| 1234567 |
- /**
- * plotly.js (cartesian - minified) v1.44.4
- * Copyright 2012-2019, Plotly, Inc.
- * All rights reserved.
- * Licensed under the MIT license
- */
- !function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Plotly=t()}}(function(){return function(){return function t(e,r,n){function a(o,l){if(!r[o]){if(!e[o]){var s="function"==typeof require&&require;if(!l&&s)return s(o,!0);if(i)return i(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[o]={exports:{}};e[o][0].call(u.exports,function(t){return a(e[o][1][t]||t)},u,u.exports,t,e,r,n)}return r[o].exports}for(var i="function"==typeof require&&require,o=0;o<n.length;o++)a(n[o]);return a}}()({1:[function(t,e,r){"use strict";var n=t("../src/lib"),a={"X,X div":"direction:ltr;font-family:'Open Sans', verdana, arial, sans-serif;margin:0;padding:0;","X input,X button":"font-family:'Open Sans', verdana, arial, sans-serif;","X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg":"overflow:hidden;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;z-index:1001;","X .ease-bg":"-webkit-transition:background-color 0.3s ease 0s;-moz-transition:background-color 0.3s ease 0s;-ms-transition:background-color 0.3s ease 0s;-o-transition:background-color 0.3s ease 0s;transition:background-color 0.3s ease 0s;","X .modebar--hover>: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;margin-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;margin-left:0px;margin-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(t,e,r){"use strict";e.exports={undo:{width:857.1,height:1e3,path:"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z",transform:"matrix(1 0 0 -1 0 850)"},home:{width:928.6,height:1e3,path:"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z",transform:"matrix(1 0 0 -1 0 850)"},"camera-retro":{width:1e3,height:1e3,path:"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z",transform:"matrix(1 0 0 -1 0 850)"},zoombox:{width:1e3,height:1e3,path:"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z",transform:"matrix(1 0 0 -1 0 850)"},pan:{width:1e3,height:1e3,path:"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z",transform:"matrix(1 0 0 -1 0 850)"},zoom_plus:{width:875,height:1e3,path:"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},zoom_minus:{width:875,height:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},autoscale:{width:1e3,height:1e3,path:"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_basic:{width:1500,height:1e3,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_compare:{width:1125,height:1e3,path:"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z",transform:"matrix(1 0 0 -1 0 850)"},plotlylogo:{width:1542,height:1e3,path:"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z",transform:"matrix(1 0 0 -1 0 850)"},"z-axis":{width:1e3,height:1e3,path:"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z",transform:"matrix(1 0 0 -1 0 850)"},"3d_rotate":{width:1e3,height:1e3,path:"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z",transform:"matrix(1 0 0 -1 0 850)"},camera:{width:1e3,height:1e3,path:"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z",transform:"matrix(1 0 0 -1 0 850)"},movie:{width:1e3,height:1e3,path:"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z",transform:"matrix(1 0 0 -1 0 850)"},question:{width:857.1,height:1e3,path:"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z",transform:"matrix(1 0 0 -1 0 850)"},disk:{width:857.1,height:1e3,path:"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z",transform:"matrix(1 0 0 -1 0 850)"},lasso:{width:1031,height:1e3,path:"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z",transform:"matrix(1 0 0 -1 0 850)"},selectbox:{width:1e3,height:1e3,path:"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z",transform:"matrix(1 0 0 -1 0 850)"},spikeline:{width:1e3,height:1e3,path:"M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z",transform:"matrix(1.5 0 0 -1.5 0 850)"},newplotlylogo:{name:"newplotlylogo",svg:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 132 132'><defs><style>.cls-1 {fill: #119dff;} .cls-2 {fill: #25fefd;} .cls-3 {fill: #fff;}</style></defs><title>plotly-logomark</title><g id='symbol'><rect class='cls-1' width='132' height='132' rx='6' ry='6'/><circle class='cls-2' cx='78' cy='54' r='6'/><circle class='cls-2' cx='102' cy='30' r='6'/><circle class='cls-2' cx='78' cy='30' r='6'/><circle class='cls-2' cx='54' cy='30' r='6'/><circle class='cls-2' cx='30' cy='30' r='6'/><circle class='cls-2' cx='30' cy='54' r='6'/><path class='cls-3' d='M30,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,30,72Z'/><path class='cls-3' d='M78,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,78,72Z'/><path class='cls-3' d='M54,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,54,48Z'/><path class='cls-3' d='M102,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,102,48Z'/></g></svg>"}}},{}],3:[function(t,e,r){"use strict";e.exports=t("../src/traces/bar")},{"../src/traces/bar":274}],4:[function(t,e,r){"use strict";e.exports=t("../src/traces/box")},{"../src/traces/box":288}],5:[function(t,e,r){"use strict";e.exports=t("../src/traces/contour")},{"../src/traces/contour":308}],6:[function(t,e,r){"use strict";e.exports=t("../src/core")},{"../src/core":151}],7:[function(t,e,r){"use strict";e.exports=t("../src/traces/heatmap")},{"../src/traces/heatmap":324}],8:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram")},{"../src/traces/histogram":342}],9:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram2d")},{"../src/traces/histogram2d":349}],10:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram2dcontour")},{"../src/traces/histogram2dcontour":353}],11:[function(t,e,r){"use strict";var n=t("./core");n.register([t("./bar"),t("./box"),t("./heatmap"),t("./histogram"),t("./histogram2d"),t("./histogram2dcontour"),t("./pie"),t("./contour"),t("./scatterternary"),t("./violin")]),e.exports=n},{"./bar":3,"./box":4,"./contour":5,"./core":6,"./heatmap":7,"./histogram":8,"./histogram2d":9,"./histogram2dcontour":10,"./pie":12,"./scatterternary":13,"./violin":14}],12:[function(t,e,r){"use strict";e.exports=t("../src/traces/pie")},{"../src/traces/pie":360}],13:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatterternary")},{"../src/traces/scatterternary":399}],14:[function(t,e,r){"use strict";e.exports=t("../src/traces/violin")},{"../src/traces/violin":407}],15:[function(t,e,r){var n=Object.create||function(t){var e=function(){};return e.prototype=t,new e},a=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return r},i=Function.prototype.bind||function(t){var e=this;return function(){return e.apply(t,arguments)}};function o(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=n(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}e.exports=o,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._maxListeners=void 0;var l,s=10;try{var c={};Object.defineProperty&&Object.defineProperty(c,"x",{value:0}),l=0===c.x}catch(t){l=!1}function u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function f(t,e,r,a){var i,o,l;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((o=t._events)?(o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),l=o[e]):(o=t._events=n(null),t._eventsCount=0),l){if("function"==typeof l?l=o[e]=a?[r,l]:[l,r]:a?l.unshift(r):l.push(r),!l.warned&&(i=u(t))&&i>0&&l.length>i){l.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+l.length+' "'+String(e)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');s.name="MaxListenersExceededWarning",s.emitter=t,s.type=e,s.count=l.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",s.name,s.message)}}else l=o[e]=r,++t._eventsCount;return t}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 t=new Array(arguments.length),e=0;e<t.length;++e)t[e]=arguments[e];this.listener.apply(this.target,t)}}function p(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},a=i.call(d,n);return a.listener=r,n.wrapFn=a,a}function h(t,e,r){var n=t._events;if(!n)return[];var a=n[e];return a?"function"==typeof a?r?[a.listener||a]:[a]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(a):v(a,a.length):[]}function g(t){var e=this._events;if(e){var r=e[t];if("function"==typeof r)return 1;if(r)return r.length}return 0}function v(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}l?Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(t){if("number"!=typeof t||t<0||t!=t)throw new TypeError('"defaultMaxListeners" must be a positive number');s=t}}):o.defaultMaxListeners=s,o.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(t){var e,r,n,a,i,o,l="error"===t;if(o=this._events)l=l&&null==o.error;else if(!l)return!1;if(l){if(arguments.length>1&&(e=arguments[1]),e instanceof Error)throw e;var s=new Error('Unhandled "error" event. ('+e+")");throw s.context=e,s}if(!(r=o[t]))return!1;var c="function"==typeof r;switch(n=arguments.length){case 1:!function(t,e,r){if(e)t.call(r);else for(var n=t.length,a=v(t,n),i=0;i<n;++i)a[i].call(r)}(r,c,this);break;case 2:!function(t,e,r,n){if(e)t.call(r,n);else for(var a=t.length,i=v(t,a),o=0;o<a;++o)i[o].call(r,n)}(r,c,this,arguments[1]);break;case 3:!function(t,e,r,n,a){if(e)t.call(r,n,a);else for(var i=t.length,o=v(t,i),l=0;l<i;++l)o[l].call(r,n,a)}(r,c,this,arguments[1],arguments[2]);break;case 4:!function(t,e,r,n,a,i){if(e)t.call(r,n,a,i);else for(var o=t.length,l=v(t,o),s=0;s<o;++s)l[s].call(r,n,a,i)}(r,c,this,arguments[1],arguments[2],arguments[3]);break;default:for(a=new Array(n-1),i=1;i<n;i++)a[i-1]=arguments[i];!function(t,e,r,n){if(e)t.apply(r,n);else for(var a=t.length,i=v(t,a),o=0;o<a;++o)i[o].apply(r,n)}(r,c,this,a)}return!0},o.prototype.addListener=function(t,e){return f(this,t,e,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(t,e){return f(this,t,e,!0)},o.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.on(t,p(this,t,e)),this},o.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.prependListener(t,p(this,t,e)),this},o.prototype.removeListener=function(t,e){var r,a,i,o,l;if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');if(!(a=this._events))return this;if(!(r=a[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=n(null):(delete a[t],a.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){l=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(var r=e,n=r+1,a=t.length;n<a;r+=1,n+=1)t[r]=t[n];t.pop()}(r,i),1===r.length&&(a[t]=r[0]),a.removeListener&&this.emit("removeListener",t,l||e)}return this},o.prototype.removeAllListeners=function(t){var e,r,i;if(!(r=this._events))return this;if(!r.removeListener)return 0===arguments.length?(this._events=n(null),this._eventsCount=0):r[t]&&(0==--this._eventsCount?this._events=n(null):delete r[t]),this;if(0===arguments.length){var o,l=a(r);for(i=0;i<l.length;++i)"removeListener"!==(o=l[i])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=n(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(e)for(i=e.length-1;i>=0;i--)this.removeListener(t,e[i]);return this},o.prototype.listeners=function(t){return h(this,t,!0)},o.prototype.rawListeners=function(t){return h(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},o.prototype.listenerCount=g,o.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],16:[function(t,e,r){!function(){var t={version:"3.5.17"},r=[].slice,n=function(t){return r.call(t)},a=this.document;function i(t){return t&&(t.ownerDocument||t.document||t).documentElement}function o(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}if(a)try{n(a.documentElement.childNodes)[0].nodeType}catch(t){n=function(t){for(var e=t.length,r=new Array(e);e--;)r[e]=t[e];return r}}if(Date.now||(Date.now=function(){return+new Date}),a)try{a.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var l=this.Element.prototype,s=l.setAttribute,c=l.setAttributeNS,u=this.CSSStyleDeclaration.prototype,f=u.setProperty;l.setAttribute=function(t,e){s.call(this,t,e+"")},l.setAttributeNS=function(t,e,r){c.call(this,t,e,r+"")},u.setProperty=function(t,e,r){f.call(this,t,e+"",r)}}function d(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function p(t){return null===t?NaN:+t}function h(t){return!isNaN(t)}function g(t){return{left:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n<a;){var i=n+a>>>1;t(e[i],r)<0?n=i+1:a=i}return n},right:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n<a;){var i=n+a>>>1;t(e[i],r)>0?a=i:n=i+1}return n}}}t.ascending=d,t.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},t.min=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a<i;)if(null!=(n=t[a])&&n>=n){r=n;break}for(;++a<i;)null!=(n=t[a])&&r>n&&(r=n)}else{for(;++a<i;)if(null!=(n=e.call(t,t[a],a))&&n>=n){r=n;break}for(;++a<i;)null!=(n=e.call(t,t[a],a))&&r>n&&(r=n)}return r},t.max=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a<i;)if(null!=(n=t[a])&&n>=n){r=n;break}for(;++a<i;)null!=(n=t[a])&&n>r&&(r=n)}else{for(;++a<i;)if(null!=(n=e.call(t,t[a],a))&&n>=n){r=n;break}for(;++a<i;)null!=(n=e.call(t,t[a],a))&&n>r&&(r=n)}return r},t.extent=function(t,e){var r,n,a,i=-1,o=t.length;if(1===arguments.length){for(;++i<o;)if(null!=(n=t[i])&&n>=n){r=a=n;break}for(;++i<o;)null!=(n=t[i])&&(r>n&&(r=n),a<n&&(a=n))}else{for(;++i<o;)if(null!=(n=e.call(t,t[i],i))&&n>=n){r=a=n;break}for(;++i<o;)null!=(n=e.call(t,t[i],i))&&(r>n&&(r=n),a<n&&(a=n))}return[r,a]},t.sum=function(t,e){var r,n=0,a=t.length,i=-1;if(1===arguments.length)for(;++i<a;)h(r=+t[i])&&(n+=r);else for(;++i<a;)h(r=+e.call(t,t[i],i))&&(n+=r);return n},t.mean=function(t,e){var r,n=0,a=t.length,i=-1,o=a;if(1===arguments.length)for(;++i<a;)h(r=p(t[i]))?n+=r:--o;else for(;++i<a;)h(r=p(e.call(t,t[i],i)))?n+=r:--o;if(o)return n/o},t.quantile=function(t,e){var r=(t.length-1)*e+1,n=Math.floor(r),a=+t[n-1],i=r-n;return i?a+i*(t[n]-a):a},t.median=function(e,r){var n,a=[],i=e.length,o=-1;if(1===arguments.length)for(;++o<i;)h(n=p(e[o]))&&a.push(n);else for(;++o<i;)h(n=p(r.call(e,e[o],o)))&&a.push(n);if(a.length)return t.quantile(a.sort(d),.5)},t.variance=function(t,e){var r,n,a=t.length,i=0,o=0,l=-1,s=0;if(1===arguments.length)for(;++l<a;)h(r=p(t[l]))&&(o+=(n=r-i)*(r-(i+=n/++s)));else for(;++l<a;)h(r=p(e.call(t,t[l],l)))&&(o+=(n=r-i)*(r-(i+=n/++s)));if(s>1)return o/(s-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var v=g(d);function y(t){return t.length}t.bisectLeft=v.left,t.bisect=t.bisectRight=v.right,t.bisector=function(t){return g(1===t.length?function(e,r){return d(t(e),r)}:t)},t.shuffle=function(t,e,r){(i=arguments.length)<3&&(r=t.length,i<2&&(e=0));for(var n,a,i=r-e;i;)a=Math.random()*i--|0,n=t[i+e],t[i+e]=t[a+e],t[a+e]=n;return t},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],a=new Array(r<0?0:r);e<r;)a[e]=[n,n=t[++e]];return a},t.transpose=function(e){if(!(i=e.length))return[];for(var r=-1,n=t.min(e,y),a=new Array(n);++r<n;)for(var i,o=-1,l=a[r]=new Array(i);++o<i;)l[o]=e[o][r];return a},t.zip=function(){return t.transpose(arguments)},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},t.merge=function(t){for(var e,r,n,a=t.length,i=-1,o=0;++i<a;)o+=t[i].length;for(r=new Array(o);--a>=0;)for(e=(n=t[a]).length;--e>=0;)r[--o]=n[e];return r};var m=Math.abs;function x(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function b(){this._=Object.create(null)}t.range=function(t,e,r){if(arguments.length<3&&(r=1,arguments.length<2&&(e=t,t=0)),(e-t)/r==1/0)throw new Error("infinite range");var n,a=[],i=function(t){var e=1;for(;t*e%1;)e*=10;return e}(m(r)),o=-1;if(t*=i,e*=i,(r*=i)<0)for(;(n=t+r*++o)>e;)a.push(n/i);else for(;(n=t+r*++o)<e;)a.push(n/i);return a},t.map=function(t,e){var r=new b;if(t instanceof b)t.forEach(function(t,e){r.set(t,e)});else if(Array.isArray(t)){var n,a=-1,i=t.length;if(1===arguments.length)for(;++a<i;)r.set(a,t[a]);else for(;++a<i;)r.set(e.call(t,n=t[a],a),n)}else for(var o in t)r.set(o,t[o]);return r};var _="__proto__",w="\0";function k(t){return(t+="")===_||t[0]===w?w+t:t}function T(t){return(t+="")[0]===w?t.slice(1):t}function M(t){return k(t)in this._}function A(t){return(t=k(t))in this._&&delete this._[t]}function L(){var t=[];for(var e in this._)t.push(T(e));return t}function S(){var t=0;for(var e in this._)++t;return t}function C(){for(var t in this._)return!1;return!0}function O(){this._=Object.create(null)}function z(t){return t}function D(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function P(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=E.length;r<n;++r){var a=E[r]+e;if(a in t)return a}}x(b,{has:M,get:function(t){return this._[k(t)]},set:function(t,e){return this._[k(t)]=e},remove:A,keys:L,values:function(){var t=[];for(var e in this._)t.push(this._[e]);return t},entries:function(){var t=[];for(var e in this._)t.push({key:T(e),value:this._[e]});return t},size:S,empty:C,forEach:function(t){for(var e in this._)t.call(this,T(e),this._[e])}}),t.nest=function(){var e,r,n={},a=[],i=[];function o(t,i,l){if(l>=a.length)return r?r.call(n,i):e?i.sort(e):i;for(var s,c,u,f,d=-1,p=i.length,h=a[l++],g=new b;++d<p;)(f=g.get(s=h(c=i[d])))?f.push(c):g.set(s,[c]);return t?(c=t(),u=function(e,r){c.set(e,o(t,r,l))}):(c={},u=function(e,r){c[e]=o(t,r,l)}),g.forEach(u),c}return n.map=function(t,e){return o(e,t,0)},n.entries=function(e){return function t(e,r){if(r>=a.length)return e;var n=[],o=i[r++];return e.forEach(function(e,a){n.push({key:e,values:t(a,r)})}),o?n.sort(function(t,e){return o(t.key,e.key)}):n}(o(t.map,e,0),0)},n.key=function(t){return a.push(t),n},n.sortKeys=function(t){return i[a.length-1]=t,n},n.sortValues=function(t){return e=t,n},n.rollup=function(t){return r=t,n},n},t.set=function(t){var e=new O;if(t)for(var r=0,n=t.length;r<n;++r)e.add(t[r]);return e},x(O,{has:M,add:function(t){return this._[k(t+="")]=!0,t},remove:A,values:L,size:S,empty:C,forEach:function(t){for(var e in this._)t.call(this,T(e))}}),t.behavior={},t.rebind=function(t,e){for(var r,n=1,a=arguments.length;++n<a;)t[r=arguments[n]]=D(t,e,e[r]);return t};var E=["webkit","ms","moz","Moz","o","O"];function R(){}function I(){}function F(t){var e=[],r=new b;function n(){for(var r,n=e,a=-1,i=n.length;++a<i;)(r=n[a].on)&&r.apply(this,arguments);return t}return n.on=function(n,a){var i,o=r.get(n);return arguments.length<2?o&&o.on:(o&&(o.on=null,e=e.slice(0,i=e.indexOf(o)).concat(e.slice(i+1)),r.remove(n)),a&&e.push(r.set(n,{on:a})),t)},n}function N(){t.event.preventDefault()}function B(){for(var e,r=t.event;e=r.sourceEvent;)r=e;return r}function j(e){for(var r=new I,n=0,a=arguments.length;++n<a;)r[arguments[n]]=F(r);return r.of=function(n,a){return function(i){try{var o=i.sourceEvent=t.event;i.target=e,t.event=i,r[i.type].apply(n,a)}finally{t.event=o}}},r}t.dispatch=function(){for(var t=new I,e=-1,r=arguments.length;++e<r;)t[arguments[e]]=F(t);return t},I.prototype.on=function(t,e){var r=t.indexOf("."),n="";if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t)return arguments.length<2?this[t].on(n):this[t].on(n,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(n,null);return this}},t.event=null,t.requote=function(t){return t.replace(H,"\\$&")};var H=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,q={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function V(t){return q(t,X),t}var U=function(t,e){return e.querySelector(t)},G=function(t,e){return e.querySelectorAll(t)},Z=function(t,e){var r=t.matches||t[P(t,"matchesSelector")];return(Z=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(U=function(t,e){return Sizzle(t,e)[0]||null},G=Sizzle,Z=Sizzle.matchesSelector),t.selection=function(){return t.select(a.documentElement)};var X=t.selection.prototype=[];function Y(t){return"function"==typeof t?t:function(){return U(t,this)}}function W(t){return"function"==typeof t?t:function(){return G(t,this)}}X.select=function(t){var e,r,n,a,i=[];t=Y(t);for(var o=-1,l=this.length;++o<l;){i.push(e=[]),e.parentNode=(n=this[o]).parentNode;for(var s=-1,c=n.length;++s<c;)(a=n[s])?(e.push(r=t.call(a,a.__data__,s,o)),r&&"__data__"in a&&(r.__data__=a.__data__)):e.push(null)}return V(i)},X.selectAll=function(t){var e,r,a=[];t=W(t);for(var i=-1,o=this.length;++i<o;)for(var l=this[i],s=-1,c=l.length;++s<c;)(r=l[s])&&(a.push(e=n(t.call(r,r.__data__,s,i))),e.parentNode=r);return V(a)};var J="http://www.w3.org/1999/xhtml",$={svg:"http://www.w3.org/2000/svg",xhtml:J,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Q(e,r){return e=t.ns.qualify(e),null==r?e.local?function(){this.removeAttributeNS(e.space,e.local)}:function(){this.removeAttribute(e)}:"function"==typeof r?e.local?function(){var t=r.apply(this,arguments);null==t?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,t)}:function(){var t=r.apply(this,arguments);null==t?this.removeAttribute(e):this.setAttribute(e,t)}:e.local?function(){this.setAttributeNS(e.space,e.local,r)}:function(){this.setAttribute(e,r)}}function K(t){return t.trim().replace(/\s+/g," ")}function tt(e){return new RegExp("(?:^|\\s+)"+t.requote(e)+"(?:\\s+|$)","g")}function et(t){return(t+"").trim().split(/^|\s+/)}function rt(t,e){var r=(t=et(t).map(nt)).length;return"function"==typeof e?function(){for(var n=-1,a=e.apply(this,arguments);++n<r;)t[n](this,a)}:function(){for(var n=-1;++n<r;)t[n](this,e)}}function nt(t){var e=tt(t);return function(r,n){if(a=r.classList)return n?a.add(t):a.remove(t);var a=r.getAttribute("class")||"";n?(e.lastIndex=0,e.test(a)||r.setAttribute("class",K(a+" "+t))):r.setAttribute("class",K(a.replace(e," ")))}}function at(t,e,r){return null==e?function(){this.style.removeProperty(t)}:"function"==typeof e?function(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}:function(){this.style.setProperty(t,e,r)}}function it(t,e){return null==e?function(){delete this[t]}:"function"==typeof e?function(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}:function(){this[t]=e}}function ot(e){return"function"==typeof e?e:(e=t.ns.qualify(e)).local?function(){return this.ownerDocument.createElementNS(e.space,e.local)}:function(){var t=this.ownerDocument,r=this.namespaceURI;return r===J&&t.documentElement.namespaceURI===J?t.createElement(e):t.createElementNS(r,e)}}function lt(){var t=this.parentNode;t&&t.removeChild(this)}function st(t){return{__data__:t}}function ct(t){return function(){return Z(this,t)}}function ut(t,e){for(var r=0,n=t.length;r<n;r++)for(var a,i=t[r],o=0,l=i.length;o<l;o++)(a=i[o])&&e(a,o,r);return t}function ft(t){return q(t,dt),t}t.ns={prefix:$,qualify:function(t){var e=t.indexOf(":"),r=t;return e>=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),$.hasOwnProperty(r)?{space:$[r],local:t}:t}},X.attr=function(e,r){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=t.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(r in e)this.each(Q(r,e[r]));return this}return this.each(Q(e,r))},X.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=et(t)).length,a=-1;if(e=r.classList){for(;++a<n;)if(!e.contains(t[a]))return!1}else for(e=r.getAttribute("class");++a<n;)if(!tt(t[a]).test(e))return!1;return!0}for(e in t)this.each(rt(e,t[e]));return this}return this.each(rt(t,e))},X.style=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){for(r in n<2&&(e=""),t)this.each(at(r,t[r],e));return this}if(n<2){var a=this.node();return o(a).getComputedStyle(a,null).getPropertyValue(t)}r=""}return this.each(at(t,e,r))},X.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(it(e,t[e]));return this}return this.each(it(t,e))},X.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},X.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},X.append=function(t){return t=ot(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},X.insert=function(t,e){return t=ot(t),e=Y(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})},X.remove=function(){return this.each(lt)},X.data=function(t,e){var r,n,a=-1,i=this.length;if(!arguments.length){for(t=new Array(i=(r=this[0]).length);++a<i;)(n=r[a])&&(t[a]=n.__data__);return t}function o(t,r){var n,a,i,o=t.length,u=r.length,f=Math.min(o,u),d=new Array(u),p=new Array(u),h=new Array(o);if(e){var g,v=new b,y=new Array(o);for(n=-1;++n<o;)(a=t[n])&&(v.has(g=e.call(a,a.__data__,n))?h[n]=a:v.set(g,a),y[n]=g);for(n=-1;++n<u;)(a=v.get(g=e.call(r,i=r[n],n)))?!0!==a&&(d[n]=a,a.__data__=i):p[n]=st(i),v.set(g,!0);for(n=-1;++n<o;)n in y&&!0!==v.get(y[n])&&(h[n]=t[n])}else{for(n=-1;++n<f;)a=t[n],i=r[n],a?(a.__data__=i,d[n]=a):p[n]=st(i);for(;n<u;++n)p[n]=st(r[n]);for(;n<o;++n)h[n]=t[n]}p.update=d,p.parentNode=d.parentNode=h.parentNode=t.parentNode,l.push(p),s.push(d),c.push(h)}var l=ft([]),s=V([]),c=V([]);if("function"==typeof t)for(;++a<i;)o(r=this[a],t.call(r,r.parentNode.__data__,a));else for(;++a<i;)o(r=this[a],t);return s.enter=function(){return l},s.exit=function(){return c},s},X.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},X.filter=function(t){var e,r,n,a=[];"function"!=typeof t&&(t=ct(t));for(var i=0,o=this.length;i<o;i++){a.push(e=[]),e.parentNode=(r=this[i]).parentNode;for(var l=0,s=r.length;l<s;l++)(n=r[l])&&t.call(n,n.__data__,l,i)&&e.push(n)}return V(a)},X.order=function(){for(var t=-1,e=this.length;++t<e;)for(var r,n=this[t],a=n.length-1,i=n[a];--a>=0;)(r=n[a])&&(i&&i!==r.nextSibling&&i.parentNode.insertBefore(r,i),i=r);return this},X.sort=function(t){t=function(t){arguments.length||(t=d);return function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}.apply(this,arguments);for(var e=-1,r=this.length;++e<r;)this[e].sort(t);return this.order()},X.each=function(t){return ut(this,function(e,r,n){t.call(e,e.__data__,r,n)})},X.call=function(t){var e=n(arguments);return t.apply(e[0]=this,e),this},X.empty=function(){return!this.node()},X.node=function(){for(var t=0,e=this.length;t<e;t++)for(var r=this[t],n=0,a=r.length;n<a;n++){var i=r[n];if(i)return i}return null},X.size=function(){var t=0;return ut(this,function(){++t}),t};var dt=[];function pt(e,r,a){var i="__on"+e,o=e.indexOf("."),l=gt;o>0&&(e=e.slice(0,o));var s=ht.get(e);function c(){var t=this[i];t&&(this.removeEventListener(e,t,t.$),delete this[i])}return s&&(e=s,l=vt),o?r?function(){var t=l(r,n(arguments));c.call(this),this.addEventListener(e,this[i]=t,t.$=a),t._=r}:c:r?R:function(){var r,n=new RegExp("^__on([^.]+)"+t.requote(e)+"$");for(var a in this)if(r=a.match(n)){var i=this[a];this.removeEventListener(r[1],i,i.$),delete this[a]}}}t.selection.enter=ft,t.selection.enter.prototype=dt,dt.append=X.append,dt.empty=X.empty,dt.node=X.node,dt.call=X.call,dt.size=X.size,dt.select=function(t){for(var e,r,n,a,i,o=[],l=-1,s=this.length;++l<s;){n=(a=this[l]).update,o.push(e=[]),e.parentNode=a.parentNode;for(var c=-1,u=a.length;++c<u;)(i=a[c])?(e.push(n[c]=r=t.call(a.parentNode,i.__data__,c,l)),r.__data__=i.__data__):e.push(null)}return V(o)},dt.insert=function(t,e){var r,n,a;return arguments.length<2&&(r=this,e=function(t,e,i){var o,l=r[i].update,s=l.length;for(i!=a&&(a=i,n=0),e>=n&&(n=e+1);!(o=l[n])&&++n<s;);return o}),X.insert.call(this,t,e)},t.select=function(t){var e;return"string"==typeof t?(e=[U(t,a)]).parentNode=a.documentElement:(e=[t]).parentNode=i(t),V([e])},t.selectAll=function(t){var e;return"string"==typeof t?(e=n(G(t,a))).parentNode=a.documentElement:(e=n(t)).parentNode=null,V([e])},X.on=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){for(r in n<2&&(e=!1),t)this.each(pt(r,t[r],e));return this}if(n<2)return(n=this.node()["__on"+t])&&n._;r=!1}return this.each(pt(t,e,r))};var ht=t.map({mouseenter:"mouseover",mouseleave:"mouseout"});function gt(e,r){return function(n){var a=t.event;t.event=n,r[0]=this.__data__;try{e.apply(this,r)}finally{t.event=a}}}function vt(t,e){var r=gt(t,e);return function(t){var e=t.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||r.call(this,t)}}a&&ht.forEach(function(t){"on"+t in a&&ht.remove(t)});var yt,mt=0;function xt(e){var r=".dragsuppress-"+ ++mt,n="click"+r,a=t.select(o(e)).on("touchmove"+r,N).on("dragstart"+r,N).on("selectstart"+r,N);if(null==yt&&(yt=!("onselectstart"in e)&&P(e.style,"userSelect")),yt){var l=i(e).style,s=l[yt];l[yt]="none"}return function(t){if(a.on(r,null),yt&&(l[yt]=s),t){var e=function(){a.on(n,null)};a.on(n,function(){N(),e()},!0),setTimeout(e,0)}}}t.mouse=function(t){return _t(t,B())};var bt=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function _t(e,r){r.changedTouches&&(r=r.changedTouches[0]);var n=e.ownerSVGElement||e;if(n.createSVGPoint){var a=n.createSVGPoint();if(bt<0){var i=o(e);if(i.scrollX||i.scrollY){var l=(n=t.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();bt=!(l.f||l.e),n.remove()}}return bt?(a.x=r.pageX,a.y=r.pageY):(a.x=r.clientX,a.y=r.clientY),[(a=a.matrixTransform(e.getScreenCTM().inverse())).x,a.y]}var s=e.getBoundingClientRect();return[r.clientX-s.left-e.clientLeft,r.clientY-s.top-e.clientTop]}function wt(){return t.event.changedTouches[0].identifier}t.touch=function(t,e,r){if(arguments.length<3&&(r=e,e=B().changedTouches),e)for(var n,a=0,i=e.length;a<i;++a)if((n=e[a]).identifier===r)return _t(t,n)},t.behavior.drag=function(){var e=j(i,"drag","dragstart","dragend"),r=null,n=l(R,t.mouse,o,"mousemove","mouseup"),a=l(wt,t.touch,z,"touchmove","touchend");function i(){this.on("mousedown.drag",n).on("touchstart.drag",a)}function l(n,a,i,o,l){return function(){var s,c=t.event.target.correspondingElement||t.event.target,u=this.parentNode,f=e.of(this,arguments),d=0,p=n(),h=".drag"+(null==p?"":"-"+p),g=t.select(i(c)).on(o+h,function(){var t,e,r=a(u,p);if(!r)return;t=r[0]-y[0],e=r[1]-y[1],d|=t|e,y=r,f({type:"drag",x:r[0]+s[0],y:r[1]+s[1],dx:t,dy:e})}).on(l+h,function(){if(!a(u,p))return;g.on(o+h,null).on(l+h,null),v(d),f({type:"dragend"})}),v=xt(c),y=a(u,p);s=r?[(s=r.apply(this,arguments)).x-y[0],s.y-y[1]]:[0,0],f({type:"dragstart"})}}return i.origin=function(t){return arguments.length?(r=t,i):r},t.rebind(i,e,"on")},t.touches=function(t,e){return arguments.length<2&&(e=B().touches),e?n(e).map(function(e){var r=_t(t,e);return r.identifier=e.identifier,r}):[]};var kt=1e-6,Tt=kt*kt,Mt=Math.PI,At=2*Mt,Lt=At-kt,St=Mt/2,Ct=Mt/180,Ot=180/Mt;function zt(t){return t>0?1:t<0?-1:0}function Dt(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function Pt(t){return t>1?0:t<-1?Mt:Math.acos(t)}function Et(t){return t>1?St:t<-1?-St:Math.asin(t)}function Rt(t){return((t=Math.exp(t))+1/t)/2}function It(t){return(t=Math.sin(t/2))*t}var Ft=Math.SQRT2;t.interpolateZoom=function(t,e){var r,n,a=t[0],i=t[1],o=t[2],l=e[0],s=e[1],c=e[2],u=l-a,f=s-i,d=u*u+f*f;if(d<Tt)n=Math.log(c/o)/Ft,r=function(t){return[a+t*u,i+t*f,o*Math.exp(Ft*t*n)]};else{var p=Math.sqrt(d),h=(c*c-o*o+4*d)/(2*o*2*p),g=(c*c-o*o-4*d)/(2*c*2*p),v=Math.log(Math.sqrt(h*h+1)-h),y=Math.log(Math.sqrt(g*g+1)-g);n=(y-v)/Ft,r=function(t){var e,r=t*n,l=Rt(v),s=o/(2*p)*(l*(e=Ft*r+v,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(v));return[a+s*u,i+s*f,o*l/Rt(Ft*r+v)]}}return r.duration=1e3*n,r},t.behavior.zoom=function(){var e,r,n,i,l,s,c,u,f,d={x:0,y:0,k:1},p=[960,500],h=jt,g=250,v=0,y="mousedown.zoom",m="mousemove.zoom",x="mouseup.zoom",b="touchstart.zoom",_=j(w,"zoomstart","zoom","zoomend");function w(t){t.on(y,z).on(Bt+".zoom",P).on("dblclick.zoom",E).on(b,D)}function k(t){return[(t[0]-d.x)/d.k,(t[1]-d.y)/d.k]}function T(t){d.k=Math.max(h[0],Math.min(h[1],t))}function M(t,e){e=function(t){return[t[0]*d.k+d.x,t[1]*d.k+d.y]}(e),d.x+=t[0]-e[0],d.y+=t[1]-e[1]}function A(e,n,a,i){e.__chart__={x:d.x,y:d.y,k:d.k},T(Math.pow(2,i)),M(r=n,a),e=t.select(e),g>0&&(e=e.transition().duration(g)),e.call(w.event)}function L(){c&&c.domain(s.range().map(function(t){return(t-d.x)/d.k}).map(s.invert)),f&&f.domain(u.range().map(function(t){return(t-d.y)/d.k}).map(u.invert))}function S(t){v++||t({type:"zoomstart"})}function C(t){L(),t({type:"zoom",scale:d.k,translate:[d.x,d.y]})}function O(t){--v||(t({type:"zoomend"}),r=null)}function z(){var e=this,r=_.of(e,arguments),n=0,a=t.select(o(e)).on(m,function(){n=1,M(t.mouse(e),i),C(r)}).on(x,function(){a.on(m,null).on(x,null),l(n),O(r)}),i=k(t.mouse(e)),l=xt(e);fl.call(e),S(r)}function D(){var e,r=this,n=_.of(r,arguments),a={},i=0,o=".zoom-"+t.event.changedTouches[0].identifier,s="touchmove"+o,c="touchend"+o,u=[],f=t.select(r),p=xt(r);function h(){var n=t.touches(r);return e=d.k,n.forEach(function(t){t.identifier in a&&(a[t.identifier]=k(t))}),n}function g(){var e=t.event.target;t.select(e).on(s,v).on(c,m),u.push(e);for(var n=t.event.changedTouches,o=0,f=n.length;o<f;++o)a[n[o].identifier]=null;var p=h(),g=Date.now();if(1===p.length){if(g-l<500){var y=p[0];A(r,y,a[y.identifier],Math.floor(Math.log(d.k)/Math.LN2)+1),N()}l=g}else if(p.length>1){y=p[0];var x=p[1],b=y[0]-x[0],_=y[1]-x[1];i=b*b+_*_}}function v(){var o,s,c,u,f=t.touches(r);fl.call(r);for(var d=0,p=f.length;d<p;++d,u=null)if(c=f[d],u=a[c.identifier]){if(s)break;o=c,s=u}if(u){var h=(h=c[0]-o[0])*h+(h=c[1]-o[1])*h,g=i&&Math.sqrt(h/i);o=[(o[0]+c[0])/2,(o[1]+c[1])/2],s=[(s[0]+u[0])/2,(s[1]+u[1])/2],T(g*e)}l=null,M(o,s),C(n)}function m(){if(t.event.touches.length){for(var e=t.event.changedTouches,r=0,i=e.length;r<i;++r)delete a[e[r].identifier];for(var l in a)return void h()}t.selectAll(u).on(o,null),f.on(y,z).on(b,D),p(),O(n)}g(),S(n),f.on(y,null).on(b,g)}function P(){var a=_.of(this,arguments);i?clearTimeout(i):(fl.call(this),e=k(r=n||t.mouse(this)),S(a)),i=setTimeout(function(){i=null,O(a)},50),N(),T(Math.pow(2,.002*Nt())*d.k),M(r,e),C(a)}function E(){var e=t.mouse(this),r=Math.log(d.k)/Math.LN2;A(this,e,k(e),t.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}return Bt||(Bt="onwheel"in a?(Nt=function(){return-t.event.deltaY*(t.event.deltaMode?120:1)},"wheel"):"onmousewheel"in a?(Nt=function(){return t.event.wheelDelta},"mousewheel"):(Nt=function(){return-t.event.detail},"MozMousePixelScroll")),w.event=function(e){e.each(function(){var e=_.of(this,arguments),n=d;hl?t.select(this).transition().each("start.zoom",function(){d=this.__chart__||{x:0,y:0,k:1},S(e)}).tween("zoom:zoom",function(){var a=p[0],i=p[1],o=r?r[0]:a/2,l=r?r[1]:i/2,s=t.interpolateZoom([(o-d.x)/d.k,(l-d.y)/d.k,a/d.k],[(o-n.x)/n.k,(l-n.y)/n.k,a/n.k]);return function(t){var r=s(t),n=a/r[2];this.__chart__=d={x:o-r[0]*n,y:l-r[1]*n,k:n},C(e)}}).each("interrupt.zoom",function(){O(e)}).each("end.zoom",function(){O(e)}):(this.__chart__=d,S(e),C(e),O(e))})},w.translate=function(t){return arguments.length?(d={x:+t[0],y:+t[1],k:d.k},L(),w):[d.x,d.y]},w.scale=function(t){return arguments.length?(d={x:d.x,y:d.y,k:null},T(+t),L(),w):d.k},w.scaleExtent=function(t){return arguments.length?(h=null==t?jt:[+t[0],+t[1]],w):h},w.center=function(t){return arguments.length?(n=t&&[+t[0],+t[1]],w):n},w.size=function(t){return arguments.length?(p=t&&[+t[0],+t[1]],w):p},w.duration=function(t){return arguments.length?(g=+t,w):g},w.x=function(t){return arguments.length?(c=t,s=t.copy(),d={x:0,y:0,k:1},w):c},w.y=function(t){return arguments.length?(f=t,u=t.copy(),d={x:0,y:0,k:1},w):f},t.rebind(w,_,"on")};var Nt,Bt,jt=[0,1/0];function Ht(){}function qt(t,e,r){return this instanceof qt?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof qt?new qt(t.h,t.s,t.l):ue(""+t,fe,qt):new qt(t,e,r)}t.color=Ht,Ht.prototype.toString=function(){return this.rgb()+""},t.hsl=qt;var Vt=qt.prototype=new Ht;function Ut(t,e,r){var n,a;function i(t){return Math.round(255*function(t){return t>360?t-=360:t<0&&(t+=360),t<60?n+(a-n)*t/60:t<180?a:t<240?n+(a-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(a=r<=.5?r*(1+e):r+e-r*e),new ie(i(t+120),i(t),i(t-120))}function Gt(e,r,n){return this instanceof Gt?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Gt?new Gt(e.h,e.c,e.l):ee(e instanceof Yt?e.l:(e=de((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Gt(e,r,n)}Vt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new qt(this.h,this.s,this.l/t)},Vt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new qt(this.h,this.s,t*this.l)},Vt.rgb=function(){return Ut(this.h,this.s,this.l)},t.hcl=Gt;var Zt=Gt.prototype=new Ht;function Xt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Yt(r,Math.cos(t*=Ct)*e,Math.sin(t)*e)}function Yt(t,e,r){return this instanceof Yt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Yt?new Yt(t.l,t.a,t.b):t instanceof Gt?Xt(t.h,t.c,t.l):de((t=ie(t)).r,t.g,t.b):new Yt(t,e,r)}Zt.brighter=function(t){return new Gt(this.h,this.c,Math.min(100,this.l+Wt*(arguments.length?t:1)))},Zt.darker=function(t){return new Gt(this.h,this.c,Math.max(0,this.l-Wt*(arguments.length?t:1)))},Zt.rgb=function(){return Xt(this.h,this.c,this.l).rgb()},t.lab=Yt;var Wt=18,Jt=.95047,$t=1,Qt=1.08883,Kt=Yt.prototype=new Ht;function te(t,e,r){var n=(t+16)/116,a=n+e/500,i=n-r/200;return new ie(ae(3.2404542*(a=re(a)*Jt)-1.5371385*(n=re(n)*$t)-.4985314*(i=re(i)*Qt)),ae(-.969266*a+1.8760108*n+.041556*i),ae(.0556434*a-.2040259*n+1.0572252*i))}function ee(t,e,r){return t>0?new Gt(Math.atan2(r,e)*Ot,Math.sqrt(e*e+r*r),t):new Gt(NaN,NaN,t)}function re(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ne(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function ae(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function ie(t,e,r){return this instanceof ie?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof ie?new ie(t.r,t.g,t.b):ue(""+t,ie,Ut):new ie(t,e,r)}function oe(t){return new ie(t>>16,t>>8&255,255&t)}function le(t){return oe(t)+""}Kt.brighter=function(t){return new Yt(Math.min(100,this.l+Wt*(arguments.length?t:1)),this.a,this.b)},Kt.darker=function(t){return new Yt(Math.max(0,this.l-Wt*(arguments.length?t:1)),this.a,this.b)},Kt.rgb=function(){return te(this.l,this.a,this.b)},t.rgb=ie;var se=ie.prototype=new Ht;function ce(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function ue(t,e,r){var n,a,i,o=0,l=0,s=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(a=n[2].split(","),n[1]){case"hsl":return r(parseFloat(a[0]),parseFloat(a[1])/100,parseFloat(a[2])/100);case"rgb":return e(he(a[0]),he(a[1]),he(a[2]))}return(i=ge.get(t))?e(i.r,i.g,i.b):(null==t||"#"!==t.charAt(0)||isNaN(i=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&i)>>4,o|=o>>4,l=240&i,l|=l>>4,s=15&i,s|=s<<4):7===t.length&&(o=(16711680&i)>>16,l=(65280&i)>>8,s=255&i)),e(o,l,s))}function fe(t,e,r){var n,a,i=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),l=o-i,s=(o+i)/2;return l?(a=s<.5?l/(o+i):l/(2-o-i),n=t==o?(e-r)/l+(e<r?6:0):e==o?(r-t)/l+2:(t-e)/l+4,n*=60):(n=NaN,a=s>0&&s<1?0:n),new qt(n,a,s)}function de(t,e,r){var n=ne((.4124564*(t=pe(t))+.3575761*(e=pe(e))+.1804375*(r=pe(r)))/Jt),a=ne((.2126729*t+.7151522*e+.072175*r)/$t);return Yt(116*a-16,500*(n-a),200*(a-ne((.0193339*t+.119192*e+.9503041*r)/Qt)))}function pe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function he(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}se.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,a=30;return e||r||n?(e&&e<a&&(e=a),r&&r<a&&(r=a),n&&n<a&&(n=a),new ie(Math.min(255,e/t),Math.min(255,r/t),Math.min(255,n/t))):new ie(a,a,a)},se.darker=function(t){return new ie((t=Math.pow(.7,arguments.length?t:1))*this.r,t*this.g,t*this.b)},se.hsl=function(){return fe(this.r,this.g,this.b)},se.toString=function(){return"#"+ce(this.r)+ce(this.g)+ce(this.b)};var ge=t.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});function ve(t){return"function"==typeof t?t:function(){return t}}function ye(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),me(e,r,t,n)}}function me(e,r,a,i){var o={},l=t.dispatch("beforesend","progress","load","error"),s={},c=new XMLHttpRequest,u=null;function f(){var t,e=c.status;if(!e&&function(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}(c)||e>=200&&e<300||304===e){try{t=a.call(o,c)}catch(t){return void l.error.call(o,t)}l.load.call(o,t)}else l.error.call(o,c)}return!this.XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(e)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=f:c.onreadystatechange=function(){c.readyState>3&&f()},c.onprogress=function(e){var r=t.event;t.event=e;try{l.progress.call(o,c)}finally{t.event=r}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?s[t]:(null==e?delete s[t]:s[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(r=null==t?null:t+"",o):r},o.responseType=function(t){return arguments.length?(u=t,o):u},o.response=function(t){return a=t,o},["get","post"].forEach(function(t){o[t]=function(){return o.send.apply(o,[t].concat(n(arguments)))}}),o.send=function(t,n,a){if(2===arguments.length&&"function"==typeof n&&(a=n,n=null),c.open(t,e,!0),null==r||"accept"in s||(s.accept=r+",*/*"),c.setRequestHeader)for(var i in s)c.setRequestHeader(i,s[i]);return null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=u&&(c.responseType=u),null!=a&&o.on("error",a).on("load",function(t){a(null,t)}),l.beforesend.call(o,c),c.send(null==n?null:n),o},o.abort=function(){return c.abort(),o},t.rebind(o,l,"on"),null==i?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(i))}ge.forEach(function(t,e){ge.set(t,oe(e))}),t.functor=ve,t.xhr=ye(z),t.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function a(t,r,n){arguments.length<3&&(n=r,r=null);var a=me(t,e,null==r?i:o(r),n);return a.row=function(t){return arguments.length?a.response(null==(r=t)?i:o(t)):r},a}function i(t){return a.parse(t.responseText)}function o(t){return function(e){return a.parse(e.responseText,t)}}function l(e){return e.map(s).join(t)}function s(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return a.parse=function(t,e){var r;return a.parseRows(t,function(t,n){if(r)return r(t,n-1);var a=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");r=e?function(t,r){return e(a(t),r)}:a})},a.parseRows=function(t,e){var r,a,i={},o={},l=[],s=t.length,c=0,u=0;function f(){if(c>=s)return o;if(a)return a=!1,i;var e=c;if(34===t.charCodeAt(e)){for(var r=e;r++<s;)if(34===t.charCodeAt(r)){if(34!==t.charCodeAt(r+1))break;++r}return c=r+2,13===(l=t.charCodeAt(r+1))?(a=!0,10===t.charCodeAt(r+2)&&++c):10===l&&(a=!0),t.slice(e+1,r).replace(/""/g,'"')}for(;c<s;){var l,u=1;if(10===(l=t.charCodeAt(c++)))a=!0;else if(13===l)a=!0,10===t.charCodeAt(c)&&(++c,++u);else if(l!==n)continue;return t.slice(e,c-u)}return t.slice(e)}for(;(r=f())!==o;){for(var d=[];r!==i&&r!==o;)d.push(r),r=f();e&&null==(d=e(d,u++))||l.push(d)}return l},a.format=function(e){if(Array.isArray(e[0]))return a.formatRows(e);var r=new O,n=[];return e.forEach(function(t){for(var e in t)r.has(e)||n.push(r.add(e))}),[n.map(s).join(t)].concat(e.map(function(e){return n.map(function(t){return s(e[t])}).join(t)})).join("\n")},a.formatRows=function(t){return t.map(l).join("\n")},a},t.csv=t.dsv(",","text/csv"),t.tsv=t.dsv("\t","text/tab-separated-values");var xe,be,_e,we,ke=this[P(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};function Te(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var a={c:t,t:r+e,n:null};return be?be.n=a:xe=a,be=a,_e||(we=clearTimeout(we),_e=1,ke(Me)),a}function Me(){var t=Ae(),e=Le()-t;e>24?(isFinite(e)&&(clearTimeout(we),we=setTimeout(Me,e)),_e=0):(_e=1,ke(Me))}function Ae(){for(var t=Date.now(),e=xe;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Le(){for(var t,e=xe,r=1/0;e;)e.c?(e.t<r&&(r=e.t),e=(t=e).n):e=t?t.n=e.n:xe=e.n;return be=t,r}function Se(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}t.timer=function(){Te.apply(this,arguments)},t.timer.flush=function(){Ae(),Le()},t.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var Ce=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(function(t,e){var r=Math.pow(10,3*m(8-e));return{scale:e>8?function(t){return t/r}:function(t){return t*r},symbol:t}});t.formatPrefix=function(e,r){var n=0;return(e=+e)&&(e<0&&(e*=-1),r&&(e=t.round(e,Se(e,r))),n=1+Math.floor(1e-12+Math.log(e)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),Ce[8+n/3]};var Oe=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,ze=t.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(e,r){return(e=t.round(e,Se(e,r))).toFixed(Math.max(0,Math.min(20,Se(e*(1+1e-15),r))))}});function De(t){return t+""}var Pe=t.time={},Ee=Date;function Re(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}Re.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){Ie.setUTCDate.apply(this._,arguments)},setDay:function(){Ie.setUTCDay.apply(this._,arguments)},setFullYear:function(){Ie.setUTCFullYear.apply(this._,arguments)},setHours:function(){Ie.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Ie.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Ie.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Ie.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Ie.setUTCSeconds.apply(this._,arguments)},setTime:function(){Ie.setTime.apply(this._,arguments)}};var Ie=Date.prototype;function Fe(t,e,r){function n(e){var r=t(e),n=i(r,1);return e-r<n-e?r:n}function a(r){return e(r=t(new Ee(r-1)),1),r}function i(t,r){return e(t=new Ee(+t),r),t}function o(t,n,i){var o=a(t),l=[];if(i>1)for(;o<n;)r(o)%i||l.push(new Date(+o)),e(o,1);else for(;o<n;)l.push(new Date(+o)),e(o,1);return l}t.floor=t,t.round=n,t.ceil=a,t.offset=i,t.range=o;var l=t.utc=Ne(t);return l.floor=l,l.round=Ne(n),l.ceil=Ne(a),l.offset=Ne(i),l.range=function(t,e,r){try{Ee=Re;var n=new Re;return n._=t,o(n,e,r)}finally{Ee=Date}},t}function Ne(t){return function(e,r){try{Ee=Re;var n=new Re;return n._=e,t(n,r)._}finally{Ee=Date}}}Pe.year=Fe(function(t){return(t=Pe.day(t)).setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),Pe.years=Pe.year.range,Pe.years.utc=Pe.year.utc.range,Pe.day=Fe(function(t){var e=new Ee(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),Pe.days=Pe.day.range,Pe.days.utc=Pe.day.utc.range,Pe.dayOfYear=function(t){var e=Pe.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var r=Pe[t]=Fe(function(t){return(t=Pe.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var r=Pe.year(t).getDay();return Math.floor((Pe.dayOfYear(t)+(r+e)%7)/7)-(r!==e)});Pe[t+"s"]=r.range,Pe[t+"s"].utc=r.utc.range,Pe[t+"OfYear"]=function(t){var r=Pe.year(t).getDay();return Math.floor((Pe.dayOfYear(t)+(r+e)%7)/7)}}),Pe.week=Pe.sunday,Pe.weeks=Pe.sunday.range,Pe.weeks.utc=Pe.sunday.utc.range,Pe.weekOfYear=Pe.sundayOfYear;var Be={"-":"",_:" ",0:"0"},je=/^\s*\d+/,He=/^%/;function qe(t,e,r){var n=t<0?"-":"",a=(n?-t:t)+"",i=a.length;return n+(i<r?new Array(r-i+1).join(e)+a:a)}function Ve(e){return new RegExp("^(?:"+e.map(t.requote).join("|")+")","i")}function Ue(t){for(var e=new b,r=-1,n=t.length;++r<n;)e.set(t[r].toLowerCase(),r);return e}function Ge(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function Ze(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r));return n?(t.U=+n[0],r+n[0].length):-1}function Xe(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r));return n?(t.W=+n[0],r+n[0].length):-1}function Ye(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function We(t,e,r){je.lastIndex=0;var n,a=je.exec(e.slice(r,r+2));return a?(t.y=(n=+a[0])+(n>68?1900:2e3),r+a[0].length):-1}function Je(t,e,r){return/^[+-]\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function $e(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Qe(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function Ke(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function tr(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function er(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function rr(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function nr(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function ar(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=m(e)/60|0,a=m(e)%60;return r+qe(n,"0",2)+qe(a,"0",2)}function ir(t,e,r){He.lastIndex=0;var n=He.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function or(t){for(var e=t.length,r=-1;++r<e;)t[r][0]=this(t[r][0]);return function(e){for(var r=0,n=t[r];!n[1](e);)n=t[++r];return n[0](e)}}t.locale=function(e){return{numberFormat:function(e){var r=e.decimal,n=e.thousands,a=e.grouping,i=e.currency,o=a&&n?function(t,e){for(var r=t.length,i=[],o=0,l=a[0],s=0;r>0&&l>0&&(s+l+1>e&&(l=Math.max(1,e-s)),i.push(t.substring(r-=l,r+l)),!((s+=l+1)>e));)l=a[o=(o+1)%a.length];return i.reverse().join(n)}:z;return function(e){var n=Oe.exec(e),a=n[1]||" ",l=n[2]||">",s=n[3]||"-",c=n[4]||"",u=n[5],f=+n[6],d=n[7],p=n[8],h=n[9],g=1,v="",y="",m=!1,x=!0;switch(p&&(p=+p.substring(1)),(u||"0"===a&&"="===l)&&(u=a="0",l="="),h){case"n":d=!0,h="g";break;case"%":g=100,y="%",h="f";break;case"p":g=100,y="%",h="r";break;case"b":case"o":case"x":case"X":"#"===c&&(v="0"+h.toLowerCase());case"c":x=!1;case"d":m=!0,p=0;break;case"s":g=-1,h="r"}"$"===c&&(v=i[0],y=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=ze.get(h)||De;var b=u&&d;return function(e){var n=y;if(m&&e%1)return"";var i=e<0||0===e&&1/e<0?(e=-e,"-"):"-"===s?"":s;if(g<0){var c=t.formatPrefix(e,p);e=c.scale(e),n=c.symbol+y}else e*=g;var _,w,k=(e=h(e,p)).lastIndexOf(".");if(k<0){var T=x?e.lastIndexOf("e"):-1;T<0?(_=e,w=""):(_=e.substring(0,T),w=e.substring(T))}else _=e.substring(0,k),w=r+e.substring(k+1);!u&&d&&(_=o(_,1/0));var M=v.length+_.length+w.length+(b?0:i.length),A=M<f?new Array(M=f-M+1).join(a):"";return b&&(_=o(A+_,A.length?f-w.length:1/0)),i+=v,e=_+w,("<"===l?i+e+A:">"===l?A+i+e:"^"===l?A.substring(0,M>>=1)+i+e+A.substring(M):i+(b?e:A+e))+n}}}(e),timeFormat:function(e){var r=e.dateTime,n=e.date,a=e.time,i=e.periods,o=e.days,l=e.shortDays,s=e.months,c=e.shortMonths;function u(t){var e=t.length;function r(r){for(var n,a,i,o=[],l=-1,s=0;++l<e;)37===t.charCodeAt(l)&&(o.push(t.slice(s,l)),null!=(a=Be[n=t.charAt(++l)])&&(n=t.charAt(++l)),(i=_[n])&&(n=i(r,null==a?"e"===n?" ":"0":a)),o.push(n),s=l+1);return o.push(t.slice(s,l)),o.join("")}return r.parse=function(e){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null};if(f(r,t,e,0)!=e.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var n=null!=r.Z&&Ee!==Re,a=new(n?Re:Ee);return"j"in r?a.setFullYear(r.y,0,r.j):"W"in r||"U"in r?("w"in r||(r.w="W"in r?1:0),a.setFullYear(r.y,0,1),a.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(a.getDay()+5)%7:r.w+7*r.U-(a.getDay()+6)%7)):a.setFullYear(r.y,r.m,r.d),a.setHours(r.H+(r.Z/100|0),r.M+r.Z%100,r.S,r.L),n?a._:a},r.toString=function(){return t},r}function f(t,e,r,n){for(var a,i,o,l=0,s=e.length,c=r.length;l<s;){if(n>=c)return-1;if(37===(a=e.charCodeAt(l++))){if(o=e.charAt(l++),!(i=w[o in Be?e.charAt(l++):o])||(n=i(t,r,n))<0)return-1}else if(a!=r.charCodeAt(n++))return-1}return n}u.utc=function(t){var e=u(t);function r(t){try{var r=new(Ee=Re);return r._=t,e(r)}finally{Ee=Date}}return r.parse=function(t){try{Ee=Re;var r=e.parse(t);return r&&r._}finally{Ee=Date}},r.toString=e.toString,r},u.multi=u.utc.multi=or;var d=t.map(),p=Ve(o),h=Ue(o),g=Ve(l),v=Ue(l),y=Ve(s),m=Ue(s),x=Ve(c),b=Ue(c);i.forEach(function(t,e){d.set(t.toLowerCase(),e)});var _={a:function(t){return l[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:u(r),d:function(t,e){return qe(t.getDate(),e,2)},e:function(t,e){return qe(t.getDate(),e,2)},H:function(t,e){return qe(t.getHours(),e,2)},I:function(t,e){return qe(t.getHours()%12||12,e,2)},j:function(t,e){return qe(1+Pe.dayOfYear(t),e,3)},L:function(t,e){return qe(t.getMilliseconds(),e,3)},m:function(t,e){return qe(t.getMonth()+1,e,2)},M:function(t,e){return qe(t.getMinutes(),e,2)},p:function(t){return i[+(t.getHours()>=12)]},S:function(t,e){return qe(t.getSeconds(),e,2)},U:function(t,e){return qe(Pe.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return qe(Pe.mondayOfYear(t),e,2)},x:u(n),X:u(a),y:function(t,e){return qe(t.getFullYear()%100,e,2)},Y:function(t,e){return qe(t.getFullYear()%1e4,e,4)},Z:ar,"%":function(){return"%"}},w={a:function(t,e,r){g.lastIndex=0;var n=g.exec(e.slice(r));return n?(t.w=v.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(t,e,r){p.lastIndex=0;var n=p.exec(e.slice(r));return n?(t.w=h.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(t,e,r){x.lastIndex=0;var n=x.exec(e.slice(r));return n?(t.m=b.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(t,e,r){y.lastIndex=0;var n=y.exec(e.slice(r));return n?(t.m=m.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(t,e,r){return f(t,_.c.toString(),e,r)},d:Qe,e:Qe,H:tr,I:tr,j:Ke,L:nr,m:$e,M:er,p:function(t,e,r){var n=d.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)},S:rr,U:Ze,w:Ge,W:Xe,x:function(t,e,r){return f(t,_.x.toString(),e,r)},X:function(t,e,r){return f(t,_.X.toString(),e,r)},y:We,Y:Ye,Z:Je,"%":ir};return u}(e)}};var lr=t.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function sr(){}t.format=lr.numberFormat,t.geo={},sr.prototype={s:0,t:0,add:function(t){ur(t,this.t,cr),ur(cr.s,this.s,this),this.s?this.t+=cr.t:this.s=cr.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var cr=new sr;function ur(t,e,r){var n=r.s=t+e,a=n-t,i=n-a;r.t=t-i+(e-a)}function fr(t,e){t&&pr.hasOwnProperty(t.type)&&pr[t.type](t,e)}t.geo.stream=function(t,e){t&&dr.hasOwnProperty(t.type)?dr[t.type](t,e):fr(t,e)};var dr={Feature:function(t,e){fr(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,a=r.length;++n<a;)fr(r[n].geometry,e)}},pr={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var r=t.coordinates,n=-1,a=r.length;++n<a;)t=r[n],e.point(t[0],t[1],t[2])},LineString:function(t,e){hr(t.coordinates,e,0)},MultiLineString:function(t,e){for(var r=t.coordinates,n=-1,a=r.length;++n<a;)hr(r[n],e,0)},Polygon:function(t,e){gr(t.coordinates,e)},MultiPolygon:function(t,e){for(var r=t.coordinates,n=-1,a=r.length;++n<a;)gr(r[n],e)},GeometryCollection:function(t,e){for(var r=t.geometries,n=-1,a=r.length;++n<a;)fr(r[n],e)}};function hr(t,e,r){var n,a=-1,i=t.length-r;for(e.lineStart();++a<i;)n=t[a],e.point(n[0],n[1],n[2]);e.lineEnd()}function gr(t,e){var r=-1,n=t.length;for(e.polygonStart();++r<n;)hr(t[r],e,1);e.polygonEnd()}t.geo.area=function(e){return vr=0,t.geo.stream(e,Cr),vr};var vr,yr,mr,xr,br,_r,wr,kr,Tr,Mr,Ar,Lr,Sr=new sr,Cr={sphere:function(){vr+=4*Mt},point:R,lineStart:R,lineEnd:R,polygonStart:function(){Sr.reset(),Cr.lineStart=Or},polygonEnd:function(){var t=2*Sr;vr+=t<0?4*Mt+t:t,Cr.lineStart=Cr.lineEnd=Cr.point=R}};function Or(){var t,e,r,n,a;function i(t,e){e=e*Ct/2+Mt/4;var i=(t*=Ct)-r,o=i>=0?1:-1,l=o*i,s=Math.cos(e),c=Math.sin(e),u=a*c,f=n*s+u*Math.cos(l),d=u*o*Math.sin(l);Sr.add(Math.atan2(d,f)),r=t,n=s,a=c}Cr.point=function(o,l){Cr.point=i,r=(t=o)*Ct,n=Math.cos(l=(e=l)*Ct/2+Mt/4),a=Math.sin(l)},Cr.lineEnd=function(){i(t,e)}}function zr(t){var e=t[0],r=t[1],n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function Dr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Pr(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Er(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Rr(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Ir(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Fr(t){return[Math.atan2(t[1],t[0]),Et(t[2])]}function Nr(t,e){return m(t[0]-e[0])<kt&&m(t[1]-e[1])<kt}t.geo.bounds=function(){var e,r,n,a,i,o,l,s,c,u,f,d={point:p,lineStart:g,lineEnd:v,polygonStart:function(){d.point=y,d.lineStart=x,d.lineEnd=b,c=0,Cr.polygonStart()},polygonEnd:function(){Cr.polygonEnd(),d.point=p,d.lineStart=g,d.lineEnd=v,Sr<0?(e=-(n=180),r=-(a=90)):c>kt?a=90:c<-kt&&(r=-90),f[0]=e,f[1]=n}};function p(t,i){u.push(f=[e=t,n=t]),i<r&&(r=i),i>a&&(a=i)}function h(t,o){var l=zr([t*Ct,o*Ct]);if(s){var c=Pr(s,l),u=Pr([c[1],-c[0],0],c);Ir(u),u=Fr(u);var f=t-i,d=f>0?1:-1,h=u[0]*Ot*d,g=m(f)>180;if(g^(d*i<h&&h<d*t))(v=u[1]*Ot)>a&&(a=v);else if(g^(d*i<(h=(h+360)%360-180)&&h<d*t)){var v;(v=-u[1]*Ot)<r&&(r=v)}else o<r&&(r=o),o>a&&(a=o);g?t<i?_(e,t)>_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t):n>=e?(t<e&&(e=t),t>n&&(n=t)):t>i?_(e,t)>_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t)}else p(t,o);s=l,i=t}function g(){d.point=h}function v(){f[0]=e,f[1]=n,d.point=p,s=null}function y(t,e){if(s){var r=t-i;c+=m(r)>180?r+(r>0?360:-360):r}else o=t,l=e;Cr.point(t,e),h(t,e)}function x(){Cr.lineStart()}function b(){y(o,l),Cr.lineEnd(),m(c)>kt&&(e=-(n=180)),f[0]=e,f[1]=n,s=null}function _(t,e){return(e-=t)<0?e+360:e}function w(t,e){return t[0]-e[0]}function k(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}return function(i){if(a=n=-(e=r=1/0),u=[],t.geo.stream(i,d),c=u.length){u.sort(w);for(var o=1,l=[g=u[0]];o<c;++o)k((p=u[o])[0],g)||k(p[1],g)?(_(g[0],p[1])>_(g[0],g[1])&&(g[1]=p[1]),_(p[0],g[1])>_(g[0],g[1])&&(g[0]=p[0])):l.push(g=p);for(var s,c,p,h=-1/0,g=(o=0,l[c=l.length-1]);o<=c;g=p,++o)p=l[o],(s=_(g[1],p[0]))>h&&(h=s,e=p[0],n=g[1])}return u=f=null,e===1/0||r===1/0?[[NaN,NaN],[NaN,NaN]]:[[e,r],[n,a]]}}(),t.geo.centroid=function(e){yr=mr=xr=br=_r=wr=kr=Tr=Mr=Ar=Lr=0,t.geo.stream(e,Br);var r=Mr,n=Ar,a=Lr,i=r*r+n*n+a*a;return i<Tt&&(r=wr,n=kr,a=Tr,mr<kt&&(r=xr,n=br,a=_r),(i=r*r+n*n+a*a)<Tt)?[NaN,NaN]:[Math.atan2(n,r)*Ot,Et(a/Math.sqrt(i))*Ot]};var Br={sphere:R,point:jr,lineStart:qr,lineEnd:Vr,polygonStart:function(){Br.lineStart=Ur},polygonEnd:function(){Br.lineStart=qr}};function jr(t,e){t*=Ct;var r=Math.cos(e*=Ct);Hr(r*Math.cos(t),r*Math.sin(t),Math.sin(e))}function Hr(t,e,r){xr+=(t-xr)/++yr,br+=(e-br)/yr,_r+=(r-_r)/yr}function qr(){var t,e,r;function n(n,a){n*=Ct;var i=Math.cos(a*=Ct),o=i*Math.cos(n),l=i*Math.sin(n),s=Math.sin(a),c=Math.atan2(Math.sqrt((c=e*s-r*l)*c+(c=r*o-t*s)*c+(c=t*l-e*o)*c),t*o+e*l+r*s);mr+=c,wr+=c*(t+(t=o)),kr+=c*(e+(e=l)),Tr+=c*(r+(r=s)),Hr(t,e,r)}Br.point=function(a,i){a*=Ct;var o=Math.cos(i*=Ct);t=o*Math.cos(a),e=o*Math.sin(a),r=Math.sin(i),Br.point=n,Hr(t,e,r)}}function Vr(){Br.point=jr}function Ur(){var t,e,r,n,a;function i(t,e){t*=Ct;var i=Math.cos(e*=Ct),o=i*Math.cos(t),l=i*Math.sin(t),s=Math.sin(e),c=n*s-a*l,u=a*o-r*s,f=r*l-n*o,d=Math.sqrt(c*c+u*u+f*f),p=r*o+n*l+a*s,h=d&&-Pt(p)/d,g=Math.atan2(d,p);Mr+=h*c,Ar+=h*u,Lr+=h*f,mr+=g,wr+=g*(r+(r=o)),kr+=g*(n+(n=l)),Tr+=g*(a+(a=s)),Hr(r,n,a)}Br.point=function(o,l){t=o,e=l,Br.point=i,o*=Ct;var s=Math.cos(l*=Ct);r=s*Math.cos(o),n=s*Math.sin(o),a=Math.sin(l),Hr(r,n,a)},Br.lineEnd=function(){i(t,e),Br.lineEnd=Vr,Br.point=jr}}function Gr(t,e){function r(r,n){return r=t(r,n),e(r[0],r[1])}return t.invert&&e.invert&&(r.invert=function(r,n){return(r=e.invert(r,n))&&t.invert(r[0],r[1])}),r}function Zr(){return!0}function Xr(t,e,r,n,a){var i=[],o=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,r=t[0],n=t[e];if(Nr(r,n)){a.lineStart();for(var l=0;l<e;++l)a.point((r=t[l])[0],r[1]);a.lineEnd()}else{var s=new Wr(r,t,null,!0),c=new Wr(r,null,s,!1);s.o=c,i.push(s),o.push(c),s=new Wr(n,t,null,!1),c=new Wr(n,null,s,!0),s.o=c,i.push(s),o.push(c)}}}),o.sort(e),Yr(i),Yr(o),i.length){for(var l=0,s=r,c=o.length;l<c;++l)o[l].e=s=!s;for(var u,f,d=i[0];;){for(var p=d,h=!0;p.v;)if((p=p.n)===d)return;u=p.z,a.lineStart();do{if(p.v=p.o.v=!0,p.e){if(h)for(l=0,c=u.length;l<c;++l)a.point((f=u[l])[0],f[1]);else n(p.x,p.n.x,1,a);p=p.n}else{if(h)for(l=(u=p.p.z).length-1;l>=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 Yr(t){if(e=t.length){for(var e,r,n=0,a=t[0];++n<e;)a.n=r=t[n],r.p=a,a=r;a.n=r=t[0],r.p=a}}function Wr(t,e,r,n){this.x=t,this.z=e,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function Jr(e,r,n,a){return function(i,o){var l,s=r(o),c=i.invert(a[0],a[1]),u={point:f,lineStart:p,lineEnd:h,polygonStart:function(){u.point=b,u.lineStart=_,u.lineEnd=w,l=[],g=[]},polygonEnd:function(){u.point=f,u.lineStart=p,u.lineEnd=h,l=t.merge(l);var e=function(t,e){var r=t[0],n=t[1],a=[Math.sin(r),-Math.cos(r),0],i=0,o=0;Sr.reset();for(var l=0,s=e.length;l<s;++l){var c=e[l],u=c.length;if(u)for(var f=c[0],d=f[0],p=f[1]/2+Mt/4,h=Math.sin(p),g=Math.cos(p),v=1;;){v===u&&(v=0);var y=(t=c[v])[0],m=t[1]/2+Mt/4,x=Math.sin(m),b=Math.cos(m),_=y-d,w=_>=0?1:-1,k=w*_,T=k>Mt,M=h*x;if(Sr.add(Math.atan2(M*w*Math.sin(k),g*b+M*Math.cos(k))),i+=T?_+w*At:_,T^d>=r^y>=r){var A=Pr(zr(f),zr(t));Ir(A);var L=Pr(a,A);Ir(L);var S=(T^_>=0?-1:1)*Et(L[2]);(n>S||n===S&&(A[0]||A[1]))&&(o+=T^_>=0?1:-1)}if(!v++)break;d=y,h=x,g=b,f=t}}return(i<-kt||i<kt&&Sr<-kt)^1&o}(c,g);l.length?(x||(o.polygonStart(),x=!0),Xr(l,Kr,e,n,o)):e&&(x||(o.polygonStart(),x=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),x&&(o.polygonEnd(),x=!1),l=g=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function f(t,r){var n=i(t,r);e(t=n[0],r=n[1])&&o.point(t,r)}function d(t,e){var r=i(t,e);s.point(r[0],r[1])}function p(){u.point=d,s.lineStart()}function h(){u.point=f,s.lineEnd()}var g,v,y=Qr(),m=r(y),x=!1;function b(t,e){v.push([t,e]);var r=i(t,e);m.point(r[0],r[1])}function _(){m.lineStart(),v=[]}function w(){b(v[0][0],v[0][1]),m.lineEnd();var t,e=m.clean(),r=y.buffer(),n=r.length;if(v.pop(),g.push(v),v=null,n)if(1&e){var a,i=-1;if((n=(t=r[0]).length-1)>0){for(x||(o.polygonStart(),x=!0),o.lineStart();++i<n;)o.point((a=t[i])[0],a[1]);o.lineEnd()}}else n>1&&2&e&&r.push(r.pop().concat(r.shift())),l.push(r.filter($r))}return u}}function $r(t){return t.length>1}function Qr(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:R,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Kr(t,e){return((t=t.x)[0]<0?t[1]-St-kt:St-t[1])-((e=e.x)[0]<0?e[1]-St-kt:St-e[1])}var tn=Jr(Zr,function(t){var e,r=NaN,n=NaN,a=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(i,o){var l=i>0?Mt:-Mt,s=m(i-r);m(s-Mt)<kt?(t.point(r,n=(n+o)/2>0?St:-St),t.point(a,n),t.lineEnd(),t.lineStart(),t.point(l,n),t.point(i,n),e=0):a!==l&&s>=Mt&&(m(r-a)<kt&&(r-=a*kt),m(i-l)<kt&&(i-=l*kt),n=function(t,e,r,n){var a,i,o=Math.sin(t-r);return m(o)>kt?Math.atan((Math.sin(e)*(i=Math.cos(n))*Math.sin(r)-Math.sin(n)*(a=Math.cos(e))*Math.sin(t))/(a*i*o)):(e+n)/2}(r,n,i,o),t.point(a,n),t.lineEnd(),t.lineStart(),t.point(l,n),e=0),t.point(r=i,n=o),a=l},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}},function(t,e,r,n){var a;if(null==t)a=r*St,n.point(-Mt,a),n.point(0,a),n.point(Mt,a),n.point(Mt,0),n.point(Mt,-a),n.point(0,-a),n.point(-Mt,-a),n.point(-Mt,0),n.point(-Mt,a);else if(m(t[0]-e[0])>kt){var i=t[0]<e[0]?Mt:-Mt;a=r*i/2,n.point(-i,a),n.point(0,a),n.point(i,a)}else n.point(e[0],e[1])},[-Mt,-Mt/2]);function en(t,e,r,n){return function(a){var i,o=a.a,l=a.b,s=o.x,c=o.y,u=0,f=1,d=l.x-s,p=l.y-c;if(i=t-s,d||!(i>0)){if(i/=d,d<0){if(i<u)return;i<f&&(f=i)}else if(d>0){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(i<u)return;i<f&&(f=i)}if(i=e-c,p||!(i>0)){if(i/=p,p<0){if(i<u)return;i<f&&(f=i)}else if(p>0){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(i<u)return;i<f&&(f=i)}return u>0&&(a.a={x:s+u*d,y:c+u*p}),f<1&&(a.b={x:s+f*d,y:c+f*p}),a}}}}}}var rn=1e9;function nn(e,r,n,a){return function(s){var c,u,f,d,p,h,g,v,y,m,x,b=s,_=Qr(),w=en(e,r,n,a),k={point:A,lineStart:function(){k.point=L,u&&u.push(f=[]);m=!0,y=!1,g=v=NaN},lineEnd:function(){c&&(L(d,p),h&&y&&_.rejoin(),c.push(_.buffer()));k.point=A,y&&s.lineEnd()},polygonStart:function(){s=_,c=[],u=[],x=!0},polygonEnd:function(){s=b,c=t.merge(c);var r=function(t){for(var e=0,r=u.length,n=t[1],a=0;a<r;++a)for(var i,o=1,l=u[a],s=l.length,c=l[0];o<s;++o)i=l[o],c[1]<=n?i[1]>n&&Dt(c,i,t)>0&&++e:i[1]<=n&&Dt(c,i,t)<0&&--e,c=i;return 0!==e}([e,a]),n=x&&r,i=c.length;(n||i)&&(s.polygonStart(),n&&(s.lineStart(),T(null,null,1,s),s.lineEnd()),i&&Xr(c,o,r,T,s),s.polygonEnd()),c=u=f=null}};function T(t,o,s,c){var u=0,f=0;if(null==t||(u=i(t,s))!==(f=i(o,s))||l(t,o)<0^s>0)do{c.point(0===u||3===u?e:n,u>1?a:r)}while((u=(u+s+4)%4)!==f);else c.point(o[0],o[1])}function M(t,i){return e<=t&&t<=n&&r<=i&&i<=a}function A(t,e){M(t,e)&&s.point(t,e)}function L(t,e){var r=M(t=Math.max(-rn,Math.min(rn,t)),e=Math.max(-rn,Math.min(rn,e)));if(u&&f.push([t,e]),m)d=t,p=e,h=r,m=!1,r&&(s.lineStart(),s.point(t,e));else if(r&&y)s.point(t,e);else{var n={a:{x:g,y:v},b:{x:t,y:e}};w(n)?(y||(s.lineStart(),s.point(n.a.x,n.a.y)),s.point(n.b.x,n.b.y),r||s.lineEnd(),x=!1):r&&(s.lineStart(),s.point(t,e),x=!1)}g=t,v=e,y=r}return k};function i(t,a){return m(t[0]-e)<kt?a>0?0:3:m(t[0]-n)<kt?a>0?2:1:m(t[1]-r)<kt?a>0?1:0:a>0?3:2}function o(t,e){return l(t.x,e.x)}function l(t,e){var r=i(t,1),n=i(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}}function an(t){var e=0,r=Mt/3,n=Cn(t),a=n(e,r);return a.parallels=function(t){return arguments.length?n(e=t[0]*Mt/180,r=t[1]*Mt/180):[e/Mt*180,r/Mt*180]},a}function on(t,e){var r=Math.sin(t),n=(r+Math.sin(e))/2,a=1+r*(2*n-r),i=Math.sqrt(a)/n;function o(t,e){var r=Math.sqrt(a-2*n*Math.sin(e))/n;return[r*Math.sin(t*=n),i-r*Math.cos(t)]}return o.invert=function(t,e){var r=i-e;return[Math.atan2(t,r)/n,Et((a-(t*t+r*r)*n*n)/(2*n))]},o}t.geo.clipExtent=function(){var t,e,r,n,a,i,o={stream:function(t){return a&&(a.valid=!1),(a=i(t)).valid=!0,a},extent:function(l){return arguments.length?(i=nn(t=+l[0][0],e=+l[0][1],r=+l[1][0],n=+l[1][1]),a&&(a.valid=!1,a=null),o):[[t,e],[r,n]]}};return o.extent([[0,0],[960,500]])},(t.geo.conicEqualArea=function(){return an(on)}).raw=on,t.geo.albers=function(){return t.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},t.geo.albersUsa=function(){var e,r,n,a,i=t.geo.albers(),o=t.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=t.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s={point:function(t,r){e=[t,r]}};function c(t){var i=t[0],o=t[1];return e=null,r(i,o),e||(n(i,o),e)||a(i,o),e}return c.invert=function(t){var e=i.scale(),r=i.translate(),n=(t[0]-r[0])/e,a=(t[1]-r[1])/e;return(a>=.12&&a<.234&&n>=-.425&&n<-.214?o:a>=.166&&a<.234&&n>=-.214&&n<-.115?l:i).invert(t)},c.stream=function(t){var e=i.stream(t),r=o.stream(t),n=l.stream(t);return{point:function(t,a){e.point(t,a),r.point(t,a),n.point(t,a)},sphere:function(){e.sphere(),r.sphere(),n.sphere()},lineStart:function(){e.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){e.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){e.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){e.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},c.precision=function(t){return arguments.length?(i.precision(t),o.precision(t),l.precision(t),c):i.precision()},c.scale=function(t){return arguments.length?(i.scale(t),o.scale(.35*t),l.scale(t),c.translate(i.translate())):i.scale()},c.translate=function(t){if(!arguments.length)return i.translate();var e=i.scale(),u=+t[0],f=+t[1];return r=i.translate(t).clipExtent([[u-.455*e,f-.238*e],[u+.455*e,f+.238*e]]).stream(s).point,n=o.translate([u-.307*e,f+.201*e]).clipExtent([[u-.425*e+kt,f+.12*e+kt],[u-.214*e-kt,f+.234*e-kt]]).stream(s).point,a=l.translate([u-.205*e,f+.212*e]).clipExtent([[u-.214*e+kt,f+.166*e+kt],[u-.115*e-kt,f+.234*e-kt]]).stream(s).point,c},c.scale(1070)};var ln,sn,cn,un,fn,dn,pn={point:R,lineStart:R,lineEnd:R,polygonStart:function(){sn=0,pn.lineStart=hn},polygonEnd:function(){pn.lineStart=pn.lineEnd=pn.point=R,ln+=m(sn/2)}};function hn(){var t,e,r,n;function a(t,e){sn+=n*t-r*e,r=t,n=e}pn.point=function(i,o){pn.point=a,t=r=i,e=n=o},pn.lineEnd=function(){a(t,e)}}var gn={point:function(t,e){t<cn&&(cn=t);t>fn&&(fn=t);e<un&&(un=e);e>dn&&(dn=e)},lineStart:R,lineEnd:R,polygonStart:R,polygonEnd:R};function vn(){var t=yn(4.5),e=[],r={point:n,lineStart:function(){r.point=a},lineEnd:o,polygonStart:function(){r.lineEnd=l},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(e){return t=yn(e),r},result:function(){if(e.length){var t=e.join("");return e=[],t}}};function n(r,n){e.push("M",r,",",n,t)}function a(t,n){e.push("M",t,",",n),r.point=i}function i(t,r){e.push("L",t,",",r)}function o(){r.point=n}function l(){e.push("Z")}return r}function yn(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}var mn,xn={point:bn,lineStart:_n,lineEnd:wn,polygonStart:function(){xn.lineStart=kn},polygonEnd:function(){xn.point=bn,xn.lineStart=_n,xn.lineEnd=wn}};function bn(t,e){xr+=t,br+=e,++_r}function _n(){var t,e;function r(r,n){var a=r-t,i=n-e,o=Math.sqrt(a*a+i*i);wr+=o*(t+r)/2,kr+=o*(e+n)/2,Tr+=o,bn(t=r,e=n)}xn.point=function(n,a){xn.point=r,bn(t=n,e=a)}}function wn(){xn.point=bn}function kn(){var t,e,r,n;function a(t,e){var a=t-r,i=e-n,o=Math.sqrt(a*a+i*i);wr+=o*(r+t)/2,kr+=o*(n+e)/2,Tr+=o,Mr+=(o=n*t-r*e)*(r+t),Ar+=o*(n+e),Lr+=3*o,bn(r=t,n=e)}xn.point=function(i,o){xn.point=a,bn(t=r=i,e=n=o)},xn.lineEnd=function(){a(t,e)}}function Tn(t){var e=4.5,r={point:n,lineStart:function(){r.point=a},lineEnd:o,polygonStart:function(){r.lineEnd=l},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(t){return e=t,r},result:R};function n(r,n){t.moveTo(r+e,n),t.arc(r,n,e,0,At)}function a(e,n){t.moveTo(e,n),r.point=i}function i(e,r){t.lineTo(e,r)}function o(){r.point=n}function l(){t.closePath()}return r}function Mn(t){var e=.5,r=Math.cos(30*Ct),n=16;function a(e){return(n?function(e){var r,a,o,l,s,c,u,f,d,p,h,g,v={point:y,lineStart:m,lineEnd:b,polygonStart:function(){e.polygonStart(),v.lineStart=_},polygonEnd:function(){e.polygonEnd(),v.lineStart=m}};function y(r,n){r=t(r,n),e.point(r[0],r[1])}function m(){f=NaN,v.point=x,e.lineStart()}function x(r,a){var o=zr([r,a]),l=t(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,e),e.point(f,d)}function b(){v.point=y,e.lineEnd()}function _(){m(),v.point=w,v.lineEnd=k}function w(t,e){x(r=t,e),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,e),v.lineEnd=b,b()}return v}:function(e){return Ln(e,function(r,n){r=t(r,n),e.point(r[0],r[1])})})(e)}function i(n,a,o,l,s,c,u,f,d,p,h,g,v,y){var x=u-n,b=f-a,_=x*x+b*b;if(_>4*e&&v--){var w=l+p,k=s+h,T=c+g,M=Math.sqrt(w*w+k*k+T*T),A=Math.asin(T/=M),L=m(m(T)-1)<kt||m(o-d)<kt?(o+d)/2:Math.atan2(k,w),S=t(L,A),C=S[0],O=S[1],z=C-n,D=O-a,P=b*z-x*D;(P*P/_>e||m((x*z+b*D)/_-.5)>.3||l*p+s*h+c*g<r)&&(i(n,a,o,l,s,c,C,O,L,w/=M,k/=M,T,v,y),y.point(C,O),i(C,O,L,w,k,T,u,f,d,p,h,g,v,y))}}return a.precision=function(t){return arguments.length?(n=(e=t*t)>0&&16,a):Math.sqrt(e)},a}function An(t){this.stream=t}function Ln(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function Sn(t){return Cn(function(){return t})()}function Cn(e){var r,n,a,i,o,l,s=Mn(function(t,e){return[(t=r(t,e))[0]*c+i,o-t[1]*c]}),c=150,u=480,f=250,d=0,p=0,h=0,g=0,v=0,y=tn,x=z,b=null,_=null;function w(t){return[(t=a(t[0]*Ct,t[1]*Ct))[0]*c+i,o-t[1]*c]}function k(t){return(t=a.invert((t[0]-i)/c,(o-t[1])/c))&&[t[0]*Ot,t[1]*Ot]}function T(){a=Gr(n=Pn(h,g,v),r);var t=r(d,p);return i=u-t[0]*c,o=f+t[1]*c,M()}function M(){return l&&(l.valid=!1,l=null),w}return w.stream=function(t){return l&&(l.valid=!1),(l=On(y(n,s(x(t))))).valid=!0,l},w.clipAngle=function(t){return arguments.length?(y=null==t?(b=t,tn):function(t){var e=Math.cos(t),r=e>0,n=m(e)>kt;return Jr(a,function(t){var e,l,s,c,u;return{lineStart:function(){c=s=!1,u=1},point:function(f,d){var p,h=[f,d],g=a(f,d),v=r?g?0:o(f,d):g?o(f+(f<0?Mt:-Mt),d):0;if(!e&&(c=s=g)&&t.lineStart(),g!==s&&(p=i(e,h),(Nr(e,p)||Nr(h,p))&&(h[0]+=kt,h[1]+=kt,g=a(h[0],h[1]))),g!==s)u=0,g?(t.lineStart(),p=i(h,e),t.point(p[0],p[1])):(p=i(e,h),t.point(p[0],p[1]),t.lineEnd()),e=p;else if(n&&e&&r^g){var y;v&l||!(y=i(h,e,!0))||(u=0,r?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!g||e&&Nr(e,h)||t.point(h[0],h[1]),e=h,s=g,l=v},lineEnd:function(){s&&t.lineEnd(),e=null},clean:function(){return u|(c&&s)<<1}}},Fn(t,6*Ct),r?[0,-t]:[-Mt,t-Mt]);function a(t,r){return Math.cos(t)*Math.cos(r)>e}function i(t,r,n){var a=[1,0,0],i=Pr(zr(t),zr(r)),o=Dr(i,i),l=i[0],s=o-l*l;if(!s)return!n&&t;var c=e*o/s,u=-e*l/s,f=Pr(a,i),d=Rr(a,c);Er(d,Rr(i,u));var p=f,h=Dr(d,p),g=Dr(p,p),v=h*h-g*(Dr(d,d)-1);if(!(v<0)){var y=Math.sqrt(v),x=Rr(p,(-h-y)/g);if(Er(x,d),x=Fr(x),!n)return x;var b,_=t[0],w=r[0],k=t[1],T=r[1];w<_&&(b=_,_=w,w=b);var M=w-_,A=m(M-Mt)<kt;if(!A&&T<k&&(b=k,k=T,T=b),A||M<kt?A?k+T>0^x[1]<(m(x[0]-_)<kt?k:T):k<=x[1]&&x[1]<=T:M>Mt^(_<=x[0]&&x[0]<=w)){var L=Rr(p,(-h+y)/g);return Er(L,d),[x,Fr(L)]}}}function o(e,n){var a=r?t:Mt-t,i=0;return e<-a?i|=1:e>a&&(i|=2),n<-a?i|=4:n>a&&(i|=8),i}}((b=+t)*Ct),M()):b},w.clipExtent=function(t){return arguments.length?(_=t,x=t?nn(t[0][0],t[0][1],t[1][0],t[1][1]):z,M()):_},w.scale=function(t){return arguments.length?(c=+t,T()):c},w.translate=function(t){return arguments.length?(u=+t[0],f=+t[1],T()):[u,f]},w.center=function(t){return arguments.length?(d=t[0]%360*Ct,p=t[1]%360*Ct,T()):[d*Ot,p*Ot]},w.rotate=function(t){return arguments.length?(h=t[0]%360*Ct,g=t[1]%360*Ct,v=t.length>2?t[2]%360*Ct:0,T()):[h*Ot,g*Ot,v*Ot]},t.rebind(w,s,"precision"),function(){return r=e.apply(this,arguments),w.invert=r.invert&&k,T()}}function On(t){return Ln(t,function(e,r){t.point(e*Ct,r*Ct)})}function zn(t,e){return[t,e]}function Dn(t,e){return[t>Mt?t-At:t<-Mt?t+At:t,e]}function Pn(t,e,r){return t?e||r?Gr(Rn(t),In(e,r)):Rn(t):e||r?In(e,r):Dn}function En(t){return function(e,r){return[(e+=t)>Mt?e-At:e<-Mt?e+At:e,r]}}function Rn(t){var e=En(t);return e.invert=En(-t),e}function In(t,e){var r=Math.cos(t),n=Math.sin(t),a=Math.cos(e),i=Math.sin(e);function o(t,e){var o=Math.cos(e),l=Math.cos(t)*o,s=Math.sin(t)*o,c=Math.sin(e),u=c*r+l*n;return[Math.atan2(s*a-u*i,l*r-c*n),Et(u*a+s*i)]}return o.invert=function(t,e){var o=Math.cos(e),l=Math.cos(t)*o,s=Math.sin(t)*o,c=Math.sin(e),u=c*a-s*i;return[Math.atan2(s*a+c*i,l*r+u*n),Et(u*r-l*n)]},o}function Fn(t,e){var r=Math.cos(t),n=Math.sin(t);return function(a,i,o,l){var s=o*e;null!=a?(a=Nn(r,a),i=Nn(r,i),(o>0?a<i:a>i)&&(a+=o*At)):(a=t+o*At,i=t-.5*s);for(var c,u=a;o>0?u>i:u<i;u-=s)l.point((c=Fr([r,-n*Math.cos(u),-n*Math.sin(u)]))[0],c[1])}}function Nn(t,e){var r=zr(e);r[0]-=t,Ir(r);var n=Pt(-r[1]);return((-r[2]<0?-n:n)+2*Math.PI-kt)%(2*Math.PI)}function Bn(e,r,n){var a=t.range(e,r-kt,n).concat(r);return function(t){return a.map(function(e){return[t,e]})}}function jn(e,r,n){var a=t.range(e,r-kt,n).concat(r);return function(t){return a.map(function(e){return[e,t]})}}function Hn(t){return t.source}function qn(t){return t.target}t.geo.path=function(){var e,r,n,a,i,o=4.5;function l(e){return e&&("function"==typeof o&&a.pointRadius(+o.apply(this,arguments)),i&&i.valid||(i=n(a)),t.geo.stream(e,i)),a.result()}function s(){return i=null,l}return l.area=function(e){return ln=0,t.geo.stream(e,n(pn)),ln},l.centroid=function(e){return xr=br=_r=wr=kr=Tr=Mr=Ar=Lr=0,t.geo.stream(e,n(xn)),Lr?[Mr/Lr,Ar/Lr]:Tr?[wr/Tr,kr/Tr]:_r?[xr/_r,br/_r]:[NaN,NaN]},l.bounds=function(e){return fn=dn=-(cn=un=1/0),t.geo.stream(e,n(gn)),[[cn,un],[fn,dn]]},l.projection=function(t){return arguments.length?(n=(e=t)?t.stream||(r=t,a=Mn(function(t,e){return r([t*Ot,e*Ot])}),function(t){return On(a(t))}):z,s()):e;var r,a},l.context=function(t){return arguments.length?(a=null==(r=t)?new vn:new Tn(t),"function"!=typeof o&&a.pointRadius(o),s()):r},l.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:(a.pointRadius(+t),+t),l):o},l.projection(t.geo.albersUsa()).context(null)},t.geo.transform=function(t){return{stream:function(e){var r=new An(e);for(var n in t)r[n]=t[n];return r}}},An.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},t.geo.projection=Sn,t.geo.projectionMutator=Cn,(t.geo.equirectangular=function(){return Sn(zn)}).raw=zn.invert=zn,t.geo.rotation=function(t){function e(e){return(e=t(e[0]*Ct,e[1]*Ct))[0]*=Ot,e[1]*=Ot,e}return t=Pn(t[0]%360*Ct,t[1]*Ct,t.length>2?t[2]*Ct:0),e.invert=function(e){return(e=t.invert(e[0]*Ct,e[1]*Ct))[0]*=Ot,e[1]*=Ot,e},e},Dn.invert=zn,t.geo.circle=function(){var t,e,r=[0,0],n=6;function a(){var t="function"==typeof r?r.apply(this,arguments):r,n=Pn(-t[0]*Ct,-t[1]*Ct,0).invert,a=[];return e(null,null,1,{point:function(t,e){a.push(t=n(t,e)),t[0]*=Ot,t[1]*=Ot}}),{type:"Polygon",coordinates:[a]}}return a.origin=function(t){return arguments.length?(r=t,a):r},a.angle=function(r){return arguments.length?(e=Fn((t=+r)*Ct,n*Ct),a):t},a.precision=function(r){return arguments.length?(e=Fn(t*Ct,(n=+r)*Ct),a):n},a.angle(90)},t.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Ct,a=t[1]*Ct,i=e[1]*Ct,o=Math.sin(n),l=Math.cos(n),s=Math.sin(a),c=Math.cos(a),u=Math.sin(i),f=Math.cos(i);return Math.atan2(Math.sqrt((r=f*o)*r+(r=c*u-s*f*l)*r),s*u+c*f*l)},t.geo.graticule=function(){var e,r,n,a,i,o,l,s,c,u,f,d,p=10,h=p,g=90,v=360,y=2.5;function x(){return{type:"MultiLineString",coordinates:b()}}function b(){return t.range(Math.ceil(a/g)*g,n,g).map(f).concat(t.range(Math.ceil(s/v)*v,l,v).map(d)).concat(t.range(Math.ceil(r/p)*p,e,p).filter(function(t){return m(t%g)>kt}).map(c)).concat(t.range(Math.ceil(o/h)*h,i,h).filter(function(t){return m(t%v)>kt}).map(u))}return x.lines=function(){return b().map(function(t){return{type:"LineString",coordinates:t}})},x.outline=function(){return{type:"Polygon",coordinates:[f(a).concat(d(l).slice(1),f(n).reverse().slice(1),d(s).reverse().slice(1))]}},x.extent=function(t){return arguments.length?x.majorExtent(t).minorExtent(t):x.minorExtent()},x.majorExtent=function(t){return arguments.length?(a=+t[0][0],n=+t[1][0],s=+t[0][1],l=+t[1][1],a>n&&(t=a,a=n,n=t),s>l&&(t=s,s=l,l=t),x.precision(y)):[[a,s],[n,l]]},x.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],o=+t[0][1],i=+t[1][1],r>e&&(t=r,r=e,e=t),o>i&&(t=o,o=i,i=t),x.precision(y)):[[r,o],[e,i]]},x.step=function(t){return arguments.length?x.majorStep(t).minorStep(t):x.minorStep()},x.majorStep=function(t){return arguments.length?(g=+t[0],v=+t[1],x):[g,v]},x.minorStep=function(t){return arguments.length?(p=+t[0],h=+t[1],x):[p,h]},x.precision=function(t){return arguments.length?(y=+t,c=Bn(o,i,90),u=jn(r,e,y),f=Bn(s,l,90),d=jn(a,n,y),x):y},x.majorExtent([[-180,-90+kt],[180,90-kt]]).minorExtent([[-180,-80-kt],[180,80+kt]])},t.geo.greatArc=function(){var e,r,n=Hn,a=qn;function i(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),r||a.apply(this,arguments)]}}return i.distance=function(){return t.geo.distance(e||n.apply(this,arguments),r||a.apply(this,arguments))},i.source=function(t){return arguments.length?(n=t,e="function"==typeof t?null:t,i):n},i.target=function(t){return arguments.length?(a=t,r="function"==typeof t?null:t,i):a},i.precision=function(){return arguments.length?i:0},i},t.geo.interpolate=function(t,e){return r=t[0]*Ct,n=t[1]*Ct,a=e[0]*Ct,i=e[1]*Ct,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(It(i-n)+o*s*It(a-r))),g=1/Math.sin(h),(v=h?function(t){var e=Math.sin(t*=h)*g,r=Math.sin(h-t)*g,n=r*u+e*d,a=r*f+e*p,i=r*l+e*c;return[Math.atan2(a,n)*Ot,Math.atan2(i,Math.sqrt(n*n+a*a))*Ot]}:function(){return[r*Ot,n*Ot]}).distance=h,v;var r,n,a,i,o,l,s,c,u,f,d,p,h,g,v},t.geo.length=function(e){return mn=0,t.geo.stream(e,Vn),mn};var Vn={sphere:R,point:R,lineStart:function(){var t,e,r;function n(n,a){var i=Math.sin(a*=Ct),o=Math.cos(a),l=m((n*=Ct)-t),s=Math.cos(l);mn+=Math.atan2(Math.sqrt((l=o*Math.sin(l))*l+(l=r*i-e*o*s)*l),e*i+r*o*s),t=n,e=i,r=o}Vn.point=function(a,i){t=a*Ct,e=Math.sin(i*=Ct),r=Math.cos(i),Vn.point=n},Vn.lineEnd=function(){Vn.point=Vn.lineEnd=R}},lineEnd:R,polygonStart:R,polygonEnd:R};function Un(t,e){function r(e,r){var n=Math.cos(e),a=Math.cos(r),i=t(n*a);return[i*a*Math.sin(e),i*Math.sin(r)]}return r.invert=function(t,r){var n=Math.sqrt(t*t+r*r),a=e(n),i=Math.sin(a),o=Math.cos(a);return[Math.atan2(t*i,n*o),Math.asin(n&&r*i/n)]},r}var Gn=Un(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(t.geo.azimuthalEqualArea=function(){return Sn(Gn)}).raw=Gn;var Zn=Un(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},z);function Xn(t,e){var r=Math.cos(t),n=function(t){return Math.tan(Mt/4+t/2)},a=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(n(e)/n(t)),i=r*Math.pow(n(t),a)/a;if(!a)return Jn;function o(t,e){i>0?e<-St+kt&&(e=-St+kt):e>St-kt&&(e=St-kt);var r=i/Math.pow(n(e),a);return[r*Math.sin(a*t),i-r*Math.cos(a*t)]}return o.invert=function(t,e){var r=i-e,n=zt(a)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/a,2*Math.atan(Math.pow(i/n,1/a))-St]},o}function Yn(t,e){var r=Math.cos(t),n=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),a=r/n+t;if(m(n)<kt)return zn;function i(t,e){var r=a-e;return[r*Math.sin(n*t),a-r*Math.cos(n*t)]}return i.invert=function(t,e){var r=a-e;return[Math.atan2(t,r)/n,a-zt(n)*Math.sqrt(t*t+r*r)]},i}(t.geo.azimuthalEquidistant=function(){return Sn(Zn)}).raw=Zn,(t.geo.conicConformal=function(){return an(Xn)}).raw=Xn,(t.geo.conicEquidistant=function(){return an(Yn)}).raw=Yn;var Wn=Un(function(t){return 1/t},Math.atan);function Jn(t,e){return[t,Math.log(Math.tan(Mt/4+e/2))]}function $n(t){var e,r=Sn(t),n=r.scale,a=r.translate,i=r.clipExtent;return r.scale=function(){var t=n.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.translate=function(){var t=a.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.clipExtent=function(t){var o=i.apply(r,arguments);if(o===r){if(e=null==t){var l=Mt*n(),s=a();i([[s[0]-l,s[1]-l],[s[0]+l,s[1]+l]])}}else e&&(o=null);return o},r.clipExtent(null)}(t.geo.gnomonic=function(){return Sn(Wn)}).raw=Wn,Jn.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-St]},(t.geo.mercator=function(){return $n(Jn)}).raw=Jn;var Qn=Un(function(){return 1},Math.asin);(t.geo.orthographic=function(){return Sn(Qn)}).raw=Qn;var Kn=Un(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});function ta(t,e){return[Math.log(Math.tan(Mt/4+e/2)),-t]}function ea(t){return t[0]}function ra(t){return t[1]}function na(t){for(var e=t.length,r=[0,1],n=2,a=2;a<e;a++){for(;n>1&&Dt(t[r[n-2]],t[r[n-1]],t[a])<=0;)--n;r[n++]=a}return r.slice(0,n)}function aa(t,e){return t[0]-e[0]||t[1]-e[1]}(t.geo.stereographic=function(){return Sn(Kn)}).raw=Kn,ta.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-St]},(t.geo.transverseMercator=function(){var t=$n(ta),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):[(t=r())[0],t[1],t[2]-90]},r([0,0,90])}).raw=ta,t.geom={},t.geom.hull=function(t){var e=ea,r=ra;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,a=ve(e),i=ve(r),o=t.length,l=[],s=[];for(n=0;n<o;n++)l.push([+a.call(this,t[n],n),+i.call(this,t[n],n),n]);for(l.sort(aa),n=0;n<o;n++)s.push([l[n][0],-l[n][1]]);var c=na(l),u=na(s),f=u[0]===c[0],d=u[u.length-1]===c[c.length-1],p=[];for(n=c.length-1;n>=0;--n)p.push(t[l[c[n]][2]]);for(n=+f;n<u.length-d;++n)p.push(t[l[u[n]][2]]);return p}return n.x=function(t){return arguments.length?(e=t,n):e},n.y=function(t){return arguments.length?(r=t,n):r},n},t.geom.polygon=function(t){return q(t,ia),t};var ia=t.geom.polygon.prototype=[];function oa(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function la(t,e,r,n){var a=t[0],i=r[0],o=e[0]-a,l=n[0]-i,s=t[1],c=r[1],u=e[1]-s,f=n[1]-c,d=(l*(s-c)-f*(a-i))/(f*o-l*u);return[a+d*o,s+d*u]}function sa(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}ia.area=function(){for(var t,e=-1,r=this.length,n=this[r-1],a=0;++e<r;)t=n,n=this[e],a+=t[1]*n[0]-t[0]*n[1];return.5*a},ia.centroid=function(t){var e,r,n=-1,a=this.length,i=0,o=0,l=this[a-1];for(arguments.length||(t=-1/(6*this.area()));++n<a;)e=l,l=this[n],r=e[0]*l[1]-l[0]*e[1],i+=(e[0]+l[0])*r,o+=(e[1]+l[1])*r;return[i*t,o*t]},ia.clip=function(t){for(var e,r,n,a,i,o,l=sa(t),s=-1,c=this.length-sa(this),u=this[c-1];++s<c;){for(e=t.slice(),t.length=0,a=this[s],i=e[(n=e.length-l)-1],r=-1;++r<n;)oa(o=e[r],u,a)?(oa(i,u,a)||t.push(la(i,o,u,a)),t.push(o)):oa(i,u,a)&&t.push(la(i,o,u,a)),i=o;l&&t.push(t[0]),u=a}return t};var ca,ua,fa,da,pa,ha=[],ga=[];function va(){Ea(this),this.edge=this.site=this.circle=null}function ya(t){var e=ha.pop()||new va;return e.site=t,e}function ma(t){La(t),fa.remove(t),ha.push(t),Ea(t)}function xa(t){var e=t.circle,r=e.x,n=e.cy,a={x:r,y:n},i=t.P,o=t.N,l=[t];ma(t);for(var s=i;s.circle&&m(r-s.circle.x)<kt&&m(n-s.circle.cy)<kt;)i=s.P,l.unshift(s),ma(s),s=i;l.unshift(s),La(s);for(var c=o;c.circle&&m(r-c.circle.x)<kt&&m(n-c.circle.cy)<kt;)o=c.N,l.push(c),ma(c),c=o;l.push(c),La(c);var u,f=l.length;for(u=1;u<f;++u)c=l[u],s=l[u-1],za(c.edge,s.site,c.site,a);s=l[0],(c=l[f-1]).edge=Oa(s.site,c.site,null,a),Aa(s),Aa(c)}function ba(t){for(var e,r,n,a,i=t.x,o=t.y,l=fa._;l;)if((n=_a(l,o)-i)>kt)l=l.L;else{if(!((a=i-wa(l,o))>kt)){n>-kt?(e=l.P,r=l):a>-kt?(e=l,r=l.N):e=r=l;break}if(!l.R){e=l;break}l=l.R}var s=ya(t);if(fa.insert(e,s),e||r){if(e===r)return La(e),r=ya(e.site),fa.insert(s,r),s.edge=r.edge=Oa(e.site,s.site),Aa(e),void Aa(r);if(r){La(e),La(r);var c=e.site,u=c.x,f=c.y,d=t.x-u,p=t.y-f,h=r.site,g=h.x-u,v=h.y-f,y=2*(d*v-p*g),m=d*d+p*p,x=g*g+v*v,b={x:(v*m-p*x)/y+u,y:(d*x-g*m)/y+f};za(r.edge,c,h,b),s.edge=Oa(c,t,null,b),r.edge=Oa(t,h,null,b),Aa(e),Aa(r)}else s.edge=Oa(e.site,s.site)}}function _a(t,e){var r=t.site,n=r.x,a=r.y,i=a-e;if(!i)return n;var o=t.P;if(!o)return-1/0;var l=(r=o.site).x,s=r.y,c=s-e;if(!c)return l;var u=l-n,f=1/i-1/c,d=u/c;return f?(-d+Math.sqrt(d*d-2*f*(u*u/(-2*c)-s+c/2+a-i/2)))/f+n:(n+l)/2}function wa(t,e){var r=t.N;if(r)return _a(r,e);var n=t.site;return n.y===e?n.x:1/0}function ka(t){this.site=t,this.edges=[]}function Ta(t,e){return e.angle-t.angle}function Ma(){Ea(this),this.x=this.y=this.arc=this.site=this.cy=null}function Aa(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,a=t.site,i=r.site;if(n!==i){var o=a.x,l=a.y,s=n.x-o,c=n.y-l,u=i.x-o,f=2*(s*(v=i.y-l)-c*u);if(!(f>=-Tt)){var d=s*s+c*c,p=u*u+v*v,h=(v*d-c*p)/f,g=(s*p-u*d)/f,v=g+l,y=ga.pop()||new Ma;y.arc=t,y.site=a,y.x=h+o,y.y=v+Math.sqrt(h*h+g*g),y.cy=v,t.circle=y;for(var m=null,x=pa._;x;)if(y.y<x.y||y.y===x.y&&y.x<=x.x){if(!x.L){m=x.P;break}x=x.L}else{if(!x.R){m=x;break}x=x.R}pa.insert(m,y),m||(da=y)}}}}function La(t){var e=t.circle;e&&(e.P||(da=e.N),pa.remove(e),ga.push(e),Ea(e),t.circle=null)}function Sa(t,e){var r=t.b;if(r)return!0;var n,a,i=t.a,o=e[0][0],l=e[1][0],s=e[0][1],c=e[1][1],u=t.l,f=t.r,d=u.x,p=u.y,h=f.x,g=f.y,v=(d+h)/2,y=(p+g)/2;if(g===p){if(v<o||v>=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.y<s)return}else i={x:v,y:c};r={x:v,y:s}}}else if(a=y-(n=(d-h)/(g-p))*v,n<-1||n>1)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<s)return}else i={x:(c-a)/n,y:c};r={x:(s-a)/n,y:s}}else if(p<g){if(i){if(i.x>=l)return}else i={x:o,y:n*o+a};r={x:l,y:n*l+a}}else{if(i){if(i.x<o)return}else i={x:l,y:n*l+a};r={x:o,y:n*o+a}}return t.a=i,t.b=r,!0}function Ca(t,e){this.l=t,this.r=e,this.a=this.b=null}function Oa(t,e,r,n){var a=new Ca(t,e);return ca.push(a),r&&za(a,t,e,r),n&&za(a,e,t,n),ua[t.i].edges.push(new Da(a,t,e)),ua[e.i].edges.push(new Da(a,e,t)),a}function za(t,e,r,n){t.a||t.b?t.l===r?t.b=n:t.a=n:(t.a=n,t.l=e,t.r=r)}function Da(t,e,r){var n=t.a,a=t.b;this.edge=t,this.site=e,this.angle=r?Math.atan2(r.y-e.y,r.x-e.x):t.l===e?Math.atan2(a.x-n.x,n.y-a.y):Math.atan2(n.x-a.x,a.y-n.y)}function Pa(){this._=null}function Ea(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function Ra(t,e){var r=e,n=e.R,a=r.U;a?a.L===r?a.L=n:a.R=n:t._=n,n.U=a,r.U=n,r.R=n.L,r.R&&(r.R.U=r),n.L=r}function Ia(t,e){var r=e,n=e.L,a=r.U;a?a.L===r?a.L=n:a.R=n:t._=n,n.U=a,r.U=n,r.L=n.R,r.L&&(r.L.U=r),n.R=r}function Fa(t){for(;t.L;)t=t.L;return t}function Na(t,e){var r,n,a,i=t.sort(Ba).pop();for(ca=[],ua=new Array(t.length),fa=new Pa,pa=new Pa;;)if(a=da,i&&(!a||i.y<a.y||i.y===a.y&&i.x<a.x))i.x===r&&i.y===n||(ua[i.i]=new ka(i),ba(i),r=i.x,n=i.y),i=t.pop();else{if(!a)break;xa(a.arc)}e&&(function(t){for(var e,r=ca,n=en(t[0][0],t[0][1],t[1][0],t[1][1]),a=r.length;a--;)(!Sa(e=r[a],t)||!n(e)||m(e.a.x-e.b.x)<kt&&m(e.a.y-e.b.y)<kt)&&(e.a=e.b=null,r.splice(a,1))}(e),function(t){for(var e,r,n,a,i,o,l,s,c,u,f=t[0][0],d=t[1][0],p=t[0][1],h=t[1][1],g=ua,v=g.length;v--;)if((i=g[v])&&i.prepare())for(s=(l=i.edges).length,o=0;o<s;)n=(u=l[o].end()).x,a=u.y,e=(c=l[++o%s].start()).x,r=c.y,(m(n-e)>kt||m(a-r)>kt)&&(l.splice(o,0,new Da((y=i.site,x=u,b=m(n-f)<kt&&h-a>kt?{x:f,y:m(e-f)<kt?r:h}:m(a-h)<kt&&d-n>kt?{x:m(r-h)<kt?e:d,y:h}:m(n-d)<kt&&a-p>kt?{x:d,y:m(e-d)<kt?r:p}:m(a-p)<kt&&n-f>kt?{x:m(r-p)<kt?e:f,y:p}:null,_=void 0,_=new Ca(y,null),_.a=x,_.b=b,ca.push(_),_),i.site,null)),++s);var y,x,b,_}(e));var o={cells:ua,edges:ca};return fa=pa=ca=ua=null,o}function Ba(t,e){return e.y-t.y||e.x-t.x}ka.prototype.prepare=function(){for(var t,e=this.edges,r=e.length;r--;)(t=e[r].edge).b&&t.a||e.splice(r,1);return e.sort(Ta),e.length},Da.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},Pa.prototype={insert:function(t,e){var r,n,a;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;r=t}else this._?(t=Fa(this._),e.P=null,e.N=t,t.P=t.L=e,r=t):(e.P=e.N=null,this._=e,r=null);for(e.L=e.R=null,e.U=r,e.C=!0,t=e;r&&r.C;)r===(n=r.U).L?(a=n.R)&&a.C?(r.C=a.C=!1,n.C=!0,t=n):(t===r.R&&(Ra(this,r),r=(t=r).U),r.C=!1,n.C=!0,Ia(this,n)):(a=n.L)&&a.C?(r.C=a.C=!1,n.C=!0,t=n):(t===r.L&&(Ia(this,r),r=(t=r).U),r.C=!1,n.C=!0,Ra(this,n)),r=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,r,n,a=t.U,i=t.L,o=t.R;if(r=i?o?Fa(o):i:o,a?a.L===t?a.L=r:a.R=r:this._=r,i&&o?(n=r.C,r.C=t.C,r.L=i,i.U=r,r!==o?(a=r.U,r.U=t.U,t=r.R,a.L=t,r.R=o,o.U=r):(r.U=a,a=r,t=r.R)):(n=t.C,t=r),t&&(t.U=a),!n)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===a.L){if((e=a.R).C&&(e.C=!1,a.C=!0,Ra(this,a),e=a.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,Ia(this,e),e=a.R),e.C=a.C,a.C=e.R.C=!1,Ra(this,a),t=this._;break}}else if((e=a.L).C&&(e.C=!1,a.C=!0,Ia(this,a),e=a.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,Ra(this,e),e=a.L),e.C=a.C,a.C=e.L.C=!1,Ia(this,a),t=this._;break}e.C=!0,t=a,a=a.U}while(!t.C);t&&(t.C=!1)}}},t.geom.voronoi=function(t){var e=ea,r=ra,n=e,a=r,i=ja;if(t)return o(t);function o(t){var e=new Array(t.length),r=i[0][0],n=i[0][1],a=i[1][0],o=i[1][1];return Na(l(t),i).cells.forEach(function(i,l){var s=i.edges,c=i.site;(e[l]=s.length?s.map(function(t){var e=t.start();return[e.x,e.y]}):c.x>=r&&c.x<=a&&c.y>=n&&c.y<=o?[[r,o],[a,o],[a,n],[r,n]]:[]).point=t[l]}),e}function l(t){return t.map(function(t,e){return{x:Math.round(n(t,e)/kt)*kt,y:Math.round(a(t,e)/kt)*kt,i:e}})}return o.links=function(t){return Na(l(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},o.triangles=function(t){var e=[];return Na(l(t)).cells.forEach(function(r,n){for(var a,i,o,l,s=r.site,c=r.edges.sort(Ta),u=-1,f=c.length,d=c[f-1].edge,p=d.l===s?d.r:d.l;++u<f;)d,a=p,p=(d=c[u].edge).l===s?d.r:d.l,n<a.i&&n<p.i&&(o=a,l=p,((i=s).x-l.x)*(o.y-i.y)-(i.x-o.x)*(l.y-i.y)<0)&&e.push([t[n],t[a.i],t[p.i]])}),e},o.x=function(t){return arguments.length?(n=ve(e=t),o):e},o.y=function(t){return arguments.length?(a=ve(r=t),o):r},o.clipExtent=function(t){return arguments.length?(i=null==t?ja:t,o):i===ja?null:i},o.size=function(t){return arguments.length?o.clipExtent(t&&[[0,0],t]):i===ja?null:i&&i[1]},o};var ja=[[-1e6,-1e6],[1e6,1e6]];function Ha(t){return t.x}function qa(t){return t.y}function Va(e,r){e=t.rgb(e),r=t.rgb(r);var n=e.r,a=e.g,i=e.b,o=r.r-n,l=r.g-a,s=r.b-i;return function(t){return"#"+ce(Math.round(n+o*t))+ce(Math.round(a+l*t))+ce(Math.round(i+s*t))}}function Ua(t,e){var r,n={},a={};for(r in t)r in e?n[r]=Wa(t[r],e[r]):a[r]=t[r];for(r in e)r in t||(a[r]=e[r]);return function(t){for(r in n)a[r]=n[r](t);return a}}function Ga(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function Za(t,e){var r,n,a,i=Xa.lastIndex=Ya.lastIndex=0,o=-1,l=[],s=[];for(t+="",e+="";(r=Xa.exec(t))&&(n=Ya.exec(e));)(a=n.index)>i&&(a=e.slice(i,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(n=n[0])?l[o]?l[o]+=n:l[++o]=n:(l[++o]=null,s.push({i:o,x:Ga(r,n)})),i=Ya.lastIndex;return i<e.length&&(a=e.slice(i),l[o]?l[o]+=a:l[++o]=a),l.length<2?s[0]?(e=s[0].x,function(t){return e(t)+""}):function(){return e}:(e=s.length,function(t){for(var r,n=0;n<e;++n)l[(r=s[n]).i]=r.x(t);return l.join("")})}t.geom.delaunay=function(e){return t.geom.voronoi().triangles(e)},t.geom.quadtree=function(t,e,r,n,a){var i,o=ea,l=ra;if(i=arguments.length)return o=Ha,l=qa,3===i&&(a=r,n=e,r=e=0),s(t);function s(t){var s,c,u,f,d,p,h,g,v,y=ve(o),x=ve(l);if(null!=e)p=e,h=r,g=n,v=a;else if(g=v=-(p=h=1/0),c=[],u=[],d=t.length,i)for(f=0;f<d;++f)(s=t[f]).x<p&&(p=s.x),s.y<h&&(h=s.y),s.x>g&&(g=s.x),s.y>v&&(v=s.y),c.push(s.x),u.push(s.y);else for(f=0;f<d;++f){var b=+y(s=t[f],f),_=+x(s,f);b<p&&(p=b),_<h&&(h=_),b>g&&(g=b),_>v&&(v=_),c.push(b),u.push(_)}var w=g-p,k=v-h;function T(t,e,r,n,a,i,o,l){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var s=t.x,c=t.y;if(null!=s)if(m(s-r)+m(c-n)<.01)M(t,e,r,n,a,i,o,l);else{var u=t.point;t.x=t.y=t.point=null,M(t,u,s,c,a,i,o,l),M(t,e,r,n,a,i,o,l)}else t.x=r,t.y=n,t.point=e}else M(t,e,r,n,a,i,o,l)}function M(t,e,r,n,a,i,o,l){var s=.5*(a+o),c=.5*(i+l),u=r>=s,f=n>=c,d=f<<1|u;t.leaf=!1,u?a=s:o=s,f?i=c:l=c,T(t=t.nodes[d]||(t.nodes[d]={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){T(A,t,+y(t,++f),+x(t,f),p,h,g,v)}}),e,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(t){T(A,t,+y(t,++f),+x(t,f),p,h,g,v)}};if(A.visit=function(t){!function t(e,r,n,a,i,o){if(!e(r,n,a,i,o)){var l=.5*(n+i),s=.5*(a+o),c=r.nodes;c[0]&&t(e,c[0],n,a,l,s),c[1]&&t(e,c[1],l,a,i,s),c[2]&&t(e,c[2],n,s,l,o),c[3]&&t(e,c[3],l,s,i,o)}}(t,A,p,h,g,v)},A.find=function(t){return function(t,e,r,n,a,i,o){var l,s=1/0;return function t(c,u,f,d,p){if(!(u>i||f>o||d<n||p<a)){if(h=c.point){var h,g=e-c.x,v=r-c.y,y=g*g+v*v;if(y<s){var m=Math.sqrt(s=y);n=e-m,a=r-m,i=e+m,o=r+m,l=h}}for(var x=c.nodes,b=.5*(u+d),_=.5*(f+p),w=(r>=_)<<1|e>=b,k=w+4;w<k;++w)if(c=x[3&w])switch(3&w){case 0:t(c,u,f,b,_);break;case 1:t(c,b,f,d,_);break;case 2:t(c,u,_,b,p);break;case 3:t(c,b,_,d,p)}}}(t,n,a,i,o),l}(A,t[0],t[1],p,h,g,v)},f=-1,null==e){for(;++f<d;)T(A,t[f],c[f],u[f],p,h,g,v);--f}else t.forEach(A.add);return c=u=t=s=null,A}return s.x=function(t){return arguments.length?(o=t,s):o},s.y=function(t){return arguments.length?(l=t,s):l},s.extent=function(t){return arguments.length?(null==t?e=r=n=a=null:(e=+t[0][0],r=+t[0][1],n=+t[1][0],a=+t[1][1]),s):null==e?null:[[e,r],[n,a]]},s.size=function(t){return arguments.length?(null==t?e=r=n=a=null:(e=r=0,n=+t[0],a=+t[1]),s):null==e?null:[n-e,a-r]},s},t.interpolateRgb=Va,t.interpolateObject=Ua,t.interpolateNumber=Ga,t.interpolateString=Za;var Xa=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ya=new RegExp(Xa.source,"g");function Wa(e,r){for(var n,a=t.interpolators.length;--a>=0&&!(n=t.interpolators[a](e,r)););return n}function Ja(t,e){var r,n=[],a=[],i=t.length,o=e.length,l=Math.min(t.length,e.length);for(r=0;r<l;++r)n.push(Wa(t[r],e[r]));for(;r<i;++r)a[r]=t[r];for(;r<o;++r)a[r]=e[r];return function(t){for(r=0;r<l;++r)a[r]=n[r](t);return a}}t.interpolate=Wa,t.interpolators=[function(t,e){var r=typeof e;return("string"===r?ge.has(e.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(e)?Va:Za:e instanceof Ht?Va:Array.isArray(e)?Ja:"object"===r&&isNaN(e)?Ua:Ga)(t,e)}],t.interpolateArray=Ja;var $a=function(){return z},Qa=t.map({linear:$a,poly:function(t){return function(e){return Math.pow(e,t)}},quad:function(){return ri},cubic:function(){return ni},sin:function(){return ii},exp:function(){return oi},circle:function(){return li},elastic:function(t,e){var r;arguments.length<2&&(e=.45);arguments.length?r=e/At*Math.asin(1/t):(t=1,r=e/4);return function(n){return 1+t*Math.pow(2,-10*n)*Math.sin((n-r)*At/e)}},back:function(t){t||(t=1.70158);return function(e){return e*e*((t+1)*e-t)}},bounce:function(){return si}}),Ka=t.map({in:z,out:ti,"in-out":ei,"out-in":function(t){return ei(ti(t))}});function ti(t){return function(e){return 1-t(1-e)}}function ei(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function ri(t){return t*t}function ni(t){return t*t*t}function ai(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function ii(t){return 1-Math.cos(t*St)}function oi(t){return Math.pow(2,10*(t-1))}function li(t){return 1-Math.sqrt(1-t*t)}function si(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function ci(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function ui(t){var e,r,n,a=[t.a,t.b],i=[t.c,t.d],o=di(a),l=fi(a,i),s=di(((e=i)[0]+=(n=-l)*(r=a)[0],e[1]+=n*r[1],e))||0;a[0]*i[1]<i[0]*a[1]&&(a[0]*=-1,a[1]*=-1,o*=-1,l*=-1),this.rotate=(o?Math.atan2(a[1],a[0]):Math.atan2(-i[0],i[1]))*Ot,this.translate=[t.e,t.f],this.scale=[o,s],this.skew=s?Math.atan2(l,s)*Ot:0}function fi(t,e){return t[0]*e[0]+t[1]*e[1]}function di(t){var e=Math.sqrt(fi(t,t));return e&&(t[0]/=e,t[1]/=e),e}t.ease=function(t){var e,n=t.indexOf("-"),a=n>=0?t.slice(0,n):t,i=n>=0?t.slice(n+1):"in";return a=Qa.get(a)||$a,i=Ka.get(i)||z,e=i(a.apply(null,r.call(arguments,1))),function(t){return t<=0?0:t>=1?1:e(t)}},t.interpolateHcl=function(e,r){e=t.hcl(e),r=t.hcl(r);var n=e.h,a=e.c,i=e.l,o=r.h-n,l=r.c-a,s=r.l-i;isNaN(l)&&(l=0,a=isNaN(a)?r.c:a);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return Xt(n+o*t,a+l*t,i+s*t)+""}},t.interpolateHsl=function(e,r){e=t.hsl(e),r=t.hsl(r);var n=e.h,a=e.s,i=e.l,o=r.h-n,l=r.s-a,s=r.l-i;isNaN(l)&&(l=0,a=isNaN(a)?r.s:a);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return Ut(n+o*t,a+l*t,i+s*t)+""}},t.interpolateLab=function(e,r){e=t.lab(e),r=t.lab(r);var n=e.l,a=e.a,i=e.b,o=r.l-n,l=r.a-a,s=r.b-i;return function(t){return te(n+o*t,a+l*t,i+s*t)+""}},t.interpolateRound=ci,t.transform=function(e){var r=a.createElementNS(t.ns.prefix.svg,"g");return(t.transform=function(t){if(null!=t){r.setAttribute("transform",t);var e=r.transform.baseVal.consolidate()}return new ui(e?e.matrix:pi)})(e)},ui.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var pi={a:1,b:0,c:0,d:1,e:0,f:0};function hi(t){return t.length?t.pop()+",":""}function gi(e,r){var n=[],a=[];return e=t.transform(e),r=t.transform(r),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push("translate(",null,",",null,")");n.push({i:a-4,x:Ga(t[0],e[0])},{i:a-2,x:Ga(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}(e.translate,r.translate,n,a),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(hi(r)+"rotate(",null,")")-2,x:Ga(t,e)})):e&&r.push(hi(r)+"rotate("+e+")")}(e.rotate,r.rotate,n,a),function(t,e,r,n){t!==e?n.push({i:r.push(hi(r)+"skewX(",null,")")-2,x:Ga(t,e)}):e&&r.push(hi(r)+"skewX("+e+")")}(e.skew,r.skew,n,a),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push(hi(r)+"scale(",null,",",null,")");n.push({i:a-4,x:Ga(t[0],e[0])},{i:a-2,x:Ga(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(hi(r)+"scale("+e+")")}(e.scale,r.scale,n,a),e=r=null,function(t){for(var e,r=-1,i=a.length;++r<i;)n[(e=a[r]).i]=e.x(t);return n.join("")}}function vi(t,e){return e=(e-=t=+t)||1/e,function(r){return(r-t)/e}}function yi(t,e){return e=(e-=t=+t)||1/e,function(r){return Math.max(0,Math.min(1,(r-t)/e))}}function mi(t){for(var e=t.source,r=t.target,n=function(t,e){if(t===e)return t;var r=xi(t),n=xi(e),a=r.pop(),i=n.pop(),o=null;for(;a===i;)o=a,a=r.pop(),i=n.pop();return o}(e,r),a=[e];e!==n;)e=e.parent,a.push(e);for(var i=a.length;r!==n;)a.splice(i,0,r),r=r.parent;return a}function xi(t){for(var e=[],r=t.parent;null!=r;)e.push(t),t=r,r=r.parent;return e.push(t),e}function bi(t){t.fixed|=2}function _i(t){t.fixed&=-7}function wi(t){t.fixed|=4,t.px=t.x,t.py=t.y}function ki(t){t.fixed&=-5}t.interpolateTransform=gi,t.layout={},t.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r<n;)e.push(mi(t[r]));return e}},t.layout.chord=function(){var e,r,n,a,i,o,l,s={},c=0;function u(){var s,u,d,p,h,g={},v=[],y=t.range(a),m=[];for(e=[],r=[],s=0,p=-1;++p<a;){for(u=0,h=-1;++h<a;)u+=n[p][h];v.push(u),m.push(t.range(a)),s+=u}for(i&&y.sort(function(t,e){return i(v[t],v[e])}),o&&m.forEach(function(t,e){t.sort(function(t,r){return o(n[e][t],n[e][r])})}),s=(At-c*a)/s,u=0,p=-1;++p<a;){for(d=u,h=-1;++h<a;){var x=y[p],b=m[x][h],_=n[x][b],w=u,k=u+=_*s;g[x+"-"+b]={index:x,subindex:b,startAngle:w,endAngle:k,value:_}}r[x]={index:x,startAngle:d,endAngle:u,value:v[x]},u+=c}for(p=-1;++p<a;)for(h=p-1;++h<a;){var T=g[p+"-"+h],M=g[h+"-"+p];(T.value||M.value)&&e.push(T.value<M.value?{source:M,target:T}:{source:T,target:M})}l&&f()}function f(){e.sort(function(t,e){return l((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)})}return s.matrix=function(t){return arguments.length?(a=(n=t)&&n.length,e=r=null,s):n},s.padding=function(t){return arguments.length?(c=t,e=r=null,s):c},s.sortGroups=function(t){return arguments.length?(i=t,e=r=null,s):i},s.sortSubgroups=function(t){return arguments.length?(o=t,e=null,s):o},s.sortChords=function(t){return arguments.length?(l=t,e&&f(),s):l},s.chords=function(){return e||u(),e},s.groups=function(){return r||u(),r},s},t.layout.force=function(){var e,r,n,a,i,o,l={},s=t.dispatch("start","tick","end"),c=[1,1],u=.9,f=Ti,d=Mi,p=-30,h=Ai,g=.1,v=.64,y=[],m=[];function x(t){return function(e,r,n,a){if(e.point!==t){var i=e.cx-t.x,o=e.cy-t.y,l=a-r,s=i*i+o*o;if(l*l/v<s){if(s<h){var c=e.charge/s;t.px-=i*c,t.py-=o*c}return!0}if(e.point&&s&&s<h){c=e.pointCharge/s;t.px-=i*c,t.py-=o*c}}return!e.charge}}function b(e){e.px=t.event.x,e.py=t.event.y,l.resume()}return l.tick=function(){if((n*=.99)<.005)return e=null,s.end({type:"end",alpha:n=0}),!0;var r,l,f,d,h,v,b,_,w,k=y.length,T=m.length;for(l=0;l<T;++l)d=(f=m[l]).source,(v=(_=(h=f.target).x-d.x)*_+(w=h.y-d.y)*w)&&(_*=v=n*i[l]*((v=Math.sqrt(v))-a[l])/v,w*=v,h.x-=_*(b=d.weight+h.weight?d.weight/(d.weight+h.weight):.5),h.y-=w*b,d.x+=_*(b=1-b),d.y+=w*b);if((b=n*g)&&(_=c[0]/2,w=c[1]/2,l=-1,b))for(;++l<k;)(f=y[l]).x+=(_-f.x)*b,f.y+=(w-f.y)*b;if(p)for(!function t(e,r,n){var a=0,i=0;e.charge=0;if(!e.leaf)for(var o,l=e.nodes,s=l.length,c=-1;++c<s;)null!=(o=l[c])&&(t(o,r,n),e.charge+=o.charge,a+=o.charge*o.cx,i+=o.charge*o.cy);if(e.point){e.leaf||(e.point.x+=Math.random()-.5,e.point.y+=Math.random()-.5);var u=r*n[e.point.index];e.charge+=e.pointCharge=u,a+=u*e.point.x,i+=u*e.point.y}e.cx=a/e.charge;e.cy=i/e.charge}(r=t.geom.quadtree(y),n,o),l=-1;++l<k;)(f=y[l]).fixed||r.visit(x(f));for(l=-1;++l<k;)(f=y[l]).fixed?(f.x=f.px,f.y=f.py):(f.x-=(f.px-(f.px=f.x))*u,f.y-=(f.py-(f.py=f.y))*u);s.tick({type:"tick",alpha:n})},l.nodes=function(t){return arguments.length?(y=t,l):y},l.links=function(t){return arguments.length?(m=t,l):m},l.size=function(t){return arguments.length?(c=t,l):c},l.linkDistance=function(t){return arguments.length?(f="function"==typeof t?t:+t,l):f},l.distance=l.linkDistance,l.linkStrength=function(t){return arguments.length?(d="function"==typeof t?t:+t,l):d},l.friction=function(t){return arguments.length?(u=+t,l):u},l.charge=function(t){return arguments.length?(p="function"==typeof t?t:+t,l):p},l.chargeDistance=function(t){return arguments.length?(h=t*t,l):Math.sqrt(h)},l.gravity=function(t){return arguments.length?(g=+t,l):g},l.theta=function(t){return arguments.length?(v=t*t,l):Math.sqrt(v)},l.alpha=function(t){return arguments.length?(t=+t,n?t>0?n=t:(e.c=null,e.t=NaN,e=null,s.end({type:"end",alpha:n=0})):t>0&&(s.start({type:"start",alpha:n=t}),e=Te(l.tick)),l):n},l.start=function(){var t,e,r,n=y.length,s=m.length,u=c[0],h=c[1];for(t=0;t<n;++t)(r=y[t]).index=t,r.weight=0;for(t=0;t<s;++t)"number"==typeof(r=m[t]).source&&(r.source=y[r.source]),"number"==typeof r.target&&(r.target=y[r.target]),++r.source.weight,++r.target.weight;for(t=0;t<n;++t)r=y[t],isNaN(r.x)&&(r.x=g("x",u)),isNaN(r.y)&&(r.y=g("y",h)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(a=[],"function"==typeof f)for(t=0;t<s;++t)a[t]=+f.call(this,m[t],t);else for(t=0;t<s;++t)a[t]=f;if(i=[],"function"==typeof d)for(t=0;t<s;++t)i[t]=+d.call(this,m[t],t);else for(t=0;t<s;++t)i[t]=d;if(o=[],"function"==typeof p)for(t=0;t<n;++t)o[t]=+p.call(this,y[t],t);else for(t=0;t<n;++t)o[t]=p;function g(r,a){if(!e){for(e=new Array(n),c=0;c<n;++c)e[c]=[];for(c=0;c<s;++c){var i=m[c];e[i.source.index].push(i.target),e[i.target.index].push(i.source)}}for(var o,l=e[t],c=-1,u=l.length;++c<u;)if(!isNaN(o=l[c][r]))return o;return Math.random()*a}return l.resume()},l.resume=function(){return l.alpha(.1)},l.stop=function(){return l.alpha(0)},l.drag=function(){if(r||(r=t.behavior.drag().origin(z).on("dragstart.force",bi).on("drag.force",b).on("dragend.force",_i)),!arguments.length)return r;this.on("mouseover.force",wi).on("mouseout.force",ki).call(r)},t.rebind(l,s,"on")};var Ti=20,Mi=1,Ai=1/0;function Li(e,r){return t.rebind(e,r,"sort","children","value"),e.nodes=e,e.links=Pi,e}function Si(t,e){for(var r=[t];null!=(t=r.pop());)if(e(t),(a=t.children)&&(n=a.length))for(var n,a;--n>=0;)r.push(a[n])}function Ci(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(i=t.children)&&(a=i.length))for(var a,i,o=-1;++o<a;)r.push(i[o]);for(;null!=(t=n.pop());)e(t)}function Oi(t){return t.children}function zi(t){return t.value}function Di(t,e){return e.value-t.value}function Pi(e){return t.merge(e.map(function(t){return(t.children||[]).map(function(e){return{source:t,target:e}})}))}t.layout.hierarchy=function(){var t=Di,e=Oi,r=zi;function n(a){var i,o=[a],l=[];for(a.depth=0;null!=(i=o.pop());)if(l.push(i),(c=e.call(n,i,i.depth))&&(s=c.length)){for(var s,c,u;--s>=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 Ci(a,function(e){var n,a;t&&(n=e.children)&&n.sort(t),r&&(a=e.parent)&&(a.value+=e.value)}),l}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(Si(t,function(t){t.children&&(t.value=0)}),Ci(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},t.layout.partition=function(){var e=t.layout.hierarchy(),r=[1,1];function n(t,n){var a=e.call(this,t,n);return function t(e,r,n,a){var i=e.children;if(e.x=r,e.y=e.depth*a,e.dx=n,e.dy=a,i&&(o=i.length)){var o,l,s,c=-1;for(n=e.value?n/e.value:0;++c<o;)t(l=i[c],r,s=l.value*n,a),r+=s}}(a[0],0,r[0],r[1]/function t(e){var r=e.children,n=0;if(r&&(a=r.length))for(var a,i=-1;++i<a;)n=Math.max(n,t(r[i]));return 1+n}(a[0])),a}return n.size=function(t){return arguments.length?(r=t,n):r},Li(n,e)},t.layout.pie=function(){var e=Number,r=Ei,n=0,a=At,i=0;function o(l){var s,c=l.length,u=l.map(function(t,r){return+e.call(o,t,r)}),f=+("function"==typeof n?n.apply(this,arguments):n),d=("function"==typeof a?a.apply(this,arguments):a)-f,p=Math.min(Math.abs(d)/c,+("function"==typeof i?i.apply(this,arguments):i)),h=p*(d<0?-1:1),g=t.sum(u),v=g?(d-c*h)/g:0,y=t.range(c),m=[];return null!=r&&y.sort(r===Ei?function(t,e){return u[e]-u[t]}:function(t,e){return r(l[t],l[e])}),y.forEach(function(t){m[t]={data:l[t],value:s=u[t],startAngle:f,endAngle:f+=s*v+h,padAngle:p}}),m}return o.value=function(t){return arguments.length?(e=t,o):e},o.sort=function(t){return arguments.length?(r=t,o):r},o.startAngle=function(t){return arguments.length?(n=t,o):n},o.endAngle=function(t){return arguments.length?(a=t,o):a},o.padAngle=function(t){return arguments.length?(i=t,o):i},o};var Ei={};function Ri(t){return t.x}function Ii(t){return t.y}function Fi(t,e,r){t.y0=e,t.y=r}t.layout.stack=function(){var e=z,r=ji,n=Hi,a=Fi,i=Ri,o=Ii;function l(s,c){if(!(p=s.length))return s;var u=s.map(function(t,r){return e.call(l,t,r)}),f=u.map(function(t){return t.map(function(t,e){return[i.call(l,t,e),o.call(l,t,e)]})}),d=r.call(l,f,c);u=t.permute(u,d),f=t.permute(f,d);var p,h,g,v,y=n.call(l,f,c),m=u[0].length;for(g=0;g<m;++g)for(a.call(l,u[0][g],v=y[g],f[0][g][1]),h=1;h<p;++h)a.call(l,u[h][g],v+=f[h-1][g][1],f[h][g][1]);return s}return l.values=function(t){return arguments.length?(e=t,l):e},l.order=function(t){return arguments.length?(r="function"==typeof t?t:Ni.get(t)||ji,l):r},l.offset=function(t){return arguments.length?(n="function"==typeof t?t:Bi.get(t)||Hi,l):n},l.x=function(t){return arguments.length?(i=t,l):i},l.y=function(t){return arguments.length?(o=t,l):o},l.out=function(t){return arguments.length?(a=t,l):a},l};var Ni=t.map({"inside-out":function(e){var r,n,a=e.length,i=e.map(qi),o=e.map(Vi),l=t.range(a).sort(function(t,e){return i[t]-i[e]}),s=0,c=0,u=[],f=[];for(r=0;r<a;++r)n=l[r],s<c?(s+=o[n],u.push(n)):(c+=o[n],f.push(n));return f.reverse().concat(u)},reverse:function(e){return t.range(e.length).reverse()},default:ji}),Bi=t.map({silhouette:function(t){var e,r,n,a=t.length,i=t[0].length,o=[],l=0,s=[];for(r=0;r<i;++r){for(e=0,n=0;e<a;e++)n+=t[e][r][1];n>l&&(l=n),o.push(n)}for(r=0;r<i;++r)s[r]=(l-o[r])/2;return s},wiggle:function(t){var e,r,n,a,i,o,l,s,c,u=t.length,f=t[0],d=f.length,p=[];for(p[0]=s=c=0,r=1;r<d;++r){for(e=0,a=0;e<u;++e)a+=t[e][r][1];for(e=0,i=0,l=f[r][0]-f[r-1][0];e<u;++e){for(n=0,o=(t[e][r][1]-t[e][r-1][1])/(2*l);n<e;++n)o+=(t[n][r][1]-t[n][r-1][1])/l;i+=o*t[e][r][1]}p[r]=s-=a?i/a*l:0,s<c&&(c=s)}for(r=0;r<d;++r)p[r]-=c;return p},expand:function(t){var e,r,n,a=t.length,i=t[0].length,o=1/a,l=[];for(r=0;r<i;++r){for(e=0,n=0;e<a;e++)n+=t[e][r][1];if(n)for(e=0;e<a;e++)t[e][r][1]/=n;else for(e=0;e<a;e++)t[e][r][1]=o}for(r=0;r<i;++r)l[r]=0;return l},zero:Hi});function ji(e){return t.range(e.length)}function Hi(t){for(var e=-1,r=t[0].length,n=[];++e<r;)n[e]=0;return n}function qi(t){for(var e,r=1,n=0,a=t[0][1],i=t.length;r<i;++r)(e=t[r][1])>a&&(n=r,a=e);return n}function Vi(t){return t.reduce(Ui,0)}function Ui(t,e){return t+e[1]}function Gi(t,e){return Zi(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function Zi(t,e){for(var r=-1,n=+t[0],a=(t[1]-n)/e,i=[];++r<=e;)i[r]=a*r+n;return i}function Xi(e){return[t.min(e),t.max(e)]}function Yi(t,e){return t.value-e.value}function Wi(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function Ji(t,e){t._pack_next=e,e._pack_prev=t}function $i(t,e){var r=e.x-t.x,n=e.y-t.y,a=t.r+e.r;return.999*a*a>r*r+n*n}function Qi(t){if((e=t.children)&&(s=e.length)){var e,r,n,a,i,o,l,s,c=1/0,u=-1/0,f=1/0,d=-1/0;if(e.forEach(Ki),(r=e[0]).x=-r.r,r.y=0,x(r),s>1&&((n=e[1]).x=n.r,n.y=0,x(n),s>2))for(eo(r,n,a=e[2]),x(a),Wi(r,a),r._pack_prev=a,Wi(a,n),n=r._pack_next,i=3;i<s;i++){eo(r,n,a=e[i]);var p=0,h=1,g=1;for(o=n._pack_next;o!==n;o=o._pack_next,h++)if($i(o,a)){p=1;break}if(1==p)for(l=r._pack_prev;l!==o._pack_prev&&!$i(l,a);l=l._pack_prev,g++);p?(h<g||h==g&&n.r<r.r?Ji(r,n=o):Ji(r=l,n),i--):(Wi(r,a),n=a,x(a))}var v=(c+u)/2,y=(f+d)/2,m=0;for(i=0;i<s;i++)(a=e[i]).x-=v,a.y-=y,m=Math.max(m,a.r+Math.sqrt(a.x*a.x+a.y*a.y));t.r=m,e.forEach(to)}function x(t){c=Math.min(t.x-t.r,c),u=Math.max(t.x+t.r,u),f=Math.min(t.y-t.r,f),d=Math.max(t.y+t.r,d)}}function Ki(t){t._pack_next=t._pack_prev=t}function to(t){delete t._pack_next,delete t._pack_prev}function eo(t,e,r){var n=t.r+r.r,a=e.x-t.x,i=e.y-t.y;if(n&&(a||i)){var o=e.r+r.r,l=a*a+i*i,s=.5+((n*=n)-(o*=o))/(2*l),c=Math.sqrt(Math.max(0,2*o*(n+l)-(n-=l)*n-o*o))/(2*l);r.x=t.x+s*a+c*i,r.y=t.y+s*i-c*a}else r.x=t.x+n,r.y=t.y}function ro(t,e){return t.parent==e.parent?1:2}function no(t){var e=t.children;return e.length?e[0]:t.t}function ao(t){var e,r=t.children;return(e=r.length)?r[e-1]:t.t}function io(t,e,r){var n=r/(e.i-t.i);e.c-=n,e.s+=r,t.c+=n,e.z+=r,e.m+=r}function oo(t,e,r){return t.a.parent===e.parent?t.a:r}function lo(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function so(t,e){var r=t.x+e[3],n=t.y+e[0],a=t.dx-e[1]-e[3],i=t.dy-e[0]-e[2];return a<0&&(r+=a/2,a=0),i<0&&(n+=i/2,i=0),{x:r,y:n,dx:a,dy:i}}function co(t){var e=t[0],r=t[t.length-1];return e<r?[e,r]:[r,e]}function uo(t){return t.rangeExtent?t.rangeExtent():co(t.range())}function fo(t,e,r,n){var a=r(t[0],t[1]),i=n(e[0],e[1]);return function(t){return i(a(t))}}function po(t,e){var r,n=0,a=t.length-1,i=t[n],o=t[a];return o<i&&(r=n,n=a,a=r,r=i,i=o,o=r),t[n]=e.floor(i),t[a]=e.ceil(o),t}function ho(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:go}t.layout.histogram=function(){var e=!0,r=Number,n=Xi,a=Gi;function i(i,o){for(var l,s,c=[],u=i.map(r,this),f=n.call(this,u,o),d=a.call(this,f,u,o),p=(o=-1,u.length),h=d.length-1,g=e?1:1/p;++o<h;)(l=c[o]=[]).dx=d[o+1]-(l.x=d[o]),l.y=0;if(h>0)for(o=-1;++o<p;)(s=u[o])>=f[0]&&s<=f[1]&&((l=c[t.bisect(d,s,1,h)-1]).y+=g,l.push(i[o]));return c}return i.value=function(t){return arguments.length?(r=t,i):r},i.range=function(t){return arguments.length?(n=ve(t),i):n},i.bins=function(t){return arguments.length?(a="number"==typeof t?function(e){return Zi(e,t)}:ve(t),i):a},i.frequency=function(t){return arguments.length?(e=!!t,i):e},i},t.layout.pack=function(){var e,r=t.layout.hierarchy().sort(Yi),n=0,a=[1,1];function i(t,i){var o=r.call(this,t,i),l=o[0],s=a[0],c=a[1],u=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(l.x=l.y=0,Ci(l,function(t){t.r=+u(t.value)}),Ci(l,Qi),n){var f=n*(e?1:Math.max(2*l.r/s,2*l.r/c))/2;Ci(l,function(t){t.r+=f}),Ci(l,Qi),Ci(l,function(t){t.r-=f})}return function t(e,r,n,a){var i=e.children;e.x=r+=a*e.x;e.y=n+=a*e.y;e.r*=a;if(i)for(var o=-1,l=i.length;++o<l;)t(i[o],r,n,a)}(l,s/2,c/2,e?1:1/Math.max(2*l.r/s,2*l.r/c)),o}return i.size=function(t){return arguments.length?(a=t,i):a},i.radius=function(t){return arguments.length?(e=null==t||"function"==typeof t?t:+t,i):e},i.padding=function(t){return arguments.length?(n=+t,i):n},Li(i,r)},t.layout.tree=function(){var e=t.layout.hierarchy().sort(null).value(null),r=ro,n=[1,1],a=null;function i(t,i){var c=e.call(this,t,i),u=c[0],f=function(t){var e,r={A:null,children:[t]},n=[r];for(;null!=(e=n.pop());)for(var a,i=e.children,o=0,l=i.length;o<l;++o)n.push((i[o]=a={_:i[o],parent:e,children:(a=i[o].children)&&a.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=a);return r.children[0]}(u);if(Ci(f,o),f.parent.m=-f.z,Si(f,l),a)Si(u,s);else{var d=u,p=u,h=u;Si(u,function(t){t.x<d.x&&(d=t),t.x>p.x&&(p=t),t.depth>h.depth&&(h=t)});var g=r(d,p)/2-d.x,v=n[0]/(p.x+r(p,d)/2+g),y=n[1]/(h.depth||1);Si(u,function(t){t.x=(t.x+g)*v,t.y=t.depth*y})}return c}function o(t){var e=t.children,n=t.parent.children,a=t.i?n[t.i-1]:null;if(e.length){!function(t){var e,r=0,n=0,a=t.children,i=a.length;for(;--i>=0;)(e=a[i]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var i=(e[0].z+e[e.length-1].z)/2;a?(t.z=a.z+r(t._,a._),t.m=t.z-i):t.z=i}else a&&(t.z=a.z+r(t._,a._));t.parent.A=function(t,e,n){if(e){for(var a,i=t,o=t,l=e,s=i.parent.children[0],c=i.m,u=o.m,f=l.m,d=s.m;l=ao(l),i=no(i),l&&i;)s=no(s),(o=ao(o)).a=t,(a=l.z+f-i.z-c+r(l._,i._))>0&&(io(oo(l,t,n),t,a),c+=a,u+=a),f+=l.m,c+=i.m,d+=s.m,u+=o.m;l&&!ao(o)&&(o.t=l,o.m+=f-u),i&&!no(s)&&(s.t=i,s.m+=c-d,n=t)}return n}(t,a,t.parent.A||n[0])}function l(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=n[0],t.y=t.depth*n[1]}return i.separation=function(t){return arguments.length?(r=t,i):r},i.size=function(t){return arguments.length?(a=null==(n=t)?s:null,i):a?null:n},i.nodeSize=function(t){return arguments.length?(a=null==(n=t)?null:s,i):a?n:null},Li(i,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=ro,n=[1,1],a=!1;function i(i,o){var l,s=e.call(this,i,o),c=s[0],u=0;Ci(c,function(e){var n=e.children;n&&n.length?(e.x=function(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}(n),e.y=function(e){return 1+t.max(e,function(t){return t.y})}(n)):(e.x=l?u+=r(e,l):0,e.y=0,l=e)});var f=function t(e){var r=e.children;return r&&r.length?t(r[0]):e}(c),d=function t(e){var r,n=e.children;return n&&(r=n.length)?t(n[r-1]):e}(c),p=f.x-r(f,d)/2,h=d.x+r(d,f)/2;return Ci(c,a?function(t){t.x=(t.x-c.x)*n[0],t.y=(c.y-t.y)*n[1]}:function(t){t.x=(t.x-p)/(h-p)*n[0],t.y=(1-(c.y?t.y/c.y:1))*n[1]}),s}return i.separation=function(t){return arguments.length?(r=t,i):r},i.size=function(t){return arguments.length?(a=null==(n=t),i):a?null:n},i.nodeSize=function(t){return arguments.length?(a=null!=(n=t),i):a?n:null},Li(i,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,a=[1,1],i=null,o=lo,l=!1,s="squarify",c=.5*(1+Math.sqrt(5));function u(t,e){for(var r,n,a=-1,i=t.length;++a<i;)n=(r=t[a]).value*(e<0?0:e),r.area=isNaN(n)||n<=0?0:n}function f(t){var e=t.children;if(e&&e.length){var r,n,a,i=o(t),l=[],c=e.slice(),d=1/0,g="slice"===s?i.dx:"dice"===s?i.dy:"slice-dice"===s?1&t.depth?i.dy:i.dx:Math.min(i.dx,i.dy);for(u(c,i.dx*i.dy/t.value),l.area=0;(a=c.length)>0;)l.push(r=c[a-1]),l.area+=r.area,"squarify"!==s||(n=p(l,g))<=d?(c.pop(),d=n):(l.area-=l.pop().area,h(l,g,i,!1),g=Math.min(i.dx,i.dy),l.length=l.area=0,d=1/0);l.length&&(h(l,g,i,!0),l.length=l.area=0),e.forEach(f)}}function d(t){var e=t.children;if(e&&e.length){var r,n=o(t),a=e.slice(),i=[];for(u(a,n.dx*n.dy/t.value),i.area=0;r=a.pop();)i.push(r),i.area+=r.area,null!=r.z&&(h(i,r.z?n.dx:n.dy,n,!a.length),i.length=i.area=0);e.forEach(d)}}function p(t,e){for(var r,n=t.area,a=0,i=1/0,o=-1,l=t.length;++o<l;)(r=t[o].area)&&(r<i&&(i=r),r>a&&(a=r));return e*=e,(n*=n)?Math.max(e*a*c/n,n/(e*i*c)):1/0}function h(t,e,r,a){var i,o=-1,l=t.length,s=r.x,c=r.y,u=e?n(t.area/e):0;if(e==r.dx){for((a||u>r.dy)&&(u=r.dy);++o<l;)(i=t[o]).x=s,i.y=c,i.dy=u,s+=i.dx=Math.min(r.x+r.dx-s,u?n(i.area/u):0);i.z=!0,i.dx+=r.x+r.dx-s,r.y+=u,r.dy-=u}else{for((a||u>r.dx)&&(u=r.dx);++o<l;)(i=t[o]).x=s,i.y=c,i.dx=u,c+=i.dy=Math.min(r.y+r.dy-c,u?n(i.area/u):0);i.z=!1,i.dy+=r.y+r.dy-c,r.x+=u,r.dx-=u}}function g(t){var n=e||r(t),i=n[0];return i.x=i.y=0,i.value?(i.dx=a[0],i.dy=a[1]):i.dx=i.dy=0,e&&r.revalue(i),u([i],i.dx*i.dy/i.value),(e?d:f)(i),l&&(e=n),n}return g.size=function(t){return arguments.length?(a=t,g):a},g.padding=function(t){if(!arguments.length)return i;function e(e){return so(e,t)}var r;return o=null==(i=t)?lo:"function"==(r=typeof t)?function(e){var r=t.call(g,e,e.depth);return null==r?lo(e):so(e,"number"==typeof r?[r,r,r,r]:r)}:"number"===r?(t=[t,t,t,t],e):e,g},g.round=function(t){return arguments.length?(n=t?Math.round:Number,g):n!=Number},g.sticky=function(t){return arguments.length?(l=t,e=null,g):l},g.ratio=function(t){return arguments.length?(c=t,g):c},g.mode=function(t){return arguments.length?(s=t+"",g):s},Li(g,r)},t.random={normal:function(t,e){var r=arguments.length;return r<2&&(e=1),r<1&&(t=0),function(){var r,n,a;do{a=(r=2*Math.random()-1)*r+(n=2*Math.random()-1)*n}while(!a||a>1);return t+e*r*Math.sqrt(-2*Math.log(a)/a)}},logNormal:function(){var e=t.random.normal.apply(t,arguments);return function(){return Math.exp(e())}},bates:function(e){var r=t.random.irwinHall(e);return function(){return r()/e}},irwinHall:function(t){return function(){for(var e=0,r=0;r<t;r++)e+=Math.random();return e}}},t.scale={};var go={floor:z,ceil:z};function vo(e,r,n,a){var i=[],o=[],l=0,s=Math.min(e.length,r.length)-1;for(e[s]<e[0]&&(e=e.slice().reverse(),r=r.slice().reverse());++l<=s;)i.push(n(e[l-1],e[l])),o.push(a(r[l-1],r[l]));return function(r){var n=t.bisect(e,r,1,s)-1;return o[n](i[n](r))}}function yo(e,r){return t.rebind(e,r,"range","rangeRound","interpolate","clamp")}function mo(t,e){return po(t,ho(xo(t,e)[2])),po(t,ho(xo(t,e)[2])),t}function xo(t,e){null==e&&(e=10);var r=co(t),n=r[1]-r[0],a=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),i=e/n*a;return i<=.15?a*=10:i<=.35?a*=5:i<=.75&&(a*=2),r[0]=Math.ceil(r[0]/a)*a,r[1]=Math.floor(r[1]/a)*a+.5*a,r[2]=a,r}function bo(e,r){return t.range.apply(t,xo(e,r))}function _o(e,r,n){var a=xo(e,r);if(n){var i=Oe.exec(n);if(i.shift(),"s"===i[8]){var o=t.formatPrefix(Math.max(m(a[0]),m(a[1])));return i[7]||(i[7]="."+ko(o.scale(a[2]))),i[8]="f",n=t.format(i.join("")),function(t){return n(o.scale(t))+o.symbol}}i[7]||(i[7]="."+function(t,e){var r=ko(e[2]);return t in wo?Math.abs(r-ko(Math.max(m(e[0]),m(e[1]))))+ +("e"!==t):r-2*("%"===t)}(i[8],a)),n=i.join("")}else n=",."+ko(a[2])+"f";return t.format(n)}t.scale.linear=function(){return function t(e,r,n,a){var i,o;function l(){var t=Math.min(e.length,r.length)>2?vo:fo,l=a?yi:vi;return i=t(e,r,l,n),o=t(r,e,l,Wa),s}function s(t){return i(t)}s.invert=function(t){return o(t)};s.domain=function(t){return arguments.length?(e=t.map(Number),l()):e};s.range=function(t){return arguments.length?(r=t,l()):r};s.rangeRound=function(t){return s.range(t).interpolate(ci)};s.clamp=function(t){return arguments.length?(a=t,l()):a};s.interpolate=function(t){return arguments.length?(n=t,l()):n};s.ticks=function(t){return bo(e,t)};s.tickFormat=function(t,r){return _o(e,t,r)};s.nice=function(t){return mo(e,t),l()};s.copy=function(){return t(e,r,n,a)};return l()}([0,1],[0,1],Wa,!1)};var wo={s:1,g:1,p:1,r:1,e:1};function ko(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}t.scale.log=function(){return function e(r,n,a,i){function o(t){return(a?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(n)}function l(t){return a?Math.pow(n,t):-Math.pow(n,-t)}function s(t){return r(o(t))}s.invert=function(t){return l(r.invert(t))};s.domain=function(t){return arguments.length?(a=t[0]>=0,r.domain((i=t.map(Number)).map(o)),s):i};s.base=function(t){return arguments.length?(n=+t,r.domain(i.map(o)),s):n};s.nice=function(){var t=po(i.map(o),a?Math:Mo);return r.domain(t),i=t.map(l),s};s.ticks=function(){var t=co(i),e=[],r=t[0],s=t[1],c=Math.floor(o(r)),u=Math.ceil(o(s)),f=n%1?2:n;if(isFinite(u-c)){if(a){for(;c<u;c++)for(var d=1;d<f;d++)e.push(l(c)*d);e.push(l(c))}else for(e.push(l(c));c++<u;)for(var d=f-1;d>0;d--)e.push(l(c)*d);for(c=0;e[c]<r;c++);for(u=e.length;e[u-1]>s;u--);e=e.slice(c,u)}return e};s.tickFormat=function(e,r){if(!arguments.length)return To;arguments.length<2?r=To:"function"!=typeof r&&(r=t.format(r));var a=Math.max(1,n*e/s.ticks().length);return function(t){var e=t/l(Math.round(o(t)));return e*n<n-.5&&(e*=n),e<=a?r(t):""}};s.copy=function(){return e(r.copy(),n,a,i)};return yo(s,r)}(t.scale.linear().domain([0,1]),10,!0,[1,10])};var To=t.format(".0e"),Mo={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function Ao(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}t.scale.pow=function(){return function t(e,r,n){var a=Ao(r),i=Ao(1/r);function o(t){return e(a(t))}o.invert=function(t){return i(e.invert(t))};o.domain=function(t){return arguments.length?(e.domain((n=t.map(Number)).map(a)),o):n};o.ticks=function(t){return bo(n,t)};o.tickFormat=function(t,e){return _o(n,t,e)};o.nice=function(t){return o.domain(mo(n,t))};o.exponent=function(t){return arguments.length?(a=Ao(r=t),i=Ao(1/r),e.domain(n.map(a)),o):r};o.copy=function(){return t(e.copy(),r,n)};return yo(o,e)}(t.scale.linear(),1,[0,1])},t.scale.sqrt=function(){return t.scale.pow().exponent(.5)},t.scale.ordinal=function(){return function e(r,n){var a,i,o;function l(t){return i[((a.get(t)||("range"===n.t?a.set(t,r.push(t)):NaN))-1)%i.length]}function s(e,n){return t.range(r.length).map(function(t){return e+n*t})}l.domain=function(t){if(!arguments.length)return r;r=[],a=new b;for(var e,i=-1,o=t.length;++i<o;)a.has(e=t[i])||a.set(e,r.push(e));return l[n.t].apply(l,n.a)};l.range=function(t){return arguments.length?(i=t,o=0,n={t:"range",a:arguments},l):i};l.rangePoints=function(t,e){arguments.length<2&&(e=0);var a=t[0],c=t[1],u=r.length<2?(a=(a+c)/2,0):(c-a)/(r.length-1+e);return i=s(a+u*e/2,u),o=0,n={t:"rangePoints",a:arguments},l};l.rangeRoundPoints=function(t,e){arguments.length<2&&(e=0);var a=t[0],c=t[1],u=r.length<2?(a=c=Math.round((a+c)/2),0):(c-a)/(r.length-1+e)|0;return i=s(a+Math.round(u*e/2+(c-a-(r.length-1+e)*u)/2),u),o=0,n={t:"rangeRoundPoints",a:arguments},l};l.rangeBands=function(t,e,a){arguments.length<2&&(e=0),arguments.length<3&&(a=e);var c=t[1]<t[0],u=t[c-0],f=t[1-c],d=(f-u)/(r.length-e+2*a);return i=s(u+d*a,d),c&&i.reverse(),o=d*(1-e),n={t:"rangeBands",a:arguments},l};l.rangeRoundBands=function(t,e,a){arguments.length<2&&(e=0),arguments.length<3&&(a=e);var c=t[1]<t[0],u=t[c-0],f=t[1-c],d=Math.floor((f-u)/(r.length-e+2*a));return i=s(u+Math.round((f-u-(r.length-e)*d)/2),d),c&&i.reverse(),o=Math.round(d*(1-e)),n={t:"rangeRoundBands",a:arguments},l};l.rangeBand=function(){return o};l.rangeExtent=function(){return co(n.a[0])};l.copy=function(){return e(r,n)};return l.domain(r)}([],{t:"range",a:[[]]})},t.scale.category10=function(){return t.scale.ordinal().range(Lo)},t.scale.category20=function(){return t.scale.ordinal().range(So)},t.scale.category20b=function(){return t.scale.ordinal().range(Co)},t.scale.category20c=function(){return t.scale.ordinal().range(Oo)};var Lo=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(le),So=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(le),Co=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(le),Oo=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(le);function zo(){return 0}t.scale.quantile=function(){return function e(r,n){var a;function i(){var e=0,i=n.length;for(a=[];++e<i;)a[e-1]=t.quantile(r,e/i);return o}function o(e){if(!isNaN(e=+e))return n[t.bisect(a,e)]}o.domain=function(t){return arguments.length?(r=t.map(p).filter(h).sort(d),i()):r};o.range=function(t){return arguments.length?(n=t,i()):n};o.quantiles=function(){return a};o.invertExtent=function(t){return(t=n.indexOf(t))<0?[NaN,NaN]:[t>0?a[t-1]:r[0],t<a.length?a[t]:r[r.length-1]]};o.copy=function(){return e(r,n)};return i()}([],[])},t.scale.quantize=function(){return function t(e,r,n){var a,i;function o(t){return n[Math.max(0,Math.min(i,Math.floor(a*(t-e))))]}function l(){return a=n.length/(r-e),i=n.length-1,o}o.domain=function(t){return arguments.length?(e=+t[0],r=+t[t.length-1],l()):[e,r]};o.range=function(t){return arguments.length?(n=t,l()):n};o.invertExtent=function(t){return[t=(t=n.indexOf(t))<0?NaN:t/a+e,t+1/a]};o.copy=function(){return t(e,r,n)};return l()}(0,1,[0,1])},t.scale.threshold=function(){return function e(r,n){function a(e){if(e<=e)return n[t.bisect(r,e)]}a.domain=function(t){return arguments.length?(r=t,a):r};a.range=function(t){return arguments.length?(n=t,a):n};a.invertExtent=function(t){return t=n.indexOf(t),[r[t-1],r[t]]};a.copy=function(){return e(r,n)};return a}([.5],[0,1])},t.scale.identity=function(){return function t(e){function r(t){return+t}r.invert=r;r.domain=r.range=function(t){return arguments.length?(e=t.map(r),r):e};r.ticks=function(t){return bo(e,t)};r.tickFormat=function(t,r){return _o(e,t,r)};r.copy=function(){return t(e)};return r}([0,1])},t.svg={},t.svg.arc=function(){var t=Po,e=Eo,r=zo,n=Do,a=Ro,i=Io,o=Fo;function l(){var l=Math.max(0,+t.apply(this,arguments)),c=Math.max(0,+e.apply(this,arguments)),u=a.apply(this,arguments)-St,f=i.apply(this,arguments)-St,d=Math.abs(f-u),p=u>f?0:1;if(c<l&&(h=c,c=l,l=h),d>=Lt)return s(c,p)+(l?s(l,1-p):"")+"Z";var h,g,v,y,m,x,b,_,w,k,T,M,A=0,L=0,S=[];if((y=(+o.apply(this,arguments)||0)/2)&&(v=n===Do?Math.sqrt(l*l+c*c):+n.apply(this,arguments),p||(L*=-1),c&&(L=Et(v/c*Math.sin(y))),l&&(A=Et(v/l*Math.sin(y)))),c){m=c*Math.cos(u+L),x=c*Math.sin(u+L),b=c*Math.cos(f-L),_=c*Math.sin(f-L);var C=Math.abs(f-u-2*L)<=Mt?0:1;if(L&&No(m,x,b,_)===p^C){var O=(u+f)/2;m=c*Math.cos(O),x=c*Math.sin(O),b=_=null}}else m=x=0;if(l){w=l*Math.cos(f-A),k=l*Math.sin(f-A),T=l*Math.cos(u+A),M=l*Math.sin(u+A);var z=Math.abs(u-f+2*A)<=Mt?0:1;if(A&&No(w,k,T,M)===1-p^z){var D=(u+f)/2;w=l*Math.cos(D),k=l*Math.sin(D),T=M=null}}else w=k=0;if(d>kt&&(h=Math.min(Math.abs(c-l)/2,+r.apply(this,arguments)))>.001){g=l<c^p?0:1;var P=h,E=h;if(d<Mt){var R=null==T?[w,k]:null==b?[m,x]:la([m,x],[T,M],[b,_],[w,k]),I=m-R[0],F=x-R[1],N=b-R[0],B=_-R[1],j=1/Math.sin(Math.acos((I*N+F*B)/(Math.sqrt(I*I+F*F)*Math.sqrt(N*N+B*B)))/2),H=Math.sqrt(R[0]*R[0]+R[1]*R[1]);E=Math.min(h,(l-H)/(j-1)),P=Math.min(h,(c-H)/(j+1))}if(null!=b){var q=Bo(null==T?[w,k]:[T,M],[m,x],c,P,p),V=Bo([b,_],[w,k],c,P,p);h===P?S.push("M",q[0],"A",P,",",P," 0 0,",g," ",q[1],"A",c,",",c," 0 ",1-p^No(q[1][0],q[1][1],V[1][0],V[1][1]),",",p," ",V[1],"A",P,",",P," 0 0,",g," ",V[0]):S.push("M",q[0],"A",P,",",P," 0 1,",g," ",V[0])}else S.push("M",m,",",x);if(null!=T){var U=Bo([m,x],[T,M],l,-E,p),G=Bo([w,k],null==b?[m,x]:[b,_],l,-E,p);h===E?S.push("L",G[0],"A",E,",",E," 0 0,",g," ",G[1],"A",l,",",l," 0 ",p^No(G[1][0],G[1][1],U[1][0],U[1][1]),",",1-p," ",U[1],"A",E,",",E," 0 0,",g," ",U[0]):S.push("L",G[0],"A",E,",",E," 0 0,",g," ",U[0])}else S.push("L",w,",",k)}else S.push("M",m,",",x),null!=b&&S.push("A",c,",",c," 0 ",C,",",p," ",b,",",_),S.push("L",w,",",k),null!=T&&S.push("A",l,",",l," 0 ",z,",",1-p," ",T,",",M);return S.push("Z"),S.join("")}function s(t,e){return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}return l.innerRadius=function(e){return arguments.length?(t=ve(e),l):t},l.outerRadius=function(t){return arguments.length?(e=ve(t),l):e},l.cornerRadius=function(t){return arguments.length?(r=ve(t),l):r},l.padRadius=function(t){return arguments.length?(n=t==Do?Do:ve(t),l):n},l.startAngle=function(t){return arguments.length?(a=ve(t),l):a},l.endAngle=function(t){return arguments.length?(i=ve(t),l):i},l.padAngle=function(t){return arguments.length?(o=ve(t),l):o},l.centroid=function(){var r=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,n=(+a.apply(this,arguments)+ +i.apply(this,arguments))/2-St;return[Math.cos(n)*r,Math.sin(n)*r]},l};var Do="auto";function Po(t){return t.innerRadius}function Eo(t){return t.outerRadius}function Ro(t){return t.startAngle}function Io(t){return t.endAngle}function Fo(t){return t&&t.padAngle}function No(t,e,r,n){return(t-r)*e-(e-n)*t>0?0:1}function Bo(t,e,r,n,a){var i=t[0]-e[0],o=t[1]-e[1],l=(a?n:-n)/Math.sqrt(i*i+o*o),s=l*o,c=-l*i,u=t[0]+s,f=t[1]+c,d=e[0]+s,p=e[1]+c,h=(u+d)/2,g=(f+p)/2,v=d-u,y=p-f,m=v*v+y*y,x=r-n,b=u*p-d*f,_=(y<0?-1:1)*Math.sqrt(Math.max(0,x*x*m-b*b)),w=(b*y-v*_)/m,k=(-b*v-y*_)/m,T=(b*y+v*_)/m,M=(-b*v+y*_)/m,A=w-h,L=k-g,S=T-h,C=M-g;return A*A+L*L>S*S+C*C&&(w=T,k=M),[[w-s,k-c],[w*r/x,k*r/x]]}function jo(t){var e=ea,r=ra,n=Zr,a=qo,i=a.key,o=.7;function l(i){var l,s=[],c=[],u=-1,f=i.length,d=ve(e),p=ve(r);function h(){s.push("M",a(t(c),o))}for(;++u<f;)n.call(this,l=i[u],u)?c.push([+d.call(this,l,u),+p.call(this,l,u)]):c.length&&(h(),c=[]);return c.length&&h(),s.length?s.join(""):null}return l.x=function(t){return arguments.length?(e=t,l):e},l.y=function(t){return arguments.length?(r=t,l):r},l.defined=function(t){return arguments.length?(n=t,l):n},l.interpolate=function(t){return arguments.length?(i="function"==typeof t?a=t:(a=Ho.get(t)||qo).key,l):i},l.tension=function(t){return arguments.length?(o=t,l):o},l}t.svg.line=function(){return jo(z)};var Ho=t.map({linear:qo,"linear-closed":Vo,step:function(t){var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];for(;++e<r;)a.push("H",(n[0]+(n=t[e])[0])/2,"V",n[1]);r>1&&a.push("H",n[0]);return a.join("")},"step-before":Uo,"step-after":Go,basis:Yo,"basis-open":function(t){if(t.length<4)return qo(t);var e,r=[],n=-1,a=t.length,i=[0],o=[0];for(;++n<3;)e=t[n],i.push(e[0]),o.push(e[1]);r.push(Wo(Qo,i)+","+Wo(Qo,o)),--n;for(;++n<a;)e=t[n],i.shift(),i.push(e[0]),o.shift(),o.push(e[1]),Ko(r,i,o);return r.join("")},"basis-closed":function(t){var e,r,n=-1,a=t.length,i=a+4,o=[],l=[];for(;++n<4;)r=t[n%a],o.push(r[0]),l.push(r[1]);e=[Wo(Qo,o),",",Wo(Qo,l)],--n;for(;++n<i;)r=t[n%a],o.shift(),o.push(r[0]),l.shift(),l.push(r[1]),Ko(e,o,l);return e.join("")},bundle:function(t,e){var r=t.length-1;if(r)for(var n,a,i=t[0][0],o=t[0][1],l=t[r][0]-i,s=t[r][1]-o,c=-1;++c<=r;)n=t[c],a=c/r,n[0]=e*n[0]+(1-e)*(i+a*l),n[1]=e*n[1]+(1-e)*(o+a*s);return Yo(t)},cardinal:function(t,e){return t.length<3?qo(t):t[0]+Zo(t,Xo(t,e))},"cardinal-open":function(t,e){return t.length<4?qo(t):t[1]+Zo(t.slice(1,-1),Xo(t,e))},"cardinal-closed":function(t,e){return t.length<3?Vo(t):t[0]+Zo((t.push(t[0]),t),Xo([t[t.length-2]].concat(t,[t[1]]),e))},monotone:function(t){return t.length<3?qo(t):t[0]+Zo(t,function(t){var e,r,n,a,i=[],o=function(t){var e=0,r=t.length-1,n=[],a=t[0],i=t[1],o=n[0]=tl(a,i);for(;++e<r;)n[e]=(o+(o=tl(a=i,i=t[e+1])))/2;return n[e]=o,n}(t),l=-1,s=t.length-1;for(;++l<s;)e=tl(t[l],t[l+1]),m(e)<kt?o[l]=o[l+1]=0:(r=o[l]/e,n=o[l+1]/e,(a=r*r+n*n)>9&&(a=3*e/Math.sqrt(a),o[l]=a*r,o[l+1]=a*n));l=-1;for(;++l<=s;)a=(t[Math.min(s,l+1)][0]-t[Math.max(0,l-1)][0])/(6*(1+o[l]*o[l])),i.push([a||0,o[l]*a||0]);return i}(t))}});function qo(t){return t.length>1?t.join("L"):t+"Z"}function Vo(t){return t.join("L")+"Z"}function Uo(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e<r;)a.push("V",(n=t[e])[1],"H",n[0]);return a.join("")}function Go(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e<r;)a.push("H",(n=t[e])[0],"V",n[1]);return a.join("")}function Zo(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return qo(t);var r=t.length!=e.length,n="",a=t[0],i=t[1],o=e[0],l=o,s=1;if(r&&(n+="Q"+(i[0]-2*o[0]/3)+","+(i[1]-2*o[1]/3)+","+i[0]+","+i[1],a=t[1],s=2),e.length>1){l=e[1],i=t[s],s++,n+="C"+(a[0]+o[0])+","+(a[1]+o[1])+","+(i[0]-l[0])+","+(i[1]-l[1])+","+i[0]+","+i[1];for(var c=2;c<e.length;c++,s++)i=t[s],l=e[c],n+="S"+(i[0]-l[0])+","+(i[1]-l[1])+","+i[0]+","+i[1]}if(r){var u=t[s];n+="Q"+(i[0]+2*l[0]/3)+","+(i[1]+2*l[1]/3)+","+u[0]+","+u[1]}return n}function Xo(t,e){for(var r,n=[],a=(1-e)/2,i=t[0],o=t[1],l=1,s=t.length;++l<s;)r=i,i=o,o=t[l],n.push([a*(o[0]-r[0]),a*(o[1]-r[1])]);return n}function Yo(t){if(t.length<3)return qo(t);var e=1,r=t.length,n=t[0],a=n[0],i=n[1],o=[a,a,a,(n=t[1])[0]],l=[i,i,i,n[1]],s=[a,",",i,"L",Wo(Qo,o),",",Wo(Qo,l)];for(t.push(t[r-1]);++e<=r;)n=t[e],o.shift(),o.push(n[0]),l.shift(),l.push(n[1]),Ko(s,o,l);return t.pop(),s.push("L",n),s.join("")}function Wo(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}Ho.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var Jo=[0,2/3,1/3,0],$o=[0,1/3,2/3,0],Qo=[0,1/6,2/3,1/6];function Ko(t,e,r){t.push("C",Wo(Jo,e),",",Wo(Jo,r),",",Wo($o,e),",",Wo($o,r),",",Wo(Qo,e),",",Wo(Qo,r))}function tl(t,e){return(e[1]-t[1])/(e[0]-t[0])}function el(t){for(var e,r,n,a=-1,i=t.length;++a<i;)r=(e=t[a])[0],n=e[1]-St,e[0]=r*Math.cos(n),e[1]=r*Math.sin(n);return t}function rl(t){var e=ea,r=ea,n=0,a=ra,i=Zr,o=qo,l=o.key,s=o,c="L",u=.7;function f(l){var f,d,p,h=[],g=[],v=[],y=-1,m=l.length,x=ve(e),b=ve(n),_=e===r?function(){return d}:ve(r),w=n===a?function(){return p}:ve(a);function k(){h.push("M",o(t(v),u),c,s(t(g.reverse()),u),"Z")}for(;++y<m;)i.call(this,f=l[y],y)?(g.push([d=+x.call(this,f,y),p=+b.call(this,f,y)]),v.push([+_.call(this,f,y),+w.call(this,f,y)])):g.length&&(k(),g=[],v=[]);return g.length&&k(),h.length?h.join(""):null}return f.x=function(t){return arguments.length?(e=r=t,f):r},f.x0=function(t){return arguments.length?(e=t,f):e},f.x1=function(t){return arguments.length?(r=t,f):r},f.y=function(t){return arguments.length?(n=a=t,f):a},f.y0=function(t){return arguments.length?(n=t,f):n},f.y1=function(t){return arguments.length?(a=t,f):a},f.defined=function(t){return arguments.length?(i=t,f):i},f.interpolate=function(t){return arguments.length?(l="function"==typeof t?o=t:(o=Ho.get(t)||qo).key,s=o.reverse||o,c=o.closed?"M":"L",f):l},f.tension=function(t){return arguments.length?(u=t,f):u},f}function nl(t){return t.radius}function al(t){return[t.x,t.y]}function il(){return 64}function ol(){return"circle"}function ll(t){var e=Math.sqrt(t/Mt);return"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+-e+"A"+e+","+e+" 0 1,1 0,"+e+"Z"}t.svg.line.radial=function(){var t=jo(el);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},Uo.reverse=Go,Go.reverse=Uo,t.svg.area=function(){return rl(z)},t.svg.area.radial=function(){var t=rl(el);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},t.svg.chord=function(){var t=Hn,e=qn,r=nl,n=Ro,a=Io;function i(r,n){var a,i,c=o(this,t,r,n),u=o(this,e,r,n);return"M"+c.p0+l(c.r,c.p1,c.a1-c.a0)+(i=u,(a=c).a0==i.a0&&a.a1==i.a1?s(c.r,c.p1,c.r,c.p0):s(c.r,c.p1,u.r,u.p0)+l(u.r,u.p1,u.a1-u.a0)+s(u.r,u.p1,c.r,c.p0))+"Z"}function o(t,e,i,o){var l=e.call(t,i,o),s=r.call(t,l,o),c=n.call(t,l,o)-St,u=a.call(t,l,o)-St;return{r:s,a0:c,a1:u,p0:[s*Math.cos(c),s*Math.sin(c)],p1:[s*Math.cos(u),s*Math.sin(u)]}}function l(t,e,r){return"A"+t+","+t+" 0 "+ +(r>Mt)+",1 "+e}function s(t,e,r,n){return"Q 0,0 "+n}return i.radius=function(t){return arguments.length?(r=ve(t),i):r},i.source=function(e){return arguments.length?(t=ve(e),i):t},i.target=function(t){return arguments.length?(e=ve(t),i):e},i.startAngle=function(t){return arguments.length?(n=ve(t),i):n},i.endAngle=function(t){return arguments.length?(a=ve(t),i):a},i},t.svg.diagonal=function(){var t=Hn,e=qn,r=al;function n(n,a){var i=t.call(this,n,a),o=e.call(this,n,a),l=(i.y+o.y)/2,s=[i,{x:i.x,y:l},{x:o.x,y:l},o];return"M"+(s=s.map(r))[0]+"C"+s[1]+" "+s[2]+" "+s[3]}return n.source=function(e){return arguments.length?(t=ve(e),n):t},n.target=function(t){return arguments.length?(e=ve(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},t.svg.diagonal.radial=function(){var e=t.svg.diagonal(),r=al,n=e.projection;return e.projection=function(t){return arguments.length?n(function(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-St;return[r*Math.cos(n),r*Math.sin(n)]}}(r=t)):r},e},t.svg.symbol=function(){var t=ol,e=il;function r(r,n){return(sl.get(t.call(this,r,n))||ll)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=ve(e),r):t},r.size=function(t){return arguments.length?(e=ve(t),r):e},r};var sl=t.map({circle:ll,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*ul)),r=e*ul;return"M0,"+-e+"L"+r+",0 0,"+e+" "+-r+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/cl),r=e*cl/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/cl),r=e*cl/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});t.svg.symbolTypes=sl.keys();var cl=Math.sqrt(3),ul=Math.tan(30*Ct);X.transition=function(t){for(var e,r,n=hl||++yl,a=bl(t),i=[],o=gl||{time:Date.now(),ease:ai,delay:0,duration:250},l=-1,s=this.length;++l<s;){i.push(e=[]);for(var c=this[l],u=-1,f=c.length;++u<f;)(r=c[u])&&_l(r,u,a,n,o),e.push(r)}return pl(i,a,n)},X.interrupt=function(t){return this.each(null==t?fl:dl(bl(t)))};var fl=dl(bl());function dl(t){return function(){var e,r,n;(e=this[t])&&(n=e[r=e.active])&&(n.timer.c=null,n.timer.t=NaN,--e.count?delete e[r]:delete this[t],e.active+=.5,n.event&&n.event.interrupt.call(this,this.__data__,n.index))}}function pl(t,e,r){return q(t,vl),t.namespace=e,t.id=r,t}var hl,gl,vl=[],yl=0;function ml(t,e,r,n){var a=t.id,i=t.namespace;return ut(t,"function"==typeof r?function(t,o,l){t[i][a].tween.set(e,n(r.call(t,t.__data__,o,l)))}:(r=n(r),function(t){t[i][a].tween.set(e,r)}))}function xl(t){return null==t&&(t=""),function(){this.textContent=t}}function bl(t){return null==t?"__transition__":"__transition_"+t+"__"}function _l(t,e,r,n,a){var i,o,l,s,c,u=t[r]||(t[r]={active:0,count:0}),f=u[n];function d(r){var a=u.active,d=u[a];for(var h in d&&(d.timer.c=null,d.timer.t=NaN,--u.count,delete u[a],d.event&&d.event.interrupt.call(t,t.__data__,d.index)),u)if(+h<n){var g=u[h];g.timer.c=null,g.timer.t=NaN,--u.count,delete u[h]}o.c=p,Te(function(){return o.c&&p(r||1)&&(o.c=null,o.t=NaN),1},0,i),u.active=n,f.event&&f.event.start.call(t,t.__data__,e),c=[],f.tween.forEach(function(r,n){(n=n.call(t,t.__data__,e))&&c.push(n)}),s=f.ease,l=f.duration}function p(a){for(var i=a/l,o=s(i),d=c.length;d>0;)c[--d].call(t,o);if(i>=1)return f.event&&f.event.end.call(t,t.__data__,e),--u.count?delete u[n]:delete t[r],1}f||(i=a.time,o=Te(function(t){var e=f.delay;if(o.t=e+i,e<=t)return d(t-e);o.c=d},0,i),f=u[n]={tween:new b,time:i,timer:o,delay:a.delay,duration:a.duration,ease:a.ease,index:e},a=null,++u.count)}vl.call=X.call,vl.empty=X.empty,vl.node=X.node,vl.size=X.size,t.transition=function(e,r){return e&&e.transition?hl?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=vl,vl.select=function(t){var e,r,n,a=this.id,i=this.namespace,o=[];t=Y(t);for(var l=-1,s=this.length;++l<s;){o.push(e=[]);for(var c=this[l],u=-1,f=c.length;++u<f;)(n=c[u])&&(r=t.call(n,n.__data__,u,l))?("__data__"in n&&(r.__data__=n.__data__),_l(r,u,i,a,n[i][a]),e.push(r)):e.push(null)}return pl(o,i,a)},vl.selectAll=function(t){var e,r,n,a,i,o=this.id,l=this.namespace,s=[];t=W(t);for(var c=-1,u=this.length;++c<u;)for(var f=this[c],d=-1,p=f.length;++d<p;)if(n=f[d]){i=n[l][o],r=t.call(n,n.__data__,d,c),s.push(e=[]);for(var h=-1,g=r.length;++h<g;)(a=r[h])&&_l(a,h,l,o,i),e.push(a)}return pl(s,l,o)},vl.filter=function(t){var e,r,n=[];"function"!=typeof t&&(t=ct(t));for(var a=0,i=this.length;a<i;a++){n.push(e=[]);for(var o,l=0,s=(o=this[a]).length;l<s;l++)(r=o[l])&&t.call(r,r.__data__,l,a)&&e.push(r)}return pl(n,this.namespace,this.id)},vl.tween=function(t,e){var r=this.id,n=this.namespace;return arguments.length<2?this.node()[n][r].tween.get(t):ut(this,null==e?function(e){e[n][r].tween.remove(t)}:function(a){a[n][r].tween.set(t,e)})},vl.attr=function(e,r){if(arguments.length<2){for(r in e)this.attr(r,e[r]);return this}var n="transform"==e?gi:Wa,a=t.ns.qualify(e);function i(){this.removeAttribute(a)}function o(){this.removeAttributeNS(a.space,a.local)}return ml(this,"attr."+e,r,a.local?function(t){return null==t?o:(t+="",function(){var e,r=this.getAttributeNS(a.space,a.local);return r!==t&&(e=n(r,t),function(t){this.setAttributeNS(a.space,a.local,e(t))})})}:function(t){return null==t?i:(t+="",function(){var e,r=this.getAttribute(a);return r!==t&&(e=n(r,t),function(t){this.setAttribute(a,e(t))})})})},vl.attrTween=function(e,r){var n=t.ns.qualify(e);return this.tween("attr."+e,n.local?function(t,e){var a=r.call(this,t,e,this.getAttributeNS(n.space,n.local));return a&&function(t){this.setAttributeNS(n.space,n.local,a(t))}}:function(t,e){var a=r.call(this,t,e,this.getAttribute(n));return a&&function(t){this.setAttribute(n,a(t))}})},vl.style=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){for(r in n<2&&(e=""),t)this.style(r,t[r],e);return this}r=""}function a(){this.style.removeProperty(t)}return ml(this,"style."+t,e,function(e){return null==e?a:(e+="",function(){var n,a=o(this).getComputedStyle(this,null).getPropertyValue(t);return a!==e&&(n=Wa(a,e),function(e){this.style.setProperty(t,n(e),r)})})})},vl.styleTween=function(t,e,r){return arguments.length<3&&(r=""),this.tween("style."+t,function(n,a){var i=e.call(this,n,a,o(this).getComputedStyle(this,null).getPropertyValue(t));return i&&function(e){this.style.setProperty(t,i(e),r)}})},vl.text=function(t){return ml(this,"text",t,xl)},vl.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})},vl.ease=function(e){var r=this.id,n=this.namespace;return arguments.length<1?this.node()[n][r].ease:("function"!=typeof e&&(e=t.ease.apply(t,arguments)),ut(this,function(t){t[n][r].ease=e}))},vl.delay=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].delay:ut(this,"function"==typeof t?function(n,a,i){n[r][e].delay=+t.call(n,n.__data__,a,i)}:(t=+t,function(n){n[r][e].delay=t}))},vl.duration=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].duration:ut(this,"function"==typeof t?function(n,a,i){n[r][e].duration=Math.max(1,t.call(n,n.__data__,a,i))}:(t=Math.max(1,t),function(n){n[r][e].duration=t}))},vl.each=function(e,r){var n=this.id,a=this.namespace;if(arguments.length<2){var i=gl,o=hl;try{hl=n,ut(this,function(t,r,i){gl=t[a][n],e.call(t,t.__data__,r,i)})}finally{gl=i,hl=o}}else ut(this,function(i){var o=i[a][n];(o.event||(o.event=t.dispatch("start","end","interrupt"))).on(e,r)});return this},vl.transition=function(){for(var t,e,r,n=this.id,a=++yl,i=this.namespace,o=[],l=0,s=this.length;l<s;l++){o.push(t=[]);for(var c,u=0,f=(c=this[l]).length;u<f;u++)(e=c[u])&&_l(e,u,i,a,{time:(r=e[i][n]).time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration}),t.push(e)}return pl(o,i,a)},t.svg.axis=function(){var e,r=t.scale.linear(),a=wl,i=6,o=6,l=3,s=[10],c=null;function u(n){n.each(function(){var n,u=t.select(this),f=this.__chart__||r,d=this.__chart__=r.copy(),p=null==c?d.ticks?d.ticks.apply(d,s):d.domain():c,h=null==e?d.tickFormat?d.tickFormat.apply(d,s):z:e,g=u.selectAll(".tick").data(p,d),v=g.enter().insert("g",".domain").attr("class","tick").style("opacity",kt),y=t.transition(g.exit()).style("opacity",kt).remove(),m=t.transition(g.order()).style("opacity",1),x=Math.max(i,0)+l,b=uo(d),_=u.selectAll(".domain").data([0]),w=(_.enter().append("path").attr("class","domain"),t.transition(_));v.append("line"),v.append("text");var k,T,M,A,L=v.select("line"),S=m.select("line"),C=g.select("text").text(h),O=v.select("text"),D=m.select("text"),P="top"===a||"left"===a?-1:1;if("bottom"===a||"top"===a?(n=Tl,k="x",M="y",T="x2",A="y2",C.attr("dy",P<0?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+b[0]+","+P*o+"V0H"+b[1]+"V"+P*o)):(n=Ml,k="y",M="x",T="y2",A="x2",C.attr("dy",".32em").style("text-anchor",P<0?"end":"start"),w.attr("d","M"+P*o+","+b[0]+"H0V"+b[1]+"H"+P*o)),L.attr(A,P*i),O.attr(M,P*x),S.attr(T,0).attr(A,P*i),D.attr(k,0).attr(M,P*x),d.rangeBand){var E=d,R=E.rangeBand()/2;f=d=function(t){return E(t)+R}}else f.rangeBand?f=d:y.call(n,d,f);v.call(n,f,d),m.call(n,d,d)})}return u.scale=function(t){return arguments.length?(r=t,u):r},u.orient=function(t){return arguments.length?(a=t in kl?t+"":wl,u):a},u.ticks=function(){return arguments.length?(s=n(arguments),u):s},u.tickValues=function(t){return arguments.length?(c=t,u):c},u.tickFormat=function(t){return arguments.length?(e=t,u):e},u.tickSize=function(t){var e=arguments.length;return e?(i=+t,o=+arguments[e-1],u):i},u.innerTickSize=function(t){return arguments.length?(i=+t,u):i},u.outerTickSize=function(t){return arguments.length?(o=+t,u):o},u.tickPadding=function(t){return arguments.length?(l=+t,u):l},u.tickSubdivide=function(){return arguments.length&&u},u};var wl="bottom",kl={top:1,right:1,bottom:1,left:1};function Tl(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate("+(isFinite(n)?n:r(t))+",0)"})}function Ml(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate(0,"+(isFinite(n)?n:r(t))+")"})}t.svg.brush=function(){var e,r,n=j(d,"brushstart","brush","brushend"),a=null,i=null,l=[0,0],s=[0,0],c=!0,u=!0,f=Ll[0];function d(e){e.each(function(){var e=t.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",v).on("touchstart.brush",v),r=e.selectAll(".background").data([0]);r.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),e.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var n=e.selectAll(".resize").data(f,z);n.exit().remove(),n.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return Al[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),n.style("display",d.empty()?"none":null);var o,l=t.transition(e),s=t.transition(r);a&&(o=uo(a),s.attr("x",o[0]).attr("width",o[1]-o[0]),h(l)),i&&(o=uo(i),s.attr("y",o[0]).attr("height",o[1]-o[0]),g(l)),p(l)})}function p(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+l[+/e$/.test(t)]+","+s[+/^s/.test(t)]+")"})}function h(t){t.select(".extent").attr("x",l[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",l[1]-l[0])}function g(t){t.select(".extent").attr("y",s[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",s[1]-s[0])}function v(){var f,v,y=this,m=t.select(t.event.target),x=n.of(y,arguments),b=t.select(y),_=m.datum(),w=!/^(n|s)$/.test(_)&&a,k=!/^(e|w)$/.test(_)&&i,T=m.classed("extent"),M=xt(y),A=t.mouse(y),L=t.select(o(y)).on("keydown.brush",function(){32==t.event.keyCode&&(T||(f=null,A[0]-=l[1],A[1]-=s[1],T=2),N())}).on("keyup.brush",function(){32==t.event.keyCode&&2==T&&(A[0]+=l[1],A[1]+=s[1],T=0,N())});if(t.event.changedTouches?L.on("touchmove.brush",O).on("touchend.brush",D):L.on("mousemove.brush",O).on("mouseup.brush",D),b.interrupt().selectAll("*").interrupt(),T)A[0]=l[0]-A[0],A[1]=s[0]-A[1];else if(_){var S=+/w$/.test(_),C=+/^n/.test(_);v=[l[1-S]-A[0],s[1-C]-A[1]],A[0]=l[S],A[1]=s[C]}else t.event.altKey&&(f=A.slice());function O(){var e=t.mouse(y),r=!1;v&&(e[0]+=v[0],e[1]+=v[1]),T||(t.event.altKey?(f||(f=[(l[0]+l[1])/2,(s[0]+s[1])/2]),A[0]=l[+(e[0]<f[0])],A[1]=s[+(e[1]<f[1])]):f=null),w&&z(e,a,0)&&(h(b),r=!0),k&&z(e,i,1)&&(g(b),r=!0),r&&(p(b),x({type:"brush",mode:T?"move":"resize"}))}function z(t,n,a){var i,o,d=uo(n),p=d[0],h=d[1],g=A[a],v=a?s:l,y=v[1]-v[0];if(T&&(p-=g,h-=y+g),i=(a?u:c)?Math.max(p,Math.min(h,t[a])):t[a],T?o=(i+=g)+y:(f&&(g=Math.max(p,Math.min(h,2*f[a]-i))),g<i?(o=i,i=g):o=g),v[0]!=i||v[1]!=o)return a?r=null:e=null,v[0]=i,v[1]=o,!0}function D(){O(),b.style("pointer-events","all").selectAll(".resize").style("display",d.empty()?"none":null),t.select("body").style("cursor",null),L.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),M(),x({type:"brushend"})}b.style("pointer-events","none").selectAll(".resize").style("display",null),t.select("body").style("cursor",m.style("cursor")),x({type:"brushstart"}),O()}return d.event=function(a){a.each(function(){var a=n.of(this,arguments),i={x:l,y:s,i:e,j:r},o=this.__chart__||i;this.__chart__=i,hl?t.select(this).transition().each("start.brush",function(){e=o.i,r=o.j,l=o.x,s=o.y,a({type:"brushstart"})}).tween("brush:brush",function(){var t=Ja(l,i.x),n=Ja(s,i.y);return e=r=null,function(e){l=i.x=t(e),s=i.y=n(e),a({type:"brush",mode:"resize"})}}).each("end.brush",function(){e=i.i,r=i.j,a({type:"brush",mode:"resize"}),a({type:"brushend"})}):(a({type:"brushstart"}),a({type:"brush",mode:"resize"}),a({type:"brushend"}))})},d.x=function(t){return arguments.length?(f=Ll[!(a=t)<<1|!i],d):a},d.y=function(t){return arguments.length?(f=Ll[!a<<1|!(i=t)],d):i},d.clamp=function(t){return arguments.length?(a&&i?(c=!!t[0],u=!!t[1]):a?c=!!t:i&&(u=!!t),d):a&&i?[c,u]:a?c:i?u:null},d.extent=function(t){var n,o,c,u,f;return arguments.length?(a&&(n=t[0],o=t[1],i&&(n=n[0],o=o[0]),e=[n,o],a.invert&&(n=a(n),o=a(o)),o<n&&(f=n,n=o,o=f),n==l[0]&&o==l[1]||(l=[n,o])),i&&(c=t[0],u=t[1],a&&(c=c[1],u=u[1]),r=[c,u],i.invert&&(c=i(c),u=i(u)),u<c&&(f=c,c=u,u=f),c==s[0]&&u==s[1]||(s=[c,u])),d):(a&&(e?(n=e[0],o=e[1]):(n=l[0],o=l[1],a.invert&&(n=a.invert(n),o=a.invert(o)),o<n&&(f=n,n=o,o=f))),i&&(r?(c=r[0],u=r[1]):(c=s[0],u=s[1],i.invert&&(c=i.invert(c),u=i.invert(u)),u<c&&(f=c,c=u,u=f))),a&&i?[[n,c],[o,u]]:a?[n,o]:i&&[c,u])},d.clear=function(){return d.empty()||(l=[0,0],s=[0,0],e=r=null),d},d.empty=function(){return!!a&&l[0]==l[1]||!!i&&s[0]==s[1]},t.rebind(d,n,"on")};var Al={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Ll=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Sl=Pe.format=lr.timeFormat,Cl=Sl.utc,Ol=Cl("%Y-%m-%dT%H:%M:%S.%LZ");function zl(t){return t.toISOString()}function Dl(e,r,n){function a(t){return e(t)}function i(e,n){var a=(e[1]-e[0])/n,i=t.bisect(El,a);return i==El.length?[r.year,xo(e.map(function(t){return t/31536e6}),n)[2]]:i?r[a/El[i-1]<El[i]/a?i-1:i]:[Fl,xo(e,n)[2]]}return a.invert=function(t){return Pl(e.invert(t))},a.domain=function(t){return arguments.length?(e.domain(t),a):e.domain().map(Pl)},a.nice=function(t,e){var r=a.domain(),n=co(r),o=null==t?i(n,10):"number"==typeof t&&i(n,t);function l(r){return!isNaN(r)&&!t.range(r,Pl(+r+1),e).length}return o&&(t=o[0],e=o[1]),a.domain(po(r,e>1?{floor:function(e){for(;l(e=t.floor(e));)e=Pl(e-1);return e},ceil:function(e){for(;l(e=t.ceil(e));)e=Pl(+e+1);return e}}:t))},a.ticks=function(t,e){var r=co(a.domain()),n=null==t?i(r,10):"number"==typeof t?i(r,t):!t.range&&[{range:t},e];return n&&(t=n[0],e=n[1]),t.range(r[0],Pl(+r[1]+1),e<1?1:e)},a.tickFormat=function(){return n},a.copy=function(){return Dl(e.copy(),r,n)},yo(a,e)}function Pl(t){return new Date(t)}Sl.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?zl:Ol,zl.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},zl.toString=Ol.toString,Pe.second=Fe(function(t){return new Ee(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),Pe.seconds=Pe.second.range,Pe.seconds.utc=Pe.second.utc.range,Pe.minute=Fe(function(t){return new Ee(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),Pe.minutes=Pe.minute.range,Pe.minutes.utc=Pe.minute.utc.range,Pe.hour=Fe(function(t){var e=t.getTimezoneOffset()/60;return new Ee(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),Pe.hours=Pe.hour.range,Pe.hours.utc=Pe.hour.utc.range,Pe.month=Fe(function(t){return(t=Pe.day(t)).setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),Pe.months=Pe.month.range,Pe.months.utc=Pe.month.utc.range;var El=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Rl=[[Pe.second,1],[Pe.second,5],[Pe.second,15],[Pe.second,30],[Pe.minute,1],[Pe.minute,5],[Pe.minute,15],[Pe.minute,30],[Pe.hour,1],[Pe.hour,3],[Pe.hour,6],[Pe.hour,12],[Pe.day,1],[Pe.day,2],[Pe.week,1],[Pe.month,1],[Pe.month,3],[Pe.year,1]],Il=Sl.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Zr]]),Fl={range:function(e,r,n){return t.range(Math.ceil(e/n)*n,+r,n).map(Pl)},floor:z,ceil:z};Rl.year=Pe.year,Pe.scale=function(){return Dl(t.scale.linear(),Rl,Il)};var Nl=Rl.map(function(t){return[t[0].utc,t[1]]}),Bl=Cl.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Zr]]);function jl(t){return JSON.parse(t.responseText)}function Hl(t){var e=a.createRange();return e.selectNode(a.body),e.createContextualFragment(t.responseText)}Nl.year=Pe.year.utc,Pe.scale.utc=function(){return Dl(t.scale.linear(),Nl,Bl)},t.text=ye(function(t){return t.responseText}),t.json=function(t,e){return me(t,"application/json",jl,e)},t.html=function(t,e){return me(t,"text/html",Hl,e)},t.xml=ye(function(t){return t.responseXML}),"object"==typeof e&&e.exports?e.exports=t:this.d3=t}()},{}],17:[function(t,e,r){(function(n,a){!function(t,n){"object"==typeof r&&"undefined"!=typeof e?e.exports=n():t.ES6Promise=n()}(this,function(){"use strict";function e(t){return"function"==typeof t}var r=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},i=0,o=void 0,l=void 0,s=function(t,e){g[i]=t,g[i+1]=e,2===(i+=2)&&(l?l(v):_())};var c="undefined"!=typeof window?window:void 0,u=c||{},f=u.MutationObserver||u.WebKitMutationObserver,d="undefined"==typeof self&&"undefined"!=typeof n&&"[object process]"==={}.toString.call(n),p="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){var t=setTimeout;return function(){return t(v,1)}}var g=new Array(1e3);function v(){for(var t=0;t<i;t+=2){(0,g[t])(g[t+1]),g[t]=void 0,g[t+1]=void 0}i=0}var y,m,x,b,_=void 0;function w(t,e){var r=arguments,n=this,a=new this.constructor(M);void 0===a[T]&&q(a);var i,o=n._state;return o?(i=r[o-1],s(function(){return j(o,a,i,n._result)})):I(n,a,t,e),a}function k(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(M);return D(e,t),e}d?_=function(){return n.nextTick(v)}:f?(m=0,x=new f(v),b=document.createTextNode(""),x.observe(b,{characterData:!0}),_=function(){b.data=m=++m%2}):p?((y=new MessageChannel).port1.onmessage=v,_=function(){return y.port2.postMessage(0)}):_=void 0===c&&"function"==typeof t?function(){try{var e=t("vertx");return o=e.runOnLoop||e.runOnContext,function(){o(v)}}catch(t){return h()}}():h();var T=Math.random().toString(36).substring(16);function M(){}var A=void 0,L=1,S=2,C=new N;function O(t){try{return t.then}catch(t){return C.error=t,C}}function z(t,r,n){r.constructor===t.constructor&&n===w&&r.constructor.resolve===k?function(t,e){e._state===L?E(t,e._result):e._state===S?R(t,e._result):I(e,void 0,function(e){return D(t,e)},function(e){return R(t,e)})}(t,r):n===C?R(t,C.error):void 0===n?E(t,r):e(n)?function(t,e,r){s(function(t){var n=!1,a=function(t,e,r,n){try{t.call(e,r,n)}catch(t){return t}}(r,e,function(r){n||(n=!0,e!==r?D(t,r):E(t,r))},function(e){n||(n=!0,R(t,e))},t._label);!n&&a&&(n=!0,R(t,a))},t)}(t,r,n):E(t,r)}function D(t,e){var r;t===e?R(t,new TypeError("You cannot resolve a promise with itself")):"function"==typeof(r=e)||"object"==typeof r&&null!==r?z(t,e,O(e)):E(t,e)}function P(t){t._onerror&&t._onerror(t._result),F(t)}function E(t,e){t._state===A&&(t._result=e,t._state=L,0!==t._subscribers.length&&s(F,t))}function R(t,e){t._state===A&&(t._state=S,t._result=e,s(P,t))}function I(t,e,r,n){var a=t._subscribers,i=a.length;t._onerror=null,a[i]=e,a[i+L]=r,a[i+S]=n,0===i&&t._state&&s(F,t)}function F(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n=void 0,a=void 0,i=t._result,o=0;o<e.length;o+=3)n=e[o],a=e[o+r],n?j(r,n,a,i):a(i);t._subscribers.length=0}}function N(){this.error=null}var B=new N;function j(t,r,n,a){var i=e(n),o=void 0,l=void 0,s=void 0,c=void 0;if(i){if((o=function(t,e){try{return t(e)}catch(t){return B.error=t,B}}(n,a))===B?(c=!0,l=o.error,o=null):s=!0,r===o)return void R(r,new TypeError("A promises callback cannot return that same promise."))}else o=a,s=!0;r._state!==A||(i&&s?D(r,o):c?R(r,l):t===L?E(r,o):t===S&&R(r,o))}var H=0;function q(t){t[T]=H++,t._state=void 0,t._result=void 0,t._subscribers=[]}function V(t,e){this._instanceConstructor=t,this.promise=new t(M),this.promise[T]||q(this.promise),r(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?E(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&E(this.promise,this._result))):R(this.promise,new Error("Array Methods must be provided an Array"))}function U(t){this[T]=H++,this._result=this._state=void 0,this._subscribers=[],M!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof U?function(t,e){try{e(function(e){D(t,e)},function(e){R(t,e)})}catch(e){R(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}function G(){var t=void 0;if("undefined"!=typeof a)t=a;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var r=null;try{r=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===r&&!e.cast)return}t.Promise=U}return V.prototype._enumerate=function(){for(var t=this.length,e=this._input,r=0;this._state===A&&r<t;r++)this._eachEntry(e[r],r)},V.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===k){var a=O(t);if(a===w&&t._state!==A)this._settledAt(t._state,e,t._result);else if("function"!=typeof a)this._remaining--,this._result[e]=t;else if(r===U){var i=new r(M);z(i,t,a),this._willSettleAt(i,e)}else this._willSettleAt(new r(function(e){return e(t)}),e)}else this._willSettleAt(n(t),e)},V.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===A&&(this._remaining--,t===S?R(n,r):this._result[e]=r),0===this._remaining&&E(n,this._result)},V.prototype._willSettleAt=function(t,e){var r=this;I(t,void 0,function(t){return r._settledAt(L,e,t)},function(t){return r._settledAt(S,e,t)})},U.all=function(t){return new V(this,t).promise},U.race=function(t){var e=this;return r(t)?new e(function(r,n){for(var a=t.length,i=0;i<a;i++)e.resolve(t[i]).then(r,n)}):new e(function(t,e){return e(new TypeError("You must pass an array to race."))})},U.resolve=k,U.reject=function(t){var e=new this(M);return R(e,t),e},U._setScheduler=function(t){l=t},U._setAsap=function(t){s=t},U._asap=s,U.prototype={constructor:U,then:w,catch:function(t){return this.then(null,t)}},G(),U.polyfill=G,U.Promise=U,U})}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:33}],18:[function(t,e,r){"use strict";var n=t("is-string-blank");e.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0===(t=+t)&&n(r))return!1}else if("number"!==e)return!1;return t-t<1}},{"is-string-blank":23}],19:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],o=r+r,l=n+n,s=a+a,c=r*o,u=n*o,f=n*l,d=a*o,p=a*l,h=a*s,g=i*o,v=i*l,y=i*s;return t[0]=1-f-h,t[1]=u+y,t[2]=d-v,t[3]=0,t[4]=u-y,t[5]=1-c-h,t[6]=p+g,t[7]=0,t[8]=d+v,t[9]=p-g,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],20:[function(t,e,r){(function(r){"use strict";var n,a=t("is-browser");n="function"==typeof r.matchMedia?!r.matchMedia("(hover: none)").matches:a,e.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"is-browser":22}],21:[function(t,e,r){"use strict";var n=t("is-browser");e.exports=n&&function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){t=!1}return t}()},{"is-browser":22}],22:[function(t,e,r){e.exports=!0},{}],23:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length,n=0;n<r;n++)if(((e=t.charCodeAt(n))<9||e>13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}},{}],24:[function(t,e,r){var n={left:0,top:0};e.exports=function(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var a=t.clientX||0,i=t.clientY||0,o=(l=e,l===window||l===document||l===document.body?n:l.getBoundingClientRect());var l;return r[0]=a-o.left,r[1]=i-o.top,r}},{}],25:[function(t,e,r){var n,a=t("./lib/build-log"),i=t("./lib/epsilon"),o=t("./lib/intersecter"),l=t("./lib/segment-chainer"),s=t("./lib/segment-selector"),c=t("./lib/geojson"),u=!1,f=i();function d(t,e,r){var a=n.segments(t),i=n.segments(e),o=r(n.combine(a,i));return n.polygon(o)}n={buildLog:function(t){return!0===t?u=a():!1===t&&(u=!1),!1!==u&&u.list},epsilon:function(t){return f.epsilon(t)},segments:function(t){var e=o(!0,f,u);return t.regions.forEach(e.addRegion),{segments:e.calculate(t.inverted),inverted:t.inverted}},combine:function(t,e){return{combined:o(!1,f,u).calculate(t.segments,t.inverted,e.segments,e.inverted),inverted1:t.inverted,inverted2:e.inverted}},selectUnion:function(t){return{segments:s.union(t.combined,u),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:s.intersect(t.combined,u),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:s.difference(t.combined,u),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:s.differenceRev(t.combined,u),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:s.xor(t.combined,u),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:l(t.segments,f,u),inverted:t.inverted}},polygonFromGeoJSON:function(t){return c.toPolygon(n,t)},polygonToGeoJSON:function(t){return c.fromPolygon(n,f,t)},union:function(t,e){return d(t,e,n.selectUnion)},intersect:function(t,e){return d(t,e,n.selectIntersect)},difference:function(t,e){return d(t,e,n.selectDifference)},differenceRev:function(t,e){return d(t,e,n.selectDifferenceRev)},xor:function(t,e){return d(t,e,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),e.exports=n},{"./lib/build-log":26,"./lib/epsilon":27,"./lib/geojson":28,"./lib/intersecter":29,"./lib/segment-chainer":31,"./lib/segment-selector":32}],26:[function(t,e,r){e.exports=function(){var t,e=0,r=!1;function n(e,r){return t.list.push({type:e,data:r?JSON.parse(JSON.stringify(r)):void 0}),t}return t={list:[],segmentId:function(){return e++},checkIntersection:function(t,e){return n("check",{seg1:t,seg2:e})},segmentChop:function(t,e){return n("div_seg",{seg:t,pt:e}),n("chop",{seg:t,pt:e})},statusRemove:function(t){return n("pop_seg",{seg:t})},segmentUpdate:function(t){return n("seg_update",{seg:t})},segmentNew:function(t,e){return n("new_seg",{seg:t,primary:e})},segmentRemove:function(t){return n("rem_seg",{seg:t})},tempStatus:function(t,e,r){return n("temp_status",{seg:t,above:e,below:r})},rewind:function(t){return n("rewind",{seg:t})},status:function(t,e,r){return n("status",{seg:t,above:e,below:r})},vert:function(e){return e===r?t:(r=e,n("vert",{x:e}))},log:function(t){return"string"!=typeof t&&(t=JSON.stringify(t,!1," ")),n("log",{txt:t})},reset:function(){return n("reset")},selected:function(t){return n("selected",{segs:t})},chainStart:function(t){return n("chain_start",{seg:t})},chainRemoveHead:function(t,e){return n("chain_rem_head",{index:t,pt:e})},chainRemoveTail:function(t,e){return n("chain_rem_tail",{index:t,pt:e})},chainNew:function(t,e){return n("chain_new",{pt1:t,pt2:e})},chainMatch:function(t){return n("chain_match",{index:t})},chainClose:function(t){return n("chain_close",{index:t})},chainAddHead:function(t,e){return n("chain_add_head",{index:t,pt:e})},chainAddTail:function(t,e){return n("chain_add_tail",{index:t,pt:e})},chainConnect:function(t,e){return n("chain_con",{index1:t,index2:e})},chainReverse:function(t){return n("chain_rev",{index:t})},chainJoin:function(t,e){return n("chain_join",{index1:t,index2:e})},done:function(){return n("done")}}}},{}],27:[function(t,e,r){e.exports=function(t){"number"!=typeof t&&(t=1e-10);var e={epsilon:function(e){return"number"==typeof e&&(t=e),t},pointAboveOrOnLine:function(e,r,n){var a=r[0],i=r[1],o=n[0],l=n[1],s=e[0];return(o-a)*(e[1]-i)-(l-i)*(s-a)>=-t},pointBetween:function(e,r,n){var a=e[1]-r[1],i=n[0]-r[0],o=e[0]-r[0],l=n[1]-r[1],s=o*i+a*l;return!(s<t||s-(i*i+l*l)>-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])<t},pointsSameY:function(e,r){return Math.abs(e[1]-r[1])<t},pointsSame:function(t,r){return e.pointsSameX(t,r)&&e.pointsSameY(t,r)},pointsCompare:function(t,r){return e.pointsSameX(t,r)?e.pointsSameY(t,r)?0:t[1]<r[1]?-1:1:t[0]<r[0]?-1:1},pointsCollinear:function(e,r,n){var a=e[0]-r[0],i=e[1]-r[1],o=r[0]-n[0],l=r[1]-n[1];return Math.abs(a*l-o*i)<t},linesIntersect:function(e,r,n,a){var i=r[0]-e[0],o=r[1]-e[1],l=a[0]-n[0],s=a[1]-n[1],c=i*s-o*l;if(Math.abs(c)<t)return!1;var u=e[0]-n[0],f=e[1]-n[1],d=(l*f-s*u)/c,p=(i*f-o*u)/c,h={alongA:0,alongB:0,pt:[e[0]+d*i,e[1]+d*o]};return h.alongA=d<=-t?-2:d<t?-1:d-1<=-t?0:d-1<t?1:2,h.alongB=p<=-t?-2:p<t?-1:p-1<=-t?0:p-1<t?1:2,h},pointInsideRegion:function(e,r){for(var n=e[0],a=e[1],i=r[r.length-1][0],o=r[r.length-1][1],l=!1,s=0;s<r.length;s++){var c=r[s][0],u=r[s][1];u-a>t!=o-a>t&&(i-c)*(a-u)/(o-u)+c-n>t&&(l=!l),i=c,o=u}return l}};return e}},{}],28:[function(t,e,r){var n={toPolygon:function(t,e){function r(e){if(e.length<=0)return t.segments({inverted:!1,regions:[]});function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}for(var n=r(e[0]),a=1;a<e.length;a++)n=t.selectDifference(t.combine(n,r(e[a])));return n}if("Polygon"===e.type)return t.polygon(r(e.coordinates));if("MultiPolygon"===e.type){for(var n=t.segments({inverted:!1,regions:[]}),a=0;a<e.coordinates.length;a++)n=t.selectUnion(t.combine(n,r(e.coordinates[a])));return t.polygon(n)}throw new Error("PolyBool: Cannot convert GeoJSON object to PolyBool polygon")},fromPolygon:function(t,e,r){function n(t,r){return e.pointInsideRegion([.5*(t[0][0]+t[1][0]),.5*(t[0][1]+t[1][1])],r)}function a(t){return{region:t,children:[]}}r=t.polygon(t.segments(r));var i=a(null);function o(t,e){for(var r=0;r<t.children.length;r++){if(n(e,(l=t.children[r]).region))return void o(l,e)}var i=a(e);for(r=0;r<t.children.length;r++){var l;n((l=t.children[r]).region,e)&&(i.children.push(l),t.children.splice(r,1),r--)}t.children.push(i)}for(var l=0;l<r.regions.length;l++){var s=r.regions[l];s.length<3||o(i,s)}function c(t,e){for(var r=0,n=t[t.length-1][0],a=t[t.length-1][1],i=[],o=0;o<t.length;o++){var l=t[o][0],s=t[o][1];i.push([l,s]),r+=s*n-l*a,n=l,a=s}return r<0!==e&&i.reverse(),i.push([i[0][0],i[0][1]]),i}var u=[];function f(t){var e=[c(t.region,!1)];u.push(e);for(var r=0;r<t.children.length;r++)e.push(d(t.children[r]))}function d(t){for(var e=0;e<t.children.length;e++)f(t.children[e]);return c(t.region,!0)}for(l=0;l<i.children.length;l++)f(i.children[l]);return u.length<=0?{type:"Polygon",coordinates:[]}:1==u.length?{type:"Polygon",coordinates:u[0]}:{type:"MultiPolygon",coordinates:u}}};e.exports=n},{}],29:[function(t,e,r){var n=t("./linked-list");e.exports=function(t,e,r){function a(t,e,n){return{id:r?r.segmentId():-1,start:t,end:e,myFill:{above:n.myFill.above,below:n.myFill.below},otherFill:null}}var i=n.create();function o(t,r){i.insertBefore(t,function(n){return function(t,r,n,a,i,o){var l=e.pointsCompare(r,i);return 0!==l?l:e.pointsSame(n,o)?0:t!==a?t?1:-1:e.pointAboveOrOnLine(n,a?i:o,a?o:i)?1:-1}(t.isStart,t.pt,r,n.isStart,n.pt,n.other.pt)<0})}function l(t,e){var r=function(t,e){var r=n.node({isStart:!0,pt:t.start,seg:t,primary:e,other:null,status:null});return o(r,t.end),r}(t,e);return function(t,e,r){var a=n.node({isStart:!1,pt:e.end,seg:e,primary:r,other:t,status:null});t.other=a,o(a,t.pt)}(r,t,e),r}function s(t,e){var n=a(e,t.seg.end,t.seg);return function(t,e){r&&r.segmentChop(t.seg,e),t.other.remove(),t.seg.end=e,t.other.pt=e,o(t.other,t.pt)}(t,e),l(n,t.primary)}function c(a,o){var l=n.create();function c(t){return l.findTransition(function(r){var n,a,i,o,l,s;return n=t,a=r.ev,i=n.seg.start,o=n.seg.end,l=a.seg.start,s=a.seg.end,(e.pointsCollinear(i,l,s)?e.pointsCollinear(o,l,s)?1:e.pointAboveOrOnLine(o,l,s)?1:-1:e.pointAboveOrOnLine(i,l,s)?1:-1)>0})}function u(t,n){var a=t.seg,i=n.seg,o=a.start,l=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var f=e.linesIntersect(o,l,c,u);if(!1===f){if(!e.pointsCollinear(o,l,c))return!1;if(e.pointsSame(o,u)||e.pointsSame(l,c))return!1;var d=e.pointsSame(o,c),p=e.pointsSame(l,u);if(d&&p)return n;var h=!d&&e.pointBetween(o,c,u),g=!p&&e.pointBetween(l,c,u);if(d)return g?s(n,l):s(t,u),n;h&&(p||(g?s(n,l):s(t,u)),s(n,o))}else 0===f.alongA&&(-1===f.alongB?s(t,c):0===f.alongB?s(t,f.pt):1===f.alongB&&s(t,u)),0===f.alongB&&(-1===f.alongA?s(n,o):0===f.alongA?s(n,f.pt):1===f.alongA&&s(n,l));return!1}for(var f=[];!i.isEmpty();){var d=i.getHead();if(r&&r.vert(d.pt[0]),d.isStart){r&&r.segmentNew(d.seg,d.primary);var p=c(d),h=p.before?p.before.ev:null,g=p.after?p.after.ev:null;function v(){if(h){var t=u(d,h);if(t)return t}return!!g&&u(d,g)}r&&r.tempStatus(d.seg,!!h&&h.seg,!!g&&g.seg);var y,m,x=v();if(x)t?(m=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below)&&(x.seg.myFill.above=!x.seg.myFill.above):x.seg.otherFill=d.seg.myFill,r&&r.segmentUpdate(x.seg),d.other.remove(),d.remove();if(i.getHead()!==d){r&&r.rewind(d.seg);continue}t?(m=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below,d.seg.myFill.below=g?g.seg.myFill.above:a,d.seg.myFill.above=m?!d.seg.myFill.below:d.seg.myFill.below):null===d.seg.otherFill&&(y=g?d.primary===g.primary?g.seg.otherFill.above:g.seg.myFill.above:d.primary?o:a,d.seg.otherFill={above:y,below:y}),r&&r.status(d.seg,!!h&&h.seg,!!g&&g.seg),d.other.status=p.insert(n.node({ev:d}))}else{var b=d.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(l.exists(b.prev)&&l.exists(b.next)&&u(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!d.primary){var _=d.seg.myFill;d.seg.myFill=d.seg.otherFill,d.seg.otherFill=_}f.push(d.seg)}i.getHead().remove()}return r&&r.done(),f}return t?{addRegion:function(t){for(var n,a,i,o=t[t.length-1],s=0;s<t.length;s++){n=o,o=t[s];var c=e.pointsCompare(n,o);0!==c&&l((a=c<0?n:o,i=c<0?o:n,{id:r?r.segmentId():-1,start:a,end:i,myFill:{above:null,below:null},otherFill:null}),!0)}},calculate:function(t){return c(t,!1)}}:{calculate:function(t,e,r,n){return t.forEach(function(t){l(a(t.start,t.end,t),!0)}),r.forEach(function(t){l(a(t.start,t.end,t),!1)}),c(e,n)}}}},{"./linked-list":30}],30:[function(t,e,r){e.exports={create:function(){var t={root:{root:!0,next:null},exists:function(e){return null!==e&&e!==t.root},isEmpty:function(){return null===t.root.next},getHead:function(){return t.root.next},insertBefore:function(e,r){for(var n=t.root,a=t.root.next;null!==a;){if(r(a))return e.prev=a.prev,e.next=a,a.prev.next=e,void(a.prev=e);n=a,a=a.next}n.next=e,e.prev=n,e.next=null},findTransition:function(e){for(var r=t.root,n=t.root.next;null!==n&&!e(n);)r=n,n=n.next;return{before:r===t.root?null:r,after:n,insert:function(t){return t.prev=r,t.next=n,r.next=t,null!==n&&(n.prev=t),t}}}};return t},node:function(t){return t.prev=null,t.next=null,t.remove=function(){t.prev.next=t.next,t.next&&(t.next.prev=t.prev),t.prev=null,t.next=null},t}}},{}],31:[function(t,e,r){e.exports=function(t,e,r){var n=[],a=[];return t.forEach(function(t){var i=t.start,o=t.end;if(e.pointsSame(i,o))console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large");else{r&&r.chainStart(t);for(var l={index:0,matches_head:!1,matches_pt1:!1},s={index:0,matches_head:!1,matches_pt1:!1},c=l,u=0;u<n.length;u++){var f=(v=n[u])[0],d=(v[1],v[v.length-1]);if(v[v.length-2],e.pointsSame(f,i)){if(T(u,!0,!0))break}else if(e.pointsSame(f,o)){if(T(u,!0,!1))break}else if(e.pointsSame(d,i)){if(T(u,!1,!0))break}else if(e.pointsSame(d,o)&&T(u,!1,!1))break}if(c===l)return n.push([i,o]),void(r&&r.chainNew(i,o));if(c===s){r&&r.chainMatch(l.index);var p=l.index,h=l.matches_pt1?o:i,g=l.matches_head,v=n[p],y=g?v[0]:v[v.length-1],m=g?v[1]:v[v.length-2],x=g?v[v.length-1]:v[0],b=g?v[v.length-2]:v[1];return e.pointsCollinear(m,y,h)&&(g?(r&&r.chainRemoveHead(l.index,h),v.shift()):(r&&r.chainRemoveTail(l.index,h),v.pop()),y=m),e.pointsSame(x,h)?(n.splice(p,1),e.pointsCollinear(b,x,y)&&(g?(r&&r.chainRemoveTail(l.index,y),v.pop()):(r&&r.chainRemoveHead(l.index,y),v.shift())),r&&r.chainClose(l.index),void a.push(v)):void(g?(r&&r.chainAddHead(l.index,h),v.unshift(h)):(r&&r.chainAddTail(l.index,h),v.push(h)))}var _=l.index,w=s.index;r&&r.chainConnect(_,w);var k=n[_].length<n[w].length;l.matches_head?s.matches_head?k?(M(_),A(_,w)):(M(w),A(w,_)):A(w,_):s.matches_head?A(_,w):k?(M(_),A(w,_)):(M(w),A(_,w))}function T(t,e,r){return c.index=t,c.matches_head=e,c.matches_pt1=r,c===l?(c=s,!1):(c=null,!0)}function M(t){r&&r.chainReverse(t),n[t].reverse()}function A(t,a){var i=n[t],o=n[a],l=i[i.length-1],s=i[i.length-2],c=o[0],u=o[1];e.pointsCollinear(s,l,c)&&(r&&r.chainRemoveTail(t,l),i.pop(),l=s),e.pointsCollinear(l,c,u)&&(r&&r.chainRemoveHead(a,c),o.shift()),r&&r.chainJoin(t,a),n[t]=i.concat(o),n.splice(a,1)}}),a}},{}],32:[function(t,e,r){function n(t,e,r){var n=[];return t.forEach(function(t){var a=(t.myFill.above?8:0)+(t.myFill.below?4:0)+(t.otherFill&&t.otherFill.above?2:0)+(t.otherFill&&t.otherFill.below?1:0);0!==e[a]&&n.push({id:r?r.segmentId():-1,start:t.start,end:t.end,myFill:{above:1===e[a],below:2===e[a]},otherFill:null})}),r&&r.selected(n),n}var a={union:function(t,e){return n(t,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],e)},intersect:function(t,e){return n(t,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],e)},difference:function(t,e){return n(t,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],e)},differenceRev:function(t,e){return n(t,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],e)},xor:function(t,e){return n(t,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],e)}};e.exports=a},{}],33:[function(t,e,r){var n,a,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{a="function"==typeof clearTimeout?clearTimeout:l}catch(t){a=l}}();var c,u=[],f=!1,d=-1;function p(){f&&c&&(f=!1,c.length?u=c.concat(u):d=-1,u.length&&h())}function h(){if(!f){var t=s(p);f=!0;for(var e=u.length;e;){for(c=u,u=[];++d<e;)c&&c[d].run();d=-1,e=u.length}c=null,f=!1,function(t){if(a===clearTimeout)return clearTimeout(t);if((a===l||!a)&&clearTimeout)return a=clearTimeout,clearTimeout(t);try{a(t)}catch(e){try{return a.call(null,t)}catch(e){return a.call(this,t)}}}(t)}}function g(t,e){this.fun=t,this.array=e}function v(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new g(t,e)),1!==u.length||f||s(h)},g.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],34:[function(t,e,r){!function(t){var r=/^\s+/,n=/\s+$/,a=0,i=t.round,o=t.min,l=t.max,s=t.random;function c(e,s){if(s=s||{},(e=e||"")instanceof c)return e;if(!(this instanceof c))return new c(e,s);var u=function(e){var a={r:0,g:0,b:0},i=1,s=null,c=null,u=null,f=!1,d=!1;"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,a=!1;if(L[t])t=L[t],a=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=j.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=j.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=j.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=j.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=j.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=j.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=j.hex8.exec(t))return{r:D(e[1]),g:D(e[2]),b:D(e[3]),a:I(e[4]),format:a?"name":"hex8"};if(e=j.hex6.exec(t))return{r:D(e[1]),g:D(e[2]),b:D(e[3]),format:a?"name":"hex"};if(e=j.hex4.exec(t))return{r:D(e[1]+""+e[1]),g:D(e[2]+""+e[2]),b:D(e[3]+""+e[3]),a:I(e[4]+""+e[4]),format:a?"name":"hex8"};if(e=j.hex3.exec(t))return{r:D(e[1]+""+e[1]),g:D(e[2]+""+e[2]),b:D(e[3]+""+e[3]),format:a?"name":"hex"};return!1}(e));"object"==typeof e&&(H(e.r)&&H(e.g)&&H(e.b)?(p=e.r,h=e.g,g=e.b,a={r:255*O(p,255),g:255*O(h,255),b:255*O(g,255)},f=!0,d="%"===String(e.r).substr(-1)?"prgb":"rgb"):H(e.h)&&H(e.s)&&H(e.v)?(s=E(e.s),c=E(e.v),a=function(e,r,n){e=6*O(e,360),r=O(r,100),n=O(n,100);var a=t.floor(e),i=e-a,o=n*(1-r),l=n*(1-i*r),s=n*(1-(1-i)*r),c=a%6;return{r:255*[n,l,o,o,s,n][c],g:255*[s,n,n,l,o,o][c],b:255*[o,o,s,n,n,l][c]}}(e.h,s,c),f=!0,d="hsv"):H(e.h)&&H(e.s)&&H(e.l)&&(s=E(e.s),u=E(e.l),a=function(t,e,r){var n,a,i;function o(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=O(t,360),e=O(e,100),r=O(r,100),0===e)n=a=i=r;else{var l=r<.5?r*(1+e):r+e-r*e,s=2*r-l;n=o(s,l,t+1/3),a=o(s,l,t),i=o(s,l,t-1/3)}return{r:255*n,g:255*a,b:255*i}}(e.h,s,u),f=!0,d="hsl"),e.hasOwnProperty("a")&&(i=e.a));var p,h,g;return i=C(i),{ok:f,format:e.format||d,r:o(255,l(a.r,0)),g:o(255,l(a.g,0)),b:o(255,l(a.b,0)),a:i}}(e);this._originalInput=e,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=s.format||u.format,this._gradientType=s.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=u.ok,this._tc_id=a++}function u(t,e,r){t=O(t,255),e=O(e,255),r=O(r,255);var n,a,i=l(t,e,r),s=o(t,e,r),c=(i+s)/2;if(i==s)n=a=0;else{var u=i-s;switch(a=c>.5?u/(2-i-s):u/(i+s),i){case t:n=(e-r)/u+(e<r?6:0);break;case e:n=(r-t)/u+2;break;case r:n=(t-e)/u+4}n/=6}return{h:n,s:a,l:c}}function f(t,e,r){t=O(t,255),e=O(e,255),r=O(r,255);var n,a,i=l(t,e,r),s=o(t,e,r),c=i,u=i-s;if(a=0===i?0:u/i,i==s)n=0;else{switch(i){case t:n=(e-r)/u+(e<r?6:0);break;case e:n=(r-t)/u+2;break;case r:n=(t-e)/u+4}n/=6}return{h:n,s:a,v:c}}function d(t,e,r,n){var a=[P(i(t).toString(16)),P(i(e).toString(16)),P(i(r).toString(16))];return n&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function p(t,e,r,n){return[P(R(n)),P(i(t).toString(16)),P(i(e).toString(16)),P(i(r).toString(16))].join("")}function h(t,e){e=0===e?0:e||10;var r=c(t).toHsl();return r.s-=e/100,r.s=z(r.s),c(r)}function g(t,e){e=0===e?0:e||10;var r=c(t).toHsl();return r.s+=e/100,r.s=z(r.s),c(r)}function v(t){return c(t).desaturate(100)}function y(t,e){e=0===e?0:e||10;var r=c(t).toHsl();return r.l+=e/100,r.l=z(r.l),c(r)}function m(t,e){e=0===e?0:e||10;var r=c(t).toRgb();return r.r=l(0,o(255,r.r-i(-e/100*255))),r.g=l(0,o(255,r.g-i(-e/100*255))),r.b=l(0,o(255,r.b-i(-e/100*255))),c(r)}function x(t,e){e=0===e?0:e||10;var r=c(t).toHsl();return r.l-=e/100,r.l=z(r.l),c(r)}function b(t,e){var r=c(t).toHsl(),n=(r.h+e)%360;return r.h=n<0?360+n:n,c(r)}function _(t){var e=c(t).toHsl();return e.h=(e.h+180)%360,c(e)}function w(t){var e=c(t).toHsl(),r=e.h;return[c(t),c({h:(r+120)%360,s:e.s,l:e.l}),c({h:(r+240)%360,s:e.s,l:e.l})]}function k(t){var e=c(t).toHsl(),r=e.h;return[c(t),c({h:(r+90)%360,s:e.s,l:e.l}),c({h:(r+180)%360,s:e.s,l:e.l}),c({h:(r+270)%360,s:e.s,l:e.l})]}function T(t){var e=c(t).toHsl(),r=e.h;return[c(t),c({h:(r+72)%360,s:e.s,l:e.l}),c({h:(r+216)%360,s:e.s,l:e.l})]}function M(t,e,r){e=e||6,r=r||30;var n=c(t).toHsl(),a=360/r,i=[c(t)];for(n.h=(n.h-(a*e>>1)+720)%360;--e;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(t,e){e=e||6;for(var r=c(t).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/e;e--;)o.push(c({h:n,s:a,v:i})),i=(i+l)%1;return o}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var e,r,n,a=this.toRgb();return e=a.r/255,r=a.g/255,n=a.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=C(t),this._roundA=i(100*this._a)/100,this},toHsv:function(){var t=f(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=f(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=u(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=u(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return d(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,a){var o=[P(i(t).toString(16)),P(i(e).toString(16)),P(i(r).toString(16)),P(R(n))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*O(this._r,255))+"%",g:i(100*O(this._g,255))+"%",b:i(100*O(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%)":"rgba("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+p(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var a=c(t);r="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(y,arguments)},brighten:function(){return this._applyModification(m,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(M,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(T,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(k,arguments)}},c.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:E(t[n]));t=r}return c(t,e)},c.equals=function(t,e){return!(!t||!e)&&c(t).toRgbString()==c(e).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(t,e,r){r=0===r?0:r||50;var n=c(t).toRgb(),a=c(e).toRgb(),i=r/100;return c({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},c.readability=function(e,r){var n=c(e),a=c(r);return(t.max(n.getLuminance(),a.getLuminance())+.05)/(t.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(t,e,r){var n,a,i=c.readability(t,e);switch(a=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(t,e,r){var n,a,i,o,l=null,s=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;u<e.length;u++)(n=c.readability(t,e[u]))>s&&(s=n,l=c(e[u]));return c.isReadable(t,l,{level:i,size:o})||!a?l:(r.includeFallbackColors=!1,c.mostReadable(t,["#fff","#000"],r))};var L=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},S=c.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(L);function C(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function O(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,l(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function z(t){return o(1,l(0,t))}function D(t){return parseInt(t,16)}function P(t){return 1==t.length?"0"+t:""+t}function E(t){return t<=1&&(t=100*t+"%"),t}function R(e){return t.round(255*parseFloat(e)).toString(16)}function I(t){return D(t)/255}var F,N,B,j=(N="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",B="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+N),rgba:new RegExp("rgba"+B),hsl:new RegExp("hsl"+N),hsla:new RegExp("hsla"+B),hsv:new RegExp("hsv"+N),hsva:new RegExp("hsva"+B),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function H(t){return!!j.CSS_UNIT.exec(t)}"undefined"!=typeof e&&e.exports?e.exports=c:window.tinycolor=c}(Math)},{}],35:[function(t,e,r){"use strict";e.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],36:[function(t,e,r){"use strict";var n=t("./arrow_paths"),a=t("../../plots/font_attributes"),i=t("../../plots/cartesian/constants"),o=t("../../plot_api/plot_template").templatedArray;e.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../plot_api/plot_template":202,"../../plots/cartesian/constants":218,"../../plots/font_attributes":239,"./arrow_paths":35}],37:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach(function(e){var r=a.getFromId(t,e.xref),n=a.getFromId(t,e.yref);e._extremes={},r&&l(e,r),n&&l(e,n)})}function l(t,e){var r,n=e._id,i=n.charAt(0),o=t[i],l=t["a"+i],s=t[i+"ref"],c=t["a"+i+"ref"],u=t["_"+i+"padplus"],f=t["_"+i+"padminus"],d={x:1,y:-1}[i]*t[i+"shift"],p=3*t.arrowsize*t.arrowwidth||0,h=p+d,g=p-d,v=3*t.startarrowsize*t.arrowwidth||0,y=v+d,m=v-d;if(c===s){var x=a.findExtremes(e,[e.r2c(o)],{ppadplus:h,ppadminus:g}),b=a.findExtremes(e,[e.r2c(l)],{ppadplus:Math.max(u,y),ppadminus:Math.max(f,m)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else y=l?y+l:y,m=l?m-l:m,r=a.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(u,h,y),ppadminus:Math.max(f,g,m)});t._extremes[n]=r}e.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([i,o],t)}},{"../../lib":168,"../../plots/cartesian/axes":212,"./draw":42}],38:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,a,i,o,s,c,u=t._fullLayout.annotations,f=[],d=[],p=[],h=(e||[]).length;for(r=0;r<u.length;r++)if(i=(a=u[r]).clicktoshow){for(n=0;n<h;n++)if(s=(o=e[n]).xaxis,c=o.yaxis,s._id===a.xref&&c._id===a.yref&&s.d2r(o.x)===l(a._xclick,s)&&c.d2r(o.y)===l(a._yclick,c)){(a.visible?"onout"===i?d:p:f).push(r);break}n===h&&a.visible&&"onout"===i&&d.push(r)}return{on:f,off:d,explicitOff:p}}function l(t,e){return"log"===e.type?e.l2r(t):e.d2r(t)}e.exports={hasClickToShow:function(t,e){var r=o(t,e);return r.on.length>0||r.explicitOff.length>0},onClick:function(t,e){var r,l,s=o(t,e),c=s.on,u=s.off.concat(s.explicitOff),f={},d=t._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r<c.length;r++)(l=i(t.layout,"annotations",d[c[r]])).modifyItem("visible",!0),n.extendFlat(f,l.getUpdateObj());for(r=0;r<u.length;r++)(l=i(t.layout,"annotations",d[u[r]])).modifyItem("visible",!1),n.extendFlat(f,l.getUpdateObj());return a.call("update",t,{},f)}}},{"../../lib":168,"../../plot_api/plot_template":202,"../../registry":257}],39:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../color");e.exports=function(t,e,r,i){i("opacity");var o=i("bgcolor"),l=i("bordercolor"),s=a.opacity(l);i("borderpad");var c=i("borderwidth"),u=i("showarrow");if(i("text",u?" ":r._dfltTitle.annotation),i("textangle"),n.coerceFont(i,"font",r.font),i("width"),i("align"),i("height")&&i("valign"),u){var f,d,p=i("arrowside");-1!==p.indexOf("end")&&(f=i("arrowhead"),d=i("arrowsize")),-1!==p.indexOf("start")&&(i("startarrowhead",f),i("startarrowsize",d)),i("arrowcolor",s?e.bordercolor:a.defaultLine),i("arrowwidth",2*(s&&c||1)),i("standoff"),i("startstandoff")}var h=i("hovertext"),g=r.hoverlabel||{};if(h){var v=i("hoverlabel.bgcolor",g.bgcolor||(a.opacity(o)?a.rgb(o):a.defaultLine)),y=i("hoverlabel.bordercolor",g.bordercolor||a.contrast(v));n.coerceFont(i,"hoverlabel.font",{family:g.font.family,size:g.font.size,color:g.font.color||y})}i("captureevents",!!h)}},{"../../lib":168,"../color":51}],40:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib/to_log_range");e.exports=function(t,e,r,i){e=e||{};var o="log"===r&&"linear"===e.type,l="linear"===r&&"log"===e.type;if(o||l)for(var s,c,u=t._fullLayout.annotations,f=e._id.charAt(0),d=0;d<u.length;d++)s=u[d],c="annotations["+d+"].",s[f+"ref"]===e._id&&p(f),s["a"+f+"ref"]===e._id&&p("a"+f);function p(t){var r=s[t],l=null;l=o?a(r,e.range):Math.pow(10,r),n(l)||(l=null),i(c+t,l)}}},{"../../lib/to_log_range":191,"fast-isnumeric":18}],41:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../../plots/array_container_defaults"),o=t("./common_defaults"),l=t("./attributes");function s(t,e,r){function i(r,a){return n.coerce(t,e,l,r,a)}var s=i("visible"),c=i("clicktoshow");if(s||c){o(t,e,r,i);for(var u=e.showarrow,f=["x","y"],d=[-10,-30],p={_fullLayout:r},h=0;h<2;h++){var g=f[h],v=a.coerceRef(t,e,p,g,"","paper");if("paper"!==v)a.getFromId(p,v)._annIndices.push(e._index);if(a.coercePosition(e,p,i,v,g,.5),u){var y="a"+g,m=a.coerceRef(t,e,p,y,"pixel");"pixel"!==m&&m!==v&&(m=e[y]="pixel");var x="pixel"===m?d[h]:.4;a.coercePosition(e,p,i,m,y,x)}i(g+"anchor"),i(g+"shift")}if(n.noneOrAll(t,e,["x","y"]),u&&n.noneOrAll(t,e,["ax","ay"]),c){var b=i("xclick"),_=i("yclick");e._xclick=void 0===b?e.x:a.cleanPosition(b,p,e.xref),e._yclick=void 0===_?e.y:a.cleanPosition(_,p,e.yref)}}}e.exports=function(t,e){i(t,e,{name:"annotations",handleItemDefaults:s})}},{"../../lib":168,"../../plots/array_container_defaults":208,"../../plots/cartesian/axes":212,"./attributes":36,"./common_defaults":39}],42:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../plots/plots"),o=t("../../lib"),l=t("../../plots/cartesian/axes"),s=t("../color"),c=t("../drawing"),u=t("../fx"),f=t("../../lib/svg_text_utils"),d=t("../../lib/setcursor"),p=t("../dragelement"),h=t("../../plot_api/plot_template").arrayEditor,g=t("./draw_arrow_head");function v(t,e){var r=t._fullLayout.annotations[e]||{},n=l.getFromId(t,r.xref),a=l.getFromId(t,r.yref);n&&n.setScale(),a&&a.setScale(),y(t,r,e,!1,n,a)}function y(t,e,r,i,l,v){var y,m,x=t._fullLayout,b=t._fullLayout._size,_=t._context.edits;i?(y="annotation-"+i,m=i+".annotations"):(y="annotation",m="annotations");var w=h(t.layout,m,e),k=w.modifyBase,T=w.modifyItem,M=w.getUpdateObj;x._infolayer.selectAll("."+y+'[data-index="'+r+'"]').remove();var A="clip"+x._uid+"_ann"+r;if(e._input&&!1!==e.visible){var L={x:{},y:{}},S=+e.textangle||0,C=x._infolayer.append("g").classed(y,!0).attr("data-index",String(r)).style("opacity",e.opacity),O=C.append("g").classed("annotation-text-g",!0),z=_[e.showarrow?"annotationTail":"annotationPosition"],D=e.captureevents||_.annotationText||z,P=O.append("g").style("pointer-events",D?"all":null).call(d,"pointer").on("click",function(){t._dragging=!1;var a={index:r,annotation:e._input,fullAnnotation:e,event:n.event};i&&(a.subplotId=i),t.emit("plotly_clickannotation",a)});e.hovertext&&P.on("mouseover",function(){var r=e.hoverlabel,n=r.font,a=this.getBoundingClientRect(),i=t.getBoundingClientRect();u.loneHover({x0:a.left-i.left,x1:a.right-i.left,y:(a.top+a.bottom)/2-i.top,text:e.hovertext,color:r.bgcolor,borderColor:r.bordercolor,fontFamily:n.family,fontSize:n.size,fontColor:n.color},{container:x._hoverlayer.node(),outerContainer:x._paper.node(),gd:t})}).on("mouseout",function(){u.loneUnhover(x._hoverlayer.node())});var E=e.borderwidth,R=e.borderpad,I=E+R,F=P.append("rect").attr("class","bg").style("stroke-width",E+"px").call(s.stroke,e.bordercolor).call(s.fill,e.bgcolor),N=e.width||e.height,B=x._topclips.selectAll("#"+A).data(N?[0]:[]);B.enter().append("clipPath").classed("annclip",!0).attr("id",A).append("rect"),B.exit().remove();var j=e.font,H=x.meta?o.templateString(e.text,{meta:x.meta}):e.text,q=P.append("text").classed("annotation-text",!0).text(H);_.annotationText?q.call(f.makeEditable,{delegate:P,gd:t}).call(V).on("edit",function(r){e.text=r,this.call(V),T("text",r),l&&l.autorange&&k(l._name+".autorange",!0),v&&v.autorange&&k(v._name+".autorange",!0),a.call("_guiRelayout",t,M())}):q.call(V)}else n.selectAll("#"+A).remove();function V(r){return r.call(c.font,j).attr({"text-anchor":{left:"start",right:"end"}[e.align]||"middle"}),f.convertToTspans(r,t,U),r}function U(){var r=q.selectAll("a");1===r.size()&&r.text()===q.text()&&P.insert("a",":first-child").attr({"xlink:xlink:href":r.attr("xlink:href"),"xlink:xlink:show":r.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(F.node());var n=P.select(".annotation-text-math-group"),u=!n.empty(),h=c.bBox((u?n:q).node()),y=h.width,m=h.height,w=e.width||y,D=e.height||m,R=Math.round(w+2*I),j=Math.round(D+2*I);function H(t,e){return"auto"===e&&(e=t<1/3?"left":t>2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var V=!1,U=["x","y"],G=0;G<U.length;G++){var Z,X,Y,W,J,$=U[G],Q=e[$+"ref"]||$,K=e["a"+$+"ref"],tt={x:l,y:v}[$],et=(S+("x"===$?0:-90))*Math.PI/180,rt=R*Math.cos(et),nt=j*Math.sin(et),at=Math.abs(rt)+Math.abs(nt),it=e[$+"anchor"],ot=e[$+"shift"]*("x"===$?1:-1),lt=L[$];if(tt){var st=tt.r2fraction(e[$]);(st<0||st>1)&&(K===Q?((st=tt.r2fraction(e["a"+$]))<0||st>1)&&(V=!0):V=!0),Z=tt._offset+tt.r2p(e[$]),W=.5}else"x"===$?(Y=e[$],Z=b.l+b.w*Y):(Y=1-e[$],Z=b.t+b.h*Y),W=e.showarrow?.5:Y;if(e.showarrow){lt.head=Z;var ct=e["a"+$];J=rt*H(.5,e.xanchor)-nt*H(.5,e.yanchor),K===Q?(lt.tail=tt._offset+tt.r2p(ct),X=J):(lt.tail=Z+ct,X=J+ct),lt.text=lt.tail+J;var ut=x["x"===$?"width":"height"];if("paper"===Q&&(lt.head=o.constrain(lt.head,1,ut-1)),"pixel"===K){var ft=-Math.max(lt.tail-3,lt.text),dt=Math.min(lt.tail+3,lt.text)-ut;ft>0?(lt.tail+=ft,lt.text+=ft):dt>0&&(lt.tail-=dt,lt.text-=dt)}lt.tail+=ot,lt.head+=ot}else X=J=at*H(W,it),lt.text=Z+J;lt.text+=ot,J+=ot,X+=ot,e["_"+$+"padplus"]=at/2+X,e["_"+$+"padminus"]=at/2-X,e["_"+$+"size"]=at,e["_"+$+"shift"]=J}if(t._dragging||!V){var pt=0,ht=0;if("left"!==e.align&&(pt=(w-y)*("center"===e.align?.5:1)),"top"!==e.valign&&(ht=(D-m)*("middle"===e.valign?.5:1)),u)n.select("svg").attr({x:I+pt-1,y:I+ht}).call(c.setClipUrl,N?A:null,t);else{var gt=I+ht-h.top,vt=I+pt-h.left;q.call(f.positionText,vt,gt).call(c.setClipUrl,N?A:null,t)}B.select("rect").call(c.setRect,I,I,w,D),F.call(c.setRect,E/2,E/2,R-E,j-E),P.call(c.setTranslate,Math.round(L.x.text-R/2),Math.round(L.y.text-j/2)),O.attr({transform:"rotate("+S+","+L.x.text+","+L.y.text+")"});var yt,mt=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,y=L.x.text+r,m=L.y.text+n,x=o.rotationXYMatrix(S,y,m),w=o.apply2DTransform(x),A=o.apply2DTransform2(x),z=+F.attr("width"),D=+F.attr("height"),E=y-.5*z,R=E+z,I=m-.5*D,N=I+D,B=[[E,I,E,N],[E,N,R,N],[R,N,R,I],[R,I,E,I]].map(A);if(!B.reduce(function(t,e){return t^!!o.segmentsIntersect(u,f,u+1e6,f+1e6,e[0],e[1],e[2],e[3])},!1)){B.forEach(function(t){var e=o.segmentsIntersect(d,h,u,f,t[0],t[1],t[2],t[3]);e&&(d=e.x,h=e.y)});var j=e.arrowwidth,H=e.arrowcolor,q=e.arrowside,V=C.append("g").style({opacity:s.opacity(H)}).classed("annotation-arrow-g",!0),U=V.append("path").attr("d","M"+d+","+h+"L"+u+","+f).style("stroke-width",j+"px").call(s.stroke,s.rgb(H));if(g(U,q,e),_.annotationPosition&&U.node().parentNode&&!i){var G=u,Z=f;if(e.standoff){var X=Math.sqrt(Math.pow(u-d,2)+Math.pow(f-h,2));G+=e.standoff*(d-u)/X,Z+=e.standoff*(h-f)/X}var Y,W,J=V.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-G)+","+(h-Z),transform:"translate("+G+","+Z+")"}).style("stroke-width",j+6+"px").call(s.stroke,"rgba(0,0,0,0)").call(s.fill,"rgba(0,0,0,0)");p.init({element:J.node(),gd:t,prepFn:function(){var t=c.getTranslate(P);Y=t.x,W=t.y,l&&l.autorange&&k(l._name+".autorange",!0),v&&v.autorange&&k(v._name+".autorange",!0)},moveFn:function(t,r){var n=w(Y,W),a=n[0]+t,i=n[1]+r;P.call(c.setTranslate,a,i),T("x",l?l.p2r(l.r2p(e.x)+t):e.x+t/b.w),T("y",v?v.p2r(v.r2p(e.y)+r):e.y-r/b.h),e.axref===e.xref&&T("ax",l.p2r(l.r2p(e.ax)+t)),e.ayref===e.yref&&T("ay",v.p2r(v.r2p(e.ay)+r)),V.attr("transform","translate("+t+","+r+")"),O.attr({transform:"rotate("+S+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",t,M());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&mt(0,0),z)p.init({element:P.node(),gd:t,prepFn:function(){yt=O.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?T("ax",l.p2r(l.r2p(e.ax)+t)):T("ax",e.ax+t),e.ayref===e.yref?T("ay",v.p2r(v.r2p(e.ay)+r)):T("ay",e.ay+r),mt(t,r);else{if(i)return;var a,o;if(l)a=l.p2r(l.r2p(e.x)+t);else{var s=e._xsize/b.w,c=e.x+(e._xshift-e.xshift)/b.w-s/2;a=p.align(c+t/b.w,s,0,1,e.xanchor)}if(v)o=v.p2r(v.r2p(e.y)+r);else{var u=e._ysize/b.h,f=e.y-(e._yshift+e.yshift)/b.h-u/2;o=p.align(f-r/b.h,u,0,1,e.yanchor)}T("x",a),T("y",o),l&&v||(n=p.getCursor(l?.5:a,v?.5:o,e.xanchor,e.yanchor))}O.attr({transform:"translate("+t+","+r+")"+yt}),d(P,n)},doneFn:function(){d(P),a.call("_guiRelayout",t,M());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}else P.remove()}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r<e.annotations.length;r++)e.annotations[r].visible&&v(t,r);return i.previousPromises(t)},drawOne:v,drawRaw:y}},{"../../lib":168,"../../lib/setcursor":187,"../../lib/svg_text_utils":189,"../../plot_api/plot_template":202,"../../plots/cartesian/axes":212,"../../plots/plots":245,"../../registry":257,"../color":51,"../dragelement":69,"../drawing":72,"../fx":90,"./draw_arrow_head":43,d3:16}],43:[function(t,e,r){"use strict";var n=t("d3"),a=t("../color"),i=t("./arrow_paths");e.exports=function(t,e,r){var o,l,s,c,u=t.node(),f=i[r.arrowhead||0],d=i[r.startarrowhead||0],p=(r.arrowwidth||1)*(r.arrowsize||1),h=(r.arrowwidth||1)*(r.startarrowsize||1),g=e.indexOf("start")>=0,v=e.indexOf("end")>=0,y=f.backoff*p+r.standoff,m=d.backoff*h+r.startstandoff;if("line"===u.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},l={x:+t.attr("x2"),y:+t.attr("y2")};var x=o.x-l.x,b=o.y-l.y;if(c=(s=Math.atan2(b,x))+Math.PI,y&&m&&y+m>Math.sqrt(x*x+b*b))return void z();if(y){if(y*y>x*x+b*b)return void z();var _=y*Math.cos(s),w=y*Math.sin(s);l.x+=_,l.y+=w,t.attr({x2:l.x,y2:l.y})}if(m){if(m*m>x*x+b*b)return void z();var k=m*Math.cos(s),T=m*Math.sin(s);o.x-=k,o.y-=T,t.attr({x1:o.x,y1:o.y})}}else if("path"===u.nodeName){var M=u.getTotalLength(),A="";if(M<y+m)return void z();var L=u.getPointAtLength(0),S=u.getPointAtLength(.1);s=Math.atan2(L.y-S.y,L.x-S.x),o=u.getPointAtLength(Math.min(m,M)),A="0px,"+m+"px,";var C=u.getPointAtLength(M),O=u.getPointAtLength(M-.1);c=Math.atan2(C.y-O.y,C.x-O.x),l=u.getPointAtLength(Math.max(0,M-y)),A+=M-(A?m+y:y)+"px,"+M+"px",t.style("stroke-dasharray",A)}function z(){t.style("stroke-dasharray","0px,100px")}function D(e,i,o,l){e.path&&(e.noRotate&&(o=0),n.select(u.parentNode).append("path").attr({class:t.attr("class"),d:e.path,transform:"translate("+i.x+","+i.y+")"+(o?"rotate("+180*o/Math.PI+")":"")+"scale("+l+")"}).style({fill:a.rgb(r.arrowcolor),"stroke-width":0}))}g&&D(d,o,s,h),v&&D(f,l,c,p)}},{"../color":51,"./arrow_paths":35,d3:16}],44:[function(t,e,r){"use strict";var n=t("./draw"),a=t("./click");e.exports={moduleType:"component",name:"annotations",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),includeBasePlot:t("../../plots/cartesian/include_components")("annotations"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne,drawRaw:n.drawRaw,hasClickToShow:a.hasClickToShow,onClick:a.onClick,convertCoords:t("./convert_coords")}},{"../../plots/cartesian/include_components":223,"./attributes":36,"./calc_autorange":37,"./click":38,"./convert_coords":40,"./defaults":41,"./draw":42}],45:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),a=t("../../plot_api/edit_types").overrideAll,i=t("../../plot_api/plot_template").templatedArray;e.exports=a(i("annotation",{visible:n.visible,x:{valType:"any"},y:{valType:"any"},z:{valType:"any"},ax:{valType:"number"},ay:{valType:"number"},xanchor:n.xanchor,xshift:n.xshift,yanchor:n.yanchor,yshift:n.yshift,text:n.text,textangle:n.textangle,font:n.font,width:n.width,height:n.height,opacity:n.opacity,align:n.align,valign:n.valign,bgcolor:n.bgcolor,bordercolor:n.bordercolor,borderpad:n.borderpad,borderwidth:n.borderwidth,showarrow:n.showarrow,arrowcolor:n.arrowcolor,arrowhead:n.arrowhead,startarrowhead:n.startarrowhead,arrowside:n.arrowside,arrowsize:n.arrowsize,startarrowsize:n.startarrowsize,arrowwidth:n.arrowwidth,standoff:n.standoff,startstandoff:n.startstandoff,hovertext:n.hovertext,hoverlabel:n.hoverlabel,captureevents:n.captureevents}),"calc","from-root")},{"../../plot_api/edit_types":195,"../../plot_api/plot_template":202,"../annotations/attributes":36}],46:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes");function i(t,e){var r=e.fullSceneLayout.domain,i=e.fullLayout._size,o={pdata:null,type:"linear",autorange:!1,range:[-1/0,1/0]};t._xa={},n.extendFlat(t._xa,o),a.setConvert(t._xa),t._xa._offset=i.l+r.x[0]*i.w,t._xa.l2p=function(){return.5*(1+t._pdata[0]/t._pdata[3])*i.w*(r.x[1]-r.x[0])},t._ya={},n.extendFlat(t._ya,o),a.setConvert(t._ya),t._ya._offset=i.t+(1-r.y[1])*i.h,t._ya.l2p=function(){return.5*(1-t._pdata[1]/t._pdata[3])*i.h*(r.y[1]-r.y[0])}}e.exports=function(t){for(var e=t.fullSceneLayout.annotations,r=0;r<e.length;r++)i(e[r],t);t.fullLayout._infolayer.selectAll(".annotation-"+t.id).remove()}},{"../../lib":168,"../../plots/cartesian/axes":212}],47:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../../plots/array_container_defaults"),o=t("../annotations/common_defaults"),l=t("./attributes");function s(t,e,r,i){function s(r,a){return n.coerce(t,e,l,r,a)}function c(t){var n=t+"axis",i={_fullLayout:{}};return i._fullLayout[n]=r[n],a.coercePosition(e,i,s,t,t,.5)}s("visible")&&(o(t,e,i.fullLayout,s),c("x"),c("y"),c("z"),n.noneOrAll(t,e,["x","y","z"]),e.xref="x",e.yref="y",e.zref="z",s("xanchor"),s("yanchor"),s("xshift"),s("yshift"),e.showarrow&&(e.axref="pixel",e.ayref="pixel",s("ax",-10),s("ay",-30),n.noneOrAll(t,e,["ax","ay"])))}e.exports=function(t,e,r){i(t,e,{name:"annotations",handleItemDefaults:s,fullLayout:r.fullLayout})}},{"../../lib":168,"../../plots/array_container_defaults":208,"../../plots/cartesian/axes":212,"../annotations/common_defaults":39,"./attributes":45}],48:[function(t,e,r){"use strict";var n=t("../annotations/draw").drawRaw,a=t("../../plots/gl3d/project"),i=["x","y","z"];e.exports=function(t){for(var e=t.fullSceneLayout,r=t.dataScale,o=e.annotations,l=0;l<o.length;l++){for(var s=o[l],c=!1,u=0;u<3;u++){var f=i[u],d=s[f],p=e[f+"axis"].r2fraction(d);if(p<0||p>1){c=!0;break}}c?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+l+'"]').remove():(s._pdata=a(t.glplot.cameraParams,[e.xaxis.r2l(s.x)*r[0],e.yaxis.r2l(s.y)*r[1],e.zaxis.r2l(s.z)*r[2]]),n(t.graphDiv,s,l,t.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":242,"../annotations/draw":42}],49:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(t),l=0;l<o.length;l++){var s=o[l];i.test(s)&&(t[s].annotations||[]).length&&(a.pushUnique(e._basePlotModules,r),a.pushUnique(e._subplots.gl3d,s))}},convert:t("./convert"),draw:t("./draw")}},{"../../lib":168,"../../registry":257,"./attributes":45,"./convert":46,"./defaults":47,"./draw":48}],50:[function(t,e,r){"use strict";r.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],r.defaultLine="#444",r.lightLine="#eee",r.background="#fff",r.borderLine="#BEC8D9",r.lightFraction=1e3/11},{}],51:[function(t,e,r){"use strict";var n=t("tinycolor2"),a=t("fast-isnumeric"),i=e.exports={},o=t("./attributes");i.defaults=o.defaults;var l=i.defaultLine=o.defaultLine;i.lightLine=o.lightLine;var s=i.background=o.background;function c(t){if(a(t)||"string"!=typeof t)return t;var e=t.trim();if("rgb"!==e.substr(0,3))return t;var r=e.match(/^rgba?\s*\(([^()]*)\)$/);if(!r)return t;var n=r[1].trim().split(/\s*[\s,]\s*/),i="a"===e.charAt(3)&&4===n.length;if(!i&&3!==n.length)return t;for(var o=0;o<n.length;o++){if(!n[o].length)return t;if(n[o]=Number(n[o]),!(n[o]>=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}i.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},i.rgb=function(t){return i.tinyRGB(n(t))},i.opacity=function(t){return t?n(t).getAlpha():0},i.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},i.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var a=n(e||s).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},i.contrast=function(t,e,r){var a=n(t);return 1!==a.getAlpha()&&(a=n(i.combine(t,s))),(a.isDark()?e?a.lighten(e):s:r?a.darken(r):l).toString()},i.stroke=function(t,e){var r=n(e);t.style({stroke:i.tinyRGB(r),"stroke-opacity":r.getAlpha()})},i.fill=function(t,e){var r=n(e);t.style({fill:i.tinyRGB(r),"fill-opacity":r.getAlpha()})},i.clean=function(t){if(t&&"object"==typeof t){var e,r,n,a,o=Object.keys(t);for(e=0;e<o.length;e++)if(a=t[n=o[e]],"color"===n.substr(n.length-5))if(Array.isArray(a))for(r=0;r<a.length;r++)a[r]=c(a[r]);else t[n]=c(a);else if("colorscale"===n.substr(n.length-10)&&Array.isArray(a))for(r=0;r<a.length;r++)Array.isArray(a[r])&&(a[r][1]=c(a[r][1]));else if(Array.isArray(a)){var l=a[0];if(!Array.isArray(l)&&l&&"object"==typeof l)for(r=0;r<a.length;r++)i.clean(a[r])}else a&&"object"==typeof a&&i.clean(a)}}},{"./attributes":50,"fast-isnumeric":18,tinycolor2:34}],52:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/layout_attributes"),a=t("../../plots/font_attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll;e.exports=o({thicknessmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels"},thickness:{valType:"number",min:0,dflt:30},lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",dflt:1.02,min:-2,max:3},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},xpad:{valType:"number",min:0,dflt:10},y:{valType:"number",dflt:.5,min:-2,max:3},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle"},ypad:{valType:"number",min:0,dflt:10},outlinecolor:n.linecolor,outlinewidth:n.linewidth,bordercolor:n.linecolor,borderwidth:{valType:"number",min:0,dflt:0},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},tickmode:n.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:i({},n.ticks,{dflt:""}),ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,tickfont:a({}),tickangle:n.tickangle,tickformat:n.tickformat,tickformatstops:n.tickformatstops,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,separatethousands:n.separatethousands,exponentformat:n.exponentformat,showexponent:n.showexponent,title:{text:{valType:"string"},font:a({}),side:{valType:"enumerated",values:["right","top","bottom"],dflt:"top"}},_deprecated:{title:{valType:"string"},titlefont:a({}),titleside:{valType:"enumerated",values:["right","top","bottom"],dflt:"top"}}},"colorbars","from-root")},{"../../lib/extend":162,"../../plot_api/edit_types":195,"../../plots/cartesian/layout_attributes":225,"../../plots/font_attributes":239}],53:[function(t,e,r){"use strict";var n=t("./draw"),a=t("../colorscale/helpers").flipScale;e.exports=function(t,e,r){if("function"==typeof r)return r(t,e);var i=e[0].trace,o="cb"+i.uid;r=Array.isArray(r)?r:[r];for(var l=0;l<r.length;l++){var s=r[l].container,c=s?i[s]:i;if(t._fullLayout._infolayer.selectAll("."+o).remove(),c&&c.showscale){var u=e[0].t.cb=n(t,o),f=c.reversescale?a(c.colorscale):c.colorscale;return void u.fillgradient(f).zrange([c[r[l].min],c[r[l].max]]).options(c.colorbar)()}}}},{"../colorscale/helpers":62,"./draw":56}],54:[function(t,e,r){"use strict";e.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}},{}],55:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plot_api/plot_template"),i=t("../../plots/cartesian/tick_value_defaults"),o=t("../../plots/cartesian/tick_mark_defaults"),l=t("../../plots/cartesian/tick_label_defaults"),s=t("./attributes");e.exports=function(t,e,r){var c=a.newContainer(e,"colorbar"),u=t.colorbar||{};function f(t,e){return n.coerce(u,c,s,t,e)}var d=f("thicknessmode");f("thickness","fraction"===d?30/(r.width-r.margin.l-r.margin.r):30);var p=f("lenmode");f("len","fraction"===p?1:r.height-r.margin.t-r.margin.b),f("x"),f("xanchor"),f("xpad"),f("y"),f("yanchor"),f("ypad"),n.noneOrAll(u,c,["x","y"]),f("outlinecolor"),f("outlinewidth"),f("bordercolor"),f("borderwidth"),f("bgcolor"),i(u,c,f,"linear");var h={outerTicks:!1,font:r.font};l(u,c,f,"linear",h),o(u,c,f,"linear",h),f("title.text",r._dfltTitle.colorbar),n.coerceFont(f,"title.font",r.font),f("title.side")}},{"../../lib":168,"../../plot_api/plot_template":202,"../../plots/cartesian/tick_label_defaults":232,"../../plots/cartesian/tick_mark_defaults":233,"../../plots/cartesian/tick_value_defaults":234,"./attributes":52}],56:[function(t,e,r){"use strict";var n=t("d3"),a=t("tinycolor2"),i=t("../../plots/plots"),o=t("../../registry"),l=t("../../plots/cartesian/axes"),s=t("../dragelement"),c=t("../../lib"),u=t("../../lib/extend").extendFlat,f=t("../../lib/setcursor"),d=t("../drawing"),p=t("../color"),h=t("../titles"),g=t("../../lib/svg_text_utils"),v=t("../../constants/alignment"),y=v.LINE_SPACING,m=v.FROM_TL,x=v.FROM_BR,b=t("../../plots/cartesian/axis_defaults"),_=t("../../plots/cartesian/position_defaults"),w=t("../../plots/cartesian/layout_attributes"),k=t("./attributes"),T=t("./constants").cn;e.exports=function(t,e){var r={};for(var v in k)r[v]=null;function M(){var v=t._fullLayout,k=v._size;if("function"==typeof r.fillcolor||"function"==typeof r.line.color||r.fillgradient){var S,C,O=r.zrange||n.extent(("function"==typeof r.fillcolor?r.fillcolor:r.line.color).domain()),z=[],D=[],P="function"==typeof r.line.color?r.line.color:function(){return r.line.color},E="function"==typeof r.fillcolor?r.fillcolor:function(){return r.fillcolor},R=r.levels.end+r.levels.size/100,I=r.levels.size,F=1.001*O[0]-.001*O[1],N=1.001*O[1]-.001*O[0];for(C=0;C<1e5&&(S=r.levels.start+C*I,!(I>0?S>=R:S<=R));C++)S>F&&S<N&&z.push(S);if(r.fillgradient)D=[0];else if("function"==typeof r.fillcolor)if(r.filllevels)for(R=r.filllevels.end+r.filllevels.size/100,I=r.filllevels.size,C=0;C<1e5&&(S=r.filllevels.start+C*I,!(I>0?S>=R:S<=R));C++)S>O[0]&&S<O[1]&&D.push(S);else(D=z.map(function(t){return t-r.levels.size/2})).push(D[D.length-1]+r.levels.size);else r.fillcolor&&"string"==typeof r.fillcolor&&(D=[0]);r.levels.size<0&&(z.reverse(),D.reverse());var B,j=k.h,H=k.w,q=Math.round(r.thickness*("fraction"===r.thicknessmode?H:1)),V=q/k.w,U=Math.round(r.len*("fraction"===r.lenmode?j:1)),G=U/k.h,Z=r.xpad/k.w,X=(r.borderwidth+r.outlinewidth)/2,Y=r.ypad/k.h,W=Math.round(r.x*k.w+r.xpad),J=r.x-V*({middle:.5,right:1}[r.xanchor]||0),$=r.y+G*(({top:-.5,bottom:.5}[r.yanchor]||0)-.5),Q=Math.round(k.h*(1-$)),K=Q-U,tt={type:"linear",range:O,tickmode:r.tickmode,nticks:r.nticks,tick0:r.tick0,dtick:r.dtick,tickvals:r.tickvals,ticktext:r.ticktext,ticks:r.ticks,ticklen:r.ticklen,tickwidth:r.tickwidth,tickcolor:r.tickcolor,showticklabels:r.showticklabels,tickfont:r.tickfont,tickangle:r.tickangle,tickformat:r.tickformat,exponentformat:r.exponentformat,separatethousands:r.separatethousands,showexponent:r.showexponent,showtickprefix:r.showtickprefix,tickprefix:r.tickprefix,showticksuffix:r.showticksuffix,ticksuffix:r.ticksuffix,title:r.title,showline:!0,anchor:"free",side:"right",position:1},et={type:"linear",_id:"y"+e},rt={letter:"y",font:v.font,noHover:!0,noTickson:!0,calendar:v.calendar};if(b(tt,et,mt,rt,v),_(tt,et,mt,rt),et.position=r.x+Z+V,M.axis=et,-1!==["top","bottom"].indexOf(r.title.side)&&(et.title.side=r.title.side,et.titlex=r.x+Z,et.titley=$+("top"===r.title.side?G-Y:Y)),r.line.color&&"auto"===r.tickmode){et.tickmode="linear",et.tick0=r.levels.start;var nt=r.levels.size,at=c.constrain((Q-K)/50,4,15)+1,it=(O[1]-O[0])/((r.nticks||at)*nt);if(it>1){var ot=Math.pow(10,Math.floor(Math.log(it)/Math.LN10));nt*=ot*c.roundUp(it/ot,[2,5,10]),(Math.abs(r.levels.start)/r.levels.size+1e-6)%1<2e-6&&(et.tick0=0)}et.dtick=nt}et.domain=[$+Y,$+G-Y],et.setScale();var lt=c.ensureSingle(v._infolayer,"g",e,function(t){t.classed(T.colorbar,!0).each(function(){var t=n.select(this);t.append("rect").classed(T.cbbg,!0),t.append("g").classed(T.cbfills,!0),t.append("g").classed(T.cblines,!0),t.append("g").classed(T.cbaxis,!0).classed(T.crisp,!0),t.append("g").classed(T.cbtitleunshift,!0).append("g").classed(T.cbtitle,!0),t.append("rect").classed(T.cboutline,!0),t.select(".cbtitle").datum(0)})});lt.attr("transform","translate("+Math.round(k.l)+","+Math.round(k.t)+")");var st=lt.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(k.l)+",-"+Math.round(k.t)+")"),ct=lt.select(".cbaxis"),ut=0;if(-1!==["top","bottom"].indexOf(r.title.side)){var ft,dt=k.l+(r.x+Z)*k.w,pt=et.title.font.size;ft="top"===r.title.side?(1-($+G-Y))*k.h+k.t+3+.75*pt:(1-($+Y))*k.h+k.t-3-.25*pt,xt(et._id+"title",{attributes:{x:dt,y:ft,"text-anchor":"start"}})}var ht,gt,vt,yt=c.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(r.title.side)){var i=lt.select(".cbtitle"),o=i.select("text"),s=[-r.outlinewidth/2,r.outlinewidth/2],u=i.select(".h"+et._id+"title-math-group").node(),f=15.6;if(o.node()&&(f=parseInt(o.node().style.fontSize,10)*y),u?(ut=d.bBox(u).height)>f&&(s[1]-=(ut-f)/2):o.node()&&!o.classed(T.jsPlaceholder)&&(ut=d.bBox(o.node()).height),ut){if(ut+=5,"top"===r.title.side)et.domain[1]-=ut/k.h,s[1]*=-1;else{et.domain[0]+=ut/k.h;var p=g.lineCount(o);s[1]+=(1-p)*f}i.attr("transform","translate("+s+")"),et.setScale()}}lt.selectAll(".cbfills,.cblines").attr("transform","translate(0,"+Math.round(k.h*(1-et.domain[1]))+")"),ct.attr("transform","translate(0,"+Math.round(-k.t)+")");var h=lt.select(".cbfills").selectAll("rect.cbfill").data(D);h.enter().append("rect").classed(T.cbfill,!0).style("stroke","none"),h.exit().remove();var m=O.map(et.c2p).map(Math.round).sort(function(t,e){return t-e});h.each(function(i,o){var l=[0===o?O[0]:(D[o]+D[o-1])/2,o===D.length-1?O[1]:(D[o]+D[o+1])/2].map(et.c2p).map(Math.round);l[1]=c.constrain(l[1]+(l[1]>l[0])?1:-1,m[0],m[1]);var s=n.select(this).attr({x:W,width:Math.max(q,2),y:n.min(l),height:Math.max(n.max(l)-n.min(l),2)});if(r.fillgradient)d.gradient(s,t,e,"vertical",r.fillgradient,"fill");else{var u=E(i).replace("e-","");s.attr("fill",a(u).toHexString())}});var x=lt.select(".cblines").selectAll("path.cbline").data(r.line.color&&r.line.width?z:[]);return x.enter().append("path").classed(T.cbline,!0),x.exit().remove(),x.each(function(t){n.select(this).attr("d","M"+W+","+(Math.round(et.c2p(t))+r.line.width/2%1)+"h"+q).call(d.lineGroupStyle,r.line.width,P(t),r.line.dash)}),ct.selectAll("g."+et._id+"tick,path").remove(),c.syncOrAsync([function(){var e=W+q+(r.outlinewidth||0)/2-("outside"===r.ticks?1:0),n=l.calcTicks(et),a=l.makeTransFn(et),i=l.makeLabelFns(et,e),o=l.getTickSigns(et)[2];return l.drawTicks(t,et,{vals:"inside"===et.ticks?l.clipEnds(et,n):n,layer:ct,path:l.makeTickPath(et,e,o),transFn:a}),l.drawLabels(t,et,{vals:n,layer:ct,transFn:a,labelXFn:i.labelXFn,labelYFn:i.labelYFn,labelAnchorFn:i.labelAnchorFn})},function(){if(-1===["top","bottom"].indexOf(r.title.side)){var e=et.title.font.size,a=et._offset+et._length/2,i=k.l+(et.position||0)*k.w+("right"===et.side?10+e*(et.showticklabels?1:.5):-10-e*(et.showticklabels?.5:0));xt("h"+et._id+"title",{avoid:{selection:n.select(t).selectAll("g."+et._id+"tick"),side:r.title.side,offsetLeft:k.l,offsetTop:0,maxShift:v.width},attributes:{x:i,y:a,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])},i.previousPromises,function(){var n=q+r.outlinewidth/2+d.bBox(ct.node()).width;if((B=st.select("text")).node()&&!B.classed(T.jsPlaceholder)){var a,o=st.select(".h"+et._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(r.title.side)?d.bBox(o).width:d.bBox(st.node()).right-W-k.l,n=Math.max(n,a)}var l=2*r.xpad+n+r.borderwidth+r.outlinewidth/2,s=Q-K;lt.select(".cbbg").attr({x:W-r.xpad-(r.borderwidth+r.outlinewidth)/2,y:K-X,width:Math.max(l,2),height:Math.max(s+2*X,2)}).call(p.fill,r.bgcolor).call(p.stroke,r.bordercolor).style({"stroke-width":r.borderwidth}),lt.selectAll(".cboutline").attr({x:W,y:K+r.ypad+("top"===r.title.side?ut:0),width:Math.max(q,2),height:Math.max(s-2*r.ypad-ut,2)}).call(p.stroke,r.outlinecolor).style({fill:"None","stroke-width":r.outlinewidth});var c=({center:.5,right:1}[r.xanchor]||0)*l;lt.attr("transform","translate("+(k.l-c)+","+k.t+")");var u={},f=m[r.yanchor],h=x[r.yanchor];"pixels"===r.lenmode?(u.y=r.y,u.t=s*f,u.b=s*h):(u.t=u.b=0,u.yt=r.y+r.len*f,u.yb=r.y-r.len*h);var g=m[r.xanchor],v=x[r.xanchor];if("pixels"===r.thicknessmode)u.x=r.x,u.l=l*g,u.r=l*v;else{var y=l-q;u.l=y*g,u.r=y*v,u.xl=r.x-r.thickness*g,u.xr=r.x+r.thickness*v}i.autoMargin(t,e,u)}],t);if(yt&&yt.then&&(t._promises||[]).push(yt),t._context.edits.colorbarPosition)s.init({element:lt.node(),gd:t,prepFn:function(){ht=lt.attr("transform"),f(lt)},moveFn:function(t,e){lt.attr("transform",ht+" translate("+t+","+e+")"),gt=s.align(J+t/k.w,V,0,1,r.xanchor),vt=s.align($-e/k.h,G,0,1,r.yanchor);var n=s.getCursor(gt,vt,r.xanchor,r.yanchor);f(lt,n)},doneFn:function(){if(f(lt),void 0!==gt&&void 0!==vt){var e={};e[L("x")]=gt,e[L("y")]=vt,o.call("_guiRestyle",t,e,A().index)}}});return yt}function mt(t,e){return c.coerce(tt,et,w,t,e)}function xt(e,r){var n={propContainer:et,propName:L("title"),traceIndex:A().index,placeholder:v._dfltTitle.colorbar,containerGroup:lt.select(".cbtitle")},a="h"===e.charAt(0)?e.substr(1):"h"+e;lt.selectAll("."+a+",."+a+"-math-group").remove(),h.draw(t,e,u(n,r||{}))}v._infolayer.selectAll("g."+e).remove()}function A(){for(var r=e.substr(2),n=0;n<t._fullData.length;n++){var a=t._fullData[n];if(a.uid===r)return a}}function L(t){var e="colorbar.",r=A()._module.colorbar.container;return r&&(e=r+"."+e),e+t}return r.fillcolor=null,r.line={color:null,width:null,dash:null},r.levels={start:null,end:null,size:null},r.filllevels=null,r.fillgradient=null,r.zrange=null,Object.keys(r).forEach(function(t){M[t]=function(e){return arguments.length?(r[t]=c.isPlainObject(r[t])?c.extendFlat(r[t],e):e,M):r[t]}}),M.options=function(t){for(var e in t)"function"==typeof M[e]&&M[e](t[e]);return M},M._opts=r,M}},{"../../constants/alignment":146,"../../lib":168,"../../lib/extend":162,"../../lib/setcursor":187,"../../lib/svg_text_utils":189,"../../plots/cartesian/axes":212,"../../plots/cartesian/axis_defaults":214,"../../plots/cartesian/layout_attributes":225,"../../plots/cartesian/position_defaults":228,"../../plots/plots":245,"../../registry":257,"../color":51,"../dragelement":69,"../drawing":72,"../titles":139,"./attributes":52,"./constants":54,d3:16,tinycolor2:34}],57:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":168}],58:[function(t,e,r){"use strict";var n=t("./scales.js").scales;Object.keys(n);function a(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,i=(e=e||{}).cLetter||"c",o=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),l="showScaleDflt"in e?e.showScaleDflt:"z"===i,s="string"==typeof e.colorscaleDflt?n[e.colorscaleDflt]:null,c=e.editTypeOverride||"",u=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):a(u+(r={z:"z",c:"color"}[i]));var f=i+"auto",d=i+"min",p=i+"max",h=(a(u+d),a(u+p),{});h[d]=h[p]=void 0;var g={};g[f]=!1;var v={};return"color"===r&&(v.color={valType:"color",arrayOk:!0,editType:c||"style"},e.anim&&(v.color.anim=!0)),v[f]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:h},v[d]={valType:"number",dflt:null,editType:c||"plot",impliedEdits:g},v[p]={valType:"number",dflt:null,editType:c||"plot",impliedEdits:g},v.colorscale={valType:"colorscale",editType:"calc",dflt:s,impliedEdits:{autocolorscale:!1}},v.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},v.reversescale={valType:"boolean",dflt:!1,editType:"plot"},o||(v.showscale={valType:"boolean",dflt:l,editType:"calc"}),v}},{"./scales.js":66}],59:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){var a=t._fullLayout,i=r.vals,o=r.containerStr,l=r.cLetter,s=o?n.nestedProperty(e,o).get():e,c=l+"min",u=l+"max",f=s[l+"auto"],d=s[c],p=s[u],h=s.colorscale;!1===f&&void 0!==d||(d=n.aggNums(Math.min,null,i)),!1===f&&void 0!==p||(p=n.aggNums(Math.max,null,i)),d===p&&(d-=.5,p+=.5),s["_"+c]=s[c]=d,s["_"+u]=s[u]=p,s.autocolorscale&&(h=d*p<0?a.colorscale.diverging:d>=0?a.colorscale.sequential:a.colorscale.sequentialminus,s._colorscale=s.colorscale=h)}},{"../../lib":168}],60:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./helpers").hasColorscale;e.exports=function(t){function e(t,e){var r=t["_"+e];void 0!==r&&(t[e]=r)}function r(t,r){var a=r.container?n.nestedProperty(t,r.container).get():t;if(a){var i=a.zauto||a.cauto,o=r.min,l=r.max;(i||void 0===a[o])&&e(a,o),(i||void 0===a[l])&&e(a,l),a.autocolorscale&&e(a,"colorscale")}}for(var i=0;i<t.length;i++){var o=t[i],l=o._module;l.colorbar&&r(o,l.colorbar),a(o,"marker.line")&&r(o,{container:"marker.line",min:"cmin",max:"cmax"}),a(o,"line")&&r(o,{container:"line",min:"cmin",max:"cmax"})}}},{"../../lib":168,"./helpers":62}],61:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../colorbar/has_colorbar"),o=t("../colorbar/defaults"),l=t("./scales").isValid;function s(t,e){var r=e.slice(0,e.length-1);return e?a.nestedProperty(t,r).get()||{}:t}e.exports=function(t,e,r,a,c){var u=c.prefix,f=c.cLetter,d=s(t,u),p=s(e,u),h=s(e._template||{},u)||{},g=d[f+"min"],v=d[f+"max"];a(u+f+"auto",!(n(g)&&n(v)&&g<v)),a(u+f+"min"),a(u+f+"max");var y,m,x=d.colorscale,b=h.colorscale;(void 0!==x&&(y=!l(x)),void 0!==b&&(y=!l(b)),a(u+"autocolorscale",y),a(u+"colorscale"),a(u+"reversescale"),c.noScale||"marker.line."===u)||(u&&(m=i(d)),a(u+"showscale",m)&&o(d,p,r))}},{"../../lib":168,"../colorbar/defaults":55,"../colorbar/has_colorbar":57,"./scales":66,"fast-isnumeric":18}],62:[function(t,e,r){"use strict";var n=t("d3"),a=t("tinycolor2"),i=t("fast-isnumeric"),o=t("../../lib"),l=t("../color"),s=t("./scales").isValid;function c(t){for(var e=t.length,r=new Array(e),n=e-1,a=0;n>=0;n--,a++){var i=t[n];r[a]=[1-i[0],i[1]]}return r}function u(t){var e={r:t[0],g:t[1],b:t[2],a:t[3]};return a(e).toRgbString()}e.exports={hasColorscale:function(t,e){var r=e?o.nestedProperty(t,e).get()||{}:t,n=r.color,a=!1;if(o.isArrayOrTypedArray(n))for(var l=0;l<n.length;l++)if(i(n[l])){a=!0;break}return o.isPlainObject(r)&&(a||!0===r.showscale||i(r.cmin)&&i(r.cmax)||s(r.colorscale)||o.isPlainObject(r.colorbar))},extractScale:function(t,e){for(var r=e.cLetter,n=t.reversescale?c(t.colorscale):t.colorscale,a=t[r+"min"],i=t[r+"max"],o=n.length,l=new Array(o),s=new Array(o),u=0;u<o;u++){var f=n[u];l[u]=a+f[0]*(i-a),s[u]=f[1]}return{domain:l,range:s}},flipScale:c,makeColorScaleFunc:function(t,e){e=e||{};for(var r=t.domain,o=t.range,s=o.length,c=new Array(s),f=0;f<s;f++){var d=a(o[f]).toRgb();c[f]=[d.r,d.g,d.b,d.a]}var p,h=n.scale.linear().domain(r).range(c).clamp(!0),g=e.noNumericCheck,v=e.returnArray;return(p=g&&v?h:g?function(t){return u(h(t))}:v?function(t){return i(t)?h(t):a(t).isValid()?t:l.defaultLine}:function(t){return i(t)?u(h(t)):a(t).isValid()?t:l.defaultLine}).domain=h.domain,p.range=function(){return o},p}}},{"../../lib":168,"../color":51,"./scales":66,d3:16,"fast-isnumeric":18,tinycolor2:34}],63:[function(t,e,r){"use strict";var n=t("./scales"),a=t("./helpers");e.exports={moduleType:"component",name:"colorscale",attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyLayoutDefaults:t("./layout_defaults"),handleDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),calc:t("./calc"),scales:n.scales,defaultScale:n.defaultScale,getScale:n.get,isValidScale:n.isValid,hasColorscale:a.hasColorscale,flipScale:a.flipScale,extractScale:a.extractScale,makeColorScaleFunc:a.makeColorScaleFunc}},{"./attributes":58,"./calc":59,"./cross_trace_defaults":60,"./defaults":61,"./helpers":62,"./layout_attributes":64,"./layout_defaults":65,"./scales":66}],64:[function(t,e,r){"use strict";var n=t("./scales").scales;e.exports={editType:"calc",sequential:{valType:"colorscale",dflt:n.Reds,editType:"calc"},sequentialminus:{valType:"colorscale",dflt:n.Blues,editType:"calc"},diverging:{valType:"colorscale",dflt:n.RdBu,editType:"calc"}}},{"./scales":66}],65:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes"),i=t("../../plot_api/plot_template");e.exports=function(t,e){var r=t.colorscale,o=i.newContainer(e,"colorscale");function l(t,e){return n.coerce(r,o,a,t,e)}l("sequential"),l("sequentialminus"),l("diverging")}},{"../../lib":168,"../../plot_api/plot_template":202,"./layout_attributes":64}],66:[function(t,e,r){"use strict";var n=t("tinycolor2"),a={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]],Cividis:[[0,"rgb(0,32,76)"],[.058824,"rgb(0,42,102)"],[.117647,"rgb(0,52,110)"],[.176471,"rgb(39,63,108)"],[.235294,"rgb(60,74,107)"],[.294118,"rgb(76,85,107)"],[.352941,"rgb(91,95,109)"],[.411765,"rgb(104,106,112)"],[.470588,"rgb(117,117,117)"],[.529412,"rgb(131,129,120)"],[.588235,"rgb(146,140,120)"],[.647059,"rgb(161,152,118)"],[.705882,"rgb(176,165,114)"],[.764706,"rgb(192,177,109)"],[.823529,"rgb(209,191,102)"],[.882353,"rgb(225,204,92)"],[.941176,"rgb(243,219,79)"],[1,"rgb(255,233,69)"]]},i=a.RdBu;function o(t){var e=0;if(!Array.isArray(t)||t.length<2)return!1;if(!t[0]||!t[t.length-1])return!1;if(0!=+t[0][0]||1!=+t[t.length-1][0])return!1;for(var r=0;r<t.length;r++){var a=t[r];if(2!==a.length||+a[0]<e||!n(a[1]).isValid())return!1;e=+a[0]}return!0}e.exports={scales:a,defaultScale:i,get:function(t,e){if(e||(e=i),!t)return e;function r(){try{t=a[t]||JSON.parse(t)}catch(r){t=e}}return"string"==typeof t&&(r(),"string"==typeof t&&r()),o(t)?t:e},isValid:function(t){return void 0!==a[t]||o(t)}}},{tinycolor2:34}],67:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,a){var i=(t-r)/(n-r),o=i+e/(n-r),l=(i+o)/2;return"left"===a||"bottom"===a?i:"center"===a||"middle"===a?l:"right"===a||"top"===a?o:i<2/3-l?i:o>4/3-l?o:l}},{}],68:[function(t,e,r){"use strict";var n=t("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,i){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*e),0,2),a[e][t]}},{"../../lib":168}],69:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),a=t("has-hover"),i=t("has-passive-events"),o=t("../../registry"),l=t("../../lib"),s=t("../../plots/cartesian/constants"),c=t("../../constants/interactions"),u=e.exports={};u.align=t("./align"),u.getCursor=t("./cursor");var f=t("./unhover");function d(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function p(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}u.unhover=f.wrapped,u.unhoverRaw=f.raw,u.init=function(t){var e,r,n,f,h,g,v,y,m=t.gd,x=1,b=c.DBLCLICKDELAY,_=t.element;m._mouseDownTime||(m._mouseDownTime=0),_.style.pointerEvents="all",_.onmousedown=k,i?(_._ontouchstart&&_.removeEventListener("touchstart",_._ontouchstart),_._ontouchstart=k,_.addEventListener("touchstart",k,{passive:!1})):_.ontouchstart=k;var w=t.clampFn||function(t,e,r){return Math.abs(t)<r&&(t=0),Math.abs(e)<r&&(e=0),[t,e]};function k(i){m._dragged=!1,m._dragging=!0;var o=p(i);e=o[0],r=o[1],v=i.target,g=i,y=2===i.buttons||i.ctrlKey,"undefined"==typeof i.clientX&&"undefined"==typeof i.clientY&&(i.clientX=e,i.clientY=r),(n=(new Date).getTime())-m._mouseDownTime<b?x+=1:(x=1,m._mouseDownTime=n),t.prepFn&&t.prepFn(i,e,r),a&&!y?(h=d()).style.cursor=window.getComputedStyle(_).cursor:a||(h=document,f=window.getComputedStyle(document.documentElement).cursor,document.documentElement.style.cursor=window.getComputedStyle(_).cursor),document.addEventListener("mouseup",M),document.addEventListener("touchend",M),!1!==t.dragmode&&(i.preventDefault(),document.addEventListener("mousemove",T),document.addEventListener("touchmove",T))}function T(n){n.preventDefault();var a=p(n),i=t.minDrag||s.MINDRAG,o=w(a[0]-e,a[1]-r,i),l=o[0],c=o[1];(l||c)&&(m._dragged=!0,u.unhover(m)),m._dragged&&t.moveFn&&!y&&t.moveFn(l,c)}function M(e){if(!1!==t.dragmode&&(e.preventDefault(),document.removeEventListener("mousemove",T),document.removeEventListener("touchmove",T)),document.removeEventListener("mouseup",M),document.removeEventListener("touchend",M),a?l.removeElement(h):f&&(h.documentElement.style.cursor=f,f=null),m._dragging){if(m._dragging=!1,(new Date).getTime()-m._mouseDownTime>b&&(x=Math.max(x-1,1)),m._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(x,g),!y){var r;try{r=new MouseEvent("click",e)}catch(t){var n=p(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}v.dispatchEvent(r)}!function(t){t._dragging=!1,t._replotPending&&o.call("plot",t)}(m),m._dragged=!1}else m._dragged=!1}},u.coverSlip=d},{"../../constants/interactions":148,"../../lib":168,"../../plots/cartesian/constants":218,"../../registry":257,"./align":67,"./cursor":68,"./unhover":70,"has-hover":20,"has-passive-events":21,"mouse-event-offset":24}],70:[function(t,e,r){"use strict";var n=t("../../lib/events"),a=t("../../lib/throttle"),i=t("../../lib/get_graph_div"),o=t("../fx/constants"),l=e.exports={};l.wrapped=function(t,e,r){(t=i(t))._fullLayout&&a.clear(t._fullLayout._uid+o.HOVERID),l.raw(t,e,r)},l.raw=function(t,e){var r=t._fullLayout,a=t._hoverdata;e||(e={}),e.target&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&a&&t.emit("plotly_unhover",{event:e,points:a}))}},{"../../lib/events":161,"../../lib/get_graph_div":166,"../../lib/throttle":190,"../fx/constants":84}],71:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],72:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("tinycolor2"),o=t("../../registry"),l=t("../color"),s=t("../colorscale"),c=t("../../lib"),u=t("../../lib/svg_text_utils"),f=t("../../constants/xmlns_namespaces"),d=t("../../constants/alignment").LINE_SPACING,p=t("../../constants/interactions").DESELECTDIM,h=t("../../traces/scatter/subtypes"),g=t("../../traces/scatter/make_bubble_size_func"),v=e.exports={};v.font=function(t,e,r,n){c.isPlainObject(e)&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(l.fill,n)},v.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},v.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},v.setRect=function(t,e,r,n,a){t.call(v.setPosition,e,r).call(v.setSize,n,a)},v.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),o=n.c2p(t.y);return!!(a(i)&&a(o)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",o):e.attr("transform","translate("+i+","+o+")"),!0)},v.translatePoints=function(t,e,r){t.each(function(t){var a=n.select(this);v.translatePoint(t,a,e,r)})},v.hideOutsideRangePoint=function(t,e,r,n,a,i){e.attr("display",r.isPtWithinRange(t,a)&&n.isPtWithinRange(t,i)?null:"none")},v.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,a=e.yaxis;t.each(function(e){var i=e[0].trace,o=i.xcalendar,l=i.ycalendar,s="bar"===i.type?".bartext":".point,.textpoint";t.selectAll(s).each(function(t){v.hideOutsideRangePoint(t,n.select(this),r,a,o,l)})})}},v.crispRound=function(t,e,r){return e&&a(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},v.singleLineStyle=function(t,e,r,n,a){e.style("fill","none");var i=(((t||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,s=a||i.dash||"";l.stroke(e,n||i.color),v.dashLine(e,s,o)},v.lineGroupStyle=function(t,e,r,a){t.style("fill","none").each(function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},o=e||i.width||0,s=a||i.dash||"";n.select(this).call(l.stroke,r||i.color).call(v.dashLine,s,o)})},v.dashLine=function(t,e,r){r=+r||0,e=v.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},v.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},v.singleFillStyle=function(t){var e=(((n.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(l.fill,e)},v.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(t){var e=n.select(this);t[0].trace&&e.call(l.fill,t[0].trace.fillcolor)})};var y=t("./symbol_defs");v.symbolNames=[],v.symbolFuncs=[],v.symbolNeedLines={},v.symbolNoDot={},v.symbolNoFill={},v.symbolList=[],Object.keys(y).forEach(function(t){var e=y[t];v.symbolList=v.symbolList.concat([e.n,t,e.n+100,t+"-open"]),v.symbolNames[e.n]=t,v.symbolFuncs[e.n]=e.f,e.needLine&&(v.symbolNeedLines[e.n]=!0),e.noDot?v.symbolNoDot[e.n]=!0:v.symbolList=v.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"]),e.noFill&&(v.symbolNoFill[e.n]=!0)});var m=v.symbolNames.length,x="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";function b(t,e){var r=t%100;return v.symbolFuncs[r](e)+(t>=200?x:"")}v.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),(t=v.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=m||t>=400?0:Math.floor(Math.max(t,0))};var _={x1:1,x2:0,y1:0,y2:0},w={x1:0,x2:0,y1:1,y2:0},k=n.format("~.1f"),T={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:_},horizontalreversed:{node:"linearGradient",attrs:_,reversed:!0},vertical:{node:"linearGradient",attrs:w},verticalreversed:{node:"linearGradient",attrs:w,reversed:!0}};v.gradient=function(t,e,r,a,o,s){for(var u=o.length,f=T[a],d=new Array(u),p=0;p<u;p++)f.reversed?d[u-1-p]=[k(100*(1-o[p][0])),o[p][1]]:d[p]=[k(100*o[p][0]),o[p][1]];var h="g"+e._fullLayout._uid+"-"+r,g=e._fullLayout._defs.select(".gradients").selectAll("#"+h).data([a+d.join(";")],c.identity);g.exit().remove(),g.enter().append(f.node).each(function(){var t=n.select(this);f.attrs&&t.attr(f.attrs),t.attr("id",h);var e=t.selectAll("stop").data(d);e.exit().remove(),e.enter().append("stop"),e.each(function(t){var e=i(t[1]);n.select(this).attr({offset:t[0]+"%","stop-color":l.tinyRGB(e),"stop-opacity":e.getAlpha()})})}),t.style(s,"url(#"+h+")").style(s+"-opacity",null)},v.initGradients=function(t){c.ensureSingle(t._fullLayout._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove()},v.pointStyle=function(t,e,r){if(t.size()){var a=v.makePointStyleFns(e);t.each(function(t){v.singlePointStyle(t,n.select(this),e,a,r)})}},v.singlePointStyle=function(t,e,r,n,a){var i=r.marker,o=i.line;if(e.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(t):void 0===t.mo?i.opacity:t.mo),n.ms2mrc){var s;s="various"===t.ms||"various"===i.size?3:n.ms2mrc(t.ms),t.mrc=s,n.selectedSizeFn&&(s=t.mrc=n.selectedSizeFn(t));var u=v.symbolNumber(t.mx||i.symbol)||0;t.om=u%200>=100,e.attr("d",b(u,s))}var f,d,p,h=!1;if(t.so)p=o.outlierwidth,d=o.outliercolor,f=i.outliercolor;else{var g=(o||{}).width;p=(t.mlw+1||g+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,d="mlc"in t?t.mlcc=n.lineScale(t.mlc):c.isArrayOrTypedArray(o.color)?l.defaultLine:o.color,c.isArrayOrTypedArray(i.color)&&(f=l.defaultLine,h=!0),f="mc"in t?t.mcc=n.markerScale(t.mc):i.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(t))}if(t.om)e.call(l.stroke,f).style({"stroke-width":(p||1)+"px",fill:"none"});else{e.style("stroke-width",p+"px");var y=i.gradient,m=t.mgt;if(m?h=!0:m=y&&y.type,Array.isArray(m)&&(m=m[0],T[m]||(m=0)),m&&"none"!==m){var x=t.mgc;x?h=!0:x=y.color;var _=r.uid;h&&(_+="-"+t.i),v.gradient(e,a,_,m,[[0,x],[1,f]],"fill")}else l.fill(e,f);p&&l.stroke(e,d)}},v.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=v.tryColorscale(r,""),e.lineScale=v.tryColorscale(r,"line"),o.traceIs(t,"symbols")&&(e.ms2mrc=h.isBubble(t)?g(t):function(){return(r.size||6)/2}),t.selectedpoints&&c.extendFlat(e,v.makeSelectedPointStyleFns(t)),e},v.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.marker||{},i=r.marker||{},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)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?a.opacity:t.mo;return t.selected?d?u:e:h?f:p*e});var g=a.color,v=i.color,y=l.color;(v||y)&&(e.selectedColorFn=function(t){var e=t.mcc||g;return t.selected?v||e:y||e});var m=a.size,x=i.size,b=l.size,_=void 0!==x,w=void 0!==b;return o.traceIs(t,"symbols")&&(_||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||m/2;return t.selected?_?x/2:e:w?b/2:e}),e},v.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.textfont||{},i=r.textfont||{},o=n.textfont||{},s=a.color,c=i.color,u=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?c||e:u||(c?e:l.addOpacity(e,p))},e},v.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=v.makeSelectedPointStyleFns(e),a=e.marker||{},i=[];r.selectedOpacityFn&&i.push(function(t,e){t.style("opacity",r.selectedOpacityFn(e))}),r.selectedColorFn&&i.push(function(t,e){l.fill(t,r.selectedColorFn(e))}),r.selectedSizeFn&&i.push(function(t,e){var n=e.mx||a.symbol||0,i=r.selectedSizeFn(e);t.attr("d",b(v.symbolNumber(n),i)),e.mrc2=i}),i.length&&t.each(function(t){for(var e=n.select(this),r=0;r<i.length;r++)i[r](e,t)})}},v.tryColorscale=function(t,e){var r=e?c.nestedProperty(t,e).get():t;if(r){var n=r.colorscale,a=r.color;if(n&&c.isArrayOrTypedArray(a))return s.makeColorScaleFunc(s.extractScale(r,{cLetter:"c"}))}return c.identity};var M={start:1,end:-1,middle:0,bottom:1,top:-1};function A(t,e,r,a){var i=n.select(t.node().parentNode),o=-1!==e.indexOf("top")?"top":-1!==e.indexOf("bottom")?"bottom":"middle",l=-1!==e.indexOf("left")?"end":-1!==e.indexOf("right")?"start":"middle",s=a?a/.8+1:0,c=(u.lineCount(t)-1)*d+1,f=M[l]*s,p=.75*r+M[o]*s+(M[o]-1)*c*r/2;t.attr("text-anchor",l),i.attr("transform","translate("+f+","+p+")")}function L(t,e){var r=t.ts||e.textfont.size;return a(r)&&r>0?r:0}v.textPointStyle=function(t,e,r){if(t.size()){var a;if(e.selectedpoints){var i=v.makeSelectedTextStyleFns(e);a=i.selectedTextColorFn}t.each(function(t){var i=n.select(this),o=c.extractOption(t,e,"tx","text");if(o||0===o){var l=t.tp||e.textposition,s=L(t,e),f=a?a(t):t.tc||e.textfont.color;i.call(v.font,t.tf||e.textfont.family,s,f).text(o).call(u.convertToTspans,r).call(A,l,s,t.mrc)}else i.remove()})}},v.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=v.makeSelectedTextStyleFns(e);t.each(function(t){var a=n.select(this),i=r.selectedTextColorFn(t),o=t.tp||e.textposition,s=L(t,e);l.fill(a,i),A(a,o,s,t.mrc2||t.mrc)})}};var S=.5;function C(t,e,r,a){var i=t[0]-e[0],o=t[1]-e[1],l=r[0]-e[0],s=r[1]-e[1],c=Math.pow(i*i+o*o,S/2),u=Math.pow(l*l+s*s,S/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(e[0]+(p&&f/p),2),n.round(e[1]+(p&&d/p),2)],[n.round(e[0]-(h&&f/h),2),n.round(e[1]-(h&&d/h),2)]]}v.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],a=[];for(r=1;r<t.length-1;r++)a.push(C(t[r-1],t[r],t[r+1],e));for(n+="Q"+a[0][0]+" "+t[1],r=2;r<t.length-1;r++)n+="C"+a[r-2][1]+" "+a[r-1][0]+" "+t[r];return n+="Q"+a[t.length-3][1]+" "+t[t.length-1]},v.smoothclosed=function(t,e){if(t.length<3)return"M"+t.join("L")+"Z";var r,n="M"+t[0],a=t.length-1,i=[C(t[a],t[0],t[1],e)];for(r=1;r<a;r++)i.push(C(t[r-1],t[r],t[r+1],e));for(i.push(C(t[a-1],t[a],t[0],e)),r=1;r<=a;r++)n+="C"+i[r-1][1]+" "+i[r][0]+" "+t[r];return n+="C"+i[a][1]+" "+i[0][0]+" "+t[0]+"Z"};var O={hv:function(t,e){return"H"+n.round(e[0],2)+"V"+n.round(e[1],2)},vh:function(t,e){return"V"+n.round(e[1],2)+"H"+n.round(e[0],2)},hvh:function(t,e){return"H"+n.round((t[0]+e[0])/2,2)+"V"+n.round(e[1],2)+"H"+n.round(e[0],2)},vhv:function(t,e){return"V"+n.round((t[1]+e[1])/2,2)+"H"+n.round(e[0],2)+"V"+n.round(e[1],2)}},z=function(t,e){return"L"+n.round(e[0],2)+","+n.round(e[1],2)};v.steps=function(t){var e=O[t]||z;return function(t){for(var r="M"+n.round(t[0][0],2)+","+n.round(t[0][1],2),a=1;a<t.length;a++)r+=e(t[a-1],t[a]);return r}},v.makeTester=function(){var t=c.ensureSingleById(n.select("body"),"svg","js-plotly-tester",function(t){t.attr(f.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})}),e=c.ensureSingle(t,"path","js-reference-point",function(t){t.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})});v.tester=t,v.testref=e},v.savedBBoxes={};var D=0;function P(t){var e=t.getAttribute("data-unformatted");if(null!==e)return e+t.getAttribute("data-math")+t.getAttribute("text-anchor")+t.getAttribute("style")}v.bBox=function(t,e,r){var a,i,o;if(r||(r=P(t)),r){if(a=v.savedBBoxes[r])return c.extendFlat({},a)}else if(1===t.childNodes.length){var l=t.childNodes[0];if(r=P(l)){var s=+l.getAttribute("x")||0,f=+l.getAttribute("y")||0,d=l.getAttribute("transform");if(!d){var p=v.bBox(l,!1,r);return s&&(p.left+=s,p.right+=s),f&&(p.top+=f,p.bottom+=f),p}if(r+="~"+s+"~"+f+"~"+d,a=v.savedBBoxes[r])return c.extendFlat({},a)}}e?i=t:(o=v.tester.node(),i=t.cloneNode(!0),o.appendChild(i)),n.select(i).attr("transform",null).call(u.positionText,0,0);var h=i.getBoundingClientRect(),g=v.testref.node().getBoundingClientRect();e||o.removeChild(i);var y={height:h.height,width:h.width,left:h.left-g.left,top:h.top-g.top,right:h.right-g.left,bottom:h.bottom-g.top};return D>=1e4&&(v.savedBBoxes={},D=0),r&&(v.savedBBoxes[r]=y),D++,c.extendFlat({},y)},v.setClipUrl=function(t,e,r){if(e){var n=r._context,a=n._exportedPlot?"":n._baseUrl||"";t.attr("clip-path","url("+a+"#"+e+")")}else t.attr("clip-path",null)},v.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+e[0]||0,y:+e[1]||0}},v.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",i=t[n]("transform")||"";return e=e||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=" translate("+e+", "+r+")").trim(),t[a]("transform",i),i},v.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+e[0]||1,y:+e[1]||1}},v.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",i=t[n]("transform")||"";return e=e||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+=" scale("+e+", "+r+")").trim(),t[a]("transform",i),i};var E=/\s*sc.*/;v.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":" scale("+e+","+r+")";t.each(function(){var t=(this.getAttribute("transform")||"").replace(E,"");t=(t+=n).trim(),this.setAttribute("transform",t)})}};var R=/translate\([^)]*\)\s*$/;v.setTextPointsScale=function(t,e,r){t&&t.each(function(){var t,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),l=parseFloat(i.attr("y")||0),s=(a.attr("transform")||"").match(R);t=1===e&&1===r?[]:["translate("+o+","+l+")","scale("+e+","+r+")","translate("+-o+","+-l+")"],s&&t.push(s),a.attr("transform",t.join(" "))}})}},{"../../constants/alignment":146,"../../constants/interactions":148,"../../constants/xmlns_namespaces":150,"../../lib":168,"../../lib/svg_text_utils":189,"../../registry":257,"../../traces/scatter/make_bubble_size_func":384,"../../traces/scatter/subtypes":391,"../color":51,"../colorscale":63,"./symbol_defs":73,d3:16,"fast-isnumeric":18,tinycolor2:34}],73:[function(t,e,r){"use strict";var n=t("d3");e.exports={circle:{n:0,f:function(t){var e=n.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=n.round(.4*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H"+e+"V"+r+"H-"+e+"V"+e+"H-"+r+"V-"+e+"H-"+e+"V-"+r+"H"+e+"V-"+e+"H"+r+"Z"}},x:{n:4,f:function(t){var e=n.round(.8*t/Math.sqrt(2),2),r="l"+e+","+e,a="l"+e+",-"+e,i="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+r+",-"+e+"H"+e+"V"+r+"Z"}},"triangle-se":{n:10,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+e+",-"+r+"V"+e+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H-"+e+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+e+","+r+"V-"+e+"H"+r+"Z"}},pentagon:{n:13,f:function(t){var e=n.round(.951*t,2),r=n.round(.588*t,2),a=n.round(-t,2),i=n.round(-.309*t,2);return"M"+e+","+i+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+e+"L-"+a+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+e+",0L"+r+",-"+a+"H-"+r+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=n.round(.924*t,2),r=n.round(.383*t,2);return"M-"+r+",-"+e+"H"+r+"L"+e+",-"+r+"V"+r+"L"+r+","+e+"H-"+r+"L-"+e+","+r+"V-"+r+"Z"}},star:{n:17,f:function(t){var e=1.4*t,r=n.round(.225*e,2),a=n.round(.951*e,2),i=n.round(.363*e,2),o=n.round(.588*e,2),l=n.round(-e,2),s=n.round(-.309*e,2),c=n.round(.118*e,2),u=n.round(.809*e,2);return"M"+r+","+s+"H"+a+"L"+i+","+c+"L"+o+","+u+"L0,"+n.round(.382*e,2)+"L-"+o+","+u+"L-"+i+","+c+"L-"+a+","+s+"H-"+r+"L0,"+l+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),a=n.round(.76*t,2);return"M-"+a+",0l-"+r+",-"+e+"h"+a+"l"+r+",-"+e+"l"+r+","+e+"h"+a+"l-"+r+","+e+"l"+r+","+e+"h-"+a+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+a+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+a+o+"-"+e+","+r+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+a+o+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+a+"-"+e+","+e+a+e+","+e+a+e+",-"+e+a+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+a+"0,"+e+a+e+",0"+a+"0,-"+e+a+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=n.round(.7*t,2),r=n.round(1.4*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=n.round(1.4*t,2),r=n.round(.7*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=n.round(t,2),r=n.round(t/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=n.round(1.3*t,2),r=n.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(t){var e=n.round(1.2*t,2),r=n.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(t){var e=n.round(t/2,2),r=n.round(t,2);return"M"+e+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+e+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+","+a+"L0,0M"+e+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+",-"+a+"L0,0M"+e+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M"+a+","+e+"L0,0M"+a+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+a+","+e+"L0,0M-"+a+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(t){var e=n.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(t){var e=n.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0,noFill:!0}}},{d3:16}],74:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],75:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../registry"),i=t("../../plots/cartesian/axes"),o=t("../../lib"),l=t("./compute_error");function s(t,e,r,a){var s=e["error_"+a]||{},c=[];if(s.visible&&-1!==["linear","log"].indexOf(r.type)){for(var u=l(s),f=0;f<t.length;f++){var d=t[f],p=d.i;if(void 0===p)p=f;else if(null===p)continue;var h=d[a];if(n(r.c2l(h))){var g=u(h,p);if(n(g[0])&&n(g[1])){var v=d[a+"s"]=h-g[0],y=d[a+"h"]=h+g[1];c.push(v,y)}}}var m=r._id,x=e._extremes[m],b=i.findExtremes(r,c,o.extendFlat({tozero:x.opts.tozero},{padded:!0}));x.min=x.min.concat(b.min),x.max=x.max.concat(b.max)}}e.exports=function(t){for(var e=t.calcdata,r=0;r<e.length;r++){var n=e[r],o=n[0].trace;if(!0===o.visible&&a.traceIs(o,"errorBarsOK")){var l=i.getFromId(t,o.xaxis),c=i.getFromId(t,o.yaxis);s(n,o,l,"x"),s(n,o,c,"y")}}}},{"../../lib":168,"../../plots/cartesian/axes":212,"../../registry":257,"./compute_error":76,"fast-isnumeric":18}],76:[function(t,e,r){"use strict";function n(t,e){return"percent"===t?function(t){return Math.abs(t*e/100)}:"constant"===t?function(){return Math.abs(e)}:"sqrt"===t?function(t){return Math.sqrt(Math.abs(t))}:void 0}e.exports=function(t){var e=t.type,r=t.symmetric;if("data"===e){var a=t.array||[];if(r)return function(t,e){var r=+a[e];return[r,r]};var i=t.arrayminus||[];return function(t,e){var r=+a[e],n=+i[e];return isNaN(r)&&isNaN(n)?[NaN,NaN]:[n||0,r||0]}}var o=n(e,t.value),l=n(e,t.valueminus);return r||void 0===t.valueminus?function(t){var e=o(t);return[e,e]}:function(t){return[l(t),o(t)]}}},{}],77:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../registry"),i=t("../../lib"),o=t("../../plot_api/plot_template"),l=t("./attributes");e.exports=function(t,e,r,s){var c="error_"+s.axis,u=o.newContainer(e,c),f=t[c]||{};function d(t,e){return i.coerce(f,u,l,t,e)}if(!1!==d("visible",void 0!==f.array||void 0!==f.value||"sqrt"===f.type)){var p=d("type","array"in f?"data":"percent"),h=!0;"sqrt"!==p&&(h=d("symmetric",!(("data"===p?"arrayminus":"valueminus")in f))),"data"===p?(d("array"),d("traceref"),h||(d("arrayminus"),d("tracerefminus"))):"percent"!==p&&"constant"!==p||(d("value"),h||d("valueminus"));var g="copy_"+s.inherit+"style";if(s.inherit)(e["error_"+s.inherit]||{}).visible&&d(g,!(f.color||n(f.thickness)||n(f.width)));s.inherit&&u[g]||(d("color",r),d("thickness"),d("width",a.traceIs(e,"gl3d")?0:4))}}},{"../../lib":168,"../../plot_api/plot_template":202,"../../registry":257,"./attributes":74,"fast-isnumeric":18}],78:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plot_api/edit_types").overrideAll,i=t("./attributes"),o={error_x:n.extendFlat({},i),error_y:n.extendFlat({},i)};delete o.error_x.copy_zstyle,delete o.error_y.copy_zstyle,delete o.error_y.copy_ystyle;var l={error_x:n.extendFlat({},i),error_y:n.extendFlat({},i),error_z:n.extendFlat({},i)};delete l.error_x.copy_ystyle,delete l.error_y.copy_ystyle,delete l.error_z.copy_ystyle,delete l.error_z.copy_zstyle,e.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:o,bar:o,histogram:o,scatter3d:a(l,"calc","nested"),scattergl:a(o,"calc","nested")}},supplyDefaults:t("./defaults"),calc:t("./calc"),makeComputeError:t("./compute_error"),plot:t("./plot"),style:t("./style"),hoverInfo:function(t,e,r){(e.error_y||{}).visible&&(r.yerr=t.yh-t.y,e.error_y.symmetric||(r.yerrneg=t.y-t.ys));(e.error_x||{}).visible&&(r.xerr=t.xh-t.x,e.error_x.symmetric||(r.xerrneg=t.x-t.xs))}}},{"../../lib":168,"../../plot_api/edit_types":195,"./attributes":74,"./calc":75,"./compute_error":76,"./defaults":77,"./plot":79,"./style":80}],79:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../drawing"),o=t("../../traces/scatter/subtypes");e.exports=function(t,e,r,l){var s=r.xaxis,c=r.yaxis,u=l&&l.duration>0;e.each(function(e){var f,d=e[0].trace,p=d.error_x||{},h=d.error_y||{};d.ids&&(f=function(t){return t.id});var g=o.hasMarkers(d)&&d.marker.maxdisplayed>0;h.visible||p.visible||(e=[]);var v=n.select(this).selectAll("g.errorbar").data(e,f);if(v.exit().remove(),e.length){p.visible||v.selectAll("path.xerror").remove(),h.visible||v.selectAll("path.yerror").remove(),v.style("opacity",1);var y=v.enter().append("g").classed("errorbar",!0);u&&y.style("opacity",0).transition().duration(l.duration).style("opacity",1),i.setClipUrl(v,r.layerClipId,t),v.each(function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(t.ys,!0)));void 0!==t.xh&&(n.xh=e.c2p(t.xh),n.xs=e.c2p(t.xs),a(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0)));return n}(t,s,c);if(!g||t.vis){var i,o=e.select("path.yerror");if(h.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var f=h.width;i="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(i+="m-"+f+",0h"+2*f),!o.size()?o=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):u&&(o=o.transition().duration(l.duration).ease(l.easing)),o.attr("d",i)}else o.remove();var d=e.select("path.xerror");if(p.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var v=(p.copy_ystyle?h:p).width;i="M"+r.xh+","+(r.y-v)+"v"+2*v+"m0,-"+v+"H"+r.xs,r.noXS||(i+="m0,-"+v+"v"+2*v),!d.size()?d=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(d=d.transition().duration(l.duration).ease(l.easing)),d.attr("d",i)}else d.remove()}})}})}},{"../../traces/scatter/subtypes":391,"../drawing":72,d3:16,"fast-isnumeric":18}],80:[function(t,e,r){"use strict";var n=t("d3"),a=t("../color");e.exports=function(t){t.each(function(t){var e=t[0].trace,r=e.error_y||{},i=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)})}},{"../color":51,d3:16}],81:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes");e.exports={hoverlabel:{bgcolor:{valType:"color",arrayOk:!0,editType:"none"},bordercolor:{valType:"color",arrayOk:!0,editType:"none"},font:n({arrayOk:!0,editType:"none"}),namelength:{valType:"integer",min:-1,arrayOk:!0,editType:"none"},editType:"calc"}}},{"../../plots/font_attributes":239}],82:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry");function i(t,e,r,a){a=a||n.identity,Array.isArray(t)&&(e[0][r]=a(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var l=0;l<e.length;l++){var s=e[l],c=s[0].trace;if(!a.traceIs(c,"pie")){var u=a.traceIs(c,"2dMap")?i:n.fillArray;u(c.hoverinfo,s,"hi",o(c)),c.hovertemplate&&u(c.hovertemplate,s,"ht"),c.hoverlabel&&(u(c.hoverlabel.bgcolor,s,"hbg"),u(c.hoverlabel.bordercolor,s,"hbc"),u(c.hoverlabel.font.size,s,"hts"),u(c.hoverlabel.font.color,s,"htc"),u(c.hoverlabel.font.family,s,"htf"),u(c.hoverlabel.namelength,s,"hnl"))}}}},{"../../lib":168,"../../registry":257}],83:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./hover").hover;e.exports=function(t,e,r){var i=n.getComponentMethod("annotations","onClick")(t,t._hoverdata);function o(){t.emit("plotly_click",{points:t._hoverdata,event:e})}void 0!==r&&a(t,e,r,!0),t._hoverdata&&e&&e.target&&(i&&i.then?i.then(o):o(),e.stopImmediatePropagation&&e.stopImmediatePropagation())}},{"../../registry":257,"./hover":87}],84:[function(t,e,r){"use strict";e.exports={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}},{}],85:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("./hoverlabel_defaults");e.exports=function(t,e,r,o){i(t,e,function(r,i){return n.coerce(t,e,a,r,i)},o.hoverlabel)}},{"../../lib":168,"./attributes":81,"./hoverlabel_defaults":88}],86:[function(t,e,r){"use strict";var n=t("../../lib");r.getSubplot=function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},r.isTraceInSubplots=function(t,e){if("splom"===t.type){for(var n=t.xaxes||[],a=t.yaxes||[],i=0;i<n.length;i++)for(var o=0;o<a.length;o++)if(-1!==e.indexOf(n[i]+a[o]))return!0;return!1}return-1!==e.indexOf(r.getSubplot(t))},r.flat=function(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)r[n]=e;return r},r.p2c=function(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)r[n]=t[n].p2c(e);return r},r.getDistanceFunction=function(t,e,n,a){return"closest"===t?a||r.quadrature(e,n):"x"===t?e:n},r.getClosest=function(t,e,r){if(!1!==r.index)r.index>=0&&r.index<t.length?r.distance=0:r.index=!1;else for(var n=0;n<t.length;n++){var a=e(t[n]);a<=r.distance&&(r.index=n,r.distance=a)}return r},r.inbox=function(t,e,r){return t*e<0||0===t?r:1/0},r.quadrature=function(t,e){return function(r){var n=t(r),a=e(r);return Math.sqrt(n*n+a*a)}},r.makeEventData=function(t,e,n){var a="index"in t?t.index:t.pointNumber,i={data:e._input,fullData:e,curveNumber:e.index,pointNumber:a};if(e._indexToPoints){var o=e._indexToPoints[a];1===o.length?i.pointIndex=o[0]:i.pointIndices=o}else i.pointIndex=a;return e._module.eventData?i=e._module.eventData(i,t,e,n,a):("xVal"in t?i.x=t.xVal:"x"in t&&(i.x=t.x),"yVal"in t?i.y=t.yVal:"y"in t&&(i.y=t.y),t.xa&&(i.xaxis=t.xa),t.ya&&(i.yaxis=t.ya),void 0!==t.zLabelVal&&(i.z=t.zLabelVal)),r.appendArrayPointValue(i,e,a),i},r.appendArrayPointValue=function(t,e,r){var a=e._arrayAttrs;if(a)for(var l=0;l<a.length;l++){var s=a[l],c=i(s);if(void 0===t[c]){var u=o(n.nestedProperty(e,s).get(),r);void 0!==u&&(t[c]=u)}}},r.appendArrayMultiPointValues=function(t,e,r){var a=e._arrayAttrs;if(a)for(var l=0;l<a.length;l++){var s=a[l],c=i(s);if(void 0===t[c]){for(var u=n.nestedProperty(e,s).get(),f=new Array(r.length),d=0;d<r.length;d++)f[d]=o(u,r[d]);t[c]=f}}};var a={ids:"id",locations:"location",labels:"label",values:"value","marker.colors":"color"};function i(t){return a[t]||t}function o(t,e){return Array.isArray(e)?Array.isArray(t)&&Array.isArray(t[e[0]])?t[e[0]][e[1]]:void 0:t[e]}},{"../../lib":168}],87:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("tinycolor2"),o=t("../../lib"),l=t("../../lib/events"),s=t("../../lib/svg_text_utils"),c=t("../../lib/override_cursor"),u=t("../drawing"),f=t("../color"),d=t("../dragelement"),p=t("../../plots/cartesian/axes"),h=t("../../registry"),g=t("./helpers"),v=t("./constants"),y=v.YANGLE,m=Math.PI*y/180,x=1/Math.sin(m),b=Math.cos(m),_=Math.sin(m),w=v.HOVERARROWSIZE,k=v.HOVERTEXTPAD;r.hover=function(t,e,r,i){t=o.getGraphDiv(t),o.throttle(t._fullLayout._uid+v.HOVERID,v.HOVERMINTIME,function(){!function(t,e,r,i){r||(r="xy");var s=Array.isArray(r)?r:[r],u=t._fullLayout,v=u._plots||[],y=v[r],m=u._has("cartesian");if(y){var b=y.overlays.map(function(t){return t.id});s=s.concat(b)}for(var _=s.length,w=new Array(_),k=new Array(_),T=!1,O=0;O<_;O++){var z=s[O],D=v[z];if(D)T=!0,w[O]=p.getFromId(t,D.xaxis._id),k[O]=p.getFromId(t,D.yaxis._id);else{var P=u[z]._subplot;w[O]=P.xaxis,k[O]=P.yaxis}}var E=e.hovermode||u.hovermode;E&&!T&&(E="closest");if(-1===["x","y","closest"].indexOf(E)||!t.calcdata||t.querySelector(".zoombox")||t._dragging)return d.unhoverRaw(t,e);var R,I,F,N,B,j,H,q,V,U,G,Z,X,Y=-1===u.hoverdistance?1/0:u.hoverdistance,W=-1===u.spikedistance?1/0:u.spikedistance,J=[],$=[],Q={hLinePoint:null,vLinePoint:null},K=!1;if(Array.isArray(e))for(E="array",F=0;F<e.length;F++)(B=t.calcdata[e[F].curveNumber||0])&&(j=B[0].trace,"skip"!==B[0].trace.hoverinfo&&($.push(B),"h"===j.orientation&&(K=!0)));else{for(N=0;N<t.calcdata.length;N++)B=t.calcdata[N],"skip"!==(j=B[0].trace).hoverinfo&&g.isTraceInSubplots(j,s)&&($.push(B),"h"===j.orientation&&(K=!0));var tt,et,rt=!e.target;if(rt)tt="xpx"in e?e.xpx:w[0]._length/2,et="ypx"in e?e.ypx:k[0]._length/2;else{if(!1===l.triggerHandler(t,"plotly_beforehover",e))return;var nt=e.target.getBoundingClientRect();if(tt=e.clientX-nt.left,et=e.clientY-nt.top,tt<0||tt>w[0]._length||et<0||et>k[0]._length)return d.unhoverRaw(t,e)}if(e.pointerX=tt+w[0]._offset,e.pointerY=et+k[0]._offset,R="xval"in e?g.flat(s,e.xval):g.p2c(w,tt),I="yval"in e?g.flat(s,e.yval):g.p2c(k,et),!a(R[0])||!a(I[0]))return o.warn("Fx.hover failed",e,t),d.unhoverRaw(t,e)}var at=1/0;for(N=0;N<$.length;N++)if((B=$[N])&&B[0]&&B[0].trace&&!0===B[0].trace.visible&&(j=B[0].trace,-1===["carpet","contourcarpet"].indexOf(j._module.name))){if("splom"===j.type?H=s[q=0]:(H=g.getSubplot(j),q=s.indexOf(H)),V=E,Z={cd:B,trace:j,xa:w[q],ya:k[q],maxHoverDistance:Y,maxSpikeDistance:W,index:!1,distance:Math.min(at,Y),spikeDistance:1/0,xSpike:void 0,ySpike:void 0,color:f.defaultLine,name:j.name,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},u[H]&&(Z.subplot=u[H]._subplot),u._splomScenes&&u._splomScenes[j.uid]&&(Z.scene=u._splomScenes[j.uid]),X=J.length,"array"===V){var it=e[N];"pointNumber"in it?(Z.index=it.pointNumber,V="closest"):(V="","xval"in it&&(U=it.xval,V="x"),"yval"in it&&(G=it.yval,V=V?"closest":"y"))}else U=R[q],G=I[q];if(0!==Y)if(j._module&&j._module.hoverPoints){var ot=j._module.hoverPoints(Z,U,G,V,u._hoverlayer);if(ot)for(var lt,st=0;st<ot.length;st++)lt=ot[st],a(lt.x0)&&a(lt.y0)&&J.push(L(lt,E))}else o.log("Unrecognized trace type in hover:",j);if("closest"===E&&J.length>X&&(J.splice(0,X),at=J[0].distance),m&&0!==W&&0===J.length){Z.distance=W,Z.index=!1;var ct=j._module.hoverPoints(Z,U,G,"closest",u._hoverlayer);if(ct&&(ct=ct.filter(function(t){return t.spikeDistance<=W})),ct&&ct.length){var ut,ft=ct.filter(function(t){return t.xa.showspikes});if(ft.length){var dt=ft[0];a(dt.x0)&&a(dt.y0)&&(ut=vt(dt),(!Q.vLinePoint||Q.vLinePoint.spikeDistance>ut.spikeDistance)&&(Q.vLinePoint=ut))}var pt=ct.filter(function(t){return t.ya.showspikes});if(pt.length){var ht=pt[0];a(ht.x0)&&a(ht.y0)&&(ut=vt(ht),(!Q.hLinePoint||Q.hLinePoint.spikeDistance>ut.spikeDistance)&&(Q.hLinePoint=ut))}}}}function gt(t,e){for(var r,n=null,a=1/0,i=0;i<t.length;i++)(r=t[i].spikeDistance)<a&&r<=e&&(n=t[i],a=r);return n}function vt(t){return t?{xa:t.xa,ya:t.ya,x:void 0!==t.xSpike?t.xSpike:(t.x0+t.x1)/2,y:void 0!==t.ySpike?t.ySpike:(t.y0+t.y1)/2,distance:t.distance,spikeDistance:t.spikeDistance,curveNumber:t.trace.index,color:t.color,pointNumber:t.index}:null}var yt={fullLayout:u,container:u._hoverlayer,outerContainer:u._paperdiv,event:e},mt=t._spikepoints,xt={vLinePoint:Q.vLinePoint,hLinePoint:Q.hLinePoint};if(t._spikepoints=xt,m&&0!==W&&0!==J.length){var bt=J.filter(function(t){return t.ya.showspikes}),_t=gt(bt,W);Q.hLinePoint=vt(_t);var wt=J.filter(function(t){return t.xa.showspikes}),kt=gt(wt,W);Q.vLinePoint=vt(kt)}if(0===J.length){var Tt=d.unhoverRaw(t,e);return!m||null===Q.hLinePoint&&null===Q.vLinePoint||C(mt)&&S(Q,yt),Tt}m&&C(mt)&&S(Q,yt);J.sort(function(t,e){return t.distance-e.distance});var Mt=t._hoverdata,At=[];for(F=0;F<J.length;F++){var Lt=J[F],St=g.makeEventData(Lt,Lt.trace,Lt.cd),Ct=!1;Lt.cd[Lt.index]&&Lt.cd[Lt.index].ht&&(Ct=Lt.cd[Lt.index].ht),J[F].hovertemplate=Ct||Lt.trace.hovertemplate||!1,J[F].eventData=[St],At.push(St)}t._hoverdata=At;var Ot="y"===E&&($.length>1||J.length>1)||"closest"===E&&K&&J.length>1,zt=f.combine(u.plot_bgcolor||f.background,u.paper_bgcolor),Dt={hovermode:E,rotateLabels:Ot,bgColor:zt,container:u._hoverlayer,outerContainer:u._paperdiv,commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance},Pt=M(J,Dt,t);if(function(t,e,r){var n,a,i,o,l,s,c,u=0,f=1,d=t.map(function(t,n){var a=t[e],i="x"===a._id.charAt(0),o=a.range;return!n&&o&&o[0]>o[1]!==i&&(f=-1),[{i:n,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(i?x:1)/2,pmin:0,pmax:i?r.width:r.height}]}).sort(function(t,e){return t[0].posref-e[0].posref||f*(e[0].traceIndex-t[0].traceIndex)});function p(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,i=r.pos+r.dp+r.size-e.pmax,a>.01){for(l=t.length-1;l>=0;l--)t[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=t.length-1;l>=0;l--)t[l].dp-=i;n=!1}if(n){var c=0;for(o=0;o<t.length;o++)(s=t[o]).pos+s.dp+s.size>e.pmax&&c++;for(o=t.length-1;o>=0&&!(c<=0);o--)(s=t[o]).pos>e.pmax-1&&(s.del=!0,c--);for(o=0;o<t.length&&!(c<=0);o++)if((s=t[o]).pos<e.pmin+1)for(s.del=!0,c--,i=2*s.size,l=t.length-1;l>=0;l--)t[l].dp-=i;for(o=t.length-1;o>=0&&!(c<=0);o--)(s=t[o]).pos+s.dp+s.size>e.pmax&&(s.del=!0,c--)}}}for(;!n&&u<=t.length;){for(u++,n=!0,o=0;o<d.length-1;){var h=d[o],g=d[o+1],v=h[h.length-1],y=g[0];if((a=v.pos+v.dp+v.size-y.pos-y.dp+y.size)>.01&&v.pmin===y.pmin&&v.pmax===y.pmax){for(l=g.length-1;l>=0;l--)g[l].dp+=a;for(h.push.apply(h,g),d.splice(o+1,1),c=0,l=h.length-1;l>=0;l--)c+=h[l].dp;for(i=c/h.length,l=h.length-1;l>=0;l--)h[l].dp-=i;n=!1}else o++}d.forEach(p)}for(o=d.length-1;o>=0;o--){var m=d[o];for(l=m.length-1;l>=0;l--){var b=m[l],_=t[b.i];_.offset=b.dp,_.del=b.del}}}(J,Ot?"xa":"ya",u),A(Pt,Ot),e.target&&e.target.tagName){var Et=h.getComponentMethod("annotations","hasClickToShow")(t,At);c(n.select(e.target),Et?"pointer":"")}if(!e.target||i||!function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=t._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(t,0,Mt))return;Mt&&t.emit("plotly_unhover",{event:e,points:Mt});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:w,yaxes:k,xvals:R,yvals:I})}(t,e,r,i)})},r.loneHover=function(t,e){var r={color:t.color||f.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,eventData:t.eventData||!1,hovertemplateLabels:t.hovertemplateLabels||!1},a=n.select(e.container),i=e.outerContainer?n.select(e.outerContainer):a,o={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||f.background,container:a,outerContainer:i},l=M([r],o,e.gd);return A(l,o.rotateLabels),l.node()},r.multiHovers=function(t,e){Array.isArray(t)||(t=[t]);var r=t.map(function(t){return{color:t.color||f.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,eventData:t.eventData||!1,hovertemplateLabels:t.hovertemplateLabels||!1}}),a=n.select(e.container),i=e.outerContainer?n.select(e.outerContainer):a,o={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||f.background,container:a,outerContainer:i},l=M(r,o,e.gd),s=0;return l.sort(function(t,e){return t.y0-e.y0}).each(function(t){var e=t.y0-t.by/2;t.offset=e-5<s?s-e+5:0,s=e+t.by+t.offset}),A(l,o.rotateLabels),l.node()};var T=/<extra>([\s\S]*)<\/extra>/;function M(t,e,r){var a=e.hovermode,i=e.rotateLabels,l=e.bgColor,c=e.container,d=e.outerContainer,p=e.commonLabelOpts||{},h=e.fontFamily||v.HOVERFONT,g=e.fontSize||v.HOVERFONTSIZE,m=t[0],x=m.xa,b=m.ya,_="y"===a?"yLabel":"xLabel",M=m[_],A=(String(M)||"").split(" ")[0],L=d.node().getBoundingClientRect(),S=L.top,C=L.width,O=L.height,z=void 0!==M&&m.distance<=e.hoverdistance&&("x"===a||"y"===a);if(z){var D,P,E=!0;for(D=0;D<t.length;D++)if(E&&void 0===t[D].zLabel&&(E=!1),P=t[D].hoverinfo||t[D].trace.hoverinfo){var R=Array.isArray(P)?P:P.split("+");if(-1===R.indexOf("all")&&-1===R.indexOf(a)){z=!1;break}}E&&(z=!1)}var I=c.selectAll("g.axistext").data(z?[0]:[]);I.enter().append("g").classed("axistext",!0),I.exit().remove(),I.each(function(){var e=n.select(this),i=o.ensureSingle(e,"path","",function(t){t.style({"stroke-width":"1px"})}),l=o.ensureSingle(e,"text","",function(t){t.attr("data-notex",1)}),c=p.bgcolor||f.defaultLine,d=p.bordercolor||f.contrast(c),v=f.contrast(c);i.style({fill:c,stroke:d}),l.text(M).call(u.font,p.font.family||h,p.font.size||g,p.font.color||v).call(s.positionText,0,0).call(s.convertToTspans,r),e.attr("transform","");var y=l.node().getBoundingClientRect();if("x"===a){l.attr("text-anchor","middle").call(s.positionText,0,"top"===x.side?S-y.bottom-w-k:S-y.top+w+k);var T="top"===x.side?"-":"";i.attr("d","M0,0L"+w+","+T+w+"H"+(k+y.width/2)+"v"+T+(2*k+y.height)+"H-"+(k+y.width/2)+"V"+T+w+"H-"+w+"Z"),e.attr("transform","translate("+(x._offset+(m.x0+m.x1)/2)+","+(b._offset+("top"===x.side?0:b._length))+")")}else{l.attr("text-anchor","right"===b.side?"start":"end").call(s.positionText,("right"===b.side?1:-1)*(k+w),S-y.top-y.height/2);var L="right"===b.side?"":"-";i.attr("d","M0,0L"+L+w+","+w+"V"+(k+y.height/2)+"h"+L+(2*k+y.width)+"V-"+(k+y.height/2)+"H"+L+w+"V-"+w+"Z"),e.attr("transform","translate("+(x._offset+("right"===b.side?x._length:0))+","+(b._offset+(m.y0+m.y1)/2)+")")}t=t.filter(function(t){return void 0!==t.zLabelVal||(t[_]||"").split(" ")[0]===A})});var F=c.selectAll("g.hovertext").data(t,function(t){return[t.trace.index,t.index,t.x0,t.y0,t.name,t.attr,t.xa,t.ya||""].join(",")});return F.enter().append("g").classed("hovertext",!0).each(function(){var t=n.select(this);t.append("rect").call(f.fill,f.addOpacity(l,.8)),t.append("text").classed("name",!0),t.append("path").style("stroke-width","1px"),t.append("text").classed("nums",!0).call(u.font,h,g)}),F.exit().remove(),F.each(function(t){var e=n.select(this).attr("transform",""),c="",d="",p=t.bgcolor||t.color,v=f.combine(f.opacity(p)?p:f.defaultLine,l),m=f.combine(f.opacity(t.color)?t.color:f.defaultLine,l),x=t.borderColor||f.contrast(v);void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(c=s.plainText(t.name||"",{len:t.nameLength,allowedTags:["br","sub","sup","b","i","em"]})),void 0!==t.zLabel?(void 0!==t.xLabel&&(d+="x: "+t.xLabel+"<br>"),void 0!==t.yLabel&&(d+="y: "+t.yLabel+"<br>"),d+=(d?"z: ":"")+t.zLabel):z&&t[a+"Label"]===M?d=t[("x"===a?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(d=t.yLabel):d=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(d+=(d?"<br>":"")+t.text),void 0!==t.extraText&&(d+=(d?"<br>":"")+t.extraText),""!==d||t.hovertemplate||(""===c&&e.remove(),d=c);var b=t.hovertemplate||!1,_=t.hovertemplateLabels||t,A=t.eventData[0]||{};b&&(d=(d=o.hovertemplateString(b,_,A)).replace(T,function(t,e){return c=e,""}));var L=e.select("text.nums").call(u.font,t.fontFamily||h,t.fontSize||g,t.fontColor||x).text(d).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,r),D=e.select("text.name"),P=0,E=0;if(c&&c!==d){D.call(u.font,t.fontFamily||h,t.fontSize||g,m).text(c).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,r);var R=D.node().getBoundingClientRect();P=R.width+2*k,E=R.height+2*k}else D.remove(),e.select("rect").remove();e.select("path").style({fill:v,stroke:x});var I,F,N=L.node().getBoundingClientRect(),B=t.xa._offset+(t.x0+t.x1)/2,j=t.ya._offset+(t.y0+t.y1)/2,H=Math.abs(t.x1-t.x0),q=Math.abs(t.y1-t.y0),V=N.width+w+k+P;t.ty0=S-N.top,t.bx=N.width+2*k,t.by=Math.max(N.height+2*k,E),t.anchor="start",t.txwidth=N.width,t.tx2width=P,t.offset=0,i?(t.pos=B,I=j+q/2+V<=O,F=j-q/2-V>=0,"top"!==t.idealAlign&&I||!F?I?(j+=q/2,t.anchor="start"):t.anchor="middle":(j-=q/2,t.anchor="end")):(t.pos=j,I=B+H/2+V<=C,F=B-H/2-V>=0,"left"!==t.idealAlign&&I||!F?I?(B+=H/2,t.anchor="start"):t.anchor="middle":(B-=H/2,t.anchor="end")),L.attr("text-anchor",t.anchor),P&&D.attr("text-anchor",t.anchor),e.attr("transform","translate("+B+","+j+")"+(i?"rotate("+y+")":""))}),F}function A(t,e){t.each(function(t){var r=n.select(this);if(t.del)r.remove();else{var a="end"===t.anchor?-1:1,i=r.select("text.nums"),o={start:1,end:-1,middle:0}[t.anchor],l=o*(w+k),c=l+o*(t.txwidth+k),f=0,d=t.offset;"middle"===t.anchor&&(l-=t.tx2width/2,c+=t.txwidth/2+k),e&&(d*=-_,f=t.offset*b),r.select("path").attr("d","middle"===t.anchor?"M-"+(t.bx/2+t.tx2width/2)+","+(d-t.by/2)+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(a*w+f)+","+(w+d)+"v"+(t.by/2-w)+"h"+a*t.bx+"v-"+t.by+"H"+(a*w+f)+"V"+(d-w)+"Z"),i.call(s.positionText,l+f,d+t.ty0-t.by/2+k),t.tx2width&&(r.select("text.name").call(s.positionText,c+o*k+f,d+t.ty0-t.by/2+k),r.select("rect").call(u.setRect,c+(o-1)*t.tx2width/2+f,d-t.by/2-1,t.tx2width,t.by+2))}})}function L(t,e){var r=t.index,n=t.trace||{},a=t.cd[0],i=t.cd[r]||{},l=Array.isArray(r)?function(t,e){return o.castOption(a,r,t)||o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(i,n,t,e)};function s(e,r,n){var a=l(r,n);a&&(t[e]=a)}if(s("hoverinfo","hi","hoverinfo"),s("bgcolor","hbg","hoverlabel.bgcolor"),s("borderColor","hbc","hoverlabel.bordercolor"),s("fontFamily","htf","hoverlabel.font.family"),s("fontSize","hts","hoverlabel.font.size"),s("fontColor","htc","hoverlabel.font.color"),s("nameLength","hnl","hoverlabel.namelength"),t.posref="y"===e||"closest"===e&&"h"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:p.hoverLabelText(t.xa,t.xLabelVal),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:p.hoverLabelText(t.ya,t.yLabelVal),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var c=p.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+c+" / -"+p.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+c,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var u=p.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+u+" / -"+p.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+u,"y"===e&&(t.distance+=1)}var f=t.hoverinfo||t.trace.hoverinfo;return f&&"all"!==f&&(-1===(f=Array.isArray(f)?f:f.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===f.indexOf("y")&&(t.yLabel=void 0),-1===f.indexOf("z")&&(t.zLabel=void 0),-1===f.indexOf("text")&&(t.text=void 0),-1===f.indexOf("name")&&(t.name=void 0)),t}function S(t,e){var r,n,a=e.container,o=e.fullLayout,l=e.event,s=!!t.hLinePoint,c=!!t.vLinePoint;if(a.selectAll(".spikeline").remove(),c||s){var d=f.combine(o.plot_bgcolor,o.paper_bgcolor);if(s){var p,h,g=t.hLinePoint;r=g&&g.xa,"cursor"===(n=g&&g.ya).spikesnap?(p=l.pointerX,h=l.pointerY):(p=r._offset+g.x,h=n._offset+g.y);var v,y,m=i.readability(g.color,d)<1.5?f.contrast(d):g.color,x=n.spikemode,b=n.spikethickness,_=n.spikecolor||m,w=n._boundingBox,k=(w.left+w.right)/2<p?w.right:w.left;-1===x.indexOf("toaxis")&&-1===x.indexOf("across")||(-1!==x.indexOf("toaxis")&&(v=k,y=p),-1!==x.indexOf("across")&&(v=n._counterSpan[0],y=n._counterSpan[1]),a.insert("line",":first-child").attr({x1:v,x2:y,y1:h,y2:h,"stroke-width":b,stroke:_,"stroke-dasharray":u.dashStyle(n.spikedash,b)}).classed("spikeline",!0).classed("crisp",!0),a.insert("line",":first-child").attr({x1:v,x2:y,y1:h,y2:h,"stroke-width":b+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)),-1!==x.indexOf("marker")&&a.insert("circle",":first-child").attr({cx:k+("right"!==n.side?b:-b),cy:h,r:b,fill:_}).classed("spikeline",!0)}if(c){var T,M,A=t.vLinePoint;r=A&&A.xa,n=A&&A.ya,"cursor"===r.spikesnap?(T=l.pointerX,M=l.pointerY):(T=r._offset+A.x,M=n._offset+A.y);var L,S,C=i.readability(A.color,d)<1.5?f.contrast(d):A.color,O=r.spikemode,z=r.spikethickness,D=r.spikecolor||C,P=r._boundingBox,E=(P.top+P.bottom)/2<M?P.bottom:P.top;-1===O.indexOf("toaxis")&&-1===O.indexOf("across")||(-1!==O.indexOf("toaxis")&&(L=E,S=M),-1!==O.indexOf("across")&&(L=r._counterSpan[0],S=r._counterSpan[1]),a.insert("line",":first-child").attr({x1:T,x2:T,y1:L,y2:S,"stroke-width":z,stroke:D,"stroke-dasharray":u.dashStyle(r.spikedash,z)}).classed("spikeline",!0).classed("crisp",!0),a.insert("line",":first-child").attr({x1:T,x2:T,y1:L,y2:S,"stroke-width":z+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)),-1!==O.indexOf("marker")&&a.insert("circle",":first-child").attr({cx:T,cy:E-("top"!==r.side?z:-z),r:z,fill:D}).classed("spikeline",!0)}}}function C(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}},{"../../lib":168,"../../lib/events":161,"../../lib/override_cursor":179,"../../lib/svg_text_utils":189,"../../plots/cartesian/axes":212,"../../registry":257,"../color":51,"../dragelement":69,"../drawing":72,"./constants":84,"./helpers":86,d3:16,"fast-isnumeric":18,tinycolor2:34}],88:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,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)}},{"../../lib":168}],89:[function(t,e,r){"use strict";e.exports=function(t,e){t=t||{};(e=e||{}).description&&e.description;var r=e.keys||[];if(r.length>0){for(var n=[],a=0;a<r.length;a++)n[a]="`"+r[a]+"`";"Finally, the template string has access to ",1===r.length?"variable "+n[0]:"variables "+n.slice(0,-1).join(", ")+" and "+n.slice(-1)+"."}return{valType:"string",dflt:"",arrayOk:!0,editType:"none"}}},{}],90:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../dragelement"),o=t("./helpers"),l=t("./layout_attributes"),s=t("./hover");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:l},attributes:t("./attributes"),layoutAttributes:l,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(t,e,r){return a.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return a.castOption(t,r,"hoverinfo",function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)})},hover:s.hover,unhover:i.unhover,loneHover:s.loneHover,multiHovers:s.multiHovers,loneUnhover:function(t){var e=a.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":168,"../dragelement":69,"./attributes":81,"./calc":82,"./click":83,"./constants":84,"./defaults":85,"./helpers":86,"./hover":87,"./layout_attributes":91,"./layout_defaults":92,"./layout_global_defaults":93,d3:16}],91:[function(t,e,r){"use strict";var n=t("./constants"),a=t("../../plots/font_attributes")({editType:"none"});a.family.dflt=n.HOVERFONT,a.size.dflt=n.HOVERFONTSIZE,e.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,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":84}],92:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r){function i(r,i){return n.coerce(t,e,a,r,i)}var o,l=i("clickmode");"select"===i("dragmode")&&i("selectdirection"),e._has("cartesian")?l.indexOf("select")>-1?o="closest":(e._isHoriz=function(t){for(var e=!0,r=0;r<t.length;r++){var n=t[r];if("h"!==n.orientation){e=!1;break}}return e}(r),o=e._isHoriz?"y":"x"):o="closest",i("hovermode",o)&&(i("hoverdistance"),i("spikedistance"));var s=e._has("mapbox"),c=e._has("geo"),u=e._basePlotModules.length;"zoom"===e.dragmode&&((s||c)&&1===u||s&&c&&2===u)&&(e.dragmode="pan")}},{"../../lib":168,"./layout_attributes":91}],93:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./hoverlabel_defaults"),i=t("./layout_attributes");e.exports=function(t,e){a(t,e,function(r,a){return n.coerce(t,e,i,r,a)})}},{"../../lib":168,"./hoverlabel_defaults":88,"./layout_attributes":91}],94:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../lib/regex").counter,i=t("../../plots/domain").attributes,o=t("../../plots/cartesian/constants").idRegex,l=t("../../plot_api/plot_template"),s={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[a("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function c(t,e,r){var n=e[r+"axes"],a=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function u(t,e,r,n,a,i){var o=e(t+"gap",r),l=e("domain."+t);e(t+"side",n);for(var s=new Array(a),c=l[0],u=(l[1]-c)/(a-o),f=u*(1-o),d=0;d<a;d++){var p=c+u*d;s[i?a-1-d:d]=[p,p+f]}return s}function f(t,e,r,n,a){var i,o=new Array(r);function l(t,r){-1!==e.indexOf(r)&&void 0===n[r]?(o[t]=r,n[r]=t):o[t]=""}if(Array.isArray(t))for(i=0;i<r;i++)l(i,t[i]);else for(l(0,a),i=1;i<r;i++)l(i,a+(i+1));return o}e.exports={moduleType:"component",name:"grid",schema:{layout:{grid:s}},layoutAttributes:s,sizeDefaults:function(t,e){var r=t.grid||{},a=c(e,r,"x"),i=c(e,r,"y");if(t.grid||a||i){var o,f,d=Array.isArray(r.subplots)&&Array.isArray(r.subplots[0]),p=Array.isArray(a),h=Array.isArray(i),g=p&&a!==r.xaxes&&h&&i!==r.yaxes;d?(o=r.subplots.length,f=r.subplots[0].length):(h&&(o=i.length),p&&(f=a.length));var v=l.newContainer(e,"grid"),y=T("rows",o),m=T("columns",f);if(y*m>1){d||p||h||"independent"===T("pattern")&&(d=!0),v._hasSubplotGrid=d;var x,b,_="top to bottom"===T("roworder"),w=d?.2:.1,k=d?.3:.1;g&&e._splomGridDflt&&(x=e._splomGridDflt.xside,b=e._splomGridDflt.yside),v._domains={x:u("x",T,w,x,m),y:u("y",T,k,b,y,_)}}else delete e.grid}function T(t,e){return n.coerce(r,v,s,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,a,i,o,l,s,u,d=t.grid||{},p=e._subplots,h=r._hasSubplotGrid,g=r.rows,v=r.columns,y="independent"===r.pattern,m=r._axisMap={};if(h){var x=d.subplots||[];s=r.subplots=new Array(g);var b=1;for(n=0;n<g;n++){var _=s[n]=new Array(v),w=x[n]||[];for(a=0;a<v;a++)if(y?(l=1===b?"xy":"x"+b+"y"+b,b++):l=w[a],_[a]="",-1!==p.cartesian.indexOf(l)){if(u=l.indexOf("y"),i=l.slice(0,u),o=l.slice(u),void 0!==m[i]&&m[i]!==a||void 0!==m[o]&&m[o]!==n)continue;_[a]=l,m[i]=a,m[o]=n}}}else{var k=c(e,d,"x"),T=c(e,d,"y");r.xaxes=f(k,p.xaxis,v,m,"x"),r.yaxes=f(T,p.yaxis,g,m,"y")}var M=r._anchors={},A="top to bottom"===r.roworder;for(var L in m){var S,C,O,z=L.charAt(0),D=r[z+"side"];if(D.length<8)M[L]="free";else if("x"===z){if("t"===D.charAt(0)===A?(S=0,C=1,O=g):(S=g-1,C=-1,O=-1),h){var P=m[L];for(n=S;n!==O;n+=C)if((l=s[n][P])&&(u=l.indexOf("y"),l.slice(0,u)===L)){M[L]=l.slice(u);break}}else for(n=S;n!==O;n+=C)if(o=r.yaxes[n],-1!==p.cartesian.indexOf(L+o)){M[L]=o;break}}else if("l"===D.charAt(0)?(S=0,C=1,O=v):(S=v-1,C=-1,O=-1),h){var E=m[L];for(n=S;n!==O;n+=C)if((l=s[E][n])&&(u=l.indexOf("y"),l.slice(u)===L)){M[L]=l.slice(0,u);break}}else for(n=S;n!==O;n+=C)if(i=r.xaxes[n],-1!==p.cartesian.indexOf(i+L)){M[L]=i;break}}}}}},{"../../lib":168,"../../lib/regex":183,"../../plot_api/plot_template":202,"../../plots/cartesian/constants":218,"../../plots/domain":238}],95:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/constants"),a=t("../../plot_api/plot_template").templatedArray;e.exports=a("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",n.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",n.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})},{"../../plot_api/plot_template":202,"../../plots/cartesian/constants":218}],96:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib/to_log_range");e.exports=function(t,e,r,i){e=e||{};var o="log"===r&&"linear"===e.type,l="linear"===r&&"log"===e.type;if(o||l)for(var s,c,u=t._fullLayout.images,f=e._id.charAt(0),d=0;d<u.length;d++)if(c="images["+d+"].",(s=u[d])[f+"ref"]===e._id){var p=s[f],h=s["size"+f],g=null,v=null;if(o){g=a(p,e.range);var y=h/Math.pow(10,g)/2;v=2*Math.log(y+Math.sqrt(1+y*y))/Math.LN10}else v=(g=Math.pow(10,p))*(Math.pow(10,h/2)-Math.pow(10,-h/2));n(g)?n(v)||(v=null):(g=null,v=null),i(c+f,g),i(c+"size"+f,v)}}},{"../../lib/to_log_range":191,"fast-isnumeric":18}],97:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../../plots/array_container_defaults"),o=t("./attributes");function l(t,e,r){function i(r,a){return n.coerce(t,e,o,r,a)}var l=i("source");if(!i("visible",!!l))return e;i("layer"),i("xanchor"),i("yanchor"),i("sizex"),i("sizey"),i("sizing"),i("opacity");for(var s={_fullLayout:r},c=["x","y"],u=0;u<2;u++){var f=c[u],d=a.coerceRef(t,e,s,f,"paper");if("paper"!==d)a.getFromId(s,d)._imgIndices.push(e._index);a.coercePosition(e,s,i,d,f,0)}return e}e.exports=function(t,e){i(t,e,{name:"images",handleItemDefaults:l})}},{"../../lib":168,"../../plots/array_container_defaults":208,"../../plots/cartesian/axes":212,"./attributes":95}],98:[function(t,e,r){"use strict";var n=t("d3"),a=t("../drawing"),i=t("../../plots/cartesian/axes"),o=t("../../constants/xmlns_namespaces");e.exports=function(t){var e,r,l=t._fullLayout,s=[],c={},u=[];for(r=0;r<l.images.length;r++){var f=l.images[r];if(f.visible)if("below"===f.layer&&"paper"!==f.xref&&"paper"!==f.yref){e=f.xref+f.yref;var d=l._plots[e];if(!d){u.push(f);continue}d.mainplot&&(e=d.mainplot.id),c[e]||(c[e]=[]),c[e].push(f)}else"above"===f.layer?s.push(f):u.push(f)}var p={x:{left:{sizing:"xMin",offset:0},center:{sizing:"xMid",offset:-.5},right:{sizing:"xMax",offset:-1}},y:{top:{sizing:"YMin",offset:0},middle:{sizing:"YMid",offset:-.5},bottom:{sizing:"YMax",offset:-1}}};function h(e){var r=n.select(this);if(!this.img||this.img.src!==e.source){r.attr("xmlns",o.svg);var a=new Promise(function(t){var n=new Image;function a(){r.remove(),t()}this.img=n,n.setAttribute("crossOrigin","anonymous"),n.onerror=a,n.onload=function(){var e=document.createElement("canvas");e.width=this.width,e.height=this.height,e.getContext("2d").drawImage(this,0,0);var n=e.toDataURL("image/png");r.attr("xlink:href",n),t()},r.on("error",a),n.src=e.source}.bind(this));t._promises.push(a)}}function g(e){var r=n.select(this),o=i.getFromId(t,e.xref),s=i.getFromId(t,e.yref),c=l._size,u=o?Math.abs(o.l2p(e.sizex)-o.l2p(0)):e.sizex*c.w,f=s?Math.abs(s.l2p(e.sizey)-s.l2p(0)):e.sizey*c.h,d=u*p.x[e.xanchor].offset,h=f*p.y[e.yanchor].offset,g=p.x[e.xanchor].sizing+p.y[e.yanchor].sizing,v=(o?o.r2p(e.x)+o._offset:e.x*c.w+c.l)+d,y=(s?s.r2p(e.y)+s._offset:c.h-e.y*c.h+c.t)+h;switch(e.sizing){case"fill":g+=" slice";break;case"stretch":g="none"}r.attr({x:v,y:y,width:u,height:f,preserveAspectRatio:g,opacity:e.opacity});var m=(o?o._id:"")+(s?s._id:"");a.setClipUrl(r,m?"clip"+l._uid+m:null,t)}var v=l._imageLowerLayer.selectAll("image").data(u),y=l._imageUpperLayer.selectAll("image").data(s);v.enter().append("image"),y.enter().append("image"),v.exit().remove(),y.exit().remove(),v.each(function(t){h.bind(this)(t),g.bind(this)(t)}),y.each(function(t){h.bind(this)(t),g.bind(this)(t)});var m=Object.keys(l._plots);for(r=0;r<m.length;r++){e=m[r];var x=l._plots[e];if(x.imagelayer){var b=x.imagelayer.selectAll("image").data(c[e]||[]);b.enter().append("image"),b.exit().remove(),b.each(function(t){h.bind(this)(t),g.bind(this)(t)})}}}},{"../../constants/xmlns_namespaces":150,"../../plots/cartesian/axes":212,"../drawing":72,d3:16}],99:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"images",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),includeBasePlot:t("../../plots/cartesian/include_components")("images"),draw:t("./draw"),convertCoords:t("./convert_coords")}},{"../../plots/cartesian/include_components":223,"./attributes":95,"./convert_coords":96,"./defaults":97,"./draw":98}],100:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes");e.exports={bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:a.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:n({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},x:{valType:"number",min:-2,max:3,dflt:1.02,editType:"legend"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",min:-2,max:3,dflt:1,editType:"legend"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"legend"},uirevision:{valType:"any",editType:"none"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"legend"},editType:"legend"}},{"../../plots/font_attributes":239,"../color/attributes":50}],101:[function(t,e,r){"use strict";e.exports={scrollBarWidth:6,scrollBarMinHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4,textOffsetX:40}},{}],102:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("../../plot_api/plot_template"),o=t("./attributes"),l=t("../../plots/layout_attributes"),s=t("./helpers");e.exports=function(t,e,r){for(var c,u,f,d,p=t.legend||{},h=0,g=!1,v="normal",y=0;y<r.length;y++){var m=r[y];m.visible&&((m.showlegend||m._dfltShowLegend)&&(h++,m.showlegend&&(g=!0,(n.traceIs(m,"pie")||!0===m._input.showlegend)&&h++)),(n.traceIs(m,"bar")&&"stack"===e.barmode||-1!==["tonextx","tonexty"].indexOf(m.fill))&&(v=s.isGrouped({traceorder:v})?"grouped+reversed":"reversed"),void 0!==m.legendgroup&&""!==m.legendgroup&&(v=s.isReversed({traceorder:v})?"reversed+grouped":"grouped"))}var x=a.coerce(t,e,l,"showlegend",g&&h>1);if(!1!==x||p.uirevision){var b=i.newContainer(e,"legend");if(w("uirevision",e.uirevision),!1!==x){if(w("bgcolor",e.paper_bgcolor),w("bordercolor"),w("borderwidth"),a.coerceFont(w,"font",e.font),w("orientation"),"h"===b.orientation){var _=t.xaxis;n.getComponentMethod("rangeslider","isVisible")(_)?(c=0,f="left",u=1.1,d="bottom"):(c=0,f="left",u=-.1,d="top")}w("traceorder",v),s.isGrouped(e.legend)&&w("tracegroupgap"),w("x",c),w("xanchor",f),w("y",u),w("yanchor",d),w("valign"),a.noneOrAll(p,b,["x","y"])}}function w(t,e){return a.coerce(p,b,o,t,e)}}},{"../../lib":168,"../../plot_api/plot_template":202,"../../plots/layout_attributes":243,"../../registry":257,"./attributes":100,"./helpers":106}],103:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../plots/plots"),o=t("../../registry"),l=t("../../lib/events"),s=t("../dragelement"),c=t("../drawing"),u=t("../color"),f=t("../../lib/svg_text_utils"),d=t("./handle_click"),p=t("./constants"),h=t("../../constants/interactions"),g=t("../../constants/alignment"),v=g.LINE_SPACING,y=g.FROM_TL,m=g.FROM_BR,x=t("./get_legend_data"),b=t("./style"),_=t("./helpers"),w=h.DBLCLICKDELAY;function k(t,e,r,n,a){var i=r.data()[0][0].trace,o={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(i._group&&(o.group=i._group),"pie"===i.type&&(o.label=r.datum()[0].label),!1!==l.triggerHandler(t,"plotly_legendclick",o))if(1===n)e._clickTimeout=setTimeout(function(){d(r,t,n)},w);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==l.triggerHandler(t,"plotly_legenddoubleclick",o)&&d(r,t,n)}}function T(t,e,r){var n=t.data()[0][0],i=e._fullLayout,l=n.trace,s=o.traceIs(l,"pie"),u=l.index,d=s?n.label:l.name,h=e._context.edits.legendText&&!s,g=a.ensureSingle(t,"text","legendtext");function y(r){f.convertToTspans(r,e,function(){!function(t,e){var r=t.data()[0][0];if(!r.trace.showlegend)return void t.remove();var n,a,i=t.select("g[class*=math-group]"),o=i.node(),l=e._fullLayout.legend.font.size*v;if(o){var s=c.bBox(o);n=s.height,a=s.width,c.setTranslate(i,0,n/4)}else{var u=t.select(".legendtext"),d=f.lineCount(u),h=u.node();n=l*d,a=h?c.bBox(h).width:0;var g=l*(.3+(1-d)/2);f.positionText(u,p.textOffsetX,g)}r.lineHeight=l,r.height=Math.max(n,16)+3,r.width=a}(t,e)})}g.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,i.legend.font).text(h?M(d,r):d),f.positionText(g,p.textOffsetX,0),h?g.call(f.makeEditable,{gd:e,text:d}).call(y).on("edit",function(t){this.text(M(t,r)).call(y);var i=n.trace._fullInput||{},l={};if(o.hasTransform(i,"groupby")){var s=o.getTransformIndices(i,"groupby"),c=s[s.length-1],f=a.keyedContainer(i,"transforms["+c+"].styles","target","value.name");f.set(n.trace._group,t),l=f.constructUpdate()}else l.name=t;return o.call("_guiRestyle",e,l,u)}):y(g)}function M(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function A(t,e){var r,i=1,o=a.ensureSingle(t,"rect","legendtoggle",function(t){t.style("cursor","pointer").attr("pointer-events","all").call(u.fill,"rgba(0,0,0,0)")});o.on("mousedown",function(){(r=(new Date).getTime())-e._legendMouseDownTime<w?i+=1:(i=1,e._legendMouseDownTime=r)}),o.on("mouseup",function(){if(!e._dragged&&!e._editing){var r=e._fullLayout.legend;(new Date).getTime()-e._legendMouseDownTime>w&&(i=Math.max(i-1,1)),k(e,r,t,i,n.event)}})}function L(t,e,r){var a=t._fullLayout,i=a.legend,o=i.borderwidth,l=_.isGrouped(i),s=0;if(i._width=0,i._height=0,_.isVertical(i))l&&e.each(function(t,e){c.setTranslate(this,0,e*i.tracegroupgap)}),r.each(function(t){var e=t[0],r=e.height,n=e.width;c.setTranslate(this,o,5+o+i._height+r/2),i._height+=r,i._width=Math.max(i._width,n)}),i._width+=45+2*o,i._height+=10+2*o,l&&(i._height+=(i._lgroupsLength-1)*i.tracegroupgap),s=40;else if(l){for(var u=[i._width],f=e.data(),d=0,p=f.length;d<p;d++){var h=f[d].map(function(t){return t[0].width}),g=40+Math.max.apply(null,h);i._width+=i.tracegroupgap+g,u.push(i._width)}e.each(function(t,e){c.setTranslate(this,u[e],0)}),e.each(function(){var t=n.select(this).selectAll("g.traces"),e=0;t.each(function(t){var r=t[0].height;c.setTranslate(this,0,5+o+e+r/2),e+=r}),i._height=Math.max(i._height,e)}),i._height+=10+2*o,i._width+=2*o}else{var v=0,y=0,m=0,x=0,b=0,w=i.tracegroupgap||5;r.each(function(t){m=Math.max(40+t[0].width,m),b+=40+t[0].width+w});var k=a._size.w>o+b-w;r.each(function(t){var e=t[0],r=k?40+t[0].width:m;o+x+w+r>a._size.w&&(x=0,v+=y,i._height+=y,y=0),c.setTranslate(this,o+x,5+o+e.height/2+v),i._width+=w+r,x+=w+r,y=Math.max(e.height,y)}),k?i._height=y:i._height+=y,i._width+=2*o,i._height+=10+2*o}i._width=Math.ceil(i._width),i._height=Math.ceil(i._height);var T=t._context.edits.legendText||t._context.edits.legendPosition;r.each(function(t){var e=t[0],r=n.select(this).select(".legendtoggle");c.setRect(r,0,-e.height/2,(T?0:i._width)+s,e.height)})}function S(t){var e=t._fullLayout.legend,r="left";a.isRightAnchor(e)?r="right":a.isCenterAnchor(e)&&(r="center");var n="top";a.isBottomAnchor(e)?n="bottom":a.isMiddleAnchor(e)&&(n="middle"),i.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*y[r],r:e._width*m[r],b:e._height*m[n],t:e._height*y[n]})}e.exports=function(t){var e=t._fullLayout,r="legend"+e._uid;if(e._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var l=e.legend,f=e.showlegend&&x(t.calcdata,l),d=e.hiddenlabels||[];if(!e.showlegend||!f.length)return e._infolayer.selectAll(".legend").remove(),e._topdefs.select("#"+r).remove(),void i.autoMargin(t,"legend");for(var h=0,g=0;g<f.length;g++)for(var v=0;v<f[g].length;v++){var _=f[g][v][0],w=_.trace,M=o.traceIs(w,"pie")?_.label:w.name;h=Math.max(h,M&&M.length||0)}var C=!1,O=a.ensureSingle(e._infolayer,"g","legend",function(t){t.attr("pointer-events","all"),C=!0}),z=a.ensureSingleById(e._topdefs,"clipPath",r,function(t){t.append("rect")}),D=a.ensureSingle(O,"rect","bg",function(t){t.attr("shape-rendering","crispEdges")});D.call(u.stroke,l.bordercolor).call(u.fill,l.bgcolor).style("stroke-width",l.borderwidth+"px");var P=a.ensureSingle(O,"g","scrollbox"),E=a.ensureSingle(O,"rect","scrollbar",function(t){t.attr({rx:20,ry:3,width:0,height:0}).call(u.fill,"#808BA4")}),R=P.selectAll("g.groups").data(f);R.enter().append("g").attr("class","groups"),R.exit().remove();var I=R.selectAll("g.traces").data(a.identity);I.enter().append("g").attr("class","traces"),I.exit().remove(),I.style("opacity",function(t){var e=t[0].trace;return o.traceIs(e,"pie")?-1!==d.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){n.select(this).call(T,t,h).call(A,t)}).call(b,t),a.syncOrAsync([i.previousPromises,function(){C&&(L(t,R,I),S(t));var u=e.width,f=e.height;L(t,R,I),l._height>f?function(t){var e=t._fullLayout.legend,r="left";a.isRightAnchor(e)?r="right":a.isCenterAnchor(e)&&(r="center");i.autoMargin(t,"legend",{x:e.x,y:.5,l:e._width*y[r],r:e._width*m[r],b:0,t:0})}(t):S(t);var d=e._size,h=d.l+d.w*l.x,g=d.t+d.h*(1-l.y);a.isRightAnchor(l)?h-=l._width:a.isCenterAnchor(l)&&(h-=l._width/2),a.isBottomAnchor(l)?g-=l._height:a.isMiddleAnchor(l)&&(g-=l._height/2);var v=l._width,x=d.w;v>x?(h=d.l,v=x):(h+v>u&&(h=u-v),h<0&&(h=0),v=Math.min(u-h,l._width));var b,_,w,T,M=l._height,A=d.h;if(M>A?(g=d.t,M=A):(g+M>f&&(g=f-M),g<0&&(g=0),M=Math.min(f-g,l._height)),c.setTranslate(O,h,g),E.on(".drag",null),O.on("wheel",null),l._height<=M||t._context.staticPlot)D.attr({width:v-l.borderwidth,height:M-l.borderwidth,x:l.borderwidth/2,y:l.borderwidth/2}),c.setTranslate(P,0,0),z.select("rect").attr({width:v-2*l.borderwidth,height:M-2*l.borderwidth,x:l.borderwidth,y:l.borderwidth}),c.setClipUrl(P,r,t),c.setRect(E,0,0,0,0),delete l._scrollY;else{var F,N,B=Math.max(p.scrollBarMinHeight,M*M/l._height),j=M-B-2*p.scrollBarMargin,H=l._height-M,q=j/H,V=Math.min(l._scrollY||0,H);D.attr({width:v-2*l.borderwidth+p.scrollBarWidth+p.scrollBarMargin,height:M-l.borderwidth,x:l.borderwidth/2,y:l.borderwidth/2}),z.select("rect").attr({width:v-2*l.borderwidth+p.scrollBarWidth+p.scrollBarMargin,height:M-2*l.borderwidth,x:l.borderwidth,y:l.borderwidth+V}),c.setClipUrl(P,r,t),G(V,B,q),O.on("wheel",function(){G(V=a.constrain(l._scrollY+n.event.deltaY/j*H,0,H),B,q),0!==V&&V!==H&&n.event.preventDefault()});var U=n.behavior.drag().on("dragstart",function(){F=n.event.sourceEvent.clientY,N=V}).on("drag",function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||G(V=a.constrain((t.clientY-F)/q+N,0,H),B,q)});E.call(U)}function G(e,r,n){l._scrollY=t._fullLayout.legend._scrollY=e,c.setTranslate(P,0,-e),c.setRect(E,v,p.scrollBarMargin+e*n,p.scrollBarWidth,r),z.select("rect").attr({y:l.borderwidth+e})}t._context.edits.legendPosition&&(O.classed("cursor-move",!0),s.init({element:O.node(),gd:t,prepFn:function(){var t=c.getTranslate(O);w=t.x,T=t.y},moveFn:function(t,e){var r=w+t,n=T+e;c.setTranslate(O,r,n),b=s.align(r,0,d.l,d.l+d.w,l.xanchor),_=s.align(n,0,d.t+d.h,d.t,l.yanchor)},doneFn:function(){void 0!==b&&void 0!==_&&o.call("_guiRelayout",t,{"legend.x":b,"legend.y":_})},clickFn:function(r,n){var a=e._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom});a.size()>0&&k(t,O,a,r,n)}}))}],t)}}},{"../../constants/alignment":146,"../../constants/interactions":148,"../../lib":168,"../../lib/events":161,"../../lib/svg_text_utils":189,"../../plots/plots":245,"../../registry":257,"../color":51,"../dragelement":69,"../drawing":72,"./constants":101,"./get_legend_data":104,"./handle_click":105,"./helpers":106,"./style":108,d3:16}],104:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./helpers");e.exports=function(t,e){var r,i,o={},l=[],s=!1,c={},u=0;function f(t,r){if(""!==t&&a.isGrouped(e))-1===l.indexOf(t)?(l.push(t),s=!0,o[t]=[[r]]):o[t].push([r]);else{var n="~~i"+u;l.push(n),o[n]=[[r]],u++}}for(r=0;r<t.length;r++){var d=t[r],p=d[0],h=p.trace,g=h.legendgroup;if(h.visible&&h.showlegend)if(n.traceIs(h,"pie"))for(c[g]||(c[g]={}),i=0;i<d.length;i++){var v=d[i].label;c[g][v]||(f(g,{label:v,color:d[i].color,i:d[i].i,trace:h,pts:d[i].pts}),c[g][v]=!0)}else f(g,p)}if(!l.length)return[];var y,m,x=l.length;if(s&&a.isGrouped(e))for(m=new Array(x),r=0;r<x;r++)y=o[l[r]],m[r]=a.isReversed(e)?y.reverse():y;else{for(m=[new Array(x)],r=0;r<x;r++)y=o[l[r]][0],m[0][a.isReversed(e)?x-r-1:r]=y;x=1}return e._lgroupsLength=x,m}},{"../../registry":257,"./helpers":106}],105:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=!0;e.exports=function(t,e,r){if(!e._dragged&&!e._editing){var o,l,s,c,u,f=e._fullLayout.hiddenlabels?e._fullLayout.hiddenlabels.slice():[],d=t.data()[0][0],p=e._fullData,h=d.trace,g=h.legendgroup,v={},y=[],m=[],x=[];if(1===r&&i&&e.data&&e._context.showTips?(n.notifier(n._(e,"Double-click on legend to isolate one trace"),"long"),i=!1):i=!1,a.traceIs(h,"pie")){var b=d.label,_=f.indexOf(b);1===r?-1===_?f.push(b):f.splice(_,1):2===r&&(f=[],e.calcdata[0].forEach(function(t){b!==t.label&&f.push(t.label)}),e._fullLayout.hiddenlabels&&e._fullLayout.hiddenlabels.length===f.length&&-1===_&&(f=[])),a.call("_guiRelayout",e,"hiddenlabels",f)}else{var w,k=g&&g.length,T=[];if(k)for(o=0;o<p.length;o++)(w=p[o]).visible&&w.legendgroup===g&&T.push(o);if(1===r){var M;switch(h.visible){case!0:M="legendonly";break;case!1:M=!1;break;case"legendonly":M=!0}if(k)for(o=0;o<p.length;o++)!1!==p[o].visible&&p[o].legendgroup===g&&D(p[o],M);else D(h,M)}else if(2===r){var A,L,S=!0;for(o=0;o<p.length;o++)if(!(p[o]===h)&&!(A=k&&p[o].legendgroup===g)&&!0===p[o].visible&&!a.traceIs(p[o],"notLegendIsolatable")){S=!1;break}for(o=0;o<p.length;o++)if(!1!==p[o].visible&&!a.traceIs(p[o],"notLegendIsolatable"))switch(h.visible){case"legendonly":D(p[o],!0);break;case!0:L=!!S||"legendonly",A=p[o]===h||k&&p[o].legendgroup===g,D(p[o],!!A||L)}}for(o=0;o<m.length;o++)if(s=m[o]){var C=s.constructUpdate(),O=Object.keys(C);for(l=0;l<O.length;l++)c=O[l],(v[c]=v[c]||[])[x[o]]=C[c]}for(u=Object.keys(v),o=0;o<u.length;o++)for(c=u[o],l=0;l<y.length;l++)v[c].hasOwnProperty(l)||(v[c][l]=void 0);a.call("_guiRestyle",e,v,y)}}function z(t,e,r){var n=y.indexOf(t),a=v[e];return a||(a=v[e]=[]),-1===y.indexOf(t)&&(y.push(t),n=y.length-1),a[n]=r,n}function D(t,e){var r=t._fullInput;if(a.hasTransform(r,"groupby")){var i=m[r.index];if(!i){var o=a.getTransformIndices(r,"groupby"),l=o[o.length-1];i=n.keyedContainer(r,"transforms["+l+"].styles","target","value.visible"),m[r.index]=i}var s=i.get(t._group);void 0===s&&(s=!0),!1!==s&&i.set(t._group,e),x[r.index]=z(r.index,"visible",!1!==r.visible)}else{var c=!1!==r.visible&&e;z(r.index,"visible",c)}}}},{"../../lib":168,"../../registry":257}],106:[function(t,e,r){"use strict";r.isGrouped=function(t){return-1!==(t.traceorder||"").indexOf("grouped")},r.isVertical=function(t){return"h"!==t.orientation},r.isReversed=function(t){return-1!==(t.traceorder||"").indexOf("reversed")}},{}],107:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"legend",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw"),style:t("./style")}},{"./attributes":100,"./defaults":102,"./draw":103,"./style":108}],108:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../lib"),o=t("../drawing"),l=t("../color"),s=t("../../traces/scatter/subtypes"),c=t("../../traces/pie/style_one");e.exports=function(t,e){t.each(function(t){var r=n.select(this),a=i.ensureSingle(r,"g","layers");a.style("opacity",t[0].trace.opacity);var o=e._fullLayout.legend.valign,l=t[0].lineHeight,s=t[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([t]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var u=a.selectAll("g.legendsymbols").data([t]);u.enter().append("g").classed("legendsymbols",!0),u.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(function(t){var e=t[0].trace,r=e.marker||{},i=r.line||{},o=n.select(this).select("g.legendpoints").selectAll("path.legendbar").data(a.traceIs(e,"bar")?[t]:[]);o.enter().append("path").classed("legendbar",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),o.exit().remove(),o.each(function(t){var e=n.select(this),a=t[0],o=(a.mlw+1||i.width+1)-1;e.style("stroke-width",o+"px").call(l.fill,a.mc||r.color),o&&e.call(l.stroke,a.mlc||i.color)})}).each(function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(a.traceIs(e,"box-violin")&&e.visible?[t]:[]);r.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.each(function(){var t=e.line.width,r=n.select(this);r.style("stroke-width",t+"px").call(l.fill,e.fillcolor),t&&l.stroke(r,e.line.color)})}).each(function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendpie").data(a.traceIs(e,"pie")&&e.visible?[t]:[]);r.enter().append("path").classed("legendpie",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.size()&&r.call(c,t[0],e)}).each(function(t){var r=t[0].trace,a=r.visible&&r.fill&&"none"!==r.fill,i=s.hasLines(r),l=r.contours,c=!1,u=!1;if(l){var f=l.coloring;"lines"===f?c=!0:i="none"===f||"heatmap"===f||l.showlines,"constraint"===l.type?a="="!==l._operation:"fill"!==f&&"heatmap"!==f||(u=!0)}var d=s.hasMarkers(r)||s.hasText(r),p=a||u,h=i||c,g=d||!p?"M5,0":h?"M5,-2":"M5,-3",v=n.select(this),y=v.select(".legendfill").selectAll("path").data(a||u?[t]:[]);y.enter().append("path").classed("js-fill",!0),y.exit().remove(),y.attr("d",g+"h30v6h-30z").call(a?o.fillGroupStyle:function(t){if(t.size()){var n="legendfill-"+r.uid;o.gradient(t,e,n,"horizontalreversed",r.colorscale,"fill")}});var m=v.select(".legendlines").selectAll("path").data(i||c?[t]:[]);m.enter().append("path").classed("js-line",!0),m.exit().remove(),m.attr("d",g+(c?"l30,0.0001":"h30")).call(i?o.lineGroupStyle:function(t){if(t.size()){var n="legendline-"+r.uid;o.lineGroupStyle(t),o.gradient(t,e,n,"horizontalreversed",r.colorscale,"stroke")}})}).each(function(t){var r,a,l=t[0],c=l.trace,u=s.hasMarkers(c),f=s.hasText(c),d=s.hasLines(c);function p(t,e,r){var n=i.nestedProperty(c,t).get(),a=i.isArrayOrTypedArray(n)&&e?e(n):n;if(r){if(a<r[0])return r[0];if(a>r[1])return r[1]}return a}function h(t){return t[0]}if(u||f||d){var g={},v={};if(u){g.mc=p("marker.color",h),g.mx=p("marker.symbol",h),g.mo=p("marker.opacity",i.mean,[.2,1]),g.mlc=p("marker.line.color",h),g.mlw=p("marker.line.width",i.mean,[0,5]),v.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var y=p("marker.size",i.mean,[2,16]);g.ms=y,v.marker.size=y}d&&(v.line={width:p("line.width",h,[0,10])}),f&&(g.tx="Aa",g.tp=p("textposition",h),g.ts=10,g.tc=p("textfont.color",h),g.tf=p("textfont.family",h)),r=[i.minExtend(l,g)],(a=i.minExtend(c,v)).selectedpoints=null}var m=n.select(this).select("g.legendpoints"),x=m.selectAll("path.scatterpts").data(u?r:[]);x.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform","translate(20,0)"),x.exit().remove(),x.call(o.pointStyle,a,e),u&&(r[0].mrc=3);var b=m.selectAll("g.pointtext").data(f?r:[]);b.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),b.exit().remove(),b.selectAll("text").call(o.textPointStyle,a,e)}).each(function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data("candlestick"===e.type&&e.visible?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each(function(t,r){var a=e[r?"increasing":"decreasing"],i=a.line.width,o=n.select(this);o.style("stroke-width",i+"px").call(l.fill,a.fillcolor),i&&l.stroke(o,a.line.color)})}).each(function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data("ohlc"===e.type&&e.visible?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each(function(t,r){var a=e[r?"increasing":"decreasing"],i=a.line.width,s=n.select(this);s.style("fill","none").call(o.dashLine,a.line.dash,i),i&&l.stroke(s,a.line.color)})})}},{"../../lib":168,"../../registry":257,"../../traces/pie/style_one":365,"../../traces/scatter/subtypes":391,"../color":51,"../drawing":72,d3:16}],109:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/plots"),i=t("../../plots/cartesian/axis_ids"),o=t("../../lib"),l=t("../../../build/ploticon"),s=o._,c=e.exports={};function u(t,e){var r,a,o=e.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=t._fullLayout,u={},f=i.list(t,null,!0),d="on";if("zoom"===l){var p,h="in"===s?.5:2,g=(1+h)/2,v=(1-h)/2;for(a=0;a<f.length;a++)if(!(r=f[a]).fixedrange)if(p=r._name,"auto"===s)u[p+".autorange"]=!0;else if("reset"===s){if(void 0===r._rangeInitial)u[p+".autorange"]=!0;else{var y=r._rangeInitial.slice();u[p+".range[0]"]=y[0],u[p+".range[1]"]=y[1]}void 0!==r._showSpikeInitial&&(u[p+".showspikes"]=r._showSpikeInitial,"on"!==d||r._showSpikeInitial||(d="off"))}else{var m=[r.r2l(r.range[0]),r.r2l(r.range[1])],x=[g*m[0]+v*m[1],g*m[1]+v*m[0]];u[p+".range[0]"]=r.l2r(x[0]),u[p+".range[1]"]=r.l2r(x[1])}c._cartesianSpikesEnabled=d}else{if("hovermode"!==l||"x"!==s&&"y"!==s){if("hovermode"===l&&"closest"===s){for(a=0;a<f.length;a++)r=f[a],"on"!==d||r.showspikes||(d="off");c._cartesianSpikesEnabled=d}}else s=c._isHoriz?"y":"x",o.setAttribute("data-val",s);u[l]=s}n.call("_guiRelayout",t,u)}function f(t,e){for(var r=e.currentTarget,a=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,o=t._fullLayout._subplots.gl3d,l={},s=a.split("."),c=0;c<o.length;c++)l[o[c]+"."+s[1]]=i;var u="pan"===i?i:"zoom";l.dragmode=u,n.call("_guiRelayout",t,l)}function d(t,e){for(var r=e.currentTarget.getAttribute("data-attr"),a=t._fullLayout,i=a._subplots.gl3d,l={},s=0;s<i.length;s++){var c=i[s],u=c+".camera",f=a[c]._scene;"resetDefault"===r?l[u]=null:"resetLastSave"===r&&(l[u]=o.extendDeep({},f.cameraInitial))}n.call("_guiRelayout",t,l)}function p(t,e){var r=e.currentTarget,n=r._previousVal,a=t._fullLayout,i=a._subplots.gl3d,o=["xaxis","yaxis","zaxis"],l={},s={};if(n)s=n,r._previousVal=null;else{for(var c=0;c<i.length;c++){var u=i[c],f=a[u],d=u+".hovermode";l[d]=f.hovermode,s[d]=!1;for(var p=0;p<3;p++){var h=o[p],g=u+"."+h+".showspikes";s[g]=!1,l[g]=f[h].showspikes}}r._previousVal=l}return s}function h(t,e){for(var r=e.currentTarget,a=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,o=t._fullLayout,l=o._subplots.geo,s=0;s<l.length;s++){var c=l[s],u=o[c];if("zoom"===a){var f=u.projection.scale,d="in"===i?2*f:.5*f;n.call("_guiRelayout",t,c+".projection.scale",d)}else"reset"===a&&y(t,"geo")}}function g(t){var e=t._fullLayout;return!e.hovermode&&(e._has("cartesian")?e._isHoriz?"y":"x":"closest")}function v(t){var e=g(t);n.call("_guiRelayout",t,"hovermode",e)}function y(t,e){for(var r=t._fullLayout,a=r._subplots[e],i={},o=0;o<a.length;o++)for(var l=a[o],s=r[l]._subplot.viewInitial,c=Object.keys(s),u=0;u<c.length;u++){var f=c[u];i[l+"."+f]=s[f]}n.call("_guiRelayout",t,i)}c.toImage={name:"toImage",title:function(t){var e=(t._context.toImageButtonOptions||{}).format||"png";return s(t,"png"===e?"Download plot as a png":"Download plot")},icon:l.camera,click:function(t){var e=t._context.toImageButtonOptions,r={format:e.format||"png"};o.notifier(s(t,"Taking snapshot - this may take a few seconds"),"long"),"svg"!==r.format&&o.isIE()&&(o.notifier(s(t,"IE only supports svg. Changing format to svg."),"long"),r.format="svg"),["filename","width","height","scale"].forEach(function(t){e[t]&&(r[t]=e[t])}),n.call("downloadImage",t,r).then(function(e){o.notifier(s(t,"Snapshot succeeded")+" - "+e,"long")}).catch(function(){o.notifier(s(t,"Sorry, there was a problem downloading your snapshot!"),"long")})}},c.sendDataToCloud={name:"sendDataToCloud",title:function(t){return s(t,"Edit in Chart Studio")},icon:l.disk,click:function(t){a.sendDataToCloud(t)}},c.zoom2d={name:"zoom2d",title:function(t){return s(t,"Zoom")},attr:"dragmode",val:"zoom",icon:l.zoombox,click:u},c.pan2d={name:"pan2d",title:function(t){return s(t,"Pan")},attr:"dragmode",val:"pan",icon:l.pan,click:u},c.select2d={name:"select2d",title:function(t){return s(t,"Box Select")},attr:"dragmode",val:"select",icon:l.selectbox,click:u},c.lasso2d={name:"lasso2d",title:function(t){return s(t,"Lasso Select")},attr:"dragmode",val:"lasso",icon:l.lasso,click:u},c.zoomIn2d={name:"zoomIn2d",title:function(t){return s(t,"Zoom in")},attr:"zoom",val:"in",icon:l.zoom_plus,click:u},c.zoomOut2d={name:"zoomOut2d",title:function(t){return s(t,"Zoom out")},attr:"zoom",val:"out",icon:l.zoom_minus,click:u},c.autoScale2d={name:"autoScale2d",title:function(t){return s(t,"Autoscale")},attr:"zoom",val:"auto",icon:l.autoscale,click:u},c.resetScale2d={name:"resetScale2d",title:function(t){return s(t,"Reset axes")},attr:"zoom",val:"reset",icon:l.home,click:u},c.hoverClosestCartesian={name:"hoverClosestCartesian",title:function(t){return s(t,"Show closest data on hover")},attr:"hovermode",val:"closest",icon:l.tooltip_basic,gravity:"ne",click:u},c.hoverCompareCartesian={name:"hoverCompareCartesian",title:function(t){return s(t,"Compare data on hover")},attr:"hovermode",val:function(t){return t._fullLayout._isHoriz?"y":"x"},icon:l.tooltip_compare,gravity:"ne",click:u},c.zoom3d={name:"zoom3d",title:function(t){return s(t,"Zoom")},attr:"scene.dragmode",val:"zoom",icon:l.zoombox,click:f},c.pan3d={name:"pan3d",title:function(t){return s(t,"Pan")},attr:"scene.dragmode",val:"pan",icon:l.pan,click:f},c.orbitRotation={name:"orbitRotation",title:function(t){return s(t,"Orbital rotation")},attr:"scene.dragmode",val:"orbit",icon:l["3d_rotate"],click:f},c.tableRotation={name:"tableRotation",title:function(t){return s(t,"Turntable rotation")},attr:"scene.dragmode",val:"turntable",icon:l["z-axis"],click:f},c.resetCameraDefault3d={name:"resetCameraDefault3d",title:function(t){return s(t,"Reset camera to default")},attr:"resetDefault",icon:l.home,click:d},c.resetCameraLastSave3d={name:"resetCameraLastSave3d",title:function(t){return s(t,"Reset camera to last save")},attr:"resetLastSave",icon:l.movie,click:d},c.hoverClosest3d={name:"hoverClosest3d",title:function(t){return s(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:l.tooltip_basic,gravity:"ne",click:function(t,e){var r=p(t,e);n.call("_guiRelayout",t,r)}},c.zoomInGeo={name:"zoomInGeo",title:function(t){return s(t,"Zoom in")},attr:"zoom",val:"in",icon:l.zoom_plus,click:h},c.zoomOutGeo={name:"zoomOutGeo",title:function(t){return s(t,"Zoom out")},attr:"zoom",val:"out",icon:l.zoom_minus,click:h},c.resetGeo={name:"resetGeo",title:function(t){return s(t,"Reset")},attr:"reset",val:null,icon:l.autoscale,click:h},c.hoverClosestGeo={name:"hoverClosestGeo",title:function(t){return s(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:l.tooltip_basic,gravity:"ne",click:v},c.hoverClosestGl2d={name:"hoverClosestGl2d",title:function(t){return s(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:l.tooltip_basic,gravity:"ne",click:v},c.hoverClosestPie={name:"hoverClosestPie",title:function(t){return s(t,"Toggle show closest data on hover")},attr:"hovermode",val:"closest",icon:l.tooltip_basic,gravity:"ne",click:v},c.toggleHover={name:"toggleHover",title:function(t){return s(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:l.tooltip_basic,gravity:"ne",click:function(t,e){var r=p(t,e);r.hovermode=g(t),n.call("_guiRelayout",t,r)}},c.resetViews={name:"resetViews",title:function(t){return s(t,"Reset views")},icon:l.home,click:function(t,e){var r=e.currentTarget;r.setAttribute("data-attr","zoom"),r.setAttribute("data-val","reset"),u(t,e),r.setAttribute("data-attr","resetLastSave"),d(t,e),y(t,"geo"),y(t,"mapbox")}},c.toggleSpikelines={name:"toggleSpikelines",title:function(t){return s(t,"Toggle Spike Lines")},icon:l.spikeline,attr:"_cartesianSpikesEnabled",val:"on",click:function(t){var e=t._fullLayout;e._cartesianSpikesEnabled="on"===e._cartesianSpikesEnabled?"off":"on";var r=function(t){for(var e,r,n=t._fullLayout,a=i.list(t,null,!0),o={},l=0;l<a.length;l++)e=a[l],r=e._name,o[r+".showspikes"]="on"===n._cartesianSpikesEnabled||e._showSpikeInitial;return o}(t);n.call("_guiRelayout",t,r)}},c.resetViewMapbox={name:"resetViewMapbox",title:function(t){return s(t,"Reset view")},attr:"reset",icon:l.home,click:function(t){y(t,"mapbox")}}},{"../../../build/ploticon":2,"../../lib":168,"../../plots/cartesian/axis_ids":215,"../../plots/plots":245,"../../registry":257}],110:[function(t,e,r){"use strict";r.manage=t("./manage")},{"./manage":111}],111:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axis_ids"),a=t("../../traces/scatter/subtypes"),i=t("../../registry"),o=t("./modebar"),l=t("./buttons");e.exports=function(t){var e=t._fullLayout,r=t._context,s=e._modeBar;if(r.displayModeBar||r.watermark){if(!Array.isArray(r.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(r.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var c,u=r.modeBarButtons;c=Array.isArray(u)&&u.length?function(t){for(var e=0;e<t.length;e++)for(var r=t[e],n=0;n<r.length;n++){var a=r[n];if("string"==typeof a){if(void 0===l[a])throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "));t[e][n]=l[a]}}return t}(u):!r.displayModeBar&&r.watermark?[]:function(t,e,r,o){var s=t._fullLayout,c=t._fullData,u=s._has("cartesian"),f=s._has("gl3d"),d=s._has("geo"),p=s._has("pie"),h=s._has("gl2d"),g=s._has("ternary"),v=s._has("mapbox"),y=s._has("polar"),m=function(t){for(var e=n.list({_fullLayout:t},null,!0),r=0;r<e.length;r++)if(!e[r].fixedrange)return!1;return!0}(s),x=[];function b(t){if(t.length){for(var r=[],n=0;n<t.length;n++){var a=t[n];-1===e.indexOf(a)&&r.push(l[a])}x.push(r)}}var _=["toImage"];o&&_.push("sendDataToCloud");b(_);var w=[],k=[],T=[],M=[];(u||h||p||g)+d+f+v+y>1?(k=["toggleHover"],T=["resetViews"]):d?(w=["zoomInGeo","zoomOutGeo"],k=["hoverClosestGeo"],T=["resetGeo"]):f?(k=["hoverClosest3d"],T=["resetCameraDefault3d","resetCameraLastSave3d"]):v?(k=["toggleHover"],T=["resetViewMapbox"]):k=h?["hoverClosestGl2d"]:p?["hoverClosestPie"]:["toggleHover"];u&&(k=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);!u&&!h||m||(w=["zoomIn2d","zoomOut2d","autoScale2d"],"resetViews"!==T[0]&&(T=["resetScale2d"]));f?M=["zoom3d","pan3d","orbitRotation","tableRotation"]:(u||h)&&!m||g?M=["zoom2d","pan2d"]:v||d?M=["pan2d"]:y&&(M=["zoom2d"]);(function(t){for(var e=!1,r=0;r<t.length&&!e;r++){var n=t[r];n._module&&n._module.selectPoints&&(i.traceIs(n,"scatter-like")?(a.hasMarkers(n)||a.hasText(n))&&(e=!0):i.traceIs(n,"box-violin")&&"all"!==n.boxpoints&&"all"!==n.points||(e=!0))}return e})(c)&&M.push("select2d","lasso2d");return b(M),b(w.concat(T)),b(k),function(t,e){if(e.length)if(Array.isArray(e[0]))for(var r=0;r<e.length;r++)t.push(e[r]);else t.push(e);return t}(x,r)}(t,r.modeBarButtonsToRemove,r.modeBarButtonsToAdd,r.showSendToCloud),s?s.update(t,c):e._modeBar=o(t,c)}else s&&(s.destroy(),delete e._modeBar)}},{"../../plots/cartesian/axis_ids":215,"../../registry":257,"../../traces/scatter/subtypes":391,"./buttons":109,"./modebar":112}],112:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../../lib"),o=t("../../../build/ploticon"),l=new DOMParser;function s(t){this.container=t.container,this.element=document.createElement("div"),this.update(t.graphInfo,t.buttons),this.container.appendChild(this.element)}var c=s.prototype;c.update=function(t,e){this.graphInfo=t;var r=this.graphInfo._context,n=this.graphInfo._fullLayout,a="modebar-"+n._uid;this.element.setAttribute("id",a),this._uid=a,this.element.className="modebar","hover"===r.displayModeBar&&(this.element.className+=" modebar--hover ease-bg"),"v"===n.modebar.orientation&&(this.element.className+=" vertical",e=e.reverse());var o=n.modebar,l="hover"===r.displayModeBar?".js-plotly-plot .plotly:hover ":"";i.deleteRelatedStyleRule(a),i.addRelatedStyleRule(a,l+"#"+a,"background-color: "+o.bgcolor),i.addRelatedStyleRule(a,"#"+a+" .modebar-btn .icon path","fill: "+o.color),i.addRelatedStyleRule(a,"#"+a+" .modebar-btn:hover .icon path","fill: "+o.activecolor),i.addRelatedStyleRule(a,"#"+a+" .modebar-btn.active .icon path","fill: "+o.activecolor);var s=!this.hasButtons(e),c=this.hasLogo!==r.displaylogo,u=this.locale!==r.locale;if(this.locale=r.locale,(s||c||u)&&(this.removeAllButtons(),this.updateButtons(e),r.watermark||r.displaylogo)){var f=this.getLogo();r.watermark&&(f.className=f.className+" watermark"),"v"===n.modebar.orientation?this.element.insertBefore(f,this.element.childNodes[0]):this.element.appendChild(f),this.hasLogo=!0}this.updateActiveButton()},c.updateButtons=function(t){var e=this;this.buttons=t,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach(function(t){var r=e.createGroup();t.forEach(function(t){var n=t.name;if(!n)throw new Error("must provide button 'name' in button config");if(-1!==e.buttonsNames.indexOf(n))throw new Error("button name '"+n+"' is taken");e.buttonsNames.push(n);var a=e.createButton(t);e.buttonElements.push(a),r.appendChild(a)}),e.element.appendChild(r)})},c.createGroup=function(){var t=document.createElement("div");return t.className="modebar-group",t},c.createButton=function(t){var e=this,r=document.createElement("a");r.setAttribute("rel","tooltip"),r.className="modebar-btn";var a=t.title;void 0===a?a=t.name:"function"==typeof a&&(a=a(this.graphInfo)),(a||0===a)&&r.setAttribute("data-title",a),void 0!==t.attr&&r.setAttribute("data-attr",t.attr);var i=t.val;if(void 0!==i&&("function"==typeof i&&(i=i(this.graphInfo)),r.setAttribute("data-val",i)),"function"!=typeof t.click)throw new Error("must provide button 'click' function in button config");r.addEventListener("click",function(r){t.click(e.graphInfo,r),e.updateActiveButton(r.currentTarget)}),r.setAttribute("data-toggle",t.toggle||!1),t.toggle&&n.select(r).classed("active",!0);var l=t.icon;return"function"==typeof l?r.appendChild(l()):r.appendChild(this.createIcon(l||o.question)),r.setAttribute("data-gravity",t.gravity||"n"),r},c.createIcon=function(t){var e,r=a(t.height)?Number(t.height):t.ascent-t.descent,n="http://www.w3.org/2000/svg";if(t.path){(e=document.createElementNS(n,"svg")).setAttribute("viewBox",[0,0,t.width,r].join(" ")),e.setAttribute("class","icon");var i=document.createElementNS(n,"path");i.setAttribute("d",t.path),t.transform?i.setAttribute("transform",t.transform):void 0!==t.ascent&&i.setAttribute("transform","matrix(1 0 0 -1 0 "+t.ascent+")"),e.appendChild(i)}t.svg&&(e=l.parseFromString(t.svg,"application/xml").childNodes[0]);return e.setAttribute("height","1em"),e.setAttribute("width","1em"),e},c.updateActiveButton=function(t){var e=this.graphInfo._fullLayout,r=void 0!==t?t.getAttribute("data-attr"):null;this.buttonElements.forEach(function(t){var a=t.getAttribute("data-val")||!0,o=t.getAttribute("data-attr"),l="true"===t.getAttribute("data-toggle"),s=n.select(t);if(l)o===r&&s.classed("active",!s.classed("active"));else{var c=null===o?o:i.nestedProperty(e,o).get();s.classed("active",c===a)}})},c.hasButtons=function(t){var e=this.buttons;if(!e)return!1;if(t.length!==e.length)return!1;for(var r=0;r<t.length;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;n<t[r].length;n++)if(t[r][n].name!==e[r][n].name)return!1}return!0},c.getLogo=function(){var t=this.createGroup(),e=document.createElement("a");return e.href="https://plot.ly/",e.target="_blank",e.setAttribute("data-title",i._(this.graphInfo,"Produced with Plotly")),e.className="modebar-btn plotlyjsicon modebar-btn--logo",e.appendChild(this.createIcon(o.newplotlylogo)),t.appendChild(e),t},c.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1},c.destroy=function(){i.removeElement(this.container.querySelector(".modebar")),i.deleteRelatedStyleRule(this._uid)},e.exports=function(t,e){var r=t._fullLayout,a=new s({graphInfo:t,container:r._paperdiv.node(),buttons:e});return r._privateplot&&n.select(a.element).append("span").classed("badge-private float--left",!0).text("PRIVATE"),a}},{"../../../build/ploticon":2,"../../lib":168,d3:16,"fast-isnumeric":18}],113:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=(0,t("../../plot_api/plot_template").templatedArray)("button",{visible:{valType:"boolean",dflt:!0,editType:"plot"},step:{valType:"enumerated",values:["month","year","day","hour","minute","second","all"],dflt:"month",editType:"plot"},stepmode:{valType:"enumerated",values:["backward","todate"],dflt:"backward",editType:"plot"},count:{valType:"number",min:0,dflt:1,editType:"plot"},label:{valType:"string",editType:"plot"},editType:"plot"});e.exports={visible:{valType:"boolean",editType:"plot"},buttons:i,x:{valType:"number",min:-2,max:3,editType:"plot"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"plot"},y:{valType:"number",min:-2,max:3,editType:"plot"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"bottom",editType:"plot"},font:n({editType:"plot"}),bgcolor:{valType:"color",dflt:a.lightLine,editType:"plot"},activecolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:a.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"}},{"../../plot_api/plot_template":202,"../../plots/font_attributes":239,"../color/attributes":50}],114:[function(t,e,r){"use strict";e.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}},{}],115:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../color"),i=t("../../plot_api/plot_template"),o=t("../../plots/array_container_defaults"),l=t("./attributes"),s=t("./constants");function c(t,e,r,a){var i=a.calendar;function o(r,a){return n.coerce(t,e,l.buttons,r,a)}if(o("visible")){var s=o("step");"all"!==s&&(!i||"gregorian"===i||"month"!==s&&"year"!==s?o("stepmode"):e.stepmode="backward",o("count")),o("label")}}e.exports=function(t,e,r,u,f){var d=t.rangeselector||{},p=i.newContainer(e,"rangeselector");function h(t,e){return n.coerce(d,p,l,t,e)}if(h("visible",o(d,p,{name:"buttons",handleItemDefaults:c,calendar:f}).length>0)){var g=function(t,e,r){for(var n=r.filter(function(r){return e[r].anchor===t._id}),a=0,i=0;i<n.length;i++){var o=e[n[i]].domain;o&&(a=Math.max(o[1],a))}return[t.domain[0],a+s.yPad]}(e,r,u);h("x",g[0]),h("y",g[1]),n.noneOrAll(t,e,["x","y"]),h("xanchor"),h("yanchor"),n.coerceFont(h,"font",r.font);var v=h("bgcolor");h("activecolor",a.contrast(v,s.lightAmount,s.darkAmount)),h("bordercolor"),h("borderwidth")}}},{"../../lib":168,"../../plot_api/plot_template":202,"../../plots/array_container_defaults":208,"../color":51,"./attributes":113,"./constants":114}],116:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../plots/plots"),o=t("../color"),l=t("../drawing"),s=t("../../lib"),c=t("../../lib/svg_text_utils"),u=t("../../plots/cartesian/axis_ids"),f=t("../../constants/alignment"),d=f.LINE_SPACING,p=f.FROM_TL,h=f.FROM_BR,g=t("./constants"),v=t("./get_update_object");function y(t){return t._id}function m(t,e,r){var n=s.ensureSingle(t,"rect","selector-rect",function(t){t.attr("shape-rendering","crispEdges")});n.attr({rx:g.rx,ry:g.ry}),n.call(o.stroke,e.bordercolor).call(o.fill,function(t,e){return e._isActive||e._isHovered?t.activecolor:t.bgcolor}(e,r)).style("stroke-width",e.borderwidth+"px")}function x(t,e,r,n){var a;s.ensureSingle(t,"text","selector-text",function(t){t.classed("user-select-none",!0).attr("text-anchor","middle")}).call(l.font,e.font).text((a=r,a.label?a.label:"all"===a.step?"all":a.count+a.step.charAt(0))).call(function(t){c.convertToTspans(t,n)})}e.exports=function(t){var e=t._fullLayout._infolayer.selectAll(".rangeselector").data(function(t){for(var e=u.list(t,"x",!0),r=[],n=0;n<e.length;n++){var a=e[n];a.rangeselector&&a.rangeselector.visible&&r.push(a)}return r}(t),y);e.enter().append("g").classed("rangeselector",!0),e.exit().remove(),e.style({cursor:"pointer","pointer-events":"all"}),e.each(function(e){var r=n.select(this),o=e,u=o.rangeselector,f=r.selectAll("g.button").data(s.filterVisible(u.buttons));f.enter().append("g").classed("button",!0),f.exit().remove(),f.each(function(e){var r=n.select(this),i=v(o,e);e._isActive=function(t,e,r){if("all"===e.step)return!0===t.autorange;var n=Object.keys(r);return t.range[0]===r[n[0]]&&t.range[1]===r[n[1]]}(o,e,i),r.call(m,u,e),r.call(x,u,e,t),r.on("click",function(){t._dragged||a.call("_guiRelayout",t,i)}),r.on("mouseover",function(){e._isHovered=!0,r.call(m,u,e)}),r.on("mouseout",function(){e._isHovered=!1,r.call(m,u,e)})}),function(t,e,r,a,o){var u=0,f=0,v=r.borderwidth;e.each(function(){var t=n.select(this),e=t.select(".selector-text"),a=r.font.size*d,i=Math.max(a*c.lineCount(e),16)+3;f=Math.max(f,i)}),e.each(function(){var t=n.select(this),e=t.select(".selector-rect"),a=t.select(".selector-text"),i=a.node()&&l.bBox(a.node()).width,o=r.font.size*d,s=c.lineCount(a),p=Math.max(i+10,g.minButtonWidth);t.attr("transform","translate("+(v+u)+","+v+")"),e.attr({x:0,y:0,width:p,height:f}),c.positionText(a,p/2,f/2-(s-1)*o/2+3),u+=p+5});var y=t._fullLayout._size,m=y.l+y.w*r.x,x=y.t+y.h*(1-r.y),b="left";s.isRightAnchor(r)&&(m-=u,b="right");s.isCenterAnchor(r)&&(m-=u/2,b="center");var _="top";s.isBottomAnchor(r)&&(x-=f,_="bottom");s.isMiddleAnchor(r)&&(x-=f/2,_="middle");u=Math.ceil(u),f=Math.ceil(f),m=Math.round(m),x=Math.round(x),i.autoMargin(t,a+"-range-selector",{x:r.x,y:r.y,l:u*p[b],r:u*h[b],b:f*h[_],t:f*p[_]}),o.attr("transform","translate("+m+","+x+")")}(t,f,u,o._name,r)})}},{"../../constants/alignment":146,"../../lib":168,"../../lib/svg_text_utils":189,"../../plots/cartesian/axis_ids":215,"../../plots/plots":245,"../../registry":257,"../color":51,"../drawing":72,"./constants":114,"./get_update_object":117,d3:16}],117:[function(t,e,r){"use strict";var n=t("d3");e.exports=function(t,e){var r=t._name,a={};if("all"===e.step)a[r+".autorange"]=!0;else{var i=function(t,e){var r,a=t.range,i=new Date(t.r2l(a[1])),o=e.step,l=e.count;switch(e.stepmode){case"backward":r=t.l2r(+n.time[o].utc.offset(i,-l));break;case"todate":var s=n.time[o].utc.offset(i,-l);r=t.l2r(+n.time[o].utc.ceil(s))}var c=a[1];return[r,c]}(t,e);a[r+".range[0]"]=i[0],a[r+".range[1]"]=i[1]}return a}},{d3:16}],118:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"rangeselector",schema:{subplots:{xaxis:{rangeselector:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":113,"./defaults":115,"./draw":116}],119:[function(t,e,r){"use strict";var n=t("../color/attributes");e.exports={bgcolor:{valType:"color",dflt:n.background,editType:"plot"},bordercolor:{valType:"color",dflt:n.defaultLine,editType:"plot"},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot"},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1}},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"}},{"../color/attributes":50}],120:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axis_ids").list,a=t("../../plots/cartesian/autorange").getAutoRange,i=t("./constants");e.exports=function(t){for(var e=n(t,"x",!0),r=0;r<e.length;r++){var o=e[r],l=o[i.name];l&&l.visible&&l.autorange&&(l._input.autorange=!0,l._input.range=l.range=a(t,o))}}},{"../../plots/cartesian/autorange":211,"../../plots/cartesian/axis_ids":215,"./constants":121}],121:[function(t,e,r){"use strict";e.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}},{}],122:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plot_api/plot_template"),i=t("../../plots/cartesian/axis_ids"),o=t("./attributes"),l=t("./oppaxis_attributes");e.exports=function(t,e,r){var s=t[r],c=e[r];if(s.rangeslider||e._requestRangeslider[c._id]){n.isPlainObject(s.rangeslider)||(s.rangeslider={});var u,f,d=s.rangeslider,p=a.newContainer(c,"rangeslider");if(_("visible")){_("bgcolor",e.plot_bgcolor),_("bordercolor"),_("borderwidth"),_("thickness"),_("autorange",!c.isValidRange(d.range)),_("range");var h=e._subplots;if(h)for(var g=h.cartesian.filter(function(t){return t.substr(0,t.indexOf("y"))===i.name2id(r)}).map(function(t){return t.substr(t.indexOf("y"),t.length)}),v=n.simpleMap(g,i.id2name),y=0;y<v.length;y++){var m=v[y];u=d[m]||{},f=a.newContainer(p,m,"yaxis");var x,b=e[m];u.range&&b.isValidRange(u.range)&&(x="fixed"),"match"!==w("rangemode",x)&&w("range",b.range.slice())}p._input=d}}function _(t,e){return n.coerce(d,p,o,t,e)}function w(t,e){return n.coerce(u,f,l,t,e)}}},{"../../lib":168,"../../plot_api/plot_template":202,"../../plots/cartesian/axis_ids":215,"./attributes":119,"./oppaxis_attributes":126}],123:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../plots/plots"),o=t("../../lib"),l=t("../drawing"),s=t("../color"),c=t("../titles"),u=t("../../plots/cartesian"),f=t("../../plots/cartesian/axis_ids"),d=t("../dragelement"),p=t("../../lib/setcursor"),h=t("./constants");function g(t,e,r,n){var a=o.ensureSingle(t,"rect",h.bgClassName,function(t){t.attr({x:0,y:0,"shape-rendering":"crispEdges"})}),i=n.borderwidth%2==0?n.borderwidth:n.borderwidth-1,s=-n._offsetShift,c=l.crispRound(e,n.borderwidth);a.attr({width:n._width+i,height:n._height+i,transform:"translate("+s+","+s+")",fill:n.bgcolor,stroke:n.bordercolor,"stroke-width":c})}function v(t,e,r,n){var a=e._fullLayout;o.ensureSingleById(a._topdefs,"clipPath",n._clipId,function(t){t.append("rect").attr({x:0,y:0})}).select("rect").attr({width:n._width,height:n._height})}function y(t,e,r,a){var s,c=e.calcdata,d=t.selectAll("g."+h.rangePlotClassName).data(r._subplotsWith,o.identity);d.enter().append("g").attr("class",function(t){return h.rangePlotClassName+" "+t}).call(l.setClipUrl,a._clipId,e),d.order(),d.exit().remove(),d.each(function(t,o){var l=n.select(this),d=0===o,p=f.getFromId(e,t,"y"),h=p._name,g=a[h],v={data:[],layout:{xaxis:{type:r.type,domain:[0,1],range:a.range.slice(),calendar:r.calendar},width:a._width,height:a._height,margin:{t:0,b:0,l:0,r:0}},_context:e._context};v.layout[h]={type:p.type,domain:[0,1],range:"match"!==g.rangemode?g.range.slice():p.range.slice(),calendar:p.calendar},i.supplyDefaults(v);var y=v._fullLayout.xaxis,m=v._fullLayout[h];y.clearCalc(),y.setScale(),m.clearCalc(),m.setScale();var x={id:t,plotgroup:l,xaxis:y,yaxis:m,isRangePlot:!0};d?s=x:(x.mainplot="xy",x.mainplotinfo=s),u.rangePlot(e,x,function(t,e){for(var r=[],n=0;n<t.length;n++){var a=t[n],i=a[0].trace;i.xaxis+i.yaxis===e&&r.push(a)}return r}(c,t))})}function m(t,e,r,n,a){(o.ensureSingle(t,"rect",h.maskMinClassName,function(t){t.attr({x:0,y:0,"shape-rendering":"crispEdges"})}).attr("height",n._height).call(s.fill,h.maskColor),o.ensureSingle(t,"rect",h.maskMaxClassName,function(t){t.attr({y:0,"shape-rendering":"crispEdges"})}).attr("height",n._height).call(s.fill,h.maskColor),"match"!==a.rangemode)&&(o.ensureSingle(t,"rect",h.maskMinOppAxisClassName,function(t){t.attr({y:0,"shape-rendering":"crispEdges"})}).attr("width",n._width).call(s.fill,h.maskOppAxisColor),o.ensureSingle(t,"rect",h.maskMaxOppAxisClassName,function(t){t.attr({y:0,"shape-rendering":"crispEdges"})}).attr("width",n._width).style("border-top",h.maskOppBorder).call(s.fill,h.maskOppAxisColor))}function x(t,e,r,n){e._context.staticPlot||o.ensureSingle(t,"rect",h.slideBoxClassName,function(t){t.attr({y:0,cursor:h.slideBoxCursor,"shape-rendering":"crispEdges"})}).attr({height:n._height,fill:h.slideBoxFill})}function b(t,e,r,n){var a=o.ensureSingle(t,"g",h.grabberMinClassName),i=o.ensureSingle(t,"g",h.grabberMaxClassName),l={x:0,width:h.handleWidth,rx:h.handleRadius,fill:s.background,stroke:s.defaultLine,"stroke-width":h.handleStrokeWidth,"shape-rendering":"crispEdges"},c={y:Math.round(n._height/4),height:Math.round(n._height/2)};if(o.ensureSingle(a,"rect",h.handleMinClassName,function(t){t.attr(l)}).attr(c),o.ensureSingle(i,"rect",h.handleMaxClassName,function(t){t.attr(l)}).attr(c),!e._context.staticPlot){var u={width:h.grabAreaWidth,x:0,y:0,fill:h.grabAreaFill,cursor:h.grabAreaCursor};o.ensureSingle(a,"rect",h.grabAreaMinClassName,function(t){t.attr(u)}).attr("height",n._height),o.ensureSingle(i,"rect",h.grabAreaMaxClassName,function(t){t.attr(u)}).attr("height",n._height)}}e.exports=function(t){for(var e=t._fullLayout,r=e._rangeSliderData,i=0;i<r.length;i++){var l=r[i][h.name];l._clipId=l._id+"-"+e._uid}var s=e._infolayer.selectAll("g."+h.containerClassName).data(r,function(t){return t._name});s.exit().each(function(t){var r=t[h.name];e._topdefs.select("#"+r._clipId).remove()}).remove(),0!==r.length&&(s.enter().append("g").classed(h.containerClassName,!0).attr("pointer-events","all"),s.each(function(r){var i=n.select(this),l=r[h.name],s=e[f.id2name(r.anchor)],u=l[f.id2name(r.anchor)];if(l.range){var _,w=o.simpleMap(l.range,r.r2l),k=o.simpleMap(r.range,r.r2l);_=k[0]<k[1]?[Math.min(w[0],k[0]),Math.max(w[1],k[1])]:[Math.max(w[0],k[0]),Math.min(w[1],k[1])],l.range=l._input.range=o.simpleMap(_,r.l2r)}r.cleanRange("rangeslider.range");var T=e.margin,M=e._size,A=r.domain,L=l._tickHeight,S=l._oppBottom;l._width=M.w*(A[1]-A[0]);var C=Math.round(T.l+M.w*A[0]),O=Math.round(M.t+M.h*(1-S)+L+l._offsetShift+h.extraPad);i.attr("transform","translate("+C+","+O+")");var z=r.r2l(l.range[0]),D=r.r2l(l.range[1]),P=D-z;if(l.p2d=function(t){return t/l._width*P+z},l.d2p=function(t){return(t-z)/P*l._width},l._rl=[z,D],"match"!==u.rangemode){var E=s.r2l(u.range[0]),R=s.r2l(u.range[1])-E;l.d2pOppAxis=function(t){return(t-E)/R*l._height}}i.call(g,t,r,l).call(v,t,r,l).call(y,t,r,l).call(m,t,r,l,u).call(x,t,r,l).call(b,t,r,l),function(t,e,r,i){var l=t.select("rect."+h.slideBoxClassName).node(),s=t.select("rect."+h.grabAreaMinClassName).node(),c=t.select("rect."+h.grabAreaMaxClassName).node();t.on("mousedown",function(){var u=n.event,f=u.target,h=u.clientX,g=h-t.node().getBoundingClientRect().left,v=i.d2p(r._rl[0]),y=i.d2p(r._rl[1]),m=d.coverSlip();function x(t){var u,d,x,b=+t.clientX-h;switch(f){case l:x="ew-resize",u=v+b,d=y+b;break;case s:x="col-resize",u=v+b,d=y;break;case c:x="col-resize",u=v,d=y+b;break;default:x="ew-resize",u=g,d=g+b}if(d<u){var _=d;d=u,u=_}i._pixelMin=u,i._pixelMax=d,p(n.select(m),x),function(t,e,r,n){function i(t){return r.l2r(o.constrain(t,n._rl[0],n._rl[1]))}var l=i(n.p2d(n._pixelMin)),s=i(n.p2d(n._pixelMax));window.requestAnimationFrame(function(){a.call("_guiRelayout",e,r._name+".range",[l,s])})}(0,e,r,i)}m.addEventListener("mousemove",x),m.addEventListener("mouseup",function t(){m.removeEventListener("mousemove",x);m.removeEventListener("mouseup",t);o.removeElement(m)})})}(i,t,r,l),function(t,e,r,n,a,i){var l=h.handleWidth/2;function s(t){return o.constrain(t,0,n._width)}function c(t){return o.constrain(t,0,n._height)}function u(t){return o.constrain(t,-l,n._width+l)}var f=s(n.d2p(r._rl[0])),d=s(n.d2p(r._rl[1]));if(t.select("rect."+h.slideBoxClassName).attr("x",f).attr("width",d-f),t.select("rect."+h.maskMinClassName).attr("width",f),t.select("rect."+h.maskMaxClassName).attr("x",d).attr("width",n._width-d),"match"!==i.rangemode){var p=n._height-c(n.d2pOppAxis(a._rl[1])),g=n._height-c(n.d2pOppAxis(a._rl[0]));t.select("rect."+h.maskMinOppAxisClassName).attr("x",f).attr("height",p).attr("width",d-f),t.select("rect."+h.maskMaxOppAxisClassName).attr("x",f).attr("y",g).attr("height",n._height-g).attr("width",d-f),t.select("rect."+h.slideBoxClassName).attr("y",p).attr("height",g-p)}var v=Math.round(u(f-l))-.5,y=Math.round(u(d-l))+.5;t.select("g."+h.grabberMinClassName).attr("transform","translate("+v+",0.5)"),t.select("g."+h.grabberMaxClassName).attr("transform","translate("+y+",0.5)")}(i,0,r,l,s,u),"bottom"===r.side&&c.draw(t,r._id+"title",{propContainer:r,propName:r._name+".title",placeholder:e._dfltTitle.x,attributes:{x:r._offset+r._length/2,y:O+l._height+l._offsetShift+10+1.5*r.title.font.size,"text-anchor":"middle"}})}))}},{"../../lib":168,"../../lib/setcursor":187,"../../plots/cartesian":224,"../../plots/cartesian/axis_ids":215,"../../plots/plots":245,"../../registry":257,"../color":51,"../dragelement":69,"../drawing":72,"../titles":139,"./constants":121,d3:16}],124:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axis_ids"),a=t("./constants"),i=a.name;function o(t){var e=t&&t[i];return e&&e.visible}r.isVisible=o,r.makeData=function(t){var e=n.list({_fullLayout:t},"x",!0),r=t.margin,a=[];if(!t._has("gl2d"))for(var l=0;l<e.length;l++){var s=e[l];if(o(s)){a.push(s);var c=s[i];c._id=i+s._id,c._height=(t.height-r.b-r.t)*c.thickness,c._offsetShift=Math.floor(c.borderwidth/2)}}t._rangeSliderData=a},r.autoMarginOpts=function(t,e){for(var r=e[i],o=1/0,l=e._counterAxes,s=0;s<l.length;s++){var c=l[s],u=n.getFromId(t,c);o=Math.min(o,u.domain[0])}r._oppBottom=o;var f="bottom"===e.side&&e._boundingBox.height||0;return r._tickHeight=f,{x:0,y:o,l:0,r:0,t:0,b:r._height+t._fullLayout.margin.b+f,pad:a.extraPad+2*r._offsetShift}}},{"../../plots/cartesian/axis_ids":215,"./constants":121}],125:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("./oppaxis_attributes"),o=t("./helpers");e.exports={moduleType:"component",name:"rangeslider",schema:{subplots:{xaxis:{rangeslider:n.extendFlat({},a,{yaxis:i})}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:t("./draw"),isVisible:o.isVisible,makeData:o.makeData,autoMarginOpts:o.autoMarginOpts}},{"../../lib":168,"./attributes":119,"./calc_autorange":120,"./defaults":122,"./draw":123,"./helpers":124,"./oppaxis_attributes":126}],126:[function(t,e,r){"use strict";e.exports={_isSubplotObj:!0,rangemode:{valType:"enumerated",values:["auto","fixed","match"],dflt:"match",editType:"calc"},range:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},editType:"calc"}},{}],127:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),a=t("../../traces/scatter/attributes").line,i=t("../drawing/attributes").dash,o=t("../../lib/extend").extendFlat,l=t("../../plot_api/plot_template").templatedArray;e.exports=l("shape",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},xref:o({},n.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},yref:o({},n.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:o({},a.color,{editType:"arraydraw"}),width:o({},a.width,{editType:"calc+arraydraw"}),dash:o({},i,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},editType:"arraydraw"})},{"../../lib/extend":162,"../../plot_api/plot_template":202,"../../traces/scatter/attributes":367,"../annotations/attributes":36,"../drawing/attributes":71}],128:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("./constants"),o=t("./helpers");function l(t){return c(t.line.width,t.xsizemode,t.x0,t.x1,t.path,!1)}function s(t){return c(t.line.width,t.ysizemode,t.y0,t.y1,t.path,!0)}function c(t,e,r,a,l,s){var c=t/2,u=s;if("pixel"===e){var f=l?o.extractPathCoords(l,s?i.paramIsY:i.paramIsX):[r,a],d=n.aggNums(Math.max,null,f),p=n.aggNums(Math.min,null,f),h=p<0?Math.abs(p)+c:c,g=d>0?d+c:c;return{ppad:c,ppadplus:u?h:g,ppadminus:u?g:h}}return{ppad:c}}function u(t,e,r,n,a){var l="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[l(e),l(r)];if(n){var s,c,u,f,d=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===t.type&&(l=o.decodeDate(l)),s=0;s<h.length;s++)void 0!==(c=a[h[s].charAt(0)].drawn)&&(!(u=h[s].substr(1).match(i.paramRE))||u.length<c||((f=l(u[c]))<d&&(d=f),f>p&&(p=f)));return p>=d?[d,p]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;o<r.length;o++){var c,f,d=r[o];if(d._extremes={},"paper"!==d.xref){var p="pixel"===d.xsizemode?d.xanchor:d.x0,h="pixel"===d.xsizemode?d.xanchor:d.x1;(f=u(c=a.getFromId(t,d.xref),p,h,d.path,i.paramIsX))&&(d._extremes[c._id]=a.findExtremes(c,f,l(d)))}if("paper"!==d.yref){var g="pixel"===d.ysizemode?d.yanchor:d.y0,v="pixel"===d.ysizemode?d.yanchor:d.y1;(f=u(c=a.getFromId(t,d.yref),g,v,d.path,i.paramIsY))&&(d._extremes[c._id]=a.findExtremes(c,f,s(d)))}}}},{"../../lib":168,"../../plots/cartesian/axes":212,"./constants":129,"./helpers":132}],129:[function(t,e,r){"use strict";e.exports={segmentRE:/[MLHVQCTSZ][^MLHVQCTSZ]*/g,paramRE:/[^\s,]+/g,paramIsX:{M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},paramIsY:{M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},numParams:{M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0}}},{}],130:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../../plots/array_container_defaults"),o=t("./attributes"),l=t("./helpers");function s(t,e,r){function i(r,a){return n.coerce(t,e,o,r,a)}if(i("visible")){i("layer"),i("opacity"),i("fillcolor"),i("line.color"),i("line.width"),i("line.dash");for(var s=i("type",t.path?"path":"rect"),c=i("xsizemode"),u=i("ysizemode"),f=["x","y"],d=0;d<2;d++){var p,h,g,v=f[d],y=v+"anchor",m="x"===v?c:u,x={_fullLayout:r},b=a.coerceRef(t,e,x,v,"","paper");if("paper"!==b?((p=a.getFromId(x,b))._shapeIndices.push(e._index),g=l.rangeToShapePosition(p),h=l.shapePositionToRange(p)):h=g=n.identity,"path"!==s){var _=v+"0",w=v+"1",k=t[_],T=t[w];t[_]=h(t[_],!0),t[w]=h(t[w],!0),"pixel"===m?(i(_,0),i(w,10)):(a.coercePosition(e,x,i,b,_,.25),a.coercePosition(e,x,i,b,w,.75)),e[_]=g(e[_]),e[w]=g(e[w]),t[_]=k,t[w]=T}if("pixel"===m){var M=t[y];t[y]=h(t[y],!0),a.coercePosition(e,x,i,b,y,.25),e[y]=g(e[y]),t[y]=M}}"path"===s?i("path"):n.noneOrAll(t,e,["x0","x1","y0","y1"])}}e.exports=function(t,e){i(t,e,{name:"shapes",handleItemDefaults:s})}},{"../../lib":168,"../../plots/array_container_defaults":208,"../../plots/cartesian/axes":212,"./attributes":127,"./helpers":132}],131:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=t("../color"),l=t("../drawing"),s=t("../../plot_api/plot_template").arrayEditor,c=t("../dragelement"),u=t("../../lib/setcursor"),f=t("./constants"),d=t("./helpers");function p(t,e){t._fullLayout._paperdiv.selectAll('.shapelayer [data-index="'+e+'"]').remove();var r=t._fullLayout.shapes[e]||{};if(r._input&&!1!==r.visible)if("below"!==r.layer)y(t._fullLayout._shapeUpperLayer);else if("paper"===r.xref||"paper"===r.yref)y(t._fullLayout._shapeLowerLayer);else{var p=t._fullLayout._plots[r.xref+r.yref];if(p)y((p.mainplotinfo||p).shapelayer);else y(t._fullLayout._shapeLowerLayer)}function y(p){var y={"data-index":e,"fill-rule":"evenodd",d:g(t,r)},m=r.line.width?r.line.color:"rgba(0,0,0,0)",x=p.append("path").attr(y).style("opacity",r.opacity).call(o.stroke,m).call(o.fill,r.fillcolor).call(l.dashLine,r.line.dash,r.line.width);h(x,t,r),t._context.edits.shapePosition&&function(t,e,r,o,p){var y,m,x,b,_,w,k,T,M,A,L,S,C,O,z,D,P=10,E=10,R="pixel"===r.xsizemode,I="pixel"===r.ysizemode,F="line"===r.type,N="path"===r.type,B=s(t.layout,"shapes",r),j=B.modifyItem,H=i.getFromId(t,r.xref),q=i.getFromId(t,r.yref),V=d.getDataToPixel(t,H),U=d.getDataToPixel(t,q,!0),G=d.getPixelToData(t,H),Z=d.getPixelToData(t,q,!0),X=F?function(){var t=Math.max(r.line.width,10),n=p.append("g").attr("data-index",o);n.append("path").attr("d",e.attr("d")).style({cursor:"move","stroke-width":t,"stroke-opacity":"0"});var a={"fill-opacity":"0"},i=t/2>10?t/2:10;return n.append("circle").attr({"data-line-point":"start-point",cx:R?V(r.xanchor)+r.x0:V(r.x0),cy:I?U(r.yanchor)-r.y0:U(r.y0),r:i}).style(a).classed("cursor-grab",!0),n.append("circle").attr({"data-line-point":"end-point",cx:R?V(r.xanchor)+r.x1:V(r.x1),cy:I?U(r.yanchor)-r.y1:U(r.y1),r:i}).style(a).classed("cursor-grab",!0),n}():e,Y={element:X.node(),gd:t,prepFn:function(n){R&&(_=V(r.xanchor));I&&(w=U(r.yanchor));"path"===r.type?z=r.path:(y=R?r.x0:V(r.x0),m=I?r.y0:U(r.y0),x=R?r.x1:V(r.x1),b=I?r.y1:U(r.y1));y<x?(M=y,C="x0",A=x,O="x1"):(M=x,C="x1",A=y,O="x0");!I&&m<b||I&&m>b?(k=m,L="y0",T=b,S="y1"):(k=b,L="y1",T=m,S="y0");W(n),Q(p,r),function(t,e,r){var n=e.xref,a=e.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(t,c?"clip"+r._fullLayout._uid+c:null,r)}(e,r,t),Y.moveFn="move"===D?J:$},doneFn:function(){u(e),K(p),h(e,t,r),n.call("_guiRelayout",t,B.getUpdateObj())},clickFn:function(){K(p)}};function W(t){if(F)D="path"===t.target.tagName?"move":"start-point"===t.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var r=Y.element.getBoundingClientRect(),n=r.right-r.left,a=r.bottom-r.top,i=t.clientX-r.left,o=t.clientY-r.top,l=!N&&n>P&&a>E&&!t.shiftKey?c.getCursor(i/n,1-o/a):"move";u(e,l),D=l.split("-")[0]}}function J(n,a){if("path"===r.type){var i=function(t){return t},o=i,l=i;R?j("xanchor",r.xanchor=G(_+n)):(o=function(t){return G(V(t)+n)},H&&"date"===H.type&&(o=d.encodeDate(o))),I?j("yanchor",r.yanchor=Z(w+a)):(l=function(t){return Z(U(t)+a)},q&&"date"===q.type&&(l=d.encodeDate(l))),j("path",r.path=v(z,o,l))}else R?j("xanchor",r.xanchor=G(_+n)):(j("x0",r.x0=G(y+n)),j("x1",r.x1=G(x+n))),I?j("yanchor",r.yanchor=Z(w+a)):(j("y0",r.y0=Z(m+a)),j("y1",r.y1=Z(b+a)));e.attr("d",g(t,r)),Q(p,r)}function $(n,a){if(N){var i=function(t){return t},o=i,l=i;R?j("xanchor",r.xanchor=G(_+n)):(o=function(t){return G(V(t)+n)},H&&"date"===H.type&&(o=d.encodeDate(o))),I?j("yanchor",r.yanchor=Z(w+a)):(l=function(t){return Z(U(t)+a)},q&&"date"===q.type&&(l=d.encodeDate(l))),j("path",r.path=v(z,o,l))}else if(F){if("resize-over-start-point"===D){var s=y+n,c=I?m-a:m+a;j("x0",r.x0=R?s:G(s)),j("y0",r.y0=I?c:Z(c))}else if("resize-over-end-point"===D){var u=x+n,f=I?b-a:b+a;j("x1",r.x1=R?u:G(u)),j("y1",r.y1=I?f:Z(f))}}else{var h=~D.indexOf("n")?k+a:k,B=~D.indexOf("s")?T+a:T,X=~D.indexOf("w")?M+n:M,Y=~D.indexOf("e")?A+n:A;~D.indexOf("n")&&I&&(h=k-a),~D.indexOf("s")&&I&&(B=T-a),(!I&&B-h>E||I&&h-B>E)&&(j(L,r[L]=I?h:Z(h)),j(S,r[S]=I?B:Z(B))),Y-X>P&&(j(C,r[C]=R?X:G(X)),j(O,r[O]=R?Y:G(Y)))}e.attr("d",g(t,r)),Q(p,r)}function Q(t,e){(R||I)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=V(R?e.xanchor:a.midRange(r?[e.x0,e.x1]:d.extractPathCoords(e.path,f.paramIsX))),o=U(I?e.yanchor:a.midRange(r?[e.y0,e.y1]:d.extractPathCoords(e.path,f.paramIsY)));if(i=d.roundPositionForSharpStrokeRendering(i,1),o=d.roundPositionForSharpStrokeRendering(o,1),R&&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(R){var s="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",s)}else{var c="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function K(t){t.selectAll(".visual-cue").remove()}c.init(Y),X.node().onmousemove=W}(t,x,r,e,p)}}function h(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"");l.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function g(t,e){var r,n,o,l,s,c,u,p,h=e.type,g=i.getFromId(t,e.xref),v=i.getFromId(t,e.yref),y=t._fullLayout._size;if(g?(r=d.shapePositionToRange(g),n=function(t){return g._offset+g.r2p(r(t,!0))}):n=function(t){return y.l+y.w*t},v?(o=d.shapePositionToRange(v),l=function(t){return v._offset+v.r2p(o(t,!0))}):l=function(t){return y.t+y.h*(1-t)},"path"===h)return g&&"date"===g.type&&(n=d.decodeDate(n)),v&&"date"===v.type&&(l=d.decodeDate(l)),function(t,e,r){var n=t.path,i=t.xsizemode,o=t.ysizemode,l=t.xanchor,s=t.yanchor;return n.replace(f.segmentRE,function(t){var n=0,c=t.charAt(0),u=f.paramIsX[c],d=f.paramIsY[c],p=f.numParams[c],h=t.substr(1).replace(f.paramRE,function(t){return u[n]?t="pixel"===i?e(l)+Number(t):e(t):d[n]&&(t="pixel"===o?r(s)-Number(t):r(t)),++n>p&&(t="X"),t});return n>p&&(h=h.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+t)),c+h})}(e,n,l);if("pixel"===e.xsizemode){var m=n(e.xanchor);s=m+e.x0,c=m+e.x1}else s=n(e.x0),c=n(e.x1);if("pixel"===e.ysizemode){var x=l(e.yanchor);u=x-e.y0,p=x-e.y1}else u=l(e.y0),p=l(e.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),T="A"+w+","+k,M=b+w+","+_;return"M"+M+T+" 0 1,1 "+(b+","+(_-k))+T+" 0 0,1 "+M+"Z"}function v(t,e,r){return t.replace(f.segmentRE,function(t){var n=0,a=t.charAt(0),i=f.paramIsX[a],o=f.paramIsY[a],l=f.numParams[a];return a+t.substr(1).replace(f.paramRE,function(t){return n>=l?t:(i[n]?t=e(t):o[n]&&(t=r(t)),n++,t)})})}e.exports={draw:function(t){var e=t._fullLayout;for(var r in e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._plots){var n=e._plots[r].shapelayer;n&&n.selectAll("path").remove()}for(var a=0;a<e.shapes.length;a++)e.shapes[a].visible&&p(t,a)},drawOne:p}},{"../../lib":168,"../../lib/setcursor":187,"../../plot_api/plot_template":202,"../../plots/cartesian/axes":212,"../../registry":257,"../color":51,"../dragelement":69,"../drawing":72,"./constants":129,"./helpers":132}],132:[function(t,e,r){"use strict";var n=t("./constants"),a=t("../../lib");r.rangeToShapePosition=function(t){return"log"===t.type?t.r2d:function(t){return t}},r.shapePositionToRange=function(t){return"log"===t.type?t.d2r:function(t){return t}},r.decodeDate=function(t){return function(e){return e.replace&&(e=e.replace("_"," ")),t(e)}},r.encodeDate=function(t){return function(e){return t(e).replace(" ","_")}},r.extractPathCoords=function(t,e){var r=[];return t.match(n.segmentRE).forEach(function(t){var i=e[t.charAt(0)].drawn;if(void 0!==i){var o=t.substr(1).match(n.paramRE);!o||o.length<i||r.push(a.cleanNumber(o[i]))}}),r},r.getDataToPixel=function(t,e,n){var a,i=t._fullLayout._size;if(e){var o=r.shapePositionToRange(e);a=function(t){return e._offset+e.r2p(o(t,!0))},"date"===e.type&&(a=r.decodeDate(a))}else a=n?function(t){return i.t+i.h*(1-t)}:function(t){return i.l+i.w*t};return a},r.getPixelToData=function(t,e,n){var a,i=t._fullLayout._size;if(e){var o=r.rangeToShapePosition(e);a=function(t){return o(e.p2r(t-e._offset))}}else a=n?function(t){return 1-(t-i.t)/i.h}:function(t){return(t-i.l)/i.w};return a},r.roundPositionForSharpStrokeRendering=function(t,e){var r=1===Math.round(e%2),n=Math.round(t);return r?n+.5:n}},{"../../lib":168,"./constants":129}],133:[function(t,e,r){"use strict";var n=t("./draw");e.exports={moduleType:"component",name:"shapes",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),includeBasePlot:t("../../plots/cartesian/include_components")("shapes"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne}},{"../../plots/cartesian/include_components":223,"./attributes":127,"./calc_autorange":128,"./defaults":130,"./draw":131}],134:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../../plots/pad_attributes"),i=t("../../lib/extend").extendDeepAll,o=t("../../plot_api/edit_types").overrideAll,l=t("../../plots/animation_attributes"),s=t("../../plot_api/plot_template").templatedArray,c=t("./constants"),u=s("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});e.exports=o(s("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:u,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:i(a({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:l.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:n({})},font:n({}),activebgcolor:{valType:"color",dflt:c.gripBgActiveColor},bgcolor:{valType:"color",dflt:c.railBgColor},bordercolor:{valType:"color",dflt:c.railBorderColor},borderwidth:{valType:"number",min:0,dflt:c.railBorderWidth},ticklen:{valType:"number",min:0,dflt:c.tickLength},tickcolor:{valType:"color",dflt:c.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:c.minorTickLength}}),"arraydraw","from-root")},{"../../lib/extend":162,"../../plot_api/edit_types":195,"../../plot_api/plot_template":202,"../../plots/animation_attributes":207,"../../plots/font_attributes":239,"../../plots/pad_attributes":244,"./constants":135}],135:[function(t,e,r){"use strict";e.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],136:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/array_container_defaults"),i=t("./attributes"),o=t("./constants").name,l=i.steps;function s(t,e,r){function o(r,a){return n.coerce(t,e,i,r,a)}for(var l=a(t,e,{name:"steps",handleItemDefaults:c}),s=0,u=0;u<l.length;u++)l[u].visible&&s++;if(s<2?e.visible=!1:o("visible")){e._stepCount=s;var f=e._visibleSteps=n.filterVisible(l);(l[o("active")]||{}).visible||(e.active=f[0]._index),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("len"),o("lenmode"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("currentvalue.visible")&&(o("currentvalue.xanchor"),o("currentvalue.prefix"),o("currentvalue.suffix"),o("currentvalue.offset"),n.coerceFont(o,"currentvalue.font",e.font)),o("transition.duration"),o("transition.easing"),o("bgcolor"),o("activebgcolor"),o("bordercolor"),o("borderwidth"),o("ticklen"),o("tickwidth"),o("tickcolor"),o("minorticklen")}}function c(t,e){function r(r,a){return n.coerce(t,e,l,r,a)}if("skip"===t.method||Array.isArray(t.args)?r("visible"):e.visible=!1){r("method"),r("args");var a=r("label","step-"+e._index);r("value",a),r("execute")}}e.exports=function(t,e){a(t,e,{name:o,handleItemDefaults:s})}},{"../../lib":168,"../../plots/array_container_defaults":208,"./attributes":134,"./constants":135}],137:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plots/plots"),i=t("../color"),o=t("../drawing"),l=t("../../lib"),s=t("../../lib/svg_text_utils"),c=t("../../plot_api/plot_template").arrayEditor,u=t("./constants"),f=t("../../constants/alignment"),d=f.LINE_SPACING,p=f.FROM_TL,h=f.FROM_BR;function g(t){return u.autoMarginIdRoot+t._index}function v(t){return t._index}function y(t,e){var r=o.tester.selectAll("g."+u.labelGroupClass).data(e._visibleSteps);r.enter().append("g").classed(u.labelGroupClass,!0);var i=0,c=0;r.each(function(t){var r=b(n.select(this),{step:t},e).node();if(r){var a=o.bBox(r);c=Math.max(c,a.height),i=Math.max(i,a.width)}}),r.remove();var f=e._dims={};f.inputAreaWidth=Math.max(u.railWidth,u.gripHeight);var d=t._fullLayout._size;f.lx=d.l+d.w*e.x,f.ly=d.t+d.h*(1-e.y),"fraction"===e.lenmode?f.outerLength=Math.round(d.w*e.len):f.outerLength=e.len,f.inputAreaStart=0,f.inputAreaLength=Math.round(f.outerLength-e.pad.l-e.pad.r);var v=(f.inputAreaLength-2*u.stepInset)/(e._stepCount-1),y=i+u.labelPadding;if(f.labelStride=Math.max(1,Math.ceil(y/v)),f.labelHeight=c,f.currentValueMaxWidth=0,f.currentValueHeight=0,f.currentValueTotalHeight=0,f.currentValueMaxLines=1,e.currentvalue.visible){var x=o.tester.append("g");r.each(function(t){var r=m(x,e,t.label),n=r.node()&&o.bBox(r.node())||{width:0,height:0},a=s.lineCount(r);f.currentValueMaxWidth=Math.max(f.currentValueMaxWidth,Math.ceil(n.width)),f.currentValueHeight=Math.max(f.currentValueHeight,Math.ceil(n.height)),f.currentValueMaxLines=Math.max(f.currentValueMaxLines,a)}),f.currentValueTotalHeight=f.currentValueHeight+e.currentvalue.offset,x.remove()}f.height=f.currentValueTotalHeight+u.tickOffset+e.ticklen+u.labelOffset+f.labelHeight+e.pad.t+e.pad.b;var _="left";l.isRightAnchor(e)&&(f.lx-=f.outerLength,_="right"),l.isCenterAnchor(e)&&(f.lx-=f.outerLength/2,_="center");var w="top";l.isBottomAnchor(e)&&(f.ly-=f.height,w="bottom"),l.isMiddleAnchor(e)&&(f.ly-=f.height/2,w="middle"),f.outerLength=Math.ceil(f.outerLength),f.height=Math.ceil(f.height),f.lx=Math.round(f.lx),f.ly=Math.round(f.ly);var k={y:e.y,b:f.height*h[w],t:f.height*p[w]};"fraction"===e.lenmode?(k.l=0,k.xl=e.x-e.len*p[_],k.r=0,k.xr=e.x+e.len*h[_]):(k.x=e.x,k.l=f.outerLength*p[_],k.r=f.outerLength*h[_]),a.autoMargin(t,g(e),k)}function m(t,e,r){if(e.currentvalue.visible){var n,a,i=e._dims;switch(e.currentvalue.xanchor){case"right":n=i.inputAreaLength-u.currentValueInset-i.currentValueMaxWidth,a="left";break;case"center":n=.5*i.inputAreaLength,a="middle";break;default:n=u.currentValueInset,a="left"}var c=l.ensureSingle(t,"text",u.labelClass,function(t){t.classed("user-select-none",!0).attr({"text-anchor":a,"data-notex":1})}),f=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)f+=r;else f+=e.steps[e.active].label;e.currentvalue.suffix&&(f+=e.currentvalue.suffix),c.call(o.font,e.currentvalue.font).text(f).call(s.convertToTspans,e._gd);var p=s.lineCount(c),h=(i.currentValueMaxLines+1-p)*e.currentvalue.font.size*d;return s.positionText(c,n,h),c}}function x(t,e,r){l.ensureSingle(t,"rect",u.gripRectClass,function(n){n.call(T,e,t,r).style("pointer-events","all")}).attr({width:u.gripWidth,height:u.gripHeight,rx:u.gripRadius,ry:u.gripRadius}).call(i.stroke,r.bordercolor).call(i.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function b(t,e,r){var n=l.ensureSingle(t,"text",u.labelClass,function(t){t.classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1})});return n.call(o.font,r.font).text(e.step.label).call(s.convertToTspans,r._gd),n}function _(t,e){var r=l.ensureSingle(t,"g",u.labelsClass),a=e._dims,i=r.selectAll("g."+u.labelGroupClass).data(a.labelSteps);i.enter().append("g").classed(u.labelGroupClass,!0),i.exit().remove(),i.each(function(t){var r=n.select(this);r.call(b,t,e),o.setTranslate(r,L(e,t.fraction),u.tickOffset+e.ticklen+e.font.size*d+u.labelOffset+a.currentValueTotalHeight)})}function w(t,e,r,n,a){var i=Math.round(n*(r._stepCount-1)),o=r._visibleSteps[i]._index;o!==r.active&&k(t,e,r,o,!0,a)}function k(t,e,r,n,i,o){var l=r.active;r.active=n,c(t.layout,u.name,r).applyUpdate("active",n);var s=r.steps[r.active];e.call(A,r,o),e.call(m,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:i,previousActive:l}),s&&s.method&&i&&(e._nextMethod?(e._nextMethod.step=s,e._nextMethod.doCallback=i,e._nextMethod.doTransition=o):(e._nextMethod={step:s,doCallback:i,doTransition:o},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(r.execute&&a.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function T(t,e,r){var a=r.node(),o=n.select(e);function l(){return r.data()[0]}t.on("mousedown",function(){var t=l();e.emit("plotly_sliderstart",{slider:t});var s=r.select("."+u.gripRectClass);n.event.stopPropagation(),n.event.preventDefault(),s.call(i.fill,t.activebgcolor);var c=S(t,n.mouse(a)[0]);w(e,r,t,c,!0),t._dragging=!0,o.on("mousemove",function(){var t=l(),i=S(t,n.mouse(a)[0]);w(e,r,t,i,!1)}),o.on("mouseup",function(){var t=l();t._dragging=!1,s.call(i.fill,t.bgcolor),o.on("mouseup",null),o.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function M(t,e){var r=t.selectAll("rect."+u.tickRectClass).data(e._visibleSteps),a=e._dims;r.enter().append("rect").classed(u.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each(function(t,r){var l=r%a.labelStride==0,s=n.select(this);s.attr({height:l?e.ticklen:e.minorticklen}).call(i.fill,e.tickcolor),o.setTranslate(s,L(e,r/(e._stepCount-1))-.5*e.tickwidth,(l?u.tickOffset:u.minorTickOffset)+a.currentValueTotalHeight)})}function A(t,e,r){for(var n=t.select("rect."+u.gripRectClass),a=0,i=0;i<e._stepCount;i++)if(e._visibleSteps[i]._index===e.active){a=i;break}var o=L(e,a/(e._stepCount-1));if(!e._invokingCommand){var l=n;r&&e.transition.duration>0&&(l=l.transition().duration(e.transition.duration).ease(e.transition.easing)),l.attr("transform","translate("+(o-.5*u.gripWidth)+","+e._dims.currentValueTotalHeight+")")}}function L(t,e){var r=t._dims;return r.inputAreaStart+u.stepInset+(r.inputAreaLength-2*u.stepInset)*Math.min(1,Math.max(0,e))}function S(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-u.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*u.stepInset-2*r.inputAreaStart)))}function C(t,e,r){var n=r._dims,a=l.ensureSingle(t,"rect",u.railTouchRectClass,function(n){n.call(T,e,t,r).style("pointer-events","all")});a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,u.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function O(t,e){var r=e._dims,n=r.inputAreaLength-2*u.railInset,a=l.ensureSingle(t,"rect",u.railRectClass);a.attr({width:n,height:u.railWidth,rx:u.railRadius,ry:u.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(a,u.railInset,.5*(r.inputAreaWidth-u.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[u.name],n=[],a=0;a<r.length;a++){var i=r[a];i.visible&&(i._gd=e,n.push(i))}return n}(e,t),i=e._infolayer.selectAll("g."+u.containerClassName).data(r.length>0?[0]:[]);function l(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),a.autoMargin(t,g(e))}if(i.enter().append("g").classed(u.containerClassName,!0).style("cursor","ew-resize"),i.exit().each(function(){n.select(this).selectAll("g."+u.groupClassName).each(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;c<r.length;c++){var f=r[c];y(t,f)}s.each(function(e){var r=n.select(this);!function(t){var e=t._dims;e.labelSteps=[];for(var r=t._stepCount,n=0;n<r;n+=e.labelStride)e.labelSteps.push({fraction:n/(r-1),step:t._visibleSteps[n]})}(e),a.manageCommandObserver(t,e,e._visibleSteps,function(e){var n=r.data()[0];n.active!==e.index&&(n._dragging||k(t,r,n,e.index,!1,!0))}),function(t,e,r){(r.steps[r.active]||{}).visible||(r.active=r._visibleSteps[0]._index);e.call(m,r).call(O,r).call(_,r).call(M,r).call(C,t,r).call(x,t,r);var n=r._dims;o.setTranslate(e,n.lx+r.pad.l,n.ly+r.pad.t),e.call(A,r,!1),e.call(m,r)}(t,n.select(this),e)})}}},{"../../constants/alignment":146,"../../lib":168,"../../lib/svg_text_utils":189,"../../plot_api/plot_template":202,"../../plots/plots":245,"../color":51,"../drawing":72,"./constants":135,d3:16}],138:[function(t,e,r){"use strict";var n=t("./constants");e.exports={moduleType:"component",name:n.name,layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":134,"./constants":135,"./defaults":136,"./draw":137}],139:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../../plots/plots"),o=t("../../registry"),l=t("../../lib"),s=t("../drawing"),c=t("../color"),u=t("../../lib/svg_text_utils"),f=t("../../constants/interactions");e.exports={draw:function(t,e,r){var p,h=r.propContainer,g=r.propName,v=r.placeholder,y=r.traceIndex,m=r.avoid||{},x=r.attributes,b=r.transform,_=r.containerGroup,w=t._fullLayout,k=1,T=!1,M=h.title,A=(M&&M.text?M.text:"").trim(),L=M&&M.font?M.font:{},S=L.family,C=L.size,O=L.color;"title.text"===g?p="titleText":-1!==g.indexOf("axis")?p="axisTitleText":g.indexOf(!0)&&(p="colorbarTitleText");var z=t._context.edits[p];""===A?k=0:A.replace(d," % ")===v.replace(d," % ")&&(k=.2,T=!0,z||(A=""));w.meta&&(A=l.templateString(A,{meta:w.meta}));var D=A||z;_||(_=l.ensureSingle(w._infolayer,"g","g-"+e));var P=_.selectAll("text").data(D?[0]:[]);if(P.enter().append("text"),P.text(A).attr("class",e),P.exit().remove(),!D)return _;function E(t){l.syncOrAsync([R,I],t)}function R(e){var r;return b?(r="",b.rotate&&(r+="rotate("+[b.rotate,x.x,x.y]+")"),b.offset&&(r+="translate(0, "+b.offset+")")):r=null,e.attr("transform",r),e.style({"font-family":S,"font-size":n.round(C,2)+"px",fill:c.rgb(O),opacity:k*c.opacity(O),"font-weight":i.fontWeight}).attr(x).call(u.convertToTspans,t),i.previousPromises(t)}function I(t){var e=n.select(t.node().parentNode);if(m&&m.selection&&m.side&&A){e.attr("transform",null);var r=0,i={left:"right",right:"left",top:"bottom",bottom:"top"}[m.side],o=-1!==["left","top"].indexOf(m.side)?-1:1,c=a(m.pad)?m.pad:2,u=s.bBox(e.node()),f={left:0,top:0,right:w.width,bottom:w.height},d=m.maxShift||(f[m.side]-u[m.side])*("left"===m.side||"top"===m.side?-1:1);if(d<0)r=d;else{var p=m.offsetLeft||0,h=m.offsetTop||0;u.left-=p,u.right-=p,u.top-=h,u.bottom-=h,m.selection.each(function(){var t=s.bBox(this);l.bBoxIntersect(u,t,c)&&(r=Math.max(r,o*(t[m.side]-u[i])+c))}),r=Math.min(d,r)}if(r>0||d<0){var g={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[m.side];e.attr("transform","translate("+g+")")}}}P.call(E),z&&(A?P.on(".opacity",null):(k=0,T=!0,P.text(v).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)})),P.call(u.makeEditable,{gd:t}).on("edit",function(e){void 0!==y?o.call("_guiRestyle",t,g,e,y):o.call("_guiRelayout",t,g,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(E)}).on("input",function(t){this.text(t||" ").call(u.positionText,x.x,x.y)}));return P.classed("js-placeholder",T),_}};var d=/ [XY][0-9]* /},{"../../constants/interactions":148,"../../lib":168,"../../lib/svg_text_utils":189,"../../plots/plots":245,"../../registry":257,"../color":51,"../drawing":72,d3:16,"fast-isnumeric":18}],140:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,l=t("../../plots/pad_attributes"),s=t("../../plot_api/plot_template").templatedArray,c=s("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=o(s("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:c,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i(l({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":162,"../../plot_api/edit_types":195,"../../plot_api/plot_template":202,"../../plots/font_attributes":239,"../../plots/pad_attributes":244,"../color/attributes":50}],141:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],142:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/array_container_defaults"),i=t("./attributes"),o=t("./constants").name,l=i.buttons;function s(t,e,r){function o(r,a){return n.coerce(t,e,i,r,a)}o("visible",a(t,e,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(t,e){function r(r,a){return n.coerce(t,e,l,r,a)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("label"),r("execute"))}e.exports=function(t,e){a(t,e,{name:o,handleItemDefaults:s})}},{"../../lib":168,"../../plots/array_container_defaults":208,"./attributes":140,"./constants":141}],143:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plots/plots"),i=t("../color"),o=t("../drawing"),l=t("../../lib"),s=t("../../lib/svg_text_utils"),c=t("../../plot_api/plot_template").arrayEditor,u=t("../../constants/alignment").LINE_SPACING,f=t("./constants"),d=t("./scrollbox");function p(t){return t._index}function h(t,e){return+t.attr(f.menuIndexAttrName)===e._index}function g(t,e,r,n,a,i,o,l){e.active=o,c(t.layout,f.name,e).applyUpdate("active",o),"buttons"===e.type?y(t,n,null,null,e):"dropdown"===e.type&&(a.attr(f.menuIndexAttrName,"-1"),v(t,n,a,i,e),l||y(t,n,a,i,e))}function v(t,e,r,n,a){var i=l.ensureSingle(e,"g",f.headerClassName,function(t){t.style("pointer-events","all")}),s=a._dims,c=a.active,u=a.buttons[c]||f.blankHeaderOpts,d={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:s.headerWidth,height:s.headerHeight};i.call(m,a,u,t).call(A,a,d,p),l.ensureSingle(e,"text",f.headerArrowClassName,function(t){t.classed("user-select-none",!0).attr("text-anchor","end").call(o.font,a.font).text(f.arrowSymbol[a.direction])}).attr({x: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)),y(t,e,r,n,a)}),i.on("mouseover",function(){i.call(w)}),i.on("mouseout",function(){i.call(k,a)}),o.setTranslate(e,s.lx,s.ly)}function y(t,e,r,i,o){r||(r=e).attr("pointer-events","all");var s=function(t){return-1==+t.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,u=r.selectAll("g."+c).data(l.filterVisible(s)),d=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(d.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var h=0,v=0,y=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?v=y.headerHeight+f.gapButtonHeader:h=y.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(v=-f.gapButtonHeader+f.gapButton-y.openHeight),"dropdown"===o.type&&"left"===o.direction&&(h=-f.gapButtonHeader+f.gapButton-y.openWidth);var b={x:y.lx+h+o.pad.l,y:y.ly+v+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},T={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each(function(l,s){var c=n.select(this);c.call(m,o,l,t).call(A,o,b),c.on("click",function(){n.event.defaultPrevented||(g(t,o,0,e,r,i,s),l.execute&&a.executeAPICommand(t,l.method,l.args),t.emit("plotly_buttonclicked",{menu:o,button:l,active:o.active}))}),c.on("mouseover",function(){c.call(w)}),c.on("mouseout",function(){c.call(k,o),u.call(_,o)})}),u.call(_,o),x?(T.w=Math.max(y.openWidth,y.headerWidth),T.h=b.y-T.t):(T.w=b.x-T.l,T.h=Math.max(y.openHeight,y.headerHeight)),T.direction=o.direction,i&&(u.size()?function(t,e,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,d=a._dims,p=a.active;if(u)for(l=0,s=0;s<p;s++)l+=d.heights[s]+f.gapButton;else for(o=0,s=0;s<p;s++)o+=d.widths[s]+f.gapButton;n.enable(i,o,l),n.hbar&&n.hbar.attr("opacity","0").transition().attr("opacity","1");n.vbar&&n.vbar.attr("opacity","0").transition().attr("opacity","1")}(0,0,0,i,o,T):function(t){var e=!!t.hbar,r=!!t.vbar;e&&t.hbar.transition().attr("opacity","0").each("end",function(){e=!1,r||t.disable()});r&&t.vbar.transition().attr("opacity","0").each("end",function(){r=!1,e||t.disable()})}(i))}function m(t,e,r,n){t.call(x,e).call(b,e,r,n)}function x(t,e){l.ensureSingle(t,"rect",f.itemRectClassName,function(t){t.attr({rx:f.rx,ry:f.ry,"shape-rendering":"crispEdges"})}).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px")}function b(t,e,r,n){l.ensureSingle(t,"text",f.itemTextClassName,function(t){t.classed("user-select-none",!0).attr({"text-anchor":"start","data-notex":1})}).call(o.font,e.font).text(r.label).call(s.convertToTspans,n)}function _(t,e){var r=e.active;t.each(function(t,a){var o=n.select(this);a===r&&e.showactive&&o.select("rect."+f.itemRectClassName).call(i.fill,f.activeColor)})}function w(t){t.select("rect."+f.itemRectClassName).call(i.fill,f.hoverColor)}function k(t,e){t.select("rect."+f.itemRectClassName).call(i.fill,e.bgcolor)}function T(t,e){var r=e._dims={width1:0,height1:0,heights:[],widths:[],totalWidth:0,totalHeight:0,openWidth:0,openHeight:0,lx:0,ly:0},i=o.tester.selectAll("g."+f.dropdownButtonClassName).data(l.filterVisible(e.buttons));i.enter().append("g").classed(f.dropdownButtonClassName,!0);var c=-1!==["up","down"].indexOf(e.direction);i.each(function(a,i){var l=n.select(this);l.call(m,e,a,t);var d=l.select("."+f.itemTextClassName),p=d.node()&&o.bBox(d.node()).width,h=Math.max(p+f.textPadX,f.minWidth),g=e.font.size*u,v=s.lineCount(d),y=Math.max(g*v,f.minHeight)+f.textOffsetY;y=Math.ceil(y),h=Math.ceil(h),r.widths[i]=h,r.heights[i]=y,r.height1=Math.max(r.height1,y),r.width1=Math.max(r.width1,h),c?(r.totalWidth=Math.max(r.totalWidth,h),r.openWidth=r.totalWidth,r.totalHeight+=y+f.gapButton,r.openHeight+=y+f.gapButton):(r.totalWidth+=h+f.gapButton,r.openWidth+=h+f.gapButton,r.totalHeight=Math.max(r.totalHeight,y),r.openHeight=r.totalHeight)}),c?r.totalHeight-=f.gapButton:r.totalWidth-=f.gapButton,r.headerWidth=r.width1+f.arrowPadX,r.headerHeight=r.height1,"dropdown"===e.type&&(c?(r.width1+=f.arrowPadX,r.totalHeight=r.height1):r.totalWidth=r.width1,r.totalWidth+=f.arrowPadX),i.remove();var d=r.totalWidth+e.pad.l+e.pad.r,p=r.totalHeight+e.pad.t+e.pad.b,h=t._fullLayout._size;r.lx=h.l+h.w*e.x,r.ly=h.t+h.h*(1-e.y);var g="left";l.isRightAnchor(e)&&(r.lx-=d,g="right"),l.isCenterAnchor(e)&&(r.lx-=d/2,g="center");var v="top";l.isBottomAnchor(e)&&(r.ly-=p,v="bottom"),l.isMiddleAnchor(e)&&(r.ly-=p/2,v="middle"),r.totalWidth=Math.ceil(r.totalWidth),r.totalHeight=Math.ceil(r.totalHeight),r.lx=Math.round(r.lx),r.ly=Math.round(r.ly),a.autoMargin(t,M(e),{x:e.x,y:e.y,l:d*({right:1,center:.5}[g]||0),r:d*({left:1,center:.5}[g]||0),b:p*({top:1,middle:.5}[v]||0),t:p*({bottom:1,middle:.5}[v]||0)})}function M(t){return f.autoMarginIdRoot+t._index}function A(t,e,r,n){n=n||{};var a=t.select("."+f.itemRectClassName),i=t.select("."+f.itemTextClassName),l=e.borderwidth,c=r.index,d=e._dims;o.setTranslate(t,l+r.x,l+r.y);var p=-1!==["up","down"].indexOf(e.direction),h=n.height||(p?d.heights[c]:d.height1);a.attr({x:0,y:0,width:n.width||(p?d.width1:d.widths[c]),height:h});var g=e.font.size*u,v=(s.lineCount(i)-1)*g/2;s.positionText(i,f.textOffsetX,h/2-v+f.textOffsetY),p?r.y+=d.heights[c]+r.yPad:r.x+=d.widths[c]+r.xPad,r.index++}function L(t,e){t.attr(f.menuIndexAttrName,e||"-1").selectAll("g."+f.dropdownButtonClassName).remove()}e.exports=function(t){var e=t._fullLayout,r=l.filterVisible(e[f.name]);function i(e){a.autoMargin(t,M(e))}var o=e._menulayer.selectAll("g."+f.containerClassName).data(r.length>0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each(function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(i)}).remove(),0!==r.length){var s=o.selectAll("g."+f.headerGroupClassName).data(r,p);s.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=l.ensureSingle(o,"g",f.dropdownButtonGroupClassName,function(t){t.style("pointer-events","all")}),u=0;u<r.length;u++){var m=r[u];T(t,m)}var x="updatemenus"+e._uid,b=new d(t,c,x);s.enter().size()&&(c.node().parentNode.appendChild(c.node()),c.call(L)),s.exit().each(function(t){c.call(L),i(t)}).remove(),s.each(function(e){var r=n.select(this),i="dropdown"===e.type?c:null;a.manageCommandObserver(t,e,e.buttons,function(n){g(t,e,e.buttons[n.index],r,i,b,n.index,!0)}),"dropdown"===e.type?(v(t,r,c,b,e),h(c,e)&&y(t,r,c,b,e)):y(t,r,null,null,e)})}}},{"../../constants/alignment":146,"../../lib":168,"../../lib/svg_text_utils":189,"../../plot_api/plot_template":202,"../../plots/plots":245,"../color":51,"../drawing":72,"./constants":141,"./scrollbox":145,d3:16}],144:[function(t,e,r){arguments[4][138][0].apply(r,arguments)},{"./attributes":140,"./constants":141,"./defaults":142,"./draw":143,dup:138}],145:[function(t,e,r){"use strict";e.exports=l;var n=t("d3"),a=t("../color"),i=t("../drawing"),o=t("../../lib");function l(t,e,r){this.gd=t,this.container=e,this.id=r,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}l.barWidth=2,l.barLength=20,l.barRadius=2,l.barPad=1,l.barColor="#808BA4",l.prototype.enable=function(t,e,r){var o=this.gd._fullLayout,s=o.width,c=o.height;this.position=t;var u,f,d,p,h=this.position.l,g=this.position.w,v=this.position.t,y=this.position.h,m=this.position.direction,x="down"===m,b="left"===m,_="up"===m,w=g,k=y;x||b||"right"===m||_||(this.position.direction="down",x=!0),x||_?(f=(u=h)+w,x?(d=v,k=(p=Math.min(d+k,c))-d):k=(p=v+k)-(d=Math.max(p-k,0))):(p=(d=v)+k,b?w=(f=h+w)-(u=Math.max(f-w,0)):(u=h,w=(f=Math.min(u+w,s))-u)),this._box={l:u,t:d,w:w,h:k};var T=g>w,M=l.barLength+2*l.barPad,A=l.barWidth+2*l.barPad,L=h,S=v+y;S+A>c&&(S=c-A);var C=this.container.selectAll("rect.scrollbar-horizontal").data(T?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,l.barColor),T?(this.hbar=C.attr({rx:l.barRadius,ry:l.barRadius,x:L,y:S,width:M,height:A}),this._hbarXMin=L+M/2,this._hbarTranslateMax=w-M):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var O=y>k,z=l.barWidth+2*l.barPad,D=l.barLength+2*l.barPad,P=h+g,E=v;P+z>s&&(P=s-z);var R=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);R.exit().on(".drag",null).remove(),R.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),O?(this.vbar=R.attr({rx:l.barRadius,ry:l.barRadius,x:P,y:E,width:z,height:D}),this._vbarYMin=E+D/2,this._vbarTranslateMax=k-D):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var I=this.id,F=u-.5,N=O?f+z+.5:f+.5,B=d-.5,j=T?p+A+.5:p+.5,H=o._topdefs.selectAll("#"+I).data(T||O?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",I).append("rect"),T||O?(this._clipRect=H.select("rect").attr({x:Math.floor(F),y:Math.floor(B),width:Math.ceil(N)-Math.floor(F),height:Math.ceil(j)-Math.floor(B)}),this.container.call(i.setClipUrl,I,this.gd),this.bg.attr({x:h,y:v,width:g,height:y})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),T||O){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 V=n.behavior.drag().on("dragstart",function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));T&&this.hbar.on(".drag",null).call(V),O&&this.vbar.on(".drag",null).call(V)}this.setTranslate(e,r)},l.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},l.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},l.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},l.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,a=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=e+this._vbarYMin,l=i+this._vbarTranslateMax;e=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(t,e)},l.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(i.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var a=t/r;this.hbar.call(i.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var l=e/n;this.vbar.call(i.setTranslate,t,e+l*this._vbarTranslateMax)}}},{"../../lib":168,"../color":51,"../drawing":72,d3:16}],146:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],147:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],148:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300,DESELECTDIM:.2}},{}],149:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],150:[function(t,e,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],151:[function(t,e,r){"use strict";r.version="1.44.4",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config")();for(var n=t("./registry"),a=r.register=n.register,i=t("./plot_api"),o=Object.keys(i),l=0;l<o.length;l++){var s=o[l];"_"!==s.charAt(0)&&(r[s]=i[s]),a({moduleType:"apiMethod",name:s,fn:i[s]})}a(t("./traces/scatter")),a([t("./components/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector"),t("./components/grid"),t("./components/errorbars"),t("./components/colorscale")]),a([t("./locale-en"),t("./locale-en-us")]),r.Icons=t("../build/ploticon"),r.Plots=t("./plots/plots"),r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":44,"./components/annotations3d":49,"./components/colorscale":63,"./components/errorbars":78,"./components/fx":90,"./components/grid":94,"./components/images":99,"./components/legend":107,"./components/rangeselector":118,"./components/rangeslider":125,"./components/shapes":133,"./components/sliders":138,"./components/updatemenus":144,"./fonts/mathjax_config":152,"./lib/queue":182,"./locale-en":193,"./locale-en-us":192,"./plot_api":197,"./plot_api/plot_schema":201,"./plots/plots":245,"./registry":257,"./snapshot":262,"./traces/scatter":379,d3:16,"es6-promise":17}],152:[function(t,e,r){"use strict";e.exports=function(){"undefined"!=typeof MathJax&&("local"!==(window.PlotlyConfig||{}).MathJaxConfig&&(MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()))}},{}],153:[function(t,e,r){"use strict";r.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}},{}],154:[function(t,e,r){"use strict";var n=t("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,l=2*o;function s(t){return Math.abs(t[1]-t[0])>l-1e-15}function c(t,e){return i(e-t,l)}function u(t,e){if(s(e))return!0;var r,n;e[0]<e[1]?(r=e[0],n=e[1]):(r=e[1],n=e[0]),(r=a(r,l))>(n=a(n,l))&&(n+=l);var i=a(t,l),o=i+l;return i>=r&&i<=n||o>=r&&o<=n}function f(t,e,r,n,a,i,c){a=a||0,i=i||0;var u,f,d,p,h,g=s([r,n]);function v(t,e){return[t*Math.cos(e)+a,i-t*Math.sin(e)]}g?(u=0,f=o,d=l):r<n?(u=r,d=n):(u=n,d=r),t<e?(p=t,h=e):(p=e,h=t);var y,m=Math.abs(d-u)<=o?0:1;function x(t,e,r){return"A"+[t,t]+" "+[0,m,r]+" "+v(t,e)}return g?y=null===p?"M"+v(h,u)+x(h,f,0)+x(h,d,0)+"Z":"M"+v(p,u)+x(p,f,0)+x(p,d,0)+"ZM"+v(h,u)+x(h,f,1)+x(h,d,1)+"Z":null===p?(y="M"+v(h,u)+x(h,d,0),c&&(y+="L0,0Z")):y="M"+v(p,u)+"L"+v(h,u)+x(h,d,0)+"L"+v(p,d)+x(p,u,1)+"Z",y}e.exports={deg2rad:function(t){return t/180*o},rad2deg:function(t){return t/o*180},angleDelta:c,angleDist:function(t,e){return Math.abs(c(t,e))},isFullCircle:s,isAngleInsideSector:u,isPtInsideSector:function(t,e,r,n){return!!u(e,n)&&(r[0]<r[1]?(a=r[0],i=r[1]):(a=r[1],i=r[0]),t>=a&&t<=i);var a,i},pathArc:function(t,e,r,n,a){return f(null,t,e,r,n,a,0)},pathSector:function(t,e,r,n,a){return f(null,t,e,r,n,a,1)},pathAnnulus:function(t,e,r,n,a,i){return f(t,e,r,n,a,i,1)}}},{"./mod":175}],155:[function(t,e,r){"use strict";var n=Array.isArray,a="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},i="undefined"==typeof DataView?function(){}:DataView;function o(t){return a.isView(t)&&!(t instanceof i)}function l(t){return n(t)||o(t)}function s(t,e,r){if(l(t)){if(l(t[0])){for(var n=r,a=0;a<t.length;a++)n=e(n,t[a].length);return n}return t.length}return 0}r.isTypedArray=o,r.isArrayOrTypedArray=l,r.isArray1D=function(t){return!l(t[0])},r.ensureArray=function(t,e){return n(t)||(t=[]),t.length=e,t},r.concat=function(){var t,e,r,a,i,o,l,s,c=[],u=!0,f=0;for(r=0;r<arguments.length;r++)(o=(a=arguments[r]).length)&&(e?c.push(a):(e=a,i=o),n(a)?t=!1:(u=!1,f?t!==a.constructor&&(t=!1):t=a.constructor),f+=o);if(!f)return[];if(!c.length)return e;if(u)return e.concat.apply(e,c);if(t){for((l=new t(f)).set(e),r=0;r<c.length;r++)a=c[r],l.set(a,i),i+=a.length;return l}for(l=new Array(f),s=0;s<e.length;s++)l[s]=e[s];for(r=0;r<c.length;r++){for(a=c[r],s=0;s<a.length;s++)l[i+s]=a[s];i+=s}return l},r.maxRowLength=function(t){return s(t,Math.max,0)},r.minRowLength=function(t){return s(t,Math.min,1/0)}},{}],156:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../constants/numerical").BADNUM,i=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(i,"")),n(t)?Number(t):a}},{"../constants/numerical":149,"fast-isnumeric":18}],157:[function(t,e,r){"use strict";e.exports=function(t){var e=t._fullLayout;e._glcanvas&&e._glcanvas.size()&&e._glcanvas.each(function(t){t.regl&&t.regl.clear({color:!0,depth:!0})})}},{}],158:[function(t,e,r){"use strict";e.exports=function(t){t._responsiveChartHandler&&(window.removeEventListener("resize",t._responsiveChartHandler),delete t._responsiveChartHandler)}},{}],159:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("tinycolor2"),i=t("../plots/attributes"),o=t("../components/colorscale/scales"),l=t("../constants/interactions").DESELECTDIM,s=t("./nested_property"),c=t("./regex").counter,u=t("./mod").modHalf,f=t("./array").isArrayOrTypedArray;function d(t,e){var n=r.valObjectMeta[e.valType];if(e.arrayOk&&f(t))return!0;if(n.validateFunction)return n.validateFunction(t,e);var a={},i=a,o={set:function(t){i=t}};return n.coerceFunction(t,o,a,e),i!==a}r.valObjectMeta={data_array:{coerceFunction:function(t,e,r){f(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),-1===n.values.indexOf(t)?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;n<r.length;n++){var a=String(r[n]);if("/"===a.charAt(0)&&"/"===a.charAt(a.length-1)){if(new RegExp(a.substr(1,a.length-2)).test(t))return!0}else if(t===r[n])return!0}return!1}},boolean:{coerceFunction:function(t,e,r){!0===t||!1===t?e.set(t):e.set(r)}},number:{coerceFunction:function(t,e,r,a){!n(t)||void 0!==a.min&&t<a.min||void 0!==a.max&&t>a.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,a){t%1||!n(t)||void 0!==a.min&&t<a.min||void 0!==a.max&&t>a.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var a="number"==typeof t;!0!==n.strict&&a?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){a(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every(function(t){return a(t).isValid()})?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o.get(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(u(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var a=n.regex||c(r);"string"==typeof t&&a.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!c(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var a=t.split("+"),i=0;i<a.length;){var o=a[i];-1===n.flags.indexOf(o)||a.indexOf(o)<i?a.splice(i,1):i++}a.length?e.set(a.join("+")):e.set(r)}else e.set(t);else e.set(r)}},any:{coerceFunction:function(t,e,r){void 0===t?e.set(r):e.set(t)}},info_array:{coerceFunction:function(t,e,n,a){function i(t,e,n){var a,i={set:function(t){a=t}};return void 0===n&&(n=e.dflt),r.valObjectMeta[e.valType].coerceFunction(t,i,n,e),a}var o=2===a.dimensions||"1-2"===a.dimensions&&Array.isArray(t)&&Array.isArray(t[0]);if(Array.isArray(t)){var l,s,c,u,f,d,p=a.items,h=[],g=Array.isArray(p),v=g&&o&&Array.isArray(p[0]),y=o&&g&&!v,m=g&&!y?p.length:t.length;if(n=Array.isArray(n)?n:[],o)for(l=0;l<m;l++)for(h[l]=[],c=Array.isArray(t[l])?t[l]:[],f=y?p.length:g?p[l].length:c.length,s=0;s<f;s++)u=y?p[s]:g?p[l][s]:p,void 0!==(d=i(c[s],u,(n[l]||[])[s]))&&(h[l][s]=d);else for(l=0;l<m;l++)void 0!==(d=i(t[l],g?p[l]:p,n[l]))&&(h[l]=d);e.set(h)}else e.set(n)},validateFunction:function(t,e){if(!Array.isArray(t))return!1;var r=e.items,n=Array.isArray(r),a=2===e.dimensions;if(!e.freeLength&&t.length!==r.length)return!1;for(var i=0;i<t.length;i++)if(a){if(!Array.isArray(t[i])||!e.freeLength&&t[i].length!==r[i].length)return!1;for(var o=0;o<t[i].length;o++)if(!d(t[i][o],n?r[i][o]:r))return!1}else if(!d(t[i],n?r[i]:r))return!1;return!0}}},r.coerce=function(t,e,n,a,i){var o=s(n,a).get(),l=s(t,a),c=s(e,a),u=l.get(),p=e._template;if(void 0===u&&p&&(u=s(p,a).get(),p=0),void 0===i&&(i=o.dflt),o.arrayOk&&f(u))return c.set(u),u;var h=r.valObjectMeta[o.valType].coerceFunction;h(u,c,i,o);var g=c.get();return p&&g===i&&!d(u,o)&&(h(u=s(p,a).get(),c,i,o),g=c.get()),g},r.coerce2=function(t,e,n,a,i){var o=s(t,a),l=r.coerce(t,e,n,a,i),c=o.get();return null!=c&&l},r.coerceFont=function(t,e,r){var n={};return r=r||{},n.family=t(e+".family",r.family),n.size=t(e+".size",r.size),n.color=t(e+".color",r.color),n},r.coerceHoverinfo=function(t,e,n){var a,o=e._module.attributes,l=o.hoverinfo?o:i,s=l.hoverinfo;if(1===n._dataLength){var c="all"===s.dflt?s.flags.slice():s.dflt.split("+");c.splice(c.indexOf("name"),1),a=c.join("+")}return r.coerce(t,e,l,"hoverinfo",a)},r.coerceSelectionMarkerOpacity=function(t,e){if(t.marker){var r,n,a=t.marker.opacity;if(void 0!==a)f(a)||t.selected||t.unselected||(r=a,n=l*a),e("selected.marker.opacity",r),e("unselected.marker.opacity",n)}},r.validate=d},{"../components/colorscale/scales":66,"../constants/interactions":148,"../plots/attributes":209,"./array":155,"./mod":175,"./nested_property":176,"./regex":183,"fast-isnumeric":18,tinycolor2:34}],160:[function(t,e,r){"use strict";var n,a,i=t("d3"),o=t("fast-isnumeric"),l=t("./loggers"),s=t("./mod").mod,c=t("../constants/numerical"),u=c.BADNUM,f=c.ONEDAY,d=c.ONEHOUR,p=c.ONEMIN,h=c.ONESEC,g=c.EPOCHJD,v=t("../registry"),y=i.time.format.utc,m=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,x=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,b=(new Date).getFullYear()-70;function _(t){return t&&v.componentsRegistry.calendars&&"string"==typeof t&&"gregorian"!==t}function w(t,e){return String(t+Math.pow(10,e)).substr(1)}r.dateTick0=function(t,e){return _(t)?e?v.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:v.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},r.dfltRange=function(t){return _(t)?v.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},r.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime},r.dateTime2ms=function(t,e){if(r.isJSDate(t)){var i=t.getTimezoneOffset()*p,o=(t.getUTCMinutes()-t.getMinutes())*p+(t.getUTCSeconds()-t.getSeconds())*h+(t.getUTCMilliseconds()-t.getMilliseconds());if(o){var l=3*p;i=i-l/2+s(o-i+l/2,l)}return(t=Number(t)-i)>=n&&t<=a?t:u}if("string"!=typeof t&&"number"!=typeof t)return u;t=String(t);var c=_(e),y=t.charAt(0);!c||"G"!==y&&"g"!==y||(t=t.substr(1),e="");var w=c&&"chinese"===e.substr(0,7),k=t.match(w?x:m);if(!k)return u;var T=k[1],M=k[3]||"1",A=Number(k[5]||1),L=Number(k[7]||0),S=Number(k[9]||0),C=Number(k[11]||0);if(c){if(2===T.length)return u;var O;T=Number(T);try{var z=v.getComponentMethod("calendars","getCal")(e);if(w){var D="i"===M.charAt(M.length-1);M=parseInt(M,10),O=z.newDate(T,z.toMonthIndex(T,M,D),A)}else O=z.newDate(T,Number(M),A)}catch(t){return u}return O?(O.toJD()-g)*f+L*d+S*p+C*h:u}T=2===T.length?(Number(T)+2e3-b)%100+b:Number(T),M-=1;var P=new Date(Date.UTC(2e3,M,A,L,S));return P.setUTCFullYear(T),P.getUTCMonth()!==M?u:P.getUTCDate()!==A?u:P.getTime()+C*h},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==u};var k=90*f,T=3*d,M=5*p;function A(t,e,r,n,a){if((e||r||n||a)&&(t+=" "+w(e,2)+":"+w(r,2),(n||a)&&(t+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;t+="."+w(a,i)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=a))return u;e||(e=0);var i,o,l,c,m,x,b=Math.floor(10*s(t+.05,1)),w=Math.round(t-b/10);if(_(r)){var L=Math.floor(w/f)+g,S=Math.floor(s(t,f));try{i=v.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(t){i=y("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e<k?Math.floor(S/d):0,l=e<k?Math.floor(S%d/p):0,c=e<T?Math.floor(S%p/h):0,m=e<M?S%h*10+b:0}else x=new Date(w),i=y("%Y-%m-%d")(x),o=e<k?x.getUTCHours():0,l=e<k?x.getUTCMinutes():0,c=e<T?x.getUTCSeconds():0,m=e<M?10*x.getUTCMilliseconds()+b:0;return A(i,o,l,c,m)},r.ms2DateTimeLocal=function(t){if(!(t>=n+f&&t<=a-f))return u;var e=Math.floor(10*s(t+.05,1)),r=new Date(Math.round(t-e/10));return A(i.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,n){if(t===u)return e;if(r.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(_(n))return l.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return l.error("unrecognized date",t),e;return t};var L=/%\d?f/g;function S(t,e,r,n){t=t.replace(L,function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"});var a=new Date(Math.floor(e+.05));if(_(n))try{t=v.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,a,i){if(a=_(a)&&a,!e)if("y"===r)e=i.year;else if("m"===r)e=i.month;else{if("d"!==r)return function(t,e){var r=s(t+.05,f),n=w(Math.floor(r/d),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==e){o(e)||(e=0);var a=(100+Math.min(s(t/h,60),C[e])).toFixed(e).substr(1);e>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(t,r)+"\n"+S(i.dayMonthYear,t,n,a);e=i.dayMonth+"\n"+i.year}return S(e,t,n,a)};var O=3*f;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=s(t,f);if(t=Math.round(t-n),r)try{var a=Math.round(t/f)+g,i=v.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return e%12?i.add(o,e,"m"):i.add(o,e/12,"y"),(o.toJD()-g)*f+n}catch(e){l.error("invalid ms "+t+" in calendar "+r)}var c=new Date(t+O);return c.setUTCMonth(c.getUTCMonth()+e)+n-O},r.findExactDates=function(t,e){for(var r,n,a=0,i=0,l=0,s=0,c=_(e)&&v.getComponentMethod("calendars","getCal")(e),u=0;u<t.length;u++)if(n=t[u],o(n)){if(!(n%f))if(c)try{1===(r=c.fromJD(n/f+g)).day()?1===r.month()?a++:i++:l++}catch(t){}else 1===(r=new Date(n)).getUTCDate()?0===r.getUTCMonth()?a++:i++:l++}else s++;l+=i+=a;var d=t.length-s;return{exactYears:a/d,exactMonths:i/d,exactDays:l/d}}},{"../constants/numerical":149,"../registry":257,"./loggers":172,"./mod":175,d3:16,"fast-isnumeric":18}],161:[function(t,e,r){"use strict";var n=t("events").EventEmitter,a={init:function(t){if(t._ev instanceof n)return t;var e=new n,r=new n;return t._ev=e,t._internalEv=r,t.on=e.on.bind(e),t.once=e.once.bind(e),t.removeListener=e.removeListener.bind(e),t.removeAllListeners=e.removeAllListeners.bind(e),t._internalOn=r.on.bind(r),t._internalOnce=r.once.bind(r),t._removeInternalListener=r.removeListener.bind(r),t._removeAllInternalListeners=r.removeAllListeners.bind(r),t.emit=function(n,a){"undefined"!=typeof jQuery&&jQuery(t).trigger(n,a),e.emit(n,a),r.emit(n,a)},t},triggerHandler:function(t,e,r){var n,a;"undefined"!=typeof jQuery&&(n=jQuery(t).triggerHandler(e,r));var i=t._ev;if(!i)return n;var o,l=i._events[e];if(!l)return n;function s(t){return t.listener?(i.removeListener(e,t.listener),t.fired?void 0:(t.fired=!0,t.listener.apply(i,[r]))):t.apply(i,[r])}for(l=Array.isArray(l)?l:[l],o=0;o<l.length-1;o++)s(l[o]);return a=s(l[o]),void 0!==n?n:a},purge:function(t){return delete t._ev,delete t.on,delete t.once,delete t.removeListener,delete t.removeAllListeners,delete t.emit,delete t._ev,delete t._internalEv,delete t._internalOn,delete t._internalOnce,delete t._removeInternalListener,delete t._removeAllInternalListeners,t}};e.exports=a},{events:15}],162:[function(t,e,r){"use strict";var n=t("./is_plain_object.js"),a=Array.isArray;function i(t,e,r,o){var l,s,c,u,f,d,p=t[0],h=t.length;if(2===h&&a(p)&&a(t[1])&&0===p.length){if(function(t,e){var r,n;for(r=0;r<t.length;r++){if(null!==(n=t[r])&&"object"==typeof n)return!1;void 0!==n&&(e[r]=n)}return!0}(t[1],p))return p;p.splice(0,p.length)}for(var g=1;g<h;g++)for(s in l=t[g])c=p[s],u=l[s],o&&a(u)?p[s]=u:e&&u&&(n(u)||(f=a(u)))?(f?(f=!1,d=c&&a(c)?c:[]):d=c&&n(c)?c:{},p[s]=i([d,u],e,r,o)):("undefined"!=typeof u||r)&&(p[s]=u);return p}r.extendFlat=function(){return i(arguments,!1,!1,!1)},r.extendDeep=function(){return i(arguments,!0,!1,!1)},r.extendDeepAll=function(){return i(arguments,!0,!0,!1)},r.extendDeepNoArrays=function(){return i(arguments,!0,!1,!0)}},{"./is_plain_object.js":169}],163:[function(t,e,r){"use strict";e.exports=function(t){for(var e={},r=[],n=0,a=0;a<t.length;a++){var i=t[a];1!==e[i]&&(e[i]=1,r[n++]=i)}return r}},{}],164:[function(t,e,r){"use strict";function n(t){return!0===t.visible}function a(t){return!0===t[0].trace.visible}e.exports=function(t){for(var e,r=(e=t,Array.isArray(e)&&Array.isArray(e[0])&&e[0][0]&&e[0][0].trace?a:n),i=[],o=0;o<t.length;o++){var l=t[o];r(l)&&i.push(l)}return i}},{}],165:[function(t,e,r){"use strict";var n,a,i,o=t("./mod").mod;function l(t,e,r,n,a,i,o,l){var s=r-t,c=a-t,u=o-a,f=n-e,d=i-e,p=l-i,h=s*p-u*f;if(0===h)return null;var g=(c*p-u*d)/h,v=(c*f-s*d)/h;return v<0||v>1||g<0||g>1?null:{x:t+s*g,y:e+f*g}}function s(t,e,r,n,a){var i=n*t+a*e;if(i<0)return n*n+a*a;if(i>r){var o=n-t,l=a-e;return o*o+l*l}var s=n*e-a*t;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(t,e,r,n,a,i,o,c){if(l(t,e,r,n,a,i,o,c))return 0;var u=r-t,f=n-e,d=o-a,p=c-i,h=u*u+f*f,g=d*d+p*p,v=Math.min(s(u,f,h,a-t,i-e),s(u,f,h,o-t,c-e),s(d,p,g,t-a,e-i),s(d,p,g,r-a,n-i));return Math.sqrt(v)},r.getTextLocation=function(t,e,r,l){if(t===a&&l===i||(n={},a=t,i=l),n[r])return n[r];var s=t.getPointAtLength(o(r-l/2,e)),c=t.getPointAtLength(o(r+l/2,e)),u=Math.atan((c.y-s.y)/(c.x-s.x)),f=t.getPointAtLength(o(r,e)),d={x:(4*f.x+s.x+c.x)/6,y:(4*f.y+s.y+c.y)/6,theta:u};return n[r]=d,d},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(t,e,r){var n,a,i=e.left,o=e.right,l=e.top,s=e.bottom,c=0,u=t.getTotalLength(),f=u;function d(e){var r=t.getPointAtLength(e);0===e?n=r:e===u&&(a=r);var c=r.x<i?i-r.x:r.x>o?r.x-o:0,f=r.y<l?l-r.y:r.y>s?r.y-s:0;return Math.sqrt(c*c+f*f)}for(var p=d(c);p;){if((c+=p+r)>f)return;p=d(c)}for(p=d(f);p;){if(c>(f-=p+r))return;p=d(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var a,i,o,l=(n=n||{}).pathLength||t.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(l)[r]?-1:1,f=0,d=0,p=l;f<c;){if(a=(d+p)/2,o=(i=t.getPointAtLength(a))[r]-e,Math.abs(o)<s)return i;u*o>0?p=a:d=a,f++}return i}},{"./mod":175}],166:[function(t,e,r){"use strict";e.exports=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null==t)throw new Error("DOM element provided is null or undefined");return t}},{}],167:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],168:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../constants/numerical"),o=i.FP_SAFE,l=i.BADNUM,s=e.exports={};s.nestedProperty=t("./nested_property"),s.keyedContainer=t("./keyed_container"),s.relativeAttr=t("./relative_attr"),s.isPlainObject=t("./is_plain_object"),s.toLogRange=t("./to_log_range"),s.relinkPrivateKeys=t("./relink_private");var c=t("./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=t("./mod");s.mod=u.mod,s.modHalf=u.modHalf;var f=t("./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=t("./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=t("./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=t("./stats");s.aggNums=h.aggNums,s.len=h.len,s.mean=h.mean,s.midRange=h.midRange,s.variance=h.variance,s.stdev=h.stdev,s.interp=h.interp;var g=t("./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=t("./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 y=t("./anchor_utils");s.isLeftAnchor=y.isLeftAnchor,s.isCenterAnchor=y.isCenterAnchor,s.isRightAnchor=y.isRightAnchor,s.isTopAnchor=y.isTopAnchor,s.isMiddleAnchor=y.isMiddleAnchor,s.isBottomAnchor=y.isBottomAnchor;var m=t("./geometry2d");s.segmentsIntersect=m.segmentsIntersect,s.segmentDistance=m.segmentDistance,s.getTextLocation=m.getTextLocation,s.clearLocationCache=m.clearLocationCache,s.getVisibleSegment=m.getVisibleSegment,s.findPointOnPath=m.findPointOnPath;var x=t("./extend");s.extendFlat=x.extendFlat,s.extendDeep=x.extendDeep,s.extendDeepAll=x.extendDeepAll,s.extendDeepNoArrays=x.extendDeepNoArrays;var b=t("./loggers");s.log=b.log,s.warn=b.warn,s.error=b.error;var _=t("./regex");s.counterRegex=_.counter;var w=t("./throttle");function k(t){var e={};for(var r in t)for(var n=t[r],a=0;a<n.length;a++)e[n[a]]=+r;return e}s.throttle=w.throttle,s.throttleDone=w.done,s.clearThrottle=w.clear,s.getGraphDiv=t("./get_graph_div"),s.clearResponsive=t("./clear_responsive"),s.makeTraceGroups=t("./make_trace_groups"),s._=t("./localize"),s.notifier=t("./notifier"),s.filterUnique=t("./filter_unique"),s.filterVisible=t("./filter_visible"),s.pushUnique=t("./push_unique"),s.cleanNumber=t("./clean_number"),s.ensureNumber=function(t){return a(t)?(t=Number(t))<-o||t>o?l:a(t)?Number(t):l:l},s.isIndex=function(t,e){return!(void 0!==e&&t>=e)&&(a(t)&&t>=0&&t%1==0)},s.noop=t("./noop"),s.identity=t("./identity"),s.repeat=function(t,e){for(var r=new Array(e),n=0;n<e;n++)r[n]=t;return r},s.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var a=0;a<e.length;a++){var i=e[a],o=s.nestedProperty(t,i.replace("?",r)),l=s.nestedProperty(t,i.replace("?",n)),c=o.get();o.set(l.get()),l.set(c)}},s.raiseToTop=function(t){t.parentNode.appendChild(t)},s.cancelTransition=function(t){return t.transition().duration(0)},s.constrain=function(t,e,r){return e>r?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},s.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},s.simpleMap=function(t,e,r,n){for(var a=t.length,i=new Array(a),o=0;o<a;o++)i[o]=e(t[o],r,n);return i},s.randstr=function t(e,r,n,a){if(n||(n=16),void 0===r&&(r=24),r<=0)return"0";var i,o,l=Math.log(Math.pow(2,r))/Math.log(n),c="";for(i=2;l===1/0;i*=2)l=Math.log(Math.pow(2,r/i))/Math.log(n)*i;var u=l-Math.floor(l);for(i=0;i<Math.floor(l);i++)c=Math.floor(Math.random()*n).toString(n)+c;u&&(o=Math.pow(n,u),c=Math.floor(Math.random()*o).toString(n)+c);var f=parseInt(c,n);return e&&e[c]||f!==1/0&&f>=Math.pow(2,r)?a>10?(s.warn("randstr failed uniqueness"),c):t(e,r,n,(a||0)+1):c},s.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},s.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,a,i,o=t.length,l=2*o,s=2*e-1,c=new Array(s),u=new Array(o);for(r=0;r<s;r++)c[r]=(1-Math.cos(Math.PI*(r+1)/e))/(2*e);for(r=0;r<o;r++){for(i=0,n=0;n<s;n++)(a=r+n+1-e)<-o?a-=l*Math.round(a/l):a>=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=t[a]*c[n];u[r]=i}return u},s.syncOrAsync=function(t,e,r){var n;function a(){return s.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(a).then(void 0,s.promiseError);return r&&r(e)},s.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},s.noneOrAll=function(t,e,r){if(t){var n,a=!1,i=!0;for(n=0;n<r.length;n++)null!=t[r[n]]?a=!0:i=!1;if(a&&!i)for(n=0;n<r.length;n++)t[r[n]]=e[r[n]]}},s.mergeArray=function(t,e,r){if(s.isArrayOrTypedArray(t))for(var n=Math.min(t.length,e.length),a=0;a<n;a++)e[a][r]=t[a]},s.fillArray=function(t,e,r,n){if(n=n||s.identity,s.isArrayOrTypedArray(t))for(var a=0;a<e.length;a++)e[a][r]=n(t[a])},s.castOption=function(t,e,r,n){n=n||s.identity;var a=s.nestedProperty(t,r).get();return s.isArrayOrTypedArray(a)?Array.isArray(e)&&s.isArrayOrTypedArray(a[e[0]])?n(a[e[0]][e[1]]):n(a[e]):a},s.extractOption=function(t,e,r,n){if(r in t)return t[r];var a=s.nestedProperty(e,n).get();return Array.isArray(a)?void 0:a},s.tagSelected=function(t,e,r){var n,a,i=e.selectedpoints,o=e._indexToPoints;o&&(n=k(o));for(var l=0;l<i.length;l++){var c=i[l];if(s.isIndex(c)){var u=n?n[c]:c,f=r?r[u]:u;void 0!==(a=f)&&a<t.length&&(t[f].selected=1)}}},s.selIndices2selPoints=function(t){var e=t.selectedpoints,r=t._indexToPoints;if(r){for(var n=k(r),a=[],i=0;i<e.length;i++){var o=e[i];if(s.isIndex(o)){var l=n[o];s.isIndex(l)&&a.push(l)}}return a}return e},s.getTargetArray=function(t,e){var r=e.target;if("string"==typeof r&&r){var n=s.nestedProperty(t,r).get();return!!Array.isArray(n)&&n}return!!Array.isArray(r)&&r},s.minExtend=function(t,e){var r={};"object"!=typeof e&&(e={});var n,a,i,o=Object.keys(t);for(n=0;n<o.length;n++)i=t[a=o[n]],"_"!==a.charAt(0)&&"function"!=typeof i&&("module"===a?r[a]=i:Array.isArray(i)?r[a]="colorscale"===a?i.slice():i.slice(0,3):r[a]=i&&"object"==typeof i?s.minExtend(t[a],e[a]):i);for(o=Object.keys(e),n=0;n<o.length;n++)"object"==typeof(i=e[a=o[n]])&&a in r&&"object"==typeof r[a]||(r[a]=i);return r},s.titleCase=function(t){return t.charAt(0).toUpperCase()+t.substr(1)},s.containsAny=function(t,e){for(var r=0;r<e.length;r++)if(-1!==t.indexOf(e[r]))return!0;return!1},s.isPlotDiv=function(t){var e=n.select(t);return e.node()instanceof HTMLElement&&e.size()&&e.classed("js-plotly-plot")},s.removeElement=function(t){var e=t&&t.parentNode;e&&e.removeChild(t)},s.addStyleRule=function(t,e){s.addRelatedStyleRule("global",t,e)},s.addRelatedStyleRule=function(t,e,r){var n="plotly.js-style-"+t,a=document.getElementById(n);a||((a=document.createElement("style")).setAttribute("id",n),a.appendChild(document.createTextNode("")),document.head.appendChild(a));var i=a.sheet;i.insertRule?i.insertRule(e+"{"+r+"}",0):i.addRule?i.addRule(e,r,0):s.warn("addStyleRule failed")},s.deleteRelatedStyleRule=function(t){var e="plotly.js-style-"+t,r=document.getElementById(e);r&&s.removeElement(r)},s.isIE=function(){return"undefined"!=typeof window.navigator.msSaveBlob},s.isD3Selection=function(t){return t&&"function"==typeof t.classed},s.ensureSingle=function(t,e,r,n){var a=t.select(e+(r?"."+r:""));if(a.size())return a;var i=t.append(e);return r&&i.classed(r,!0),n&&i.call(n),i},s.ensureSingleById=function(t,e,r,n){var a=t.select(e+"#"+r);if(a.size())return a;var i=t.append(e).attr("id",r);return n&&i.call(n),i},s.objectFromPath=function(t,e){for(var r,n=t.split("."),a=r={},i=0;i<n.length;i++){var o=n[i],l=null,s=n[i].match(/(.*)\[([0-9]+)\]/);s?(o=s[1],l=s[2],r=r[o]=[],i===n.length-1?r[l]=e:r[l]={},r=r[l]):(i===n.length-1?r[o]=e:r[o]={},r=r[o])}return a};var T=/^([^\[\.]+)\.(.+)?/,M=/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/;s.expandObjectPaths=function(t){var e,r,n,a,i,o,l;if("object"==typeof t&&!Array.isArray(t))for(r in t)t.hasOwnProperty(r)&&((e=r.match(T))?(a=t[r],n=e[1],delete t[r],t[n]=s.extendDeepNoArrays(t[n]||{},s.objectFromPath(r,s.expandObjectPaths(a))[n])):(e=r.match(M))?(a=t[r],n=e[1],i=parseInt(e[2]),delete t[r],t[n]=t[n]||[],"."===e[3]?(l=e[4],o=t[n][i]=t[n][i]||{},s.extendDeepNoArrays(o,s.objectFromPath(l,s.expandObjectPaths(a)))):t[n][i]=s.expandObjectPaths(a)):t[r]=s.expandObjectPaths(t[r]));return t},s.numSeparate=function(t,e,r){if(r||(r=!1),"string"!=typeof e||0===e.length)throw new Error("Separator string required for formatting!");"number"==typeof t&&(t=String(t));var n=/(\d+)(\d{3})/,a=e.charAt(0),i=e.charAt(1),o=t.split("."),l=o[0],s=o.length>1?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};var A=/%{([^\s%{}:]*)(:[^}]*)?}/g,L=/^\w*$/;s.templateString=function(t,e){var r={};return t.replace(A,function(t,n){return L.test(n)?e[n]||"":(r[n]=r[n]||s.nestedProperty(e,n).get,r[n]()||"")})};var S=/^:/,C=0;s.hovertemplateString=function(t,e){var r=arguments,a={};return t.replace(A,function(t,i,o){var l,c,u;for(u=2;u<r.length;u++){if((l=r[u]).hasOwnProperty(i)){c=l[i];break}if(L.test(i)||(c=a[i]||s.nestedProperty(l,i).get())&&(a[i]=c),void 0!==c)break}return void 0===c&&(C<10&&(s.warn("Variable '"+i+"' in hovertemplate could not be found!"),c=t),10===C&&s.warn("Too many hovertemplate warnings - additional warnings will be suppressed"),C++),o?c=n.format(o.replace(S,""))(c):e.hasOwnProperty(i+"Label")&&(c=e[i+"Label"]),c})};s.subplotSort=function(t,e){for(var r=Math.min(t.length,e.length)+1,n=0,a=0,i=0;i<r;i++){var o=t.charCodeAt(i)||0,l=e.charCodeAt(i)||0,s=o>=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 O=2e9;s.seedPseudoRandom=function(){O=2e9},s.pseudoRandom=function(){var t=O;return O=(69069*O+1)%4294967296,Math.abs(O-t)<429496729?s.pseudoRandom():O/4294967296}},{"../constants/numerical":149,"./anchor_utils":153,"./angles":154,"./array":155,"./clean_number":156,"./clear_responsive":158,"./coerce":159,"./dates":160,"./extend":162,"./filter_unique":163,"./filter_visible":164,"./geometry2d":165,"./get_graph_div":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:16,"fast-isnumeric":18}],169:[function(t,e,r){"use strict";e.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t)===Object.prototype}},{}],170:[function(t,e,r){"use strict";var n=t("./nested_property"),a=/^\w*$/;e.exports=function(t,e,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};e&&e.length?(s=n(t,e),l=s.get()):l=t,e=e||"";var u={};if(l)for(o=0;o<l.length;o++)u[l[o][r]]=o;var f=a.test(i),d={set:function(t,e){var a=null===e?4:0;if(!l){if(!s||4===a)return;l=[],s.set(l)}var o=u[t];if(void 0===o){if(4===a)return;a|=3,o=l.length,u[t]=o}else e!==(f?l[o][i]:n(l[o],i).get())&&(a|=2);var p=l[o]=l[o]||{};return p[r]=t,f?p[i]=e:n(p,i).set(e),null!==e&&(a&=-5),c[o]=c[o]|a,d},get:function(t){if(l){var e=u[t];return void 0===e?void 0:f?l[e][i]:n(l[e],i).get()}},rename:function(t,e){var n=u[t];return void 0===n?d:(c[n]=1|c[n],u[e]=n,delete u[t],l[n][r]=e,d)},remove:function(t){var e=u[t];if(void 0===e)return d;var a=l[e];if(Object.keys(a).length>2)return c[e]=2|c[e],d.set(t,null);if(f){for(o=e;o<l.length;o++)c[o]=3|c[o];for(o=e;o<l.length;o++)u[l[o][r]]--;l.splice(e,1),delete u[t]}else n(a,i).set(null),c[e]=6|c[e];return d},constructUpdate:function(){for(var t,a,o={},s=Object.keys(c),u=0;u<s.length;u++)a=s[u],t=e+"["+a+"]",l[a]?(1&c[a]&&(o[t+"."+r]=l[a][r]),2&c[a]&&(o[t+"."+i]=f?4&c[a]?null:l[a][i]:4&c[a]?null:n(l[a],i).get())):o[t]=null;return o}};return d}},{"./nested_property":176}],171:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t,e){for(var r=t._context.locale,a=0;a<2;a++){for(var i=t._context.locales,o=0;o<2;o++){var l=(i[r]||{}).dictionary;if(l){var s=l[e];if(s)return s}i=n.localeRegistry}var c=r.split("-")[0];if(c===r)break;r=c}return e}},{"../registry":257}],172:[function(t,e,r){"use strict";var n=t("../plot_api/plot_config").dfltConfig,a=e.exports={};function i(t,e){if(t&&t.apply)try{return void t.apply(console,e)}catch(t){}for(var r=0;r<e.length;r++)try{t(e[r])}catch(t){console.log(e[r])}}a.log=function(){if(n.logging>1){for(var t=["LOG:"],e=0;e<arguments.length;e++)t.push(arguments[e]);i(console.trace||console.log,t)}},a.warn=function(){if(n.logging>0){for(var t=["WARN:"],e=0;e<arguments.length;e++)t.push(arguments[e]);i(console.trace||console.log,t)}},a.error=function(){if(n.logging>0){for(var t=["ERROR:"],e=0;e<arguments.length;e++)t.push(arguments[e]);i(console.error,t)}}},{"../plot_api/plot_config":200}],173:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n=t.selectAll("g."+r.replace(/\s/g,".")).data(e,function(t){return t[0].trace.uid});return n.exit().remove(),n.enter().append("g").attr("class",r),n.order(),n}},{}],174:[function(t,e,r){"use strict";r.init2dArray=function(t,e){for(var r=new Array(t),n=0;n<t;n++)r[n]=new Array(e);return r},r.transposeRagged=function(t){var e,r,n=0,a=t.length;for(e=0;e<a;e++)n=Math.max(n,t[e].length);var i=new Array(n);for(e=0;e<n;e++)for(i[e]=new Array(a),r=0;r<a;r++)i[e][r]=t[r][e];return i},r.dot=function(t,e){if(!t.length||!e.length||t.length!==e.length)return null;var n,a,i=t.length;if(t[0].length)for(n=new Array(i),a=0;a<i;a++)n[a]=r.dot(t[a],e);else if(e[0].length){var o=r.transposeRagged(e);for(n=new Array(o.length),a=0;a<o.length;a++)n[a]=r.dot(t,o[a])}else for(n=0,a=0;a<i;a++)n+=t[a]*e[a];return n},r.translationMatrix=function(t,e){return[[1,0,t],[0,1,e],[0,0,1]]},r.rotationMatrix=function(t){var e=t*Math.PI/180;return[[Math.cos(e),-Math.sin(e),0],[Math.sin(e),Math.cos(e),0],[0,0,1]]},r.rotationXYMatrix=function(t,e,n){return r.dot(r.dot(r.translationMatrix(e,n),r.rotationMatrix(t)),r.translationMatrix(-e,-n))},r.apply2DTransform=function(t){return function(){var e=arguments;3===e.length&&(e=e[0]);var n=1===arguments.length?e[0]:[e[0],e[1]];return r.dot(t,[n[0],n[1],1]).slice(0,2)}},r.apply2DTransform2=function(t){var e=r.apply2DTransform(t);return function(t){return e(t.slice(0,2)).concat(e(t.slice(2,4)))}}},{}],175:[function(t,e,r){"use strict";e.exports={mod:function(t,e){var r=t%e;return r<0?r+e:r},modHalf:function(t,e){return Math.abs(t)>e/2?t-Math.round(t/e)*e:t}}},{}],176:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./array").isArrayOrTypedArray;e.exports=function(t,e){if(n(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,i,o,s=0,c=e.split(".");s<c.length;){if(r=String(c[s]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/)){if(r[1])c[s]=r[1];else{if(0!==s)throw"bad property string";c.splice(0,1)}for(i=r[2].substr(1,r[2].length-2).split("]["),o=0;o<i.length;o++)s++,c.splice(s,0,Number(i[o]))}s++}return"object"!=typeof t?function(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}(t,e,c):{set:l(t,c,e),get:function t(e,r){return function(){var n,i,o,l,s,c=e;for(l=0;l<r.length-1;l++){if(-1===(n=r[l])){for(i=!0,o=[],s=0;s<c.length;s++)o[s]=t(c[s],r.slice(l+1))(),o[s]!==o[0]&&(i=!1);return i?o[0]:o}if("number"==typeof n&&!a(c))return;if("object"!=typeof(c=c[n])||null===c)return}if("object"==typeof c&&null!==c&&null!==(o=c[r[l]]))return o}}(t,c),astr:e,parts:c,obj:t}};var i=/(^|\.)args\[/;function o(t,e){return void 0===t||null===t&&!e.match(i)}function l(t,e,r){return function(n){var i,l,f=t,d="",p=[[t,d]],h=o(n,r);for(l=0;l<e.length-1;l++){if("number"==typeof(i=e[l])&&!a(f))throw"array index but container is not an array";if(-1===i){if(h=!c(f,e.slice(l+1),n,r))break;return}if(!u(f,i,e[l+1],h))break;if("object"!=typeof(f=f[i])||null===f)throw"container is not an object";d=s(d,i),p.push([f,d])}if(h){if(l===e.length-1&&(delete f[e[l]],Array.isArray(f)&&+e[l]==f.length-1))for(;f.length&&void 0===f[f.length-1];)f.pop()}else f[e[l]]=n}}function s(t,e){var r=e;return n(e)?r="["+e+"]":t&&(r="."+e),t+r}function c(t,e,r,n){var i,s=a(r),c=!0,f=r,d=n.replace("-1",0),p=!s&&o(r,d),h=e[0];for(i=0;i<t.length;i++)d=n.replace("-1",i),s&&(p=o(f=r[i%r.length],d)),p&&(c=!1),u(t,i,h,p)&&l(t[i],e,n.replace("-1",i))(f);return c}function u(t,e,r,n){if(void 0===t[e]){if(n)return!1;t[e]="number"==typeof r?[]:{}}return!0}},{"./array":155,"fast-isnumeric":18}],177:[function(t,e,r){"use strict";e.exports=function(){}},{}],178:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=[];e.exports=function(t,e){if(-1===i.indexOf(t)){i.push(t);var r=1e3;a(e)?r=e:"long"===e&&(r=3e3);var o=n.select("body").selectAll(".plotly-notifier").data([0]);o.enter().append("div").classed("plotly-notifier",!0),o.selectAll(".notifier-note").data(i).enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(t){var e=n.select(this);e.append("button").classed("notifier-close",!0).html("×").on("click",function(){e.transition().call(l)});for(var a=e.append("p"),i=t.split(/<br\s*\/?>/g),o=0;o<i.length;o++)o&&a.append("br"),a.append("span").text(i[o]);e.transition().duration(700).style("opacity",1).transition().delay(r).call(l)})}function l(t){t.duration(700).style("opacity",0).each("end",function(t){var e=i.indexOf(t);-1!==e&&i.splice(e,1),n.select(this).remove()})}}},{d3:16,"fast-isnumeric":18}],179:[function(t,e,r){"use strict";var n=t("./setcursor"),a="data-savedcursor";e.exports=function(t,e){var r=t.attr(a);if(e){if(!r){for(var i=(t.attr("class")||"").split(" "),o=0;o<i.length;o++){var l=i[o];0===l.indexOf("cursor-")&&t.attr(a,l.substr(7)).classed(l,!1)}t.attr(a)||t.attr(a,"!!")}n(t,e)}else r&&(t.attr(a,null),"!!"===r?n(t):n(t,r))}},{"./setcursor":187}],180:[function(t,e,r){"use strict";var n=t("./matrix").dot,a=t("../constants/numerical").BADNUM,i=e.exports={};i.tester=function(t){var e,r=t.slice(),n=r[0][0],i=n,o=r[0][1],l=o;for(r.push(r[0]),e=1;e<r.length;e++)n=Math.min(n,r[e][0]),i=Math.max(i,r[e][0]),o=Math.min(o,r[e][1]),l=Math.max(l,r[e][1]);var s,c=!1;5===r.length&&(r[0][0]===r[1][0]?r[2][0]===r[3][0]&&r[0][1]===r[3][1]&&r[1][1]===r[2][1]&&(c=!0,s=function(t){return t[0]===r[0][0]}):r[0][1]===r[1][1]&&r[2][1]===r[3][1]&&r[0][0]===r[3][0]&&r[1][0]===r[2][0]&&(c=!0,s=function(t){return t[1]===r[0][1]}));var u=!0,f=r[0];for(e=1;e<r.length;e++)if(f[0]!==r[e][0]||f[1]!==r[e][1]){u=!1;break}return{xmin:n,xmax:i,ymin:o,ymax:l,pts:r,contains:c?function(t,e){var r=t[0],c=t[1];return!(r===a||r<n||r>i||c===a||c<o||c>l||e&&s(t))}:function(t,e){var s=t[0],c=t[1];if(s===a||s<n||s>i||c===a||c<o||c>l)return!1;var u,f,d,p,h,g=r.length,v=r[0][0],y=r[0][1],m=0;for(u=1;u<g;u++)if(f=v,d=y,v=r[u][0],y=r[u][1],!(s<(p=Math.min(f,v))||s>Math.max(f,v)||c>Math.max(d,y)))if(c<Math.min(d,y))s!==p&&m++;else{if(c===(h=v===f?c:d+(s-f)*(y-d)/(v-f)))return 1!==u||!e;c<=h&&s!==p&&m++}return m%2==1},isRect:c,degenerate:u}};var o=i.isSegmentBent=function(t,e,r,a){var i,o,l,s=t[e],c=[t[r][0]-s[0],t[r][1]-s[1]],u=n(c,c),f=Math.sqrt(u),d=[-c[1]/f,c[0]/f];for(i=e+1;i<r;i++)if(o=[t[i][0]-s[0],t[i][1]-s[1]],(l=n(o,c))<0||l>u||Math.abs(n(o,d))>a)return!0;return!1};i.filter=function(t,e){var r=[t[0]],n=0,a=0;function i(i){t.push(i);var l=r.length,s=n;r.splice(a+1);for(var c=s+1;c<t.length;c++)(c===t.length-1||o(t,s,c+1,e))&&(r.push(t[c]),r.length<l-2&&(n=c,a=r.length-1),s=c)}t.length>1&&i(t.pop());return{addPt:i,raw:t,filtered:r}}},{"../constants/numerical":149,"./matrix":174}],181:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;n<t.length;n++)if(t[n]instanceof RegExp&&t[n].toString()===r)return t;t.push(e)}else!e&&0!==e||-1!==t.indexOf(e)||t.push(e);return t}},{}],182:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plot_api/plot_config").dfltConfig;var i={add:function(t,e,r,n,i){var o,l;t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},l=t.undoQueue.index,t.autoplay?t.undoQueue.inSequence||(t.autoplay=!1):(!t.undoQueue.sequence||t.undoQueue.beginSequence?(o={undo:{calls:[],args:[]},redo:{calls:[],args:[]}},t.undoQueue.queue.splice(l,t.undoQueue.queue.length-l,o),t.undoQueue.index+=1):o=t.undoQueue.queue[l-1],t.undoQueue.beginSequence=!1,o&&(o.undo.calls.unshift(e),o.undo.args.unshift(r),o.redo.calls.push(n),o.redo.args.push(i)),t.undoQueue.queue.length>a.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.undo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r<e.undo.calls.length;r++)i.plotDo(t,e.undo.calls[r],e.undo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1}},redo:function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.redo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index>=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r<e.redo.calls.length;r++)i.plotDo(t,e.redo.calls[r],e.redo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1,t.undoQueue.index++}}};i.plotDo=function(t,e,r){t.autoplay=!0,r=function(t,e){for(var r,a=[],i=0;i<e.length;i++)r=e[i],a[i]=r===t?r:"object"==typeof r?Array.isArray(r)?n.extendDeep([],r):n.extendDeepAll({},r):r;return a}(t,r),e.apply(null,r)},e.exports=i},{"../lib":168,"../plot_api/plot_config":200}],183:[function(t,e,r){"use strict";r.counter=function(t,e,r,n){var a=(e||"")+(r?"":"$"),i=!1===n?"":"^";return"xy"===t?new RegExp(i+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+a):new RegExp(i+t+"([2-9]|[1-9][0-9]+)?"+a)}},{}],184:[function(t,e,r){"use strict";var n=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,a=/^[^\.\[\]]+$/;e.exports=function(t,e){for(;e;){var r=t.match(n);if(r)t=r[1];else{if(!t.match(a))throw new Error("bad relativeAttr call:"+[t,e]);t=""}if("^"!==e.charAt(0))break;e=e.slice(1)}return t&&"["!==e.charAt(0)?t+"."+e:t+e}},{}],185:[function(t,e,r){"use strict";var n=t("./array").isArrayOrTypedArray,a=t("./is_plain_object");e.exports=function t(e,r){for(var i in r){var o=r[i],l=e[i];if(l!==o)if("_"===i.charAt(0)||"function"==typeof o){if(i in e)continue;e[i]=o}else if(n(o)&&n(l)&&a(o[0])){if("customdata"===i||"ids"===i)continue;for(var s=Math.min(o.length,l.length),c=0;c<s;c++)l[c]!==o[c]&&a(o[c])&&a(l[c])&&t(l[c],o[c])}else a(o)&&a(l)&&(t(l,o),Object.keys(l).length||delete e[i])}}},{"./array":155,"./is_plain_object":169}],186:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./loggers"),i=t("./identity");function o(t,e){return t<e}function l(t,e){return t<=e}function s(t,e){return t>e}function c(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var i,u,f=0,d=e.length,p=0,h=d>1?(e[d-1]-e[0])/(d-1):1;for(u=h>=0?r?o:l:r?c:s,t+=1e-9*h*(r?-1:1)*(h>=0?1:-1);f<d&&p++<100;)u(e[i=Math.floor((f+d)/2)],t)?f=i+1:d=i;return p>90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e=t.slice();e.sort(r.sorterAsc);for(var n=e.length-1,a=e[n]-e[0]||1,i=a/(n||1)/1e4,o=[e[0]],l=0;l<n;l++)e[l+1]>e[l]+i&&(a=Math.min(a,e[l+1]-e[l]),o.push(e[l+1]));return{vals:o,minDiff:a}},r.roundUp=function(t,e,r){for(var n,a=0,i=e.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a<i&&o++<100;)e[n=c((a+i)/2)]<=t?a=n+l:i=n-s;return e[a]},r.sort=function(t,e){for(var r=0,n=0,a=1;a<t.length;a++){var i=e(t[a],t[a-1]);if(i<0?r=1:i>0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||i;for(var r,n=1/0,a=0;a<t.length;a++){var o=e(t[a]);o<n&&(n=o,r=a)}return r}},{"./identity":167,"./loggers":172,"fast-isnumeric":18}],187:[function(t,e,r){"use strict";e.exports=function(t,e){(t.attr("class")||"").split(" ").forEach(function(e){0===e.indexOf("cursor-")&&t.classed(e,!1)}),e&&t.classed("cursor-"+e,!0)}},{}],188:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./array").isArrayOrTypedArray;r.aggNums=function(t,e,i,o){var l,s;if((!o||o>i.length)&&(o=i.length),n(e)||(e=!1),a(i[0])){for(s=new Array(o),l=0;l<o;l++)s[l]=r.aggNums(t,e,i[l]);i=s}for(l=0;l<o;l++)n(e)?n(i[l])&&(e=t(+e,+i[l])):e=i[l];return e},r.len=function(t){return r.aggNums(function(t){return t+1},0,t)},r.mean=function(t,e){return e||(e=r.len(t)),r.aggNums(function(t,e){return t+e},0,t)/e},r.midRange=function(t){if(void 0!==t&&0!==t.length)return(r.aggNums(Math.max,null,t)+r.aggNums(Math.min,null,t))/2},r.variance=function(t,e,a){return e||(e=r.len(t)),n(a)||(a=r.mean(t,e)),r.aggNums(function(t,e){return t+Math.pow(e-a,2)},0,t)/e},r.stdev=function(t,e,n){return Math.sqrt(r.variance(t,e,n))},r.interp=function(t,e){if(!n(e))throw"n should be a finite number";if((e=e*t.length-.5)<0)return t[0];if(e>t.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":155,"fast-isnumeric":18}],189:[function(t,e,r){"use strict";var n=t("d3"),a=t("../lib"),i=t("../constants/xmlns_namespaces"),o=t("../constants/alignment").LINE_SPACING;function l(t,e){return t.node().getBoundingClientRect()[e]}var s=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,A){var L=t.text(),C=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&L.match(s),O=n.select(t.node().parentNode);if(!O.empty()){var z=t.attr("class")?t.attr("class").split(" ")[0]:"text";return z+="-math",O.selectAll("svg."+z).remove(),O.selectAll("g."+z+"-group").remove(),t.style("display",null).attr({"data-unformatted":L,"data-math":"N"}),C?(e&&e._promises||[]).push(new Promise(function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),i={fontSize:r};!function(t,e,r){var i,o,l,s;MathJax.Hub.Queue(function(){return o=a.extendDeepAll({},MathJax.Hub.config),l=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})},function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")},function(){var r="math-output-"+a.randstr({},64);return s=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(t.replace(c,"\\lt ").replace(u,"\\gt ")),MathJax.Hub.Typeset(s.node())},function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(s.select(".MathJax_SVG").empty()||!s.select("svg").node())a.log("There was an error in the tex syntax.",t),r();else{var o=s.select("svg").node().getBoundingClientRect();r(s.select(".MathJax_SVG"),e,o)}if(s.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)},function(){return void 0!==l&&(MathJax.Hub.processSectionDelay=l),MathJax.Hub.Config(o)})}(C[2],i,function(n,a,i){O.selectAll("svg."+z).remove(),O.selectAll("g."+z+"-group").remove();var o=n&&n.select("svg");if(!o||!o.node())return D(),void e();var s=O.append("g").classed(z+"-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:z,height:i.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=t.node().style.fill||"black";o.select("g").attr({fill:c,stroke:c});var u=l(o,"width"),f=l(o,"height"),d=+t.attr("x")-u*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],p=-(r||l(t,"height"))/4;"y"===z[0]?(s.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-u/2,p-f/2]+")"}),o.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===z[0]?o.attr({x:t.attr("x"),y:p-f/2}):"a"===z[0]&&0!==z.indexOf("atitle")?o.attr({x:0,y:p}):o.attr({x:d,y:+t.attr("y")+p-f/2}),A&&A.call(t,s),e(s)})})):D(),t}function D(){O.empty()||(z=t.attr("class")+"-math",O.select("svg."+z).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(v," ");var r,l=!1,s=[],c=-1;function u(){c++;var e=document.createElementNS(i.svg,"tspan");n.select(e).attr({class:"line",dy:c*o+"em"}),t.appendChild(e),r=e;var a=s;if(s=[{node:e}],a.length>1)for(var l=1;l<a.length;l++)A(a[l])}function A(t){var e,a=t.type,o={};if("a"===a){e="a";var l=t.target,c=t.href,u=t.popup;c&&(o={"xlink:xlink:show":"_blank"===l||"_"!==l.charAt(0)?"new":"replace",target:l,"xlink:xlink:href":c},u&&(o.onclick='window.open(this.href.baseVal,this.target.baseVal,"'+u+'");return false;'))}else e="tspan";t.style&&(o.style=t.style);var f=document.createElementNS(i.svg,e);if("sup"===a||"sub"===a){L(r,h),r.appendChild(f);var g=document.createElementNS(i.svg,"tspan");L(g,h),n.select(g).attr("dy",p[a]),o.dy=d[a],r.appendChild(f),r.appendChild(g)}else r.appendChild(f);n.select(f).attr(o),r=t.node=f,s.push(t)}function L(t,e){t.appendChild(document.createTextNode(e))}function C(t){if(1!==s.length){var n=s.pop();t!==n.type&&a.log("Start tag <"+n.type+"> doesnt match end tag <"+t+">. Pretending it did match.",e),r=s[s.length-1].node}else a.log("Ignoring unexpected end tag </"+t+">.",e)}x.test(e)?u():(r=t,s=[{node:t}]);for(var O=e.split(y),z=0;z<O.length;z++){var D=O[z],P=D.match(m),E=P&&P[2].toLowerCase(),R=f[E];if("br"===E)u();else if(void 0===R)L(r,S(D));else if(P[1])C(E);else{var I=P[4],F={type:E},N=T(I,b);if(N?(N=N.replace(M,"$1 fill:"),R&&(N+=";"+R)):R&&(N=R),N&&(F.style=N),"a"===E){l=!0;var B=T(I,_);if(B){var j=document.createElement("a");j.href=B,-1!==g.indexOf(j.protocol)&&(F.href=encodeURI(decodeURI(B)),F.target=T(I,w)||"_blank",F.popup=T(I,k))}}A(F)}}return l}(t.node(),L)&&t.style("pointer-events","all"),r.positionText(t),A&&A.call(t)}};var c=/(<|<|<)/g,u=/(>|>|>)/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\n?|\n)/g,y=/(<[^<>]*>)/,m=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=/<br(\s+.*)?>/i,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 T(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&S(n)}var M=/(^|;)\s*color:/;r.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],a="...".length,i=t.split(y),o=[],l="",s=0,c=0;c<i.length;c++){var u=i[c],f=u.match(m),d=f&&f[2].toLowerCase();if(d)-1!==n.indexOf(d)&&(o.push(u),l=d);else{var p=u.length;if(s+p<r)o.push(u),s+=p;else if(s<r){var h=r-s;l&&("br"!==l||h<=a||p<=a)&&o.pop(),r>a?o.push(u.substr(0,h-a)+"..."):o.push(u.substr(0,h));break}l=""}}return o.join("")};var A={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},L=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function S(t){return t.replace(L,function(t,e){return("#"===e.charAt(0)?function(t){if(t>1114111)return;var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):A[e])||t})}function C(t,e,r){var n,a,i,o=r.horizontalAlign,l=r.verticalAlign||"top",s=t.node().getBoundingClientRect(),c=e.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(t){return t.selectAll("tspan.line").size()||1},r.positionText=function(t,e,r){return t.each(function(){var t=n.select(this);function a(e,r){return void 0===r?null===(r=t.attr(e))&&(t.attr(e,0),r=0):t.attr(e,r),r}var i=a("x",e),o=a("y",r);"text"===this.nodeName&&t.selectAll("tspan.line").attr({x:i,y:o})})},r.makeEditable=function(t,e){var r=e.gd,a=e.delegate,i=n.dispatch("edit","input","cancel"),o=a||t;if(t.style({"pointer-events":a?"none":"all"}),1!==t.size())throw new Error("boo");function l(){!function(){var a=n.select(r).select(".svg-container"),o=a.append("div"),l=t.node().style,c=parseFloat(l.fontSize||12),u=e.text;void 0===u&&(u=t.attr("data-unformatted"));o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":l.fontFamily||"Arial","font-size":c,color:e.fill||l.fill||"black",opacity:1,"background-color":e.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(t,a,e)).on("blur",function(){r._editing=!1,t.text(this.textContent).style({opacity:1});var e,a=n.select(this).attr("class");(e=a?"."+a.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(t.node().parentNode).select(e).style({opacity:0});var o=this.textContent;n.select(this).transition().duration(0).remove(),n.select(document).on("mouseup",null),i.edit.call(t,o)}).on("focus",function(){var t=this;r._editing=!0,n.select(document).on("mouseup",function(){if(n.event.target===t)return!1;document.activeElement===o.node()&&o.node().blur()})}).on("keyup",function(){27===n.event.which?(r._editing=!1,t.style({opacity:1}),n.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),i.cancel.call(t,this.textContent)):(i.input.call(t,this.textContent),n.select(this).call(C(t,a,e)))}).on("keydown",function(){13===n.event.which&&this.blur()}).call(s)}(),t.style({opacity:0});var a,l=o.attr("class");(a=l?"."+l.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(t.node().parentNode).select(a).style({opacity:0})}function s(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}return e.immediate?l():o.on("click",l),n.rebind(t,i,"on")}},{"../constants/alignment":146,"../constants/xmlns_namespaces":150,"../lib":168,d3:16}],190:[function(t,e,r){"use strict";var n={};function a(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}r.throttle=function(t,e,r){var i=n[t],o=Date.now();if(!i){for(var l in n)n[l].ts<o-6e4&&delete n[l];i=n[t]={ts:0,timer:null}}function s(){r(),i.ts=Date.now(),i.onDone&&(i.onDone(),i.onDone=null)}a(i),o>i.ts+e?s():i.timer=setTimeout(function(){s(),i.timer=null},e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise(function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}}):Promise.resolve()},r.clear=function(t){if(t)a(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],191:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},{"fast-isnumeric":18}],192:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],193:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],194:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=t.split("[")[0],l=0;l<i.length;l++)if((r=t.match(i[l]))&&0===r.index){e=r[0];break}if(e||(e=a[a.indexOf(o)]),!e)return!1;var s=t.substr(e.length);return s?!!(r=s.match(/^\[(0|[1-9][0-9]*)\](\.(.+))?$/))&&{array:e,index:Number(r[1]),property:r[3]||""}:{array:e,index:"",property:""}}},{"../registry":257}],195:[function(t,e,r){"use strict";var n=t("../lib"),a=n.extendFlat,i=n.isPlainObject,o={valType:"flaglist",extras:["none"],flags:["calc","clearAxisTypes","plot","style","markerSize","colorbars"]},l={valType:"flaglist",extras:["none"],flags:["calc","plot","legend","ticks","axrange","layoutstyle","modebar","camera","arraydraw"]},s=o.flags.slice().concat(["fullReplot"]),c=l.flags.slice().concat("layoutReplot");function u(t){for(var e={},r=0;r<t.length;r++)e[t[r]]=!1;return e}function f(t,e,r){var n=a({},t);for(var o in n){var l=n[o];i(l)&&(n[o]=d(l,e,r,o))}return"from-root"===r&&(n.editType=e),n}function d(t,e,r,n){if(t.valType){var i=a({},t);if(i.editType=e,Array.isArray(t.items)){i.items=new Array(t.items.length);for(var o=0;o<t.items.length;o++)i.items[o]=d(t.items[o],e,"from-root")}return i}return f(t,e,"_"===n.charAt(0)?"nested":"from-root")}e.exports={traces:o,layout:l,traceFlags:function(){return u(s)},layoutFlags:function(){return u(c)},update:function(t,e){var r=e.editType;if(r&&"none"!==r)for(var n=r.split("+"),a=0;a<n.length;a++)t[n[a]]=!0},overrideAll:f}},{"../lib":168}],196:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("gl-mat4/fromQuat"),i=t("../registry"),o=t("../lib"),l=t("../plots/plots"),s=t("../plots/cartesian/axis_ids"),c=s.cleanId,u=s.getFromTrace,f=t("../components/color");function d(t,e){var r=t[e],n=e.charAt(0);r&&"paper"!==r&&(t[e]=c(r,n))}function p(t){function e(e,r){var n=t[e],a=t.title&&t.title[r];n&&!a&&(t.title||(t.title={}),t.title[r]=t[e],delete t[e])}t&&("string"!=typeof t.title&&"number"!=typeof t.title||(t.title={text:t.title}),e("titlefont","font"),e("titleposition","position"),e("titleside","side"),e("titleoffset","offset"))}function h(t){if(!o.isPlainObject(t))return!1;var e=t.name;return delete t.name,delete t.showlegend,("string"==typeof e||"number"==typeof e)&&String(e)}function g(t,e,r,n){if(r&&!n)return t;if(n&&!r)return e;if(!t.trim())return e;if(!e.trim())return t;var a,i=Math.min(t.length,e.length);for(a=0;a<i&&t.charAt(a)===e.charAt(a);a++);return t.substr(0,a).trim()}function v(t){var e="middle",r="center";return"string"==typeof t&&(-1!==t.indexOf("top")?e="top":-1!==t.indexOf("bottom")&&(e="bottom"),-1!==t.indexOf("left")?r="left":-1!==t.indexOf("right")&&(r="right")),e+" "+r}function y(t,e){return e in t&&"object"==typeof t[e]&&0===Object.keys(t[e]).length}r.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var i=(l.subplotsRegistry.cartesian||{}).attrRegex,s=(l.subplotsRegistry.polar||{}).attrRegex,u=(l.subplotsRegistry.ternary||{}).attrRegex,h=(l.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(t);for(e=0;e<g.length;e++){var v=g[e];if(i&&i.test(v)){var m=t[v];m.anchor&&"free"!==m.anchor&&(m.anchor=c(m.anchor)),m.overlaying&&(m.overlaying=c(m.overlaying)),m.type||(m.isdate?m.type="date":m.islog?m.type="log":!1===m.isdate&&!1===m.islog&&(m.type="linear")),"withzero"!==m.autorange&&"tozero"!==m.autorange||(m.autorange=!0,m.rangemode="tozero"),delete m.islog,delete m.isdate,delete m.categories,y(m,"domain")&&delete m.domain,void 0!==m.autotick&&(void 0===m.tickmode&&(m.tickmode=m.autotick?"auto":"linear"),delete m.autotick),p(m)}else if(s&&s.test(v)){p(t[v].radialaxis)}else if(u&&u.test(v)){var x=t[v];p(x.aaxis),p(x.baxis),p(x.caxis)}else if(h&&h.test(v)){var b=t[v],_=b.cameraposition;if(Array.isArray(_)&&4===_[0].length){var w=_[0],k=_[1],T=_[2],M=a([],w),A=[];for(n=0;n<3;++n)A[n]=k[n]+T*M[2+4*n];b.camera={eye:{x:A[0],y:A[1],z:A[2]},center:{x:k[0],y:k[1],z:k[2]},up:{x:0,y:0,z:1}},delete b.cameraposition}p(b.xaxis),p(b.yaxis),p(b.zaxis)}}var L=Array.isArray(t.annotations)?t.annotations.length:0;for(e=0;e<L;e++){var S=t.annotations[e];o.isPlainObject(S)&&(S.ref&&("paper"===S.ref?(S.xref="paper",S.yref="paper"):"data"===S.ref&&(S.xref="x",S.yref="y"),delete S.ref),d(S,"xref"),d(S,"yref"))}var C=Array.isArray(t.shapes)?t.shapes.length:0;for(e=0;e<C;e++){var O=t.shapes[e];o.isPlainObject(O)&&(d(O,"xref"),d(O,"yref"))}var z=t.legend;return z&&(z.x>3?(z.x=1.02,z.xanchor="left"):z.x<-2&&(z.x=-.02,z.xanchor="right"),z.y>3?(z.y=1.02,z.yanchor="bottom"):z.y<-2&&(z.y=-.02,z.yanchor="top")),p(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),f.clean(t),t.template&&t.template.layout&&r.cleanLayout(t.template.layout),t},r.cleanData=function(t){for(var e=0;e<t.length;e++){var n,a=t[e];if("histogramy"===a.type&&"xbins"in a&&!("ybins"in a)&&(a.ybins=a.xbins,delete a.xbins),a.error_y&&"opacity"in a.error_y){var s=f.defaults,u=a.error_y.color||(i.traceIs(a,"bar")?f.defaultLine:s[e%s.length]);a.error_y.color=f.addOpacity(f.rgb(u),f.opacity(u)*a.error_y.opacity),delete a.error_y.opacity}if("bardir"in a&&("h"!==a.bardir||!i.traceIs(a,"bar")&&"histogram"!==a.type.substr(0,9)||(a.orientation="h",r.swapXYData(a)),delete a.bardir),"histogramy"===a.type&&r.swapXYData(a),"histogramx"!==a.type&&"histogramy"!==a.type||(a.type="histogram"),"scl"in a&&!("colorscale"in a)&&(a.colorscale=a.scl,delete a.scl),"reversescl"in a&&!("reversescale"in a)&&(a.reversescale=a.reversescl,delete a.reversescl),a.xaxis&&(a.xaxis=c(a.xaxis,"x")),a.yaxis&&(a.yaxis=c(a.yaxis,"y")),i.traceIs(a,"gl3d")&&a.scene&&(a.scene=l.subplotsRegistry.gl3d.cleanId(a.scene)),!i.traceIs(a,"pie")&&!i.traceIs(a,"bar"))if(Array.isArray(a.textposition))for(n=0;n<a.textposition.length;n++)a.textposition[n]=v(a.textposition[n]);else a.textposition&&(a.textposition=v(a.textposition));var d=i.getModule(a);if(d&&d.colorbar){var m=d.colorbar.container,x=m?a[m]:a;x&&x.colorscale&&("YIGnBu"===x.colorscale&&(x.colorscale="YlGnBu"),"YIOrRd"===x.colorscale&&(x.colorscale="YlOrRd"))}if("surface"===a.type&&o.isPlainObject(a.contours)){var b=["x","y","z"];for(n=0;n<b.length;n++){var _=a.contours[b[n]];o.isPlainObject(_)&&(_.highlightColor&&(_.highlightcolor=_.highlightColor,delete _.highlightColor),_.highlightWidth&&(_.highlightwidth=_.highlightWidth,delete _.highlightWidth))}}if("candlestick"===a.type||"ohlc"===a.type){var w=!1!==(a.increasing||{}).showlegend,k=!1!==(a.decreasing||{}).showlegend,T=h(a.increasing),M=h(a.decreasing);if(!1!==T&&!1!==M){var A=g(T,M,w,k);A&&(a.name=A)}else!T&&!M||a.name||(a.name=T||M)}if(Array.isArray(a.transforms)){var L=a.transforms;for(n=0;n<L.length;n++){var S=L[n];if(o.isPlainObject(S))switch(S.type){case"filter":S.filtersrc&&(S.target=S.filtersrc,delete S.filtersrc),S.calendar&&(S.valuecalendar||(S.valuecalendar=S.calendar),delete S.calendar);break;case"groupby":if(S.styles=S.styles||S.style,S.styles&&!Array.isArray(S.styles)){var C=S.styles,O=Object.keys(C);S.styles=[];for(var z=0;z<O.length;z++)S.styles.push({target:O[z],value:C[O[z]]})}}}}y(a,"line")&&delete a.line,"marker"in a&&(y(a.marker,"line")&&delete a.marker.line,y(a,"marker")&&delete a.marker),f.clean(a),a.autobinx&&(delete a.autobinx,delete a.xbins),a.autobiny&&(delete a.autobiny,delete a.ybins),p(a),a.colorbar&&p(a.colorbar),a.marker&&a.marker.colorbar&&p(a.marker.colorbar),a.line&&a.line.colorbar&&p(a.line.colorbar),a.aaxis&&p(a.aaxis),a.baxis&&p(a.baxis)}},r.swapXYData=function(t){var e;if(o.swapAttrs(t,["?","?0","d?","?bins","nbins?","autobin?","?src","error_?"]),Array.isArray(t.z)&&Array.isArray(t.z[0])&&(t.transpose?delete t.transpose:t.transpose=!0),t.error_x&&t.error_y){var r=t.error_y,n="copy_ystyle"in r?r.copy_ystyle:!(r.color||r.thickness||r.width);o.swapAttrs(t,["error_?.copy_ystyle"]),n&&o.swapAttrs(t,["error_?.color","error_?.thickness","error_?.width"])}if("string"==typeof t.hoverinfo){var a=t.hoverinfo.split("+");for(e=0;e<a.length;e++)"x"===a[e]?a[e]="y":"y"===a[e]&&(a[e]="x");t.hoverinfo=a.join("+")}},r.coerceTraceIndices=function(t,e){if(n(e))return[e];if(!Array.isArray(e)||!e.length)return t.data.map(function(t,e){return e});if(Array.isArray(e)){for(var r=[],a=0;a<e.length;a++)o.isIndex(e[a],t.data.length)?r.push(e[a]):o.warn("trace index (",e[a],") is not a number or is out of bounds");return r}return e},r.manageArrayContainers=function(t,e,r){var a=t.obj,i=t.parts,l=i.length,s=i[l-1],c=n(s);if(c&&null===e){var u=i.slice(0,l-1).join(".");o.nestedProperty(a,u).get().splice(s,1)}else c&&void 0===t.get()?(void 0===t.get()&&(r[t.astr]=null),t.set(e)):t.set(e)};var m=/(\.[^\[\]\.]+|\[[^\[\]\.]+\])$/;function x(t){var e=t.search(m);if(e>0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=x(e);r;){if(r in t)return!0;r=x(r)}return!1};var b=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n<e.length;n++)for(var a=t._fullData[n],i=0;i<3;i++){var l=u(t,a,b[i]);if(l&&"log"!==l.type){var s=l._name,c=l._id.substr(1);if("scene"===c.substr(0,5)){if(void 0!==r[c])continue;s=c+"."+s}var f=s+".type";void 0===r[s]&&void 0===r[f]&&o.nestedProperty(t.layout,f).set(null)}}}},{"../components/color":51,"../lib":168,"../plots/cartesian/axis_ids":215,"../plots/plots":245,"../registry":257,"fast-isnumeric":18,"gl-mat4/fromQuat":19}],197:[function(t,e,r){"use strict";var n=t("./plot_api");r.plot=n.plot,r.newPlot=n.newPlot,r.restyle=n.restyle,r.relayout=n.relayout,r.redraw=n.redraw,r.update=n.update,r._guiRestyle=n._guiRestyle,r._guiRelayout=n._guiRelayout,r._guiUpdate=n._guiUpdate,r._storeDirectGUIEdit=n._storeDirectGUIEdit,r.react=n.react,r.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.purge=n.purge,r.addFrames=n.addFrames,r.deleteFrames=n.deleteFrames,r.animate=n.animate,r.setPlotConfig=n.setPlotConfig,r.toImage=t("./to_image"),r.validate=t("./validate"),r.downloadImage=t("../snapshot/download");var a=t("./template_api");r.makeTemplate=a.makeTemplate,r.validateTemplate=a.validateTemplate},{"../snapshot/download":259,"./plot_api":199,"./template_api":204,"./to_image":205,"./validate":206}],198:[function(t,e,r){"use strict";var n=t("../lib/is_plain_object"),a=t("../lib/noop"),i=t("../lib/loggers"),o=t("../lib/search").sorterAsc,l=t("../registry");r.containerArrayMatch=t("./container_array_match");var s=r.isAddVal=function(t){return"add"===t||n(t)},c=r.isRemoveVal=function(t){return null===t||"remove"===t};r.applyContainerArrayChanges=function(t,e,r,n,u){var f=e.astr,d=l.getComponentMethod(f,"supplyLayoutDefaults"),p=l.getComponentMethod(f,"draw"),h=l.getComponentMethod(f,"drawOne"),g=n.replot||n.recalc||d===a||p===a,v=t.layout,y=t._fullLayout;if(r[""]){Object.keys(r).length>1&&i.warn("Full array edits are incompatible with other edits",f);var m=r[""][""];if(c(m))e.set(null);else{if(!Array.isArray(m))return i.warn("Unrecognized full array edit value",f,m),!0;e.set(m)}return!g&&(d(v,y),p(t),!0)}var x,b,_,w,k,T,M,A,L=Object.keys(r).map(Number).sort(o),S=e.get(),C=S||[],O=u(y,f).get(),z=[],D=-1,P=C.length;for(x=0;x<L.length;x++)if(w=r[_=L[x]],k=Object.keys(w),T=w[""],M=s(T),_<0||_>C.length-(M?0:1))i.warn("index out of range",f,_);else if(void 0!==T)k.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(T)?z.push(_):M?("add"===T&&(T={}),C.splice(_,0,T),O&&O.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,T),-1===D&&(D=_);else for(b=0;b<k.length;b++)A=f+"["+_+"].",u(C[_],k[b],A).set(w[k[b]]);for(x=z.length-1;x>=0;x--)C.splice(z[x],1),O&&O.splice(z[x],1);if(C.length?S||e.set(C):e.set(null),g)return!1;if(d(v,y),h!==a){var E;if(-1===D)E=L;else{for(P=Math.max(C.length,P),E=[],x=0;x<L.length&&!((_=L[x])>=D);x++)E.push(_);for(x=D;x<P;x++)E.push(x)}for(x=0;x<E.length;x++)h(t,E[x])}else p(t);return!0}},{"../lib/is_plain_object":169,"../lib/loggers":172,"../lib/noop":177,"../lib/search":186,"../registry":257,"./container_array_match":194}],199:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("has-hover"),o=t("../lib"),l=o.nestedProperty,s=t("../lib/events"),c=t("../lib/queue"),u=t("../registry"),f=t("./plot_schema"),d=t("../plots/plots"),p=t("../plots/polar/legacy"),h=t("../plots/cartesian/axes"),g=t("../components/drawing"),v=t("../components/color"),y=t("../components/colorbar/connect"),m=t("../plots/cartesian/graph_interact").initInteractions,x=t("../constants/xmlns_namespaces"),b=t("../lib/svg_text_utils"),_=t("./plot_config").dfltConfig,w=t("./manage_arrays"),k=t("./helpers"),T=t("./subroutines"),M=t("./edit_types"),A=t("../plots/cartesian/constants").AX_NAME_PATTERN,L=0;function S(t){var e=t._fullLayout;e._redrawFromAutoMarginCount?e._redrawFromAutoMarginCount--:t.emit("plotly_afterplot")}function C(t,e){try{t._fullLayout._paper.style("background",e)}catch(t){o.error(t)}}function O(t,e){C(t,v.combine(e,"white"))}function z(t,e){if(!t._context){t._context=o.extendDeep({},_);var r=n.select("base");t._context._baseUrl=r.size()&&r.attr("href")?window.location.href.split("#")[0]:""}var a,l,s,c=t._context;if(e){for(l=Object.keys(e),a=0;a<l.length;a++)"editable"!==(s=l[a])&&"edits"!==s&&s in c&&("setBackground"===s&&"opaque"===e[s]?c[s]=O:c[s]=e[s]);e.plot3dPixelRatio&&!c.plotGlPixelRatio&&(c.plotGlPixelRatio=c.plot3dPixelRatio);var u=e.editable;if(void 0!==u)for(c.editable=u,l=Object.keys(c.edits),a=0;a<l.length;a++)c.edits[l[a]]=u;if(e.edits)for(l=Object.keys(e.edits),a=0;a<l.length;a++)(s=l[a])in c.edits&&(c.edits[s]=e.edits[s]);c._exportedPlot=e._exportedPlot}c.staticPlot&&(c.editable=!1,c.edits={},c.autosizable=!1,c.scrollZoom=!1,c.doubleClick=!1,c.showTips=!1,c.showLink=!1,c.displayModeBar=!1),"hover"!==c.displayModeBar||i||(c.displayModeBar=!0),"transparent"!==c.setBackground&&"function"==typeof c.setBackground||(c.setBackground=C),c._hasZeroHeight=c._hasZeroHeight||0===t.clientHeight,c._hasZeroWidth=c._hasZeroWidth||0===t.clientWidth;var f=c.scrollZoom,d=c._scrollZoom={};if(!0===f)d.cartesian=1,d.gl3d=1,d.geo=1,d.mapbox=1;else if("string"==typeof f){var p=f.split("+");for(a=0;a<p.length;a++)d[p[a]]=1}else!1!==f&&(d.gl3d=1,d.geo=1,d.mapbox=1)}function D(t,e){var r,n,a=e+1,i=[];for(r=0;r<t.length;r++)(n=t[r])<0?i.push(a+n):i.push(n);return i}function P(t,e,r){var n,a;for(n=0;n<e.length;n++){if((a=e[n])!==parseInt(a,10))throw new Error("all values in "+r+" must be integers");if(a>=t.data.length||a<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(a,n+1)>-1||a>=0&&e.indexOf(-t.data.length+a)>-1||a<0&&e.indexOf(t.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function E(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),P(t,e,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&P(t,r,"newIndices"),"undefined"!=typeof r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function R(t,e,r,n,i){!function(t,e,r,n){var a=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if("undefined"==typeof r)throw new Error("indices must be an integer or array of integers");for(var i in P(t,r,"indices"),e){if(!Array.isArray(e[i])||e[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==e[i].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var s=function(t,e,r,n){var i,s,c,u,f,d=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=D(r,t.data.length-1),e)for(var g=0;g<r.length;g++){if(i=t.data[r[g]],s=(c=l(i,h)).get(),u=e[h][g],!o.isArrayOrTypedArray(u))throw new Error("attribute: "+h+" index: "+g+" must be an array");if(!o.isArrayOrTypedArray(s))throw new Error("cannot extend missing or non-array attribute: "+h);if(s.constructor!==u.constructor)throw new Error("cannot extend array with an array of a different type: "+h);f=d?n[h][g]:n,a(f)||(f=-1),p.push({prop:c,target:s,insert:u,maxp:Math.floor(f)})}return p}(t,e,r,n),c={},u={},f=0;f<s.length;f++){var d=s[f].prop,p=s[f].maxp,h=i(s[f].target,s[f].insert,p);d.set(h[0]),Array.isArray(c[d.astr])||(c[d.astr]=[]),c[d.astr].push(h[1]),Array.isArray(u[d.astr])||(u[d.astr]=[]),u[d.astr].push(s[f].target.length)}return{update:c,maxPoints:u}}function I(t,e){var r=new t.constructor(t.length+e.length);return r.set(t),r.set(e,t.length),r}function F(t,e,n,a){t=o.getGraphDiv(t),k.clearPromiseQueue(t);var i={};if("string"==typeof e)i[e]=n;else{if(!o.isPlainObject(e))return o.warn("Restyle fail.",e,n,a),Promise.reject();i=o.extendFlat({},e),void 0===a&&(a=n)}Object.keys(i).length&&(t.changed=!0);var l=k.coerceTraceIndices(t,a),s=H(t,i,l),u=s.flags;u.calc&&(t.calcdata=void 0),u.clearAxisTypes&&k.clearAxisTypes(t,l,{});var f=[];u.fullReplot?f.push(r.plot):(f.push(d.previousPromises),d.supplyDefaults(t),u.markerSize&&(d.doCalcdata(t),G(f)),u.style&&f.push(T.doTraceStyle),u.colorbars&&f.push(T.doColorBars),f.push(S)),f.push(d.rehover),c.add(t,F,[t,s.undoit,s.traces],F,[t,s.redoit,s.traces]);var p=o.syncOrAsync(f,t);return p&&p.then||(p=Promise.resolve()),p.then(function(){return t.emit("plotly_restyle",s.eventData),t})}function N(t){return void 0===t?null:t}function B(t,e){return e?function(e,r,n){var a=l(e,r),i=a.set;return a.set=function(e){j((n||"")+r,a.get(),e,t),i(e)},a}:l}function j(t,e,r,n){if(Array.isArray(e)||Array.isArray(r))for(var a=Array.isArray(e)?e:[],i=Array.isArray(r)?r:[],l=Math.max(a.length,i.length),s=0;s<l;s++)j(t+"["+s+"]",a[s],i[s],n);else if(o.isPlainObject(e)||o.isPlainObject(r)){var c=o.isPlainObject(e)?e:{},u=o.isPlainObject(r)?r:{},f=o.extendFlat({},c,u);for(var d in f)j(t+"."+d,c[d],u[d],n)}else void 0===n[t]&&(n[t]=N(e))}function H(t,e,r){var n,a=t._fullLayout,i=t._fullData,s=t.data,c=a._guiEditing,p=B(a._preGUI,c),g=o.extendDeepAll({},e);q(e);var v,y=M.traceFlags(),m={},x={};function b(){return r.map(function(){})}function _(t){var e=h.id2name(t);-1===v.indexOf(e)&&v.push(e)}function w(t){return"LAYOUT"+t+".autorange"}function T(t){return"LAYOUT"+t+".range"}function A(t){for(var e=t;e<i.length;e++)if(i[e]._input===s[t])return i[e]}function L(n,i,o){if(Array.isArray(n))n.forEach(function(t){L(t,i,o)});else if(!(n in e||k.hasParent(e,n))){var l;if("LAYOUT"===n.substr(0,6))l=p(t.layout,n.replace("LAYOUT",""));else{var u=r[o];l=B(a._tracePreGUI[A(u)._fullInput.uid],c)(s[u],n)}n in x||(x[n]=b()),void 0===x[n][o]&&(x[n][o]=N(l.get())),void 0!==i&&l.set(i)}}function S(t){return function(e){return i[e][t]}}function C(t){return function(e,n){return!1===e?i[r[n]][t]:null}}for(var O in e){if(k.hasParent(e,O))throw new Error("cannot set "+O+"and a parent attribute simultaneously");var z,D,P,E,R,I,F=e[O];if("autobinx"!==O&&"autobiny"!==O||(O=O.charAt(O.length-1)+"bins",F=Array.isArray(F)?F.map(C(O)):!1===F?r.map(S(O)):null),m[O]=F,"LAYOUT"!==O.substr(0,6)){for(x[O]=b(),n=0;n<r.length;n++){if(z=s[r[n]],D=A(r[n]),E=(P=B(a._tracePreGUI[D._fullInput.uid],c)(z,O)).get(),void 0!==(R=Array.isArray(F)?F[n%F.length]:F)){var j=P.parts[P.parts.length-1],H=O.substr(0,O.length-j.length-1),V=H?H+".":"",U=H?l(D,H).get():D;if((I=f.getTraceValObject(D,P.parts))&&I.impliedEdits&&null!==R)for(var G in I.impliedEdits)L(o.relativeAttr(O,G),I.impliedEdits[G],n);else if("thicknessmode"!==j&&"lenmode"!==j||E===R||"fraction"!==R&&"pixels"!==R||!U){if("type"===O&&"pie"===R!=("pie"===E)){var Z="x",X="y";"bar"!==R&&"bar"!==E||"h"!==z.orientation||(Z="y",X="x"),o.swapAttrs(z,["?","?src"],"labels",Z),o.swapAttrs(z,["d?","?0"],"label",Z),o.swapAttrs(z,["?","?src"],"values",X),"pie"===E?(l(z,"marker.color").set(l(z,"marker.colors").get()),a._pielayer.selectAll("g.trace").remove()):u.traceIs(z,"cartesian")&&l(z,"marker.colors").set(l(z,"marker.color").get())}}else{var Y=a._size,W=U.orient,J="top"===W||"bottom"===W;if("thicknessmode"===j){var $=J?Y.h:Y.w;L(V+"thickness",U.thickness*("fraction"===R?1/$:$),n)}else{var Q=J?Y.w:Y.h;L(V+"len",U.len*("fraction"===R?1/Q:Q),n)}}x[O][n]=N(E);if(-1!==["swapxy","swapxyaxes","orientation","orientationaxes"].indexOf(O)){if("orientation"===O){P.set(R);var K=z.x&&!z.y?"h":"v";if((P.get()||K)===D.orientation)continue}else"orientationaxes"===O&&(z.orientation={v:"h",h:"v"}[D.orientation]);k.swapXYData(z),y.calc=y.clearAxisTypes=!0}else-1!==d.dataArrayContainers.indexOf(P.parts[0])?(k.manageArrayContainers(P,R,x),y.calc=!0):(I?I.arrayOk&&!u.traceIs(D,"regl")&&(o.isArrayOrTypedArray(R)||o.isArrayOrTypedArray(E))?y.calc=!0:M.update(y,I):y.calc=!0,P.set(R))}}if(-1!==["swapxyaxes","orientationaxes"].indexOf(O)&&h.swap(t,r),"orientationaxes"===O){var tt=l(t.layout,"hovermode");"x"===tt.get()?tt.set("y"):"y"===tt.get()&&tt.set("x")}if(-1!==["orientation","type"].indexOf(O)){for(v=[],n=0;n<r.length;n++){var et=s[r[n]];u.traceIs(et,"cartesian")&&(_(et.xaxis||"x"),_(et.yaxis||"y"))}L(v.map(w),!0,0),L(v.map(T),[0,1],0)}}else P=p(t.layout,O.replace("LAYOUT","")),x[O]=[N(P.get())],P.set(Array.isArray(F)?F[0]:F),y.calc=!0}return(y.calc||y.plot)&&(y.fullReplot=!0),{flags:y,undoit:x,redoit:m,traces:r,eventData:o.extendDeepNoArrays([],[g,r])}}function q(t){var e,r,n,a=o.counterRegex("axis",".title",!1,!1),i=/colorbar\.title$/,l=Object.keys(t);for(e=0;e<l.length;e++)r=l[e],n=t[r],"title"!==r&&!a.test(r)&&!i.test(r)||"string"!=typeof n&&"number"!=typeof n?r.indexOf("titlefont")>-1?s(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?s(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?s(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&s(r,r.replace("titleoffset","title.offset")):s(r,r.replace("title","title.text"));function s(e,r){t[r]=t[e],delete t[e]}}function V(t,e,r){if(t=o.getGraphDiv(t),k.clearPromiseQueue(t),t.framework&&t.framework.isPolar)return Promise.resolve(t);var n={};if("string"==typeof e)n[e]=r;else{if(!o.isPlainObject(e))return o.warn("Relayout fail.",e,r),Promise.reject();n=o.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var a=W(t,n),i=a.flags;i.calc&&(t.calcdata=void 0);var l=[d.previousPromises];i.layoutReplot?l.push(T.layoutReplot):Object.keys(n).length&&(U(t,i,a)||d.supplyDefaults(t),i.legend&&l.push(T.doLegend),i.layoutstyle&&l.push(T.layoutStyles),i.axrange&&G(l,a.rangesAltered),i.ticks&&l.push(T.doTicksRelayout),i.modebar&&l.push(T.doModeBar),i.camera&&l.push(T.doCamera),l.push(S)),l.push(d.rehover),c.add(t,V,[t,a.undoit],V,[t,a.redoit]);var s=o.syncOrAsync(l,t);return s&&s.then||(s=Promise.resolve(t)),s.then(function(){return t.emit("plotly_relayout",a.eventData),t})}function U(t,e,r){var n;if(!e.axrange)return!1;for(n in e)if("axrange"!==n&&e[n])return!1;for(n in r.rangesAltered){var a=h.id2name(n),i=t.layout[a],o=t._fullLayout[a];o.autorange=i.autorange,o.range=i.range.slice(),o.cleanRange()}return!0}function G(t,e){var r=e?function(t){var r={skipTitle:!0};for(var n in e)if(h.getFromId(t,n).automargin){r={};break}return h.draw(t,Object.keys(e),r)}:function(t){return h.draw(t,"redraw")};t.push(T.doAutoRangeAndConstraints,r,T.drawData,T.finalDraw)}r.plot=function(t,e,a,i){var l;if(t=o.getGraphDiv(t),s.init(t),o.isPlainObject(e)){var c=e;e=c.data,a=c.layout,i=c.config,l=c.frames}if(!1===s.triggerHandler(t,"plotly_beforeplot",[e,a,i]))return Promise.reject();e||a||o.isPlotDiv(t)||o.warn("Calling Plotly.plot as if redrawing but this container doesn't yet have a plot.",t),z(t,i),a||(a={}),n.select(t).classed("js-plotly-plot",!0),g.makeTester(),Array.isArray(t._promises)||(t._promises=[]);var f=0===(t.data||[]).length&&Array.isArray(e);if(Array.isArray(e)&&(k.cleanData(e),f?t.data=e:t.data.push.apply(t.data,e),t.empty=!1),t.layout&&!f||(t.layout=k.cleanLayout(a)),t._dragging&&!t._transitioning)return t._replotPending=!0,Promise.reject();t._replotPending=!1,d.supplyDefaults(t);var v=t._fullLayout,x=v._has("cartesian");if(!v._has("polar")&&e&&e[0]&&e[0].r)return o.log("Legacy polar charts are deprecated!"),function(t,e,r){var a=n.select(t).selectAll(".plot-container").data([0]);a.enter().insert("div",":first-child").classed("plot-container plotly",!0);var i=a.selectAll(".svg-container").data([0]);i.enter().append("div").classed("svg-container",!0).style("position","relative"),i.html(""),e&&(t.data=e);r&&(t.layout=r);p.manager.fillLayout(t),i.style({width:t._fullLayout.width+"px",height:t._fullLayout.height+"px"}),t.framework=p.manager.framework(t),t.framework({data:t.data,layout:t.layout},i.node()),t.framework.setUndoPoint();var l=t.framework.svg(),s=1,c=t._fullLayout.title?t._fullLayout.title.text:"";""!==c&&c||(s=0);var u=function(){this.call(b.convertToTspans,t)},f=l.select(".title-group text").call(u);if(t._context.edits.titleText){var h=o._(t,"Click to enter Plot title");c&&c!==h||(s=.2,f.attr({"data-unformatted":h}).text(h).style({opacity:s}).on("mouseover.opacity",function(){n.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(1e3).style("opacity",0)}));var g=function(){this.call(b.makeEditable,{gd:t}).on("edit",function(e){t.framework({layout:{title:{text:e}}}),this.text(e).call(u),this.call(g)}).on("cancel",function(){var t=this.attr("data-unformatted");this.text(t).call(u)})};f.call(g)}return t._context.setBackground(t,t._fullLayout.paper_bgcolor),d.addLinks(t),Promise.resolve()}(t,e,a);v._replotting=!0,f&<(t),t.framework!==lt&&(t.framework=lt,lt(t)),g.initGradients(t),f&&h.saveShowSpikeInitial(t);var _=!t.calcdata||t.calcdata.length!==(t._fullData||[]).length;_&&d.doCalcdata(t);for(var w=0;w<t.calcdata.length;w++)t.calcdata[w][0].trace=t._fullData[w];t._context.responsive?t._responsiveChartHandler||(t._responsiveChartHandler=function(){d.resize(t)},window.addEventListener("resize",t._responsiveChartHandler)):o.clearResponsive(t);var M=JSON.stringify(v._size),A=0;function L(){var e,r,n,a=t.calcdata;for(d.clearAutoMarginIds(t),T.drawMarginPushers(t),h.allowAutoMargin(t),e=0;e<a.length;e++){var i=(n=(r=a[e])[0].trace)._module.colorbar;!0===n.visible&&i?y(t,r,i):d.autoMargin(t,"cb"+n.uid)}return d.doAutoMargin(t),d.previousPromises(t)}function C(){t._transitioning||(T.doAutoRangeAndConstraints(t),f&&h.saveRangeInitial(t),u.getComponentMethod("rangeslider","calcAutorange")(t))}var O=[d.previousPromises,function(){if(l)return r.addFrames(t,l)},function e(){for(var r=v._basePlotModules,n=0;n<r.length;n++)r[n].drawFramework&&r[n].drawFramework(t);if(!v._glcanvas&&v._has("gl")&&(v._glcanvas=v._glcontainer.selectAll(".gl-canvas").data([{key:"contextLayer",context:!0,pick:!1},{key:"focusLayer",context:!1,pick:!1},{key:"pickLayer",context:!1,pick:!0}],function(t){return t.key}),v._glcanvas.enter().append("canvas").attr("class",function(t){return"gl-canvas gl-canvas-"+t.key.replace("Layer","")}).style({position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"visible","pointer-events":"none"})),v._glcanvas){v._glcanvas.attr("width",v.width).attr("height",v.height);var a=v._glcanvas.data()[0].regl;if(a&&(Math.floor(v.width)!==a._gl.drawingBufferWidth||Math.floor(v.height)!==a._gl.drawingBufferHeight)){var i="WebGL context buffer and canvas dimensions do not match due to browser/WebGL bug.";if(!A)return o.log(i+" Clearing graph and plotting again."),d.cleanPlot([],{},t._fullData,v),d.supplyDefaults(t),v=t._fullLayout,d.doCalcdata(t),A++,e();o.error(i)}}return d.previousPromises(t)},L,function(){if(JSON.stringify(v._size)!==M)return o.syncOrAsync([L,T.layoutStyles],t)}];x&&O.push(function(){if(_)return o.syncOrAsync([u.getComponentMethod("shapes","calcAutorange"),u.getComponentMethod("annotations","calcAutorange"),C],t);C()}),O.push(T.layoutStyles),x&&O.push(function(){return h.draw(t,f?"":"redraw")}),O.push(T.drawData,T.finalDraw,m,d.addLinks,d.rehover,d.doAutoMargin,d.previousPromises);var D=o.syncOrAsync(O,t);return D&&D.then||(D=Promise.resolve()),D.then(function(){return S(t),t})},r.setPlotConfig=function(t){return o.extendFlat(_,t)},r.redraw=function(t){if(t=o.getGraphDiv(t),!o.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);return k.cleanData(t.data),k.cleanLayout(t.layout),t.calcdata=void 0,r.plot(t).then(function(){return t.emit("plotly_redraw"),t})},r.newPlot=function(t,e,n,a){return t=o.getGraphDiv(t),d.cleanPlot([],{},t._fullData||[],t._fullLayout||{}),d.purge(t),r.plot(t,e,n,a)},r.extendTraces=function t(e,n,a,i){var l=R(e=o.getGraphDiv(e),n,a,i,function(t,e,r){var n,a;if(o.isTypedArray(t))if(r<0){var i=new t.constructor(0),l=I(t,e);r<0?(n=l,a=i):(n=i,a=l)}else if(n=new t.constructor(r),a=new t.constructor(t.length+e.length-r),r===e.length)n.set(e),a.set(t);else if(r<e.length){var s=e.length-r;n.set(e.subarray(s)),a.set(t),a.set(e.subarray(0,s),t.length)}else{var c=r-e.length,u=t.length-c;n.set(t.subarray(u)),n.set(e,c),a.set(t.subarray(0,u))}else n=t.concat(e),a=r>=0&&r<n.length?n.splice(0,n.length-r):[];return[n,a]}),s=r.redraw(e),u=[e,l.update,a,l.maxPoints];return c.add(e,r.prependTraces,u,t,arguments),s},r.prependTraces=function t(e,n,a,i){var l=R(e=o.getGraphDiv(e),n,a,i,function(t,e,r){var n,a;if(o.isTypedArray(t))if(r<=0){var i=new t.constructor(0),l=I(e,t);r<0?(n=l,a=i):(n=i,a=l)}else if(n=new t.constructor(r),a=new t.constructor(t.length+e.length-r),r===e.length)n.set(e),a.set(t);else if(r<e.length){var s=e.length-r;n.set(e.subarray(0,s)),a.set(e.subarray(s)),a.set(t,s)}else{var c=r-e.length;n.set(e),n.set(t.subarray(0,c),e.length),a.set(t.subarray(c))}else n=e.concat(t),a=r>=0&&r<n.length?n.splice(r,n.length):[];return[n,a]}),s=r.redraw(e),u=[e,l.update,a,l.maxPoints];return c.add(e,r.extendTraces,u,t,arguments),s},r.addTraces=function t(e,n,a){e=o.getGraphDiv(e);var i,l,s=[],u=r.deleteTraces,f=t,d=[e,s],p=[e,n];for(function(t,e,r){var n,a;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n<e.length;n++)if("object"!=typeof(a=e[n])||Array.isArray(a)||null===a)throw new Error("all values in traces array must be non-array objects");if("undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&r.length!==e.length)throw new Error("if indices is specified, traces.length must equal indices.length")}(e,n,a),Array.isArray(n)||(n=[n]),n=n.map(function(t){return o.extendFlat({},t)}),k.cleanData(n),i=0;i<n.length;i++)e.data.push(n[i]);for(i=0;i<n.length;i++)s.push(-n.length+i);if("undefined"==typeof a)return l=r.redraw(e),c.add(e,u,d,f,p),l;Array.isArray(a)||(a=[a]);try{E(e,s,a)}catch(t){throw e.data.splice(e.data.length-n.length,n.length),t}return c.startSequence(e),c.add(e,u,d,f,p),l=r.moveTraces(e,s,a),c.stopSequence(e),l},r.deleteTraces=function t(e,n){e=o.getGraphDiv(e);var a,i,l=[],s=r.addTraces,u=t,f=[e,l,n],d=[e,n];if("undefined"==typeof n)throw new Error("indices must be an integer or array of integers.");for(Array.isArray(n)||(n=[n]),P(e,n,"indices"),(n=D(n,e.data.length-1)).sort(o.sorterDes),a=0;a<n.length;a+=1)i=e.data.splice(n[a],1)[0],l.push(i);var p=r.redraw(e);return c.add(e,s,f,u,d),p},r.moveTraces=function t(e,n,a){var i,l=[],s=[],u=t,f=t,d=[e=o.getGraphDiv(e),a,n],p=[e,n,a];if(E(e,n,a),n=Array.isArray(n)?n:[n],"undefined"==typeof a)for(a=[],i=0;i<n.length;i++)a.push(-n.length+i);for(a=Array.isArray(a)?a:[a],n=D(n,e.data.length-1),a=D(a,e.data.length-1),i=0;i<e.data.length;i++)-1===n.indexOf(i)&&l.push(e.data[i]);for(i=0;i<n.length;i++)s.push({newIndex:a[i],trace:e.data[n[i]]});for(s.sort(function(t,e){return t.newIndex-e.newIndex}),i=0;i<s.length;i+=1)l.splice(s[i].newIndex,0,s[i].trace);e.data=l;var h=r.redraw(e);return c.add(e,u,d,f,p),h},r.restyle=F,r._storeDirectGUIEdit=function(t,e,r){for(var n in r){j(n,l(t,n).get(),r[n],e)}},r.relayout=V;var Z=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,X=/^[xyz]axis[0-9]*\.autorange$/,Y=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function W(t,e){var r,n,a,i=t.layout,s=t._fullLayout,c=s._guiEditing,d=B(s._preGUI,c),p=Object.keys(e),g=h.list(t),v=o.extendDeepAll({},e),y={};for(q(e),p=Object.keys(e),n=0;n<p.length;n++)if(0===p[n].indexOf("allaxes")){for(a=0;a<g.length;a++){var m=g[a]._id.substr(1),x=-1!==m.indexOf("scene")?m+".":"",b=p[n].replace("allaxes",x+g[a]._name);e[b]||(e[b]=e[p[n]])}delete e[p[n]]}var _=M.layoutFlags(),T={},L={};function S(t,r){if(Array.isArray(t))t.forEach(function(t){S(t,r)});else if(!(t in e||k.hasParent(e,t))){var n=d(i,t);t in L||(L[t]=N(n.get())),void 0!==r&&n.set(r)}}var C,O={};function z(t){var e=h.name2id(t.split(".")[0]);return O[e]=1,e}for(var D in e){if(k.hasParent(e,D))throw new Error("cannot set "+D+"and a parent attribute simultaneously");for(var P=d(i,D),E=e[D],R=P.parts.length-1;R>0&&"string"!=typeof P.parts[R];)R--;var I=P.parts[R],F=P.parts[R-1]+"."+I,j=P.parts.slice(0,R).join("."),H=l(t.layout,j).get(),V=l(s,j).get(),U=P.get();if(void 0!==E){T[D]=E,L[D]="reverse"===I?E:N(U);var G=f.getLayoutValObject(s,P.parts);if(G&&G.impliedEdits&&null!==E)for(var W in G.impliedEdits)S(o.relativeAttr(D,W),G.impliedEdits[W]);if(-1!==["width","height"].indexOf(D))if(E){S("autosize",null);var $="height"===D?"width":"height";S($,s[$])}else s[D]=t._initialAutoSize[D];else if("autosize"===D)S("width",E?null:s.width),S("height",E?null:s.height);else if(F.match(Z))z(F),l(s,j+"._inputRange").set(null);else if(F.match(X)){z(F),l(s,j+"._inputRange").set(null);var Q=l(s,j).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else F.match(Y)&&l(s,j+"._inputDomain").set(null);if("type"===I){var K=H,tt="linear"===V.type&&"log"===E,et="log"===V.type&&"linear"===E;if(tt||et){if(K&&K.range)if(V.autorange)tt&&(K.range=K.range[1]>K.range[0]?[1,2]:[2,1]);else{var rt=K.range[0],nt=K.range[1];tt?(rt<=0&&nt<=0&&S(j+".autorange",!0),rt<=0?rt=nt/1e6:nt<=0&&(nt=rt/1e6),S(j+".range[0]",Math.log(rt)/Math.LN10),S(j+".range[1]",Math.log(nt)/Math.LN10)):(S(j+".range[0]",Math.pow(10,rt)),S(j+".range[1]",Math.pow(10,nt)))}else S(j+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[P.parts[0]]&&"radialaxis"===P.parts[1]&&delete s[P.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(t,V,E,S),u.getComponentMethod("images","convertCoords")(t,V,E,S)}else S(j+".autorange",!0),S(j+".range",null);l(s,j+"._inputRange").set(null)}else if(I.match(A)){var at=l(s,D).get(),it=(E||{}).type;it&&"-"!==it||(it="linear"),u.getComponentMethod("annotations","convertCoords")(t,at,it,S),u.getComponentMethod("images","convertCoords")(t,at,it,S)}var ot=w.containerArrayMatch(D);if(ot){r=ot.array,n=ot.index;var lt=ot.property,st=G||{editType:"calc"};""!==n&&""===lt&&(w.isAddVal(E)?L[D]=null:w.isRemoveVal(E)?L[D]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",e)),M.update(_,st),y[r]||(y[r]={});var ct=y[r][n];ct||(ct=y[r][n]={}),ct[lt]=E,delete e[D]}else"reverse"===I?(H.range?H.range.reverse():(S(j+".autorange",!0),H.range=[1,0]),V.autorange?_.calc=!0:_.plot=!0):(s._has("scatter-like")&&s._has("regl")&&"dragmode"===D&&("lasso"===E||"select"===E)&&"lasso"!==U&&"select"!==U?_.plot=!0:G?M.update(_,G):_.calc=!0,P.set(E))}}for(r in y){w.applyContainerArrayChanges(t,d(i,r),y[r],_,d)||(_.plot=!0)}var ut=s._axisConstraintGroups||[];for(C in O)for(n=0;n<ut.length;n++){var ft=ut[n];if(ft[C])for(var dt in _.calc=!0,ft)O[dt]||(h.getFromId(t,dt)._constraintShrinkable=!0)}return(J(t)||e.height||e.width)&&(_.plot=!0),(_.plot||_.calc)&&(_.layoutReplot=!0),{flags:_,rangesAltered:O,undoit:L,redoit:T,eventData:v}}function J(t){var e=t._fullLayout,r=e.width,n=e.height;return t.layout.autosize&&d.plotAutoSize(t,t.layout,e),e.width!==r||e.height!==n}function $(t,e,n,a){if(t=o.getGraphDiv(t),k.clearPromiseQueue(t),t.framework&&t.framework.isPolar)return Promise.resolve(t);o.isPlainObject(e)||(e={}),o.isPlainObject(n)||(n={}),Object.keys(e).length&&(t.changed=!0),Object.keys(n).length&&(t.changed=!0);var i=k.coerceTraceIndices(t,a),l=H(t,o.extendFlat({},e),i),s=l.flags,u=W(t,o.extendFlat({},n)),f=u.flags;(s.calc||f.calc)&&(t.calcdata=void 0),s.clearAxisTypes&&k.clearAxisTypes(t,i,n);var p=[];if(s.fullReplot&&f.layoutReplot){var h=t.data,g=t.layout;t.data=void 0,t.layout=void 0,p.push(function(){return r.plot(t,h,g)})}else s.fullReplot?p.push(r.plot):f.layoutReplot?p.push(T.layoutReplot):(p.push(d.previousPromises),U(t,f,u)||d.supplyDefaults(t),s.style&&p.push(T.doTraceStyle),s.colorbars&&p.push(T.doColorBars),f.legend&&p.push(T.doLegend),f.layoutstyle&&p.push(T.layoutStyles),f.axrange&&G(p,u.rangesAltered),f.ticks&&p.push(T.doTicksRelayout),f.modebar&&p.push(T.doModeBar),f.camera&&p.push(T.doCamera),p.push(S));p.push(d.rehover),c.add(t,$,[t,l.undoit,u.undoit,l.traces],$,[t,l.redoit,u.redoit,l.traces]);var v=o.syncOrAsync(p,t);return v&&v.then||(v=Promise.resolve(t)),v.then(function(){return t.emit("plotly_update",{data:l.eventData,layout:u.eventData}),t})}function Q(t){return function(e){e._fullLayout._guiEditing=!0;var r=t.apply(null,arguments);return e._fullLayout._guiEditing=!1,r}}r.update=$,r._guiRestyle=Q(F),r._guiRelayout=Q(V),r._guiUpdate=Q($);var K=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],tt=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function et(t,e){for(var r=0;r<e.length;r++){var n=e[r],a=t.match(n.pattern);if(a)return{head:a[1],attr:n.attr}}}function rt(t,e){var r=l(e,t).get();if(void 0!==r)return r;var n=t.split(".");for(n.pop();n.length>1;)if(n.pop(),void 0!==(r=l(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function nt(t,e){for(var r=0;r<e.length;r++)if(e[r]._fullInput.uid===t)return r;return-1}function at(t,e,r){for(var n=0;n<e.length;n++)if(e[n].uid===t)return n;return!e[r]||e[r].uid?-1:r}function it(t,e){var r=o.isPlainObject(t),n=Array.isArray(t);return r||n?(r&&o.isPlainObject(e)||n&&Array.isArray(e))&&JSON.stringify(t)===JSON.stringify(e):t===e}function ot(t,e,r,n){var a,i,s,c=n.getValObject,u=n.flags,f=n.immutable,d=n.inArray,p=n.arrayIndex;function h(){var t=a.editType;d&&-1!==t.indexOf("arraydraw")?o.pushUnique(u.arrays[d],p):(M.update(u,a),"none"!==t&&u.nChanges++,n.transition&&a.anim&&u.nChangesAnim++,(Z.test(s)||X.test(s))&&(u.rangesAltered[r[0]]=1),Y.test(s)&&l(e,"_inputDomain").set(null),"datarevision"===i&&(u.newDataRevision=1))}function g(t){return"data_array"===t.valType||t.arrayOk}for(i in t){if(u.calc&&!n.transition)return;var v=t[i],y=e[i],m=r.concat(i);if(s=m.join("."),"_"!==i.charAt(0)&&"function"!=typeof v&&v!==y){if(("tick0"===i||"dtick"===i)&&"geo"!==r[0]){var x=e.tickmode;if("auto"===x||"array"===x||!x)continue}if(("range"!==i||!e.autorange)&&("zmin"!==i&&"zmax"!==i||"contourcarpet"!==e.type)&&(a=c(m))&&(!a._compareAsJSON||JSON.stringify(v)!==JSON.stringify(y))){var b,_=a.valType,w=g(a),k=Array.isArray(v),T=Array.isArray(y);if(k&&T){var A="_input_"+i,L=t[A],S=e[A];if(Array.isArray(L)&&L===S)continue}if(void 0===y)w&&k?u.calc=!0:h();else if(a._isLinkedToArray){var C=[],O=!1;d||(u.arrays[i]=C);var z=Math.min(v.length,y.length),D=Math.max(v.length,y.length);if(z!==D){if("arraydraw"!==a.editType){h();continue}O=!0}for(b=0;b<z;b++)ot(v[b],y[b],m.concat(b),o.extendFlat({inArray:i,arrayIndex:b},n));if(O)for(b=z;b<D;b++)C.push(b)}else!_&&o.isPlainObject(v)?ot(v,y,m,n):w?k&&T?(f&&(u.calc=!0),(f||n.newDataRevision)&&h()):k!==T?u.calc=!0:h():k&&T&&v.length===y.length&&String(v)===String(y)||h()}}}for(i in e)if(!(i in t||"_"===i.charAt(0)||"function"==typeof e[i])){if(g(a=c(r.concat(i)))&&Array.isArray(e[i]))return void(u.calc=!0);h()}}function lt(t){var e=n.select(t),r=t._fullLayout;if(r._container=e.selectAll(".plot-container").data([0]),r._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0),r._paperdiv=r._container.selectAll(".svg-container").data([0]),r._paperdiv.enter().append("div").classed("svg-container",!0).style("position","relative"),r._glcontainer=r._paperdiv.selectAll(".gl-container").data([{}]),r._glcontainer.enter().append("div").classed("gl-container",!0),r._paperdiv.selectAll(".main-svg").remove(),r._paper=r._paperdiv.insert("svg",":first-child").classed("main-svg",!0),r._toppaper=r._paperdiv.append("svg").classed("main-svg",!0),!r._uid){var a={};n.selectAll("defs").each(function(){this.id&&(a[this.id.split("-")[1]]=1)}),r._uid=o.randstr(a)}r._paperdiv.selectAll(".main-svg").attr(x.svgAttrs),r._defs=r._paper.append("defs").attr("id","defs-"+r._uid),r._clips=r._defs.append("g").classed("clips",!0),r._topdefs=r._toppaper.append("defs").attr("id","topdefs-"+r._uid),r._topclips=r._topdefs.append("g").classed("clips",!0),r._bgLayer=r._paper.append("g").classed("bglayer",!0),r._draggers=r._paper.append("g").classed("draglayer",!0);var i=r._paper.append("g").classed("layer-below",!0);r._imageLowerLayer=i.append("g").classed("imagelayer",!0),r._shapeLowerLayer=i.append("g").classed("shapelayer",!0),r._cartesianlayer=r._paper.append("g").classed("cartesianlayer",!0),r._polarlayer=r._paper.append("g").classed("polarlayer",!0),r._ternarylayer=r._paper.append("g").classed("ternarylayer",!0),r._geolayer=r._paper.append("g").classed("geolayer",!0),r._pielayer=r._paper.append("g").classed("pielayer",!0),r._glimages=r._paper.append("g").classed("glimages",!0);var l=r._toppaper.append("g").classed("layer-above",!0);r._imageUpperLayer=l.append("g").classed("imagelayer",!0),r._shapeUpperLayer=l.append("g").classed("shapelayer",!0),r._infolayer=r._toppaper.append("g").classed("infolayer",!0),r._menulayer=r._toppaper.append("g").classed("menulayer",!0),r._zoomlayer=r._toppaper.append("g").classed("zoomlayer",!0),r._hoverlayer=r._toppaper.append("g").classed("hoverlayer",!0),t.emit("plotly_framework")}r.react=function(t,e,n,a){var i,s;var c=(t=o.getGraphDiv(t))._fullData,p=t._fullLayout;if(o.isPlotDiv(t)&&c&&p){if(o.isPlainObject(e)){var h=e;e=h.data,n=h.layout,a=h.config,i=h.frames}var g=!1;if(a){var v=o.extendDeep({},t._context);t._context=void 0,z(t,a),g=function t(e,r){var n;for(n in e)if("_"!==n.charAt(0)){var a=e[n],i=r[n];if(a!==i)if(o.isPlainObject(a)&&o.isPlainObject(i)){if(t(a,i))return!0}else{if(!Array.isArray(a)||!Array.isArray(i))return!0;if(a.length!==i.length)return!0;for(var l=0;l<a.length;l++)if(a[l]!==i[l]){if(!o.isPlainObject(a[l])||!o.isPlainObject(i[l]))return!0;if(t(a[l],i[l]))return!0}}}}(v,t._context)}t.data=e||[],k.cleanData(t.data),t.layout=n||{},k.cleanLayout(t.layout),function(t,e,r,n){var a,i,s,c,u,f,d,p,h=n._preGUI,g=[],v={};for(a in h){if(u=et(a,K)){if(i=u.attr||u.head+".uirevision",(c=(s=l(n,i).get())&&rt(i,e))&&c===s&&(null===(f=h[a])&&(f=void 0),it(p=(d=l(e,a)).get(),f))){void 0===p&&"autorange"===a.substr(a.length-9)&&g.push(a.substr(0,a.length-10)),d.set(N(l(n,a).get()));continue}}else o.warn("unrecognized GUI edit: "+a);delete h[a],"range["===a.substr(a.length-8,6)&&(v[a.substr(0,a.length-9)]=1)}for(var y=0;y<g.length;y++){var m=g[y];if(v[m]){var x=l(e,m).get();x&&delete x.autorange}}var b=n._tracePreGUI;for(var _ in b){var w,k=b[_],T=null;for(a in k){if(!T){var M=nt(_,r);if(M<0){delete b[_];break}var A=at(_,t,(w=r[M]._fullInput).index);if(A<0){delete b[_];break}T=t[A]}if(u=et(a,tt)){if(u.attr?c=(s=l(n,u.attr).get())&&rt(u.attr,e):(s=w.uirevision,void 0===(c=T.uirevision)&&(c=e.uirevision)),c&&c===s&&(null===(f=k[a])&&(f=void 0),it(p=(d=l(T,a)).get(),f))){d.set(N(l(w,a).get()));continue}}else o.warn("unrecognized GUI edit: "+a+" in trace uid "+_);delete k[a]}}}(t.data,t.layout,c,p),d.supplyDefaults(t,{skipUpdateCalc:!0});var y=t._fullData,m=t._fullLayout,x=void 0===m.datarevision,b=m.transition,_=function(t,e,r,n,a){var i=M.layoutFlags();i.arrays={},i.rangesAltered={},i.nChanges=0,i.nChangesAnim=0,ot(e,r,[],{getValObject:function(t){return f.getLayoutValObject(r,t)},flags:i,immutable:n,transition:a,gd:t}),(i.plot||i.calc)&&(i.layoutReplot=!0);a&&i.nChanges&&i.nChangesAnim&&(i.anim=i.nChanges===i.nChangesAnim?"all":"some");return i}(t,p,m,x,b),w=_.newDataRevision,A=function(t,e,r,n,a,i){var o=e.length===r.length;if(!a&&!o)return{fullReplot:!0,calc:!0};var l,s,c=M.traceFlags();c.arrays={},c.nChanges=0,c.nChangesAnim=0;var u={getValObject:function(t){return f.getTraceValObject(s,t)},flags:c,immutable:n,transition:a,newDataRevision:i,gd:t},p={};for(l=0;l<e.length;l++)if(r[l]){if(s=r[l]._fullInput,d.hasMakesDataTransform(s)&&(s=r[l]),p[s.uid])continue;p[s.uid]=1,ot(e[l]._fullInput,s,[],u)}(c.calc||c.plot)&&(c.fullReplot=!0);a&&c.nChanges&&c.nChangesAnim&&(c.anim=c.nChanges===c.nChangesAnim&&o?"all":"some");return c}(t,c,y,x,b,w);J(t)&&(_.layoutReplot=!0),A.calc||_.calc?t.calcdata=void 0:d.supplyDefaultsUpdateCalc(t.calcdata,y);var L=[];if(i&&(t._transitionData={},d.createTransitionData(t),L.push(function(){return r.addFrames(t,i)})),m.transition&&!g&&(A.anim||_.anim))d.doCalcdata(t),T.doAutoRangeAndConstraints(t),L.push(function(){return d.transitionFromReact(t,A,_,p)});else if(A.fullReplot||_.layoutReplot||g)t._fullLayout._skipDefaults=!0,L.push(r.plot);else{for(var C in _.arrays){var O=_.arrays[C];if(O.length){var D=u.getComponentMethod(C,"drawOne");if(D!==o.noop)for(var P=0;P<O.length;P++)D(t,O[P]);else{var E=u.getComponentMethod(C,"draw");if(E===o.noop)throw new Error("cannot draw components: "+C);E(t)}}}L.push(d.previousPromises),A.style&&L.push(T.doTraceStyle),A.colorbars&&L.push(T.doColorBars),_.legend&&L.push(T.doLegend),_.layoutstyle&&L.push(T.layoutStyles),_.axrange&&G(L),_.ticks&&L.push(T.doTicksRelayout),_.modebar&&L.push(T.doModeBar),_.camera&&L.push(T.doCamera),L.push(S)}L.push(d.rehover),(s=o.syncOrAsync(L,t))&&s.then||(s=Promise.resolve(t))}else s=r.newPlot(t,e,n,a);return s.then(function(){return t.emit("plotly_react",{data:e,layout:n}),t})},r.animate=function(t,e,r){if(t=o.getGraphDiv(t),!o.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before animating it. For more details, see https://plot.ly/javascript/animations/");var n=t._transitionData;n._frameQueue||(n._frameQueue=[]);var a=(r=d.supplyAnimationDefaults(r)).transition,i=r.frame;function l(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}function s(t){return Array.isArray(i)?t>=i.length?i[0]:i[t]:i}function c(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise(function(i,u){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,d.transition(t,e.frame.data,e.frame.layout,k.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then(function(){e.onComplete&&e.onComplete()}),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&f()};e()}var h,g,v=0;function y(t){return Array.isArray(a)?v>=a.length?t.transitionOpts=a[v]:t.transitionOpts=a[0]:t.transitionOpts=a,v++,t}var m=[],x=null==e,b=Array.isArray(e);if(!x&&!b&&o.isPlainObject(e))m.push({type:"object",data:y(o.extendFlat({},e))});else if(x||-1!==["string","number"].indexOf(typeof e))for(h=0;h<n._frames.length;h++)(g=n._frames[h])&&(x||String(g.group)===String(e))&&m.push({type:"byname",name:String(g.name),data:y({name:g.name})});else if(b)for(h=0;h<e.length;h++){var _=e[h];-1!==["number","string"].indexOf(typeof _)?(_=String(_),m.push({type:"byname",name:_,data:y({name:_})})):o.isPlainObject(_)&&m.push({type:"object",data:y(o.extendFlat({},_))})}for(h=0;h<m.length;h++)if("byname"===(g=m[h]).type&&!n._frameHash[g.data.name])return o.warn('animate failure: frame not found: "'+g.data.name+'"'),void u();-1!==["next","immediate"].indexOf(r.mode)&&function(){if(0!==n._frameQueue.length){for(;n._frameQueue.length;){var e=n._frameQueue.pop();e.onInterrupt&&e.onInterrupt()}t.emit("plotly_animationinterrupted",[])}}(),"reverse"===r.direction&&m.reverse();var w=t._fullLayout._currentFrame;if(w&&r.fromcurrent){var T=-1;for(h=0;h<m.length;h++)if("byname"===(g=m[h]).type&&g.name===w){T=h;break}if(T>0&&T<m.length-1){var M=[];for(h=0;h<m.length;h++)g=m[h],("byname"!==m[h].type||h>T)&&M.push(g);m=M}}m.length>0?function(e){if(0!==e.length){for(var a=0;a<e.length;a++){var o;o="byname"===e[a].type?d.computeFrame(t,e[a].name):e[a].data;var f=s(a),h=l(a);h.duration=Math.min(h.duration,f.duration);var g={frame:o,name:e[a].name,frameOpts:f,transitionOpts:h};a===e.length-1&&(g.onComplete=c(i,2),g.onInterrupt=u),n._frameQueue.push(g)}"immediate"===r.mode&&(n._lastFrameAt=-1/0),n._animationRaf||p()}}(m):(t.emit("plotly_animated"),i())})},r.addFrames=function(t,e,r){if(t=o.getGraphDiv(t),null==e)return Promise.resolve();if(!o.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plot.ly/javascript/animations/");var n,a,i,l,s=t._transitionData._frames,u=t._transitionData._frameHash;if(!Array.isArray(e))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+e);var f=s.length+2*e.length,p=[],h={};for(n=e.length-1;n>=0;n--)if(o.isPlainObject(e[n])){var g=e[n].name,v=(u[g]||h[g]||{}).name,y=e[n].name,m=u[v]||h[v];v&&y&&"number"==typeof y&&m&&L<5&&(L++,o.warn('addFrames: overwriting frame "'+(u[v]||h[v]).name+'" with a frame whose name of type "number" also equates to "'+v+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===L&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h[g]={name:g},p.push({frame:d.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort(function(t,e){return t.index>e.index?-1:t.index<e.index?1:0});var x=[],b=[],_=s.length;for(n=p.length-1;n>=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+t._transitionData._counter++];);if(u[a.name]){for(i=0;i<s.length&&(s[i]||{}).name!==a.name;i++);x.push({type:"replace",index:i,value:a}),b.unshift({type:"replace",index:i,value:s[i]})}else l=Math.max(0,Math.min(p[n].index,_)),x.push({type:"insert",index:l,value:a}),b.unshift({type:"delete",index:l}),_++}var w=d.modifyFrames,k=d.modifyFrames,T=[t,b],M=[t,x];return c&&c.add(t,w,T,k,M),d.modifyFrames(t,x)},r.deleteFrames=function(t,e){if(t=o.getGraphDiv(t),!o.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);var r,n,a=t._transitionData._frames,i=[],l=[];if(!e)for(e=[],r=0;r<a.length;r++)e.push(r);for((e=e.slice(0)).sort(),r=e.length-1;r>=0;r--)n=e[r],i.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var s=d.modifyFrames,u=d.modifyFrames,f=[t,l],p=[t,i];return c&&c.add(t,s,f,u,p),d.modifyFrames(t,i)},r.purge=function(t){var e=(t=o.getGraphDiv(t))._fullLayout||{},r=t._fullData||[];return d.cleanPlot([],{},r,e),d.purge(t),s.purge(t),e._container&&e._container.remove(),delete t._context,t}},{"../components/color":51,"../components/colorbar/connect":53,"../components/drawing":72,"../constants/xmlns_namespaces":150,"../lib":168,"../lib/events":161,"../lib/queue":182,"../lib/svg_text_utils":189,"../plots/cartesian/axes":212,"../plots/cartesian/constants":218,"../plots/cartesian/graph_interact":222,"../plots/plots":245,"../plots/polar/legacy":248,"../registry":257,"./edit_types":195,"./helpers":196,"./manage_arrays":198,"./plot_config":200,"./plot_schema":201,"./subroutines":203,d3:16,"fast-isnumeric":18,"has-hover":20}],200:[function(t,e,r){"use strict";var n={staticPlot:{valType:"boolean",dflt:!1},plotlyServerURL:{valType:"string",dflt:"https://plot.ly"},editable:{valType:"boolean",dflt:!1},edits:{annotationPosition:{valType:"boolean",dflt:!1},annotationTail:{valType:"boolean",dflt:!1},annotationText:{valType:"boolean",dflt:!1},axisTitleText:{valType:"boolean",dflt:!1},colorbarPosition:{valType:"boolean",dflt:!1},colorbarTitleText:{valType:"boolean",dflt:!1},legendPosition:{valType:"boolean",dflt:!1},legendText:{valType:"boolean",dflt:!1},shapePosition:{valType:"boolean",dflt:!1},titleText:{valType:"boolean",dflt:!1}},autosizable:{valType:"boolean",dflt:!1},responsive:{valType:"boolean",dflt:!1},fillFrame:{valType:"boolean",dflt:!1},frameMargins:{valType:"number",dflt:0,min:0,max:.5},scrollZoom:{valType:"flaglist",flags:["cartesian","gl3d","geo","mapbox"],extras:[!0,!1],dflt:"gl3d+geo+mapbox"},doubleClick:{valType:"enumerated",values:[!1,"reset","autosize","reset+autosize"],dflt:"reset+autosize"},showAxisDragHandles:{valType:"boolean",dflt:!0},showAxisRangeEntryBoxes:{valType:"boolean",dflt:!0},showTips:{valType:"boolean",dflt:!0},showLink:{valType:"boolean",dflt:!1},linkText:{valType:"string",dflt:"Edit chart",noBlank:!0},sendData:{valType:"boolean",dflt:!0},showSources:{valType:"any",dflt:!1},displayModeBar:{valType:"enumerated",values:["hover",!0,!1],dflt:"hover"},showSendToCloud:{valType:"boolean",dflt:!1},modeBarButtonsToRemove:{valType:"any",dflt:[]},modeBarButtonsToAdd:{valType:"any",dflt:[]},modeBarButtons:{valType:"any",dflt:!1},toImageButtonOptions:{valType:"any",dflt:{}},displaylogo:{valType:"boolean",dflt:!0},watermark:{valType:"boolean",dflt:!1},plotGlPixelRatio:{valType:"number",dflt:2,min:1,max:4},setBackground:{valType:"any",dflt:"transparent"},topojsonURL:{valType:"string",noBlank:!0,dflt:"https://cdn.plot.ly/"},mapboxAccessToken:{valType:"string",dflt:null},logging:{valType:"boolean",dflt:1},queueLength:{valType:"integer",min:0,dflt:0},globalTransforms:{valType:"any",dflt:[]},locale:{valType:"string",dflt:"en-US"},locales:{valType:"any",dflt:{}}},a={};!function t(e,r){for(var n in e){var a=e[n];a.valType?r[n]=a.dflt:(r[n]||(r[n]={}),t(a,r[n]))}}(n,a),e.exports={configAttributes:n,dfltConfig:a}},{}],201:[function(t,e,r){"use strict";var n=t("../registry"),a=t("../lib"),i=t("../plots/attributes"),o=t("../plots/layout_attributes"),l=t("../plots/frame_attributes"),s=t("../plots/animation_attributes"),c=t("./plot_config").configAttributes,u=t("../plots/polar/legacy/area_attributes"),f=t("../plots/polar/legacy/axis_attributes"),d=t("./edit_types"),p=a.extendFlat,h=a.extendDeepAll,g=a.isPlainObject,v="_isSubplotObj",y="_isLinkedToArray",m=[v,y,"_arrayAttrRegexps","_deprecated"];function x(t,e,r){if(!t)return!1;if(t._isLinkedToArray)if(b(e[r]))r++;else if(r<e.length)return!1;for(;r<e.length;r++){var n=t[e[r]];if(!g(n))break;if(t=n,r===e.length-1)break;if(t._isLinkedToArray){if(!b(e[++r]))return!1}else if("info_array"===t.valType){var a=e[++r];if(!b(a))return!1;var i=t.items;if(Array.isArray(i)){if(a>=i.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!b(o))return!1;t=i[a][o]}else t=i[a]}else t=i}}return t}function b(t){return t===Math.round(t)&&t>=0}function _(t){return function(t){r.crawl(t,function(t,e,n){r.isValObject(t)?"data_array"===t.valType?(t.role="data",n[e+"src"]={valType:"string",editType:"none"}):!0===t.arrayOk&&(n[e+"src"]={valType:"string",editType:"none"}):g(t)&&(t.role="object")})}(t),function(t){r.crawl(t,function(t,e,r){if(!t)return;var n=t[y];if(!n)return;delete t[y],r[e]={items:{}},r[e].items[n]=t,r[e].role="object"})}(t),function(t){!function t(e){for(var r in e)if(g(e[r]))t(e[r]);else if(Array.isArray(e[r]))for(var n=0;n<e[r].length;n++)t(e[r][n]);else e[r]instanceof RegExp&&(e[r]=e[r].toString())}(t)}(t),t}function w(t,e,r){var n=a.nestedProperty(t,r),i=h({},e.layoutAttributes);i[v]=!0,n.set(i)}function k(t,e,r){var n=a.nestedProperty(t,r);n.set(h(n.get()||{},e))}r.IS_SUBPLOT_OBJ=v,r.IS_LINKED_TO_ARRAY=y,r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=m,r.get=function(){var t={};n.allTypes.concat("area").forEach(function(e){t[e]=function(t){var e,o;"area"===t?(e={attributes:u},o={}):(e=n.modules[t]._module,o=e.basePlotModule);var l={type:null},s=h({},i),c=h({},e.attributes);r.crawl(c,function(t,e,r,n,i){a.nestedProperty(s,i).set(void 0),void 0===t&&a.nestedProperty(c,i).set(void 0)}),h(l,s),h(l,c),o.attributes&&h(l,o.attributes);l.type=t;var f={meta:e.meta||{},attributes:_(l)};if(e.layoutAttributes){var d={};h(d,e.layoutAttributes),f.layoutAttributes=_(d)}return f}(e)});var e,g={};return Object.keys(n.transformsRegistry).forEach(function(t){g[t]=function(t){var e=n.transformsRegistry[t],r=h({},e.attributes);return Object.keys(n.componentsRegistry).forEach(function(e){var a=n.componentsRegistry[e];a.schema&&a.schema.transforms&&a.schema.transforms[t]&&Object.keys(a.schema.transforms[t]).forEach(function(e){k(r,a.schema.transforms[t][e],e)})}),{attributes:_(r)}}(t)}),{defs:{valObjects:a.valObjectMeta,metaKeys:m.concat(["description","role","editType","impliedEdits"]),editType:{traces:d.traces,layout:d.layout},impliedEdits:{}},traces:t,layout:function(){var t,e,r={};for(t in h(r,o),n.subplotsRegistry)if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var a=0;a<e.attr.length;a++)w(r,e,e.attr[a]);else{var i="subplot"===e.attr?e.name:e.attr;w(r,e,i)}for(t in r=function(t){return p(t,{radialaxis:f.radialaxis,angularaxis:f.angularaxis}),p(t,f.layout),t}(r),n.componentsRegistry){var l=(e=n.componentsRegistry[t]).schema;if(l&&(l.subplots||l.layout)){var s=l.subplots;if(s&&s.xaxis&&!s.yaxis)for(var c in s.xaxis)delete r.yaxis[c]}else e.layoutAttributes&&k(r,e.layoutAttributes,e.name)}return{layoutAttributes:_(r)}}(),transforms:g,frames:(e={frames:a.extendDeepAll({},l)},_(e),e.frames),animation:_(s),config:_(c)}},r.crawl=function(t,e,n,a){var i=n||0;a=a||"",Object.keys(t).forEach(function(n){var o=t[n];if(-1===m.indexOf(n)){var l=(a?a+".":"")+n;e(o,n,t,i,l),r.isValObject(o)||g(o)&&"impliedEdits"!==n&&r.crawl(o,e,i+1,l)}})},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){var e,n,o=[],l=[],s=[];function c(t,r,i,c){l=l.slice(0,c).concat([r]),s=s.slice(0,c).concat([t&&t._isLinkedToArray]),t&&("data_array"===t.valType||!0===t.arrayOk)&&!("colorbar"===l[c-1]&&("ticktext"===r||"tickvals"===r))&&function t(e,r,i){var c=e[l[r]];var u=i+l[r];if(r===l.length-1)a.isArrayOrTypedArray(c)&&o.push(n+u);else if(s[r]){if(Array.isArray(c))for(var f=0;f<c.length;f++)a.isPlainObject(c[f])&&t(c[f],r+1,u+"["+f+"].")}else a.isPlainObject(c)&&t(c,r+1,u+".")}(e,0,"")}e=t,n="",r.crawl(i,c),t._module&&t._module.attributes&&r.crawl(t._module.attributes,c);var u=t.transforms;if(u)for(var f=0;f<u.length;f++){var d=u[f],p=d._module;p&&(n="transforms["+f+"].",e=d,r.crawl(p.attributes,c))}return o},r.getTraceValObject=function(t,e){var r,a,o=e[0],l=1;if("transforms"===o){if(1===e.length)return i.transforms;var s=t.transforms;if(!Array.isArray(s)||!s.length)return!1;var c=e[1];if(!b(c)||c>=s.length)return!1;a=(r=(n.transformsRegistry[s[c].type]||{}).attributes)&&r[e[2]],l=3}else if("area"===t.type)a=u[o];else{var f=t._module;if(f||(f=(n.modules[t.type||i.type.dflt]||{})._module),!f)return!1;if(!(a=(r=f.attributes)&&r[o])){var d=f.basePlotModule;d&&d.attributes&&(a=d.attributes[o])}a||(a=i[o])}return x(a,e,l)},r.getLayoutValObject=function(t,e){return x(function(t,e){var r,a,i,l,s=t._basePlotModules;if(s){var c;for(r=0;r<s.length;r++){if((i=s[r]).attrRegex&&i.attrRegex.test(e)){if(i.layoutAttrOverrides)return i.layoutAttrOverrides;!c&&i.layoutAttributes&&(c=i.layoutAttributes)}var u=i.baseLayoutAttrOverrides;if(u&&e in u)return u[e]}if(c)return c}var d=t._modules;if(d)for(r=0;r<d.length;r++)if((l=d[r].layoutAttributes)&&e in l)return l[e];for(a in n.componentsRegistry)if(!(i=n.componentsRegistry[a]).schema&&e===i.name)return i.layoutAttributes;if(e in o)return o[e];if("radialaxis"===e||"angularaxis"===e)return f[e];return f.layout[e]||!1}(t,e[0]),e,1)}},{"../lib":168,"../plots/animation_attributes":207,"../plots/attributes":209,"../plots/frame_attributes":240,"../plots/layout_attributes":243,"../plots/polar/legacy/area_attributes":246,"../plots/polar/legacy/axis_attributes":247,"../registry":257,"./edit_types":195,"./plot_config":200}],202:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plots/attributes"),i="templateitemname",o={name:{valType:"string",editType:"none"}};function l(t){return t&&"string"==typeof t}function s(t){var e=t.length-1;return"s"!==t.charAt(e)&&n.warn("bad argument to arrayDefaultKey: "+t),t.substr(0,t.length-1)+"defaults"}o[i]={valType:"string",editType:"calc"},r.templatedArray=function(t,e){return e._isLinkedToArray=t,e.name=o.name,e[i]=o[i],e},r.traceTemplater=function(t){var e,r,i={};for(e in t)r=t[e],Array.isArray(r)&&r.length&&(i[e]=0);return{newTrace:function(o){var l={type:e=n.coerce(o,{},a,"type"),_template:null};if(e in i){r=t[e];var s=i[e]%r.length;i[e]++,l._template=r[s]}return l}}},r.newContainer=function(t,e,r){var a=t._template,i=a&&(a[e]||r&&a[r]);return n.isPlainObject(i)||(i=null),t[e]={_template:i}},r.arrayTemplater=function(t,e,r){var n=t._template,a=n&&n[s(e)],o=n&&n[e];Array.isArray(o)&&o.length||(o=[]);var c={};return{newItem:function(t){var e={name:t.name,_input:t},n=e[i]=t[i];if(!l(n))return e._template=a,e;for(var s=0;s<o.length;s++){var u=o[s];if(u.name===n)return c[n]=1,e._template=u,e}return e[r]=t[r]||!1,e._template=!1,e},defaultItems:function(){for(var t=[],e=0;e<o.length;e++){var r=o[e],n=r.name;if(l(n)&&!c[n]){var a={_template:r,name:n,_input:{_templateitemname:n}};a[i]=r[i],t.push(a),c[n]=1}}return t}}},r.arrayDefaultKey=s,r.arrayEditor=function(t,e,r){var a=(n.nestedProperty(t,e).get()||[]).length,o=r._index,l=o>=a&&(r._input||{})._templateitemname;l&&(o=a);var s,c=e+"["+o+"]";function u(){s={},l&&(s[c]={},s[c][i]=l)}function f(t,e){l?n.nestedProperty(s[c],t).set(e):s[c+"."+t]=e}function d(){var t=s;return u(),t}return u(),{modifyBase:function(t,e){s[t]=e},modifyItem:f,getUpdateObj:d,applyUpdate:function(e,r){e&&f(e,r);var a=d();for(var i in a)n.nestedProperty(t,i).set(a[i])}}}},{"../lib":168,"../plots/attributes":209}],203:[function(t,e,r){"use strict";var n=t("d3"),a=t("../registry"),i=t("../plots/plots"),o=t("../lib"),l=t("../lib/clear_gl_canvases"),s=t("../components/color"),c=t("../components/drawing"),u=t("../components/titles"),f=t("../components/modebar"),d=t("../plots/cartesian/axes"),p=t("../constants/alignment"),h=t("../plots/cartesian/constraints"),g=h.enforce,v=h.clean,y=t("../plots/cartesian/autorange").doAutoRange,m="start",x="middle",b="end";function _(t,e,r){for(var n=0;n<r.length;n++){var a=r[n][0],i=r[n][1];if(!(a[0]>=t[1]||a[1]<=t[0])&&(i[0]<e[1]&&i[1]>e[0]))return!0}return!1}function w(t){var e,a,i,l,u,h,g=t._fullLayout,v=g._size,y=v.p,m=d.list(t,"",!0);if(g._paperdiv.style({width:t._context.responsive&&g.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":g.width+"px",height:t._context.responsive&&g.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":g.height+"px"}).selectAll(".main-svg").call(c.setSize,g.width,g.height),t._context.setBackground(t,g.paper_bgcolor),r.drawMainTitle(t),f.manage(t),!g._has("cartesian"))return t._promises.length&&Promise.all(t._promises);function x(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-y-n:e._offset+e._length+y+n:v.t+v.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+y+n:e._offset-y-n:v.l+v.w*(t.position||0)+n%1}for(e=0;e<m.length;e++){var b=(l=m[e])._anchorAxis;l._linepositions={},l._lw=c.crispRound(t,l.linewidth,1),l._mainLinePosition=x(l,b,l.side),l._mainMirrorPosition=l.mirror&&b?x(l,b,p.OPPOSITE_SIDE[l.side]):null}var w=[],T=[],A=[],L=1===s.opacity(g.paper_bgcolor)&&1===s.opacity(g.plot_bgcolor)&&g.paper_bgcolor===g.plot_bgcolor;for(a in g._plots)if((i=g._plots[a]).mainplot)i.bg&&i.bg.remove(),i.bg=void 0;else{var S=i.xaxis.domain,C=i.yaxis.domain,O=i.plotgroup;if(_(S,C,A)){var z=O.node(),D=i.bg=o.ensureSingle(O,"rect","bg");z.insertBefore(D.node(),z.childNodes[0]),T.push(a)}else O.select("rect.bg").remove(),A.push([S,C]),L||(w.push(a),T.push(a))}var P,E,R,I,F,N,B,j,H,q,V,U,G,Z=g._bgLayer.selectAll(".bg").data(w);for(Z.enter().append("rect").classed("bg",!0),Z.exit().remove(),Z.each(function(t){g._plots[t].bg=n.select(this)}),e=0;e<T.length;e++)i=g._plots[T[e]],u=i.xaxis,h=i.yaxis,i.bg&&i.bg.call(c.setRect,u._offset-y,h._offset-y,u._length+2*y,h._length+2*y).call(s.fill,g.plot_bgcolor).style("stroke-width",0);if(!g._hasOnlyLargeSploms)for(a in g._plots){i=g._plots[a],u=i.xaxis,h=i.yaxis;var X,Y,W=i.clipId="clip"+g._uid+a+"plot",J=o.ensureSingleById(g._clips,"clipPath",W,function(t){t.classed("plotclip",!0).append("rect")});i.clipRect=J.select("rect").attr({width:u._length,height:h._length}),c.setTranslate(i.plot,u._offset,h._offset),i._hasClipOnAxisFalse?(X=null,Y=W):(X=W,Y=null),c.setClipUrl(i.plot,X,t),i.layerClipId=Y}function $(t){return"M"+P+","+t+"H"+E}function Q(t){return"M"+u._offset+","+t+"h"+u._length}function K(t){return"M"+t+","+j+"V"+B}function tt(t){return"M"+t+","+h._offset+"v"+h._length}function et(t,e,r){if(!t.showline||a!==t._mainSubplot)return"";if(!t._anchorAxis)return r(t._mainLinePosition);var n=e(t._mainLinePosition);return t.mirror&&(n+=e(t._mainMirrorPosition)),n}for(a in g._plots){i=g._plots[a],u=i.xaxis,h=i.yaxis;var rt="M0,0";k(u,a)&&(F=M(u,"left",h,m),P=u._offset-(F?y+F:0),N=M(u,"right",h,m),E=u._offset+u._length+(N?y+N:0),R=x(u,h,"bottom"),I=x(u,h,"top"),!(G=!u._anchorAxis||a!==u._mainSubplot)||"allticks"!==u.mirror&&"all"!==u.mirror||(u._linepositions[a]=[R,I]),rt=et(u,$,Q),G&&u.showline&&("all"===u.mirror||"allticks"===u.mirror)&&(rt+=$(R)+$(I)),i.xlines.style("stroke-width",u._lw+"px").call(s.stroke,u.showline?u.linecolor:"rgba(0,0,0,0)")),i.xlines.attr("d",rt);var nt="M0,0";k(h,a)&&(V=M(h,"bottom",u,m),B=h._offset+h._length+(V?y:0),U=M(h,"top",u,m),j=h._offset-(U?y:0),H=x(h,u,"left"),q=x(h,u,"right"),!(G=!h._anchorAxis||a!==h._mainSubplot)||"allticks"!==h.mirror&&"all"!==h.mirror||(h._linepositions[a]=[H,q]),nt=et(h,K,tt),G&&h.showline&&("all"===h.mirror||"allticks"===h.mirror)&&(nt+=K(H)+K(q)),i.ylines.style("stroke-width",h._lw+"px").call(s.stroke,h.showline?h.linecolor:"rgba(0,0,0,0)")),i.ylines.attr("d",nt)}return d.makeClipPaths(t),t._promises.length&&Promise.all(t._promises)}function k(t,e){return(t.ticks||t.showline)&&(e===t._mainSubplot||"all"===t.mirror||"allticks"===t.mirror)}function T(t,e,r){if(!r.showline||!r._lw)return!1;if("all"===r.mirror||"allticks"===r.mirror)return!0;var n=r._anchorAxis;if(!n)return!1;var a=p.FROM_BL[e];return r.side===e?n.domain[a]===t.domain[a]:r.mirror&&n.domain[1-a]===t.domain[1-a]}function M(t,e,r,n){if(T(t,e,r))return r._lw;for(var a=0;a<n.length;a++){var i=n[a];if(i._mainAxis===r._mainAxis&&T(t,e,i))return i._lw}return 0}r.layoutStyles=function(t){return o.syncOrAsync([i.doAutoMargin,w],t)},r.drawMainTitle=function(t){var e=t._fullLayout,r=function(t){var e=t.title,r=x;o.isRightAnchor(e)?r=b:o.isLeftAnchor(e)&&(r=m);return r}(e),n=function(t){var e=t.title,r="0em";o.isTopAnchor(e)?r=p.CAP_SHIFT+"em":o.isMiddleAnchor(e)&&(r=p.MID_SHIFT+"em");return r}(e);u.draw(t,"gtitle",{propContainer:e,propName:"title.text",placeholder:e._dfltTitle.plot,attributes:{x:function(t,e){var r=t.title,n=t._size,a=0;e===m?a=r.pad.l:e===b&&(a=-r.pad.r);switch(r.xref){case"paper":return n.l+n.w*r.x+a;case"container":default:return t.width*r.x+a}}(e,r),y:function(t,e){var r=t.title,n=t._size,a=0;"0em"!==e&&e?e===p.CAP_SHIFT+"em"&&(a=r.pad.t):a=-r.pad.b;if("auto"===r.y)return n.t/2;switch(r.yref){case"paper":return n.t+n.h-n.h*r.y+a;case"container":default:return t.height-t.height*r.y+a}}(e,n),"text-anchor":r,dy:n}})},r.doTraceStyle=function(t){var e,n=t.calcdata,o=[];for(e=0;e<n.length;e++){var s=n[e],c=s[0]||{},u=c.trace||{},f=u._module||{},d=f.arraysToCalcdata;d&&d(s,u);var p=f.editStyle;p&&o.push({fn:p,cd0:c})}if(o.length){for(e=0;e<o.length;e++){var h=o[e];h.fn(t,h.cd0)}l(t),r.redrawReglTraces(t)}return i.style(t),a.getComponentMethod("legend","draw")(t),i.previousPromises(t)},r.doColorBars=function(t){for(var e=0;e<t.calcdata.length;e++){var r=t.calcdata[e][0];if((r.t||{}).cb){var n=r.trace,o=r.t.cb;a.traceIs(n,"contour")&&o.line({width:!1!==n.contours.showlines?n.line.width:0,dash:n.line.dash,color:"line"===n.contours.coloring?o._opts.line.color:n.line.color});var l=n._module.colorbar.container,s=(l?n[l]:n).colorbar;o.options(s)()}}return i.previousPromises(t)},r.layoutReplot=function(t){var e=t.layout;return t.layout=void 0,a.call("plot",t,"",e)},r.doLegend=function(t){return a.getComponentMethod("legend","draw")(t),i.previousPromises(t)},r.doTicksRelayout=function(t){return d.draw(t,"redraw"),t._fullLayout._hasOnlyLargeSploms&&(a.subplotsRegistry.splom.updateGrid(t),l(t),r.redrawReglTraces(t)),r.drawMainTitle(t),i.previousPromises(t)},r.doModeBar=function(t){var e=t._fullLayout;f.manage(t);for(var r=0;r<e._basePlotModules.length;r++){var n=e._basePlotModules[r].updateFx;n&&n(t)}return i.previousPromises(t)},r.doCamera=function(t){for(var e=t._fullLayout,r=e._subplots.gl3d,n=0;n<r.length;n++){var a=e[r[n]];a._scene.setCamera(a.camera)}},r.drawData=function(t){var e,n=t._fullLayout,o=t.calcdata;for(e=0;e<o.length;e++){var s=o[e][0].trace;!0===s.visible&&s._module.colorbar||n._infolayer.select(".cb"+s.uid).remove()}l(t);var c=n._basePlotModules;for(e=0;e<c.length;e++)c[e].plot(t);return r.redrawReglTraces(t),i.style(t),a.getComponentMethod("shapes","draw")(t),a.getComponentMethod("annotations","draw")(t),n._replotting=!1,i.previousPromises(t)},r.redrawReglTraces=function(t){var e=t._fullLayout;if(e._has("regl")){var r,n,a=t._fullData,i=[],l=[];for(e._hasOnlyLargeSploms&&e._splomGrid.draw(),r=0;r<a.length;r++){var s=a[r];!0===s.visible&&("splom"===s.type?e._splomScenes[s.uid].draw():"scattergl"===s.type?o.pushUnique(i,s.xaxis+s.yaxis):"scatterpolargl"===s.type&&o.pushUnique(l,s.subplot))}for(r=0;r<i.length;r++)(n=e._plots[i[r]])._scene&&n._scene.draw();for(r=0;r<l.length;r++)(n=e[l[r]]._subplot)._scene&&n._scene.draw()}},r.doAutoRangeAndConstraints=function(t){for(var e=d.list(t,"",!0),r=0;r<e.length;r++){var n=e[r];v(t,n),n.setScale(),y(t,n)}g(t)},r.finalDraw=function(t){a.getComponentMethod("shapes","draw")(t),a.getComponentMethod("images","draw")(t),a.getComponentMethod("annotations","draw")(t),a.getComponentMethod("rangeslider","draw")(t),a.getComponentMethod("rangeselector","draw")(t)},r.drawMarginPushers=function(t){a.getComponentMethod("legend","draw")(t),a.getComponentMethod("rangeselector","draw")(t),a.getComponentMethod("sliders","draw")(t),a.getComponentMethod("updatemenus","draw")(t)}},{"../components/color":51,"../components/drawing":72,"../components/modebar":110,"../components/titles":139,"../constants/alignment":146,"../lib":168,"../lib/clear_gl_canvases":157,"../plots/cartesian/autorange":211,"../plots/cartesian/axes":212,"../plots/cartesian/constraints":220,"../plots/plots":245,"../registry":257,d3:16}],204:[function(t,e,r){"use strict";var n=t("../lib"),a=n.isPlainObject,i=t("./plot_schema"),o=t("../plots/plots"),l=t("../plots/attributes"),s=t("./plot_template"),c=t("./plot_config").dfltConfig;function u(t,e){t=n.extendDeep({},t);var r,i,o=Object.keys(t).sort();function l(e,r,n){if(a(r)&&a(e))u(e,r);else if(Array.isArray(r)&&Array.isArray(e)){var o=s.arrayTemplater({_template:t},n);for(i=0;i<r.length;i++){var l=r[i],c=o.newItem(l)._template;c&&u(c,l)}var f=o.defaultItems();for(i=0;i<f.length;i++)r.push(f[i]._template);for(i=0;i<r.length;i++)delete r[i].templateitemname}}for(r=0;r<o.length;r++){var c=o[r],d=t[c];if(c in e?l(d,e[c],c):e[c]=d,f(c)===c)for(var p in e){var h=f(p);p===h||h!==c||p in t||l(d,e[p],c)}}}function f(t){return t.replace(/[0-9]+$/,"")}function d(t,e,r,i,o){var l=o&&r(o);for(var c in t){var u=t[c],h=p(t,c,i),g=p(t,c,o),v=r(g);if(!v){var y=f(c);y!==c&&(v=r(g=p(t,y,o)))}if((!l||l!==v)&&!(!v||v._noTemplating||"data_array"===v.valType||v.arrayOk&&Array.isArray(u)))if(!v.valType&&a(u))d(u,e,r,h,g);else if(v._isLinkedToArray&&Array.isArray(u))for(var m=!1,x=0,b={},_=0;_<u.length;_++){var w=u[_];if(a(w)){var k=w.name;if(k)b[k]||(d(w,e,r,p(u,x,h),p(u,x,g)),x++,b[k]=1);else if(!m){var T=p(t,s.arrayDefaultKey(c),i),M=p(u,x,h);d(w,e,r,M,p(u,x,g));var A=n.nestedProperty(e,M);n.nestedProperty(e,T).set(A.get()),A.set(null),m=!0}}}else{n.nestedProperty(e,h).set(u)}}}function p(t,e,r){return r?Array.isArray(t)?r+"["+e+"]":r+"."+e:e}function h(t){for(var e=0;e<t.length;e++)if(a(t[e]))return!0}function g(t){var e;switch(t.code){case"data":e="The template has no key data.";break;case"layout":e="The template has no key layout.";break;case"missing":e=t.path?"There are no templates for item "+t.path+" with name "+t.templateitemname:"There are no templates for trace "+t.index+", of type "+t.traceType+".";break;case"unused":e=t.path?"The template item at "+t.path+" was not used in constructing the plot.":t.dataCount?"Some of the templates of type "+t.traceType+" were not used. The template has "+t.templateCount+" traces, the data only has "+t.dataCount+" of this type.":"The template has "+t.templateCount+" traces of type "+t.traceType+" but there are none in the data.";break;case"reused":e="Some of the templates of type "+t.traceType+" were used more than once. The template has "+t.templateCount+" traces, the data has "+t.dataCount+" of this type."}return t.msg=e,t}r.makeTemplate=function(t){t=n.isPlainObject(t)?t:n.getGraphDiv(t),t=n.extendDeep({_context:c},{data:t.data,layout:t.layout}),o.supplyDefaults(t);var e=t.data||[],r=t.layout||{};r._basePlotModules=t._fullLayout._basePlotModules,r._modules=t._fullLayout._modules;var s={data:{},layout:{}};e.forEach(function(t){var e={};d(t,e,function(t,e){return i.getTraceValObject(t,n.nestedProperty({},e).parts)}.bind(null,t));var r=n.coerce(t,{},l,"type"),a=s.data[r];a||(a=s.data[r]=[]),a.push(e)}),d(r,s.layout,function(t,e){return i.getLayoutValObject(t,n.nestedProperty({},e).parts)}.bind(null,r)),delete s.layout.template;var f=r.template;if(a(f)){var p,h,g,v,y,m,x=f.layout;a(x)&&u(x,s.layout);var b=f.data;if(a(b)){for(h in s.data)if(g=b[h],Array.isArray(g)){for(m=(y=s.data[h]).length,v=g.length,p=0;p<m;p++)u(g[p%v],y[p]);for(p=m;p<v;p++)y.push(n.extendDeep({},g[p]))}for(h in b)h in s.data||(s.data[h]=n.extendDeep([],b[h]))}}return s},r.validateTemplate=function(t,e){var r=n.extendDeep({},{_context:c,data:t.data,layout:t.layout}),i=r.layout||{};a(e)||(e=i.template||{});var l=e.layout,s=e.data,u=[];r.layout=i,r.layout.template=e,o.supplyDefaults(r);var d=r._fullLayout,v=r._fullData,y={};if(a(l)?(!function t(e,r){for(var n in e)if("_"!==n.charAt(0)&&a(e[n])){var i,o=f(n),l=[];for(i=0;i<r.length;i++)l.push(p(e,n,r[i])),o!==n&&l.push(p(e,o,r[i]));for(i=0;i<l.length;i++)y[l[i]]=1;t(e[n],l)}}(d,["layout"]),function t(e,r){for(var n in e)if(-1===n.indexOf("defaults")&&a(e[n])){var i=p(e,n,r);y[i]?t(e[n],i):u.push({code:"unused",path:i})}}(l,"layout")):u.push({code:"layout"}),a(s)){for(var m,x={},b=0;b<v.length;b++){var _=v[b];x[m=_.type]=(x[m]||0)+1,_._fullInput._template||u.push({code:"missing",index:_._fullInput.index,traceType:m})}for(m in s){var w=s[m].length,k=x[m]||0;w>k?u.push({code:"unused",traceType:m,templateCount:w,dataCount:k}):k>w&&u.push({code:"reused",traceType:m,templateCount:w,dataCount:k})}}else u.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var i=e[n],o=p(e,n,r);a(i)?(Array.isArray(e)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),t(i,o)):Array.isArray(i)&&h(i)&&t(i,o)}}({data:v,layout:d},""),u.length)return u.map(g)}},{"../lib":168,"../plots/attributes":209,"../plots/plots":245,"./plot_config":200,"./plot_schema":201,"./plot_template":202}],205:[function(t,e,r){"use strict";var n=t("./plot_api"),a=t("../lib"),i=t("../snapshot/helpers"),o=t("../snapshot/tosvg"),l=t("../snapshot/svgtoimg"),s={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}},c=/^data:image\/\w+;base64,/;e.exports=function(t,e){var r,u,f;function d(t){return!(t in e)||a.validate(e[t],s[t])}if(e=e||{},a.isPlainObject(t)?(r=t.data||[],u=t.layout||{},f=t.config||{}):(t=a.getGraphDiv(t),r=a.extendDeep([],t.data),u=a.extendDeep({},t.layout),f=t._context),!d("width")||!d("height"))throw new Error("Height and width should be pixel values.");if(!d("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var p={};function h(t,r){return a.coerce(e,p,s,t,r)}var g=h("format"),v=h("width"),y=h("height"),m=h("scale"),x=h("setBackground"),b=h("imageDataOnly"),_=document.createElement("div");_.style.position="absolute",_.style.left="-5000px",document.body.appendChild(_);var w=a.extendFlat({},u);v&&(w.width=v),y&&(w.height=y);var k=a.extendFlat({},f,{_exportedPlot:!0,staticPlot:!0,setBackground:x}),T=i.getRedrawFunc(_);function M(){return new Promise(function(t){setTimeout(t,i.getDelay(_._fullLayout))})}function A(){return new Promise(function(t,e){var r=o(_,g,m),i=_._fullLayout.width,s=_._fullLayout.height;if(n.purge(_),document.body.removeChild(_),"svg"===g)return t(b?r:"data:image/svg+xml,"+encodeURIComponent(r));var c=document.createElement("canvas");c.id=a.randstr(),l({format:g,width:i,height:s,scale:m,canvas:c,svg:r,promise:!0}).then(t).catch(e)})}return new Promise(function(t,e){n.plot(_,r,w,k).then(T).then(M).then(A).then(function(e){t(function(t){return b?t.replace(c,""):t}(e))}).catch(function(t){e(t)})})}},{"../lib":168,"../snapshot/helpers":261,"../snapshot/svgtoimg":263,"../snapshot/tosvg":265,"./plot_api":199}],206:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plots/plots"),i=t("./plot_schema"),o=t("./plot_config").dfltConfig,l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(t,e,r,a,i,o){o=o||[];for(var f=Object.keys(t),d=0;d<f.length;d++){var v=f[d];if("transforms"!==v){var y=o.slice();y.push(v);var m=t[v],x=e[v],b=g(r,v),_="info_array"===(b||{}).valType,w="colorscale"===(b||{}).valType,k=(b||{}).items;if(h(r,v))if(l(m)&&l(x))u(m,x,b,a,i,y);else if(_&&s(m)){m.length>x.length&&a.push(p("unused",i,y.concat(x.length)));var T,M,A,L,S,C=x.length,O=Array.isArray(k);if(O&&(C=Math.min(C,k.length)),2===b.dimensions)for(M=0;M<C;M++)if(s(m[M])){m[M].length>x[M].length&&a.push(p("unused",i,y.concat(M,x[M].length)));var z=x[M].length;for(T=0;T<(O?Math.min(z,k[M].length):z);T++)A=O?k[M][T]:k,L=m[M][T],S=x[M][T],n.validate(L,A)?S!==L&&S!==+L&&a.push(p("dynamic",i,y.concat(M,T),L,S)):a.push(p("value",i,y.concat(M,T),L))}else a.push(p("array",i,y.concat(M),m[M]));else for(M=0;M<C;M++)A=O?k[M]:k,L=m[M],S=x[M],n.validate(L,A)?S!==L&&S!==+L&&a.push(p("dynamic",i,y.concat(M),L,S)):a.push(p("value",i,y.concat(M),L))}else if(b.items&&!_&&s(m)){var D,P,E=k[Object.keys(k)[0]],R=[];for(D=0;D<x.length;D++){var I=x[D]._index||D;if((P=y.slice()).push(I),l(m[I])&&l(x[D])){R.push(I);var F=m[I],N=x[D];l(F)&&!1!==F.visible&&!1===N.visible?a.push(p("invisible",i,P)):u(F,N,E,a,i,P)}}for(D=0;D<m.length;D++)(P=y.slice()).push(D),l(m[D])?-1===R.indexOf(D)&&a.push(p("unused",i,P)):a.push(p("object",i,P,m[D]))}else!l(m)&&l(x)?a.push(p("object",i,y,m)):c(m)||!c(x)||_||w?v in e?n.validate(m,b)?"enumerated"===b.valType&&(b.coerceNumber&&m!==+x||m!==x)&&a.push(p("dynamic",i,y,m,x)):a.push(p("value",i,y,m)):a.push(p("unused",i,y,m)):a.push(p("array",i,y,m));else a.push(p("schema",i,y))}}return a}e.exports=function(t,e){var r,c,f=i.get(),d=[],h={_context:n.extendFlat({},o)};s(t)?(h.data=n.extendDeep([],t),r=t):(h.data=[],r=[],d.push(p("array","data"))),l(e)?(h.layout=n.extendDeep({},e),c=e):(h.layout={},c={},arguments.length>1&&d.push(p("object","layout"))),a.supplyDefaults(h);for(var g=h._fullData,v=r.length,y=0;y<v;y++){var m=r[y],x=["data",y];if(l(m)){var b=g[y],_=b.type,w=f.traces[_].attributes;w.type={valType:"enumerated",values:[_]},!1===b.visible&&!1!==m.visible&&d.push(p("invisible",x)),u(m,b,w,d,x);var k=m.transforms,T=b.transforms;if(k){s(k)||d.push(p("array",x,["transforms"])),x.push("transforms");for(var M=0;M<k.length;M++){var A=["transforms",M],L=k[M].type;if(l(k[M])){var S=f.transforms[L]?f.transforms[L].attributes:{};S.type={valType:"enumerated",values:Object.keys(f.transforms)},u(k[M],T[M],S,d,x,A)}else d.push(p("object",x,A))}}}else d.push(p("object",x))}return u(c,h._fullLayout,function(t,e){for(var r=t.layout.layoutAttributes,a=0;a<e.length;a++){var i=e[a],o=t.traces[i.type],l=o.layoutAttributes;l&&(i.subplot?n.extendFlat(r[o.attributes.subplot.dflt],l):n.extendFlat(r,l))}return r}(f,g),d,"layout"),0===d.length?void 0:d};var f={object:function(t,e){return("layout"===t&&""===e?"The layout argument":"data"===t[0]&&""===e?"Trace "+t[1]+" in the data argument":d(t)+"key "+e)+" must be linked to an object container"},array:function(t,e){return("data"===t?"The data argument":d(t)+"key "+e)+" must be linked to an array container"},schema:function(t,e){return d(t)+"key "+e+" is not part of the schema"},unused:function(t,e,r){var n=l(r)?"container":"key";return d(t)+n+" "+e+" did not get coerced"},dynamic:function(t,e,r,n){return[d(t)+"key",e,"(set to '"+r+"')","got reset to","'"+n+"'","during defaults."].join(" ")},invisible:function(t,e){return(e?d(t)+"item "+e:"Trace "+t[1])+" got defaulted to be not visible"},value:function(t,e,r){return[d(t)+"key "+e,"is set to an invalid value ("+r+")"].join(" ")}};function d(t){return s(t)?"In data trace "+t[1]+", ":"In "+t+", "}function p(t,e,r,a,i){var o,l;r=r||"",s(e)?(o=e[0],l=e[1]):(o=e,l=null);var c=function(t){if(!s(t))return String(t);for(var e="",r=0;r<t.length;r++){var n=t[r];"number"==typeof n?e=e.substr(0,e.length-1)+"["+n+"]":e+=n,r<t.length-1&&(e+=".")}return e}(r),u=f[t](e,c,a,i);return n.log(u),{code:t,container:o,trace:l,path:r,astr:c,msg:u}}function h(t,e){var r=y(e),n=r.keyMinusId,a=r.id;return!!(n in t&&t[n]._isSubplotObj&&a)||e in t}function g(t,e){return e in t?t[e]:t[y(e).keyMinusId]}var v=n.counterRegex("([a-z]+)");function y(t){var e=t.match(v);return{keyMinusId:e&&e[1],id:e&&e[2]}}},{"../lib":168,"../plots/plots":245,"./plot_config":200,"./plot_schema":201}],207:[function(t,e,r){"use strict";e.exports={mode:{valType:"enumerated",dflt:"afterall",values:["immediate","next","afterall"]},direction:{valType:"enumerated",values:["forward","reverse"],dflt:"forward"},fromcurrent:{valType:"boolean",dflt:!1},frame:{duration:{valType:"number",min:0,dflt:500},redraw:{valType:"boolean",dflt:!0}},transition:{duration:{valType:"number",min:0,dflt:500,editType:"none"},easing:{valType:"enumerated",dflt:"cubic-in-out",values:["linear","quad","cubic","sin","exp","circle","elastic","back","bounce","linear-in","quad-in","cubic-in","sin-in","exp-in","circle-in","elastic-in","back-in","bounce-in","linear-out","quad-out","cubic-out","sin-out","exp-out","circle-out","elastic-out","back-out","bounce-out","linear-in-out","quad-in-out","cubic-in-out","sin-in-out","exp-in-out","circle-in-out","elastic-in-out","back-in-out","bounce-in-out"],editType:"none"},ordering:{valType:"enumerated",values:["layout first","traces first"],dflt:"layout first",editType:"none"}}}},{}],208:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plot_api/plot_template");e.exports=function(t,e,r){var i,o,l=r.name,s=r.inclusionAttr||"visible",c=e[l],u=n.isArrayOrTypedArray(t[l])?t[l]:[],f=e[l]=[],d=a.arrayTemplater(e,l,s);for(i=0;i<u.length;i++){var p=u[i];n.isPlainObject(p)?o=d.newItem(p):(o=d.newItem({}))[s]=!1,o._index=i,!1!==o[s]&&r.handleItemDefaults(p,o,e,r),f.push(o)}var h=d.defaultItems();for(i=0;i<h.length;i++)(o=h[i])._index=f.length,r.handleItemDefaults({},o,e,r,{}),f.push(o);if(n.isArrayOrTypedArray(c)){var g=Math.min(c.length,f.length);for(i=0;i<g;i++)n.relinkPrivateKeys(f[i],c[i])}return f}},{"../lib":168,"../plot_api/plot_template":202}],209:[function(t,e,r){"use strict";var n=t("../components/fx/attributes");e.exports={type:{valType:"enumerated",values:[],dflt:"scatter",editType:"calc+clearAxisTypes",_noTemplating:!0},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0,editType:"calc"},showlegend:{valType:"boolean",dflt:!0,editType:"style"},legendgroup:{valType:"string",dflt:"",editType:"style"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"style"},name:{valType:"string",editType:"style"},uid:{valType:"string",editType:"plot",anim:!0},ids:{valType:"data_array",editType:"calc",anim:!0},customdata:{valType:"data_array",editType:"calc"},selectedpoints:{valType:"any",editType:"calc"},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],arrayOk:!0,dflt:"all",editType:"none"},hoverlabel:n.hoverlabel,stream:{token:{valType:"string",noBlank:!0,strict:!0,editType:"calc"},maxpoints:{valType:"number",min:0,max:1e4,dflt:500,editType:"calc"},editType:"calc"},transforms:{_isLinkedToArray:"transform",editType:"calc"},uirevision:{valType:"any",editType:"none"}}},{"../components/fx/attributes":81}],210:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],211:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").FP_SAFE,o=t("../../registry");function l(t,e){var r,n,i=[],o=s(e),l=c(t,e),u=l.min,f=l.max;if(0===u.length||0===f.length)return a.simpleMap(e.range,e.r2l);var d=u[0].val,p=f[0].val;for(r=1;r<u.length&&d===p;r++)d=Math.min(d,u[r].val);for(r=1;r<f.length&&d===p;r++)p=Math.max(p,f[r].val);var h=!1;if(e.range){var g=a.simpleMap(e.range,e.r2l);h=g[1]<g[0]}"reversed"===e.autorange&&(h=!0,e.autorange=!0);var v,y,m,x,b,_,w=e.rangemode,k="tozero"===w,T="nonnegative"===w,M=e._length,A=M/10,L=0;for(r=0;r<u.length;r++)for(v=u[r],n=0;n<f.length;n++)(_=(y=f[n]).val-v.val)>0&&((b=M-o(v)-o(y))>A?_/b>L&&(m=v,x=y,L=_/b):_/M>L&&(m={val:v.val,pad:0},x={val:y.val,pad:0},L=_/M));if(d===p){var S=d-1,C=d+1;if(k)if(0===d)i=[0,1];else{var O=(d>0?f:u).reduce(function(t,e){return Math.max(t,o(e))},0),z=d/(1-Math.min(.5,O/M));i=d>0?[0,z]:[z,0]}else i=T?[Math.max(0,S),Math.max(1,C)]:[S,C]}else k?(m.val>=0&&(m={val:0,pad:0}),x.val<=0&&(x={val:0,pad:0})):T&&(m.val-L*o(m)<0&&(m={val:0,pad:0}),x.val<=0&&(x={val:1,pad:0})),L=(x.val-m.val)/(M-o(m)-o(x)),i=[m.val-L*o(m),x.val+L*o(x)];return h&&i.reverse(),a.simpleMap(i,e.l2r||Number)}function s(t){var e=t._length/20;return"domain"===t.constrain&&t._inputDomain&&(e*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0])),function(t){return t.pad+(t.extrapad?e:0)}}function c(t,e){var r,n,a,i=e._id,o=t._fullData,l=t._fullLayout,s=[],c=[];function d(t,e){for(r=0;r<e.length;r++){var o=t[e[r]],l=(o._extremes||{})[i];if(!0===o.visible&&l){for(n=0;n<l.min.length;n++)a=l.min[n],u(s,a.val,a.pad,{extrapad:a.extrapad});for(n=0;n<l.max.length;n++)a=l.max[n],f(c,a.val,a.pad,{extrapad:a.extrapad})}}}return d(o,e._traceIndices),d(l.annotations||[],e._annIndices||[]),d(l.shapes||[],e._shapeIndices||[]),{min:s,max:c}}function u(t,e,r,n){d(t,e,r,n,h)}function f(t,e,r,n){d(t,e,r,n,g)}function d(t,e,r,n,a){for(var i=n.tozero,o=n.extrapad,l=!0,s=0;s<t.length&&l;s++){var c=t[s];if(a(c.val,e)&&c.pad>=r&&(c.extrapad||!o)){l=!1;break}a(e,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(t.splice(s,1),s--)}if(l){var u=i&&0===e;t.push({val:e,pad:u?0:r,extrapad:!u&&o})}}function p(t){return n(t)&&Math.abs(t)<i}function h(t,e){return t<=e}function g(t,e){return t>=e}e.exports={getAutoRange:l,makePadFn:s,doAutoRange:function(t,e){if(e.autorange){e.range=l(t,e),e._r=e.range.slice(),e._rl=a.simpleMap(e._r,e.r2l);var r=e._input,n={};n[e._attr+".range"]=e.range,n[e._attr+".autorange"]=e.autorange,o.call("_storeDirectGUIEdit",t.layout,t._fullLayout._preGUI,n),r.range=e.range.slice(),r.autorange=e.autorange}var i=e._anchorAxis;if(i&&i.rangeslider){var s=i.rangeslider[e._name];s&&"auto"===s.rangemode&&(s.range=l(t,e)),i._input.rangeslider[e._name]=a.extendFlat({},s)}},findExtremes:function(t,e,r){r||(r={});t._m||t.setScale();var a,o,l,s,c,d,h,g,v,y=[],m=[],x=e.length,b=r.padded||!1,_=r.tozero&&("linear"===t.type||"-"===t.type),w="log"===t.type,k=!1;function T(t){if(Array.isArray(t))return k=!0,function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}var M=T((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),A=T((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),L=T(r.vpadplus||r.vpad),S=T(r.vpadminus||r.vpad);if(!k){if(g=1/0,v=-1/0,w)for(a=0;a<x;a++)(o=e[a])<g&&o>0&&(g=o),o>v&&o<i&&(v=o);else for(a=0;a<x;a++)(o=e[a])<g&&o>-i&&(g=o),o>v&&o<i&&(v=o);e=[g,v],x=2}var C={tozero:_,extrapad:b};function O(r){l=e[r],n(l)&&(d=M(r),h=A(r),g=l-S(r),v=l+L(r),w&&g<v/10&&(g=v/10),s=t.c2l(g),c=t.c2l(v),_&&(s=Math.min(0,s),c=Math.max(0,c)),p(s)&&u(y,s,h,C),p(c)&&f(m,c,d,C))}var z=Math.min(6,x);for(a=0;a<z;a++)O(a);for(a=x-1;a>=z;a--)O(a);return{min:y,max:m,opts:r}},concatExtremes:c}},{"../../constants/numerical":149,"../../lib":168,"../../registry":257,"fast-isnumeric":18}],212:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../../plots/plots"),o=t("../../registry"),l=t("../../lib"),s=t("../../lib/svg_text_utils"),c=t("../../components/titles"),u=t("../../components/color"),f=t("../../components/drawing"),d=t("./layout_attributes"),p=t("./clean_ticks"),h=t("../../constants/numerical"),g=h.ONEAVGYEAR,v=h.ONEAVGMONTH,y=h.ONEDAY,m=h.ONEHOUR,x=h.ONEMIN,b=h.ONESEC,_=h.MINUS_SIGN,w=h.BADNUM,k=t("../../constants/alignment").MID_SHIFT,T=t("../../constants/alignment").LINE_SPACING,M=e.exports={};M.setConvert=t("./set_convert");var A=t("./axis_autotype"),L=t("./axis_ids");M.id2name=L.id2name,M.name2id=L.name2id,M.cleanId=L.cleanId,M.list=L.list,M.listIds=L.listIds,M.getFromId=L.getFromId,M.getFromTrace=L.getFromTrace;var S=t("./autorange");M.getAutoRange=S.getAutoRange,M.findExtremes=S.findExtremes,M.coerceRef=function(t,e,r,n,a,i){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=s[0]||i),i||(i=a),u[c]={valType:"enumerated",values:s.concat(i?[i]:[]),dflt:a},l.coerce(t,e,u,c)},M.coercePosition=function(t,e,r,n,a,i){var o,s;if("paper"===n||"pixel"===n)o=l.ensureNumber,s=r(a,i);else{var c=M.getFromId(e,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}t[a]=o(s)},M.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?l.ensureNumber:M.getFromId(e,r).cleanPos)(t)},M.redrawComponents=function(t,e){e=e||M.listIds(t);var r=t._fullLayout;function n(n,a,i,l){for(var s=o.getComponentMethod(n,a),c={},u=0;u<e.length;u++)for(var f=r[M.id2name(e[u])][i],d=0;d<f.length;d++){var p=f[d];if(!c[p]&&(s(t,p),c[p]=1,l))return}}n("annotations","drawOne","_annIndices"),n("shapes","drawOne","_shapeIndices"),n("images","draw","_imgIndices",!0)};var C=M.getDataConversions=function(t,e,r,n){var a,i="x"===r||"y"===r||"z"===r?r:n;if(Array.isArray(i)){if(a={type:A(n),_categories:[]},M.setConvert(a),"category"===a.type)for(var o=0;o<n.length;o++)a.d2c(n[o])}else a=M.getFromTrace(t,e,i);return a?{d2c:a.d2c,c2d:a.c2d}:"ids"===i?{d2c:z,c2d:z}:{d2c:O,c2d:O}};function O(t){return+t}function z(t){return String(t)}M.getDataToCoordFunc=function(t,e,r,n){return C(t,e,r,n).d2c},M.counterLetter=function(t){var e=t.charAt(0);return"x"===e?"y":"y"===e?"x":void 0},M.minDtick=function(t,e,r,n){-1===["log","category","multicategory"].indexOf(t.type)&&n?void 0===t._minDtick?(t._minDtick=e,t._forceTick0=r):t._minDtick&&((t._minDtick/e+1e-6)%1<2e-6&&((r-t._forceTick0)/e%1+1.000001)%1<2e-6?(t._minDtick=e,t._forceTick0=r):((e/t._minDtick+1e-6)%1>2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},M.saveRangeInitial=function(t,e){for(var r=M.list(t,"",!0),n=!1,a=0;a<r.length;a++){var i=r[a],o=void 0===i._rangeInitial,l=o||!(i.range[0]===i._rangeInitial[0]&&i.range[1]===i._rangeInitial[1]);(o&&!1===i.autorange||e&&l)&&(i._rangeInitial=i.range.slice(),n=!0)}return n},M.saveShowSpikeInitial=function(t,e){for(var r=M.list(t,"",!0),n=!1,a="on",i=0;i<r.length;i++){var o=r[i],l=void 0===o._showSpikeInitial,s=l||!(o.showspikes===o._showspikes);(l||e&&s)&&(o._showSpikeInitial=o.showspikes,n=!0),"on"!==a||o.showspikes||(a="off")}return t._fullLayout._cartesianSpikesEnabled=a,n},M.autoBin=function(t,e,r,n,i,o){var s,c=l.aggNums(Math.min,null,t),u=l.aggNums(Math.max,null,t);if("category"===e.type||"multicategory"===e.type)return{start:c-.5,end:u+.5,size:Math.max(1,Math.round(o)||1),_dataSpan:u-c};if(i||(i=e.calendar),s="log"===e.type?{type:"linear",range:[c,u]}:{type:e.type,range:l.simpleMap([c,u],e.c2r,0,i),calendar:i},M.setConvert(s),o=o&&p.dtick(o,s.type))s.dtick=o,s.tick0=p.tick0(void 0,s.type,i);else{var f;if(r)f=(u-c)/r;else{var d=l.distinctVals(t),h=Math.pow(10,Math.floor(Math.log(d.minDiff)/Math.LN10)),g=h*l.roundUp(d.minDiff/h,[.9,1.9,4.9,9.9],!0);f=Math.max(g,2*l.stdev(t)/Math.pow(t.length,n?.25:.4)),a(f)||(f=1)}M.autoTicks(s,f)}var v,m=s.dtick,x=M.tickIncrement(M.tickFirst(s),m,"reverse",i);if("number"==typeof m)v=(x=function(t,e,r,n,i){var o=0,l=0,s=0,c=0;function u(e){return(1+100*(e-t)/r.dtick)%100<2}for(var f=0;f<e.length;f++)e[f]%1==0?s++:a(e[f])||c++,u(e[f])&&o++,u(e[f]+r.dtick/2)&&l++;var d=e.length-c;if(s===d&&"date"!==r.type)r.dtick<1?t=n-.5*r.dtick:(t-=.5)+r.dtick<n&&(t+=r.dtick);else if(l<.1*d&&(o>.3*d||u(n)||u(i))){var p=r.dtick/2;t+=t+p<n?p:-p}return t}(x,t,s,c,u))+(1+Math.floor((u-x)/m))*m;else for("M"===s.dtick.charAt(0)&&(x=function(t,e,r,n,a){var i=l.findExactDates(e,a);if(i.exactDays>.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?t=M.tickIncrement(t,"M6","reverse")+1.5*y:i.exactMonths>.8?t=M.tickIncrement(t,"M1","reverse")+15.5*y:t-=y/2;var s=M.tickIncrement(t,r);if(s<=n)return s}return t}(x,t,m,c,i)),v=x,0;v<=u;)v=M.tickIncrement(v,m,!1,i),0;return{start:e.c2r(x,0,i),end:e.c2r(v,0,i),size:m,_dataSpan:u-c}},M.prepTicks=function(t){var e=l.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var r,n=t.nticks;n||("category"===t.type||"multicategory"===t.type?(r=t.tickfont?1.2*(t.tickfont.size||12):15,n=t._length/r):(r="y"===t._id.charAt(0)?40:80,n=l.constrain(t._length/r,4,9)+1),"radialaxis"===t._name&&(n*=2)),"array"===t.tickmode&&(n*=100),M.autoTicks(t,Math.abs(e[1]-e[0])/n),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),"date"===t.type&&t.dtick<.1&&(t.dtick=.1),j(t)},M.calcTicks=function(t){M.prepTicks(t);var e=l.simpleMap(t.range,t.r2l);if("array"===t.tickmode)return function(t){var e=t.tickvals,r=t.ticktext,n=new Array(e.length),a=l.simpleMap(t.range,t.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"===t.type?t.d2l_noadd:t.d2l;"log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1));for(var d=0;d<e.length;d++){var p=f(e[d]);p>s&&p<c&&(void 0===r[d]?n[u]=M.tickText(t,p):n[u]=H(t,p,String(r[d])),u++)}u<e.length&&n.splice(u,e.length-u);return n}(t);t._tmin=M.tickFirst(t);var r=1.0001*e[0]-1e-4*e[1],n=1.0001*e[1]-1e-4*e[0],a=e[1]<e[0];if(t._tmin<r!==a)return[];var i=[];"category"!==t.type&&"multicategory"!==t.type||(n=a?Math.max(-.5,n):Math.min(t._categories.length-.5,n));for(var o=null,s=Math.max(1e3,t._length||0),c=t._tmin;(a?c>=n:c<=n)&&!(i.length>s||c===o);c=M.tickIncrement(c,t.dtick,a,t.calendar))o=c,i.push(c);et(t)&&360===Math.abs(e[1]-e[0])&&i.pop(),t._tmax=i[i.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var u=new Array(i.length),f=0;f<i.length;f++)u[f]=M.tickText(t,i[f]);return t._inCalcTicks=!1,u};var D=[2,5,10],P=[1,2,3,6,12],E=[1,2,5,10,15,30],R=[1,2,3,7,14],I=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],F=[-.301,0,.301,.699,1],N=[15,30,45,90,180];function B(t,e,r){return e*l.roundUp(t/e,r)}function j(t){var e=t.dtick;if(t._tickexponent=0,a(e)||"string"==typeof e||(e=1),"category"!==t.type&&"multicategory"!==t.type||(t._tickround=null),"date"===t.type){var r=t.r2l(t.tick0),n=t.l2r(r).replace(/(^-|i)/g,""),i=n.length;if("M"===String(e).charAt(0))i>10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=y&&i<=10||e>=15*y)t._tickround="d";else if(e>=x&&i<=16||e>=m)t._tickround="M";else if(e>=b&&i<=19||e>=x)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,o)-20,t._tickround<0&&(t._tickround=4)}}else if(a(e)||"L"===e.charAt(0)){var l=t.range.map(t.r2d||Number);a(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(c)>3&&(V(t.exponentformat)&&!U(c)?t._tickexponent=3*Math.round((c-1)/3):t._tickexponent=c)}else t._tickround=null}function H(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}M.autoTicks=function(t,e){var r;function n(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=l.dateTick0(t.calendar);var i=2*e;i>g?(e/=g,r=n(10),t.dtick="M"+12*B(e,r,D)):i>v?(e/=v,t.dtick="M"+B(e,1,P)):i>y?(t.dtick=B(e,y,R),t.tick0=l.dateTick0(t.calendar,!0)):i>m?t.dtick=B(e,m,P):i>x?t.dtick=B(e,x,E):i>b?t.dtick=B(e,b,E):(r=n(10),t.dtick=B(e,r,D))}else if("log"===t.type){t.tick0=0;var o=l.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(o[1]-o[0])<1){var s=1.5*Math.abs((o[1]-o[0])/e);e=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/s,r=n(10),t.dtick="L"+B(e,r,D)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):et(t)?(t.tick0=0,r=1,t.dtick=B(e,r,N)):(t.tick0=0,r=n(10),t.dtick=B(e,r,D));if(0===t.dtick&&(t.dtick=1),!a(t.dtick)&&"string"!=typeof t.dtick){var c=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(c)}},M.tickIncrement=function(t,e,r,i){var o=r?-1:1;if(a(e))return t+o*e;var s=e.charAt(0),c=o*Number(e.substr(1));if("M"===s)return l.incrementMonth(t,c,i);if("L"===s)return Math.log(Math.pow(10,t)+c)/Math.LN10;if("D"===s){var u="D2"===e?F:I,f=t+.01*o,d=l.roundUp(l.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(e)},M.tickFirst=function(t){var e=t.r2l||Number,r=l.simpleMap(t.range,e),i=r[1]<r[0],o=i?Math.floor:Math.ceil,s=1.0001*r[0]-1e-4*r[1],c=t.dtick,u=e(t.tick0);if(a(c)){var f=o((s-u)/c)*c+u;return"category"!==t.type&&"multicategory"!==t.type||(f=l.constrain(f,0,t._categories.length-1)),f}var d=c.charAt(0),p=Number(c.substr(1));if("M"===d){for(var h,g,v,y=0,m=u;y<10;){if(((h=M.tickIncrement(m,c,i,t.calendar))-s)*(m-s)<=0)return i?Math.min(m,h):Math.max(m,h);g=(s-(m+h)/2)/(h-m),v=d+(Math.abs(Math.round(g))||1)*p,m=M.tickIncrement(m,v,g<0?!i:i,t.calendar),y++}return l.error("tickFirst did not converge",t),m}if("L"===d)return Math.log(o((Math.pow(10,s)-u)/p)*p+u)/Math.LN10;if("D"===d){var x="D2"===c?F:I,b=l.roundUp(l.mod(s,1),x,i);return Math.floor(s)+Math.log(n.round(Math.pow(10,b),1))/Math.LN10}throw"unrecognized dtick "+String(c)},M.tickText=function(t,e,r){var n,i=H(t,e),o="array"===t.tickmode,s=r||o,c=t.type,u="category"===c?t.d2l_noadd:t.d2l;if(o&&Array.isArray(t.ticktext)){var f=l.simpleMap(t.range,t.r2l),d=Math.abs(f[1]-f[0])/1e4;for(n=0;n<t.ticktext.length&&!(Math.abs(e-u(t.tickvals[n]))<d);n++);if(n<t.ticktext.length)return i.text=String(t.ticktext[n]),i}function p(n){if(void 0===n)return!0;if(r)return"none"===n;var a={first:t._tmin,last:t._tmax}[n];return"all"!==n&&e!==a}var h=r?"never":"none"!==t.exponentformat&&p(t.showexponent)?"hide":"";if("date"===c?function(t,e,r,n){var i=t._tickround,o=r&&t.hoverformat||M.getTickFormat(t);n&&(i=a(i)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[i]);var s,c=l.formatDate(e.x,o,i,t._dateFormat,t.calendar,t._extraFormat),u=c.indexOf("\n");-1!==u&&(s=c.substr(u+1),c=c.substr(0,u));n&&("00:00:00"===c||"00:00"===c?(c=s,s=""):8===c.length&&(c=c.replace(/:00$/,"")));s&&(r?"d"===i?c+=", "+s:c=s+(c?", "+c:""):t._inCalcTicks&&s===t._prevDateHead||(c+="<br>"+s,t._prevDateHead=s));e.text=c}(t,i,r,s):"log"===c?function(t,e,r,n,i){var o=t.dtick,s=e.x,c=t.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)e.text=G(Math.pow(10,s),t,i,n);else if(a(o)||"D"===u&&l.mod(s+.01,1)<.1){var f=Math.round(s),d=Math.abs(f),p=t.exponentformat;"power"===p||V(p)&&U(f)?(e.text=0===f?1:1===f?"10":"10<sup>"+(f>1?"":_)+d+"</sup>",e.fontSize*=1.25):("e"===p||"E"===p)&&d>2?e.text="1"+p+(f>0?"+":_)+d:(e.text=G(Math.pow(10,s),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,l.mod(s,1)))),e.fontSize*=.75}if("D1"===t.dtick){var h=String(e.text).charAt(0);"0"!==h&&"1"!==h||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(s<0?.5:.25)))}}(t,i,0,s,h):"category"===c?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r="");e.text=String(r)}(t,i):"multicategory"===c?function(t,e,r){var n=Math.round(e.x),a=t._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?e.text=o+" - "+i:(e.text=i,e.text2=o)}(t,i,r):et(t)?function(t,e,r,n,a){if("radians"!==t.thetaunit||r)e.text=G(e.x,t,a,n);else{var i=e.x/180;if(0===i)e.text="0";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){var r=1;for(;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,a=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)e.text=G(l.deg2rad(e.x),t,a,n);else{var s=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["<sup>",o[0],"</sup>","\u2044","<sub>",o[1],"</sub>","\u03c0"].join(""),s&&(e.text=_+e.text)}}}}(t,i,r,s,h):function(t,e,r,n,a){"never"===a?a="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide");e.text=G(e.x,t,a,n)}(t,i,0,s,h),t.tickprefix&&!p(t.showtickprefix)&&(i.text=t.tickprefix+i.text),t.ticksuffix&&!p(t.showticksuffix)&&(i.text+=t.ticksuffix),"boundaries"===t.tickson||t.showdividers){var g=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};i.xbnd=[g(i.x-.5),g(i.x+t.dtick-.5)]}return i},M.hoverLabelText=function(t,e,r){if(r!==w&&r!==e)return M.hoverLabelText(t,e)+" - "+M.hoverLabelText(t,r);var n="log"===t.type&&e<=0,a=M.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":_+a:a};var q=["f","p","n","\u03bc","m","","k","M","G","T"];function V(t){return"SI"===t||"B"===t}function U(t){return t>14||t<-15}function G(t,e,r,n){var i=t<0,o=e._tickround,s=r||e.exponentformat||"B",c=e._tickexponent,u=M.getTickFormat(e),f=e.separatethousands;if(n){var d={exponentformat:s,dtick:"none"===e.showexponent?e.dtick:a(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};j(d),o=(Number(d._tickround)||0)+4,c=d._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,_);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(t=Math.abs(t))<h)t="0",i=!1;else{if(t+=h,c&&(t*=Math.pow(10,-c),o+=c),0===o)t=String(Math.floor(t));else if(o<0){t=(t=String(Math.round(t))).substr(0,t.length+o);for(var g=o;g<0;g++)t+="0"}else{var v=(t=String(t)).indexOf(".")+1;v&&(t=t.substr(0,v+o).replace(/\.?0+$/,""))}t=l.numSeparate(t,e._separators,f)}c&&"hide"!==s&&(V(s)&&U(c)&&(s="power"),p=c<0?_+-c:"power"!==s?"+"+c:String(c),"e"===s||"E"===s?t+=s+p:"power"===s?t+="\xd710<sup>"+p+"</sup>":"B"===s&&9===c?t+="B":V(s)&&(t+=q[c/3+5]));return i?_+t:t}function Z(t,e){var r=t._id.charAt(0),n=t._tickAngles[e]||0,a=l.deg2rad(n),i=Math.sin(a),o=Math.cos(a),s=0,c=0;return t._selections[e].each(function(){var t=W(this),e=f.bBox(t.node()),r=e.width,n=e.height;s=Math.max(s,o*r,i*n),c=Math.max(c,i*r,o*n)}),{x:c,y:s}[r]}function X(t){return[t.text,t.x,t.axInfo,t.font,t.fontSize,t.fontColor].join("_")}function Y(t,e){var r=t.l2p(e);return r>1&&r<t._length-1}function W(t){var e=n.select(t),r=e.select(".text-math-group");return r.empty()?e.select("text"):r}function J(t){return t._id+".automargin"}function $(t){return t._id+".rangeslider"}function Q(t,e){for(var r=0;r<e.length;r++)-1===t.indexOf(e[r])&&t.push(e[r])}function K(t,e,r){var n,a,i=[],o=[],s=t.layout;for(n=0;n<e.length;n++)i.push(M.getFromId(t,e[n]));for(n=0;n<r.length;n++)o.push(M.getFromId(t,r[n]));var c=Object.keys(d),u=["anchor","domain","overlaying","position","side","tickangle","editType"],f=["linear","log"];for(n=0;n<c.length;n++){var p=c[n],h=i[0][p],g=o[0][p],v=!0,y=!1,m=!1;if("_"!==p.charAt(0)&&"function"!=typeof h&&-1===u.indexOf(p)){for(a=1;a<i.length&&v;a++){var x=i[a][p];"type"===p&&-1!==f.indexOf(h)&&-1!==f.indexOf(x)&&h!==x?y=!0:x!==h&&(v=!1)}for(a=1;a<o.length&&v;a++){var b=o[a][p];"type"===p&&-1!==f.indexOf(g)&&-1!==f.indexOf(b)&&g!==b?m=!0:o[a][p]!==g&&(v=!1)}v&&(y&&(s[i[0]._name].type="linear"),m&&(s[o[0]._name].type="linear"),tt(s,p,i,o,t._fullLayout._dfltTitle))}}for(n=0;n<t._fullLayout.annotations.length;n++){var _=t._fullLayout.annotations[n];-1!==e.indexOf(_.xref)&&-1!==r.indexOf(_.yref)&&l.swapAttrs(s.annotations[n],["?"])}}function tt(t,e,r,n,a){var i,o=l.nestedProperty,s=o(t[r[0]._name],e).get(),c=o(t[n[0]._name],e).get();for("title"===e&&(s&&s.text===a.x&&(s.text=a.y),c&&c.text===a.y&&(c.text=a.x)),i=0;i<r.length;i++)o(t,r[i]._name+"."+e).set(c);for(i=0;i<n.length;i++)o(t,n[i]._name+"."+e).set(s)}function et(t){return"angularaxis"===t._id}M.getTickFormat=function(t){var e,r,n,a,i,o,l,s;function c(t){return"string"!=typeof t?t:Number(t.replace("M",""))*v}function u(t,e){var r=["L","D"];if(typeof t==typeof e){if("number"==typeof t)return t-e;var n=r.indexOf(t.charAt(0)),a=r.indexOf(e.charAt(0));return n===a?Number(t.replace(/(L|D)/g,""))-Number(e.replace(/(L|D)/g,"")):n-a}return"number"==typeof t?1:-1}function f(t,e){var r=null===e[0],n=null===e[1],a=u(t,e[0])>=0,i=u(t,e[1])<=0;return(r||a)&&(n||i)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e<t.tickformatstops.length;e++)if((n=t.tickformatstops[e]).enabled&&(a=t.dtick,i=n.dtickrange,o=void 0,void 0,void 0,o=c||function(t){return t},l=i[0],s=i[1],(!l&&"number"!=typeof l||o(l)<=o(a))&&(!s&&"number"!=typeof s||o(s)>=o(a)))){r=n;break}break;case"log":for(e=0;e<t.tickformatstops.length;e++)if((n=t.tickformatstops[e]).enabled&&f(t.dtick,n.dtickrange)){r=n;break}}return r?r.value:t.tickformat},M.getSubplots=function(t,e){var r=t._fullLayout._subplots,n=r.cartesian.concat(r.gl2d||[]),a=e?M.findSubplotsWithAxis(n,e):n;return a.sort(function(t,e){var r=t.substr(1).split("y"),n=e.substr(1).split("y");return r[0]===n[0]?+r[1]-+n[1]:+r[0]-+n[0]}),a},M.findSubplotsWithAxis=function(t,e){for(var r=new RegExp("x"===e._id.charAt(0)?"^"+e._id+"y":e._id+"$"),n=[],a=0;a<t.length;a++){var i=t[a];r.test(i)&&n.push(i)}return n},M.makeClipPaths=function(t){var e=t._fullLayout;if(!e._hasOnlyLargeSploms){var r,a,i={_offset:0,_length:e.width,_id:""},o={_offset:0,_length:e.height,_id:""},l=M.list(t,"x",!0),s=M.list(t,"y",!0),c=[];for(r=0;r<l.length;r++)for(c.push({x:l[r],y:o}),a=0;a<s.length;a++)0===r&&c.push({x:i,y:s[a]}),c.push({x:l[r],y:s[a]});var u=e._clips.selectAll(".axesclip").data(c,function(t){return t.x._id+t.y._id});u.enter().append("clipPath").classed("axesclip",!0).attr("id",function(t){return"clip"+e._uid+t.x._id+t.y._id}).append("rect"),u.exit().remove(),u.each(function(t){n.select(this).select("rect").attr({x:t.x._offset||0,y:t.y._offset||0,width:t.x._length||1,height:t.y._length||1})})}},M.draw=function(t,e,r){var n=t._fullLayout;"redraw"===e&&n._paper.selectAll("g.subplot").each(function(t){var e=t[0],r=n._plots[e],a=r.xaxis,i=r.yaxis;r.xaxislayer.selectAll("."+a._id+"tick").remove(),r.yaxislayer.selectAll("."+i._id+"tick").remove(),r.xaxislayer.selectAll("."+a._id+"tick2").remove(),r.yaxislayer.selectAll("."+i._id+"tick2").remove(),r.xaxislayer.selectAll("."+a._id+"divider").remove(),r.yaxislayer.selectAll("."+i._id+"divider").remove(),r.gridlayer&&r.gridlayer.selectAll("path").remove(),r.zerolinelayer&&r.zerolinelayer.selectAll("path").remove(),n._infolayer.select(".g-"+a._id+"title").remove(),n._infolayer.select(".g-"+i._id+"title").remove()});var a=e&&"redraw"!==e?e:M.listIds(t);return l.syncOrAsync(a.map(function(e){return function(){if(e){var n=M.getFromId(t,e),a=M.drawOne(t,n,r);return n._r=n.range.slice(),n._rl=l.simpleMap(n._r,n.r2l),a}}}))},M.drawOne=function(t,e,r){var n,a,s;r=r||{},e.setScale();var d=t._fullLayout,p=e._id,h=p.charAt(0),g=M.counterLetter(p),v=e._mainSubplot,y=e._mainLinePosition,m=e._mainMirrorPosition,x=d._plots[v],b=x[h+"axislayer"],_=e._subplotsWith,w=e._vals=M.calcTicks(e),k=[e.mirror,y,m].join("_");for(n=0;n<w.length;n++)w[n].axInfo=k;if(e.visible){e._selections={},e._tickAngles={};var A,S,C=M.makeTransFn(e);if("boundaries"===e.tickson){var O=function(t,e){var r,n=[],a=function(t,e){var r=t.xbnd[e];null!==r&&n.push(l.extendFlat({},t,{x:r}))};if(e.length){for(r=0;r<e.length;r++)a(e[r],0);a(e[r-1],1)}return n}(0,w);S=M.clipEnds(e,O),A="inside"===e.ticks?S:O}else S=M.clipEnds(e,w),A="inside"===e.ticks?S:w;var z=e._gridVals=S,D=function(t,e){var r,n,a=[],i=function(t,e){var r=t.xbnd[e];null!==r&&a.push(l.extendFlat({},t,{x:r}))};if(t.showdividers&&e.length){for(r=0;r<e.length;r++){var o=e[r];o.text2!==n&&i(o,0),n=o.text2}i(e[r-1],1)}return a}(e,w);if(!d._hasOnlyLargeSploms){var P={};for(n=0;n<_.length;n++){a=_[n];var E=(s=d._plots[a])[g+"axis"],R=E._mainAxis._id;if(!P[R]){P[R]=1;var I="x"===h?"M0,"+E._offset+"v"+E._length:"M"+E._offset+",0h"+E._length;M.drawGrid(t,e,{vals:z,counterAxis:E,layer:s.gridlayer.select("."+p),path:I,transFn:C}),M.drawZeroLine(t,e,{counterAxis:E,layer:s.zerolinelayer,path:I,transFn:C})}}}var F=M.getTickSigns(e),N=[];if(e.ticks){var B,j,q,V=M.makeTickPath(e,y,F[2]);if(e._anchorAxis&&e.mirror&&!0!==e.mirror?(B=M.makeTickPath(e,m,F[3]),j=V+B):(B="",j=V),e.showdividers&&"outside"===e.ticks&&"boundaries"===e.tickson){var U={};for(n=0;n<D.length;n++)U[D[n].x]=1;q=function(t){return U[t.x]?B:j}}else q=j;M.drawTicks(t,e,{vals:A,layer:b,path:q,transFn:C}),N=Object.keys(e._linepositions||{})}for(n=0;n<N.length;n++){a=N[n],s=d._plots[a];var G=e._linepositions[a]||[],Y=M.makeTickPath(e,G[0],F[0])+M.makeTickPath(e,G[1],F[1]);M.drawTicks(t,e,{vals:A,layer:s[h+"axislayer"],path:Y,transFn:C})}var W=[];if(W.push(function(){var r=M.makeLabelFns(e,y);return M.drawLabels(t,e,{vals:w,layer:b,transFn:C,labelXFn:r.labelXFn,labelYFn:r.labelYFn,labelAnchorFn:r.labelAnchorFn})}),"multicategory"===e.type){var Q=0,K={x:2,y:10}[h],tt=F[2]*("inside"===e.ticks?-1:1);W.push(function(){Q+=Z(e,p+"tick")+K,Q+=e._tickAngles[p+"tick"]?e.tickfont.size*T:0;var r=y+Q*tt,n=M.makeLabelFns(e,r);return M.drawLabels(t,e,{vals:function(t,e){for(var r=[],n={},a=0;a<e.length;a++){var i=e[a];n[i.text2]?n[i.text2].push(i.x):n[i.text2]=[i.x]}for(var o in n)r.push(H(t,l.interp(n[o],.5),o));return r}(e,w),layer:b,cls:p+"tick2",repositionOnUpdate:!0,secondary:!0,transFn:C,labelXFn:n.labelXFn,labelYFn:n.labelYFn,labelAnchorFn:n.labelAnchorFn})}),W.push(function(){return Q+=Z(e,p+"tick2"),e._labelLength=Q,function(t,e,r){var n=e._id+"divider",a=r.vals,i=r.layer.selectAll("path."+n).data(a,X);i.exit().remove(),i.enter().insert("path",":first-child").classed(n,1).classed("crisp",1).call(u.stroke,e.dividercolor).style("stroke-width",f.crispRound(t,e.dividerwidth,1)+"px"),i.attr("transform",r.transFn).attr("d",r.path)}(t,e,{vals:D,layer:b,path:M.makeTickPath(e,y,tt,Q),transFn:C})})}var et=o.getComponentMethod("rangeslider","isVisible")(e);return W.push(function(){if(e.showticklabels){var r=t.getBoundingClientRect(),n=b.node().getBoundingClientRect();e._boundingBox={width:n.width,height:n.height,left:n.left-r.left,right:n.right-r.left,top:n.top-r.top,bottom:n.bottom-r.top}}else{var a,i=d._size;"x"===h?(a="free"===e.anchor?i.t+i.h*(1-e.position):i.t+i.h*(1-e._anchorAxis.domain[{bottom:0,top:1}[e.side]]),e._boundingBox={top:a,bottom:a,left:e._offset,right:e._offset+e._length,width:e._length,height:0}):(a="free"===e.anchor?i.l+i.w*e.position:i.l+i.w*e._anchorAxis.domain[{left:0,right:1}[e.side]],e._boundingBox={left:a,right:a,bottom:e._offset+e._length,top:e._offset,height:e._length,width:0})}if(_){for(var o=e._counterSpan=[1/0,-1/0],l=0;l<_.length;l++){var s=d._plots[_[l]]["x"===h?"yaxis":"xaxis"];rt(o,[s._offset,s._offset+s._length])}"free"===e.anchor&&rt(o,"x"===h?[e._boundingBox.bottom,e._boundingBox.top]:[e._boundingBox.right,e._boundingBox.left])}},function(){var r,n,a=e.side.charAt(0);if(et&&(n=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),i.autoMargin(t,$(e),n),e.automargin&&(!et||"b"!==a)){r={x:0,y:0,r:0,l:0,t:0,b:0};var l,s,c=e._boundingBox,u=x[g+"axis"];switch(h+a){case"xb":l=0,s=c.top-u._length-u._offset,r[a]=c.height;break;case"xt":l=1,s=u._offset-c.bottom,r[a]=c.height;break;case"yl":l=0,s=u._offset-c.right,r[a]=c.width;break;case"yr":l=1,s=c.left-u._length-u._offset,r[a]=c.width}r[g]="free"===e.anchor?e.position:e._anchorAxis.domain[l],r[a]>0&&(r[a]+=s),e.title.text!==d._dfltTitle[h]&&(r[a]+=e.title.font.size)}i.autoMargin(t,J(e),r)}),r.skipTitle||et&&e._boundingBox&&"bottom"===e.side||W.push(function(){return function(t,e){var r,n,a,i,o,l,s=t._fullLayout,u=e._id,d=u.charAt(0),p=s._size,h=e.title.font.size;if("multicategory"===e.type)r=e._labelLength;else{r=10+1.5*h+(e.linewidth?e.linewidth-1:0)}"x"===d?(a="free"===e.anchor?{_offset:p.t+(1-(e.position||0))*p.h,_length:0}:L.getFromId(t,e.anchor),i=e._offset+e._length/2,o="top"===e.side?-r-h*(e.showticklabels?1:0):a._length+r+h*(e.showticklabels?1.5:.5),o+=a._offset):(a="free"===e.anchor?{_offset:p.l+(e.position||0)*p.w,_length:0}:L.getFromId(t,e.anchor),o=e._offset+e._length/2,i="right"===e.side?a._length+r+h*(e.showticklabels?1:.5):-r-h*(e.showticklabels?.5:0),i+=a._offset,n={rotate:"-90",offset:0});if("multicategory"!==e.type){var g=e._selections[e._id+"tick"];if(l={selection:g,side:e.side},g&&g.node()&&g.node().parentNode){var v=f.getTranslate(g.node().parentNode);l.offsetLeft=v.x,l.offsetTop=v.y}}return c.draw(t,u+"title",{propContainer:e,propName:e._name+".title.text",placeholder:s._dfltTitle[d],avoid:l,transform:n,attributes:{x:i,y:o,"text-anchor":"middle"}})}(t,e)}),l.syncOrAsync(W)}function rt(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.max(t[1],e[1])}},M.getTickSigns=function(t){var e=t._id.charAt(0),r={x:"top",y:"right"}[e],n=t.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==t.ticks==("x"===e)&&(a=a.map(function(t){return-t})),a},M.makeTransFn=function(t){var e=t._id.charAt(0),r=t._offset;return"x"===e?function(e){return"translate("+(r+t.l2p(e.x))+",0)"}:function(e){return"translate(0,"+(r+t.l2p(e.x))+")"}},M.makeTickPath=function(t,e,r,n){n=void 0!==n?n:t.ticklen;var a=t._id.charAt(0),i=(t.linewidth||1)/2;return"x"===a?"M0,"+(e+i*r)+"v"+n*r:"M"+(e+i*r)+",0h"+n*r},M.makeLabelFns=function(t,e,r){var n=t._id.charAt(0),i=(t.linewidth||1)/2,o="boundaries"!==t.tickson&&"outside"===t.ticks,s=o?t.ticklen:0,c=0;if(r&&"outside"===t.ticks){var u=l.deg2rad(r);s=t.ticklen*Math.cos(u)+1,c=t.ticklen*Math.sin(u)}t.showticklabels&&(o||t.showline)&&(s+=.2*t.tickfont.size);var f,d,p,h,g={labelStandoff:s,labelShift:c};return"x"===n?(h="bottom"===t.side?1:-1,f=c*h,d=e+(s+i)*h,p="bottom"===t.side?1:-.2,g.labelXFn=function(t){return t.dx+f},g.labelYFn=function(t){return t.dy+d+t.fontSize*p},g.labelAnchorFn=function(t){return a(t)&&0!==t&&180!==t?t*h<0?"end":"start":"middle"}):"y"===n&&(h="right"===t.side?1:-1,f=s+i,d=-c*h,p=90===Math.abs(t.tickangle)?.5:0,g.labelXFn=function(t){return t.dx+e+(f+t.fontSize*p)*h},g.labelYFn=function(t){return t.dy+d+t.fontSize*k},g.labelAnchorFn=function(e){return a(e)&&90===Math.abs(e)?"middle":"right"===t.side?"start":"end"}),g},M.drawTicks=function(t,e,r){r=r||{};var n=e._id+"tick",a=r.layer.selectAll("path."+n).data(e.ticks?r.vals:[],X);a.exit().remove(),a.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(u.stroke,e.tickcolor).style("stroke-width",f.crispRound(t,e.tickwidth,1)+"px").attr("d",r.path),a.attr("transform",r.transFn)},M.drawGrid=function(t,e,r){r=r||{};var n=e._id+"grid",a=r.vals,i=r.counterAxis;if(!1===e.showgrid)a=[];else if(i&&M.shouldShowZeroLine(t,e,i))for(var o="array"===e.tickmode,l=0;l<a.length;l++){var s=a[l].x;if(o?!s:Math.abs(s)<e.dtick/100){if(a=a.slice(0,l).concat(a.slice(l+1)),!o)break;l--}}var c=r.layer.selectAll("path."+n).data(a,X);c.exit().remove(),c.enter().append("path").classed(n,1).classed("crisp",!1!==r.crisp),e._gw=f.crispRound(t,e.gridwidth,1),c.attr("transform",r.transFn).attr("d",r.path).call(u.stroke,e.gridcolor||"#ddd").style("stroke-width",e._gw+"px"),"function"==typeof r.path&&c.attr("d",r.path)},M.drawZeroLine=function(t,e,r){r=r||r;var n=e._id+"zl",a=M.shouldShowZeroLine(t,e,r.counterAxis),i=r.layer.selectAll("path."+n).data(a?[{x:0,id:e._id}]:[]);i.exit().remove(),i.enter().append("path").classed(n,1).classed("zl",1).classed("crisp",!1!==r.crisp).each(function(){r.layer.selectAll("path").sort(function(t,e){return L.idSort(t.id,e.id)})}),i.attr("transform",r.transFn).attr("d",r.path).call(u.stroke,e.zerolinecolor||u.defaultLine).style("stroke-width",f.crispRound(t,e.zerolinewidth,e._gw||1)+"px")},M.drawLabels=function(t,e,r){r=r||{};var i=e._id,o=i.charAt(0),c=r.cls||i+"tick",u=r.vals,d=r.labelXFn,p=r.labelYFn,h=r.labelAnchorFn,g=r.secondary?0:e.tickangle,v=(e._tickAngles||{})[c],y=r.layer.selectAll("g."+c).data(e.showticklabels?u:[],X),m=[];function x(t,i){t.each(function(t){var l=n.select(this),c=l.select(".text-math-group"),u=h(i,t),g=r.transFn.call(l.node(),t)+(a(i)&&0!=+i?" rotate("+i+","+d(t)+","+(p(t)-t.fontSize/2)+")":""),v=function(t,r,n){var a=(t-1)*r;if("x"===o){if(n<-60||60<n)return-.5*a;if("top"===e.side)return-a}else{if((n*="left"===e.side?1:-1)<-30)return-a;if(n<30)return-.5*a}return 0}(s.lineCount(l),T*t.fontSize,a(i)?+i:0);if(v&&(g+=" translate(0, "+v+")"),c.empty())l.select("text").attr({transform:g,"text-anchor":u});else{var y=f.bBox(c.node()).width*{end:-.5,start:.5}[u];c.attr("transform",g+(y?"translate("+y+",0)":""))}})}y.enter().append("g").classed(c,1).append("text").attr("text-anchor","middle").each(function(e){var r=n.select(this),a=t._promises.length;r.call(s.positionText,d(e),p(e)).call(f.font,e.font,e.fontSize,e.fontColor).text(e.text).call(s.convertToTspans,t),t._promises[a]?m.push(t._promises.pop().then(function(){x(r,g)})):x(r,g)}),y.exit().remove(),r.repositionOnUpdate&&y.each(function(t){n.select(this).select("text").call(s.positionText,d(t),p(t))}),x(y,v||g),e._selections&&(e._selections[c]=y);var b=l.syncOrAsync([function(){return m.length&&Promise.all(m)},function(){x(y,g);var t=null;if(u.length&&"x"===o&&!a(g)&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){t=0;var n,i=0,s=[];if(y.each(function(t){i=Math.max(i,t.fontSize);var r=e.l2p(t.x),n=W(this),a=f.bBox(n.node());s.push({top:0,bottom:10,height:10,left:r-a.width/2,right:r+a.width/2+2,width:a.width+2})}),"boundaries"!==e.tickson&&!e.showdividers||r.secondary){var d=u.length,p=Math.abs((u[d-1].x-u[0].x)*e._m)/(d-1)<2.5*i||"multicategory"===e.type;for(n=0;n<s.length-1;n++)if(l.bBoxIntersect(s[n],s[n+1])){t=p?90:30;break}}else{var h=2;for(e.ticks&&(h+=e.tickwidth/2),n=0;n<s.length;n++){var v=u[n].xbnd,m=s[n];if(null!==v[0]&&m.left-e.l2p(v[0])<h||null!==v[1]&&e.l2p(v[1])-m.right<h){t=90;break}}}t&&x(y,t)}e._tickAngles&&(e._tickAngles[c]=null===t?a(g)?g:0:t)}]);return b&&b.then&&t._promises.push(b),b},M.shouldShowZeroLine=function(t,e,r){var n=l.simpleMap(e.range,e.r2l);return n[0]*n[1]<=0&&e.zeroline&&("linear"===e.type||"-"===e.type)&&e._gridVals.length&&(Y(e,0)||!function(t,e,r,n){var a=r._mainAxis;if(!a)return;var i=t._fullLayout,o=e._id.charAt(0),l=M.counterLetter(e._id),s=e._offset+(Math.abs(n[0])<Math.abs(n[1])==("x"===o)?0:e._length);function c(t){if(!t.showline||!t.linewidth)return!1;var r=Math.max((t.linewidth+e.zerolinewidth)/2,1);function n(t){return"number"==typeof t&&Math.abs(t-s)<r}if(n(t._mainLinePosition)||n(t._mainMirrorPosition))return!0;var a=t._linepositions||{};for(var i in a)if(n(a[i][0])||n(a[i][1]))return!0}var u=i._plots[r._mainSubplot];if(!(u.mainplotinfo||u).overlays.length)return c(r);for(var f=M.list(t,l),d=0;d<f.length;d++){var p=f[d];if(p._mainAxis===a&&c(p))return!0}}(t,e,r,n)||function(t,e){for(var r=t._fullData,n=e._mainSubplot,a=e._id.charAt(0),i=0;i<r.length;i++){var l=r[i];if(!0===l.visible&&l.xaxis+l.yaxis===n&&(o.traceIs(l,"bar")&&l.orientation==={x:"h",y:"v"}[a]||l.fill&&l.fill.charAt(l.fill.length-1)===a))return!0}return!1}(t,e))},M.clipEnds=function(t,e){return e.filter(function(e){return Y(t,e.x)})},M.allowAutoMargin=function(t){for(var e=M.list(t,"",!0),r=0;r<e.length;r++){var n=e[r];n.automargin&&i.allowAutoMargin(t,J(n)),o.getComponentMethod("rangeslider","isVisible")(n)&&i.allowAutoMargin(t,$(n))}},M.swap=function(t,e){for(var r=function(t,e){var r,n,a=[];for(r=0;r<e.length;r++){var i=[],o=t._fullData[e[r]].xaxis,l=t._fullData[e[r]].yaxis;if(o&&l){for(n=0;n<a.length;n++)-1===a[n].x.indexOf(o)&&-1===a[n].y.indexOf(l)||i.push(n);if(i.length){var s,c=a[i[0]];if(i.length>1)for(n=1;n<i.length;n++)s=a[i[n]],Q(c.x,s.x),Q(c.y,s.y);Q(c.x,[o]),Q(c.y,[l])}else a.push({x:[o],y:[l]})}}return a}(t,e),n=0;n<r.length;n++)K(t,r[n].x,r[n].y)}},{"../../components/color":51,"../../components/drawing":72,"../../components/titles":139,"../../constants/alignment":146,"../../constants/numerical":149,"../../lib":168,"../../lib/svg_text_utils":189,"../../plots/plots":245,"../../registry":257,"./autorange":211,"./axis_autotype":213,"./axis_ids":215,"./clean_ticks":217,"./layout_attributes":225,"./set_convert":231,d3:16,"fast-isnumeric":18}],213:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r){return!(r=r||{}).noMultiCategory&&(o=t,a.isArrayOrTypedArray(o[0])&&a.isArrayOrTypedArray(o[1]))?"multicategory":function(t,e){for(var r=Math.max(1,(t.length-1)/1e3),i=0,o=0,l={},s=0;s<t.length;s+=r){var c=t[Math.round(s)],u=String(c);l[u]||(l[u]=1,a.isDateTime(c,e)&&(i+=1),n(c)&&(o+=1))}return i>2*o}(t,e)?"date":function(t){for(var e=Math.max(1,(t.length-1)/1e3),r=0,n=0,o={},l=0;l<t.length;l+=e){var s=t[Math.round(l)],c=String(s);o[c]||(o[c]=1,"boolean"==typeof s?n++:a.cleanNumber(s)!==i?r++:"string"==typeof s&&n++)}return n>2*r}(t)?"category":function(t){if(!t)return!1;for(var e=0;e<t.length;e++)if(n(t[e]))return!0;return!1}(t)?"linear":"-";var o}},{"../../constants/numerical":149,"../../lib":168,"fast-isnumeric":18}],214:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("./layout_attributes"),o=t("./tick_value_defaults"),l=t("./tick_mark_defaults"),s=t("./tick_label_defaults"),c=t("./category_order_defaults"),u=t("./line_grid_defaults"),f=t("./set_convert");e.exports=function(t,e,r,d,p){var h=d.letter,g=d.font||{},v=d.splomStash||{},y=r("visible",!d.cheateronly),m=e.type;"date"===m&&n.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",d.calendar);if(f(e,p),!r("autorange",!e.isValidRange(t.range))||"linear"!==m&&"-"!==m||r("rangemode"),r("range"),e.cleanRange(),c(t,e,r,d),"category"===m||d.noHover||r("hoverformat"),!y)return e;var x=r("color"),b=x!==i.color.dflt?x:g.color;r("title.text",v.label||p._dfltTitle[h]),a.coerceFont(r,"title.font",{family:g.family,size:Math.round(1.2*g.size),color:b}),o(t,e,r,m),s(t,e,r,m,d),l(t,e,r,d),u(t,e,r,{dfltColor:x,bgColor:d.bgColor,showGrid:d.showGrid,attributes:i}),(e.showline||e.ticks)&&r("mirror"),d.automargin&&r("automargin");var _,w="multicategory"===e.type;d.noTickson||"category"!==e.type&&!w||!e.ticks&&!e.showgrid||(w&&(_="boundaries"),r("tickson",_));w&&(r("showdividers")&&(r("dividercolor"),r("dividerwidth")));return e}},{"../../lib":168,"../../registry":257,"./category_order_defaults":216,"./layout_attributes":225,"./line_grid_defaults":227,"./set_convert":231,"./tick_label_defaults":232,"./tick_mark_defaults":233,"./tick_value_defaults":234}],215:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./constants");r.id2name=function(t){if("string"==typeof t&&t.match(a.AX_ID_PATTERN)){var e=t.substr(1);return"1"===e&&(e=""),t.charAt(0)+"axis"+e}},r.name2id=function(t){if(t.match(a.AX_NAME_PATTERN)){var e=t.substr(5);return"1"===e&&(e=""),t.charAt(0)+e}},r.cleanId=function(t,e){if(t.match(a.AX_ID_PATTERN)&&(!e||t.charAt(0)===e)){var r=t.substr(1).replace(/^0+/,"");return"1"===r&&(r=""),t.charAt(0)+r}},r.list=function(t,e,n){var a=t._fullLayout;if(!a)return[];var i,o=r.listIds(t,e),l=new Array(o.length);for(i=0;i<o.length;i++){var s=o[i];l[i]=a[s.charAt(0)+"axis"+s.substr(1)]}if(!n){var c=a._subplots.gl3d||[];for(i=0;i<c.length;i++){var u=a[c[i]];e?l.push(u[e+"axis"]):l.push(u.xaxis,u.yaxis,u.zaxis)}}return l},r.listIds=function(t,e){var r=t._fullLayout;if(!r)return[];var n=r._subplots;return e?n[e+"axis"]:n.xaxis.concat(n.yaxis)},r.getFromId=function(t,e,n){var a=t._fullLayout;return"x"===n?e=e.replace(/y[0-9]*/,""):"y"===n&&(e=e.replace(/x[0-9]*/,"")),a[r.id2name(e)]},r.getFromTrace=function(t,e,a){var i=t._fullLayout,o=null;if(n.traceIs(e,"gl3d")){var l=e.scene;"scene"===l.substr(0,5)&&(o=i[l][a+"axis"])}else o=r.getFromId(t,e[a+"axis"]||a);return o},r.idSort=function(t,e){var r=t.charAt(0),n=e.charAt(0);return r!==n?r>n?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)}},{"../../registry":257,"./constants":218}],216:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){if("category"===e.type){var a,i=t.categoryarray,o=Array.isArray(i)&&i.length>0;o&&(a="array");var l,s=r("categoryorder",a);"array"===s&&(l=r("categoryarray")),o||"array"!==s||(s=e.categoryorder="trace"),"trace"===s?e._initialCategories=[]:"array"===s?e._initialCategories=l.slice():(l=function(t,e){var r,n,a,i=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;n<e.data.length;n++){var l=e.data[n];l[i+"axis"]===t._id&&r.push(l)}for(n=0;n<r.length;n++){var s=r[n][i];for(a=0;a<s.length;a++){var c=s[a];null!=c&&(o[c]=1)}}return Object.keys(o)}(e,n).sort(),"category ascending"===s?e._initialCategories=l:"category descending"===s&&(e._initialCategories=l.reverse()))}}},{}],217:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").ONEDAY;r.dtick=function(t,e){var r="log"===e,a="date"===e,o="category"===e,l=a?i:1;if(!t)return l;if(n(t))return(t=Number(t))<=0?l:o?Math.max(1,Math.round(t)):a?Math.max(.1,t):t;if("string"!=typeof t||!a&&!r)return l;var s=t.charAt(0),c=t.substr(1);return(c=n(c)?Number(c):0)<=0||!(a&&"M"===s&&c===Math.round(c)||r&&"L"===s||r&&"D"===s&&(1===c||2===c))?l:t},r.tick0=function(t,e,r,i){return"date"===e?a.cleanDate(t,a.dateTick0(r)):"D1"!==i&&"D2"!==i?n(t)?Number(t):0:void 0}},{"../../constants/numerical":149,"../../lib":168,"fast-isnumeric":18}],218:[function(t,e,r){"use strict";var n=t("../../lib/regex").counter;e.exports={idRegex:{x:n("x"),y:n("y")},attrRegex:n("[xy]axis"),xAxisMatch:n("xaxis"),yAxisMatch:n("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,SELECTDELAY:100,SELECTID:"-select",DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["heatmaplayer","contourcarpetlayer","contourlayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},{"../../lib/regex":183}],219:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./axis_ids").id2name;e.exports=function(t,e,r,i,o){var l=o._axisConstraintGroups,s=e._id,c=s.charAt(0);if(!e.fixedrange&&(r("constrain"),n.coerce(t,e,{constraintoward:{valType:"enumerated",values:"x"===c?["left","center","right"]:["bottom","middle","top"],dflt:"x"===c?"center":"middle"}},"constraintoward"),t.scaleanchor)){var u=function(t,e,r,n){var i,o,l,s,c=n[a(e)].type,u=[];for(o=0;o<r.length;o++)(l=r[o])!==e&&((s=n[a(l)]).type!==c||s.fixedrange||u.push(l));for(i=0;i<t.length;i++)if(t[i][e]){var f=t[i],d=[];for(o=0;o<u.length;o++)l=u[o],f[l]||d.push(l);return{linkableAxes:d,thisGroup:f}}return{linkableAxes:u,thisGroup:null}}(l,s,i,o),f=n.coerce(t,e,{scaleanchor:{valType:"enumerated",values:u.linkableAxes}},"scaleanchor");if(f){var d=r("scaleratio");d||(d=e.scaleratio=1),function(t,e,r,n,a){var i,o,l,s,c;null===e?((e={})[r]=1,c=t.length,t.push(e)):c=t.indexOf(e);var u=Object.keys(e);for(i=0;i<t.length;i++)if(l=t[i],i!==c&&l[n]){var f=l[n];for(o=0;o<u.length;o++)s=u[o],l[s]=f*a*e[s];return void t.splice(c,1)}if(1!==a)for(o=0;o<u.length;o++)e[u[o]]*=a;e[n]=1}(l,u.thisGroup,s,f,d)}else-1!==i.indexOf(t.scaleanchor)&&n.warn("ignored "+e._name+'.scaleanchor: "'+t.scaleanchor+'" to avoid either an infinite loop and possibly inconsistent scaleratios, or because the targetaxis has fixed range.')}}},{"../../lib":168,"./axis_ids":215}],220:[function(t,e,r){"use strict";var n=t("./axis_ids").id2name,a=t("./scale_zoom"),i=t("./autorange").makePadFn,o=t("./autorange").concatExtremes,l=t("../../constants/numerical").ALMOST_EQUAL,s=t("../../constants/alignment").FROM_BL;function c(t,e){var r=t._inputDomain,n=s[t.constraintoward],a=r[0]+(r[1]-r[0])*n;t.domain=t._input.domain=[a+(r[0]-a)/e,a+(r[1]-a)/e],t.setScale()}r.enforce=function(t){var e,r,s,u,f,d,p,h=t._fullLayout,g=h._axisConstraintGroups||[];for(e=0;e<g.length;e++){var v=g[e],y=Object.keys(v),m=1/0,x=0,b=1/0,_={},w={},k=!1;for(r=0;r<y.length;r++)w[s=y[r]]=u=h[n(s)],u._inputDomain?u.domain=u._inputDomain.slice():u._inputDomain=u.domain.slice(),u._inputRange||(u._inputRange=u.range.slice()),u.setScale(),_[s]=f=Math.abs(u._m)/v[s],m=Math.min(m,f),"domain"!==u.constrain&&u._constraintShrinkable||(b=Math.min(b,f)),delete u._constraintShrinkable,x=Math.max(x,f),"domain"===u.constrain&&(k=!0);if(!(m>l*x)||k)for(r=0;r<y.length;r++)if(f=_[s=y[r]],d=(u=w[s]).constrain,f!==b||"domain"===d)if(p=f/b,"range"===d)a(u,p);else{var T=u._inputDomain,M=(u.domain[1]-u.domain[0])/(T[1]-T[0]),A=(u.r2l(u.range[1])-u.r2l(u.range[0]))/(u.r2l(u._inputRange[1])-u.r2l(u._inputRange[0]));if((p/=M)*A<1){u.domain=u._input.domain=T.slice(),a(u,p);continue}if(A<1&&(u.range=u._input.range=u._inputRange.slice(),p*=A),u.autorange){var L=u.r2l(u.range[0]),S=u.r2l(u.range[1]),C=(L+S)/2,O=C,z=C,D=Math.abs(S-C),P=C-D*p*1.0001,E=C+D*p*1.0001,R=i(u);c(u,p);var I,F,N=Math.abs(u._m),B=o(t,u),j=B.min,H=B.max;for(F=0;F<j.length;F++)(I=j[F].val-R(j[F])/N)>P&&I<O&&(O=I);for(F=0;F<H.length;F++)(I=H[F].val+R(H[F])/N)<E&&I>z&&(z=I);p/=(z-O)/(2*D),O=u.l2r(O),z=u.l2r(z),u.range=u._input.range=L<S?[O,z]:[z,O]}c(u,p)}}},r.clean=function(t,e){if(e._inputDomain){for(var r=!1,n=e._id,a=t._fullLayout._axisConstraintGroups,i=0;i<a.length;i++)if(a[i][n]){r=!0;break}r&&"domain"===e.constrain||(e._input.domain=e.domain=e._inputDomain,delete e._inputDomain)}}},{"../../constants/alignment":146,"../../constants/numerical":149,"./autorange":211,"./axis_ids":215,"./scale_zoom":229}],221:[function(t,e,r){"use strict";var n=t("d3"),a=t("tinycolor2"),i=t("has-passive-events"),o=t("../../registry"),l=t("../../lib"),s=t("../../lib/svg_text_utils"),c=t("../../components/color"),u=t("../../components/drawing"),f=t("../../components/fx"),d=t("./axes"),p=t("../../lib/setcursor"),h=t("../../components/dragelement"),g=t("../../constants/alignment").FROM_TL,v=t("../../lib/clear_gl_canvases"),y=t("../../plot_api/subroutines").redrawReglTraces,m=t("../plots"),x=t("./axis_ids").getFromId,b=t("./select").prepSelect,_=t("./select").clearSelect,w=t("./select").selectOnClick,k=t("./scale_zoom"),T=t("./constants"),M=T.MINDRAG,A=T.MINZOOM,L=!0;function S(t,e,r,n){var a=l.ensureSingle(t.draglayer,e,r,function(e){e.classed("drag",!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",t.id)});return a.call(p,n),a.node()}function C(t,e,r,a,i,o,l){var s=S(t,"rect",e,r);return n.select(s).call(u.setRect,a,i,o,l),s}function O(t,e){for(var r=0;r<t.length;r++)if(!t[r].fixedrange)return e;return""}function z(t,e,r,n,a){var i,o,l,s;for(i=0;i<t.length;i++)(o=t[i]).fixedrange||(l=o._rl[0],s=o._rl[1]-l,o.range=[o.l2r(l+s*e),o.l2r(l+s*r)],n[o._name+".range[0]"]=o.range[0],n[o._name+".range[1]"]=o.range[1]);if(a&&a.length){var c=(e+(1-r))/2;z(a,c,1-c,n)}}function D(t,e){for(var r=0;r<t.length;r++){var n=t[r];n.fixedrange||(n.range=[n.l2r(n._rl[0]-e/n._m),n.l2r(n._rl[1]-e/n._m)])}}function P(t){return 1-(t>=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function E(t,e,r,n,a){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",a+"Z")}function R(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function I(t,e,r,n,a,i){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),F(t,e,a,i)}function F(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function N(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function B(t){L&&t.data&&t._context.showTips&&(l.notifier(l._(t,"Double-click to zoom back out"),"long"),L=!1)}function j(t){return"lasso"===t||"select"===t}function H(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,A)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function q(t,e){if(i){var r=void 0!==t.onwheel?"wheel":"mousewheel";t._onwheel&&t.removeEventListener(r,t._onwheel),t._onwheel=e,t.addEventListener(r,e,{passive:!1})}else void 0!==t.onwheel?t.onwheel=e:void 0!==t.onmousewheel&&(t.onmousewheel=e)}function V(t){var e=[];for(var r in t)e.push(t[r]);return e}e.exports={makeDragBox:function(t,e,r,i,c,p,L,S){var F,U,G,Z,X,Y,W,J,$,Q,K,tt,et,rt,nt,at,it,ot,lt,st,ct,ut=t._fullLayout._zoomlayer,ft=L+S==="nsew",dt=1===(L+S).length;function pt(){if(F=e.xaxis,U=e.yaxis,$=F._length,Q=U._length,W=F._offset,J=U._offset,(G={})[F._id]=F,(Z={})[U._id]=U,L&&S)for(var r=e.overlays,n=0;n<r.length;n++){var a=r[n].xaxis;G[a._id]=a;var i=r[n].yaxis;Z[i._id]=i}X=V(G),Y=V(Z),tt=O(X,S),et=O(Y,L),rt=!et&&!tt,K=function(t,e,r){for(var n,a,i,o,s=t._fullLayout._axisConstraintGroups,c=!1,u={},f={},d=0;d<s.length;d++){var p=s[d];for(n in e)if(p[n]){for(i in p)("x"===i.charAt(0)?e:r)[i]||(u[i]=1);for(a in r)p[a]&&(c=!0)}for(a in r)if(p[a])for(o in p)("x"===o.charAt(0)?e:r)[o]||(f[o]=1)}c&&(l.extendFlat(u,f),f={});var h={},g=[];for(i in u){var v=x(t,i);g.push(v),h[v._id]=v}var y={},m=[];for(o in f){var b=x(t,o);m.push(b),y[b._id]=b}return{xaHash:h,yaHash:y,xaxes:g,yaxes:m,isSubplotConstrained:c}}(t,G,Z),nt=K.isSubplotConstrained,at=S||nt,it=L||nt;var o=t._fullLayout;ot=o._has("scattergl"),lt=o._has("splom"),st=o._has("svg")}pt();var ht=function(t,e,r){return t?"nsew"===t?r?"":"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}(et+tt,t._fullLayout.dragmode,ft),gt=C(e,L+S+"drag",ht,r,i,c,p);if(rt&&!ft)return gt.onmousedown=null,gt.style.pointerEvents="none",gt;var vt,yt,mt,xt,bt,_t,wt,kt,Tt,Mt,At={element:gt,gd:t,plotinfo:e};function Lt(){At.plotinfo.selection=!1,_(ut)}function St(r,a){var i=t._fullLayout.clickmode;if(N(t),2!==r||dt||function(){if(!t._transitioningWithDuration){var e,r,n,a=t._context.doubleClick,i=(tt?X:[]).concat(et?Y:[]),l={};if("reset+autosize"===a)for(a="autosize",r=0;r<i.length;r++)if((e=i[r])._rangeInitial&&(e.range[0]!==e._rangeInitial[0]||e.range[1]!==e._rangeInitial[1])||!e._rangeInitial&&!e.autorange){a="reset";break}if("autosize"===a)for(r=0;r<i.length;r++)(e=i[r]).fixedrange||(l[e._name+".autorange"]=!0);else if("reset"===a)for((tt||nt)&&(i=i.concat(K.xaxes)),et&&!nt&&(i=i.concat(K.yaxes)),nt&&(tt?et||(i=i.concat(Y)):i=i.concat(X)),r=0;r<i.length;r++)(e=i[r]).fixedrange||(e._rangeInitial?(n=e._rangeInitial,l[e._name+".range[0]"]=n[0],l[e._name+".range[1]"]=n[1]):l[e._name+".autorange"]=!0);t.emit("plotly_doubleclick",null),o.call("_guiRelayout",t,l)}}(),ft)i.indexOf("select")>-1&&w(a,t,X,Y,e.id,At),i.indexOf("event")>-1&&f.click(t,a,e.id);else if(1===r&&dt){var l=L?U:F,c="s"===L||"w"===S?0:1,u=l._name+".range["+c+"]",d=function(t,e){var r,a=t.range[e],i=Math.abs(a-t.range[1-e]);return"date"===t.type?a:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,n.format("."+r+"g")(Math.pow(10,a))):(r=Math.floor(Math.log(Math.abs(a))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,n.format("."+String(r)+"g")(a))}(l,c),p="left",h="middle";if(l.fixedrange)return;L?(h="n"===L?"top":"bottom","right"===l.side&&(p="right")):"e"===S&&(p="right"),t._context.showAxisRangeEntryBoxes&&n.select(gt).call(s.makeEditable,{gd:t,immediate:!0,background:t._fullLayout.paper_bgcolor,text:String(d),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:p,verticalAlign:h}).on("edit",function(e){var r=l.d2r(e);void 0!==r&&o.call("_guiRelayout",t,u,r)})}}function Ct(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min($,e+vt)),a=Math.max(0,Math.min(Q,r+yt)),i=Math.abs(n-vt),o=Math.abs(a-yt);function l(){wt="",mt.r=mt.l,mt.t=mt.b,Tt.attr("d","M0,0Z")}mt.l=Math.min(vt,n),mt.r=Math.max(vt,n),mt.t=Math.min(yt,a),mt.b=Math.max(yt,a),nt?i>A||o>A?(wt="xy",i/$>o/Q?(o=i*Q/$,yt>a?mt.t=yt-o:mt.b=yt+o):(i=o*$/Q,vt>n?mt.l=vt-i:mt.r=vt+i),Tt.attr("d",H(mt))):l():!et||o<Math.min(Math.max(.6*i,M),A)?i<M||!tt?l():(mt.t=0,mt.b=Q,wt="x",Tt.attr("d",function(t,e){return"M"+(t.l-.5)+","+(e-A-.5)+"h-3v"+(2*A+1)+"h3ZM"+(t.r+.5)+","+(e-A-.5)+"h3v"+(2*A+1)+"h-3Z"}(mt,yt))):!tt||i<Math.min(.6*o,A)?(mt.l=0,mt.r=$,wt="y",Tt.attr("d",function(t,e){return"M"+(e-A-.5)+","+(t.t-.5)+"v-3h"+(2*A+1)+"v3ZM"+(e-A-.5)+","+(t.b+.5)+"v3h"+(2*A+1)+"v-3Z"}(mt,vt))):(wt="xy",Tt.attr("d",H(mt))),mt.w=mt.r-mt.l,mt.h=mt.b-mt.t,wt&&(Mt=!0),t._dragged=Mt,I(kt,Tt,mt,bt,_t,xt),_t=!0}function Ot(){if(ct={},Math.min(mt.h,mt.w)<2*M)return N(t);"xy"!==wt&&"x"!==wt||z(X,mt.l/$,mt.r/$,ct,K.xaxes),"xy"!==wt&&"y"!==wt||z(Y,(Q-mt.b)/Q,(Q-mt.t)/Q,ct,K.yaxes),N(t),Bt(),B(t)}At.prepFn=function(e,r,n){var i=At.dragmode,o=t._fullLayout.dragmode;o!==i&&(At.dragmode=o),pt(),rt||(ft?e.shiftKey?"pan"===o?o="zoom":j(o)||(o="pan"):e.ctrlKey&&(o="pan"):o="pan"),At.minDrag="lasso"===o?1:void 0,j(o)?(At.xaxes=X,At.yaxes=Y,b(e,r,n,At,o)):(At.clickFn=St,j(i)&&Lt(),rt||("zoom"===o?(At.moveFn=Ct,At.doneFn=Ot,At.minDrag=1,function(e,r,n){var i=gt.getBoundingClientRect();vt=r-i.left,yt=n-i.top,mt={l:vt,r:vt,w:0,t:yt,b:yt,h:0},xt=t._hmpixcount?t._hmlumcount/t._hmpixcount:a(t._fullLayout.plot_bgcolor).getLuminance(),_t=!1,wt="xy",Mt=!1,kt=E(ut,xt,W,J,bt="M0,0H"+$+"V"+Q+"H0V0"),Tt=R(ut,W,J)}(0,r,n)):"pan"===o&&(At.moveFn=Ft,At.doneFn=Bt)))},h.init(At);var zt,Dt,Pt=[0,0,$,Q],Et=null,Rt=T.REDRAWDELAY,It=e.mainplot?t._fullLayout._plots[e.mainplot]:e;function Ft(e,r){if(!t._transitioningWithDuration){if(t._fullLayout._replotting=!0,"ew"===tt||"ns"===et)return tt&&D(X,e),et&&D(Y,r),jt([tt?-e:0,et?-r:0,$,Q]),void Nt();if(nt&&tt&&et){var n="w"===tt==("n"===et)?1:-1,a=(e/$+n*r/Q)/2;e=a*$,r=n*a*Q}"w"===tt?e=s(X,0,e):"e"===tt?e=s(X,1,-e):tt||(e=0),"n"===et?r=s(Y,1,r):"s"===et?r=s(Y,0,-r):et||(r=0);var i="w"===tt?e:0,o="n"===et?r:0;if(nt){var l;if(!tt&&1===et.length){for(l=0;l<X.length;l++)X[l].range=X[l]._r.slice(),k(X[l],1-r/Q);i=(e=r*$/Q)/2}if(!et&&1===tt.length){for(l=0;l<Y.length;l++)Y[l].range=Y[l]._r.slice(),k(Y[l],1-e/$);o=(r=e*Q/$)/2}}jt([i,o,$-e,Q-r]),Nt()}function s(t,e,r){for(var n,a,i=1-e,o=0;o<t.length;o++){var l=t[o];if(!l.fixedrange){n=l,a=l._rl[i]+(l._rl[e]-l._rl[i])/P(r/l._length);var s=l.l2r(a);!1!==s&&void 0!==s&&(l.range[e]=s)}}return n._length*(n._rl[e]-a)/(n._rl[e]-n._rl[i])}}function Nt(){var e,r=[];function n(t){for(e=0;e<t.length;e++)t[e].fixedrange||r.push(t[e]._id)}for(at&&(n(X),n(K.xaxes)),it&&(n(Y),n(K.yaxes)),ct={},e=0;e<r.length;e++){var a=r[e],i=x(t,a);d.drawOne(t,i,{skipTitle:!0}),ct[i._name+".range[0]"]=i.range[0],ct[i._name+".range[1]"]=i.range[1]}d.redrawComponents(t,r)}function Bt(){jt([0,0,$,Q]),l.syncOrAsync([m.previousPromises,function(){t._fullLayout._replotting=!1,o.call("_guiRelayout",t,ct)}],t)}function jt(e){var r,n,a,i,s=t._fullLayout,c=s._plots,f=s._subplots.cartesian;if(lt&&o.subplotsRegistry.splom.drag(t),ot)for(r=0;r<f.length;r++)if(a=(n=c[f[r]]).xaxis,i=n.yaxis,n._scene){var d=l.simpleMap(a.range,a.r2l),p=l.simpleMap(i.range,i.r2l);n._scene.update({range:[d[0],p[0],d[1],p[1]]})}if((lt||ot)&&(v(t),y(t)),st){var h=e[2]/F._length,g=e[3]/U._length;for(r=0;r<f.length;r++){a=(n=c[f[r]]).xaxis,i=n.yaxis;var m,x,b,_,w=at&&!a.fixedrange&&G[a._id],k=it&&!i.fixedrange&&Z[i._id];if(w?(m=h,b=S?e[0]:Vt(a,m)):b=qt(a,m=Ht(a,h,g)),k?(x=g,_=L?e[1]:Vt(i,x)):_=qt(i,x=Ht(i,h,g)),m||x){m||(m=1),x||(x=1);var T=a._offset-b/m,M=i._offset-_/x;n.clipRect.call(u.setTranslate,b,_).call(u.setScale,m,x),n.plot.call(u.setTranslate,T,M).call(u.setScale,1/m,1/x),m===zt&&x===Dt||(u.setPointGroupScale(n.zoomScalePts,m,x),u.setTextPointsScale(n.zoomScaleTxt,m,x)),u.hideOutsideRangePoints(n.clipOnAxisFalseTraces,n),zt=m,Dt=x}}}}function Ht(t,e,r){return t.fixedrange?0:at&&K.xaHash[t._id]?e:it&&(nt?K.xaHash:K.yaHash)[t._id]?r:0}function qt(t,e){return e?(t.range=t._r.slice(),k(t,e),Vt(t,e)):0}function Vt(t,e){return t._length*(1-e)*g[t.constraintoward||"middle"]}return L.length*S.length!=1&&q(gt,function(e){if(t._context._scrollZoom.cartesian||t._fullLayout._enablescrollzoom){if(Lt(),t._transitioningWithDuration)return e.preventDefault(),void e.stopPropagation();pt(),clearTimeout(Et);var r=-e.deltaY;if(isFinite(r)||(r=e.wheelDelta/10),isFinite(r)){var n,a=Math.exp(-Math.min(Math.max(r,-20),20)/200),i=It.draglayer.select(".nsewdrag").node().getBoundingClientRect(),o=(e.clientX-i.left)/i.width,s=(i.bottom-e.clientY)/i.height;if(at){for(S||(o=.5),n=0;n<X.length;n++)c(X[n],o,a);Pt[2]*=a,Pt[0]+=Pt[2]*o*(1/a-1)}if(it){for(L||(s=.5),n=0;n<Y.length;n++)c(Y[n],s,a);Pt[3]*=a,Pt[1]+=Pt[3]*(1-s)*(1/a-1)}jt(Pt),Nt(),Et=setTimeout(function(){Pt=[0,0,$,Q],Bt()},Rt),e.preventDefault()}else l.log("Did not find wheel motion attributes: ",e)}function c(t,e,r){if(!t.fixedrange){var n=l.simpleMap(t.range,t.r2l),a=n[0]+(n[1]-n[0])*e;t.range=n.map(function(e){return t.l2r(a+(e-a)*r)})}}}),gt},makeDragger:S,makeRectDragger:C,makeZoombox:E,makeCorners:R,updateZoombox:I,xyCorners:H,transitionZoombox:F,removeZoombox:N,showDoubleClickNotifier:B,attachWheelEventHandler:q}},{"../../components/color":51,"../../components/dragelement":69,"../../components/drawing":72,"../../components/fx":90,"../../constants/alignment":146,"../../lib":168,"../../lib/clear_gl_canvases":157,"../../lib/setcursor":187,"../../lib/svg_text_utils":189,"../../plot_api/subroutines":203,"../../registry":257,"../plots":245,"./axes":212,"./axis_ids":215,"./constants":218,"./scale_zoom":229,"./select":230,d3:16,"has-passive-events":21,tinycolor2:34}],222:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/fx"),i=t("../../components/dragelement"),o=t("../../lib/setcursor"),l=t("./dragbox").makeDragBox,s=t("./constants").DRAGGERSIZE;r.initInteractions=function(t){var e=t._fullLayout;if(t._context.staticPlot)n.select(t).selectAll(".drag").remove();else if(e._has("cartesian")||e._has("splom")){Object.keys(e._plots||{}).sort(function(t,r){if((e._plots[t].mainplot&&!0)===(e._plots[r].mainplot&&!0)){var n=t.split("y"),a=r.split("y");return n[0]===a[0]?Number(n[1]||1)-Number(a[1]||1):Number(n[0]||1)-Number(a[0]||1)}return e._plots[t].mainplot?1:-1}).forEach(function(r){var n=e._plots[r],o=n.xaxis,c=n.yaxis;if(!n.mainplot){var u=l(t,n,o._offset,c._offset,o._length,c._length,"ns","ew");u.onmousemove=function(e){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===r&&a.hover(t,e,r)},a.hover(t,e,r),t._fullLayout._lasthover=u,t._fullLayout._hoversubplot=r},u.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,i.unhover(t,e))},t._context.showAxisDragHandles&&(l(t,n,o._offset-s,c._offset-s,s,s,"n","w"),l(t,n,o._offset+o._length,c._offset-s,s,s,"n","e"),l(t,n,o._offset-s,c._offset+c._length,s,s,"s","w"),l(t,n,o._offset+o._length,c._offset+c._length,s,s,"s","e"))}if(t._context.showAxisDragHandles){if(r===o._mainSubplot){var f=o._mainLinePosition;"top"===o.side&&(f-=s),l(t,n,o._offset+.1*o._length,f,.8*o._length,s,"","ew"),l(t,n,o._offset,f,.1*o._length,s,"","w"),l(t,n,o._offset+.9*o._length,f,.1*o._length,s,"","e")}if(r===c._mainSubplot){var d=c._mainLinePosition;"right"!==c.side&&(d-=s),l(t,n,d,c._offset+.1*c._length,s,.8*c._length,"ns",""),l(t,n,d,c._offset+.9*c._length,s,.1*c._length,"s",""),l(t,n,d,c._offset,s,.1*c._length,"n","")}}});var o=e._hoverlayer.node();o.onmousemove=function(r){r.target=t._fullLayout._lasthover,a.hover(t,r,e._hoversubplot)},o.onclick=function(e){e.target=t._fullLayout._lasthover,a.click(t,e)},o.onmousedown=function(e){t._fullLayout._lasthover.onmousedown(e)},r.updateFx(t)}},r.updateFx=function(t){var e=t._fullLayout,r="pan"===e.dragmode?"move":"crosshair";o(e._draggers,r)}},{"../../components/dragelement":69,"../../components/fx":90,"../../lib/setcursor":187,"./constants":218,"./dragbox":221,d3:16}],223:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib");e.exports=function(t){return function(e,r){var i=e[t];if(Array.isArray(i))for(var o=n.subplotsRegistry.cartesian,l=o.idRegex,s=r._subplots,c=s.xaxis,u=s.yaxis,f=s.cartesian,d=r._has("cartesian")||r._has("gl2d"),p=0;p<i.length;p++){var h=i[p];if(a.isPlainObject(h)){var g=h.xref,v=h.yref,y=l.x.test(g),m=l.y.test(v);if(y||m){d||a.pushUnique(r._basePlotModules,o);var x=!1;y&&-1===c.indexOf(g)&&(c.push(g),x=!0),m&&-1===u.indexOf(v)&&(u.push(v),x=!0),x&&y&&m&&f.push(g+v)}}}}}},{"../../lib":168,"../../registry":257}],224:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../lib"),o=t("../plots"),l=t("../../components/drawing"),s=t("../get_data").getModuleCalcData,c=t("./axis_ids"),u=t("./constants"),f=t("../../constants/xmlns_namespaces"),d=i.ensureSingle;function p(t,e,r){return i.ensureSingle(t,e,r,function(t){t.datum(r)})}function h(t,e,r,i,o){for(var c,f,d,p=u.traceLayerClasses,h=t._fullLayout,g=h._modules,v=[],y=[],m=0;m<g.length;m++){var x=(c=g[m]).name,b=a.modules[x].categories;if(b.svg){var _=c.layerName||x+"layer",w=c.plot;d=(f=s(r,w))[0],r=f[1],d.length&&v.push({i:p.indexOf(_),className:_,plotMethod:w,cdModule:d}),b.zoomScale&&y.push("."+_)}}v.sort(function(t,e){return t.i-e.i});var k=e.plot.selectAll("g.mlayer").data(v,function(t){return t.className});if(k.enter().append("g").attr("class",function(t){return t.className}).classed("mlayer",!0),k.exit().remove(),k.order(),k.each(function(r){var a=n.select(this),s=r.className;r.plotMethod(t,e,r.cdModule,a,i,o),"scatterlayer"!==s&&"barlayer"!==s&&l.setClipUrl(a,e.layerClipId,t)}),h._has("scattergl")&&(c=a.getModule("scattergl"),d=s(r,c)[0],c.plot(t,e,d)),!t._context.staticPlot&&(e._hasClipOnAxisFalse&&(e.clipOnAxisFalseTraces=e.plot.selectAll(".scatterlayer, .barlayer").selectAll(".trace")),y.length)){var T=e.plot.selectAll(y.join(",")).selectAll(".trace");e.zoomScalePts=T.selectAll("path.point"),e.zoomScaleTxt=T.selectAll(".textpoint")}}function g(t,e){var r=e.plotgroup,n=e.id,a=u.layerValue2layerClass[e.xaxis.layer],i=u.layerValue2layerClass[e.yaxis.layer],o=t._fullLayout._hasOnlyLargeSploms;if(e.mainplot){var l=e.mainplotinfo,s=l.plotgroup,f=n+"-x",h=n+"-y";e.gridlayer=l.gridlayer,e.zerolinelayer=l.zerolinelayer,d(l.overlinesBelow,"path",f),d(l.overlinesBelow,"path",h),d(l.overaxesBelow,"g",f),d(l.overaxesBelow,"g",h),e.plot=d(l.overplot,"g",n),d(l.overlinesAbove,"path",f),d(l.overlinesAbove,"path",h),d(l.overaxesAbove,"g",f),d(l.overaxesAbove,"g",h),e.xlines=s.select(".overlines-"+a).select("."+f),e.ylines=s.select(".overlines-"+i).select("."+h),e.xaxislayer=s.select(".overaxes-"+a).select("."+f),e.yaxislayer=s.select(".overaxes-"+i).select("."+h)}else if(o)e.xlines=d(r,"path","xlines-above"),e.ylines=d(r,"path","ylines-above"),e.xaxislayer=d(r,"g","xaxislayer-above"),e.yaxislayer=d(r,"g","yaxislayer-above");else{var g=d(r,"g","layer-subplot");e.shapelayer=d(g,"g","shapelayer"),e.imagelayer=d(g,"g","imagelayer"),e.gridlayer=d(r,"g","gridlayer"),e.zerolinelayer=d(r,"g","zerolinelayer"),d(r,"path","xlines-below"),d(r,"path","ylines-below"),e.overlinesBelow=d(r,"g","overlines-below"),d(r,"g","xaxislayer-below"),d(r,"g","yaxislayer-below"),e.overaxesBelow=d(r,"g","overaxes-below"),e.plot=d(r,"g","plot"),e.overplot=d(r,"g","overplot"),e.xlines=d(r,"path","xlines-above"),e.ylines=d(r,"path","ylines-above"),e.overlinesAbove=d(r,"g","overlines-above"),d(r,"g","xaxislayer-above"),d(r,"g","yaxislayer-above"),e.overaxesAbove=d(r,"g","overaxes-above"),e.xlines=r.select(".xlines-"+a),e.ylines=r.select(".ylines-"+i),e.xaxislayer=r.select(".xaxislayer-"+a),e.yaxislayer=r.select(".yaxislayer-"+i)}o||(p(e.gridlayer,"g",e.xaxis._id),p(e.gridlayer,"g",e.yaxis._id),e.gridlayer.selectAll("g").map(function(t){return t[0]}).sort(c.idSort)),e.xlines.style("fill","none").classed("crisp",!0),e.ylines.style("fill","none").classed("crisp",!0)}function v(t,e){if(t){var r={};for(var a in t.each(function(t){var a=t[0];n.select(this).remove(),y(a,e),r[a]=!0}),e._plots)for(var i=e._plots[a].overlays||[],o=0;o<i.length;o++){var l=i[o];r[l.id]&&l.plot.selectAll(".trace").remove()}}}function y(t,e){e._draggers.selectAll("g."+t).remove(),e._defs.select("#clip"+e._uid+t+"plot").remove()}r.name="cartesian",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex=u.idRegex,r.attrRegex=u.attrRegex,r.attributes=t("./attributes"),r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.transitionAxes=t("./transition_axes"),r.finalizeSubplots=function(t,e){var r,n,a,o=e._subplots,l=o.xaxis,s=o.yaxis,f=o.cartesian,d=f.concat(o.gl2d||[]),p={},h={};for(r=0;r<d.length;r++){var g=d[r].split("y");p[g[0]]=1,h["y"+g[1]]=1}for(r=0;r<l.length;r++)p[n=l[r]]||(a=(t[c.id2name(n)]||{}).anchor,u.idRegex.y.test(a)||(a="y"),f.push(n+a),d.push(n+a),h[a]||(h[a]=1,i.pushUnique(s,a)));for(r=0;r<s.length;r++)h[a=s[r]]||(n=(t[c.id2name(a)]||{}).anchor,u.idRegex.x.test(n)||(n="x"),f.push(n+a),d.push(n+a),p[n]||(p[n]=1,i.pushUnique(l,n)));if(!d.length){for(var v in n="",a="",t){if(u.attrRegex.test(v))"x"===v.charAt(0)?(!n||+v.substr(5)<+n.substr(5))&&(n=v):(!a||+v.substr(5)<+a.substr(5))&&(a=v)}n=n?c.name2id(n):"x",a=a?c.name2id(a):"y",l.push(n),s.push(a),f.push(n+a)}},r.plot=function(t,e,r,n){var a,i=t._fullLayout,o=i._subplots.cartesian,l=t.calcdata;if(null!==e){if(!Array.isArray(e))for(e=[],a=0;a<l.length;a++)e.push(a);for(a=0;a<o.length;a++){for(var s,c=o[a],u=i._plots[c],f=[],d=0;d<l.length;d++){var p=l[d],g=p[0].trace;g.xaxis+g.yaxis===c&&((-1!==e.indexOf(g.index)||g.carpet)&&(s&&s[0].trace.xaxis+s[0].trace.yaxis===c&&-1!==["tonextx","tonexty","tonext"].indexOf(g.fill)&&-1===f.indexOf(s)&&f.push(s),f.push(p)),s=p)}h(t,u,f,r,n)}}},r.clean=function(t,e,r,n){var a,i,o,l=n._plots||{},s=e._plots||{},u=n._subplots||{};if(n._hasOnlyLargeSploms&&!e._hasOnlyLargeSploms)for(o in l)(a=l[o]).plotgroup&&a.plotgroup.remove();var f=n._has&&n._has("gl"),d=e._has&&e._has("gl");if(f&&!d)for(o in l)(a=l[o])._scene&&a._scene.destroy();if(u.xaxis&&u.yaxis){var p=c.listIds({_fullLayout:n});for(i=0;i<p.length;i++){var h=p[i];e[c.id2name(h)]||n._infolayer.selectAll(".g-"+h+"title").remove()}}var g=n._has&&n._has("cartesian"),m=e._has&&e._has("cartesian");if(g&&!m)v(n._cartesianlayer.selectAll(".subplot"),n),n._defs.selectAll(".axesclip").remove(),delete n._axisConstraintGroups;else if(u.cartesian)for(i=0;i<u.cartesian.length;i++){var x=u.cartesian[i];if(!s[x]){var b="."+x+",."+x+"-x,."+x+"-y";n._cartesianlayer.selectAll(b).remove(),y(x,n)}}},r.drawFramework=function(t){var e=t._fullLayout,r=function(t){var e,r,n,a,i,o,l=t._fullLayout,s=l._subplots.cartesian,c=s.length,u=[],f=[];for(e=0;e<c;e++){n=s[e],a=l._plots[n],i=a.xaxis,o=a.yaxis;var d=i._mainAxis,p=o._mainAxis,h=d._id+p._id,g=l._plots[h];a.overlays=[],h!==n&&g?(a.mainplot=h,a.mainplotinfo=g,f.push(n)):(a.mainplot=void 0,a.mainPlotinfo=void 0,u.push(n))}for(e=0;e<f.length;e++)n=f[e],(a=l._plots[n]).mainplotinfo.overlays.push(a);var v=u.concat(f),y=new Array(c);for(e=0;e<c;e++){n=v[e],a=l._plots[n],i=a.xaxis,o=a.yaxis;var m=[n,i.layer,o.layer,i.overlaying||"",o.overlaying||""];for(r=0;r<a.overlays.length;r++)m.push(a.overlays[r].id);y[e]=m}return y}(t),a=e._cartesianlayer.selectAll(".subplot").data(r,String);a.enter().append("g").attr("class",function(t){return"subplot "+t[0]}),a.order(),a.exit().call(v,e),a.each(function(r){var a=r[0],i=e._plots[a];i.plotgroup=n.select(this),g(t,i),i.draglayer=d(e._draggers,"g",a)})},r.rangePlot=function(t,e,r){g(t,e),h(t,e,r),o.style(t)},r.toSVG=function(t){var e=t._fullLayout._glimages,r=n.select(t).selectAll(".svg-container");r.filter(function(t,e){return e===r.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus").each(function(){var t=this.toDataURL("image/png");e.append("svg:image").attr({xmlns:f.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:this.width,height:this.height})})},r.updateFx=t("./graph_interact").updateFx},{"../../components/drawing":72,"../../constants/xmlns_namespaces":150,"../../lib":168,"../../registry":257,"../get_data":241,"../plots":245,"./attributes":210,"./axis_ids":215,"./constants":218,"./graph_interact":222,"./layout_attributes":225,"./layout_defaults":226,"./transition_axes":235,d3:16}],225:[function(t,e,r){"use strict";var n=t("../font_attributes"),a=t("../../components/color/attributes"),i=t("../../components/drawing/attributes").dash,o=t("../../lib/extend").extendFlat,l=t("../../plot_api/plot_template").templatedArray,s=t("./constants");e.exports={visible:{valType:"boolean",editType:"plot"},color:{valType:"color",dflt:a.defaultLine,editType:"ticks"},title:{text:{valType:"string",editType:"ticks"},font:n({editType:"ticks"}),editType:"ticks"},type:{valType:"enumerated",values:["-","linear","log","date","category","multicategory"],dflt:"-",editType:"calc",_noTemplating:!0},autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0,editType:"axrange",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"plot"},range:{valType:"info_array",items:[{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0},{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0}],editType:"axrange",impliedEdits:{autorange:!1},anim:!0},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},scaleanchor:{valType:"enumerated",values:[s.idRegex.x.toString(),s.idRegex.y.toString()],editType:"plot"},scaleratio:{valType:"number",min:0,dflt:1,editType:"plot"},constrain:{valType:"enumerated",values:["range","domain"],dflt:"range",editType:"plot"},constraintoward:{valType:"enumerated",values:["left","center","right","top","middle","bottom"],editType:"plot"},tickmode:{valType:"enumerated",values:["auto","linear","array"],editType:"ticks",impliedEdits:{tick0:void 0,dtick:void 0}},nticks:{valType:"integer",min:0,dflt:0,editType:"ticks"},tick0:{valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},dtick:{valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},tickvals:{valType:"data_array",editType:"ticks"},ticktext:{valType:"data_array",editType:"ticks"},ticks:{valType:"enumerated",values:["outside","inside",""],editType:"ticks"},tickson:{valType:"enumerated",values:["labels","boundaries"],dflt:"labels",editType:"ticks"},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1,editType:"ticks+layoutstyle"},ticklen:{valType:"number",min:0,dflt:5,editType:"ticks"},tickwidth:{valType:"number",min:0,dflt:1,editType:"ticks"},tickcolor:{valType:"color",dflt:a.defaultLine,editType:"ticks"},showticklabels:{valType:"boolean",dflt:!0,editType:"ticks"},automargin:{valType:"boolean",dflt:!1,editType:"ticks"},showspikes:{valType:"boolean",dflt:!1,editType:"modebar"},spikecolor:{valType:"color",dflt:null,editType:"none"},spikethickness:{valType:"number",dflt:3,editType:"none"},spikedash:o({},i,{dflt:"dash",editType:"none"}),spikemode:{valType:"flaglist",flags:["toaxis","across","marker"],dflt:"toaxis",editType:"none"},spikesnap:{valType:"enumerated",values:["data","cursor"],dflt:"data",editType:"none"},tickfont:n({editType:"ticks"}),tickangle:{valType:"angle",dflt:"auto",editType:"ticks"},tickprefix:{valType:"string",dflt:"",editType:"ticks"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},ticksuffix:{valType:"string",dflt:"",editType:"ticks"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B",editType:"ticks"},separatethousands:{valType:"boolean",dflt:!1,editType:"ticks"},tickformat:{valType:"string",dflt:"",editType:"ticks"},tickformatstops:l("tickformatstop",{enabled:{valType:"boolean",dflt:!0,editType:"ticks"},dtickrange:{valType:"info_array",items:[{valType:"any",editType:"ticks"},{valType:"any",editType:"ticks"}],editType:"ticks"},value:{valType:"string",dflt:"",editType:"ticks"},editType:"ticks"}),hoverformat:{valType:"string",dflt:"",editType:"none"},showline:{valType:"boolean",dflt:!1,editType:"ticks+layoutstyle"},linecolor:{valType:"color",dflt:a.defaultLine,editType:"layoutstyle"},linewidth:{valType:"number",min:0,dflt:1,editType:"ticks+layoutstyle"},showgrid:{valType:"boolean",editType:"ticks"},gridcolor:{valType:"color",dflt:a.lightLine,editType:"ticks"},gridwidth:{valType:"number",min:0,dflt:1,editType:"ticks"},zeroline:{valType:"boolean",editType:"ticks"},zerolinecolor:{valType:"color",dflt:a.defaultLine,editType:"ticks"},zerolinewidth:{valType:"number",dflt:1,editType:"ticks"},showdividers:{valType:"boolean",dflt:!0,editType:"ticks"},dividercolor:{valType:"color",dflt:a.defaultLine,editType:"ticks"},dividerwidth:{valType:"number",dflt:1,editType:"ticks"},anchor:{valType:"enumerated",values:["free",s.idRegex.x.toString(),s.idRegex.y.toString()],editType:"plot"},side:{valType:"enumerated",values:["top","bottom","left","right"],editType:"plot"},overlaying:{valType:"enumerated",values:["free",s.idRegex.x.toString(),s.idRegex.y.toString()],editType:"plot"},layer:{valType:"enumerated",values:["above traces","below traces"],dflt:"above traces",editType:"plot"},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot"},position:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},uirevision:{valType:"any",editType:"none"},editType:"calc",_deprecated:{autotick:{valType:"boolean",editType:"ticks"},title:{valType:"string",editType:"ticks"},titlefont:n({editType:"ticks"})}}},{"../../components/color/attributes":50,"../../components/drawing/attributes":71,"../../lib/extend":162,"../../plot_api/plot_template":202,"../font_attributes":239,"./constants":218}],226:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/color"),i=t("../../plot_api/plot_template"),o=t("../layout_attributes"),l=t("./layout_attributes"),s=t("./type_defaults"),c=t("./axis_defaults"),u=t("./constraint_defaults"),f=t("./position_defaults"),d=t("./axis_ids"),p=d.id2name,h=d.name2id,g=t("../../registry"),v=g.traceIs,y=g.getComponentMethod;function m(t,e,r){Array.isArray(t[e])?t[e].push(r):t[e]=[r]}e.exports=function(t,e,r){var d,g,x={},b={},_={},w={},k={};for(d=0;d<r.length;d++){var T=r[d];if(v(T,"cartesian")||v(T,"gl2d")){var M,A;if(T.xaxis)m(x,M=p(T.xaxis),T);else if(T.xaxes)for(g=0;g<T.xaxes.length;g++)m(x,p(T.xaxes[g]),T);if(T.yaxis)m(x,A=p(T.yaxis),T);else if(T.yaxes)for(g=0;g<T.yaxes.length;g++)m(x,p(T.yaxes[g]),T);if(v(T,"carpet")&&("carpet"!==T.type||T._cheater)||M&&(_[M]=1),"carpet"===T.type&&T._cheater&&M&&(b[M]=1),v(T,"2dMap")&&(w[M]=1,w[A]=1),v(T,"oriented"))k["h"===T.orientation?A:M]=1}}var L=e._subplots,S=L.xaxis,C=L.yaxis,O=n.simpleMap(S,p),z=n.simpleMap(C,p),D=O.concat(z),P=a.background;S.length&&C.length&&(P=n.coerce(t,e,o,"plot_bgcolor"));var E,R,I,F,N=a.combine(P,e.paper_bgcolor);function B(t,e){return n.coerce(I,F,l,t,e)}function j(t,e){return n.coerce2(I,F,l,t,e)}function H(t){return"x"===t?C:S}var q={x:H("x"),y:H("y")};function V(e,r){for(var n="x"===e?O:z,a=[],i=0;i<n.length;i++){var o=n[i];o===r||(t[o]||{}).overlaying||a.push(h(o))}return a}for(d=0;d<D.length;d++){R=(E=D[d]).charAt(0),n.isPlainObject(t[E])||(t[E]={}),I=t[E],F=i.newContainer(e,E,R+"axis");var U=x[E]||[];F._traceIndices=U.map(function(t){return t._expandedIndex}),F._annIndices=[],F._shapeIndices=[],F._imgIndices=[],F._subplotsWith=[],F._counterAxes=[],F._name=F._attr=E;var G=F._id=h(E),Z=V(R,E),X={letter:R,font:e.font,outerTicks:w[E],showGrid:!k[E],data:U,bgColor:N,calendar:e.calendar,automargin:!0,cheateronly:"x"===R&&b[E]&&!_[E],splomStash:((e._splomAxes||{})[R]||{})[G]};B("uirevision",e.uirevision),s(I,F,B,X),c(I,F,B,X,e);var Y=j("spikecolor"),W=j("spikethickness"),J=j("spikedash"),$=j("spikemode"),Q=j("spikesnap");B("showspikes",!!(Y||W||J||$||Q))||(delete F.spikecolor,delete F.spikethickness,delete F.spikedash,delete F.spikemode,delete F.spikesnap);var K={letter:R,counterAxes:q[R],overlayableAxes:Z,grid:e.grid};f(I,F,B,K),F._input=I}var tt=y("rangeslider","handleDefaults"),et=y("rangeselector","handleDefaults");for(d=0;d<O.length;d++)E=O[d],I=t[E],F=e[E],tt(t,e,E),"date"===F.type&&et(I,F,e,z,F.calendar),B("fixedrange");for(d=0;d<z.length;d++){E=z[d],I=t[E],F=e[E];var rt=e[p(F.anchor)];B("fixedrange",y("rangeslider","isVisible")(rt))}e._axisConstraintGroups=[];var nt=q.x.concat(q.y);for(d=0;d<D.length;d++)R=(E=D[d]).charAt(0),I=t[E],F=e[E],u(I,F,B,nt,e)}},{"../../components/color":51,"../../lib":168,"../../plot_api/plot_template":202,"../../registry":257,"../layout_attributes":243,"./axis_defaults":214,"./axis_ids":215,"./constraint_defaults":219,"./layout_attributes":225,"./position_defaults":228,"./type_defaults":236}],227:[function(t,e,r){"use strict";var n=t("tinycolor2").mix,a=t("../../components/color/attributes").lightFraction,i=t("../../lib");e.exports=function(t,e,r,o){var l=(o=o||{}).dfltColor;function s(r,n){return i.coerce2(t,e,o.attributes,r,n)}var c=s("linecolor",l),u=s("linewidth");r("showline",o.showLine||!!c||!!u)||(delete e.linecolor,delete e.linewidth);var f=s("gridcolor",n(l,o.bgColor,o.blend||a).toRgbString()),d=s("gridwidth");if(r("showgrid",o.showGrid||!!f||!!d)||(delete e.gridcolor,delete e.gridwidth),!o.noZeroLine){var p=s("zerolinecolor",l),h=s("zerolinewidth");r("zeroline",o.showGrid||!!p||!!h)||(delete e.zerolinecolor,delete e.zerolinewidth)}}},{"../../components/color/attributes":50,"../../lib":168,tinycolor2:34}],228:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib");e.exports=function(t,e,r,i){var o,l,s,c,u=i.counterAxes||[],f=i.overlayableAxes||[],d=i.letter,p=i.grid;p&&(l=p._domains[d][p._axisMap[e._id]],o=p._anchors[e._id],l&&(s=p[d+"side"].split(" ")[0],c=p.domain[d]["right"===s||"top"===s?1:0])),l=l||[0,1],o=o||(n(t.position)?"free":u[0]||"free"),s=s||("x"===d?"bottom":"left"),c=c||0,"free"===a.coerce(t,e,{anchor:{valType:"enumerated",values:["free"].concat(u),dflt:o}},"anchor")&&r("position",c),a.coerce(t,e,{side:{valType:"enumerated",values:"x"===d?["bottom","top"]:["left","right"],dflt:s}},"side");var h=!1;if(f.length&&(h=a.coerce(t,e,{overlaying:{valType:"enumerated",values:[!1].concat(f),dflt:!1}},"overlaying")),!h){var g=r("domain",l);g[0]>g[1]-1/4096&&(e.domain=l),a.noneOrAll(t.domain,e.domain,l)}return r("layer"),e}},{"../../lib":168,"fast-isnumeric":18}],229:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var a=[t.r2l(t.range[0]),t.r2l(t.range[1])],i=a[0]+(a[1]-a[0])*r;t.range=t._input.range=[t.l2r(i+(a[0]-i)*e),t.l2r(i+(a[1]-i)*e)]}},{"../../constants/alignment":146}],230:[function(t,e,r){"use strict";var n=t("polybooljs"),a=t("../../registry"),i=t("../../components/color"),o=t("../../components/fx"),l=t("../../lib/polygon"),s=t("../../lib/throttle"),c=t("../../components/fx/helpers").makeEventData,u=t("./axis_ids").getFromId,f=t("../../lib/clear_gl_canvases"),d=t("../../plot_api/subroutines").redrawReglTraces,p=t("./constants"),h=p.MINSELECT,g=l.filter,v=l.tester;function y(t){return t._id}function m(t,e,r,n,a,i,o){var l,s,c,u,f,d,p,h,g,v=e._hoverdata,y=e._fullLayout.clickmode.indexOf("event")>-1,m=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(v)){w(t,e,i);var x=function(t,e){var r,n,a=t[0],i=-1,o=[];for(n=0;n<e.length;n++)if(r=e[n],a.fullData._expandedIndex===r.cd[0].trace._expandedIndex){if(!0===a.hoverOnBox)break;void 0!==a.pointNumber?i=a.pointNumber:void 0!==a.binNumber&&(i=a.binNumber,o=a.pointNumbers);break}return{pointNumber:i,pointNumbers:o,searchInfo:r}}(v,l=T(e,r,n,a));if(x.pointNumbers.length>0?function(t,e){var r,n,a,i=[];for(a=0;a<t.length;a++)(r=t[a]).cd[0].trace.selectedpoints&&r.cd[0].trace.selectedpoints.length>0&&i.push(r);if(1===i.length&&i[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(a=0;a<e.pointNumbers.length;a++)if(n.selectedpoints.indexOf(e.pointNumbers[a])<0)return!1;return!0}return!1}(l,x):function(t){var e,r,n,a=0;for(n=0;n<t.length;n++)if(e=t[n],(r=e.cd[0].trace).selectedpoints){if(r.selectedpoints.length>1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(l)&&(d=A(x))){for(o&&o.remove(),g=0;g<l.length;g++)(s=l[g])._module.selectPoints(s,!1);L(e,l),k(i),y&&e.emit("plotly_deselect",null)}else{for(p=t.shiftKey&&(void 0!==d?d:A(x)),c=function(t,e,r){return{pointNumber:t,searchInfo:e,subtract:r}}(x.pointNumber,x.searchInfo,p),u=_(i.selectionDefs.concat([c])),g=0;g<l.length;g++)if(f=S(l[g]._module.selectPoints(l[g],u),l[g]),m.length)for(var b=0;b<f.length;b++)m.push(f[b]);else m=f;L(e,l,h={points:m}),c&&i&&i.selectionDefs.push(c),o&&M(i.mergedPolygons,o),y&&e.emit("plotly_selected",h)}}}function x(t){return"pointNumber"in t&&"searchInfo"in t}function b(t){return{xmin:0,xmax:0,ymin:0,ymax:0,pts:[],contains:function(e,r,n,a){var i=t.searchInfo.cd[0].trace._expandedIndex;return a.cd[0].trace._expandedIndex===i&&n===t.pointNumber},isRect:!1,degenerate:!1,subtract:t.subtract}}function _(t){for(var e=[],r=x(t[0])?0:t[0][0][0],n=r,a=x(t[0])?0:t[0][0][1],i=a,o=0;o<t.length;o++)if(x(t[o]))e.push(b(t[o]));else{var s=l.tester(t[o]);s.subtract=t[o].subtract,e.push(s),r=Math.min(r,s.xmin),n=Math.max(n,s.xmax),a=Math.min(a,s.ymin),i=Math.max(i,s.ymax)}return{xmin:r,xmax:n,ymin:a,ymax:i,pts:[],contains:function(t,r,n,a){for(var i=!1,o=0;o<e.length;o++)e[o].contains(t,r,n,a)&&(i=!1===e[o].subtract);return i},isRect:!1,degenerate:!1}}function w(t,e,r){var n=e._fullLayout,a=n._zoomlayer,i=r.plotinfo,o=n._lastSelectedSubplot&&n._lastSelectedSubplot===i.id,l=t.shiftKey||t.altKey;o&&l&&i.selection&&i.selection.selectionDefs&&!r.selectionDefs?(r.selectionDefs=i.selection.selectionDefs,r.mergedPolygons=i.selection.mergedPolygons):l&&i.selection||k(r),o||(C(a),n._lastSelectedSubplot=i.id)}function k(t){var e=t.plotinfo;e.selection={},e.selection.selectionDefs=t.selectionDefs=[],e.selection.mergedPolygons=t.mergedPolygons=[]}function T(t,e,r,n){var a,i,o,l=[],s=e.map(y),c=r.map(y);for(o=0;o<t.calcdata.length;o++)if(!0===(i=(a=t.calcdata[o])[0].trace).visible&&i._module&&i._module.selectPoints)if(!n||i.subplot!==n&&i.geo!==n)if("splom"===i.type&&i._xaxes[s[0]]&&i._yaxes[c[0]]){var f=d(i._module,a,e[0],r[0]);f.scene=t._fullLayout._splomScenes[i.uid],l.push(f)}else{if(-1===s.indexOf(i.xaxis))continue;if(-1===c.indexOf(i.yaxis))continue;l.push(d(i._module,a,u(t,i.xaxis),u(t,i.yaxis)))}else l.push(d(i._module,a,e[0],r[0]));return l;function d(t,e,r,n){return{_module:t,cd:e,xaxis:r,yaxis:n}}}function M(t,e){var r,n,a=[];for(r=0;r<t.length;r++){var i=t[r];a.push(i.join("L")+"L"+i[0])}n=t.length>0?"M"+a.join("M")+"Z":"M0,0Z",e.attr("d",n)}function A(t){var e=t.searchInfo.cd[0].trace,r=t.pointNumber,n=t.pointNumbers,a=n.length>0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(a)>-1}function L(t,e,r){var n,i,o,l;for(n=0;n<e.length;n++){var s=e[n].cd[0].trace._fullInput,c=t._fullLayout._tracePreGUI[s.uid];void 0===c.selectedpoints&&(c.selectedpoints=s._input.selectedpoints||null)}if(r){var u=r.points||[];for(n=0;n<e.length;n++)(l=e[n].cd[0].trace)._input.selectedpoints=l._fullInput.selectedpoints=[],l._fullInput!==l&&(l.selectedpoints=[]);for(n=0;n<u.length;n++){var p=u[n],h=p.data,g=p.fullData;p.pointIndices?([].push.apply(h.selectedpoints,p.pointIndices),l._fullInput!==l&&[].push.apply(g.selectedpoints,p.pointIndices)):(h.selectedpoints.push(p.pointIndex),l._fullInput!==l&&g.selectedpoints.push(p.pointIndex))}}else for(n=0;n<e.length;n++)delete(l=e[n].cd[0].trace).selectedpoints,delete l._input.selectedpoints,l._fullInput!==l&&delete l._fullInput.selectedpoints;var v=!1;for(n=0;n<e.length;n++){l=(o=(i=e[n]).cd)[0].trace,a.traceIs(l,"regl")&&(v=!0);var y=i._module,m=y.styleOnSelect||y.style;m&&m(t,o)}v&&(f(t),d(t))}function S(t,e){if(Array.isArray(t))for(var r=e.cd,n=e.cd[0].trace,a=0;a<t.length;a++)t[a]=c(t[a],n,r);return t}function C(t){t.selectAll(".select-outline").remove()}e.exports={prepSelect:function(t,e,r,a,l){var c,u,f,d,y,x,b,A=a.gd,C=A._fullLayout,O=C._zoomlayer,z=a.element.getBoundingClientRect(),D=a.plotinfo,P=D.xaxis._offset,E=D.yaxis._offset,R=e-z.left,I=r-z.top,F=R,N=I,B="M"+R+","+I,j=a.xaxes[0]._length,H=a.yaxes[0]._length,q=a.xaxes.concat(a.yaxes),V=t.altKey;w(t,A,a),"lasso"===l&&(c=g([[R,I]],p.BENDPX));var U=O.selectAll("path.select-outline-"+D.id).data([1,2]);U.enter().append("path").attr("class",function(t){return"select-outline select-outline-"+t+" select-outline-"+D.id}).attr("transform","translate("+P+", "+E+")").attr("d",B+"Z");var G,Z=O.append("path").attr("class","zoombox-corners").style({fill:i.background,stroke:i.defaultLine,"stroke-width":1}).attr("transform","translate("+P+", "+E+")").attr("d","M0,0Z"),X=C._uid+p.SELECTID,Y=[],W=T(A,a.xaxes,a.yaxes,a.subplot);function J(t){var e="y"===t._id.charAt(0)?1:0;return function(r){return t.p2d(r[e])}}function $(t,e){return t-e}G=D.fillRangeItems?D.fillRangeItems:"select"===l?function(t,e){var r=t.range={};for(y=0;y<q.length;y++){var n=q[y],a=n._id.charAt(0);r[n._id]=[n.p2d(e[a+"min"]),n.p2d(e[a+"max"])].sort($)}}:function(t,e,r){var n=t.lassoPoints={};for(y=0;y<q.length;y++){var a=q[y];n[a._id]=r.filtered.map(J(a))}},a.moveFn=function(t,e){F=Math.max(0,Math.min(j,t+R)),N=Math.max(0,Math.min(H,e+I));var r=Math.abs(F-R),i=Math.abs(N-I);if("select"===l){var o=C.selectdirection;"h"===(o="any"===C.selectdirection?i<Math.min(.6*r,h)?"h":r<Math.min(.6*i,h)?"v":"d":C.selectdirection)?((d=[[R,0],[R,H],[F,H],[F,0]]).xmin=Math.min(R,F),d.xmax=Math.max(R,F),d.ymin=Math.min(0,H),d.ymax=Math.max(0,H),Z.attr("d","M"+d.xmin+","+(I-h)+"h-4v"+2*h+"h4ZM"+(d.xmax-1)+","+(I-h)+"h4v"+2*h+"h-4Z")):"v"===o?((d=[[0,I],[0,N],[j,N],[j,I]]).xmin=Math.min(0,j),d.xmax=Math.max(0,j),d.ymin=Math.min(I,N),d.ymax=Math.max(I,N),Z.attr("d","M"+(R-h)+","+d.ymin+"v-4h"+2*h+"v4ZM"+(R-h)+","+(d.ymax-1)+"v4h"+2*h+"v-4Z")):"d"===o&&((d=[[R,I],[R,N],[F,N],[F,I]]).xmin=Math.min(R,F),d.xmax=Math.max(R,F),d.ymin=Math.min(I,N),d.ymax=Math.max(I,N),Z.attr("d","M0,0Z"))}else"lasso"===l&&(c.addPt([F,N]),d=c.filtered);a.selectionDefs&&a.selectionDefs.length?(f=function(t,e,r){return r?n.difference({regions:t,inverted:!1},{regions:[e],inverted:!1}).regions:n.union({regions:t,inverted:!1},{regions:[e],inverted:!1}).regions}(a.mergedPolygons,d,V),d.subtract=V,u=_(a.selectionDefs.concat([d]))):(f=[d],u=v(d)),M(f,U),s.throttle(X,p.SELECTDELAY,function(){var t;Y=[];var e,r=[];for(y=0;y<W.length;y++)if(e=(x=W[y])._module.selectPoints(x,u),r.push(e),t=S(e,x),Y.length)for(var n=0;n<t.length;n++)Y.push(t[n]);else Y=t;L(A,W,b={points:Y}),G(b,d,c),a.gd.emit("plotly_selecting",b)})},a.clickFn=function(t,e){var r=C.clickmode;Z.remove(),s.done(X).then(function(){if(s.clear(X),2===t){for(U.remove(),y=0;y<W.length;y++)(x=W[y])._module.selectPoints(x,!1);L(A,W),k(a),A.emit("plotly_deselect",null)}else r.indexOf("select")>-1&&m(e,A,a.xaxes,a.yaxes,a.subplot,a,U),"event"===r&&A.emit("plotly_selected",void 0);o.click(A,e)})},a.doneFn=function(){Z.remove(),s.done(X).then(function(){s.clear(X),a.gd.emit("plotly_selected",b),d&&a.selectionDefs&&(d.subtract=V,a.selectionDefs.push(d),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,f))})}},clearSelect:C,selectOnClick:m}},{"../../components/color":51,"../../components/fx":90,"../../components/fx/helpers":86,"../../lib/clear_gl_canvases":157,"../../lib/polygon":180,"../../lib/throttle":190,"../../plot_api/subroutines":203,"../../registry":257,"./axis_ids":215,"./constants":218,polybooljs:25}],231:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../../lib"),o=i.cleanNumber,l=i.ms2DateTime,s=i.dateTime2ms,c=i.ensureNumber,u=i.isArrayOrTypedArray,f=t("../../constants/numerical"),d=f.FP_SAFE,p=f.BADNUM,h=f.LOG_CLIP,g=t("./constants"),v=t("./axis_ids");function y(t){return Math.pow(10,t)}function m(t){return null!=t}e.exports=function(t,e){e=e||{};var r=(t._id||"x").charAt(0);function f(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],a=t.range[1];return.5*(n+a-2*h*Math.abs(n-a))}return p}function x(e,r,n){var o=s(e,n||t.calendar);if(o===p){if(!a(e))return p;e=+e;var l=Math.floor(10*i.mod(e+.05,1)),c=Math.round(e-l/10);o=s(new Date(c))+l/10}return o}function b(e,r,n){return l(e,r,n||t.calendar)}function _(e){return t._categories[Math.round(e)]}function w(e){if(m(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return p}function k(e){if(t._categoriesMap)return t._categoriesMap[e]}function T(t){var e=k(t);return void 0!==e?e:a(t)?+t:void 0}function M(e){return a(e)?n.round(t._b+t._m*e,2):p}function A(e){return(e-t._b)/t._m}t.c2l="log"===t.type?f:c,t.l2c="log"===t.type?y:c,t.l2p=M,t.p2l=A,t.c2p="log"===t.type?function(t,e){return M(f(t,e))}:M,t.p2c="log"===t.type?function(t){return y(A(t))}:A,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=o,t.c2d=t.c2r=t.l2d=t.l2r=c,t.d2p=t.r2p=function(e){return t.l2p(o(e))},t.p2d=t.p2r=A,t.cleanPos=c):"log"===t.type?(t.d2r=t.d2l=function(t,e){return f(o(t),e)},t.r2d=t.r2c=function(t){return y(o(t))},t.d2c=t.r2l=o,t.c2d=t.l2r=c,t.c2r=f,t.l2d=y,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return y(A(t))},t.r2p=function(e){return t.l2p(o(e))},t.p2r=A,t.cleanPos=c):"date"===t.type?(t.d2r=t.r2d=i.identity,t.d2c=t.r2c=t.d2l=t.r2l=x,t.c2d=t.c2r=t.l2d=t.l2r=b,t.d2p=t.r2p=function(e,r,n){return t.l2p(x(e,0,n))},t.p2d=t.p2r=function(t,e,r){return b(A(t),e,r)},t.cleanPos=function(e){return i.cleanDate(e,p,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=w,t.r2d=t.c2d=t.l2d=_,t.d2r=t.d2l_noadd=T,t.r2c=function(e){var r=T(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=c,t.r2l=T,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return _(A(t))},t.r2p=t.d2p,t.p2r=A,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:c(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=_,t.d2r=t.d2l_noadd=T,t.r2c=function(e){var r=T(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=k,t.l2r=t.c2r=c,t.r2l=T,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return _(A(t))},t.r2p=t.d2p,t.p2r=A,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:c(t)},t.setupMultiCategory=function(e){var n,a,o=t._traceIndices,l=t._multicatSeen=[[0,{}],[0,{}]],s=t._multicatList=[];for(n=0;n<o.length;n++){var c=e[o[n]];if(r in c){var f=c[r],d=c._length||i.minRowLength(f);if(u(f[0])&&u(f[1]))for(a=0;a<d;a++){var p=f[0][a],h=f[1][a];m(p)&&m(h)&&(s.push([p,h]),p in l[0][1]||(l[0][1][p]=l[0][0]++),h in l[1][1]||(l[1][1][h]=l[1][0]++))}}}for(s.sort(function(t,e){var r=l[0][1],n=r[t[0]]-r[e[0]];if(n)return n;var a=l[1][1];return a[t[1]]-a[e[1]]}),n=0;n<s.length;n++)w(s[n])}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e,n){n||(n={}),e||(e="range");var o,l,s=i.nestedProperty(t,e).get();if(l=(l="date"===t.type?i.dfltRange(t.calendar):"y"===r?g.DFLTRANGEY:n.dfltRange||g.DFLTRANGEX).slice(),s&&2===s.length)for("date"===t.type&&(s[0]=i.cleanDate(s[0],p,t.calendar),s[1]=i.cleanDate(s[1],p,t.calendar)),o=0;o<2;o++)if("date"===t.type){if(!i.isDateTime(s[o],t.calendar)){t[e]=l;break}if(t.r2l(s[0])===t.r2l(s[1])){var c=i.constrain(t.r2l(s[0]),i.MIN_MS+1e3,i.MAX_MS-1e3);s[0]=t.l2r(c-1e3),s[1]=t.l2r(c+1e3);break}}else{if(!a(s[o])){if(!a(s[1-o])){t[e]=l;break}s[o]=s[1-o]*(o?10:.1)}if(s[o]<-d?s[o]=-d:s[o]>d&&(s[o]=d),s[0]===s[1]){var u=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=u,s[1]+=u}}else i.nestedProperty(t,e).set(l)},t.setScale=function(n){var a=e._size;if(t.overlaying){var i=v.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var o=n&&t._r?"_r":"range",l=t.calendar;t.cleanRange(o);var s=t.r2l(t[o][0],l),c=t.r2l(t[o][1],l);if("y"===r?(t._offset=a.t+(1-t.domain[1])*a.h,t._length=a.h*(t.domain[1]-t.domain[0]),t._m=t._length/(s-c),t._b=-t._m*c):(t._offset=a.l+t.domain[0]*a.w,t._length=a.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-s),t._b=-t._m*s),!isFinite(t._m)||!isFinite(t._b))throw e._replotting=!1,new Error("Something went wrong with axis scaling")},t.makeCalcdata=function(e,r){var n,a,o,l,s=t.type,c="date"===s&&e[r+"calendar"];if(r in e){if(n=e[r],l=e._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(t,e){for(var r=new Array(e),n=0;n<e;n++){var a=(t[0]||[])[n],i=(t[1]||[])[n];r[n]=k([a,i])}return r}(n,l);for(a=new Array(l),o=0;o<l;o++)a[o]=t.d2c(n[o],0,c)}else{var u=r+"0"in e?t.d2c(e[r+"0"],0,c):0,f=e["d"+r]?Number(e["d"+r]):1;for(n=e[{x:"y",y:"x"}[r]],l=e._length||n.length,a=new Array(l),o=0;o<l;o++)a[o]=u+o*f}return a},t.isValidRange=function(e){return Array.isArray(e)&&2===e.length&&a(t.r2l(e[0]))&&a(t.r2l(e[1]))},t.isPtWithinRange=function(e,n){var a=t.c2l(e[r],null,n),i=t.r2l(t.range[0]),o=t.r2l(t.range[1]);return i<o?i<=a&&a<=o:o<=a&&a<=i},t.clearCalc=function(){t._categories=(t._initialCategories||[]).slice(),t._categoriesMap={};for(var e=0;e<t._categories.length;e++)t._categoriesMap[t._categories[e]]=e};var L=e._d3locale;"date"===t.type&&(t._dateFormat=L?L.timeFormat.utc:n.time.format.utc,t._extraFormat=e._extraFormat),t._separators=e.separators,t._numFormat=L?L.numberFormat:n.format,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":149,"../../lib":168,"./axis_ids":215,"./constants":218,d3:16,"fast-isnumeric":18}],232:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes"),i=t("../array_container_defaults");function o(t,e){function r(r,i){return n.coerce(t,e,a.tickformatstops,r,i)}r("enabled")&&(r("dtickrange"),r("value"))}e.exports=function(t,e,r,l,s){var c=function(t){var e=["showexponent","showtickprefix","showticksuffix"].filter(function(e){return void 0!==t[e]});if(e.every(function(r){return t[r]===t[e[0]]})||1===e.length)return t[e[0]]}(t);if(r("tickprefix")&&r("showtickprefix",c),r("ticksuffix",s.tickSuffixDflt)&&r("showticksuffix",c),r("showticklabels")){var u=s.font||{},f=e.color,d=f&&f!==a.color.dflt?f:u.color;if(n.coerceFont(r,"tickfont",{family:u.family,size:u.size,color:d}),r("tickangle"),"category"!==l){var p=r("tickformat"),h=t.tickformatstops;Array.isArray(h)&&h.length&&i(t,e,{name:"tickformatstops",inclusionAttr:"enabled",handleItemDefaults:o}),p||"date"===l||(r("showexponent",c),r("exponentformat"),r("separatethousands"))}}}},{"../../lib":168,"../array_container_defaults":208,"./layout_attributes":225}],233:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r,i){var o=n.coerce2(t,e,a,"ticklen"),l=n.coerce2(t,e,a,"tickwidth"),s=n.coerce2(t,e,a,"tickcolor",e.color);r("ticks",i.outerTicks||o||l||s?"outside":"")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":168,"./layout_attributes":225}],234:[function(t,e,r){"use strict";var n=t("./clean_ticks");e.exports=function(t,e,r,a){var i;"array"!==t.tickmode||"log"!==a&&"date"!==a?i=r("tickmode",Array.isArray(t.tickvals)?"array":t.dtick?"linear":"auto"):i=e.tickmode="auto";if("auto"===i)r("nticks");else if("linear"===i){var o=e.dtick=n.dtick(t.dtick,a);e.tick0=n.tick0(t.tick0,a,e.calendar,o)}else if("multicategory"!==a){void 0===r("tickvals")?e.tickmode="auto":r("ticktext")}}},{"./clean_ticks":217}],235:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../components/drawing"),o=t("./axes");e.exports=function(t,e,r,l){var s=t._fullLayout;if(0!==e.length){var c,u,f,d;l&&(c=l());var p=n.ease(r.easing);return t._transitionData._interruptCallbacks.push(function(){return window.cancelAnimationFrame(d),d=null,function(){for(var r={},n=0;n<e.length;n++){var i=e[n];i.xr0&&(r[i.plotinfo.xaxis._name+".range"]=i.xr0.slice()),i.yr0&&(r[i.plotinfo.yaxis._name+".range"]=i.yr0.slice())}return a.call("relayout",t,r).then(function(){for(var t=0;t<e.length;t++)h(e[t].plotinfo)})}()}),u=Date.now(),d=window.requestAnimationFrame(function n(){f=Date.now();for(var i=Math.min(1,(f-u)/r.duration),o=p(i),l=0;l<e.length;l++)g(e[l],o);f-u>r.duration?(function(){for(var r={},n=0;n<e.length;n++){var i=e[n];i.xr1&&(r[i.plotinfo.xaxis._name+".range"]=i.xr1.slice()),i.yr1&&(r[i.plotinfo.yaxis._name+".range"]=i.yr1.slice())}c&&c(),a.call("relayout",t,r).then(function(){for(var t=0;t<e.length;t++)h(e[t].plotinfo)})}(),d=window.cancelAnimationFrame(n)):d=window.requestAnimationFrame(n)}),Promise.resolve()}function h(t){var e=t.xaxis,r=t.yaxis;s._defs.select("#"+t.clipId+"> rect").call(i.setTranslate,0,0).call(i.setScale,1,1),t.plot.call(i.setTranslate,e._offset,r._offset).call(i.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(i.setPointGroupScale,1,1),n.selectAll(".textpoint").call(i.setTextPointsScale,1,1),n.call(i.hideOutsideRangePoints,t)}function g(e,r){var n=e.plotinfo,a=n.xaxis,l=n.yaxis,s=e.xr0,c=e.xr1,u=a._length,f=e.yr0,d=e.yr1,p=l._length,h=!!c,g=!!d,v=[];if(h){var y=s[1]-s[0],m=c[1]-c[0];v[0]=(s[0]*(1-r)+r*c[0]-s[0])/(s[1]-s[0])*u,v[2]=u*(1-r+r*m/y),a.range[0]=s[0]*(1-r)+r*c[0],a.range[1]=s[1]*(1-r)+r*c[1]}else v[0]=0,v[2]=u;if(g){var x=f[1]-f[0],b=d[1]-d[0];v[1]=(f[1]*(1-r)+r*d[1]-f[1])/(f[0]-f[1])*p,v[3]=p*(1-r+r*b/x),l.range[0]=f[0]*(1-r)+r*d[0],l.range[1]=f[1]*(1-r)+r*d[1]}else v[1]=0,v[3]=p;o.drawOne(t,a,{skipTitle:!0}),o.drawOne(t,l,{skipTitle:!0}),o.redrawComponents(t,[a._id,l._id]);var _=h?u/v[2]:1,w=g?p/v[3]:1,k=h?v[0]:0,T=g?v[1]:0,M=h?v[0]/v[2]*u:0,A=g?v[1]/v[3]*p:0,L=a._offset-M,S=l._offset-A;n.clipRect.call(i.setTranslate,k,T).call(i.setScale,1/_,1/w),n.plot.call(i.setTranslate,L,S).call(i.setScale,_,w),i.setPointGroupScale(n.zoomScalePts,1/_,1/w),i.setTextPointsScale(n.zoomScaleTxt,1/_,1/w)}o.redrawComponents(t)}},{"../../components/drawing":72,"../../registry":257,"./axes":212,d3:16}],236:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,a=t("./axis_autotype");function i(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=i(t),a=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return a&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,l){"-"===r("type",(l.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r=t._id,l=r.charAt(0);-1!==r.indexOf("scene")&&(r=l);var s=function(t,e,r){for(var n=0;n<t.length;n++){var a=t[n];if("splom"===a.type&&a._length>0&&(a["_"+r+"axes"]||{})[e])return a;if((a[r+"axis"]||r)===e){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(e,r,l);if(!s)return;if("histogram"===s.type&&l==={v:"y",h:"x"}[s.orientation||"v"])return void(t.type="linear");var c,u=l+"calendar",f=s[u],d={noMultiCategory:!n(s,"cartesian")||n(s,"noMultiCategory")};if(o(s,l)){var p=i(s),h=[];for(c=0;c<e.length;c++){var g=e[c];n(g,"box-violin")&&(g[l+"axis"]||l)===r&&(void 0!==g[p]?h.push(g[p][0]):void 0!==g.name?h.push(g.name):h.push("text"),g[u]!==f&&(f=void 0))}t.type=a(h,f,d)}else if("splom"===s.type){var v=s.dimensions,y=s._diag;for(c=0;c<v.length;c++){var m=v[c];if(m.visible&&(y[c][0]===r||y[c][1]===r)){t.type=a(m.values,f,d);break}}}else t.type=a(s[l]||[s[l+"0"]],f,d)}(e,l.data),"-"===e.type?e.type="linear":t.type=e.type)}},{"../../registry":257,"./axis_autotype":213}],237:[function(t,e,r){"use strict";var n=t("../registry"),a=t("../lib");function i(t,e,r){var n,i,o,l=!1;if("data"===e.type)n=t._fullData[null!==e.traces?e.traces[0]:0];else{if("layout"!==e.type)return!1;n=t._fullLayout}return i=a.nestedProperty(n,e.prop).get(),(o=r[e.type]=r[e.type]||{}).hasOwnProperty(e.prop)&&o[e.prop]!==i&&(l=!0),o[e.prop]=i,{changed:l,value:i}}function o(t,e){var r=[],n=e[0],i={};if("string"==typeof n)i[n]=e[1];else{if(!a.isPlainObject(n))return r;i=n}return s(i,function(t,e,n){r.push({type:"layout",prop:t,value:n})},"",0),r}function l(t,e){var r,n,i,o,l=[];if(n=e[0],i=e[1],r=e[2],o={},"string"==typeof n)o[n]=i;else{if(!a.isPlainObject(n))return l;o=n,void 0===r&&(r=i)}return void 0===r&&(r=null),s(o,function(e,n,a){var i;if(Array.isArray(a)){var o=Math.min(a.length,t.data.length);r&&(o=Math.min(o,r.length)),i=[];for(var s=0;s<o;s++)i[s]=r?r[s]:s}else i=r?r.slice(0):null;if(null===i)Array.isArray(a)&&(a=a[0]);else if(Array.isArray(i)){if(!Array.isArray(a)){var c=a;a=[];for(var u=0;u<i.length;u++)a[u]=c}a.length=Math.min(i.length,a.length)}l.push({type:"data",prop:e,traces:i,value:a})},"",0),l}function s(t,e,r,n){Object.keys(t).forEach(function(i){var o=t[i];if("_"!==i[0]){var l=r+(n>0?".":"")+i;a.isPlainObject(o)?s(o,e,l,n+1):e(l,i,o)}})}r.manageCommandObserver=function(t,e,n,o){var l={},s=!0;e&&e._commandObserver&&(l=e._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=r.hasSimpleAPICommandBindings(t,n,l.lookupTable);if(e&&e._commandObserver){if(c)return l;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,l}if(c){i(t,c,l.cache),l.check=function(){if(s){var e=i(t,c,l.cache);return e.changed&&o&&void 0!==l.lookupTable[e.value]&&(l.disable(),Promise.resolve(o({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[e.value]})).then(l.enable,l.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f<u.length;f++)t._internalOn(u[f],l.check);l.remove=function(){for(var e=0;e<u.length;e++)t._removeInternalListener(u[e],l.check)}}else a.log("Unable to automatically bind plot updates to API command"),l.lookupTable={},l.remove=function(){};return l.disable=function(){s=!1},l.enable=function(){s=!0},e&&(e._commandObserver=l),l},r.hasSimpleAPICommandBindings=function(t,e,n){var a,i,o=e.length;for(a=0;a<o;a++){var l,s=e[a],c=s.method,u=s.args;if(Array.isArray(u)||(u=[]),!c)return!1;var f=r.computeAPICommandBindings(t,c,u);if(1!==f.length)return!1;if(i){if((l=f[0]).type!==i.type)return!1;if(l.prop!==i.prop)return!1;if(Array.isArray(i.traces)){if(!Array.isArray(l.traces))return!1;l.traces.sort();for(var d=0;d<i.traces.length;d++)if(i.traces[d]!==l.traces[d])return!1}else if(l.prop!==i.prop)return!1}else i=f[0],Array.isArray(i.traces)&&i.traces.sort();var p=(l=f[0]).value;if(Array.isArray(p)){if(1!==p.length)return!1;p=p[0]}n&&(n[p]=a)}return i},r.executeAPICommand=function(t,e,r){if("skip"===e)return Promise.resolve();var i=n.apiMethodRegistry[e],o=[t];Array.isArray(r)||(r=[]);for(var l=0;l<r.length;l++)o.push(r[l]);return i.apply(null,o).catch(function(t){return a.warn("API call to Plotly."+e+" rejected.",t),Promise.reject(t)})},r.computeAPICommandBindings=function(t,e,r){var n;switch(Array.isArray(r)||(r=[]),e){case"restyle":n=l(t,r);break;case"relayout":n=o(t,r);break;case"update":n=l(t,[r[0],r[2]]).concat(o(t,[r[1]]));break;case"animate":n=function(t,e){return Array.isArray(e[0])&&1===e[0].length&&-1!==["string","number"].indexOf(typeof e[0][0])?[{type:"layout",prop:"_currentFrame",value:e[0][0].toString()}]:[]}(0,r);break;default:n=[]}return n}},{"../lib":168,"../registry":257}],238:[function(t,e,r){"use strict";var n=t("../lib/extend").extendFlat;r.attributes=function(t,e){e=e||{};var r={valType:"info_array",editType:(t=t||{}).editType,items:[{valType:"number",min:0,max:1,editType:t.editType},{valType:"number",min:0,max:1,editType:t.editType}],dflt:[0,1]},a=(t.name&&t.name,t.trace,e.description&&e.description,{x:n({},r,{}),y:n({},r,{}),editType:t.editType});return t.noGridCell||(a.row={valType:"integer",min:0,dflt:0,editType:t.editType},a.column={valType:"integer",min:0,dflt:0,editType:t.editType}),a},r.defaults=function(t,e,r,n){var a=n&&n.x||[0,1],i=n&&n.y||[0,1],o=e.grid;if(o){var l=r("domain.column");void 0!==l&&(l<o.columns?a=o._domains.x[l]:delete t.domain.column);var s=r("domain.row");void 0!==s&&(s<o.rows?i=o._domains.y[s]:delete t.domain.row)}r("domain.x",a),r("domain.y",i)}},{"../lib/extend":162}],239:[function(t,e,r){"use strict";e.exports=function(t){var e=t.editType,r=t.colorEditType;void 0===r&&(r=e);var n={family:{valType:"string",noBlank:!0,strict:!0,editType:e},size:{valType:"number",min:1,editType:e},color:{valType:"color",editType:r},editType:e};return t.arrayOk&&(n.family.arrayOk=!0,n.size.arrayOk=!0,n.color.arrayOk=!0),n}},{}],240:[function(t,e,r){"use strict";e.exports={_isLinkedToArray:"frames_entry",group:{valType:"string"},name:{valType:"string"},traces:{valType:"any"},baseframe:{valType:"string"},data:{valType:"any"},layout:{valType:"any"}}},{}],241:[function(t,e,r){"use strict";var n=t("../registry"),a=t("./cartesian/constants").SUBPLOT_PATTERN;r.getSubplotCalcData=function(t,e,r){var a=n.subplotsRegistry[e];if(!a)return[];for(var i=a.attr,o=[],l=0;l<t.length;l++){var s=t[l];s[0].trace[i]===r&&o.push(s)}return o},r.getModuleCalcData=function(t,e){var r,a=[],i=[];if(!(r="string"==typeof e?n.getModule(e).plot:"function"==typeof e?e:e.plot))return[a,t];for(var o=0;o<t.length;o++){var l=t[o],s=l[0].trace;!0===s.visible&&(s._module.plot===r?a.push(l):i.push(l))}return[a,i]},r.getSubplotData=function(t,e,r){if(!n.subplotsRegistry[e])return[];var i,o,l,s=n.subplotsRegistry[e].attr,c=[];if("gl2d"===e){var u=r.match(a);o="x"+u[1],l="y"+u[2]}for(var f=0;f<t.length;f++)i=t[f],"gl2d"===e&&n.traceIs(i,"gl2d")?i[s[0]]===o&&i[s[1]]===l&&c.push(i):i[s]===r&&c.push(i);return c}},{"../registry":257,"./cartesian/constants":218}],242:[function(t,e,r){"use strict";function n(t,e){var r,n,a=[0,0,0,0];for(r=0;r<4;++r)for(n=0;n<4;++n)a[n]+=t[4*r+n]*e[r];return a}e.exports=function(t,e){return n(t.projection,n(t.view,n(t.model,[e[0],e[1],e[2],1])))}},{}],243:[function(t,e,r){"use strict";var n=t("./font_attributes"),a=t("./animation_attributes"),i=t("../components/color/attributes"),o=t("../components/colorscale/layout_attributes"),l=t("./pad_attributes"),s=t("../lib/extend").extendFlat,c=n({editType:"calc"});c.family.dflt='"Open Sans", verdana, arial, sans-serif',c.size.dflt=12,c.color.dflt=i.defaultLine,e.exports={font:c,title:{text:{valType:"string",editType:"layoutstyle"},font:n({editType:"layoutstyle"}),xref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},yref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},x:{valType:"number",min:0,max:1,dflt:.5,editType:"layoutstyle"},y:{valType:"number",min:0,max:1,dflt:"auto",editType:"layoutstyle"},xanchor:{valType:"enumerated",dflt:"auto",values:["auto","left","center","right"],editType:"layoutstyle"},yanchor:{valType:"enumerated",dflt:"auto",values:["auto","top","middle","bottom"],editType:"layoutstyle"},pad:s(l({editType:"layoutstyle"}),{}),editType:"layoutstyle"},autosize:{valType:"boolean",dflt:!1,editType:"none"},width:{valType:"number",min:10,dflt:700,editType:"plot"},height:{valType:"number",min:10,dflt:450,editType:"plot"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot"},r:{valType:"number",min:0,dflt:80,editType:"plot"},t:{valType:"number",min:0,dflt:100,editType:"plot"},b:{valType:"number",min:0,dflt:80,editType:"plot"},pad:{valType:"number",min:0,dflt:0,editType:"plot"},autoexpand:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},paper_bgcolor:{valType:"color",dflt:i.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:i.background,editType:"layoutstyle"},separators:{valType:"string",editType:"plot"},hidesources:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:{valType:"boolean",editType:"legend"},colorway:{valType:"colorlist",dflt:i.defaults,editType:"calc"},colorscale:o,datarevision:{valType:"any",editType:"calc"},uirevision:{valType:"any",editType:"none"},editrevision:{valType:"any",editType:"none"},selectionrevision:{valType:"any",editType:"none"},template:{valType:"any",editType:"calc"},modebar:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"modebar"},meta:{valType:"data_array",editType:"plot"},transition:s({},a.transition,{editType:"none"}),_deprecated:{title:{valType:"string",editType:"layoutstyle"},titlefont:n({editType:"layoutstyle"})}}},{"../components/color/attributes":50,"../components/colorscale/layout_attributes":64,"../lib/extend":162,"./animation_attributes":207,"./font_attributes":239,"./pad_attributes":244}],244:[function(t,e,r){"use strict";e.exports=function(t){var e=t.editType;return{t:{valType:"number",dflt:0,editType:e},r:{valType:"number",dflt:0,editType:e},b:{valType:"number",dflt:0,editType:e},l:{valType:"number",dflt:0,editType:e},editType:e}}},{}],245:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../registry"),o=t("../plot_api/plot_schema"),l=t("../plot_api/plot_template"),s=t("../lib"),c=t("../components/color"),u=t("../constants/numerical").BADNUM,f=t("../plots/cartesian/axis_ids"),d=t("./animation_attributes"),p=t("./frame_attributes"),h=s.relinkPrivateKeys,g=s._,v=e.exports={};s.extendFlat(v,i),v.attributes=t("./attributes"),v.attributes.type.values=v.allTypes,v.fontAttrs=t("./font_attributes"),v.layoutAttributes=t("./layout_attributes"),v.fontWeight="normal";var y=v.transformsRegistry,m=t("./command");v.executeAPICommand=m.executeAPICommand,v.computeAPICommandBindings=m.computeAPICommandBindings,v.manageCommandObserver=m.manageCommandObserver,v.hasSimpleAPICommandBindings=m.hasSimpleAPICommandBindings,v.redrawText=function(t){if(!((t=s.getGraphDiv(t)).data&&t.data[0]&&t.data[0].r))return new Promise(function(e){setTimeout(function(){i.getComponentMethod("annotations","draw")(t),i.getComponentMethod("legend","draw")(t),(t.calcdata||[]).forEach(function(t){t[0]&&t[0].t&&t[0].t.cb&&t[0].t.cb()}),e(v.previousPromises(t))},300)})},v.resize=function(t){return t=s.getGraphDiv(t),new Promise(function(e,r){function n(t){var e=window.getComputedStyle(t).display;return!e||"none"===e}t&&!n(t)||r(new Error("Resize must be passed a displayed plot div element.")),t._redrawTimer&&clearTimeout(t._redrawTimer),t._redrawTimer=setTimeout(function(){if(!t.layout||t.layout.width&&t.layout.height||n(t))e(t);else{delete t.layout.width,delete t.layout.height;var r=t.changed;t.autoplay=!0,i.call("relayout",t,{autosize:!0}).then(function(){t.changed=r,e(t)})}},100)})},v.previousPromises=function(t){if((t._promises||[]).length)return Promise.all(t._promises).then(function(){t._promises=[]})},v.addLinks=function(t){if(t._context.showLink||t._context.showSources){var e=t._fullLayout,r=s.ensureSingle(e._paper,"text","js-plot-link-container",function(t){t.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:c.defaultLine,"pointer-events":"all"}).each(function(){var t=n.select(this);t.append("tspan").classed("js-link-to-tool",!0),t.append("tspan").classed("js-link-spacer",!0),t.append("tspan").classed("js-sourcelinks",!0)})}),a=r.node(),i={y:e._paper.attr("height")-9};document.body.contains(a)&&a.getComputedTextLength()>=e.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=e._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),u=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(t,e){e.text("");var r=e.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(t._context.linkText+" "+String.fromCharCode(187));if(t._context.sendData)r.on("click",function(){v.sendDataToCloud(t)});else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(t,o),l.text(o.text()&&u.text()?" - ":"")}},v.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL,r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=v.graphJson(t,!1,"keepdata"),a.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1};var x=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],b=["year","month","dayMonth","dayMonthYear"];function _(t,e){var r=t._context.locale,n=!1,a={};function o(t){for(var r=!0,i=0;i<e.length;i++){var o=e[i];a[o]||(t[o]?a[o]=t[o]:r=!1)}r&&(n=!0)}for(var l=0;l<2;l++){for(var s=t._context.locales,c=0;c<2;c++){var u=(s[r]||{}).format;if(u&&(o(u),n))break;s=i.localeRegistry}var f=r.split("-")[0];if(n||f===r)break;r=f}return n||o(i.localeRegistry.en.format),a}function w(t,e){var r={_fullLayout:e},n="x"===t._id.charAt(0),a=t._mainAxis._anchorAxis,i="",o="",l="";if(a&&(l=a._mainAxis._id,i=n?t._id+l:l+t._id),!i||!e._plots[i]){i="";for(var s=t._counterAxes,c=0;c<s.length;c++){var u=s[c],d=n?t._id+u:u+t._id;o||(o=d);var p=f.getFromId(r,u);if(l&&p.overlaying===l){i=d;break}}}return i||o}function k(t){var e=t.transforms;if(Array.isArray(e)&&e.length)for(var r=0;r<e.length;r++){var n=e[r],a=n._module||y[n.type];if(a&&a.makesData)return!0}return!1}function T(t,e,r,n){for(var a=t.transforms,i=[t],o=0;o<a.length;o++){var l=a[o],s=y[l.type];s&&s.transform&&(i=s.transform(i,{transform:l,fullTrace:t,fullData:e,layout:r,fullLayout:n,transformIndex:o}))}return i}function M(t){var e=t.margin;if(!t._size){var r=t._size={l:Math.round(e.l),r:Math.round(e.r),t:Math.round(e.t),b:Math.round(e.b),p:Math.round(e.pad)};r.w=Math.round(t.width)-r.l-r.r,r.h=Math.round(t.height)-r.t-r.b}t._pushmargin||(t._pushmargin={}),t._pushmarginIds||(t._pushmarginIds={})}function A(t,e,r){var n=!1;var a=[v.previousPromises,function(){if(t._transitionData)return t._transitioning=!1,function(t){var e=Promise.resolve();if(!t)return e;for(;t.length;)e=e.then(t.shift());return e}(t._transitionData._interruptCallbacks)},r.prepareFn,v.rehover,function(){return t.emit("plotly_transitioning",[]),new Promise(function(a){t._transitioning=!0,e.duration>0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){n=!0}),r.redraw&&t._transitionData._interruptCallbacks.push(function(){return i.call("redraw",t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var o=0,l=0;function s(){return o++,function(){var e;l++,n||l!==o||(e=a,t._transitionData&&(function(t){if(t)for(;t.length;)t.shift()}(t._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(r.redraw)return i.call("redraw",t)}).then(function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])}).then(e)))}}r.runFn(s),setTimeout(s())})}],o=s.syncOrAsync(a,t);return o&&o.then||(o=Promise.resolve()),o.then(function(){return t})}function L(t,e){for(var r=0;r<t.length;r++){var n=t[r];n.clearCalc(),"multicategory"===n.type&&n.setupMultiCategory(e)}}v.supplyDefaults=function(t,e){var r=e&&e.skipUpdateCalc,a=t._fullLayout||{};if(a._skipDefaults)delete a._skipDefaults;else{var o,l=t._fullLayout={},c=t.layout||{},u=t._fullData||[],f=t._fullData=[],d=t.data||[],p=t.calcdata||[],y=t._context||{};t._transitionData||v.createTransitionData(t),l._dfltTitle={plot:g(t,"Click to enter Plot title"),x:g(t,"Click to enter X axis title"),y:g(t,"Click to enter Y axis title"),colorbar:g(t,"Click to enter Colorscale title"),annotation:g(t,"new text")},l._traceWord=g(t,"trace");var m=_(t,x);if(l._mapboxAccessToken=y.mapboxAccessToken,a._initialAutoSizeIsDone){var w=a.width,k=a.height;v.supplyLayoutGlobalDefaults(c,l,m),c.width||(l.width=w),c.height||(l.height=k),v.sanitizeMargins(l)}else{v.supplyLayoutGlobalDefaults(c,l,m);var T=!c.width||!c.height,A=l.autosize,L=y.autosizable;T&&(A||L)?v.plotAutoSize(t,c,l):T&&v.sanitizeMargins(l),!A&&T&&(c.width=l.width,c.height=l.height)}l._d3locale=function(t,e){return t.decimal=e.charAt(0),t.thousands=e.charAt(1),n.locale(t)}(m,l.separators),l._extraFormat=_(t,b),l._initialAutoSizeIsDone=!0,l._dataLength=d.length,l._modules=[],l._visibleModules=[],l._basePlotModules=[];var S=l._subplots=function(){var t,e,r=i.collectableSubplotTypes,n={};if(!r){r=[];var a=i.subplotsRegistry;for(var o in a){var l=a[o],c=l.attr;if(c&&(r.push(o),Array.isArray(c)))for(e=0;e<c.length;e++)s.pushUnique(r,c[e])}}for(t=0;t<r.length;t++)n[r[t]]=[];return n}(),C=l._splomAxes={x:{},y:{}},O=l._splomSubplots={};l._splomGridDflt={},l._scatterStackOpts={},l._firstScatter={},l._requestRangeslider={},l._traceUids=function(t,e){var r,n,a=e.length,i=[];for(r=0;r<t.length;r++){var o=t[r]._fullInput;o!==n&&i.push(o),n=o}var l=i.length,c=new Array(a),u={};function f(t,e){c[e]=t,u[t]=1}function d(t,e){if(t&&"string"==typeof t&&!u[t])return f(t,e),!0}for(r=0;r<a;r++){var p=e[r].uid;"number"==typeof p&&(p=String(p)),d(p,r)||(r<l&&d(i[r].uid,r)||f(s.randstr(u),r))}return c}(u,d),l._globalTransforms=(t._context||{}).globalTransforms,v.supplyDataDefaults(d,f,c,l);var z=Object.keys(C.x),D=Object.keys(C.y);if(z.length>1&&D.length>1){for(i.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o<z.length;o++)s.pushUnique(S.xaxis,z[o]);for(o=0;o<D.length;o++)s.pushUnique(S.yaxis,D[o]);for(var P in O)s.pushUnique(S.cartesian,P)}if(l._has=v._hasPlotType.bind(l),u.length===f.length)for(o=0;o<f.length;o++)h(f[o],u[o]);v.supplyLayoutModuleDefaults(c,l,f,t._transitionData);var E=l._visibleModules,R=[];for(o=0;o<E.length;o++){var I=E[o].crossTraceDefaults;I&&s.pushUnique(R,I)}for(o=0;o<R.length;o++)R[o](f,l);i.getComponentMethod("colorscale","crossTraceDefaults")(f,l),l._hasOnlyLargeSploms=1===l._basePlotModules.length&&"splom"===l._basePlotModules[0].name&&z.length>15&&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"),v.linkSubplots(f,l,u,a),v.cleanPlot(f,l,u,a),h(l,a),l._preGUI||(l._preGUI={}),l._tracePreGUI||(l._tracePreGUI={});var F,N=l._tracePreGUI,B={};for(F in N)B[F]="old";for(o=0;o<f.length;o++)B[F=f[o]._fullInput.uid]||(N[F]={}),B[F]="new";for(F in B)"old"===B[F]&&delete N[F];M(l),i.getComponentMethod("rangeslider","makeData")(l),r||p.length!==f.length||v.supplyDefaultsUpdateCalc(p,f)}},v.supplyDefaultsUpdateCalc=function(t,e){for(var r=0;r<e.length;r++){var n=e[r],a=(t[r]||[])[0];if(a&&a.trace){var i=a.trace;if(i._hasCalcTransform){var o,l,c,u=i._arrayAttrs;for(o=0;o<u.length;o++)l=u[o],c=s.nestedProperty(i,l).get().slice(),s.nestedProperty(n,l).set(c)}a.trace=n}}},v.createTransitionData=function(t){t._transitionData||(t._transitionData={}),t._transitionData._frames||(t._transitionData._frames=[]),t._transitionData._frameHash||(t._transitionData._frameHash={}),t._transitionData._counter||(t._transitionData._counter=0),t._transitionData._interruptCallbacks||(t._transitionData._interruptCallbacks=[])},v._hasPlotType=function(t){var e,r=this._basePlotModules||[];for(e=0;e<r.length;e++)if(r[e].name===t)return!0;var n=this._modules||[];for(e=0;e<n.length;e++){var a=n[e].name;if(a===t)return!0;var o=i.modules[a];if(o&&o.categories[t])return!0}return!1},v.cleanPlot=function(t,e,r,n){var a,i,o=n._basePlotModules||[];for(a=0;a<o.length;a++){var l=o[a];l.clean&&l.clean(t,e,r,n)}var s=n._has&&n._has("gl"),c=e._has&&e._has("gl");s&&!c&&void 0!==n._glcontainer&&(n._glcontainer.selectAll(".gl-canvas").remove(),n._glcontainer.selectAll(".no-webgl").remove(),n._glcanvas=null);var u=!!n._infolayer;t:for(a=0;a<r.length;a++){var f=r[a].uid;for(i=0;i<t.length;i++){if(f===t[i].uid)continue t}u&&n._infolayer.select(".cb"+f).remove()}n._zoomlayer&&n._zoomlayer.selectAll(".select-outline").remove()},v.linkSubplots=function(t,e,r,n){var a,i,o=n._plots||{},l=e._plots={},c=e._subplots,u={_fullData:t,_fullLayout:e},d=c.cartesian.concat(c.gl2d||[]);for(a=0;a<d.length;a++){var p,h=d[a],g=o[h],v=f.getFromId(u,h,"x"),y=f.getFromId(u,h,"y");for(g?p=l[h]=g:(p=l[h]={}).id=h,v._counterAxes.push(y._id),y._counterAxes.push(v._id),v._subplotsWith.push(h),y._subplotsWith.push(h),p.xaxis=v,p.yaxis=y,p._hasClipOnAxisFalse=!1,i=0;i<t.length;i++){var m=t[i];if(m.xaxis===p.xaxis._id&&m.yaxis===p.yaxis._id&&!1===m.cliponaxis){p._hasClipOnAxisFalse=!0;break}}}var x,b=f.list(u,null,!0);for(a=0;a<b.length;a++){var _=null;(x=b[a]).overlaying&&(_=f.getFromId(u,x.overlaying))&&_.overlaying&&(x.overlaying=!1,_=null),x._mainAxis=_||x,_&&(x.domain=_.domain.slice()),x._anchorAxis="free"===x.anchor?null:f.getFromId(u,x.anchor)}for(a=0;a<b.length;a++)(x=b[a])._counterAxes.sort(f.idSort),x._subplotsWith.sort(s.subplotSort),x._mainSubplot=w(x,e)},v.clearExpandedTraceDefaultColors=function(t){var e,r,n;for(r=[],(e=t._module._colorAttrs)||(t._module._colorAttrs=e=[],o.crawl(t._module.attributes,function(t,n,a,i){r[i]=n,r.length=i+1,"color"===t.valType&&void 0===t.dflt&&e.push(r.join("."))})),n=0;n<e.length;n++){s.nestedProperty(t,"_input."+e[n]).get()||s.nestedProperty(t,e[n]).set(null)}},v.supplyDataDefaults=function(t,e,r,n){var a,o,c,u=n._modules,f=n._visibleModules,d=n._basePlotModules,p=0,g=0;function y(t){e.push(t);var r=t._module;r&&(s.pushUnique(u,r),!0===t.visible&&s.pushUnique(f,r),s.pushUnique(d,t._module.basePlotModule),p++,!1!==t._input.visible&&g++)}n._transformModules=[];var m={},x=[],b=(r.template||{}).data||{},_=l.traceTemplater(b);for(a=0;a<t.length;a++){if(c=t[a],(o=_.newTrace(c)).uid=n._traceUids[a],v.supplyTraceDefaults(c,o,g,n,a),o.index=a,o._input=c,o._expandedIndex=p,o.transforms&&o.transforms.length)for(var w=!1!==c.visible&&!1===o.visible,k=T(o,e,r,n),M=0;M<k.length;M++){var A=k[M],L={_template:o._template,type:o.type,uid:o.uid+M};w&&!1===A.visible&&delete A.visible,v.supplyTraceDefaults(A,L,p,n,a),h(L,A),L.index=a,L._input=c,L._fullInput=o,L._expandedIndex=p,L._expandedInput=A,y(L)}else o._fullInput=o,o._expandedInput=o,y(o);i.traceIs(o,"carpetAxis")&&(m[o.carpet]=o),i.traceIs(o,"carpetDependent")&&x.push(a)}for(a=0;a<x.length;a++)if((o=e[x[a]]).visible){var S=m[o.carpet];o._carpet=S,S&&S.visible?(o.xaxis=S.xaxis,o.yaxis=S.yaxis):o.visible=!1}},v.supplyAnimationDefaults=function(t){var e;t=t||{};var r={};function n(e,n){return s.coerce(t||{},r,d,e,n)}if(n("mode"),n("direction"),n("fromcurrent"),Array.isArray(t.frame))for(r.frame=[],e=0;e<t.frame.length;e++)r.frame[e]=v.supplyAnimationFrameDefaults(t.frame[e]||{});else r.frame=v.supplyAnimationFrameDefaults(t.frame||{});if(Array.isArray(t.transition))for(r.transition=[],e=0;e<t.transition.length;e++)r.transition[e]=v.supplyAnimationTransitionDefaults(t.transition[e]||{});else r.transition=v.supplyAnimationTransitionDefaults(t.transition||{});return r},v.supplyAnimationFrameDefaults=function(t){var e={};function r(r,n){return s.coerce(t||{},e,d.frame,r,n)}return r("duration"),r("redraw"),e},v.supplyAnimationTransitionDefaults=function(t){var e={};function r(r,n){return s.coerce(t||{},e,d.transition,r,n)}return r("duration"),r("easing"),e},v.supplyFrameDefaults=function(t){var e={};function r(r,n){return s.coerce(t,e,p,r,n)}return r("group"),r("name"),r("traces"),r("baseframe"),r("data"),r("layout"),e},v.supplyTraceDefaults=function(t,e,r,n,a){var o,l=n.colorway||c.defaults,u=l[r%l.length];function f(r,n){return s.coerce(t,e,v.attributes,r,n)}var d=f("visible");f("type"),f("name",n._traceWord+" "+a),f("uirevision",n.uirevision);var p,h,g,y=v.getModule(e);if(e._module=y,y){var m=y.basePlotModule,x=m.attr,b=m.attributes;if(x&&b){var _=n._subplots,w="";if("gl2d"!==m.name||d){if(Array.isArray(x))for(o=0;o<x.length;o++){var k=x[o],T=s.coerce(t,e,b,k);_[k]&&s.pushUnique(_[k],T),w+=T}else w=s.coerce(t,e,b,x);_[m.name]&&s.pushUnique(_[m.name],w)}}}return d&&(f("customdata"),f("ids"),i.traceIs(e,"showLegend")?(e._dfltShowLegend=!0,f("showlegend"),f("legendgroup")):e._dfltShowLegend=!1,p="hoverlabel",h="",g=function(){i.getComponentMethod("fx","supplyDefaults")(t,e,u,n)},y&&p in y.attributes&&void 0===y.attributes[p]||(g&&"function"==typeof g?g():f(p,h)),y&&(y.supplyDefaults(t,e,u,n),e.hovertemplate||s.coerceHoverinfo(t,e,n)),i.traceIs(e,"noOpacity")||f("opacity"),i.traceIs(e,"notLegendIsolatable")&&(e.visible=!!e.visible),y&&y.selectPoints&&f("selectedpoints"),v.supplyTransformDefaults(t,e,n)),e},v.hasMakesDataTransform=k,v.supplyTransformDefaults=function(t,e,r){if(e._length||k(t)){var n=r._globalTransforms||[],a=r._transformModules||[];if(Array.isArray(t.transforms)||0!==n.length)for(var i=t.transforms||[],o=n.concat(i),l=e.transforms=[],c=0;c<o.length;c++){var u,f=o[c],d=f.type,p=y[d],h=!(f._module&&f._module===p),g=p&&"function"==typeof p.transform;p||s.warn("Unrecognized transform type "+d+"."),p&&p.supplyDefaults&&(h||g)?((u=p.supplyDefaults(f,e,r,t)).type=d,u._module=p,s.pushUnique(a,p)):u=s.extendFlat({},f),l.push(u)}}},v.supplyLayoutGlobalDefaults=function(t,e,r){function n(r,n){return s.coerce(t,e,v.layoutAttributes,r,n)}var a=t.template;s.isPlainObject(a)&&(e.template=a,e._template=a.layout,e._dataTemplate=a.data);var o=s.coerceFont(n,"font");n("title.text",e._dfltTitle.plot),s.coerceFont(n,"title.font",{family:o.family,size:Math.round(1.4*o.size),color:o.color}),n("title.xref"),n("title.yref"),n("title.x"),n("title.y"),n("title.xanchor"),n("title.yanchor"),n("title.pad.t"),n("title.pad.r"),n("title.pad.b"),n("title.pad.l"),n("autosize",!(t.width&&t.height)),n("width"),n("height"),n("margin.l"),n("margin.r"),n("margin.t"),n("margin.b"),n("margin.pad"),n("margin.autoexpand"),t.width&&t.height&&v.sanitizeMargins(e),i.getComponentMethod("grid","sizeDefaults")(t,e),n("paper_bgcolor"),n("separators",r.decimal+r.thousands),n("hidesources"),n("colorway"),n("datarevision");var l=n("uirevision");n("editrevision",l),n("selectionrevision",l),n("modebar.orientation"),n("modebar.bgcolor",c.addOpacity(e.paper_bgcolor,.5));var u=c.contrast(c.rgb(e.modebar.bgcolor));n("modebar.color",c.addOpacity(u,.3)),n("modebar.activecolor",c.addOpacity(u,.7)),n("modebar.uirevision",l),n("meta"),s.isPlainObject(t.transition)&&(n("transition.duration"),n("transition.easing"),n("transition.ordering")),i.getComponentMethod("calendars","handleDefaults")(t,e,"calendar"),i.getComponentMethod("fx","supplyLayoutGlobalDefaults")(t,e,n)},v.plotAutoSize=function(t,e,r){var n,i,o=t._context||{},l=o.frameMargins,c=s.isPlotDiv(t);if(c&&t.emit("plotly_autosize"),o.fillFrame)n=window.innerWidth,i=window.innerHeight,document.body.style.overflow="hidden";else{var u=c?window.getComputedStyle(t):{};if(n=parseFloat(u.width)||parseFloat(u.maxWidth)||r.width,i=parseFloat(u.height)||parseFloat(u.maxHeight)||r.height,a(l)&&l>0){var f=1-2*l;n=Math.round(f*n),i=Math.round(f*i)}}var d=v.layoutAttributes.width.min,p=v.layoutAttributes.height.min;n<d&&(n=d),i<p&&(i=p);var h=!e.width&&Math.abs(r.width-n)>1,g=!e.height&&Math.abs(r.height-i)>1;(g||h)&&(h&&(r.width=n),g&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),v.sanitizeMargins(r)},v.supplyLayoutModuleDefaults=function(t,e,r,n){var a,o,l,c=i.componentsRegistry,u=e._basePlotModules,f=i.subplotsRegistry.cartesian;for(a in c)(l=c[a]).includeBasePlot&&l.includeBasePlot(t,e);for(var d in u.length||u.push(f),e._has("cartesian")&&(i.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e)),e._subplots)e._subplots[d].sort(s.subplotSort);for(o=0;o<u.length;o++)(l=u[o]).supplyLayoutDefaults&&l.supplyLayoutDefaults(t,e,r);var p=e._modules;for(o=0;o<p.length;o++)(l=p[o]).supplyLayoutDefaults&&l.supplyLayoutDefaults(t,e,r);var h=e._transformModules;for(o=0;o<h.length;o++)(l=h[o]).supplyLayoutDefaults&&l.supplyLayoutDefaults(t,e,r,n);for(a in c)(l=c[a]).supplyLayoutDefaults&&l.supplyLayoutDefaults(t,e,r)},v.purge=function(t){var e=t._fullLayout||{};void 0!==e._glcontainer&&(e._glcontainer.selectAll(".gl-canvas").remove(),e._glcontainer.remove(),e._glcanvas=null),void 0!==e._geocontainer&&e._geocontainer.remove(),e._modeBar&&e._modeBar.destroy(),t._transitionData&&(t._transitionData._interruptCallbacks&&(t._transitionData._interruptCallbacks.length=0),t._transitionData._animationRaf&&window.cancelAnimationFrame(t._transitionData._animationRaf)),s.clearThrottle(),s.clearResponsive(t),delete t.data,delete t.layout,delete t._fullData,delete t._fullLayout,delete t.calcdata,delete t.framework,delete t.empty,delete t.fid,delete t.undoqueue,delete t.undonum,delete t.autoplay,delete t.changed,delete t._promises,delete t._redrawTimer,delete t._hmlumcount,delete t._hmpixcount,delete t._transitionData,delete t._transitioning,delete t._initialAutoSize,delete t._transitioningWithDuration,delete t._dragging,delete t._dragged,delete t._hoverdata,delete t._snapshotInProgress,delete t._editing,delete t._replotPending,delete t._mouseDownTime,delete t._legendMouseDownTime,t.removeAllListeners&&t.removeAllListeners()},v.style=function(t){var e,r=t._fullLayout._visibleModules,n=[];for(e=0;e<r.length;e++){var a=r[e];a.style&&s.pushUnique(n,a.style)}for(e=0;e<n.length;e++)n[e](t)},v.sanitizeMargins=function(t){if(t&&t.margin){var e,r=t.width,n=t.height,a=t.margin,i=r-(a.l+a.r),o=n-(a.t+a.b);i<0&&(e=(r-1)/(a.l+a.r),a.l=Math.floor(e*a.l),a.r=Math.floor(e*a.r)),o<0&&(e=(n-1)/(a.t+a.b),a.t=Math.floor(e*a.t),a.b=Math.floor(e*a.b))}},v.clearAutoMarginIds=function(t){t._fullLayout._pushmarginIds={}},v.allowAutoMargin=function(t,e){t._fullLayout._pushmarginIds[e]=1},v.autoMargin=function(t,e,r){var n=t._fullLayout,a=n._pushmargin,i=n._pushmarginIds;if(!1!==n.margin.autoexpand){if(r){var o=r.pad;if(void 0===o){var l=n.margin;o=Math.min(12,l.l,l.r,l.t,l.b)}r.l+r.r>.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0);var s=void 0!==r.xl?r.xl:r.x,c=void 0!==r.xr?r.xr:r.x,u=void 0!==r.yt?r.yt:r.y,f=void 0!==r.yb?r.yb:r.y;a[e]={l:{val:s,size:r.l+o},r:{val:c,size:r.r+o},b:{val:f,size:r.b+o},t:{val:u,size:r.t+o}},i[e]=1}else delete a[e],delete i[e];n._replotting||v.doAutoMargin(t)}},v.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),M(e);var r=e._size,n=JSON.stringify(r),o=e.margin,l=o.l,s=o.r,c=o.t,u=o.b,f=e._pushmargin,d=e._pushmarginIds;if(!1!==e.margin.autoexpand){for(var p in f)d[p]||delete f[p];for(var h in f.base={l:{val:0,size:l},r:{val:1,size:s},t:{val:1,size:c},b:{val:0,size:u}},f){var g=f[h].l||{},v=f[h].b||{},y=g.val,m=g.size,x=v.val,b=v.size;for(var _ in f){if(a(m)&&f[_].r){var w=f[_].r.val,k=f[_].r.size;if(w>y){var T=(m*w+(k-e.width)*y)/(w-y),A=(k*(1-y)+(m-e.width)*(1-w))/(w-y);T>=0&&A>=0&&T+A>l+s&&(l=T,s=A)}}if(a(b)&&f[_].t){var L=f[_].t.val,S=f[_].t.size;if(L>x){var C=(b*L+(S-e.height)*x)/(L-x),O=(S*(1-x)+(b-e.height)*(1-L))/(L-x);C>=0&&O>=0&&C+O>u+c&&(u=C,c=O)}}}}}if(r.l=Math.round(l),r.r=Math.round(s),r.t=Math.round(c),r.b=Math.round(u),r.p=Math.round(o.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,!e._replotting&&"{}"!==n&&n!==JSON.stringify(e._size))return"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1,i.call("plot",t)},v.graphJson=function(t,e,r,n,a){(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&v.supplyDefaults(t);var i=a?t._fullData:t.data,o=a?t._fullLayout:t.layout,l=(t._transitionData||{})._frames;function c(t){if("function"==typeof t)return null;if(s.isPlainObject(t)){var e,n,a={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0&&!s.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;a[e]=c(t[e])}return a}return Array.isArray(t)?t.map(c):s.isTypedArray(t)?s.simpleMap(t,s.identity):s.isJSDate(t)?s.ms2DateTimeLocal(+t):t}var u={data:(i||[]).map(function(t){var r=c(t);return e&&delete r.fit,r})};return e||(u.layout=c(o)),t.framework&&t.framework.isPolar&&(u=t.framework.getConfig()),l&&(u.frames=c(l)),"object"===n?u:JSON.stringify(u)},v.modifyFrames=function(t,e){var r,n,a,i=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r<e.length;r++)switch((n=e[r]).type){case"replace":a=n.value;var l=(i[n.index]||{}).name,s=a.name;i[n.index]=o[s]=a,s!==l&&(delete o[l],o[s]=a);break;case"insert":o[(a=n.value).name]=a,i.splice(n.index,0,a);break;case"delete":delete o[(a=i[n.index]).name],i.splice(n.index,1)}return Promise.resolve()},v.computeFrame=function(t,e){var r,n,a,i,o=t._transitionData._frameHash;if(!e)throw new Error("computeFrame must be given a string frame name");var l=o[e.toString()];if(!l)return!1;for(var s=[l],c=[l.name];l.baseframe&&(l=o[l.baseframe.toString()])&&-1===c.indexOf(l.name);)s.push(l),c.push(l.name);for(var u={};l=s.pop();)if(l.layout&&(u.layout=v.extendLayout(u.layout,l.layout)),l.data){if(u.data||(u.data=[]),!(n=l.traces))for(n=[],r=0;r<l.data.length;r++)n[r]=r;for(u.traces||(u.traces=[]),r=0;r<l.data.length;r++)null!=(a=n[r])&&(-1===(i=u.traces.indexOf(a))&&(i=u.data.length,u.traces[i]=a),u.data[i]=v.extendTrace(u.data[i],l.data[r]))}return u},v.recomputeFrameHash=function(t){for(var e=t._transitionData._frameHash={},r=t._transitionData._frames,n=0;n<r.length;n++){var a=r[n];a&&a.name&&(e[a.name]=a)}},v.extendObjectWithContainers=function(t,e,r){var n,a,i,o,l,c,u,f=s.extendDeepNoArrays({},e||{}),d=s.expandObjectPaths(f),p={};if(r&&r.length)for(i=0;i<r.length;i++)void 0===(a=(n=s.nestedProperty(d,r[i])).get())?s.nestedProperty(p,r[i]).set(null):(n.set(null),s.nestedProperty(p,r[i]).set(a));if(t=s.extendDeepNoArrays(t||{},d),r&&r.length)for(i=0;i<r.length;i++)if(c=s.nestedProperty(p,r[i]).get()){for(u=(l=s.nestedProperty(t,r[i])).get(),Array.isArray(u)||(u=[],l.set(u)),o=0;o<c.length;o++){var h=c[o];u[o]=null===h?null:v.extendObjectWithContainers(u[o],h)}l.set(u)}return t},v.dataArrayContainers=["transforms","dimensions"],v.layoutArrayContainers=i.layoutArrayContainers,v.extendTrace=function(t,e){return v.extendObjectWithContainers(t,e,v.dataArrayContainers)},v.extendLayout=function(t,e){return v.extendObjectWithContainers(t,e,v.layoutArrayContainers)},v.transition=function(t,e,r,n,a,i){var o={redraw:a.redraw},l=[],c=[];return o.prepareFn=function(){for(var a=Array.isArray(e)?e.length:0,i=n.slice(0,a),o=0;o<i.length;o++){var u=i[o],f=t._fullData[u]._module;f&&(f.animatable&&l.push(u),t.data[i[o]]=v.extendTrace(t.data[i[o]],e[o]))}var d=s.expandObjectPaths(s.extendDeepNoArrays({},r)),p=/^[xy]axis[0-9]*$/;for(var h in d)p.test(h)&&delete d[h].range;v.extendLayout(t.layout,d),delete t.calcdata,v.supplyDefaults(t),v.doCalcdata(t);var g=s.expandObjectPaths(r);if(g){var y=t._fullLayout._plots;for(var m in y){var x,b,_,w,k=y[m],T=k.xaxis,M=k.yaxis,A=T.range.slice(),L=M.range.slice();Array.isArray(g[T._name+".range"])?x=g[T._name+".range"].slice():Array.isArray((g[T._name]||{}).range)&&(x=g[T._name].range.slice()),Array.isArray(g[M._name+".range"])?b=g[M._name+".range"].slice():Array.isArray((g[M._name]||{}).range)&&(b=g[M._name].range.slice()),A&&x&&(A[0]!==x[0]||A[1]!==x[1])&&(_={xr0:A,xr1:x}),L&&b&&(L[0]!==b[0]||L[1]!==b[1])&&(w={yr0:L,yr1:b}),(_||w)&&c.push(s.extendFlat({plotinfo:k},_,w))}}return Promise.resolve()},o.runFn=function(e){var n,a,o=t._fullLayout._basePlotModules,u=c.length;if(r)for(a=0;a<o.length;a++)o[a].transitionAxes&&o[a].transitionAxes(t,c,i,e);for(u?((n=s.extendFlat({},i)).duration=0,l=null):n=i,a=0;a<o.length;a++)o[a].plot(t,l,n,e)},A(t,i,o)},v.transitionFromReact=function(t,e,r,n){var a=t._fullLayout,i=a.transition,o={},l=[];return o.prepareFn=function(){var t=a._plots;for(var i in o.redraw=!1,"some"===e.anim&&(o.redraw=!0),"some"===r.anim&&(o.redraw=!0),t){var c,u,f=t[i],d=f.xaxis,p=f.yaxis,h=n[d._name].range.slice(),g=n[p._name].range.slice(),v=d.range.slice(),y=p.range.slice();d.setScale(),p.setScale(),h[0]===v[0]&&h[1]===v[1]||(c={xr0:h,xr1:v}),g[0]===y[0]&&g[1]===y[1]||(u={yr0:g,yr1:y}),(c||u)&&l.push(s.extendFlat({plotinfo:f},c,u))}return Promise.resolve()},o.runFn=function(r){for(var n,a,o,c=t._fullData,u=t._fullLayout._basePlotModules,f=[],d=0;d<c.length;d++)f.push(d);function p(){for(var e=0;e<u.length;e++)u[e].transitionAxes&&u[e].transitionAxes(t,l,n,r)}function h(){for(var e=0;e<u.length;e++)u[e].plot(t,o,a,r)}l.length&&e.anim?"traces first"===i.ordering?(n=s.extendFlat({},i,{duration:0}),o=f,a=i,h(),setTimeout(p,i.duration)):(n=i,o=null,a=s.extendFlat({},i,{duration:0}),p(),h()):l.length?(n=i,p()):e.anim&&(o=f,a=i,h())},A(t,i,o)},v.doCalcdata=function(t,e){var r,n,a,l,c=f.list(t),d=t._fullData,p=t._fullLayout,h=new Array(d.length),g=(t.calcdata||[]).slice(0);for(t.calcdata=h,p._numBoxes=0,p._numViolins=0,p._violinScaleGroupStats={},t._hmpixcount=0,t._hmlumcount=0,p._piecolormap={},a=0;a<d.length;a++)Array.isArray(e)&&-1===e.indexOf(a)&&(h[a]=g[a]);for(a=0;a<d.length;a++)(r=d[a])._arrayAttrs=o.findArrayAttributes(r),r._extremes={};var v=p._subplots.polar||[];for(a=0;a<v.length;a++)c.push(p[v[a]].radialaxis,p[v[a]].angularaxis);L(c,d);var m=!1;for(a=0;a<d.length;a++)if(!0===(r=d[a]).visible&&r.transforms){if((n=r._module)&&n.calc){var x=n.calc(t,r);x[0]&&x[0].t&&x[0].t._scene&&delete x[0].t._scene.dirty}for(l=0;l<r.transforms.length;l++){var b=r.transforms[l];(n=y[b.type])&&n.calcTransform&&(r._hasCalcTransform=!0,m=!0,n.calcTransform(t,r,b))}}function _(e,a){if(r=d[e],!!(n=r._module).isContainer===a){var i=[];if(!0===r.visible){delete r._indexToPoints;var o=r.transforms||[];for(l=o.length-1;l>=0;l--)if(o[l].enabled){r._indexToPoints=o[l]._indexToPoints;break}n&&n.calc&&(i=n.calc(t,r))}Array.isArray(i)&&i[0]||(i=[{x:u,y:u}]),i[0].t||(i[0].t={}),i[0].trace=r,h[e]=i}}for(m&&L(c,d),a=0;a<d.length;a++)_(a,!0);for(a=0;a<d.length;a++)_(a,!1);!function(t){var e,r,n,a=t._fullLayout,i=a._visibleModules,o={};for(r=0;r<i.length;r++){var l=i[r],c=l.crossTraceCalc;if(c){var u=l.basePlotModule.name;o[u]?s.pushUnique(o[u],c):o[u]=[c]}}for(n in o){var f=o[n],d=a._subplots[n];if(Array.isArray(d))for(e=0;e<d.length;e++){var p=d[e],h="cartesian"===n?a._plots[p]:a[p];for(r=0;r<f.length;r++)f[r](t,h,p)}else for(r=0;r<f.length;r++)f[r](t)}}(t),i.getComponentMethod("fx","calc")(t),i.getComponentMethod("errorbars","calc")(t)},v.rehover=function(t){t._fullLayout._rehover&&t._fullLayout._rehover()},v.generalUpdatePerTraceModule=function(t,e,r,n){var a,i=e.traceHash,o={};for(a=0;a<r.length;a++){var l=r[a],c=l[0].trace;c.visible&&(o[c.type]=o[c.type]||[],o[c.type].push(l))}for(var u in i)if(!o[u]){var f=i[u][0];f[0].trace.visible=!1,o[u]=[f]}for(var d in o){var p=o[d];p[0][0].trace._module.plot(t,e,s.filterVisible(p),n)}e.traceHash=o}},{"../components/color":51,"../constants/numerical":149,"../lib":168,"../plot_api/plot_schema":201,"../plot_api/plot_template":202,"../plots/cartesian/axis_ids":215,"../registry":257,"./animation_attributes":207,"./attributes":209,"./command":237,"./font_attributes":239,"./frame_attributes":240,"./layout_attributes":243,d3:16,"fast-isnumeric":18}],246:[function(t,e,r){"use strict";var n=t("../../../traces/scatter/attributes"),a=n.marker,i=t("../../../lib/extend").extendFlat;["Area traces are deprecated!","Please switch to the *barpolar* trace type."].join(" ");e.exports={r:i({},n.r,{}),t:i({},n.t,{}),marker:{color:i({},a.color,{}),size:i({},a.size,{}),symbol:i({},a.symbol,{}),opacity:i({},a.opacity,{}),editType:"calc"}}},{"../../../lib/extend":162,"../../../traces/scatter/attributes":367}],247:[function(t,e,r){"use strict";var n=t("../../cartesian/layout_attributes"),a=t("../../../lib/extend").extendFlat,i=t("../../../plot_api/edit_types").overrideAll,o=["Legacy polar charts are deprecated!","Please switch to *polar* subplots."].join(" "),l=a({},n.domain,{});function s(t,e){return a({},e,{showline:{valType:"boolean"},showticklabels:{valType:"boolean"},tickorientation:{valType:"enumerated",values:["horizontal","vertical"]},ticklen:{valType:"number",min:0},tickcolor:{valType:"color"},ticksuffix:{valType:"string"},endpadding:{valType:"number",description:o},visible:{valType:"boolean"}})}e.exports=i({radialaxis:s(0,{range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},domain:l,orientation:{valType:"number"}}),angularaxis:s(0,{range:{valType:"info_array",items:[{valType:"number",dflt:0},{valType:"number",dflt:360}]},domain:l}),layout:{direction:{valType:"enumerated",values:["clockwise","counterclockwise"]},orientation:{valType:"angle"}}},"plot","nested")},{"../../../lib/extend":162,"../../../plot_api/edit_types":195,"../../cartesian/layout_attributes":225}],248:[function(t,e,r){"use strict";(e.exports=t("./micropolar")).manager=t("./micropolar_manager")},{"./micropolar":249,"./micropolar_manager":250}],249:[function(t,e,r){var n=t("d3"),a=t("../../../lib").extendDeepAll,i=t("../../../constants/alignment").MID_SHIFT,o=e.exports={version:"0.2.2"};o.Axis=function(){var t,e,r,l,s={data:[],layout:{}},c={},u={},f=n.dispatch("hover"),d={};return d.render=function(c){return function(c){e=c||e;var f=s.data,d=s.layout;("string"==typeof e||e.nodeName)&&(e=n.select(e)),e.datum(f).each(function(e,s){var c=e.slice();u={data:o.util.cloneJson(c),layout:o.util.cloneJson(d)};var f=0;c.forEach(function(t,e){t.color||(t.color=d.defaultColorRange[f],f=(f+1)%d.defaultColorRange.length),t.strokeColor||(t.strokeColor="LinePlot"===t.geometry?t.color:n.rgb(t.color).darker().toString()),u.data[e].color=t.color,u.data[e].strokeColor=t.strokeColor,u.data[e].strokeDash=t.strokeDash,u.data[e].strokeSize=t.strokeSize});var p=c.filter(function(t,e){var r=t.visible;return"undefined"==typeof r||!0===r}),h=!1,g=p.map(function(t,e){return h=h||"undefined"!=typeof t.groupId,t});if(h){var v=n.nest().key(function(t,e){return"undefined"!=typeof t.groupId?t.groupId:"unstacked"}).entries(g),y=[],m=v.map(function(t,e){if("unstacked"===t.key)return t.values;var r=t.values[0].r.map(function(t,e){return 0});return t.values.forEach(function(t,e,n){t.yStack=[r],y.push(r),r=o.util.sumArrays(t.r,r)}),t.values});p=n.merge(m)}p.forEach(function(t,e){t.t=Array.isArray(t.t[0])?t.t:[t.t],t.r=Array.isArray(t.r[0])?t.r:[t.r]});var x=Math.min(d.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2;x=Math.max(10,x);var b,_=[d.margin.left+x,d.margin.top+x];b=h?[0,n.max(o.util.sumArrays(o.util.arrayLast(p).r[0],o.util.arrayLast(y)))]:n.extent(o.util.flattenArray(p.map(function(t,e){return t.r}))),d.radialAxis.domain!=o.DATAEXTENT&&(b[0]=0),r=n.scale.linear().domain(d.radialAxis.domain!=o.DATAEXTENT&&d.radialAxis.domain?d.radialAxis.domain:b).range([0,x]),u.layout.radialAxis.domain=r.domain();var w,k=o.util.flattenArray(p.map(function(t,e){return t.t})),T="string"==typeof k[0];T&&(k=o.util.deduplicate(k),w=k.slice(),k=n.range(k.length),p=p.map(function(t,e){var r=t;return t.t=[k],h&&(r.yStack=t.yStack),r}));var M=p.filter(function(t,e){return"LinePlot"===t.geometry||"DotPlot"===t.geometry}).length===p.length,A=null===d.needsEndSpacing?T||!M:d.needsEndSpacing,L=d.angularAxis.domain&&d.angularAxis.domain!=o.DATAEXTENT&&!T&&d.angularAxis.domain[0]>=0?d.angularAxis.domain:n.extent(k),S=Math.abs(k[1]-k[0]);M&&!T&&(S=0);var C=L.slice();A&&T&&(C[1]+=S);var O=d.angularAxis.ticksCount||4;O>8&&(O=O/(O/8)+O%8),d.angularAxis.ticksStep&&(O=(C[1]-C[0])/O);var z=d.angularAxis.ticksStep||(C[1]-C[0])/(O*(d.minorTicks+1));w&&(z=Math.max(Math.round(z),1)),C[2]||(C[2]=z);var D=n.range.apply(this,C);if(D=D.map(function(t,e){return parseFloat(t.toPrecision(12))}),l=n.scale.linear().domain(C.slice(0,2)).range("clockwise"===d.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=l.domain(),u.layout.angularAxis.endPadding=A?S:0,"undefined"==typeof(t=n.select(this).select("svg.chart-root"))||t.empty()){var P=(new DOMParser).parseFromString("<svg xmlns='http://www.w3.org/2000/svg' class='chart-root'>' + '<g class='outer-group'>' + '<g class='chart-group'>' + '<circle class='background-circle'></circle>' + '<g class='geometry-group'></g>' + '<g class='radial axis-group'>' + '<circle class='outside-circle'></circle>' + '</g>' + '<g class='angular axis-group'></g>' + '<g class='guides-group'><line></line><circle r='0'></circle></g>' + '</g>' + '<g class='legend-group'></g>' + '<g class='tooltips-group'></g>' + '<g class='title-group'><text></text></g>' + '</g>' + '</svg>","application/xml"),E=this.appendChild(this.ownerDocument.importNode(P.documentElement,!0));t=n.select(E)}t.select(".guides-group").style({"pointer-events":"none"}),t.select(".angular.axis-group").style({"pointer-events":"none"}),t.select(".radial.axis-group").style({"pointer-events":"none"});var R,I=t.select(".chart-group"),F={fill:"none",stroke:d.tickColor},N={"font-size":d.font.size,"font-family":d.font.family,fill:d.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+d.font.outlineColor}).join(",")};if(d.showLegend){R=t.select(".legend-group").attr({transform:"translate("+[x,d.margin.top]+")"}).style({display:"block"});var B=p.map(function(t,e){var r=o.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend="undefined"==typeof t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});o.Legend().config({data:p.map(function(t,e){return t.name||"Element"+e}),legendConfig:a({},o.Legend.defaultConfig().legendConfig,{container:R,elements:B,reverseOrder:d.legend.reverseOrder})})();var j=R.node().getBBox();x=Math.min(d.width-j.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2,x=Math.max(10,x),_=[d.margin.left+x,d.margin.top+x],r.range([0,x]),u.layout.radialAxis.domain=r.domain(),R.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else R=t.select(".legend-group").style({display:"none"});t.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+(j?j.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]),t.select(".outer-group").attr("transform","translate("+H+")"),d.title&&d.title.text){var q=t.select("g.title-group text").style(N).text(d.title.text),V=q.node().getBBox();q.attr({x:_[0]-V.width/2,y:_[1]-x-20})}var U=t.select(".radial.axis-group");if(d.radialAxis.gridLinesVisible){var G=U.selectAll("circle.grid-circle").data(r.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(F),G.attr("r",r),G.exit().remove()}U.select("circle.outside-circle").attr({r:x}).style(F);var Z=t.select("circle.background-circle").attr({r:x}).style({fill:d.backgroundColor,stroke:d.stroke});function X(t,e){return l(t)%360+d.orientation}if(d.radialAxis.visible){var Y=n.svg.axis().scale(r).ticks(5).tickSize(5);U.call(Y).attr({transform:"rotate("+d.radialAxis.orientation+")"}),U.selectAll(".domain").style(F),U.selectAll("g>text").text(function(t,e){return this.textContent+d.radialAxis.ticksSuffix}).style(N).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===d.radialAxis.tickOrientation?"rotate("+-d.radialAxis.orientation+") translate("+[0,N["font-size"]]+")":"translate("+[0,N["font-size"]]+")"}}),U.selectAll("g>line").style({stroke:"black"})}var W=t.select(".angular.axis-group").selectAll("g.angular-tick").data(D),J=W.enter().append("g").classed("angular-tick",!0);W.attr({transform:function(t,e){return"rotate("+X(t)+")"}}).style({display:d.angularAxis.visible?"block":"none"}),W.exit().remove(),J.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(d.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(d.minorTicks+1)==0)}).style(F),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(N);var $=W.select("text.axis-text").attr({x:x+d.labelOffset,dy:i+"em",transform:function(t,e){var r=X(t),n=x+d.labelOffset,a=d.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-r+" "+n+" 0)":"radial"==a?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:d.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(d.minorTicks+1)!=0?"":w?w[t]+d.angularAxis.ticksSuffix:t+d.angularAxis.ticksSuffix}).style(N);d.angularAxis.rewriteTicks&&$.text(function(t,e){return e%(d.minorTicks+1)!=0?"":d.angularAxis.rewriteTicks(this.textContent,e)});var Q=n.max(I.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));R.attr({transform:"translate("+[x+Q,d.margin.top]+")"});var K=t.select("g.geometry-group").selectAll("g").size()>0,tt=t.select("g.geometry-group").selectAll("g.geometry").data(p);if(tt.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),tt.exit().remove(),p[0]||K){var et=[];p.forEach(function(t,e){var n={};n.radialScale=r,n.angularScale=l,n.container=tt.filter(function(t,r){return r==e}),n.geometry=t.geometry,n.orientation=d.orientation,n.direction=d.direction,n.index=e,et.push({data:t,geometryConfig:n})});var rt=n.nest().key(function(t,e){return"undefined"!=typeof t.data.groupId||"unstacked"}).entries(et),nt=[];rt.forEach(function(t,e){"unstacked"===t.key?nt=nt.concat(t.values.map(function(t,e){return[t]})):nt.push(t.values)}),nt.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return a(o[r].defaultConfig(),t)});o[r]().config(n)()})}var at,it,ot=t.select(".guides-group"),lt=t.select(".tooltips-group"),st=o.tooltipPanel().config({container:lt,fontSize:8})(),ct=o.tooltipPanel().config({container:lt,fontSize:8})(),ut=o.tooltipPanel().config({container:lt,hasTick:!0})();if(!T){var ft=ot.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});I.on("mousemove.angular-guide",function(t,e){var r=o.util.getMousePos(Z).angle;ft.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-d.orientation)%360;at=l.invert(n);var a=o.util.convertToCartesian(x+12,r+180);st.text(o.util.round(at)).move([a[0]+_[0],a[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){ot.select("line").style({opacity:0})})}var dt=ot.select("circle").style({stroke:"grey",fill:"none"});I.on("mousemove.radial-guide",function(t,e){var n=o.util.getMousePos(Z).radius;dt.attr({r:n}).style({opacity:.5}),it=r.invert(o.util.getMousePos(Z).radius);var a=o.util.convertToCartesian(n,d.radialAxis.orientation);ct.text(o.util.round(it)).move([a[0]+_[0],a[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){dt.style({opacity:0}),ut.hide(),st.hide(),ct.hide()}),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(e,r){var a=n.select(this),i=this.style.fill,l="black",s=this.style.opacity||1;if(a.attr({"data-opacity":s}),i&&"none"!==i){a.attr({"data-fill":i}),l=n.hsl(i).darker().toString(),a.style({fill:l,opacity:1});var c={t:o.util.round(e[0]),r:o.util.round(e[1])};T&&(c.t=w[e[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),d=t.node().getBoundingClientRect(),p=[f.left+f.width/2-H[0]-d.left,f.top+f.height/2-H[1]-d.top];ut.config({color:l}).text(u),ut.move(p)}else i=this.style.stroke||"black",a.attr({"data-stroke":i}),l=n.hsl(i).darker().toString(),a.style({stroke:l,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ut.show()}).on("mouseout.tooltip",function(t,e){ut.hide();var r=n.select(this),a=r.attr("data-fill");a?r.style({fill:a,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})})}(c),this},d.config=function(t){if(!arguments.length)return s;var e=o.util.cloneJson(t);return e.data.forEach(function(t,e){s.data[e]||(s.data[e]={}),a(s.data[e],o.Axis.defaultConfig().data[0]),a(s.data[e],t)}),a(s.layout,o.Axis.defaultConfig().layout),a(s.layout,e.layout),this},d.getLiveConfig=function(){return u},d.getinputConfig=function(){return c},d.radialScale=function(t){return r},d.angularScale=function(t){return l},d.svg=function(){return t},n.rebind(d,f,"on"),d},o.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},o.util._extend=function(t,e){for(var r in t)e[r]=t[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180;return[e,t(n)]})},o.util.dataFromEquation=function(t,e,r){var a=e||6,i=[],o=[];n.range(0,360+a,a).forEach(function(e,r){var n=e*Math.PI/180,a=t(n);i.push(e),o.push(a)});var l={t:i,r:o};return r&&(l.name=r),l},o.util.ensureArray=function(t,e){if("undefined"==typeof t)return null;var r=[].concat(t);return n.range(e).map(function(t,e){return r[e]||r[0]})},o.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=o.util.ensureArray(t[e],r)}),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},o.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},o.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},o.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},o.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],a=e[1],i={};return i.x=r,i.y=a,i.pos=e,i.angle=180*(Math.atan2(a,r)+Math.PI)/Math.PI,i.radius=Math.sqrt(r*r+a*a),i},o.util.duplicatesCount=function(t){for(var e,r={},n={},a=0,i=t.length;a<i;a++)(e=t[a])in r?(r[e]++,n[e]=r[e]):r[e]=1;return n},o.util.duplicates=function(t){return Object.keys(o.util.duplicatesCount(t))},o.util.translator=function(t,e,r,n){if(n){var a=r.slice();r=e,e=a}var i=e.reduce(function(t,e){if("undefined"!=typeof t)return t[e]},t);"undefined"!=typeof i&&(e.reduce(function(t,r,n){if("undefined"!=typeof t)return n===e.length-1&&delete t[r],t[r]},t),r.reduce(function(t,e,n){return"undefined"==typeof t[e]&&(t[e]={}),n===r.length-1&&(t[e]=i),t[e]},t))},o.PolyChart=function(){var t=[o.PolyChart.defaultConfig()],e=n.dispatch("hover"),r={solid:"none",dash:[5,2],dot:[2,5]};function i(){var e=t[0].geometryConfig,a=e.container;"string"==typeof a&&(a=n.select(a)),a.datum(t).each(function(t,a){var i=!!t[0].data.yStack,o=t.map(function(t,e){return i?n.zip(t.data.t[0],t.data.r[0],t.data.yStack[0]):n.zip(t.data.t[0],t.data.r[0])}),l=e.angularScale,s=e.radialScale.domain()[0],c={bar:function(r,a,i){var o=t[i].data,s=e.radialScale(r[1])-e.radialScale(0),c=e.radialScale(r[2]||0),u=o.barWidth;n.select(this).attr({class:"mark bar",d:"M"+[[s+c,-u/2],[s+c,u/2],[c,u/2],[c,-u/2]].join("L")+"Z",transform:function(t,r){return"rotate("+(e.orientation+l(t[0]))+")"}})}};c.dot=function(r,a,i){var o=r[2]?[r[0],r[1]+r[2]]:r,l=n.svg.symbol().size(t[i].data.dotSize).type(t[i].data.dotType)(r,a);n.select(this).attr({class:"mark dot",d:l,transform:function(t,r){var n,a,i,l=(n=function(t,r){var n=e.radialScale(t[1]),a=(e.angularScale(t[0])+e.orientation)*Math.PI/180;return{r:n,t:a}}(o),a=n.r*Math.cos(n.t),i=n.r*Math.sin(n.t),{x:a,y:i});return"translate("+[l.x,l.y]+")"}})};var u=n.svg.line.radial().interpolate(t[0].data.lineInterpolation).radius(function(t){return e.radialScale(t[1])}).angle(function(t){return e.angularScale(t[0])*Math.PI/180});c.line=function(r,a,i){var l=r[2]?o[i].map(function(t,e){return[t[0],t[1]+t[2]]}):o[i];if(n.select(this).each(c.dot).style({opacity:function(e,r){return+t[i].data.dotVisible},fill:h.stroke(r,a,i)}).attr({class:"mark dot"}),!(a>0)){var s=n.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({class:"line",d:u(l),transform:function(t,r){return"rotate("+(e.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return h.fill(r,a,i)},"fill-opacity":0,stroke:function(t,e){return h.stroke(r,a,i)},"stroke-width":function(t,e){return h["stroke-width"](r,a,i)},"stroke-dasharray":function(t,e){return h["stroke-dasharray"](r,a,i)},opacity:function(t,e){return h.opacity(r,a,i)},display:function(t,e){return h.display(r,a,i)}})}};var f=e.angularScale.range(),d=Math.abs(f[1]-f[0])/o[0].length*Math.PI/180,p=n.svg.arc().startAngle(function(t){return-d/2}).endAngle(function(t){return d/2}).innerRadius(function(t){return e.radialScale(s+(t[2]||0))}).outerRadius(function(t){return e.radialScale(s+(t[2]||0))+e.radialScale(t[1])});c.arc=function(t,r,a){n.select(this).attr({class:"mark arc",d:p,transform:function(t,r){return"rotate("+(e.orientation+l(t[0])+90)+")"}})};var h={fill:function(e,r,n){return t[n].data.color},stroke:function(e,r,n){return t[n].data.strokeColor},"stroke-width":function(e,r,n){return t[n].data.strokeSize+"px"},"stroke-dasharray":function(e,n,a){return r[t[a].data.strokeDash]},opacity:function(e,r,n){return t[n].data.opacity},display:function(e,r,n){return"undefined"==typeof t[n].data.visible||t[n].data.visible?"block":"none"}},g=n.select(this).selectAll("g.layer").data(o);g.enter().append("g").attr({class:"layer"});var v=g.selectAll("path.mark").data(function(t,e){return t});v.enter().append("path").attr({class:"mark"}),v.style(h).each(c[e.geometryType]),v.exit().remove(),g.exit().remove()})}return i.config=function(e){return arguments.length?(e.forEach(function(e,r){t[r]||(t[r]={}),a(t[r],o.PolyChart.defaultConfig()),a(t[r],e)}),this):t},i.getColorScale=function(){},n.rebind(i,e,"on"),i},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){var t=o.Legend.defaultConfig(),e=n.dispatch("hover");function r(){var e=t.legendConfig,i=t.data.map(function(t,r){return[].concat(t).map(function(t,n){var i=a({},e.elements[r]);return i.name=t,i.color=[].concat(e.elements[r].color)[n],i})}),o=n.merge(i);o=o.filter(function(t,r){return e.elements[r]&&(e.elements[r].visibleInLegend||"undefined"==typeof e.elements[r].visibleInLegend)}),e.reverseOrder&&(o=o.reverse());var l=e.container;("string"==typeof l||l.nodeName)&&(l=n.select(l));var s=o.map(function(t,e){return t.color}),c=e.fontSize,u=null==e.isContinuous?"number"==typeof o[0]:e.isContinuous,f=u?e.height:c*o.length,d=l.classed("legend-group",!0).selectAll("svg").data([0]),p=d.enter().append("svg").attr({width:300,height:f+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var h=n.range(o.length),g=n.scale[u?"linear":"ordinal"]().domain(h).range(s),v=n.scale[u?"linear":"ordinal"]().domain(h)[u?"range":"rangePoints"]([0,f]);if(u){var y=d.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(s);y.enter().append("stop"),y.attr({offset:function(t,e){return e/(s.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),d.append("rect").classed("legend-mark",!0).attr({height:e.height,width:e.colorBandWidth,fill:"url(#grad1)"})}else{var m=d.select(".legend-marks").selectAll("path.legend-mark").data(o);m.enter().append("path").classed("legend-mark",!0),m.attr({transform:function(t,e){return"translate("+[c/2,v(e)+c/2]+")"},d:function(t,e){var r,a,i,o=t.symbol;return i=3*(a=c),"line"===(r=o)?"M"+[[-a/2,-a/12],[a/2,-a/12],[a/2,a/12],[-a/2,a/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(r)?n.svg.symbol().type(r).size(i)():n.svg.symbol().type("square").size(i)()},fill:function(t,e){return g(e)}}),m.exit().remove()}var x=n.svg.axis().scale(v).orient("right"),b=d.select("g.legend-axis").attr({transform:"translate("+[u?e.colorBandWidth:c,c/2]+")"}).call(x);return b.selectAll(".domain").style({fill:"none",stroke:"none"}),b.selectAll("line").style({fill:"none",stroke:u?e.textColor:"none"}),b.selectAll("text").style({fill:e.textColor,"font-size":e.fontSize}).text(function(t,e){return o[e].name}),r}return r.config=function(e){return arguments.length?(a(t,e),this):t},n.rebind(r,e,"on"),r},o.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var t,e,r,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},l="tooltip-"+o.tooltipPanel.uid++,s=10,c=function(){var n=(t=i.container.selectAll("g."+l).data([0])).enter().append("g").classed(l,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:i.padding+s,dy:.3*+i.fontSize}),c};return c.text=function(a){var o=n.hsl(i.color).l,l=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",f=a||"";e.style({fill:u,"font-size":i.fontSize+"px"}).text(f);var d=i.padding,p=e.node().getBBox(),h={fill:i.color,stroke:l,"stroke-width":"2px"},g=p.width+2*d+s,v=p.height+2*d;return r.attr({d:"M"+[[s,-v/2],[s,-v/4],[i.hasTick?0:s,0],[s,v/4],[s,v/2],[g,v/2],[g,-v/2]].join("L")+"Z"}).style(h),t.attr({transform:"translate("+[s,-v/2+2*d]+")"}),t.style({display:"block"}),c},c.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),c},c.hide=function(){if(t)return t.style({display:"none"}),c},c.show=function(){if(t)return t.style({display:"block"}),c},c.config=function(t){return a(i,t),c},c},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={convert:function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=a({},t);return[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]].forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var i=o.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=i.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)})}if(t.layout){var l=a({},t.layout);if([[l,["plot_bgcolor"],["backgroundColor"]],[l,["showlegend"],["showLegend"]],[l,["radialaxis"],["radialAxis"]],[l,["angularaxis"],["angularAxis"]],[l.angularaxis,["showline"],["gridLinesVisible"]],[l.angularaxis,["showticklabels"],["labelsVisible"]],[l.angularaxis,["nticks"],["ticksCount"]],[l.angularaxis,["tickorientation"],["tickOrientation"]],[l.angularaxis,["ticksuffix"],["ticksSuffix"]],[l.angularaxis,["range"],["domain"]],[l.angularaxis,["endpadding"],["endPadding"]],[l.radialaxis,["showline"],["gridLinesVisible"]],[l.radialaxis,["tickorientation"],["tickOrientation"]],[l.radialaxis,["ticksuffix"],["ticksSuffix"]],[l.radialaxis,["range"],["domain"]],[l.angularAxis,["showline"],["gridLinesVisible"]],[l.angularAxis,["showticklabels"],["labelsVisible"]],[l.angularAxis,["nticks"],["ticksCount"]],[l.angularAxis,["tickorientation"],["tickOrientation"]],[l.angularAxis,["ticksuffix"],["ticksSuffix"]],[l.angularAxis,["range"],["domain"]],[l.angularAxis,["endpadding"],["endPadding"]],[l.radialAxis,["showline"],["gridLinesVisible"]],[l.radialAxis,["tickorientation"],["tickOrientation"]],[l.radialAxis,["ticksuffix"],["ticksSuffix"]],[l.radialAxis,["range"],["domain"]],[l.font,["outlinecolor"],["outlineColor"]],[l.legend,["traceorder"],["reverseOrder"]],[l,["labeloffset"],["labelOffset"]],[l,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e?("undefined"!=typeof l.tickLength&&(l.angularaxis.ticklen=l.tickLength,delete l.tickLength),l.tickColor&&(l.angularaxis.tickcolor=l.tickColor,delete l.tickColor)):(l.angularAxis&&"undefined"!=typeof l.angularAxis.ticklen&&(l.tickLength=l.angularAxis.ticklen),l.angularAxis&&"undefined"!=typeof l.angularAxis.tickcolor&&(l.tickColor=l.angularAxis.tickcolor)),l.legend&&"boolean"!=typeof l.legend.reverseOrder&&(l.legend.reverseOrder="normal"!=l.legend.reverseOrder),l.legend&&"boolean"==typeof l.legend.traceorder&&(l.legend.traceorder=l.legend.traceorder?"reversed":"normal",delete l.legend.reverseOrder),l.margin&&"undefined"!=typeof l.margin.t){var s=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(l.margin).forEach(function(t,e){u[c[s.indexOf(t.key)]]=t.value}),l.margin=u}e&&(delete l.needsEndSpacing,delete l.minorTickColor,delete l.minorTicks,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksStep,delete l.angularaxis.rewriteTicks,delete l.angularaxis.nticks,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksStep,delete l.radialaxis.rewriteTicks,delete l.radialaxis.nticks),r.layout=l}return r}};return t}},{"../../../constants/alignment":146,"../../../lib":168,d3:16}],250:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../../lib"),i=t("../../../components/color"),o=t("./micropolar"),l=t("./undo_manager"),s=a.extendDeepAll,c=e.exports={};c.framework=function(t){var e,r,a,i,u,f=new l;function d(r,l){return l&&(u=l),n.select(n.select(u).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),e=e?s(e,r):r,a||(a=o.Axis()),i=o.adapter.plotly().convert(e),a.config(i).render(u),t.data=e.data,t.layout=e.layout,c.fillLayout(t),e}return d.isPolar=!0,d.svg=function(){return a.svg()},d.getConfig=function(){return e},d.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},d.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},d.setUndoPoint=function(){var t,n,a=this,i=o.util.cloneJson(e);t=i,n=r,f.add({undo:function(){n&&a(n)},redo:function(){a(t)}}),r=o.util.cloneJson(i)},d.undo=function(){f.undo()},d.redo=function(){f.redo()},d},c.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),a=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:i.background,_container:e,_paperdiv:r,_paper:a};t._fullLayout=s(o,t.layout)}},{"../../../components/color":51,"../../../lib":168,"./micropolar":249,"./undo_manager":251,d3:16}],251:[function(t,e,r){"use strict";e.exports=function(){var t,e=[],r=-1,n=!1;function a(t,e){return t?(n=!0,t[e](),n=!1,this):this}return{add:function(t){return n?this:(e.splice(r+1,e.length-r),e.push(t),r=e.length-1,this)},setCallback:function(e){t=e},undo:function(){var n=e[r];return n?(a(n,"undo"),r-=1,t&&t(n.undo),this):this},redo:function(){var n=e[r+1];return n?(a(n,"redo"),r+=1,t&&t(n.redo),this):this},clear:function(){e=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r<e.length-1},getCommands:function(){return e},getPreviousCommand:function(){return e[r-1]},getIndex:function(){return r}}}},{}],252:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plot_api/plot_template"),i=t("./domain").defaults;e.exports=function(t,e,r,o){var l,s,c=o.type,u=o.attributes,f=o.handleDefaults,d=o.partition||"x",p=e._subplots[c],h=p.length,g=h&&p[0].replace(/\d+$/,"");function v(t,e){return n.coerce(l,s,u,t,e)}for(var y=0;y<h;y++){var m=p[y];l=t[m]?t[m]:t[m]={},s=a.newContainer(e,m,g),v("uirevision",e.uirevision);var x={};x[d]=[y/h,(y+1)/h],i(s,e,v,x),o.id=m,f(l,s,v,o)}}},{"../lib":168,"../plot_api/plot_template":202,"./domain":238}],253:[function(t,e,r){"use strict";var n=t("./ternary"),a=t("../../plots/get_data").getSubplotCalcData,i=t("../../lib").counterRegex;r.name="ternary";var o=r.attr="subplot";r.idRoot="ternary",r.idRegex=r.attrRegex=i("ternary"),(r.attributes={})[o]={valType:"subplotid",dflt:"ternary",editType:"calc"},r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.plot=function(t){for(var e=t._fullLayout,r=t.calcdata,i=e._subplots.ternary,o=0;o<i.length;o++){var l=i[o],s=a(r,"ternary",l),c=e[l]._subplot;c||(c=new n({id:l,graphDiv:t,container:e._ternarylayer.node()},e),e[l]._subplot=c),c.plot(s,e,t._promises)}},r.clean=function(t,e,r,n){for(var a=n._subplots.ternary||[],i=0;i<a.length;i++){var o=a[i],l=n[o]._subplot;!e[o]&&l&&(l.plotContainer.remove(),l.clipDef.remove(),l.clipDefRelative.remove(),l.layers["a-title"].remove(),l.layers["b-title"].remove(),l.layers["c-title"].remove())}}},{"../../lib":168,"../../plots/get_data":241,"./layout_attributes":254,"./layout_defaults":255,"./ternary":256}],254:[function(t,e,r){"use strict";var n=t("../../components/color/attributes"),a=t("../domain").attributes,i=t("../cartesian/layout_attributes"),o=t("../../plot_api/edit_types").overrideAll,l=t("../../lib/extend").extendFlat,s={title:i.title,color:i.color,tickmode:i.tickmode,nticks:l({},i.nticks,{dflt:6,min:1}),tick0:i.tick0,dtick:i.dtick,tickvals:i.tickvals,ticktext:i.ticktext,ticks:i.ticks,ticklen:i.ticklen,tickwidth:i.tickwidth,tickcolor:i.tickcolor,showticklabels:i.showticklabels,showtickprefix:i.showtickprefix,tickprefix:i.tickprefix,showticksuffix:i.showticksuffix,ticksuffix:i.ticksuffix,showexponent:i.showexponent,exponentformat:i.exponentformat,separatethousands:i.separatethousands,tickfont:i.tickfont,tickangle:i.tickangle,tickformat:i.tickformat,tickformatstops:i.tickformatstops,hoverformat:i.hoverformat,showline:l({},i.showline,{dflt:!0}),linecolor:i.linecolor,linewidth:i.linewidth,showgrid:l({},i.showgrid,{dflt:!0}),gridcolor:i.gridcolor,gridwidth:i.gridwidth,layer:i.layer,min:{valType:"number",dflt:0,min:0},_deprecated:{title:i._deprecated.title,titlefont:i._deprecated.titlefont}},c=e.exports=o({domain:a({name:"ternary"}),bgcolor:{valType:"color",dflt:n.background},sum:{valType:"number",dflt:1,min:0},aaxis:s,baxis:s,caxis:s},"plot","from-root");c.uirevision={valType:"any",editType:"none"},c.aaxis.uirevision=c.baxis.uirevision=c.caxis.uirevision={valType:"any",editType:"none"}},{"../../components/color/attributes":50,"../../lib/extend":162,"../../plot_api/edit_types":195,"../cartesian/layout_attributes":225,"../domain":238}],255:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../plot_api/plot_template"),i=t("../../lib"),o=t("../subplot_defaults"),l=t("../cartesian/tick_label_defaults"),s=t("../cartesian/tick_mark_defaults"),c=t("../cartesian/tick_value_defaults"),u=t("../cartesian/line_grid_defaults"),f=t("./layout_attributes"),d=["aaxis","baxis","caxis"];function p(t,e,r,i){var o,l,s,c=r("bgcolor"),u=r("sum");i.bgColor=n.combine(c,i.paper_bgcolor);for(var f=0;f<d.length;f++)l=t[o=d[f]]||{},(s=a.newContainer(e,o))._name=o,h(l,s,i,e);var p=e.aaxis,g=e.baxis,v=e.caxis;p.min+g.min+v.min>=u&&(p.min=0,g.min=0,v.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}function h(t,e,r,n){var a=f[e._name];function o(r,n){return i.coerce(t,e,a,r,n)}o("uirevision",n.uirevision),e.type="linear";var d=o("color"),p=d!==a.color.dflt?d:r.font.color,h=e._name.charAt(0).toUpperCase(),g="Component "+h,v=o("title.text",g);e._hovertitle=v===g?v:h,i.coerceFont(o,"title.font",{family:r.font.family,size:Math.round(1.2*r.font.size),color:p}),o("min"),c(t,e,o,"linear"),l(t,e,o,"linear",{}),s(t,e,o,{outerTicks:!0}),o("showticklabels")&&(i.coerceFont(o,"tickfont",{family:r.font.family,size:r.font.size,color:p}),o("tickangle"),o("tickformat")),u(t,e,o,{dfltColor:d,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:a}),o("hoverformat"),o("layer")}e.exports=function(t,e,r){o(t,e,r,{type:"ternary",attributes:f,handleDefaults:p,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../components/color":51,"../../lib":168,"../../plot_api/plot_template":202,"../cartesian/line_grid_defaults":227,"../cartesian/tick_label_defaults":232,"../cartesian/tick_mark_defaults":233,"../cartesian/tick_value_defaults":234,"../subplot_defaults":252,"./layout_attributes":254}],256:[function(t,e,r){"use strict";var n=t("d3"),a=t("tinycolor2"),i=t("../../registry"),o=t("../../lib"),l=o._,s=t("../../components/color"),c=t("../../components/drawing"),u=t("../cartesian/set_convert"),f=t("../../lib/extend").extendFlat,d=t("../plots"),p=t("../cartesian/axes"),h=t("../../components/dragelement"),g=t("../../components/fx"),v=t("../../components/titles"),y=t("../cartesian/select").prepSelect,m=t("../cartesian/select").selectOnClick,x=t("../cartesian/select").clearSelect,b=t("../cartesian/constants");function _(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework(e),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}e.exports=_;var w=_.prototype;w.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},w.plot=function(t,e){var r=e[this.id],n=e._size;this._hasClipOnAxisFalse=!1;for(var a=0;a<t.length;a++){if(!1===t[a][0].trace.cliponaxis){this._hasClipOnAxisFalse=!0;break}}this.updateLayers(r),this.adjustLayout(r,n),d.generalUpdatePerTraceModule(this.graphDiv,this,t,r),this.layers.plotbg.select("path").call(s.fill,r.bgcolor)},w.makeFramework=function(t){var e=this.graphDiv,r=t[this.id],n=this.clipId="clip"+this.layoutId+this.id,a=this.clipIdRelative="clip-relative"+this.layoutId+this.id;this.clipDef=o.ensureSingleById(t._clips,"clipPath",n,function(t){t.append("path").attr("d","M0,0Z")}),this.clipDefRelative=o.ensureSingleById(t._clips,"clipPath",a,function(t){t.append("path").attr("d","M0,0Z")}),this.plotContainer=o.ensureSingle(this.container,"g",this.id),this.updateLayers(r),c.setClipUrl(this.layers.backplot,n,e),c.setClipUrl(this.layers.grids,n,e)},w.updateLayers=function(t){var e=this.layers,r=["draglayer","plotbg","backplot","grids"];"below traces"===t.aaxis.layer&&r.push("aaxis","aline"),"below traces"===t.baxis.layer&&r.push("baxis","bline"),"below traces"===t.caxis.layer&&r.push("caxis","cline"),r.push("frontplot"),"above traces"===t.aaxis.layer&&r.push("aaxis","aline"),"above traces"===t.baxis.layer&&r.push("baxis","bline"),"above traces"===t.caxis.layer&&r.push("caxis","cline");var a=this.plotContainer.selectAll("g.toplevel").data(r,String),i=["agrid","bgrid","cgrid"];a.enter().append("g").attr("class",function(t){return"toplevel "+t}).each(function(t){var r=n.select(this);e[t]=r,"frontplot"===t?r.append("g").classed("scatterlayer",!0):"backplot"===t?r.append("g").classed("maplayer",!0):"plotbg"===t?r.append("path").attr("d","M0,0Z"):"aline"===t||"bline"===t||"cline"===t?r.append("path"):"grids"===t&&i.forEach(function(t){e[t]=r.append("g").classed("grid "+t,!0)})}),a.order()};var k=Math.sqrt(4/3);w.adjustLayout=function(t,e){var r,n,a,i,o,l,d=this,p=t.domain,h=(p.x[0]+p.x[1])/2,g=(p.y[0]+p.y[1])/2,v=p.x[1]-p.x[0],y=p.y[1]-p.y[0],m=v*e.w,x=y*e.h,b=t.sum,_=t.aaxis.min,w=t.baxis.min,T=t.caxis.min;m>k*x?a=(i=x)*k:i=(a=m)/k,o=v*a/m,l=y*i/x,r=e.l+e.w*h-a/2,n=e.t+e.h*(1-g)-i/2,d.x0=r,d.y0=n,d.w=a,d.h=i,d.sum=b,d.xaxis={type:"linear",range:[_+2*T-b,b-_-2*w],domain:[h-o/2,h+o/2],_id:"x"},u(d.xaxis,d.graphDiv._fullLayout),d.xaxis.setScale(),d.xaxis.isPtWithinRange=function(t){return t.a>=d.aaxis.range[0]&&t.a<=d.aaxis.range[1]&&t.b>=d.baxis.range[1]&&t.b<=d.baxis.range[0]&&t.c>=d.caxis.range[1]&&t.c<=d.caxis.range[0]},d.yaxis={type:"linear",range:[_,b-w-T],domain:[g-l/2,g+l/2],_id:"y"},u(d.yaxis,d.graphDiv._fullLayout),d.yaxis.setScale(),d.yaxis.isPtWithinRange=function(){return!0};var M=d.yaxis.domain[0],A=d.aaxis=f({},t.aaxis,{range:[_,b-w-T],side:"left",tickangle:(+t.aaxis.tickangle||0)-30,domain:[M,M+l*k],anchor:"free",position:0,_id:"y",_length:a});u(A,d.graphDiv._fullLayout),A.setScale();var L=d.baxis=f({},t.baxis,{range:[b-_-T,w],side:"bottom",domain:d.xaxis.domain,anchor:"free",position:0,_id:"x",_length:a});u(L,d.graphDiv._fullLayout),L.setScale();var S=d.caxis=f({},t.caxis,{range:[b-_-w,T],side:"right",tickangle:(+t.caxis.tickangle||0)+30,domain:[M,M+l*k],anchor:"free",position:0,_id:"y",_length:a});u(S,d.graphDiv._fullLayout),S.setScale();var C="M"+r+","+(n+i)+"h"+a+"l-"+a/2+",-"+i+"Z";d.clipDef.select("path").attr("d",C),d.layers.plotbg.select("path").attr("d",C);var O="M0,"+i+"h"+a+"l-"+a/2+",-"+i+"Z";d.clipDefRelative.select("path").attr("d",O);var z="translate("+r+","+n+")";d.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",z),d.clipDefRelative.select("path").attr("transform",null);var D="translate("+(r-L._offset)+","+(n+i)+")";d.layers.baxis.attr("transform",D),d.layers.bgrid.attr("transform",D);var P="translate("+(r+a/2)+","+n+")rotate(30)translate(0,"+-A._offset+")";d.layers.aaxis.attr("transform",P),d.layers.agrid.attr("transform",P);var E="translate("+(r+a/2)+","+n+")rotate(-30)translate(0,"+-S._offset+")";d.layers.caxis.attr("transform",E),d.layers.cgrid.attr("transform",E),d.drawAxes(!0),d.layers.aline.select("path").attr("d",A.showline?"M"+r+","+(n+i)+"l"+a/2+",-"+i:"M0,0").call(s.stroke,A.linecolor||"#000").style("stroke-width",(A.linewidth||0)+"px"),d.layers.bline.select("path").attr("d",L.showline?"M"+r+","+(n+i)+"h"+a:"M0,0").call(s.stroke,L.linecolor||"#000").style("stroke-width",(L.linewidth||0)+"px"),d.layers.cline.select("path").attr("d",S.showline?"M"+(r+a/2)+","+n+"l"+a/2+","+i:"M0,0").call(s.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),d.graphDiv._context.staticPlot||d.initInteractions(),c.setClipUrl(d.layers.frontplot,d._hasClipOnAxisFalse?null:d.clipId,d.graphDiv)},w.drawAxes=function(t){var e=this.graphDiv,r=this.id.substr(7)+"title",n=this.layers,a=this.aaxis,i=this.baxis,o=this.caxis;if(this.drawAx(a),this.drawAx(i),this.drawAx(o),t){var s=Math.max(a.showticklabels?a.tickfont.size/2:0,(o.showticklabels?.75*o.tickfont.size:0)+("outside"===o.ticks?.87*o.ticklen:0)),c=(i.showticklabels?i.tickfont.size:0)+("outside"===i.ticks?i.ticklen:0)+3;n["a-title"]=v.draw(e,"a"+r,{propContainer:a,propName:this.id+".aaxis.title",placeholder:l(e,"Click to enter Component A title"),attributes:{x:this.x0+this.w/2,y:this.y0-a.title.font.size/3-s,"text-anchor":"middle"}}),n["b-title"]=v.draw(e,"b"+r,{propContainer:i,propName:this.id+".baxis.title",placeholder:l(e,"Click to enter Component B title"),attributes:{x:this.x0-c,y:this.y0+this.h+.83*i.title.font.size+c,"text-anchor":"middle"}}),n["c-title"]=v.draw(e,"c"+r,{propContainer:o,propName:this.id+".caxis.title",placeholder:l(e,"Click to enter Component C title"),attributes:{x:this.x0+this.w+c,y:this.y0+this.h+.83*o.title.font.size+c,"text-anchor":"middle"}})}},w.drawAx=function(t){var e,r=this.graphDiv,n=t._name,a=n.charAt(0),i=t._id,l=this.layers[n],s=a+"tickLayout",c=(e=t).ticks+String(e.ticklen)+String(e.showticklabels);this[s]!==c&&(l.selectAll("."+i+"tick").remove(),this[s]=c),t.setScale();var u=p.calcTicks(t),f=p.clipEnds(t,u),d=p.makeTransFn(t),h=p.getTickSigns(t)[2],g=o.deg2rad(30),v=h*(t.linewidth||1)/2,y=h*t.ticklen,m=this.w,x=this.h,b="b"===a?"M0,"+v+"l"+Math.sin(g)*y+","+Math.cos(g)*y:"M"+v+",0l"+Math.cos(g)*y+","+-Math.sin(g)*y,_={a:"M0,0l"+x+",-"+m/2,b:"M0,0l-"+m/2+",-"+x,c:"M0,0l-"+x+","+m/2}[a];p.drawTicks(r,t,{vals:"inside"===t.ticks?f:u,layer:l,path:b,transFn:d,crisp:!1}),p.drawGrid(r,t,{vals:f,layer:this.layers[a+"grid"],path:_,transFn:d,crisp:!1});var w=p.makeLabelFns(t,0,30);p.drawLabels(r,t,{vals:u,layer:l,transFn:d,labelXFn:w.labelXFn,labelYFn:w.labelYFn,labelAnchorFn:w.labelAnchorFn})};var T=b.MINZOOM/2+.87,M="m-0.87,.5h"+T+"v3h-"+(T+5.2)+"l"+(T/2+2.6)+",-"+(.87*T+4.5)+"l2.6,1.5l-"+T/2+","+.87*T+"Z",A="m0.87,.5h-"+T+"v3h"+(T+5.2)+"l-"+(T/2+2.6)+",-"+(.87*T+4.5)+"l-2.6,1.5l"+T/2+","+.87*T+"Z",L="m0,1l"+T/2+","+.87*T+"l2.6,-1.5l-"+(T/2+2.6)+",-"+(.87*T+4.5)+"l-"+(T/2+2.6)+","+(.87*T+4.5)+"l2.6,1.5l"+T/2+",-"+.87*T+"Z",S="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",C=!0;function O(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}w.initInteractions=function(){var t,e,r,n,u,f,d,p,v,_,w=this,T=w.layers.plotbg.select("path").node(),z=w.graphDiv,D=z._fullLayout._zoomlayer,P={element:T,gd:z,plotinfo:{id:w.id,xaxis:w.xaxis,yaxis:w.yaxis},subplot:w.id,prepFn:function(i,o,l){P.xaxes=[w.xaxis],P.yaxes=[w.yaxis];var c=z._fullLayout.dragmode;P.minDrag="lasso"===c?1:void 0,"zoom"===c?(P.moveFn=B,P.clickFn=R,P.doneFn=j,function(i,o,l){var c=T.getBoundingClientRect();t=o-c.left,e=l-c.top,r={a:w.aaxis.range[0],b:w.baxis.range[1],c:w.caxis.range[1]},u=r,n=w.aaxis.range[1]-r.a,f=a(w.graphDiv._fullLayout[w.id].bgcolor).getLuminance(),d="M0,"+w.h+"L"+w.w/2+", 0L"+w.w+","+w.h+"Z",p=!1,v=D.append("path").attr("class","zoombox").attr("transform","translate("+w.x0+", "+w.y0+")").style({fill:f>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",d),_=D.append("path").attr("class","zoombox-corners").attr("transform","translate("+w.x0+", "+w.y0+")").style({fill:s.background,stroke:s.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),x(D)}(0,o,l)):"pan"===c?(P.moveFn=H,P.clickFn=R,P.doneFn=q,r={a:w.aaxis.range[0],b:w.baxis.range[1],c:w.caxis.range[1]},u=r,x(D)):"select"!==c&&"lasso"!==c||y(i,o,l,P,c)}};function E(t){var e={};return e[w.id+".aaxis.min"]=t.a,e[w.id+".baxis.min"]=t.b,e[w.id+".caxis.min"]=t.c,e}function R(t,e){var r=z._fullLayout.clickmode;O(z),2===t&&(z.emit("plotly_doubleclick",null),i.call("_guiRelayout",z,E({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===t&&m(e,z,[w.xaxis],[w.yaxis],w.id,P),r.indexOf("event")>-1&&g.click(z,e,w.id)}function I(t,e){return 1-e/w.h}function F(t,e){return 1-(t+(w.h-e)/Math.sqrt(3))/w.w}function N(t,e){return(t-(w.h-e)/Math.sqrt(3))/w.w}function B(a,i){var o=t+a,l=e+i,s=Math.max(0,Math.min(1,I(0,e),I(0,l))),c=Math.max(0,Math.min(1,F(t,e),F(o,l))),h=Math.max(0,Math.min(1,N(t,e),N(o,l))),g=(s/2+h)*w.w,y=(1-s/2-c)*w.w,m=(g+y)/2,x=y-g,T=(1-s)*w.h,C=T-x/k;x<b.MINZOOM?(u=r,v.attr("d",d),_.attr("d","M0,0Z")):(u={a:r.a+s*n,b:r.b+c*n,c:r.c+h*n},v.attr("d",d+"M"+g+","+T+"H"+y+"L"+m+","+C+"L"+g+","+T+"Z"),_.attr("d","M"+t+","+e+S+"M"+g+","+T+M+"M"+y+","+T+A+"M"+m+","+C+L)),p||(v.transition().style("fill",f>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),_.transition().style("opacity",1).duration(200),p=!0)}function j(){O(z),u!==r&&(i.call("_guiRelayout",z,E(u)),C&&z.data&&z._context.showTips&&(o.notifier(l(z,"Double-click to zoom back out"),"long"),C=!1))}function H(t,e){var n=t/w.xaxis._m,a=e/w.yaxis._m,i=[(u={a:r.a-a,b:r.b+(n+a)/2,c:r.c-(n-a)/2}).a,u.b,u.c].sort(),o=i.indexOf(u.a),l=i.indexOf(u.b),s=i.indexOf(u.c);i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),u={a:i[o],b:i[l],c:i[s]},e=(r.a-u.a)*w.yaxis._m,t=(r.c-u.c-r.b+u.b)*w.xaxis._m);var f="translate("+(w.x0+t)+","+(w.y0+e)+")";w.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",f);var d="translate("+-t+","+-e+")";w.clipDefRelative.select("path").attr("transform",d),w.aaxis.range=[u.a,w.sum-u.b-u.c],w.baxis.range=[w.sum-u.a-u.c,u.b],w.caxis.range=[w.sum-u.a-u.b,u.c],w.drawAxes(!1),w._hasClipOnAxisFalse&&w.plotContainer.select(".scatterlayer").selectAll(".trace").call(c.hideOutsideRangePoints,w)}function q(){i.call("_guiRelayout",z,E(u))}T.onmousemove=function(t){g.hover(z,t,w.id),z._fullLayout._lasthover=T,z._fullLayout._hoversubplot=w.id},T.onmouseout=function(t){z._dragging||h.unhover(z,t)},h.init(P)}},{"../../components/color":51,"../../components/dragelement":69,"../../components/drawing":72,"../../components/fx":90,"../../components/titles":139,"../../lib":168,"../../lib/extend":162,"../../registry":257,"../cartesian/axes":212,"../cartesian/constants":218,"../cartesian/select":230,"../cartesian/set_convert":231,"../plots":245,d3:16,tinycolor2:34}],257:[function(t,e,r){"use strict";var n=t("./lib/loggers"),a=t("./lib/noop"),i=t("./lib/push_unique"),o=t("./lib/is_plain_object"),l=t("./lib/extend"),s=t("./plots/attributes"),c=t("./plots/layout_attributes"),u=l.extendFlat,f=l.extendDeepAll;function d(t){var e=t.name,a=t.categories,i=t.meta;if(r.modules[e])n.log("Type "+e+" already registered");else{r.subplotsRegistry[t.basePlotModule.name]||function(t){var e=t.name;if(r.subplotsRegistry[e])return void n.log("Plot type "+e+" already registered.");for(var a in v(t),r.subplotsRegistry[e]=t,r.componentsRegistry)x(a,t.name)}(t.basePlotModule);for(var o={},l=0;l<a.length;l++)o[a[l]]=!0,r.allCategories[a[l]]=!0;for(var s in r.modules[e]={_module:t,categories:o},i&&Object.keys(i).length&&(r.modules[e].meta=i),r.allTypes.push(e),r.componentsRegistry)y(s,e);t.layoutAttributes&&u(r.traceLayoutAttributes,t.layoutAttributes)}}function p(t){if("string"!=typeof t.name)throw new Error("Component module *name* must be a string.");var e=t.name;for(var n in r.componentsRegistry[e]=t,t.layoutAttributes&&(t.layoutAttributes._isLinkedToArray&&i(r.layoutArrayContainers,e),v(t)),r.modules)y(e,n);for(var a in r.subplotsRegistry)x(e,a);for(var o in r.transformsRegistry)m(e,o);t.schema&&t.schema.layout&&f(c,t.schema.layout)}function h(t){if("string"!=typeof t.name)throw new Error("Transform module *name* must be a string.");var e="Transform module "+t.name,a="function"==typeof t.transform,i="function"==typeof t.calcTransform;if(!a&&!i)throw new Error(e+" is missing a *transform* or *calcTransform* method.");for(var l in a&&i&&n.log([e+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),o(t.attributes)||n.log(e+" registered without an *attributes* object."),"function"!=typeof t.supplyDefaults&&n.log(e+" registered without a *supplyDefaults* method."),r.transformsRegistry[t.name]=t,r.componentsRegistry)m(l,t.name)}function g(t){var e=t.name,n=e.split("-")[0],a=t.dictionary,i=t.format,o=a&&Object.keys(a).length,l=i&&Object.keys(i).length,s=r.localeRegistry,c=s[e];if(c||(s[e]=c={}),n!==e){var u=s[n];u||(s[n]=u={}),o&&u.dictionary===c.dictionary&&(u.dictionary=a),l&&u.format===c.format&&(u.format=i)}o&&(c.dictionary=a),l&&(c.format=i)}function v(t){if(t.layoutAttributes){var e=t.layoutAttributes._arrayAttrRegexps;if(e)for(var n=0;n<e.length;n++)i(r.layoutArrayRegexes,e[n])}}function y(t,e){var n=r.componentsRegistry[t].schema;if(n&&n.traces){var a=n.traces[e];a&&f(r.modules[e]._module.attributes,a)}}function m(t,e){var n=r.componentsRegistry[t].schema;if(n&&n.transforms){var a=n.transforms[e];a&&f(r.transformsRegistry[e].attributes,a)}}function x(t,e){var n=r.componentsRegistry[t].schema;if(n&&n.subplots){var a=r.subplotsRegistry[e],i=a.layoutAttributes,o="subplot"===a.attr?a.name:a.attr;Array.isArray(o)&&(o=o[0]);var l=n.subplots[o];i&&l&&f(i,l)}}function b(t){return"object"==typeof t&&(t=t.type),t}r.modules={},r.allCategories={},r.allTypes=[],r.subplotsRegistry={},r.transformsRegistry={},r.componentsRegistry={},r.layoutArrayContainers=[],r.layoutArrayRegexes=[],r.traceLayoutAttributes={},r.localeRegistry={},r.apiMethodRegistry={},r.collectableSubplotTypes=null,r.register=function(t){if(r.collectableSubplotTypes=null,!t)throw new Error("No argument passed to Plotly.register.");t&&!Array.isArray(t)&&(t=[t]);for(var e=0;e<t.length;e++){var n=t[e];if(!n)throw new Error("Invalid module was attempted to be registered!");switch(n.moduleType){case"trace":d(n);break;case"transform":h(n);break;case"component":p(n);break;case"locale":g(n);break;case"apiMethod":var a=n.name;r.apiMethodRegistry[a]=n.fn;break;default:throw new Error("Invalid module was attempted to be registered!")}}},r.getModule=function(t){var e=r.modules[b(t)];return!!e&&e._module},r.traceIs=function(t,e){if("various"===(t=b(t)))return!1;var a=r.modules[t];return a||(t&&"area"!==t&&n.log("Unrecognized trace type "+t+"."),a=r.modules[s.type.dflt]),!!a.categories[e]},r.getTransformIndices=function(t,e){for(var r=[],n=t.transforms||[],a=0;a<n.length;a++)n[a].type===e&&r.push(a);return r},r.hasTransform=function(t,e){for(var r=t.transforms||[],n=0;n<r.length;n++)if(r[n].type===e)return!0;return!1},r.getComponentMethod=function(t,e){var n=r.componentsRegistry[t];return n&&n[e]||a},r.call=function(){var t=arguments[0],e=[].slice.call(arguments,1);return r.apiMethodRegistry[t].apply(null,e)}},{"./lib/extend":162,"./lib/is_plain_object":169,"./lib/loggers":172,"./lib/noop":177,"./lib/push_unique":181,"./plots/attributes":209,"./plots/layout_attributes":243}],258:[function(t,e,r){"use strict";var n=t("../lib"),a=n.extendFlat,i=n.extendDeep;function o(t){var e;switch(t){case"themes__thumb":e={autosize:!0,width:150,height:150,title:{text:""},showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":e={title:{text:""},hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:e={}}return e}e.exports=function(t,e){var r;t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var n,l=t.data,s=t.layout,c=i([],l),u=i({},s,o(e.tileClass)),f=t._context||{};if(e.width&&(u.width=e.width),e.height&&(u.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){u.annotations=[];var d=Object.keys(u);for(r=0;r<d.length;r++)n=d[r],["xaxis","yaxis","zaxis"].indexOf(n.slice(0,5))>-1&&(u[d[r]].title={text:""});for(r=0;r<c.length;r++){var p=c[r];p.showscale=!1,p.marker&&(p.marker.showscale=!1),"pie"===p.type&&(p.textposition="none")}}if(Array.isArray(e.annotations))for(r=0;r<e.annotations.length;r++)u.annotations.push(e.annotations[r]);var h=Object.keys(u).filter(function(t){return t.match(/^scene\d*$/)});if(h.length){var g={};for("thumbnail"===e.tileClass&&(g={title:{text:""},showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),r=0;r<h.length;r++){var v=u[h[r]];v.xaxis||(v.xaxis={}),v.yaxis||(v.yaxis={}),v.zaxis||(v.zaxis={}),a(v.xaxis,g),a(v.yaxis,g),a(v.zaxis,g),v._scene=null}}var y=document.createElement("div");e.tileClass&&(y.className=e.tileClass);var m={gd:y,td:y,layout:u,data:c,config:{staticPlot:void 0===e.staticPlot||e.staticPlot,plotGlPixelRatio:void 0===e.plotGlPixelRatio?2:e.plotGlPixelRatio,displaylogo:e.displaylogo||!1,showLink:e.showLink||!1,showTips:e.showTips||!1,mapboxAccessToken:f.mapboxAccessToken}};return"transparent"!==e.setBackground&&(m.config.setBackground=e.setBackground||"opaque"),m.gd.defaultLayout=o(e.tileClass),m}},{"../lib":168}],259:[function(t,e,r){"use strict";var n=t("../plot_api/to_image"),a=t("../lib"),i=t("./filesaver");e.exports=function(t,e){var r;return a.isPlainObject(t)||(r=a.getGraphDiv(t)),(e=e||{}).format=e.format||"png",new Promise(function(o,l){r&&r._snapshotInProgress&&l(new Error("Snapshotting already in progress.")),a.isIE()&&"svg"!==e.format&&l(new Error("Sorry IE does not support downloading from canvas. Try {format:'svg'} instead.")),r&&(r._snapshotInProgress=!0);var s=n(t,e),c=e.filename||t.fn||"newplot";c+="."+e.format,s.then(function(t){return r&&(r._snapshotInProgress=!1),i(t,c)}).then(function(t){o(t)}).catch(function(t){r&&(r._snapshotInProgress=!1),l(t)})})}},{"../lib":168,"../plot_api/to_image":205,"./filesaver":260}],260:[function(t,e,r){"use strict";e.exports=function(t,e){var r=document.createElement("a"),n="download"in r,a=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent);return new Promise(function(i,o){if("undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent)&&o(new Error("IE < 10 unsupported")),a&&(document.location.href="data:application/octet-stream"+t.slice(t.search(/[,;]/)),i(e)),e||(e="download"),n&&(r.href=t,r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r),i(e)),"undefined"!=typeof navigator&&navigator.msSaveBlob){var l=t.split(/^data:image\/svg\+xml,/)[1],s=decodeURIComponent(l);navigator.msSaveBlob(new Blob([s]),e),i(e)}o(new Error("download error"))})}},{}],261:[function(t,e,r){"use strict";r.getDelay=function(t){return t._has&&(t._has("gl3d")||t._has("gl2d")||t._has("mapbox"))?500:0},r.getRedrawFunc=function(t){var e=t._fullLayout||{};if(!(!(e._has&&e._has("polar"))&&t.data&&t.data[0]&&t.data[0].r))return function(){(t.calcdata||[]).forEach(function(t){t[0]&&t[0].t&&t[0].t.cb&&t[0].t.cb()})}}},{}],262:[function(t,e,r){"use strict";var n=t("./helpers"),a={getDelay:n.getDelay,getRedrawFunc:n.getRedrawFunc,clone:t("./cloneplot"),toSVG:t("./tosvg"),svgToImg:t("./svgtoimg"),toImage:t("./toimage"),downloadImage:t("./download")};e.exports=a},{"./cloneplot":258,"./download":259,"./helpers":261,"./svgtoimg":263,"./toimage":264,"./tosvg":265}],263:[function(t,e,r){"use strict";var n=t("../lib"),a=t("events").EventEmitter;e.exports=function(t){var e=t.emitter||new a,r=new Promise(function(a,i){var o=window.Image,l=t.svg,s=t.format||"png";if(n.isIE()&&"svg"!==s){var c=new Error("Sorry IE does not support downloading from canvas. Try {format:'svg'} instead.");return i(c),t.promise?r:e.emit("error",c)}var u=t.canvas,f=t.scale||1,d=t.width||300,p=t.height||150,h=f*d,g=f*p,v=u.getContext("2d"),y=new o,m="data:image/svg+xml,"+encodeURIComponent(l);u.width=h,u.height=g,y.onload=function(){var r;switch("svg"!==s&&v.drawImage(y,0,0,h,g),s){case"jpeg":r=u.toDataURL("image/jpeg");break;case"png":r=u.toDataURL("image/png");break;case"webp":r=u.toDataURL("image/webp");break;case"svg":r=m;break;default:var n="Image format is not jpeg, png, svg or webp.";if(i(new Error(n)),!t.promise)return e.emit("error",n)}a(r),t.promise||e.emit("success",r)},y.onerror=function(r){if(i(r),!t.promise)return e.emit("error",r)},y.src=m});return t.promise?r:e}},{"../lib":168,events:15}],264:[function(t,e,r){"use strict";var n=t("events").EventEmitter,a=t("../registry"),i=t("../lib"),o=t("./helpers"),l=t("./cloneplot"),s=t("./tosvg"),c=t("./svgtoimg");e.exports=function(t,e){var r=new n,u=l(t,{format:"png"}),f=u.gd;f.style.position="absolute",f.style.left="-5000px",document.body.appendChild(f);var d=o.getRedrawFunc(f);return a.call("plot",f,u.data,u.layout,u.config).then(d).then(function(){var t=o.getDelay(f._fullLayout);setTimeout(function(){var t=s(f),n=document.createElement("canvas");n.id=i.randstr(),(r=c({format:e.format,width:f._fullLayout.width,height:f._fullLayout.height,canvas:n,emitter:r,svg:t})).clean=function(){f&&document.body.removeChild(f)}},t)}).catch(function(t){r.emit("error",t)}),r}},{"../lib":168,"../registry":257,"./cloneplot":258,"./helpers":261,"./svgtoimg":263,"./tosvg":265,events:15}],265:[function(t,e,r){"use strict";var n=t("d3"),a=t("../lib"),i=t("../components/drawing"),o=t("../components/color"),l=t("../constants/xmlns_namespaces"),s=/"/g,c=new RegExp('("TOBESTRIPPED)|(TOBESTRIPPED")',"g");e.exports=function(t,e,r){var u,f=t._fullLayout,d=f._paper,p=f._toppaper,h=f.width,g=f.height;d.insert("rect",":first-child").call(i.setRect,0,0,h,g).call(o.fill,f.paper_bgcolor);var v=f._basePlotModules||[];for(u=0;u<v.length;u++){var y=v[u];y.toSVG&&y.toSVG(t)}if(p){var m=p.node().childNodes,x=Array.prototype.slice.call(m);for(u=0;u<x.length;u++){var b=x[u];b.childNodes.length&&d.node().appendChild(b)}}f._draggers&&f._draggers.remove(),d.node().style.background="",d.selectAll("text").attr({"data-unformatted":null,"data-math":null}).each(function(){var t=n.select(this);if("hidden"!==this.style.visibility&&"none"!==this.style.display){t.style({visibility:null,display:null});var e=this.style.fontFamily;e&&-1!==e.indexOf('"')&&t.style("font-family",e.replace(s,"TOBESTRIPPED"))}else t.remove()}),d.selectAll(".point, .scatterpts, .legendfill>path, .legendlines>path, .cbfill").each(function(){var t=n.select(this),e=this.style.fill;e&&-1!==e.indexOf("url(")&&t.style("fill",e.replace(s,"TOBESTRIPPED"));var r=this.style.stroke;r&&-1!==r.indexOf("url(")&&t.style("stroke",r.replace(s,"TOBESTRIPPED"))}),"pdf"!==e&&"eps"!==e||d.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),d.node().setAttributeNS(l.xmlns,"xmlns",l.svg),d.node().setAttributeNS(l.xmlns,"xmlns:xlink",l.xlink),"svg"===e&&r&&(d.attr("width",r*h),d.attr("height",r*g),d.attr("viewBox","0 0 "+h+" "+g));var _=(new window.XMLSerializer).serializeToString(d.node());return _=function(t){var e=n.select("body").append("div").style({display:"none"}).html(""),r=t.replace(/(&[^;]*;)/gi,function(t){return"<"===t?"<":"&rt;"===t?">":-1!==t.indexOf("<")||-1!==t.indexOf(">")?"":e.html(t).text()});return e.remove(),r}(_),_=(_=_.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(_=(_=(_=_.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),_}},{"../components/color":51,"../components/drawing":72,"../constants/xmlns_namespaces":150,"../lib":168,d3:16}],266:[function(t,e,r){"use strict";var n=t("../../lib").mergeArray;e.exports=function(t,e){for(var r=0;r<t.length;r++)t[r].i=r;n(e.text,t,"tx"),n(e.hovertext,t,"htx");var a=e.marker;if(a){n(a.opacity,t,"mo"),n(a.color,t,"mc");var i=a.line;i&&(n(i.color,t,"mlc"),n(i.width,t,"mlw"))}}},{"../../lib":168}],267:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../../components/fx/hovertemplate_attributes"),i=t("../../components/colorscale/attributes"),o=t("../../components/colorbar/attributes"),l=t("../../plots/font_attributes"),s=t("./constants.js"),c=t("../../lib/extend").extendFlat,u=l({editType:"calc",arrayOk:!0,colorEditType:"style"}),f=c({},n.marker.line.width,{dflt:0}),d=c({width:f,editType:"calc"},i("marker.line")),p=c({line:d,editType:"calc"},i("marker"),{colorbar:o,opacity:{valType:"number",arrayOk:!0,dflt:1,min:0,max:1,editType:"style"}});e.exports={x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,text:n.text,hovertext:n.hovertext,hovertemplate:a({},{keys:s.eventDataKeys}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"none",arrayOk:!0,editType:"calc"},textfont:c({},u,{}),insidetextfont:c({},u,{}),outsidetextfont:c({},u,{}),constraintext:{valType:"enumerated",values:["inside","outside","both","none"],dflt:"both",editType:"calc"},cliponaxis:c({},n.cliponaxis,{}),orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},base:{valType:"any",dflt:null,arrayOk:!0,editType:"calc"},offset:{valType:"number",dflt:null,arrayOk:!0,editType:"calc"},width:{valType:"number",dflt:null,min:0,arrayOk:!0,editType:"calc"},marker:p,selected:{marker:{opacity:n.selected.marker.opacity,color:n.selected.marker.color,editType:"style"},textfont:n.selected.textfont,editType:"style"},unselected:{marker:{opacity:n.unselected.marker.opacity,color:n.unselected.marker.color,editType:"style"},textfont:n.unselected.textfont,editType:"style"},r:n.r,t:n.t,_deprecated:{bardir:{valType:"enumerated",editType:"calc",values:["v","h"]}}}},{"../../components/colorbar/attributes":52,"../../components/colorscale/attributes":58,"../../components/fx/hovertemplate_attributes":89,"../../lib/extend":162,"../../plots/font_attributes":239,"../scatter/attributes":367,"./constants.js":269}],268:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/calc"),o=t("./arrays_to_calcdata"),l=t("../scatter/calc_selection");e.exports=function(t,e){var r,s,c=n.getFromId(t,e.xaxis||"x"),u=n.getFromId(t,e.yaxis||"y");"h"===e.orientation?(r=c.makeCalcdata(e,"x"),s=u.makeCalcdata(e,"y")):(r=u.makeCalcdata(e,"y"),s=c.makeCalcdata(e,"x"));for(var f=Math.min(s.length,r.length),d=new Array(f),p=0;p<f;p++)d[p]={p:s[p],s:r[p]},e.ids&&(d[p].id=String(e.ids[p]));return a(e,"marker")&&i(t,e,{vals:e.marker.color,containerStr:"marker",cLetter:"c"}),a(e,"marker.line")&&i(t,e,{vals:e.marker.line.color,containerStr:"marker.line",cLetter:"c"}),o(d,e),l(d,e),d}},{"../../components/colorscale/calc":59,"../../components/colorscale/helpers":62,"../../plots/cartesian/axes":212,"../scatter/calc_selection":369,"./arrays_to_calcdata":266}],269:[function(t,e,r){"use strict";e.exports={eventDataKeys:[]}},{}],270:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib").isArrayOrTypedArray,i=t("../../constants/numerical").BADNUM,o=t("../../registry"),l=t("../../plots/cartesian/axes"),s=t("./sieve.js");function c(t,e,r,o){if(o.length){var c,x,b,_,w=t._fullLayout.barmode,k="overlay"===w,T="group"===w;if(function(t,e,r,i){var o,l;for(o=0;o<i.length;o++){var s,c=i[o],u=c[0].trace,f=u.base,d="h"===u.orientation?u.xcalendar:u.ycalendar,p="category"===r.type||"multicategory"===r.type?function(){return null}:r.d2c;if(a(f)){for(l=0;l<Math.min(f.length,c.length);l++)s=p(f[l],0,d),n(s)?(c[l].b=+s,c[l].hasB=1):c[l].b=0;for(;l<c.length;l++)c[l].b=0}else{s=p(f,0,d);var h=n(s);for(s=h?s:0,l=0;l<c.length;l++)c[l].b=s,h&&(c[l].hasB=1)}}}(0,0,r,o),k)u(t,e,r,o);else if(T){for(c=[],x=[],b=0;b<o.length;b++)void 0===(_=o[b])[0].trace.offset?x.push(_):c.push(_);x.length&&function(t,e,r,n){var a=t._fullLayout.barnorm,i=new s(n,!1,!a);(function(t,e,r){for(var n=t._fullLayout,a=n.bargap,i=n.bargroupgap||0,o=r.positions,l=r.distinctPositions,s=r.minDiff,c=r.traces,u=o.length!==l.length,f=c.length,g=s*(1-a),v=u?g/f:g,y=v*(1-i),m=0;m<f;m++){var x=c[m],b=x[0].t,_=u?((2*m+1-f)*v-y)/2:-y/2;b.barwidth=y,b.poffset=_,b.bargroupwidth=g,b.bardelta=s}r.binWidth=c[0][0].t.barwidth/100,d(r),p(t,e,r),h(t,e,r,u)})(t,e,i),a?(v(t,r,i),y(t,r,i)):g(t,r,i)}(t,e,r,x),c.length&&u(t,e,r,c)}else{for(c=[],x=[],b=0;b<o.length;b++)void 0===(_=o[b])[0].trace.base?x.push(_):c.push(_);x.length&&function(t,e,r,n){var a=t._fullLayout,o=a.barmode,c="stack"===o,u="relative"===o,d=a.barnorm,p=new s(n,u,!(d||c||u));f(t,e,p),function(t,e,r){for(var n=t._fullLayout.barnorm,a=m(e),o=r.traces,s=0;s<o.length;s++){for(var c=o[s],u=c[0].trace,f=[],d=0;d<c.length;d++){var p=c[d];if(p.s!==i){var h=r.put(p.p,p.b+p.s),g=h+p.b+p.s;p.b=h,p[a]=g,n||(f.push(g),p.hasB&&f.push(h))}}n||(u._extremes[e._id]=l.findExtremes(e,f,{tozero:!0,padded:!0}))}}(t,r,p);for(var h=0;h<n.length;h++)for(var g=n[h],v=0;v<g.length;v++){var x=g[v];if(x.s!==i){var b=x.b+x.s===p.get(x.p,x.s);b&&(x._outmost=!0)}}d&&y(t,r,p)}(t,e,r,x),c.length&&u(t,e,r,c)}!function(t,e){var r,a,i,o=m(e),l={},s=1/0,c=-1/0;for(r=0;r<t.length;r++)for(i=t[r],a=0;a<i.length;a++){var u=i[a].p;n(u)&&(s=Math.min(s,u),c=Math.max(c,u))}var f=1e4/(c-s),d=l.round=function(t){return String(Math.round(f*(t-s)))};for(r=0;r<t.length;r++){(i=t[r])[0].t.extents=l;var p=i[0].t.poffset,h=Array.isArray(p);for(a=0;a<i.length;a++){var g=i[a],v=g[o]-g.w/2;if(n(v)){var y=g[o]+g.w/2,x=d(g.p);l[x]?l[x]=[Math.min(v,l[x][0]),Math.max(y,l[x][1])]:l[x]=[v,y]}g.p0=g.p+(h?p[a]:p),g.p1=g.p0+g.w,g.s0=g.b,g.s1=g.s0+g.s}}}(o,e)}}function u(t,e,r,n){for(var a=t._fullLayout.barnorm,i=!a,o=0;o<n.length;o++){var l=n[o],c=new s([l],!1,i);f(t,e,c),a?(v(t,r,c),y(t,r,c)):g(t,r,c)}}function f(t,e,r){for(var n=t._fullLayout,a=n.bargap,i=n.bargroupgap||0,o=r.minDiff,l=r.traces,s=o*(1-a),c=s*(1-i),u=-c/2,f=0;f<l.length;f++){var g=l[f][0].t;g.barwidth=c,g.poffset=u,g.bargroupwidth=s,g.bardelta=o}r.binWidth=l[0][0].t.barwidth/100,d(r),p(t,e,r),h(t,e,r)}function d(t){var e,r,i=t.traces;for(e=0;e<i.length;e++){var o,l=i[e],s=l[0],c=s.trace,u=s.t,f=c._offset||c.offset,d=u.poffset;if(a(f)){for(o=Array.prototype.slice.call(f,0,l.length),r=0;r<o.length;r++)n(o[r])||(o[r]=d);for(r=o.length;r<l.length;r++)o.push(d);u.poffset=o}else void 0!==f&&(u.poffset=f);var p=c._width||c.width,h=u.barwidth;if(a(p)){var g=Array.prototype.slice.call(p,0,l.length);for(r=0;r<g.length;r++)n(g[r])||(g[r]=h);for(r=g.length;r<l.length;r++)g.push(h);if(u.barwidth=g,void 0===f){for(o=[],r=0;r<l.length;r++)o.push(d+(h-g[r])/2);u.poffset=o}}else void 0!==p&&(u.barwidth=p,void 0===f&&(u.poffset=d+(h-p)/2))}}function p(t,e,r){for(var n=r.traces,a=m(e),i=0;i<n.length;i++)for(var o=n[i],l=o[0].t,s=l.poffset,c=Array.isArray(s),u=l.barwidth,f=Array.isArray(u),d=0;d<o.length;d++){var p=o[d],h=p.w=f?u[d]:u;p[a]=p.p+(c?s[d]:s)+h/2}}function h(t,e,r,n){var a=r.traces,i=r.minDiff/2;l.minDtick(e,r.minDiff,r.distinctPositions[0],n);for(var o=0;o<a.length;o++){var s,c,u,f,d=a[o],p=d[0],h=p.trace,g=[];for(f=0;f<d.length;f++)c=(s=d[f]).p-i,u=s.p+i,g.push(c,u);if(h.width||h.offset){var v=p.t,y=v.poffset,m=v.barwidth,x=Array.isArray(y),b=Array.isArray(m);for(f=0;f<d.length;f++){s=d[f];var _=x?y[f]:y,w=b?m[f]:m;u=(c=s.p+_)+w,g.push(c,u)}}h._extremes[e._id]=l.findExtremes(e,g,{padded:!1})}}function g(t,e,r){for(var n=r.traces,a=m(e),i=0;i<n.length;i++){for(var o=n[i],s=o[0].trace,c=[],u=!0,f=0;f<o.length;f++){var d=o[f],p=d.b,h=p+d.s;d[a]=h,c.push(h),d.hasB&&c.push(p),d.hasB&&d.b>0&&d.s>0||(u=!1)}s._extremes[e._id]=l.findExtremes(e,c,{tozero:!u,padded:!0})}}function v(t,e,r){for(var n=r.traces,a=0;a<n.length;a++)for(var o=n[a],l=0;l<o.length;l++){var s=o[l];s.s!==i&&r.put(s.p,s.b+s.s)}}function y(t,e,r){var a=t._fullLayout,o=r.traces,s=m(e),c="fraction"===a.barnorm?1:100,u=c/1e9,f=e.l2c(e.c2l(0)),d="stack"===a.barmode?c:f;function p(t){return n(e.c2l(t))&&(t<f-u||t>d+u||!n(f))}for(var h=0;h<o.length;h++){for(var g=o[h],v=g[0].trace,y=[],x=!0,b=!1,_=0;_<g.length;_++){var w=g[_];if(w.s!==i){var k=Math.abs(c/r.get(w.p,w.s));w.b*=k,w.s*=k;var T=w.b,M=T+w.s;w[s]=M,y.push(M),b=b||p(M),w.hasB&&(y.push(T),b=b||p(T)),w.hasB&&w.b>0&&w.s>0||(x=!1)}}v._extremes[e._id]=l.findExtremes(e,y,{tozero:!x,padded:b})}}function m(t){return t._id.charAt(0)}e.exports={crossTraceCalc:function(t,e){for(var r=e.xaxis,n=e.yaxis,a=t._fullData,i=t.calcdata,l=[],s=[],u=0;u<a.length;u++){var f=a[u];!0===f.visible&&o.traceIs(f,"bar")&&f.xaxis===r._id&&f.yaxis===n._id&&("h"===f.orientation?l.push(i[u]):s.push(i[u]))}c(t,r,n,s),c(t,n,r,l)},setGroupPositions:c}},{"../../constants/numerical":149,"../../lib":168,"../../plots/cartesian/axes":212,"../../registry":257,"./sieve.js":279,"fast-isnumeric":18}],271:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/color"),i=t("../../registry"),o=t("../scatter/xy_defaults"),l=t("../bar/style_defaults"),s=t("./attributes");e.exports=function(t,e,r,c){function u(r,a){return n.coerce(t,e,s,r,a)}var f=n.coerceFont;if(o(t,e,c,u)){u("orientation",e.x&&!e.y?"h":"v"),u("base"),u("offset"),u("width"),u("text"),u("hovertext"),u("hovertemplate");var d=u("textposition"),p=Array.isArray(d)||"auto"===d,h=p||"outside"===d;if(p||"inside"===d||h){var g=f(u,"textfont",c.font),v=n.extendFlat({},g);!(t.textfont&&t.textfont.color)&&delete v.color,f(u,"insidetextfont",v),h&&f(u,"outsidetextfont",g),u("constraintext"),u("selected.textfont.color"),u("unselected.textfont.color"),u("cliponaxis")}l(t,e,u,r,c);var y=(e.marker.line||{}).color,m=i.getComponentMethod("errorbars","supplyDefaults");m(t,e,y||a.defaultLine,{axis:"y"}),m(t,e,y||a.defaultLine,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(e,u)}else e.visible=!1}},{"../../components/color":51,"../../lib":168,"../../registry":257,"../bar/style_defaults":281,"../scatter/xy_defaults":393,"./attributes":267}],272:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("tinycolor2");r.coerceString=function(t,e,r){if("string"==typeof e){if(e||!t.noBlank)return e}else if("number"==typeof e&&!t.strict)return String(e);return void 0!==r?r:t.dflt},r.coerceNumber=function(t,e,r){if(n(e)){e=+e;var a=t.min,i=t.max;if(!(void 0!==a&&e<a||void 0!==i&&e>i))return e}return void 0!==r?r:t.dflt},r.coerceColor=function(t,e,r){return a(e).isValid()?e:void 0!==r?r:t.dflt},r.coerceEnumerated=function(t,e,r){return t.coerceNumber&&(e=+e),-1!==t.values.indexOf(e)?e:void 0!==r?r:t.dflt},r.getValue=function(t,e){var r;return Array.isArray(t)?e<t.length&&(r=t[e]):r=t,r}},{"fast-isnumeric":18,tinycolor2:34}],273:[function(t,e,r){"use strict";var n=t("../../components/fx"),a=t("../../registry"),i=t("../../components/color"),o=t("../scatter/fill_hover_text");function l(t,e){var r=e.mcc||t.marker.color,n=e.mlcc||t.marker.line.color,a=e.mlw||t.marker.line.width;return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}e.exports={hoverPoints:function(t,e,r,i){var s,c,u,f,d,p,h,g=t.cd,v=g[0].trace,y=g[0].t,m="closest"===i,x=t.maxHoverDistance,b=t.maxSpikeDistance;function _(t){return t[u]-t.w/2}function w(t){return t[u]+t.w/2}var k=m?_:function(t){return Math.min(_(t),t.p-y.bardelta/2)},T=m?w:function(t){return Math.max(w(t),t.p+y.bardelta/2)};function M(t,e){return n.inbox(t-s,e-s,x+Math.min(1,Math.abs(e-t)/h)-1)}function A(t){return M(k(t),T(t))}function L(t){return n.inbox(t.b-c,t[f]-c,x+(t[f]-c)/(t[f]-t.b)-1)}"h"===v.orientation?(s=r,c=e,u="y",f="x",d=L,p=A):(s=e,c=r,u="x",f="y",p=L,d=A);var S=t[u+"a"],C=t[f+"a"];h=Math.abs(S.r2c(S.range[1])-S.r2c(S.range[0]));var O=n.getDistanceFunction(i,d,p,function(t){return(d(t)+p(t))/2});if(n.getClosest(g,O,t),!1!==t.index){m||(k=function(t){return Math.min(_(t),t.p-y.bargroupwidth/2)},T=function(t){return Math.max(w(t),t.p+y.bargroupwidth/2)});var z=g[t.index],D=v.base?z.b+z.s:z.s;t[f+"0"]=t[f+"1"]=C.c2p(z[f],!0),t[f+"LabelVal"]=D;var P=y.extents[y.extents.round(z.p)];return t[u+"0"]=S.c2p(m?k(z):P[0],!0),t[u+"1"]=S.c2p(m?T(z):P[1],!0),t[u+"LabelVal"]=z.p,t.spikeDistance=(L(z)+function(t){return M(_(t),w(t))}(z))/2+b-x,t[u+"Spike"]=S.c2p(z.p,!0),t.color=l(v,z),o(z,v,t),a.getComponentMethod("errorbars","hoverInfo")(z,v,t),t.hovertemplate=v.hovertemplate,[t]}},getTraceColor:l}},{"../../components/color":51,"../../components/fx":90,"../../registry":257,"../scatter/fill_hover_text":375}],274:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.layoutAttributes=t("./layout_attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("./layout_defaults"),n.calc=t("./calc"),n.crossTraceCalc=t("./cross_trace_calc").crossTraceCalc,n.colorbar=t("../scatter/marker_colorbar"),n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.style=t("./style").style,n.styleOnSelect=t("./style").styleOnSelect,n.hoverPoints=t("./hover").hoverPoints,n.selectPoints=t("./select"),n.moduleType="trace",n.name="bar",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],n.meta={},e.exports=n},{"../../plots/cartesian":224,"../scatter/marker_colorbar":385,"./arrays_to_calcdata":266,"./attributes":267,"./calc":268,"./cross_trace_calc":270,"./defaults":271,"./hover":273,"./layout_attributes":275,"./layout_defaults":276,"./plot":277,"./select":278,"./style":280}],275:[function(t,e,r){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],276:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/cartesian/axes"),i=t("../../lib"),o=t("./layout_attributes");e.exports=function(t,e,r){function l(r,n){return i.coerce(t,e,o,r,n)}for(var s=!1,c=!1,u=!1,f={},d=0;d<r.length;d++){var p=r[d];if(n.traceIs(p,"bar")&&p.visible){if(s=!0,"overlay"!==t.barmode&&"stack"!==t.barmode){var h=p.xaxis+p.yaxis;f[h]&&(u=!0),f[h]=!0}if(p.visible&&"histogram"===p.type)"category"!==a.getFromId({_fullLayout:e},p["v"===p.orientation?"xaxis":"yaxis"]).type&&(c=!0)}}s&&("overlay"!==l("barmode")&&l("barnorm"),l("bargap",c&&!u?0:.2),l("bargroupgap"))}},{"../../lib":168,"../../plots/cartesian/axes":212,"../../registry":257,"./layout_attributes":275}],277:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../../lib"),o=t("../../lib/svg_text_utils"),l=t("../../components/color"),s=t("../../components/drawing"),c=t("../../registry"),u=t("./attributes"),f=u.text,d=u.textposition,p=t("./helpers"),h=t("./style"),g=3;function v(t,e,r,n,a,i){var o;return a<1?o="scale("+a+") ":(a=1,o=""),"translate("+(r-a*t)+" "+(n-a*e)+")"+o+(i?"rotate("+i+" "+t+" "+e+") ":"")}e.exports=function(t,e,r,u){var y=e.xaxis,m=e.yaxis,x=t._fullLayout,b=i.makeTraceGroups(u,r,"trace bars").each(function(r){var c=n.select(this),u=r[0],b=u.trace;e.isRangePlot||(u.node3=c);var _=i.ensureSingle(c,"g","points").selectAll("g.point").data(i.identity);_.enter().append("g").classed("point",!0),_.exit().remove(),_.each(function(c,u){var _,w,k,T,M=n.select(this);if("h"===b.orientation?(k=m.c2p(c.p0,!0),T=m.c2p(c.p1,!0),_=y.c2p(c.s0,!0),w=y.c2p(c.s1,!0),c.ct=[w,(k+T)/2]):(_=y.c2p(c.p0,!0),w=y.c2p(c.p1,!0),k=m.c2p(c.s0,!0),T=m.c2p(c.s1,!0),c.ct=[(_+w)/2,T]),a(_)&&a(w)&&a(k)&&a(T)&&_!==w&&k!==T){var A=(c.mlw+1||b.marker.line.width+1||(c.trace?c.trace.marker.line.width:0)+1)-1,L=n.round(A/2%1,2);if(!t._context.staticPlot){var S=l.opacity(c.mc||b.marker.color)<1||A>.01?C:function(t,e){return Math.abs(t-e)>=2?C(t):t>e?Math.ceil(t):Math.floor(t)};_=S(_,w),w=S(w,_),k=S(k,T),T=S(T,k)}i.ensureSingle(M,"path").style("vector-effect","non-scaling-stroke").attr("d","M"+_+","+k+"V"+T+"H"+w+"V"+k+"Z").call(s.setClipUrl,e.layerClipId,t),function(t,e,r,n,a,l,c,u){var y;function m(e,r,n){var a=i.ensureSingle(e,"text").text(r).attr({class:"bartext bartext-"+y,transform:"","text-anchor":"middle","data-notex":1}).call(s.font,n).call(o.convertToTspans,t);return a}var x=r[0].trace,b=x.orientation,_=function(t,e){var r=p.getValue(t.text,e);return p.coerceString(f,r)}(x,n);if(y=function(t,e){var r=p.getValue(t.textposition,e);return p.coerceEnumerated(d,r)}(x,n),!_||"none"===y)return void e.select("text").remove();var w,k,T,M,A,L,S=t._fullLayout.font,C=h.getBarColor(r[n],x),O=h.getInsideTextFont(x,n,S,C),z=h.getOutsideTextFont(x,n,S),D=t._fullLayout.barmode,P="relative"===D,E="stack"===D||P,R=r[n],I=!E||R._outmost,F=Math.abs(l-a)-2*g,N=Math.abs(u-c)-2*g;"outside"===y&&(I||R.hasB||(y="inside"));if("auto"===y)if(I){y="inside",w=m(e,_,O),k=s.bBox(w.node()),T=k.width,M=k.height;var B=T>0&&M>0,j=T<=F&&M<=N,H=T<=N&&M<=F,q="h"===b?F>=T*(N/M):N>=M*(F/T);B&&(j||H||q)?y="inside":(y="outside",w.remove(),w=null)}else y="inside";if(!w&&(w=m(e,_,"outside"===y?z:O),k=s.bBox(w.node()),T=k.width,M=k.height,T<=0||M<=0))return void w.remove();"outside"===y?(L="both"===x.constraintext||"outside"===x.constraintext,A=function(t,e,r,n,a,i,o){var l,s="h"===i?Math.abs(n-r):Math.abs(e-t);s>2*g&&(l=g);var c=1;o&&(c="h"===i?Math.min(1,s/a.height):Math.min(1,s/a.width));var u,f,d,p,h=(a.left+a.right)/2,y=(a.top+a.bottom)/2;u=c*a.width,f=c*a.height,"h"===i?e<t?(d=e-l-u/2,p=(r+n)/2):(d=e+l+u/2,p=(r+n)/2):n>r?(d=(t+e)/2,p=n+l+f/2):(d=(t+e)/2,p=n-l-f/2);return v(h,y,d,p,c,!1)}(a,l,c,u,k,b,L)):(L="both"===x.constraintext||"inside"===x.constraintext,A=function(t,e,r,n,a,i,o){var l,s,c,u,f,d,p,h=a.width,y=a.height,m=(a.left+a.right)/2,x=(a.top+a.bottom)/2,b=Math.abs(e-t),_=Math.abs(n-r);b>2*g&&_>2*g?(b-=2*(f=g),_-=2*f):f=0;h<=b&&y<=_?(d=!1,p=1):h<=_&&y<=b?(d=!0,p=1):h<y==b<_?(d=!1,p=o?Math.min(b/h,_/y):1):(d=!0,p=o?Math.min(_/h,b/y):1);d&&(d=90);d?(l=p*y,s=p*h):(l=p*h,s=p*y);"h"===i?e<t?(c=e+f+l/2,u=(r+n)/2):(c=e-f-l/2,u=(r+n)/2):n>r?(c=(t+e)/2,u=n-f-s/2):(c=(t+e)/2,u=n+f+s/2);return v(m,x,c,u,p,d)}(a,l,c,u,k,b,L));w.attr("transform",A)}(t,M,r,u,_,w,k,T),e.layerClipId&&s.hideOutsideRangePoint(c,M.select("text"),y,m,b.xcalendar,b.ycalendar)}else M.remove();function C(t){return 0===x.bargap&&0===x.bargroupgap?n.round(Math.round(t)-L,2):t}});var w=!1===u.trace.cliponaxis;s.setClipUrl(c,w?null:e.layerClipId,t)});c.getComponentMethod("errorbars","plot")(t,b,e)}},{"../../components/color":51,"../../components/drawing":72,"../../lib":168,"../../lib/svg_text_utils":189,"../../registry":257,"./attributes":267,"./helpers":272,"./style":280,d3:16,"fast-isnumeric":18}],278:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n=t.cd,a=t.xaxis,i=t.yaxis,o=[];if(!1===e)for(r=0;r<n.length;r++)n[r].selected=0;else for(r=0;r<n.length;r++){var l=n[r];e.contains(l.ct,!1,r,t)?(o.push({pointNumber:r,x:a.c2d(l.x),y:i.c2d(l.y)}),l.selected=1):l.selected=0}return o}},{}],279:[function(t,e,r){"use strict";e.exports=i;var n=t("../../lib"),a=t("../../constants/numerical").BADNUM;function i(t,e,r){this.traces=t,this.separateNegativeValues=e,this.dontMergeOverlappingData=r;for(var i=1/0,o=[],l=0;l<t.length;l++){for(var s=t[l],c=0;c<s.length;c++){var u=s[c];u.p!==a&&o.push(u.p)}s[0]&&s[0].width1&&(i=Math.min(s[0].width1,i))}this.positions=o;var f=n.distinctVals(o);this.distinctPositions=f.vals,1===f.vals.length&&i!==1/0?this.minDiff=i:this.minDiff=Math.min(f.minDiff,i),this.binWidth=this.minDiff,this.bins={}}i.prototype.put=function(t,e){var r=this.getLabel(t,e),n=this.bins[r]||0;return this.bins[r]=n+e,n},i.prototype.get=function(t,e){var r=this.getLabel(t,e);return this.bins[r]||0},i.prototype.getLabel=function(t,e){return(e<0&&this.separateNegativeValues?"v":"^")+(this.dontMergeOverlappingData?t:Math.round(t/this.binWidth))}},{"../../constants/numerical":149,"../../lib":168}],280:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/color"),i=t("../../components/drawing"),o=t("../../lib"),l=t("../../registry"),s=t("./attributes"),c=s.textfont,u=s.insidetextfont,f=s.outsidetextfont,d=t("./helpers");function p(t,e,r){var a=t.selectAll("path"),o=t.selectAll("text");i.pointStyle(a,e,r),o.each(function(t){var a=n.select(this),o=h(a,t,e,r);i.font(a,o)})}function h(t,e,r,n){var a=n._fullLayout.font,i=r.textfont;if(t.classed("bartext-inside")){var o=x(e,r);i=v(r,e.i,a,o)}else t.classed("bartext-outside")&&(i=y(r,e.i,a));return i}function g(t,e,r){return m(c,t.textfont,e,r)}function v(t,e,r,n){var i=g(t,e,r);return(void 0===t._input.textfont||void 0===t._input.textfont.color||Array.isArray(t.textfont.color)&&void 0===t.textfont.color[e])&&(i={color:a.contrast(n),family:i.family,size:i.size}),m(u,t.insidetextfont,e,i)}function y(t,e,r){var n=g(t,e,r);return m(f,t.outsidetextfont,e,n)}function m(t,e,r,n){e=e||{};var a=d.getValue(e.family,r),i=d.getValue(e.size,r),o=d.getValue(e.color,r);return{family:d.coerceString(t.family,a,n.family),size:d.coerceNumber(t.size,i,n.size),color:d.coerceColor(t.color,o,n.color)}}function x(t,e){return t.mc||e.marker.color}e.exports={style:function(t,e){var r=e?e[0].node3:n.select(t).selectAll("g.trace.bars"),a=r.size(),i=t._fullLayout;r.style("opacity",function(t){return t[0].trace.opacity}).each(function(t){("stack"===i.barmode&&a>1||0===i.bargap&&0===i.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")}),r.selectAll("g.points").each(function(e){p(n.select(this),e[0].trace,t)}),l.getComponentMethod("errorbars","style")(r)},styleOnSelect:function(t,e){var r=e[0].node3,a=e[0].trace;a.selectedpoints?function(t,e,r){i.selectedPointStyle(t.selectAll("path"),e),function(t,e,r){t.each(function(t){var a,l=n.select(this);if(t.selected){a=o.extendFlat({},h(l,t,e,r));var s=e.selected.textfont&&e.selected.textfont.color;s&&(a.color=s),i.font(l,a)}else i.selectedTextStyle(l,e)})}(t.selectAll("text"),e,r)}(r,a,t):p(r,a,t)},getInsideTextFont:v,getOutsideTextFont:y,getBarColor:x}},{"../../components/color":51,"../../components/drawing":72,"../../lib":168,"../../registry":257,"./attributes":267,"./helpers":272,d3:16}],281:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,l){r("marker.color",o),a(t,"marker")&&i(t,e,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(t,"marker.line")&&i(t,e,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":51,"../../components/colorscale/defaults":61,"../../components/colorscale/helpers":62}],282:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../../components/color/attributes"),i=t("../../lib/extend").extendFlat,o=n.marker,l=o.line;e.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},name:{valType:"string",editType:"calc+clearAxisTypes"},text:i({},n.text,{}),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},notched:{valType:"boolean",editType:"calc"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calc"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers",editType:"calc"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1,editType:"calc"},jitter:{valType:"number",min:0,max:1,editType:"calc"},pointpos:{valType:"number",min:-2,max:2,editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},width:{valType:"number",min:0,dflt:0,editType:"calc"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:i({},o.symbol,{arrayOk:!1,editType:"plot"}),opacity:i({},o.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:i({},o.size,{arrayOk:!1,editType:"calc"}),color:i({},o.color,{arrayOk:!1,editType:"style"}),line:{color:i({},l.color,{arrayOk:!1,dflt:a.defaultLine,editType:"style"}),width:i({},l.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},{"../../components/color/attributes":50,"../../lib/extend":162,"../scatter/attributes":367}],283:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=a._,o=t("../../plots/cartesian/axes");function l(t,e,r){var n={text:"tx"};for(var a in n)Array.isArray(e[a])&&(t[n[a]]=e[a][r])}function s(t,e){return t.v-e.v}function c(t){return t.v}e.exports=function(t,e){var r,u,f,d,p,h=t._fullLayout,g=o.getFromId(t,e.xaxis||"x"),v=o.getFromId(t,e.yaxis||"y"),y=[],m="violin"===e.type?"_numViolins":"_numBoxes";"h"===e.orientation?(u=g,f="x",d=v,p="y"):(u=v,f="y",d=g,p="x");var x,b=u.makeCalcdata(e,f),_=function(t,e,r,i,o){if(e in t)return r.makeCalcdata(t,e);var l;l=e+"0"in t?t[e+"0"]:"name"in t&&("category"===r.type||n(t.name)&&-1!==["linear","log"].indexOf(r.type)||a.isDateTime(t.name)&&"date"===r.type)?t.name:o;var s="multicategory"===r.type?r.r2c_just_indices(l):r.d2c(l,0,t[e+"calendar"]);return i.map(function(){return s})}(e,p,d,b,h[m]),w=a.distinctVals(_),k=w.vals,T=w.minDiff/2,M=function(t,e){for(var r=t.length,n=new Array(r+1),a=0;a<r;a++)n[a]=t[a]-e;return n[r]=t[r-1]+e,n}(k,T),A=k.length,L=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=[];return e}(A);for(r=0;r<e._length;r++){var S=b[r];if(n(S)){var C=a.findBin(_[r],M);if(C>=0&&C<A){var O={v:S,i:r};l(O,e,r),L[C].push(O)}}}var z="all"===(e.boxpoints||e.points)?a.identity:function(t){return t.v<x.lf||t.v>x.uf};for(r=0;r<A;r++)if(L[r].length>0){var D=L[r].sort(s),P=D.map(c),E=P.length;(x={}).pos=k[r],x.pts=D,x.min=P[0],x.max=P[E-1],x.mean=a.mean(P,E),x.sd=a.stdev(P,E,x.mean),x.q1=a.interp(P,.25),x.med=a.interp(P,.5),x.q3=a.interp(P,.75),x.lf=Math.min(x.q1,P[Math.min(a.findBin(2.5*x.q1-1.5*x.q3,P,!0)+1,E-1)]),x.uf=Math.max(x.q3,P[Math.max(a.findBin(2.5*x.q3-1.5*x.q1,P),0)]),x.lo=4*x.q1-3*x.q3,x.uo=4*x.q3-3*x.q1;var R=1.57*(x.q3-x.q1)/Math.sqrt(E);x.ln=x.med-R,x.un=x.med+R,x.pts2=D.filter(z),y.push(x)}!function(t,e){if(a.isArrayOrTypedArray(e.selectedpoints))for(var r=0;r<t.length;r++){for(var n=t[r].pts||[],i={},o=0;o<n.length;o++)i[n[o].i]=o;a.tagSelected(n,e,i)}}(y,e);var I=o.findExtremes(u,b,{padded:!0});return e._extremes[u._id]=I,y.length>0?(y[0].t={num:h[m],dPos:T,posLetter:p,valLetter:f,labels:{med:i(t,"median:"),min:i(t,"min:"),q1:i(t,"q1:"),q3:i(t,"q3:"),max:i(t,"max:"),mean:"sd"===e.boxmean?i(t,"mean \xb1 \u03c3:"):i(t,"mean:"),lf:i(t,"lower fence:"),uf:i(t,"upper fence:")}},h[m]++,y):[{t:{empty:!0}}]}},{"../../lib":168,"../../plots/cartesian/axes":212,"fast-isnumeric":18}],284:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),a=t("../../lib"),i=["v","h"];function o(t,e,r,i){var o,l,s,c=e.calcdata,u=e._fullLayout,f=i._id,d=f.charAt(0),p="violin"===t?"_numViolins":"_numBoxes",h=[],g=0;for(o=0;o<r.length;o++)for(s=c[r[o]],l=0;l<s.length;l++)h.push(s[l].pos),g+=(s[l].pts2||[]).length;if(h.length){var v=a.distinctVals(h),y=v.minDiff/2;n.minDtick(i,v.minDiff,v.vals[0],!0);var m=u[p],x="group"===u[t+"mode"]&&m>1,b=1-u[t+"gap"],_=1-u[t+"groupgap"];for(o=0;o<r.length;o++){var w,k,T,M,A,L,S=(s=c[r[o]])[0].trace,C=s[0].t,O=S.width,z=S.side;O?(w=k=M=O/2,T=0):(k=(w=y)*b*_/(x?m:1),T=x?2*w*((C.num+.5)/m-.5)*b:0,M=w*(x?b/m:1)),C.dPos=w,C.bPos=T,C.bdPos=k,C.wHover=M;var D,P,E,R,I,F,N=T+k;"positive"===z?(A=w*(O?1:.5),D=N,L=D=T):"negative"===z?(A=D=T,L=w*(O?1:.5),P=N):(A=L=w,D=P=N);var B=!1;if((S.boxpoints||S.points)&&g>0){var j=S.pointpos,H=S.jitter,q=S.marker.size/2,V=0;j+H>=0&&((V=N*(j+H))>A?(B=!0,I=q,E=V):V>D&&(I=q,E=A)),V<=A&&(E=A);var U=0;j-H<=0&&((U=-N*(j-H))>L?(B=!0,F=q,R=U):U>P&&(F=q,R=L)),U<=L&&(R=L)}else E=A,R=L;var G=s[0].pos,Z=s[s.length-1].pos;S._extremes[f]=n.findExtremes(i,[G,Z],{padded:B,vpadminus:R,vpadplus:E,ppadminus:{x:F,y:I}[d],ppadplus:{x:I,y:F}[d]})}}}e.exports={crossTraceCalc:function(t,e){for(var r=t.calcdata,n=e.xaxis,a=e.yaxis,l=0;l<i.length;l++){for(var s=i[l],c="h"===s?a:n,u=[],f=0;f<r.length;f++){var d=r[f],p=d[0].t,h=d[0].trace;!0!==h.visible||"box"!==h.type&&"candlestick"!==h.type||p.empty||(h.orientation||"v")!==s||h.xaxis!==n._id||h.yaxis!==a._id||u.push(f)}o("box",t,u,c)}},setPositionOffset:o}},{"../../lib":168,"../../plots/cartesian/axes":212}],285:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("../../components/color"),o=t("./attributes");function l(t,e,r,i){var o,l,s=r("y"),c=r("x"),u=c&&c.length;if(s&&s.length)o="v",u?l=Math.min(n.minRowLength(c),n.minRowLength(s)):(r("x0"),l=n.minRowLength(s));else{if(!u)return void(e.visible=!1);o="h",r("y0"),l=n.minRowLength(c)}e._length=l,a.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],i),r("orientation",o)}function s(t,e,r,a){var i=a.prefix,l=n.coerce2(t,e,o,"marker.outliercolor"),s=r("marker.line.outliercolor"),c=r(i+"points",l||s?"suspectedoutliers":void 0);c?(r("jitter","all"===c?.3:0),r("pointpos","all"===c?-1.5:0),r("marker.symbol"),r("marker.opacity"),r("marker.size"),r("marker.color",e.line.color),r("marker.line.color"),r("marker.line.width"),"suspectedoutliers"===c&&(r("marker.line.outliercolor",e.marker.color),r("marker.line.outlierwidth")),r("selected.marker.color"),r("unselected.marker.color"),r("selected.marker.size"),r("unselected.marker.size"),r("text")):delete e.marker,r("hoveron"),n.coerceSelectionMarkerOpacity(e,r)}e.exports={supplyDefaults:function(t,e,r,a){function c(r,a){return n.coerce(t,e,o,r,a)}l(t,e,c,a),!1!==e.visible&&(c("line.color",(t.marker||{}).color||r),c("line.width"),c("fillcolor",i.addOpacity(e.line.color,.5)),c("whiskerwidth"),c("boxmean"),c("width"),c("notched",void 0!==t.notchwidth)&&c("notchwidth"),s(t,e,c,{prefix:"box"}))},handleSampleDefaults:l,handlePointsDefaults:s}},{"../../components/color":51,"../../lib":168,"../../registry":257,"./attributes":282}],286:[function(t,e,r){"use strict";e.exports=function(t,e){return e.hoverOnBox&&(t.hoverOnBox=e.hoverOnBox),"xVal"in e&&(t.x=e.xVal),"yVal"in e&&(t.y=e.yVal),e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),t}},{}],287:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),a=t("../../lib"),i=t("../../components/fx"),o=t("../../components/color"),l=t("../scatter/fill_hover_text");function s(t,e,r,l){var s,c,u,f,d,p,h,g,v,y,m,x,b=t.cd,_=t.xa,w=t.ya,k=b[0].trace,T=b[0].t,M="violin"===k.type,A=[],L=T.bdPos,S=T.wHover,C=function(t){return t.pos+T.bPos-p};M&&"both"!==k.side?("positive"===k.side&&(v=function(t){var e=C(t);return i.inbox(e,e+S,y)}),"negative"===k.side&&(v=function(t){var e=C(t);return i.inbox(e-S,e,y)})):v=function(t){var e=C(t);return i.inbox(e-S,e+S,y)},x=M?function(t){return i.inbox(t.span[0]-d,t.span[1]-d,y)}:function(t){return i.inbox(t.min-d,t.max-d,y)},"h"===k.orientation?(d=e,p=r,h=x,g=v,s="y",u=w,c="x",f=_):(d=r,p=e,h=v,g=x,s="x",u=_,c="y",f=w);var O=Math.min(1,L/Math.abs(u.r2c(u.range[1])-u.r2c(u.range[0])));function z(t){return(h(t)+g(t))/2}y=t.maxHoverDistance-O,m=t.maxSpikeDistance-O;var D=i.getDistanceFunction(l,h,g,z);if(i.getClosest(b,D,t),!1===t.index)return[];var P=b[t.index],E=k.line.color,R=(k.marker||{}).color;o.opacity(E)&&k.line.width?t.color=E:o.opacity(R)&&k.boxpoints?t.color=R:t.color=k.fillcolor,t[s+"0"]=u.c2p(P.pos+T.bPos-L,!0),t[s+"1"]=u.c2p(P.pos+T.bPos+L,!0),t[s+"LabelVal"]=P.pos;var I=s+"Spike";t.spikeDistance=z(P)*m/y,t[I]=u.c2p(P.pos,!0);var F={},N=["med","min","q1","q3","max"];(k.boxmean||(k.meanline||{}).visible)&&N.push("mean"),(k.boxpoints||k.points)&&N.push("lf","uf");for(var B=0;B<N.length;B++){var j=N[B];if(j in P&&!(P[j]in F)){F[P[j]]=!0;var H=P[j],q=f.c2p(H,!0),V=a.extendFlat({},t);V[c+"0"]=V[c+"1"]=q,V[c+"LabelVal"]=H,V[c+"Label"]=(T.labels?T.labels[j]+" ":"")+n.hoverLabelText(f,H),V.hoverOnBox=!0,"mean"===j&&"sd"in P&&"sd"===k.boxmean&&(V[c+"err"]=P.sd),t.name="",t.spikeDistance=void 0,t[I]=void 0,A.push(V)}}return A}function c(t,e,r){for(var n,o,s,c=t.cd,u=t.xa,f=t.ya,d=c[0].trace,p=u.c2p(e),h=f.c2p(r),g=i.quadrature(function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(u.c2p(t.x)-p)-e,1-3/e)},function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(f.c2p(t.y)-h)-e,1-3/e)}),v=!1,y=0;y<c.length;y++){o=c[y];for(var m=0;m<(o.pts||[]).length;m++){var x=g(s=o.pts[m]);x<=t.distance&&(t.distance=x,v=[y,m])}}if(!v)return!1;s=(o=c[v[0]]).pts[v[1]];var b,_=u.c2p(s.x,!0),w=f.c2p(s.y,!0),k=s.mrc||1;return n=a.extendFlat({},t,{index:s.i,color:(d.marker||{}).color,name:d.name,x0:_-k,x1:_+k,y0:w-k,y1:w+k,spikeDistance:t.distance}),"h"===d.orientation?(b=f,n.xLabelVal=s.x,n.yLabelVal=o.pos):(b=u,n.xLabelVal=o.pos,n.yLabelVal=s.y),n[b._id.charAt(0)+"Spike"]=b.c2p(o.pos,!0),l(s,d,n),n}e.exports={hoverPoints:function(t,e,r,n){var a,i=t.cd[0].trace.hoveron,o=[];return-1!==i.indexOf("boxes")&&(o=o.concat(s(t,e,r,n))),-1!==i.indexOf("points")&&(a=c(t,e,r)),"closest"===n?a?[a]:o:a?(o.push(a),o):o},hoverOnBoxes:s,hoverOnPoints:c}},{"../../components/color":51,"../../components/fx":90,"../../lib":168,"../../plots/cartesian/axes":212,"../scatter/fill_hover_text":375}],288:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.layoutAttributes=t("./layout_attributes"),n.supplyDefaults=t("./defaults").supplyDefaults,n.supplyLayoutDefaults=t("./layout_defaults").supplyLayoutDefaults,n.calc=t("./calc"),n.crossTraceCalc=t("./cross_trace_calc").crossTraceCalc,n.plot=t("./plot").plot,n.style=t("./style").style,n.styleOnSelect=t("./style").styleOnSelect,n.hoverPoints=t("./hover").hoverPoints,n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="box",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","svg","symbols","oriented","box-violin","showLegend","boxLayout","zoomScale"],n.meta={},e.exports=n},{"../../plots/cartesian":224,"./attributes":282,"./calc":283,"./cross_trace_calc":284,"./defaults":285,"./event_data":286,"./hover":287,"./layout_attributes":289,"./layout_defaults":290,"./plot":291,"./select":292,"./style":293}],289:[function(t,e,r){"use strict";e.exports={boxmode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},boxgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"},boxgroupgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"}}},{}],290:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("./layout_attributes");function o(t,e,r,a,i){for(var o,l=i+"Layout",s=0;s<r.length;s++)if(n.traceIs(r[s],l)){o=!0;break}o&&(a(i+"mode"),a(i+"gap"),a(i+"groupgap"))}e.exports={supplyLayoutDefaults:function(t,e,r){o(0,0,r,function(r,n){return a.coerce(t,e,i,r,n)},"box")},_supply:o}},{"../../lib":168,"../../registry":257,"./layout_attributes":289}],291:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../components/drawing"),o=5,l=.01;function s(t,e,r,i){var o,l,s=e.pos,c=e.val,u=i.bPos,f=i.wdPos||0,d=i.bPosPxOffset||0,p=r.whiskerwidth||0,h=r.notched||!1,g=h?1-2*r.notchwidth:1;Array.isArray(i.bdPos)?(o=i.bdPos[0],l=i.bdPos[1]):(o=i.bdPos,l=i.bdPos);var v=t.selectAll("path.box").data("violin"!==r.type||r.box.visible?a.identity:[]);v.enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","box"),v.exit().remove(),v.each(function(t){if(t.empty)return"M0,0Z";var e=t.pos,i=s.c2p(e+u,!0)+d,v=s.c2p(e+u-o,!0)+d,y=s.c2p(e+u+l,!0)+d,m=s.c2p(e+u-f,!0)+d,x=s.c2p(e+u+f,!0)+d,b=s.c2p(e+u-o*g,!0)+d,_=s.c2p(e+u+l*g,!0)+d,w=c.c2p(t.q1,!0),k=c.c2p(t.q3,!0),T=a.constrain(c.c2p(t.med,!0),Math.min(w,k)+1,Math.max(w,k)-1),M=void 0===t.lf||!1===r.boxpoints,A=c.c2p(M?t.min:t.lf,!0),L=c.c2p(M?t.max:t.uf,!0),S=c.c2p(t.ln,!0),C=c.c2p(t.un,!0);"h"===r.orientation?n.select(this).attr("d","M"+T+","+b+"V"+_+"M"+w+","+v+"V"+y+(h?"H"+S+"L"+T+","+_+"L"+C+","+y:"")+"H"+k+"V"+v+(h?"H"+C+"L"+T+","+b+"L"+S+","+v:"")+"ZM"+w+","+i+"H"+A+"M"+k+","+i+"H"+L+(0===p?"":"M"+A+","+m+"V"+x+"M"+L+","+m+"V"+x)):n.select(this).attr("d","M"+b+","+T+"H"+_+"M"+v+","+w+"H"+y+(h?"V"+S+"L"+_+","+T+"L"+y+","+C:"")+"V"+k+"H"+v+(h?"V"+C+"L"+b+","+T+"L"+v+","+S:"")+"ZM"+i+","+w+"V"+A+"M"+i+","+k+"V"+L+(0===p?"":"M"+m+","+A+"H"+x+"M"+m+","+L+"H"+x))})}function c(t,e,r,n){var s=e.x,c=e.y,u=n.bdPos,f=n.bPos,d=r.boxpoints||r.points;a.seedPseudoRandom();var p=t.selectAll("g.points").data(d?function(t){return t.forEach(function(t){t.t=n,t.trace=r}),t}:[]);p.enter().append("g").attr("class","points"),p.exit().remove();var h=p.selectAll("path").data(function(t){var e,n,i=t.pts2,s=Math.max((t.max-t.min)/10,t.q3-t.q1),c=1e-9*s,p=s*l,h=[],g=0;if(r.jitter){if(0===s)for(g=1,h=new Array(i.length),e=0;e<i.length;e++)h[e]=1;else for(e=0;e<i.length;e++){var v=Math.max(0,e-o),y=i[v].v,m=Math.min(i.length-1,e+o),x=i[m].v;"all"!==d&&(i[e].v<t.lf?x=Math.min(x,t.lf):y=Math.max(y,t.uf));var b=Math.sqrt(p*(m-v)/(x-y+c))||0;b=a.constrain(Math.abs(b),0,1),h.push(b),g=Math.max(b,g)}n=2*r.jitter/(g||1)}for(e=0;e<i.length;e++){var _=i[e],w=_.v,k=r.jitter?n*h[e]*(a.pseudoRandom()-.5):0,T=t.pos+f+u*(r.pointpos+k);"h"===r.orientation?(_.y=T,_.x=w):(_.x=T,_.y=w),"suspectedoutliers"===d&&w<t.uo&&w>t.lo&&(_.so=!0)}return i});h.enter().append("path").classed("point",!0),h.exit().remove(),h.call(i.translatePoints,s,c)}function u(t,e,r,i){var o,l,s=e.pos,c=e.val,u=i.bPos,f=i.bPosPxOffset||0,d=r.boxmean||(r.meanline||{}).visible;Array.isArray(i.bdPos)?(o=i.bdPos[0],l=i.bdPos[1]):(o=i.bdPos,l=i.bdPos);var p=t.selectAll("path.mean").data("box"===r.type&&r.boxmean||"violin"===r.type&&r.box.visible&&r.meanline.visible?a.identity:[]);p.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),p.exit().remove(),p.each(function(t){var e=s.c2p(t.pos+u,!0)+f,a=s.c2p(t.pos+u-o,!0)+f,i=s.c2p(t.pos+u+l,!0)+f,p=c.c2p(t.mean,!0),h=c.c2p(t.mean-t.sd,!0),g=c.c2p(t.mean+t.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+p+","+a+"V"+i+("sd"===d?"m0,0L"+h+","+e+"L"+p+","+a+"L"+g+","+e+"Z":"")):n.select(this).attr("d","M"+a+","+p+"H"+i+("sd"===d?"m0,0L"+e+","+h+"L"+a+","+p+"L"+e+","+g+"Z":""))})}e.exports={plot:function(t,e,r,i){var o=e.xaxis,l=e.yaxis;a.makeTraceGroups(i,r,"trace boxes").each(function(t){var r,a,i=n.select(this),f=t[0],d=f.t,p=f.trace;e.isRangePlot||(f.node3=i),d.wdPos=d.bdPos*p.whiskerwidth,!0!==p.visible||d.empty?i.remove():("h"===p.orientation?(r=l,a=o):(r=o,a=l),s(i,{pos:r,val:a},p,d),c(i,{x:o,y:l},p,d),u(i,{pos:r,val:a},p,d))})},plotBoxAndWhiskers:s,plotPoints:c,plotBoxMean:u}},{"../../components/drawing":72,"../../lib":168,d3:16}],292:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,a=t.cd,i=t.xaxis,o=t.yaxis,l=[];if(!1===e)for(r=0;r<a.length;r++)for(n=0;n<(a[r].pts||[]).length;n++)a[r].pts[n].selected=0;else for(r=0;r<a.length;r++)for(n=0;n<(a[r].pts||[]).length;n++){var s=a[r].pts[n],c=i.c2p(s.x),u=o.c2p(s.y);e.contains([c,u],null,s.i,t)?(l.push({pointNumber:s.i,x:i.c2d(s.x),y:o.c2d(s.y)}),s.selected=1):s.selected=0}return l}},{}],293:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/color"),i=t("../../components/drawing");e.exports={style:function(t,e){var r=e?e[0].node3:n.select(t).selectAll("g.trace.boxes");r.style("opacity",function(t){return t[0].trace.opacity}),r.each(function(e){var r=n.select(this),o=e[0].trace,l=o.line.width;function s(t,e,r,n){t.style("stroke-width",e+"px").call(a.stroke,r).call(a.fill,n)}var c=r.selectAll("path.box");if("candlestick"===o.type)c.each(function(t){if(!t.empty){var e=n.select(this),r=o[t.dir];s(e,r.line.width,r.line.color,r.fillcolor),e.style("opacity",o.selectedpoints&&!t.selected?.3:1)}});else{s(c,l,o.line.color,o.fillcolor),r.selectAll("path.mean").style({"stroke-width":l,"stroke-dasharray":2*l+"px,"+l+"px"}).call(a.stroke,o.line.color);var u=r.selectAll("path.point");i.pointStyle(u,o,t)}})},styleOnSelect:function(t,e){var r=e[0].node3,n=e[0].trace,a=r.selectAll("path.point");n.selectedpoints?i.selectedPointStyle(a,n):i.pointStyle(a,n,t)}}},{"../../components/color":51,"../../components/drawing":72,d3:16}],294:[function(t,e,r){"use strict";var n=t("../heatmap/attributes"),a=t("../scatter/attributes"),i=t("../../components/colorscale/attributes"),o=t("../../components/colorbar/attributes"),l=t("../../components/drawing/attributes").dash,s=t("../../plots/font_attributes"),c=t("../../lib/extend").extendFlat,u=t("../../constants/filter_ops"),f=u.COMPARISON_OPS2,d=u.INTERVAL_OPS,p=a.line;e.exports=c({z:n.z,x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,text:n.text,transpose:n.transpose,xtype:n.xtype,ytype:n.ytype,zhoverformat:n.zhoverformat,connectgaps:n.connectgaps,fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:s({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot"},operation:{valType:"enumerated",values:[].concat(f).concat(d),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:c({},p.color,{editType:"style+colorbars"}),width:c({},p.width,{editType:"style+colorbars"}),dash:l,smoothing:c({},p.smoothing,{}),editType:"plot"}},i("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}),{colorbar:o})},{"../../components/colorbar/attributes":52,"../../components/colorscale/attributes":58,"../../components/drawing/attributes":71,"../../constants/filter_ops":147,"../../lib/extend":162,"../../plots/font_attributes":239,"../heatmap/attributes":316,"../scatter/attributes":367}],295:[function(t,e,r){"use strict";var n=t("../heatmap/calc"),a=t("./set_contours");e.exports=function(t,e){var r=n(t,e);return a(e),r}},{"../heatmap/calc":317,"./set_contours":313}],296:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var a,i,o,l=t[0],s=l.x.length,c=l.y.length,u=l.z,f=n.contours,d=-1/0,p=1/0;for(a=0;a<c;a++)p=Math.min(p,u[a][0]),p=Math.min(p,u[a][s-1]),d=Math.max(d,u[a][0]),d=Math.max(d,u[a][s-1]);for(a=1;a<s-1;a++)p=Math.min(p,u[0][a]),p=Math.min(p,u[c-1][a]),d=Math.max(d,u[0][a]),d=Math.max(d,u[c-1][a]);switch(l.prefixBoundary=!1,e){case">":f.value>d&&(l.prefixBoundary=!0);break;case"<":f.value<p&&(l.prefixBoundary=!0);break;case"[]":i=Math.min.apply(null,f.value),((o=Math.max.apply(null,f.value))<p||i>d)&&(l.prefixBoundary=!0);break;case"][":i=Math.min.apply(null,f.value),o=Math.max.apply(null,f.value),i<p&&o>d&&(l.prefixBoundary=!0)}}},{}],297:[function(t,e,r){"use strict";var n=t("../../components/colorbar/draw"),a=t("./make_color_map"),i=t("./end_plus");e.exports=function(t,e){var r=e[0].trace,o="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+o).remove(),r.showscale){var l=e[0].t.cb=n(t,o),s=r.contours,c=r.line,u=s.size||1,f=s.coloring,d=a(r,{isColorbar:!0});l.fillgradient("heatmap"===f?r.colorscale:"").zrange("heatmap"===f?[r.zmin,r.zmax]:"").fillcolor("fill"===f?d:"").line({color:"lines"===f?d:c.color,width:!1!==s.showlines?c.width:0,dash:c.dash}).levels({start:s.start,end:i(s),size:u}).options(r.colorbar)()}}},{"../../components/colorbar/draw":56,"./end_plus":305,"./make_color_map":310}],298:[function(t,e,r){"use strict";e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},{}],299:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./label_defaults"),i=t("../../components/color"),o=i.addOpacity,l=i.opacity,s=t("../../constants/filter_ops"),c=s.CONSTRAINT_REDUCTION,u=s.COMPARISON_OPS2;e.exports=function(t,e,r,i,s,f){var d,p,h,g=e.contours,v=r("contours.operation");(g._operation=c[v],function(t,e){var r;-1===u.indexOf(e.operation)?(t("contours.value",[0,1]),Array.isArray(e.value)?e.value.length>2?e.value=e.value.slice(2):0===e.length?e.value=[0,1]:e.length<2?(r=parseFloat(e.value[0]),e.value=[r,r+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:n(e.value)&&(r=parseFloat(e.value),e.value=[r,r+1])):(t("contours.value",0),n(e.value)||(Array.isArray(e.value)?e.value=parseFloat(e.value[0]):e.value=0))}(r,g),"="===v?d=g.showlines=!0:(d=r("contours.showlines"),h=r("fillcolor",o((t.line||{}).color||s,.5))),d)&&(p=r("line.color",h&&l(h)?o(e.fillcolor,1):s),r("line.width",2),r("line.dash"));r("line.smoothing"),a(r,i,p,f)}},{"../../components/color":51,"../../constants/filter_ops":147,"./label_defaults":309,"fast-isnumeric":18}],300:[function(t,e,r){"use strict";var n=t("../../constants/filter_ops"),a=t("fast-isnumeric");function i(t,e){var r,i=Array.isArray(e);function o(t){return a(t)?+t:null}return-1!==n.COMPARISON_OPS2.indexOf(t)?r=o(i?e[0]:e):-1!==n.INTERVAL_OPS.indexOf(t)?r=i?[o(e[0]),o(e[1])]:[o(e),o(e)]:-1!==n.SET_OPS.indexOf(t)&&(r=i?e.map(o):[o(e)]),r}function o(t){return function(e){e=i(t,e);var r=Math.min(e[0],e[1]),n=Math.max(e[0],e[1]);return{start:r,end:n,size:n-r}}}function l(t){return function(e){return{start:e=i(t,e),end:1/0,size:1/0}}}e.exports={"[]":o("[]"),"][":o("]["),">":l(">"),"<":l("<"),"=":l("=")}},{"../../constants/filter_ops":147,"fast-isnumeric":18}],301:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var a=n("contours.start"),i=n("contours.end"),o=!1===a||!1===i,l=r("contours.size");!(o?e.autocontour=!0:r("autocontour",!1))&&l||r("ncontours")}},{}],302:[function(t,e,r){"use strict";var n=t("../../lib");function a(t){return n.extendFlat({},t,{edgepaths:n.extendDeep([],t.edgepaths),paths:n.extendDeep([],t.paths)})}e.exports=function(t,e){var r,i,o,l=function(t){return t.reverse()},s=function(t){return t};switch(e){case"=":case"<":return t;case">":for(1!==t.length&&n.warn("Contour data invalid for the specified inequality operation."),i=t[0],r=0;r<i.edgepaths.length;r++)i.edgepaths[r]=l(i.edgepaths[r]);for(r=0;r<i.paths.length;r++)i.paths[r]=l(i.paths[r]);return t;case"][":var c=l;l=s,s=c;case"[]":for(2!==t.length&&n.warn("Contour data invalid for the specified inequality range operation."),i=a(t[0]),o=a(t[1]),r=0;r<i.edgepaths.length;r++)i.edgepaths[r]=l(i.edgepaths[r]);for(r=0;r<i.paths.length;r++)i.paths[r]=l(i.paths[r]);for(;o.edgepaths.length;)i.edgepaths.push(s(o.edgepaths.shift()));for(;o.paths.length;)i.paths.push(s(o.paths.shift()));return[i]}}},{"../../lib":168}],303:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../heatmap/xyz_defaults"),i=t("./constraint_defaults"),o=t("./contours_defaults"),l=t("./style_defaults"),s=t("./attributes");e.exports=function(t,e,r,c){function u(r,a){return n.coerce(t,e,s,r,a)}if(a(t,e,u,c)){u("text");var f="constraint"===u("contours.type");u("connectgaps",n.isArray1D(e.z)),f?i(t,e,u,c,r):(o(t,e,u,function(r){return n.coerce2(t,e,s,r)}),l(t,e,u,c))}else e.visible=!1}},{"../../lib":168,"../heatmap/xyz_defaults":330,"./attributes":294,"./constraint_defaults":299,"./contours_defaults":301,"./style_defaults":315}],304:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./constraint_mapping"),i=t("./end_plus");e.exports=function(t,e,r){for(var o="constraint"===t.type?a[t._operation](t.value):t,l=o.size,s=[],c=i(o),u=r.trace._carpetTrace,f=u?{xaxis:u.aaxis,yaxis:u.baxis,x:r.a,y:r.b}:{xaxis:e.xaxis,yaxis:e.yaxis,x:r.x,y:r.y},d=o.start;d<c;d+=l)if(s.push(n.extendFlat({level:d,crossings:{},starts:[],edgepaths:[],paths:[],z:r.z,smoothing:r.trace.line.smoothing},f)),s.length>1e3){n.warn("Too many contours, clipping at 1000",t);break}return s}},{"../../lib":168,"./constraint_mapping":300,"./end_plus":305}],305:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],306:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./constants");function i(t,e,r,n){return Math.abs(t[0]-e[0])<r&&Math.abs(t[1]-e[1])<n}function o(t,e,r,o,s){var c,u=e.join(","),f=u,d=t.crossings[f],p=function(t,e,r){var n=0,i=0;t>20&&e?208===t||1114===t?n=0===r[0]?1:-1:i=0===r[1]?1:-1:-1!==a.BOTTOMSTART.indexOf(t)?i=1:-1!==a.LEFTSTART.indexOf(t)?n=1:-1!==a.TOPSTART.indexOf(t)?i=-1:n=-1;return[n,i]}(d,r,e),h=[l(t,e,[-p[0],-p[1]])],g=p.join(","),v=t.z.length,y=t.z[0].length;for(c=0;c<1e4;c++){if(d>20?(d=a.CHOOSESADDLE[d][(p[0]||p[1])<0?0:1],t.crossings[f]=a.SADDLEREMAINDER[d]):delete t.crossings[f],!(p=a.NEWDELTA[d])){n.log("Found bad marching index:",d,e,t.level);break}h.push(l(t,e,p)),e[0]+=p[0],e[1]+=p[1],i(h[h.length-1],h[h.length-2],o,s)&&h.pop(),f=e.join(",");var m=p[0]&&(e[0]<0||e[0]>y-2)||p[1]&&(e[1]<0||e[1]>v-2);if(f===u&&p.join(",")===g||r&&m)break;d=t.crossings[f]}1e4===c&&n.log("Infinite loop in contour?");var x,b,_,w,k,T,M,A,L,S,C,O,z,D,P,E=i(h[0],h[h.length-1],o,s),R=0,I=.2*t.smoothing,F=[],N=0;for(c=1;c<h.length;c++)O=h[c],z=h[c-1],void 0,void 0,D=O[2]-z[2],P=O[3]-z[3],R+=M=Math.sqrt(D*D+P*P),F.push(M);var B=R/F.length*I;function j(t){return h[t%h.length]}for(c=h.length-2;c>=N;c--)if((x=F[c])<B){for(_=0,b=c-1;b>=N&&x+F[b]<B;b--)x+=F[b];if(E&&c===h.length-2)for(_=0;_<b&&x+F[_]<B;_++)x+=F[_];k=c-b+_+1,T=Math.floor((c+b+_+2)/2),w=E||c!==h.length-2?E||-1!==b?k%2?j(T):[(j(T)[0]+j(T+1)[0])/2,(j(T)[1]+j(T+1)[1])/2]:h[0]:h[h.length-1],h.splice(b+1,c-b+1,w),c=b+1,_&&(N=_),E&&(c===h.length-2?h[_]=h[h.length-1]:0===c&&(h[h.length-1]=h[0]))}for(h.splice(0,N),c=0;c<h.length;c++)h[c].length=2;if(!(h.length<2))if(E)h.pop(),t.paths.push(h);else{r||n.log("Unclosed interior contour?",t.level,u,h.join("L"));var H=!1;for(A=0;A<t.edgepaths.length;A++)if(S=t.edgepaths[A],!H&&i(S[0],h[h.length-1],o,s)){h.pop(),H=!0;var q=!1;for(L=0;L<t.edgepaths.length;L++)if(i((C=t.edgepaths[L])[C.length-1],h[0],o,s)){q=!0,h.shift(),t.edgepaths.splice(A,1),L===A?t.paths.push(h.concat(C)):(L>A&&L--,t.edgepaths[L]=C.concat(h,S));break}q||(t.edgepaths[A]=h.concat(S))}for(A=0;A<t.edgepaths.length&&!H;A++)i((S=t.edgepaths[A])[S.length-1],h[0],o,s)&&(h.shift(),t.edgepaths[A]=S.concat(h),H=!0);H||t.edgepaths.push(h)}}function l(t,e,r){var n=e[0]+Math.max(r[0],0),a=e[1]+Math.max(r[1],0),i=t.z[a][n],o=t.xaxis,l=t.yaxis;if(r[1]){var s=(t.level-i)/(t.z[a][n+1]-i);return[o.c2p((1-s)*t.x[n]+s*t.x[n+1],!0),l.c2p(t.y[a],!0),n+s,a]}var c=(t.level-i)/(t.z[a+1][n]-i);return[o.c2p(t.x[n],!0),l.c2p((1-c)*t.y[a]+c*t.y[a+1],!0),n,a+c]}e.exports=function(t,e,r){var a,i,l,s;for(e=e||.01,r=r||.01,i=0;i<t.length;i++){for(l=t[i],s=0;s<l.starts.length;s++)o(l,l.starts[s],"edge",e,r);for(a=0;Object.keys(l.crossings).length&&a<1e4;)a++,o(l,Object.keys(l.crossings)[0].split(",").map(Number),void 0,e,r);1e4===a&&n.log("Infinite loop in contour?")}}},{"../../lib":168,"./constants":298}],307:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../heatmap/hover");e.exports=function(t,e,r,i,o){var l=a(t,e,r,i,o,!0);return l&&l.forEach(function(t){var e=t.trace;"constraint"===e.contours.type&&(e.fillcolor&&n.opacity(e.fillcolor)?t.color=n.addOpacity(e.fillcolor,1):e.contours.showlines&&n.opacity(e.line.color)&&(t.color=n.addOpacity(e.line.color,1)))}),l}},{"../../components/color":51,"../heatmap/hover":323}],308:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot").plot,n.style=t("./style"),n.colorbar=t("./colorbar"),n.hoverPoints=t("./hover"),n.moduleType="trace",n.name="contour",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","svg","2dMap","contour","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":224,"./attributes":294,"./calc":295,"./colorbar":297,"./defaults":303,"./hover":307,"./plot":312,"./style":314}],309:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,a){if(a||(a={}),t("contours.showlabels")){var i=e.font;n.coerceFont(t,"contours.labelfont",{family:i.family,size:i.size,color:r}),t("contours.labelformat")}!1!==a.hasHover&&t("zhoverformat")}},{"../../lib":168}],310:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/colorscale"),i=t("./end_plus");e.exports=function(t){var e=t.contours,r=e.start,o=i(e),l=e.size||1,s=Math.floor((o-r)/l)+1,c="lines"===e.coloring?0:1;isFinite(l)||(l=1,s=1);var u,f,d=t.reversescale?a.flipScale(t.colorscale):t.colorscale,p=d.length,h=new Array(p),g=new Array(p);if("heatmap"===e.coloring){for(t.zauto&&!1===t.autocontour&&(t.zmin=r-l/2,t.zmax=t.zmin+s*l),f=0;f<p;f++)u=d[f],h[f]=u[0]*(t.zmax-t.zmin)+t.zmin,g[f]=u[1];var v=n.extent([t.zmin,t.zmax,e.start,e.start+l*(s-1)]),y=v[t.zmin<t.zmax?0:1],m=v[t.zmin<t.zmax?1:0];y!==t.zmin&&(h.splice(0,0,y),g.splice(0,0,Range[0])),m!==t.zmax&&(h.push(m),g.push(g[g.length-1]))}else for(f=0;f<p;f++)u=d[f],h[f]=(u[0]*(s+c-1)-c/2)*l+r,g[f]=u[1];return a.makeColorScaleFunc({domain:h,range:g},{noNumericCheck:!0})}},{"../../components/colorscale":63,"./end_plus":305,d3:16}],311:[function(t,e,r){"use strict";var n=t("./constants");function a(t,e){var r=(e[0][0]>t?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);return 5===r||10===r?t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}e.exports=function(t){var e,r,i,o,l,s,c,u,f,d=t[0].z,p=d.length,h=d[0].length,g=2===p||2===h;for(r=0;r<p-1;r++)for(o=[],0===r&&(o=o.concat(n.BOTTOMSTART)),r===p-2&&(o=o.concat(n.TOPSTART)),e=0;e<h-1;e++)for(i=o.slice(),0===e&&(i=i.concat(n.LEFTSTART)),e===h-2&&(i=i.concat(n.RIGHTSTART)),l=e+","+r,s=[[d[r][e],d[r][e+1]],[d[r+1][e],d[r+1][e+1]]],f=0;f<t.length;f++)(c=a((u=t[f]).level,s))&&(u.crossings[l]=c,-1!==i.indexOf(c)&&(u.starts.push([e,r]),g&&-1!==i.indexOf(c,i.indexOf(c)+1)&&u.starts.push([e,r])))}},{"./constants":298}],312:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../components/drawing"),o=t("../../lib/svg_text_utils"),l=t("../../plots/cartesian/axes"),s=t("../../plots/cartesian/set_convert"),c=t("../heatmap/plot"),u=t("./make_crossings"),f=t("./find_all_paths"),d=t("./empty_pathinfo"),p=t("./convert_to_constraints"),h=t("./close_boundaries"),g=t("./constants"),v=g.LABELOPTIMIZER;function y(t,e){var r,n,o,l,s,c,u,f=function(t,e){var r=t.prefixBoundary;if(void 0===r){var n=Math.min(t.z[0][0],t.z[0][1]);r=!t.edgepaths.length&&n>t.level}return r?"M"+e.join("L")+"Z":""}(t,e),d=0,p=t.edgepaths.map(function(t,e){return e}),h=!0;function g(t){return Math.abs(t[1]-e[2][1])<.01}function v(t){return Math.abs(t[0]-e[0][0])<.01}function y(t){return Math.abs(t[0]-e[2][0])<.01}for(;p.length;){for(c=i.smoothopen(t.edgepaths[d],t.smoothing),f+=h?c:c.replace(/^M/,"L"),p.splice(p.indexOf(d),1),r=t.edgepaths[d][t.edgepaths[d].length-1],l=-1,o=0;o<4;o++){if(!r){a.log("Missing end?",d,t);break}for(u=r,Math.abs(u[1]-e[0][1])<.01&&!y(r)?n=e[1]:v(r)?n=e[0]:g(r)?n=e[3]:y(r)&&(n=e[2]),s=0;s<t.edgepaths.length;s++){var m=t.edgepaths[s][0];Math.abs(r[0]-n[0])<.01?Math.abs(r[0]-m[0])<.01&&(m[1]-r[1])*(n[1]-m[1])>=0&&(n=m,l=s):Math.abs(r[1]-n[1])<.01?Math.abs(r[1]-m[1])<.01&&(m[0]-r[0])*(n[0]-m[0])>=0&&(n=m,l=s):a.log("endpt to newendpt is not vert. or horz.",r,n,m)}if(r=n,l>=0)break;f+="L"+n}if(l===t.edgepaths.length){a.log("unclosed perimeter path");break}d=l,(h=-1===p.indexOf(d))&&(d=p[0],f+="Z")}for(d=0;d<t.paths.length;d++)f+=i.smoothclosed(t.paths[d],t.smoothing);return f}function m(t,e,r,n){var i=e.width/2,o=e.height/2,l=t.x,s=t.y,c=t.theta,u=Math.cos(c)*i,f=Math.sin(c)*i,d=(l>n.center?n.right-l:l-n.left)/(u+Math.abs(Math.sin(c)*o)),p=(s>n.middle?n.bottom-s:s-n.top)/(Math.abs(f)+Math.cos(c)*o);if(d<1||p<1)return 1/0;var h=v.EDGECOST*(1/(d-1)+1/(p-1));h+=v.ANGLECOST*c*c;for(var g=l-u,y=s-f,m=l+u,x=s+f,b=0;b<r.length;b++){var _=r[b],w=Math.cos(_.theta)*_.width/2,k=Math.sin(_.theta)*_.width/2,T=2*a.segmentDistance(g,y,m,x,_.x-w,_.y-k,_.x+w,_.y+k)/(e.height+_.height),M=_.level===e.level,A=M?v.SAMELEVELDISTANCE:1;if(T<=A)return 1/0;h+=v.NEIGHBORCOST*(M?v.SAMELEVELFACTOR:1)/(T-A)}return h}r.plot=function(t,e,o,l){var s=e.xaxis,v=e.yaxis;a.makeTraceGroups(l,o,"contour").each(function(o){var l=n.select(this),m=o[0],x=m.trace,b=m.x,_=m.y,w=x.contours,k=d(w,e,m),T=a.ensureSingle(l,"g","heatmapcoloring"),M=[];"heatmap"===w.coloring&&(x.zauto&&!1===x.autocontour&&(x._input.zmin=x.zmin=w.start-w.size/2,x._input.zmax=x.zmax=x.zmin+k.length*w.size),M=[o]),c(t,e,M,T),u(k),f(k);var A=s.c2p(b[0],!0),L=s.c2p(b[b.length-1],!0),S=v.c2p(_[0],!0),C=v.c2p(_[_.length-1],!0),O=[[A,C],[L,C],[L,S],[A,S]],z=k;"constraint"===w.type&&(z=p(k,w._operation),h(z,w._operation,O,x)),function(t,e,r){var n=a.ensureSingle(t,"g","contourbg").selectAll("path").data("fill"===r.coloring?[0]:[]);n.enter().append("path"),n.exit().remove(),n.attr("d","M"+e.join("L")+"Z").style("stroke","none")}(l,O,w),function(t,e,r,i){var o=a.ensureSingle(t,"g","contourfill").selectAll("path").data("fill"===i.coloring||"constraint"===i.type&&"="!==i._operation?e:[]);o.enter().append("path"),o.exit().remove(),o.each(function(t){var e=y(t,r);e?n.select(this).attr("d",e).style("stroke","none"):n.select(this).remove()})}(l,z,O,w),function(t,e,o,l,s,c){var u=a.ensureSingle(t,"g","contourlines"),f=!1!==s.showlines,d=s.showlabels,p=f&&d,h=r.createLines(u,f||d,e),v=r.createLineClip(u,p,o,l.trace.uid),y=t.selectAll("g.contourlabels").data(d?[0]:[]);if(y.exit().remove(),y.enter().append("g").classed("contourlabels",!0),d){var m=[],x=[];a.clearLocationCache();var b=r.labelFormatter(s,l.t.cb,o._fullLayout),_=i.tester.append("text").attr("data-notex",1).call(i.font,s.labelfont),w=e[0].xaxis,k=e[0].yaxis,T=w._length,M=k._length,A=w.range,L=k.range,S=Math.max(c[0][0],0),C=Math.min(c[2][0],T),O=Math.max(c[0][1],0),z=Math.min(c[2][1],M),D={};A[0]<A[1]?(D.left=S,D.right=C):(D.left=C,D.right=S),L[0]<L[1]?(D.top=O,D.bottom=z):(D.top=z,D.bottom=O),D.middle=(D.top+D.bottom)/2,D.center=(D.left+D.right)/2,m.push([[D.left,D.top],[D.right,D.top],[D.right,D.bottom],[D.left,D.bottom]]);var P=Math.sqrt(T*T+M*M),E=g.LABELDISTANCE*P/Math.max(1,e.length/g.LABELINCREASE);h.each(function(t){var e=r.calcTextOpts(t.level,b,_,o);n.select(this).selectAll("path").each(function(){var t=a.getVisibleSegment(this,D,e.height/2);if(t&&!(t.len<(e.width+e.height)*g.LABELMIN))for(var n=Math.min(Math.ceil(t.len/E),g.LABELMAX),i=0;i<n;i++){var o=r.findBestTextLocation(this,t,e,x,D);if(!o)break;r.addLabelData(o,e,x,m)}})}),_.remove(),r.drawLabels(y,x,o,v,p?m:null)}d&&!f&&h.remove()}(l,k,t,m,w,O),function(t,e,r,n,o){var l=r._fullLayout._clips,s="clip"+n.trace.uid,c=l.selectAll("#"+s).data(n.trace.connectgaps?[]:[0]);if(c.enter().append("clipPath").classed("contourclip",!0).attr("id",s),c.exit().remove(),!1===n.trace.connectgaps){var d={level:.9,crossings:{},starts:[],edgepaths:[],paths:[],xaxis:e.xaxis,yaxis:e.yaxis,x:n.x,y:n.y,z:function(t){var e,r,n=t.trace._emptypoints,a=[],i=t.z.length,o=t.z[0].length,l=[];for(e=0;e<o;e++)l.push(1);for(e=0;e<i;e++)a.push(l.slice());for(e=0;e<n.length;e++)r=n[e],a[r[0]][r[1]]=0;return t.zmask=a,a}(n),smoothing:0};u([d]),f([d]);var p=y(d,o),h=a.ensureSingle(c,"path","");h.attr("d",p)}else s=null;i.setClipUrl(t,s,r)}(l,e,t,m,O)})},r.createLines=function(t,e,r){var n=r[0].smoothing,a=t.selectAll("g.contourlevel").data(e?r:[]);if(a.exit().remove(),a.enter().append("g").classed("contourlevel",!0),e){var o=a.selectAll("path.openline").data(function(t){return t.pedgepaths||t.edgepaths});o.exit().remove(),o.enter().append("path").classed("openline",!0),o.attr("d",function(t){return i.smoothopen(t,n)}).style("stroke-miterlimit",1).style("vector-effect","non-scaling-stroke");var l=a.selectAll("path.closedline").data(function(t){return t.ppaths||t.paths});l.exit().remove(),l.enter().append("path").classed("closedline",!0),l.attr("d",function(t){return i.smoothclosed(t,n)}).style("stroke-miterlimit",1).style("vector-effect","non-scaling-stroke")}return a},r.createLineClip=function(t,e,r,n){var a=e?"clipline"+n:null,o=r._fullLayout._clips.selectAll("#"+a).data(e?[0]:[]);return o.exit().remove(),o.enter().append("clipPath").classed("contourlineclip",!0).attr("id",a),i.setClipUrl(t,a,r),o},r.labelFormatter=function(t,e,r){if(t.labelformat)return r._d3locale.numberFormat(t.labelformat);var n;if(e)n=e.axis;else{if(n={type:"linear",_id:"ycontour",showexponent:"all",exponentformat:"B"},"constraint"===t.type){var a=t.value;Array.isArray(a)?n.range=[a[0],a[a.length-1]]:n.range=[a,a]}else n.range=[t.start,t.end],n.nticks=(t.end-t.start)/t.size;n.range[0]===n.range[1]&&(n.range[1]+=n.range[0]||1),n.nticks||(n.nticks=1e3),s(n,r),l.prepTicks(n),n._tmin=null,n._tmax=null}return function(t){return l.tickText(n,t).text}},r.calcTextOpts=function(t,e,r,n){var a=e(t);r.text(a).call(o.convertToTspans,n);var l=i.bBox(r.node(),!0);return{text:a,width:l.width,height:l.height,level:t,dy:(l.top+l.bottom)/2}},r.findBestTextLocation=function(t,e,r,n,i){var o,l,s,c,u,f=r.width;e.isClosed?(l=e.len/v.INITIALSEARCHPOINTS,o=e.min+l/2,s=e.max):(l=(e.len-f)/(v.INITIALSEARCHPOINTS+1),o=e.min+l+f/2,s=e.max-(l+f)/2);for(var d=1/0,p=0;p<v.ITERATIONS;p++){for(var h=o;h<s;h+=l){var g=a.getTextLocation(t,e.total,h,f),y=m(g,r,n,i);y<d&&(d=y,u=g,c=h)}if(d>2*v.MAXCOST)break;p&&(l/=2),s=(o=c-l/2)+1.5*l}if(d<=v.MAXCOST)return u},r.addLabelData=function(t,e,r,n){var a=e.width/2,i=e.height/2,o=t.x,l=t.y,s=t.theta,c=Math.sin(s),u=Math.cos(s),f=a*u,d=i*c,p=a*c,h=-i*u,g=[[o-f-d,l-p-h],[o+f-d,l+p-h],[o+f+d,l+p+h],[o-f+d,l-p+h]];r.push({text:e.text,x:o,y:l,dy:e.dy,theta:s,level:e.level,width:e.width,height:e.height}),n.push(g)},r.drawLabels=function(t,e,r,i,l){var s=t.selectAll("text").data(e,function(t){return t.text+","+t.x+","+t.y+","+t.theta});if(s.exit().remove(),s.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each(function(t){var e=t.x+Math.sin(t.theta)*t.dy,a=t.y-Math.cos(t.theta)*t.dy;n.select(this).text(t.text).attr({x:e,y:a,transform:"rotate("+180*t.theta/Math.PI+" "+e+" "+a+")"}).call(o.convertToTspans,r)}),l){for(var c="",u=0;u<l.length;u++)c+="M"+l[u].join("L")+"Z";a.ensureSingle(i,"path","").attr("d",c)}}},{"../../components/drawing":72,"../../lib":168,"../../lib/svg_text_utils":189,"../../plots/cartesian/axes":212,"../../plots/cartesian/set_convert":231,"../heatmap/plot":327,"./close_boundaries":296,"./constants":298,"./convert_to_constraints":302,"./empty_pathinfo":304,"./find_all_paths":306,"./make_crossings":311,d3:16}],313:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),a=t("../../lib");function i(t,e,r){var a={type:"linear",range:[t,e]};return n.autoTicks(a,(e-t)/(r||15)),a}e.exports=function(t){var e=t.contours;if(t.autocontour){var r=t.zmin,o=t.zmax;void 0!==r&&void 0!==o||(r=a.aggNums(Math.min,null,t._z),o=a.aggNums(Math.max,null,t._z));var l=i(r,o,t.ncontours);e.size=l.dtick,e.start=n.tickFirst(l),l.range.reverse(),e.end=n.tickFirst(l),e.start===r&&(e.start+=e.size),e.end===o&&(e.end-=e.size),e.start>e.end&&(e.start=e.end=(e.start+e.end)/2),t._input.contours||(t._input.contours={}),a.extendFlat(t._input.contours,{start:e.start,end:e.end,size:e.size}),t._input.autocontour=!0}else if("constraint"!==e.type){var s,c=e.start,u=e.end,f=t._input.contours;if(c>u&&(e.start=f.start=u,u=e.end=f.end=c,c=e.start),!(e.size>0))s=c===u?1:i(c,u,t.ncontours).dtick,f.size=e.size=s}}},{"../../lib":168,"../../plots/cartesian/axes":212}],314:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/drawing"),i=t("../heatmap/style"),o=t("./make_color_map");e.exports=function(t){var e=n.select(t).selectAll("g.contour");e.style("opacity",function(t){return t[0].trace.opacity}),e.each(function(t){var e=n.select(this),r=t[0].trace,i=r.contours,l=r.line,s=i.size||1,c=i.start,u="constraint"===i.type,f=!u&&"lines"===i.coloring,d=!u&&"fill"===i.coloring,p=f||d?o(r):null;e.selectAll("g.contourlevel").each(function(t){n.select(this).selectAll("path").call(a.lineGroupStyle,l.width,f?p(t.level):l.color,l.dash)});var h=i.labelfont;if(e.selectAll("g.contourlabels text").each(function(t){a.font(n.select(this),{family:h.family,size:h.size,color:h.color||(f?p(t.level):l.color)})}),u)e.selectAll("g.contourfill path").style("fill",r.fillcolor);else if(d){var g;e.selectAll("g.contourfill path").style("fill",function(t){return void 0===g&&(g=t.level),p(t.level+.5*s)}),void 0===g&&(g=c),e.selectAll("g.contourbg path").style("fill",p(g-.5*s))}}),i(t)}},{"../../components/drawing":72,"../heatmap/style":328,"./make_color_map":310,d3:16}],315:[function(t,e,r){"use strict";var n=t("../../components/colorscale/defaults"),a=t("./label_defaults");e.exports=function(t,e,r,i,o){var l,s=r("contours.coloring"),c="";"fill"===s&&(l=r("contours.showlines")),!1!==l&&("lines"!==s&&(c=r("line.color","#000")),r("line.width",.5),r("line.dash")),"none"!==s&&(!0!==t.showlegend&&(e.showlegend=!1),e._dfltShowLegend=!1,n(t,e,i,r,{prefix:"",cLetter:"z"})),r("line.smoothing"),a(r,i,c,o)}},{"../../components/colorscale/defaults":61,"./label_defaults":309}],316:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../../components/colorscale/attributes"),i=t("../../components/colorbar/attributes"),o=t("../../lib/extend").extendFlat;e.exports=o({z:{valType:"data_array",editType:"calc"},x:o({},n.x,{impliedEdits:{xtype:"array"}}),x0:o({},n.x0,{impliedEdits:{xtype:"scaled"}}),dx:o({},n.dx,{impliedEdits:{xtype:"scaled"}}),y:o({},n.y,{impliedEdits:{ytype:"array"}}),y0:o({},n.y0,{impliedEdits:{ytype:"scaled"}}),dy:o({},n.dy,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},zhoverformat:{valType:"string",dflt:"",editType:"none"},transforms:void 0},a("",{cLetter:"z",autoColorDflt:!1}),{colorbar:i})},{"../../components/colorbar/attributes":52,"../../components/colorscale/attributes":58,"../../lib/extend":162,"../scatter/attributes":367}],317:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=t("../histogram2d/calc"),l=t("../../components/colorscale/calc"),s=t("./convert_column_xyz"),c=t("./clean_2d_array"),u=t("./interp2d"),f=t("./find_empties"),d=t("./make_bound_array");e.exports=function(t,e){var r,p,h,g,v,y,m,x,b,_=i.getFromId(t,e.xaxis||"x"),w=i.getFromId(t,e.yaxis||"y"),k=n.traceIs(e,"contour"),T=n.traceIs(e,"histogram"),M=n.traceIs(e,"gl2d"),A=k?"best":e.zsmooth;if(_._minDtick=0,w._minDtick=0,T)r=(b=o(t,e)).x,p=b.x0,h=b.dx,g=b.y,v=b.y0,y=b.dy,m=b.z;else{var L=e.z;a.isArray1D(L)?(s(e,_,w,"x","y",["z"]),r=e._x,g=e._y,L=e._z):(r=e.x?_.makeCalcdata(e,"x"):[],g=e.y?w.makeCalcdata(e,"y"):[]),p=e.x0||0,h=e.dx||1,v=e.y0||0,y=e.dy||1,m=c(L,e.transpose),(k||e.connectgaps)&&(e._emptypoints=f(m),u(m,e._emptypoints))}function S(t){A=e._input.zsmooth=e.zsmooth=!1,a.warn('cannot use zsmooth: "fast": '+t)}if("fast"===A)if("log"===_.type||"log"===w.type)S("log axis found");else if(!T){if(r.length){var C=(r[r.length-1]-r[0])/(r.length-1),O=Math.abs(C/100);for(x=0;x<r.length-1;x++)if(Math.abs(r[x+1]-r[x]-C)>O){S("x scale is not linear");break}}if(g.length&&"fast"===A){var z=(g[g.length-1]-g[0])/(g.length-1),D=Math.abs(z/100);for(x=0;x<g.length-1;x++)if(Math.abs(g[x+1]-g[x]-z)>D){S("y scale is not linear");break}}}var P=a.maxRowLength(m),E="scaled"===e.xtype?"":r,R=d(e,E,p,h,P,_),I="scaled"===e.ytype?"":g,F=d(e,I,v,y,m.length,w);M||(e._extremes[_._id]=i.findExtremes(_,R),e._extremes[w._id]=i.findExtremes(w,F));var N={x:R,y:F,z:m,text:e._text||e.text};if(E&&E.length===R.length-1&&(N.xCenter=E),I&&I.length===F.length-1&&(N.yCenter=I),T&&(N.xRanges=b.xRanges,N.yRanges=b.yRanges,N.pts=b.pts),k&&"constraint"===e.contours.type||l(t,e,{vals:m,containerStr:"",cLetter:"z"}),k&&e.contours&&"heatmap"===e.contours.coloring){var B={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};N.xfill=d(B,E,p,h,P,_),N.yfill=d(B,I,v,y,m.length,w)}return[N]}},{"../../components/colorscale/calc":59,"../../lib":168,"../../plots/cartesian/axes":212,"../../registry":257,"../histogram2d/calc":345,"./clean_2d_array":318,"./convert_column_xyz":320,"./find_empties":322,"./interp2d":325,"./make_bound_array":326}],318:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){var r,a,i,o,l,s;function c(t){if(n(t))return+t}if(e){for(r=0,l=0;l<t.length;l++)r=Math.max(r,t[l].length);if(0===r)return!1;i=function(t){return t.length},o=function(t,e,r){return t[r][e]}}else r=t.length,i=function(t,e){return t[e].length},o=function(t,e,r){return t[e][r]};var u=new Array(r);for(l=0;l<r;l++)for(a=i(t,l),u[l]=new Array(a),s=0;s<a;s++)u[l][s]=c(o(t,l,s));return u}},{"fast-isnumeric":18}],319:[function(t,e,r){"use strict";e.exports={min:"zmin",max:"zmax"}},{}],320:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r,i,o,l){var s,c,u,f=t._length,d=e.makeCalcdata(t,i),p=r.makeCalcdata(t,o),h=t.text,g=void 0!==h&&n.isArray1D(h),v=n.distinctVals(d),y=v.vals,m=n.distinctVals(p),x=m.vals,b=[];for(s=0;s<l.length;s++)b[s]=n.init2dArray(x.length,y.length);for(g&&(u=n.init2dArray(x.length,y.length)),s=0;s<f;s++)if(d[s]!==a&&p[s]!==a){var _=n.findBin(d[s]+v.minDiff/2,y),w=n.findBin(p[s]+m.minDiff/2,x);for(c=0;c<l.length;c++){var k=t[l[c]];b[c][w][_]=k[s]}g&&(u[w][_]=h[s])}for(t["_"+i]=y,t["_"+o]=x,c=0;c<l.length;c++)t["_"+l[c]]=b[c];g&&(t._text=u)}},{"../../constants/numerical":149,"../../lib":168}],321:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./xyz_defaults"),i=t("./style_defaults"),o=t("../../components/colorscale/defaults"),l=t("./attributes");e.exports=function(t,e,r,s){function c(r,a){return n.coerce(t,e,l,r,a)}a(t,e,c,s)?(c("text"),i(t,e,c,s),c("connectgaps",n.isArray1D(e.z)&&!1!==e.zsmooth),o(t,e,s,c,{prefix:"",cLetter:"z"})):e.visible=!1}},{"../../components/colorscale/defaults":61,"../../lib":168,"./attributes":316,"./style_defaults":329,"./xyz_defaults":330}],322:[function(t,e,r){"use strict";var n=t("../../lib").maxRowLength;e.exports=function(t){var e,r,a,i,o,l,s,c,u=[],f={},d=[],p=t[0],h=[],g=[0,0,0],v=n(t);for(r=0;r<t.length;r++)for(e=h,h=p,p=t[r+1]||[],a=0;a<v;a++)void 0===h[a]&&((l=(void 0!==h[a-1]?1:0)+(void 0!==h[a+1]?1:0)+(void 0!==e[a]?1:0)+(void 0!==p[a]?1:0))?(0===r&&l++,0===a&&l++,r===t.length-1&&l++,a===h.length-1&&l++,l<4&&(f[[r,a]]=[r,a,l]),u.push([r,a,l])):d.push([r,a]));for(;d.length;){for(s={},c=!1,o=d.length-1;o>=0;o--)(l=((f[[(r=(i=d[o])[0])-1,a=i[1]]]||g)[2]+(f[[r+1,a]]||g)[2]+(f[[r,a-1]]||g)[2]+(f[[r,a+1]]||g)[2])/20)&&(s[i]=[r,a,l],d.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(i in s)f[i]=s[i],u.push(s[i])}return u.sort(function(t,e){return e[2]-t[2]})}},{"../../lib":168}],323:[function(t,e,r){"use strict";var n=t("../../components/fx"),a=t("../../lib"),i=t("../../plots/cartesian/axes");e.exports=function(t,e,r,o,l,s){var c,u,f,d,p=t.cd[0],h=p.trace,g=t.xa,v=t.ya,y=p.x,m=p.y,x=p.z,b=p.xCenter,_=p.yCenter,w=p.zmask,k=[h.zmin,h.zmax],T=h.zhoverformat,M=y,A=m;if(!1!==t.index){try{f=Math.round(t.index[1]),d=Math.round(t.index[0])}catch(e){return void a.error("Error hovering on heatmap, pointNumber must be [row,col], found:",t.index)}if(f<0||f>=x[0].length||d<0||d>x.length)return}else{if(n.inbox(e-y[0],e-y[y.length-1],0)>0||n.inbox(r-m[0],r-m[m.length-1],0)>0)return;if(s){var L;for(M=[2*y[0]-y[1]],L=1;L<y.length;L++)M.push((y[L]+y[L-1])/2);for(M.push([2*y[y.length-1]-y[y.length-2]]),A=[2*m[0]-m[1]],L=1;L<m.length;L++)A.push((m[L]+m[L-1])/2);A.push([2*m[m.length-1]-m[m.length-2]])}f=Math.max(0,Math.min(M.length-2,a.findBin(e,M))),d=Math.max(0,Math.min(A.length-2,a.findBin(r,A)))}var S=g.c2p(y[f]),C=g.c2p(y[f+1]),O=v.c2p(m[d]),z=v.c2p(m[d+1]);s?(C=S,c=y[f],z=O,u=m[d]):(c=b?b[f]:(y[f]+y[f+1])/2,u=_?_[d]:(m[d]+m[d+1])/2,h.zsmooth&&(S=C=g.c2p(c),O=z=v.c2p(u)));var D,P,E=x[d][f];w&&!w[d][f]&&(E=void 0),Array.isArray(p.text)&&Array.isArray(p.text[d])&&(D=p.text[d][f]);var R={type:"linear",range:k,hoverformat:T,_separators:g._separators,_numFormat:g._numFormat};return P=i.tickText(R,E,"hover").text,[a.extendFlat(t,{index:[d,f],distance:t.maxHoverDistance,spikeDistance:t.maxSpikeDistance,x0:S,x1:C,y0:O,y1:z,xLabelVal:c,yLabelVal:u,zLabelVal:E,zLabel:P,text:D})]}},{"../../components/fx":90,"../../lib":168,"../../plots/cartesian/axes":212}],324:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.moduleType="trace",n.name="heatmap",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","svg","2dMap"],n.meta={},e.exports=n},{"../../plots/cartesian":224,"./attributes":316,"./calc":317,"./colorbar":319,"./defaults":321,"./hover":323,"./plot":327,"./style":328}],325:[function(t,e,r){"use strict";var n=t("../../lib"),a=[[-1,0],[1,0],[0,-1],[0,1]];function i(t){return.5-.25*Math.min(1,.5*t)}function o(t,e,r){var n,i,o,l,s,c,u,f,d,p,h,g,v,y=0;for(l=0;l<e.length;l++){for(i=(n=e[l])[0],o=n[1],h=t[i][o],p=0,d=0,s=0;s<4;s++)(u=t[i+(c=a[s])[0]])&&void 0!==(f=u[o+c[1]])&&(0===p?g=v=f:(g=Math.min(g,f),v=Math.max(v,f)),d++,p+=f);if(0===d)throw"iterateInterp2d order is wrong: no defined neighbors";t[i][o]=p/d,void 0===h?d<4&&(y=1):(t[i][o]=(1+r)*t[i][o]-r*h,v>g&&(y=Math.max(y,Math.abs(t[i][o]-h)/(v-g))))}return y}e.exports=function(t,e){var r,a=1;for(o(t,e),r=0;r<e.length&&!(e[r][2]<4);r++);for(e=e.slice(r),r=0;r<100&&a>.01;r++)a=o(t,e,i(a));return a>.01&&n.log("interp2d didn't converge quickly",a),t}},{"../../lib":168}],326:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,i,o,l){var s,c,u,f=[],d=n.traceIs(t,"contour"),p=n.traceIs(t,"histogram"),h=n.traceIs(t,"gl2d");if(a(e)&&e.length>1&&!p&&"category"!==l.type){var g=e.length;if(!(g<=o))return d?e.slice(0,o):e.slice(0,o+1);if(d||h)f=e.slice(0,o);else if(1===o)f=[e[0]-.5,e[0]+.5];else{for(f=[1.5*e[0]-.5*e[1]],u=1;u<g;u++)f.push(.5*(e[u-1]+e[u]));f.push(1.5*e[g-1]-.5*e[g-2])}if(g<o){var v=f[f.length-1],y=v-f[f.length-2];for(u=g;u<o;u++)v+=y,f.push(v)}}else{c=i||1;var m=t[l._id.charAt(0)+"calendar"];for(s=p||"category"===l.type||"multicategory"===l.type?l.r2c(r,0,m)||0:a(e)&&1===e.length?e[0]:void 0===r?0:l.d2c(r,0,m),u=d||h?0:-.5;u<o;u++)f.push(s+c*u)}return f}},{"../../lib":168,"../../registry":257}],327:[function(t,e,r){"use strict";var n=t("d3"),a=t("tinycolor2"),i=t("../../registry"),o=t("../../lib"),l=t("../../components/colorscale"),s=t("../../constants/xmlns_namespaces");function c(t,e){var r=e.length-2,n=o.constrain(o.findBin(t,e),0,r),a=e[n],i=e[n+1],l=o.constrain(n+(t-a)/(i-a)-.5,0,r),s=Math.round(l),c=Math.abs(l-s);return l&&l!==r&&c?{bin0:s,frac:c,bin1:Math.round(s+c/(l-s))}:{bin0:s,bin1:s,frac:0}}function u(t,e){var r=e.length-1,n=o.constrain(o.findBin(t,e),0,r),a=e[n],i=(t-a)/(e[n+1]-a)||0;return i<=0?{bin0:n,bin1:n,frac:0}:i<.5?{bin0:n,bin1:n+1,frac:i}:{bin0:n+1,bin1:n,frac:1-i}}function f(t,e,r){t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=Math.round(255*r[3])}e.exports=function(t,e,r,d){var p=e.xaxis,h=e.yaxis;o.makeTraceGroups(d,r,"hm").each(function(e){var r,d,g,v,y,m,x=n.select(this),b=e[0],_=b.trace,w=b.z,k=b.x,T=b.y,M=b.xCenter,A=b.yCenter,L=i.traceIs(_,"contour"),S=L?"best":_.zsmooth,C=w.length,O=o.maxRowLength(w),z=!1,D=!1;for(m=0;void 0===r&&m<k.length-1;)r=p.c2p(k[m]),m++;for(m=k.length-1;void 0===d&&m>0;)d=p.c2p(k[m]),m--;for(d<r&&(g=d,d=r,r=g,z=!0),m=0;void 0===v&&m<T.length-1;)v=h.c2p(T[m]),m++;for(m=T.length-1;void 0===y&&m>0;)y=h.c2p(T[m]),m--;if(y<v&&(g=v,v=y,y=g,D=!0),L&&(M=k,A=T,k=b.xfill,T=b.yfill),"fast"!==S){var P="best"===S?0:.5;r=Math.max(-P*p._length,r),d=Math.min((1+P)*p._length,d),v=Math.max(-P*h._length,v),y=Math.min((1+P)*h._length,y)}var E=Math.round(d-r),R=Math.round(y-v);if(E<=0||R<=0){x.selectAll("image").data([]).exit().remove()}else{var I,F;"fast"===S?(I=O,F=C):(I=E,F=R);var N=document.createElement("canvas");N.width=I,N.height=F;var B,j,H=N.getContext("2d"),q=l.makeColorScaleFunc(l.extractScale(_,{cLetter:"z"}),{noNumericCheck:!0,returnArray:!0});"fast"===S?(B=z?function(t){return O-1-t}:o.identity,j=D?function(t){return C-1-t}:o.identity):(B=function(t){return o.constrain(Math.round(p.c2p(k[t])-r),0,E)},j=function(t){return o.constrain(Math.round(h.c2p(T[t])-v),0,R)});var V,U,G,Z,X,Y=j(0),W=[Y,Y],J=z?0:1,$=D?0:1,Q=0,K=0,tt=0,et=0;if(S){var rt,nt=0;try{rt=new Uint8Array(E*R*4)}catch(t){rt=new Array(E*R*4)}if("best"===S){var at,it,ot,lt=M||k,st=A||T,ct=new Array(lt.length),ut=new Array(st.length),ft=new Array(E),dt=M?u:c,pt=A?u:c;for(m=0;m<lt.length;m++)ct[m]=Math.round(p.c2p(lt[m])-r);for(m=0;m<st.length;m++)ut[m]=Math.round(h.c2p(st[m])-v);for(m=0;m<E;m++)ft[m]=dt(m,ct);for(U=0;U<R;U++)for(it=w[(at=pt(U,ut)).bin0],ot=w[at.bin1],m=0;m<E;m++,nt+=4)f(rt,nt,X=Tt(it,ot,ft[m],at))}else for(U=0;U<C;U++)for(Z=w[U],W=j(U),m=0;m<E;m++)X=kt(Z[m],1),f(rt,nt=4*(W*E+B(m)),X);var ht=H.createImageData(E,R);try{ht.data.set(rt)}catch(t){var gt=ht.data,vt=gt.length;for(U=0;U<vt;U++)gt[U]=rt[U]}H.putImageData(ht,0,0)}else{var yt=_.xgap,mt=_.ygap,xt=Math.floor(yt/2),bt=Math.floor(mt/2);for(U=0;U<C;U++)if(Z=w[U],W.reverse(),W[$]=j(U+1),W[0]!==W[1]&&void 0!==W[0]&&void 0!==W[1])for(V=[G=B(0),G],m=0;m<O;m++)V.reverse(),V[J]=B(m+1),V[0]!==V[1]&&void 0!==V[0]&&void 0!==V[1]&&(X=kt(Z[m],(V[1]-V[0])*(W[1]-W[0])),H.fillStyle="rgba("+X.join(",")+")",H.fillRect(V[0]+xt,W[0]+bt,V[1]-V[0]-yt,W[1]-W[0]-mt))}K=Math.round(K/Q),tt=Math.round(tt/Q),et=Math.round(et/Q);var _t=a("rgb("+K+","+tt+","+et+")");t._hmpixcount=(t._hmpixcount||0)+Q,t._hmlumcount=(t._hmlumcount||0)+Q*_t.getLuminance();var wt=x.selectAll("image").data(e);wt.enter().append("svg:image").attr({xmlns:s.svg,preserveAspectRatio:"none"}),wt.attr({height:R,width:E,x:r,y:v,"xlink:href":N.toDataURL("image/png")})}function kt(t,e){if(void 0!==t){var r=q(t);return r[0]=Math.round(r[0]),r[1]=Math.round(r[1]),r[2]=Math.round(r[2]),Q+=e,K+=r[0]*e,tt+=r[1]*e,et+=r[2]*e,r}return[0,0,0,0]}function Tt(t,e,r,n){var a=t[r.bin0];if(void 0===a)return kt(void 0,1);var i,o=t[r.bin1],l=e[r.bin0],s=e[r.bin1],c=o-a||0,u=l-a||0;return i=void 0===o?void 0===s?0:void 0===l?2*(s-a):2*(2*s-l-a)/3:void 0===s?void 0===l?0:2*(2*a-o-l)/3:void 0===l?2*(2*s-o-a)/3:s+a-o-l,kt(a+r.frac*c+n.frac*(u+r.frac*i))}})}},{"../../components/colorscale":63,"../../constants/xmlns_namespaces":150,"../../lib":168,"../../registry":257,d3:16,tinycolor2:34}],328:[function(t,e,r){"use strict";var n=t("d3");e.exports=function(t){n.select(t).selectAll(".hm image").style("opacity",function(t){return t.trace.opacity})}},{d3:16}],329:[function(t,e,r){"use strict";e.exports=function(t,e,r){!1===r("zsmooth")&&(r("xgap"),r("ygap")),r("zhoverformat")}},{}],330:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../registry");function o(t,e){var r=e(t);return"scaled"===(r?e(t+"type","array"):"scaled")&&(e(t+"0"),e("d"+t)),r}e.exports=function(t,e,r,l,s,c){var u,f,d=r("z");if(s=s||"x",c=c||"y",void 0===d||!d.length)return 0;if(a.isArray1D(t.z)){u=r(s),f=r(c);var p=a.minRowLength(u),h=a.minRowLength(f);if(0===p||0===h)return 0;e._length=Math.min(p,h,d.length)}else{if(u=o(s,r),f=o(c,r),!function(t){for(var e,r=!0,i=!1,o=!1,l=0;l<t.length;l++){if(e=t[l],!a.isArrayOrTypedArray(e)){r=!1;break}e.length>0&&(i=!0);for(var s=0;s<e.length;s++)if(n(e[s])){o=!0;break}}return r&&i&&o}(d))return 0;r("transpose"),e._length=null}return i.getComponentMethod("calendars","handleTraceDefaults")(t,e,[s,c],l),!0}},{"../../lib":168,"../../registry":257,"fast-isnumeric":18}],331:[function(t,e,r){"use strict";var n=t("../bar/attributes"),a=t("../../components/fx/hovertemplate_attributes"),i=t("./bin_attributes"),o=t("./constants");e.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},text:n.text,orientation:n.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count",editType:"calc"},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:"",editType:"calc"},cumulative:{enabled:{valType:"boolean",dflt:!1,editType:"calc"},direction:{valType:"enumerated",values:["increasing","decreasing"],dflt:"increasing",editType:"calc"},currentbin:{valType:"enumerated",values:["include","exclude","half"],dflt:"include",editType:"calc"},editType:"calc"},nbinsx:{valType:"integer",min:0,dflt:0,editType:"calc"},xbins:i("x",!0),nbinsy:{valType:"integer",min:0,dflt:0,editType:"calc"},ybins:i("y",!0),autobinx:{valType:"boolean",dflt:null,editType:"calc"},autobiny:{valType:"boolean",dflt:null,editType:"calc"},hovertemplate:a({},{keys:o.eventDataKeys}),marker:n.marker,selected:n.selected,unselected:n.unselected,_deprecated:{bardir:n._deprecated.bardir}}},{"../../components/fx/hovertemplate_attributes":89,"../bar/attributes":267,"./bin_attributes":333,"./constants":337}],332:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=t.length,n=0,a=0;a<r;a++)e[a]?(t[a]/=e[a],n+=t[a]):t[a]=null;return n}},{}],333:[function(t,e,r){"use strict";e.exports=function(t,e){return{start:{valType:"any",editType:"calc"},end:{valType:"any",editType:"calc"},size:{valType:"any",editType:"calc"},editType:"calc"}}},{}],334:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports={count:function(t,e,r){return r[t]++,1},sum:function(t,e,r,a){var i=a[e];return n(i)?(i=Number(i),r[t]+=i,i):0},avg:function(t,e,r,a,i){var o=a[e];return n(o)&&(o=Number(o),r[t]+=o,i[t]++),0},min:function(t,e,r,a){var i=a[e];if(n(i)){if(i=Number(i),!n(r[t]))return r[t]=i,i;if(r[t]>i){var o=i-r[t];return r[t]=i,o}}return 0},max:function(t,e,r,a){var i=a[e];if(n(i)){if(i=Number(i),!n(r[t]))return r[t]=i,i;if(r[t]<i){var o=i-r[t];return r[t]=i,o}}return 0}}},{"fast-isnumeric":18}],335:[function(t,e,r){"use strict";var n=t("../../constants/numerical"),a=n.ONEAVGYEAR,i=n.ONEAVGMONTH,o=n.ONEDAY,l=n.ONEHOUR,s=n.ONEMIN,c=n.ONESEC,u=t("../../plots/cartesian/axes").tickIncrement;function f(t,e,r,n){if(t*e<=0)return 1/0;for(var a=Math.abs(e-t),i="date"===r.type,o=d(a,i),l=0;l<10;l++){var s=d(80*o,i);if(o===s)break;if(!p(s,t,e,i,r,n))break;o=s}return o}function d(t,e){return e&&t>c?t>o?t>1.1*a?a:t>1.1*i?i:o:t>l?l:t>s?s:c:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function p(t,e,r,n,i,l){if(n&&t>o){var s=h(e,i,l),c=h(r,i,l),u=t===a?0:1;return s[u]!==c[u]}return Math.floor(r/t)-Math.floor(e/t)>.1}function h(t,e,r){var n=e.c2d(t,a,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}e.exports=function(t,e,r,n,i){var l,s,c=-1.1*e,d=-.1*e,p=t-d,h=r[0],g=r[1],v=Math.min(f(h+d,h+p,n,i),f(g+d,g+p,n,i)),y=Math.min(f(h+c,h+d,n,i),f(g+c,g+d,n,i));if(v>y&&y<Math.abs(g-h)/4e3?(l=v,s=!1):(l=Math.min(v,y),s=!0),"date"===n.type&&l>o){var m=l===a?1:6,x=l===a?"M12":"M1";return function(e,r){var o=n.c2d(e,a,i),l=o.indexOf("-",m);l>0&&(o=o.substr(0,l));var c=n.d2c(o,0,i);if(c<e){var f=u(c,x,!1,i);(c+f)/2<e+t&&(c=f)}return r&&s?u(c,x,!0,i):c}}return function(e,r){var n=l*Math.round(e/l);return n+l/10<e&&n+.9*l<e+t&&(n+=l),r&&s&&(n-=l),n}}},{"../../constants/numerical":149,"../../plots/cartesian/axes":212}],336:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=t("../bar/arrays_to_calcdata"),l=t("./bin_functions"),s=t("./norm_functions"),c=t("./average"),u=t("./bin_label_vals");function f(t,e,r,o,l){var s,c,u,d,p,h,g,v=o+"bins",y=t._fullLayout,m="overlay"===y.barmode,x="date"===r.type?function(t){return t||0===t?a.cleanDate(t,null,r.calendar):null}:function(t){return n(t)?Number(t):null};function b(t,e,r){e[t+"Found"]?(e[t]=x(e[t]),null===e[t]&&(e[t]=r[t])):(h[t]=e[t]=r[t],a.nestedProperty(c[0],v+"."+t).set(r[t]))}var _=y._histogramBinOpts[e._groupName];if(e._autoBinFinished)delete e._autoBinFinished;else{c=_.traces;var w=_.sizeFound,k=[];h=c[0]._autoBin={};var T=!0;for(s=0;s<c.length;s++)(u=c[s]).visible&&(p=u._pos0=r.makeCalcdata(u,o),k=a.concat(k,p),delete u._autoBinFinished,!0===e.visible&&(T?T=!1:(delete u._autoBin,u._autoBinFinished=1)));d=c[0][o+"calendar"];var M=i.autoBin(k,r,_.nbins,!1,d,w&&_.size);if(m&&0===M._dataSpan&&"category"!==r.type&&"multicategory"!==r.type){if(l)return[M,p,!0];M=function(t,e,r,n,i){var o,l,s=function(t,e){for(var r=e.xaxis,n=e.yaxis,a=e.orientation,i=[],o=t._fullData,l=0;l<o.length;l++){var s=o[l];"histogram"===s.type&&!0===s.visible&&s.orientation===a&&s.xaxis===r&&s.yaxis===n&&i.push(s)}return i}(t,e),c=!1,u=1/0,d=[e];for(o=0;o<s.length;o++)if((l=s[o])===e)c=!0;else if(c){var p=f(t,l,r,n,!0),h=p[0],g=p[2];l._autoBinFinished=1,l._pos0=p[1],g?d.push(l):u=Math.min(u,h.size)}else u=Math.min(u,l[i].size);var v=new Array(d.length);for(o=0;o<d.length;o++)for(var y=d[o]._pos0,m=0;m<y.length;m++)if(void 0!==y[m]){v[o]=y[m];break}isFinite(u)||(u=a.distinctVals(v).minDiff);for(o=0;o<d.length;o++){var x=(l=d[o])[n+"calendar"];l._input[i]=l[i]={start:r.c2r(v[o]-u/2,0,x),end:r.c2r(v[o]+u/2,0,x),size:u}}return e[i]}(t,e,r,o,v)}(g=u.cumulative).enabled&&"include"!==g.currentbin&&("decreasing"===g.direction?M.start=r.c2r(i.tickIncrement(r.r2c(M.start,0,d),M.size,!0,d)):M.end=r.c2r(i.tickIncrement(r.r2c(M.end,0,d),M.size,!1,d))),_.size=M.size,w||(h.size=M.size,a.nestedProperty(c[0],v+".size").set(M.size)),b("start",_,M),b("end",_,M)}p=e._pos0,delete e._pos0;var A=e._input[v]||{},L=a.extendFlat({},_),S=_.start,C=r.r2l(A.start),O=void 0!==C;if((_.startFound||O)&&C!==r.r2l(S)){var z=O?C:a.aggNums(Math.min,null,p),D={type:"category"===r.type||"multicategory"===r.type?"linear":r.type,r2l:r.r2l,dtick:_.size,tick0:S,calendar:d,range:[z,i.tickIncrement(z,_.size,!1,d)].map(r.l2r)},P=i.tickFirst(D);P>r.r2l(z)&&(P=i.tickIncrement(P,_.size,!0,d)),L.start=r.l2r(P),O||a.nestedProperty(e,v+".start").set(L.start)}var E=_.end,R=r.r2l(A.end),I=void 0!==R;if((_.endFound||I)&&R!==r.r2l(E)){var F=I?R:a.aggNums(Math.max,null,p);L.end=r.l2r(F),I||a.nestedProperty(e,v+".start").set(L.end)}var N="autobin"+o;return!1===e._input[N]&&(e._input[v]=a.extendFlat({},e[v]||{}),delete e._input[N],delete e[N]),[L,p]}e.exports=function(t,e){if(!0===e.visible){var r,d,p,h,g=[],v=[],y=i.getFromId(t,"h"===e.orientation?e.yaxis||"y":e.xaxis||"x"),m="h"===e.orientation?"y":"x",x={x:"y",y:"x"}[m],b=e[m+"calendar"],_=e.cumulative,w=f(t,e,y,m),k=w[0],T=w[1],M="string"==typeof k.size,A=[],L=M?A:k,S=[],C=[],O=[],z=0,D=e.histnorm,P=e.histfunc,E=-1!==D.indexOf("density");_.enabled&&E&&(D=D.replace(/ ?density$/,""),E=!1);var R,I="max"===P||"min"===P?null:0,F=l.count,N=s[D],B=!1,j=function(t){return y.r2c(t,0,b)};for(a.isArrayOrTypedArray(e[x])&&"count"!==P&&(R=e[x],B="avg"===P,F=l[P]),r=j(k.start),p=j(k.end)+(r-i.tickIncrement(r,k.size,!1,b))/1e6;r<p&&g.length<1e6&&(d=i.tickIncrement(r,k.size,!1,b),g.push((r+d)/2),v.push(I),O.push([]),A.push(r),E&&S.push(1/(d-r)),B&&C.push(0),!(d<=r));)r=d;A.push(r),M||"date"!==y.type||(L={start:j(L.start),end:j(L.end),size:L.size});var H,q=v.length,V=!0,U=1/0,G=1/0,Z={};for(r=0;r<T.length;r++){var X=T[r];(h=a.findBin(X,L))>=0&&h<q&&(z+=F(h,r,v,R,C),V&&O[h].length&&X!==T[O[h][0]]&&(V=!1),O[h].push(r),Z[r]=h,U=Math.min(U,X-A[h]),G=Math.min(G,A[h+1]-X))}V||(H=u(U,G,A,y,b)),B&&(z=c(v,C)),N&&N(v,z,S),_.enabled&&function(t,e,r){var n,a,i;function o(e){i=t[e],t[e]/=2}function l(e){a=t[e],t[e]=i+a/2,i+=a}if("half"===r)if("increasing"===e)for(o(0),n=1;n<t.length;n++)l(n);else for(o(t.length-1),n=t.length-2;n>=0;n--)l(n);else if("increasing"===e){for(n=1;n<t.length;n++)t[n]+=t[n-1];"exclude"===r&&(t.unshift(0),t.pop())}else{for(n=t.length-2;n>=0;n--)t[n]+=t[n+1];"exclude"===r&&(t.push(0),t.shift())}}(v,_.direction,_.currentbin);var Y=Math.min(g.length,v.length),W=[],J=0,$=Y-1;for(r=0;r<Y;r++)if(v[r]){J=r;break}for(r=Y-1;r>=J;r--)if(v[r]){$=r;break}for(r=J;r<=$;r++)if(n(g[r])&&n(v[r])){var Q={p:g[r],s:v[r],b:0};_.enabled||(Q.pts=O[r],V?Q.ph0=Q.ph1=O[r].length?T[O[r][0]]:g[r]:(Q.ph0=H(A[r]),Q.ph1=H(A[r+1],!0))),W.push(Q)}return 1===W.length&&(W[0].width1=i.tickIncrement(W[0].p,k.size,!1,b)-W[0].p),o(W,e),a.isArrayOrTypedArray(e.selectedpoints)&&a.tagSelected(W,e,Z),W}}},{"../../lib":168,"../../plots/cartesian/axes":212,"../bar/arrays_to_calcdata":266,"./average":332,"./bin_functions":334,"./bin_label_vals":335,"./norm_functions":343,"fast-isnumeric":18}],337:[function(t,e,r){"use strict";e.exports={eventDataKeys:["binNumber"]}},{}],338:[function(t,e,r){"use strict";var n=t("../../lib"),a=n.nestedProperty,i=t("./attributes"),o={x:[{aStr:"xbins.start",name:"start"},{aStr:"xbins.end",name:"end"},{aStr:"xbins.size",name:"size"},{aStr:"nbinsx",name:"nbins"}],y:[{aStr:"ybins.start",name:"start"},{aStr:"ybins.end",name:"end"},{aStr:"ybins.size",name:"size"},{aStr:"nbinsy",name:"nbins"}]};e.exports=function(t,e){var r,l,s,c,u,f,d,p=e._histogramBinOpts={},h="overlay"===e.barmode;function g(t){return n.coerce(s._input,s,i,t)}for(r=0;r<t.length;r++)"histogram"===(s=t[r]).type&&(delete s._autoBinFinished,u="v"===s.orientation?"x":"y",f=h?s.uid:s.xaxis+s.yaxis+u,s._groupName=f,(d=p[f])?d.traces.push(s):d=p[f]={traces:[s],direction:u});for(f in p){u=(d=p[f]).direction;var v=o[u];for(l=0;l<v.length;l++){var y=v[l],m=y.name;if("nbins"!==m||!d.sizeFound){var x=y.aStr;for(r=0;r<d.traces.length;r++){if(c=(s=d.traces[r])._input,void 0!==a(c,x).get()){d[m]=g(x),d[m+"Found"]=!0;break}var b=s._autoBin;b&&b[m]&&a(s,x).set(b[m])}if("start"===m||"end"===m)for(;r<d.traces.length;r++)g(x,((s=d.traces[r])._autoBin||{})[m]);"nbins"!==m||d.sizeFound||d.nbinsFound||(s=d.traces[0],d[m]=g(x))}}}}},{"../../lib":168,"./attributes":331}],339:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("../../components/color"),o=t("../bar/style_defaults"),l=t("./attributes");e.exports=function(t,e,r,s){function c(r,n){return a.coerce(t,e,l,r,n)}var u=c("x"),f=c("y");c("cumulative.enabled")&&(c("cumulative.direction"),c("cumulative.currentbin")),c("text");var d=c("orientation",f&&!u?"h":"v"),p="v"===d?"x":"y",h="v"===d?"y":"x",g=u&&f?Math.min(a.minRowLength(u)&&a.minRowLength(f)):a.minRowLength(e[p]||[]);if(g){e._length=g,n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],s),e[h]&&c("histfunc"),c("histnorm"),c("autobin"+p),c("hovertemplate"),o(t,e,c,r,s),a.coerceSelectionMarkerOpacity(e,c);var v=(e.marker.line||{}).color,y=n.getComponentMethod("errorbars","supplyDefaults");y(t,e,v||i.defaultLine,{axis:"y"}),y(t,e,v||i.defaultLine,{axis:"x",inherit:"y"})}else e.visible=!1}},{"../../components/color":51,"../../lib":168,"../../registry":257,"../bar/style_defaults":281,"./attributes":331}],340:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,a){if(t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),!(r.cumulative||{}).enabled){var i,o=Array.isArray(a)?n[0].pts[a[0]][a[1]]:n[a].pts;if(t.pointNumbers=o,t.binNumber=t.pointNumber,delete t.pointNumber,delete t.pointIndex,r._indexToPoints){i=[];for(var l=0;l<o.length;l++)i=i.concat(r._indexToPoints[o[l]])}else i=o;t.pointIndices=i}return t}},{}],341:[function(t,e,r){"use strict";var n=t("../bar/hover").hoverPoints,a=t("../../plots/cartesian/axes").hoverLabelText;e.exports=function(t,e,r,i){var o=n(t,e,r,i);if(o){var l=(t=o[0]).cd[t.index],s=t.cd[0].trace;if(!s.cumulative.enabled){var c="h"===s.orientation?"y":"x";t[c+"Label"]=a(t[c+"a"],l.ph0,l.ph1)}return s.hovermplate&&(t.hovertemplate=s.hovertemplate),o}}},{"../../plots/cartesian/axes":212,"../bar/hover":273}],342:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.layoutAttributes=t("../bar/layout_attributes"),n.supplyDefaults=t("./defaults"),n.crossTraceDefaults=t("./cross_trace_defaults"),n.supplyLayoutDefaults=t("../bar/layout_defaults"),n.calc=t("./calc"),n.crossTraceCalc=t("../bar/cross_trace_calc").crossTraceCalc,n.plot=t("../bar/plot"),n.layerName="barlayer",n.style=t("../bar/style").style,n.styleOnSelect=t("../bar/style").styleOnSelect,n.colorbar=t("../scatter/marker_colorbar"),n.hoverPoints=t("./hover"),n.selectPoints=t("../bar/select"),n.eventData=t("./event_data"),n.moduleType="trace",n.name="histogram",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","svg","bar","histogram","oriented","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":224,"../bar/cross_trace_calc":270,"../bar/layout_attributes":275,"../bar/layout_defaults":276,"../bar/plot":277,"../bar/select":278,"../bar/style":280,"../scatter/marker_colorbar":385,"./attributes":331,"./calc":336,"./cross_trace_defaults":338,"./defaults":339,"./event_data":340,"./hover":341}],343:[function(t,e,r){"use strict";e.exports={percent:function(t,e){for(var r=t.length,n=100/e,a=0;a<r;a++)t[a]*=n},probability:function(t,e){for(var r=t.length,n=0;n<r;n++)t[n]/=e},density:function(t,e,r,n){var a=t.length;n=n||1;for(var i=0;i<a;i++)t[i]*=r[i]*n},"probability density":function(t,e,r,n){var a=t.length;n&&(e/=n);for(var i=0;i<a;i++)t[i]*=r[i]/e}}},{}],344:[function(t,e,r){"use strict";var n=t("../histogram/attributes"),a=t("../histogram/bin_attributes"),i=t("../heatmap/attributes"),o=t("../../components/colorscale/attributes"),l=t("../../components/colorbar/attributes"),s=t("../../lib/extend").extendFlat;e.exports=s({x:n.x,y:n.y,z:{valType:"data_array",editType:"calc"},marker:{color:{valType:"data_array",editType:"calc"},editType:"calc"},histnorm:n.histnorm,histfunc:n.histfunc,nbinsx:n.nbinsx,xbins:a("x"),nbinsy:n.nbinsy,ybins:a("y"),autobinx:n.autobinx,autobiny:n.autobiny,xgap:i.xgap,ygap:i.ygap,zsmooth:i.zsmooth,zhoverformat:i.zhoverformat},o("",{cLetter:"z",autoColorDflt:!1}),{colorbar:l})},{"../../components/colorbar/attributes":52,"../../components/colorscale/attributes":58,"../../lib/extend":162,"../heatmap/attributes":316,"../histogram/attributes":331,"../histogram/bin_attributes":333}],345:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../histogram/bin_functions"),o=t("../histogram/norm_functions"),l=t("../histogram/average"),s=t("../histogram/bin_label_vals");function c(t,e,r,i,o,l,s){var c=e+"bins",u=t[c];u||(u=t[c]={});var f=t._input[c]||{},d=t._autoBin={};f.size||delete u.size,void 0===f.start&&delete u.start,void 0===f.end&&delete u.end;var p=!u.size,h=void 0===u.start,g=void 0===u.end;if(p||h||g){var v=a.autoBin(r,i,t["nbins"+e],"2d",s,u.size);"histogram2dcontour"===t.type&&(h&&(v.start=l(a.tickIncrement(o(v.start),v.size,!0,s))),g&&(v.end=l(a.tickIncrement(o(v.end),v.size,!1,s)))),p&&(u.size=d.size=v.size),h&&(u.start=d.start=v.start),g&&(u.end=d.end=v.end)}var y="autobin"+e;!1===t._input[y]&&(t._input[c]=n.extendFlat({},u),delete t._input[y],delete t[y])}function u(t,e,r,n){var a,i=new Array(t);if(n)for(a=0;a<t;a++)i[a]=1/(e[a+1]-e[a]);else{var o=1/r;for(a=0;a<t;a++)i[a]=o}return i}function f(t,e){return{start:t(e.start),end:t(e.end),size:e.size}}function d(t,e,r,n,a,i){var o,l=t.length-1,c=new Array(l);if(e)for(o=0;o<l;o++)c[o]=[e[o],e[o]];else{var u=s(r,n,t,a,i);for(o=0;o<l;o++)c[o]=[u(t[o]),u(t[o+1],!0)]}return c}e.exports=function(t,e){var r,s,p,h,g=a.getFromId(t,e.xaxis||"x"),v=e.x?g.makeCalcdata(e,"x"):[],y=a.getFromId(t,e.yaxis||"y"),m=e.y?y.makeCalcdata(e,"y"):[],x=e.xcalendar,b=e.ycalendar,_=function(t){return g.r2c(t,0,x)},w=function(t){return y.r2c(t,0,b)},k=function(t){return g.c2r(t,0,x)},T=function(t){return y.c2r(t,0,b)},M=e._length;v.length>M&&v.splice(M,v.length-M),m.length>M&&m.splice(M,m.length-M),c(e,"x",v,g,_,k,x),c(e,"y",m,y,w,T,b);var A=[],L=[],S=[],C="string"==typeof e.xbins.size,O="string"==typeof e.ybins.size,z=[],D=[],P=C?z:e.xbins,E=O?D:e.ybins,R=0,I=[],F=[],N=e.histnorm,B=e.histfunc,j=-1!==N.indexOf("density"),H="max"===B||"min"===B?null:0,q=i.count,V=o[N],U=!1,G=[],Z=[],X="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";X&&"count"!==B&&(U="avg"===B,q=i[B]);var Y=e.xbins,W=_(Y.start),J=_(Y.end)+(W-a.tickIncrement(W,Y.size,!1,x))/1e6;for(r=W;r<J;r=a.tickIncrement(r,Y.size,!1,x))L.push(H),z.push(r),U&&S.push(0);z.push(r);var $=L.length,Q=_(e.xbins.start),K=(r-Q)/$,tt=k(Q+K/2);for(W=w((Y=e.ybins).start),J=w(Y.end)+(W-a.tickIncrement(W,Y.size,!1,b))/1e6,r=W;r<J;r=a.tickIncrement(r,Y.size,!1,b)){A.push(L.slice()),D.push(r);var et=new Array($);for(s=0;s<$;s++)et[s]=[];F.push(et),U&&I.push(S.slice())}D.push(r);var rt=A.length,nt=w(e.ybins.start),at=(r-nt)/rt,it=T(nt+at/2);j&&(G=u(L.length,P,K,C),Z=u(A.length,E,at,O)),C||"date"!==g.type||(P=f(_,P)),O||"date"!==y.type||(E=f(w,E));var ot=!0,lt=!0,st=new Array($),ct=new Array(rt),ut=1/0,ft=1/0,dt=1/0,pt=1/0;for(r=0;r<M;r++){var ht=v[r],gt=m[r];p=n.findBin(ht,P),h=n.findBin(gt,E),p>=0&&p<$&&h>=0&&h<rt&&(R+=q(p,r,A[h],X,I[h]),F[h][p].push(r),ot&&(void 0===st[p]?st[p]=ht:st[p]!==ht&&(ot=!1)),lt&&(void 0===ct[p]?ct[p]=gt:ct[p]!==gt&&(lt=!1)),ut=Math.min(ut,ht-z[p]),ft=Math.min(ft,z[p+1]-ht),dt=Math.min(dt,gt-D[h]),pt=Math.min(pt,D[h+1]-gt))}if(U)for(h=0;h<rt;h++)R+=l(A[h],I[h]);if(V)for(h=0;h<rt;h++)V(A[h],R,G,Z[h]);return{x:v,xRanges:d(z,ot&&st,ut,ft,g,x),x0:tt,dx:K,y:m,yRanges:d(D,lt&&ct,dt,pt,y,b),y0:it,dy:at,z:A,pts:F}}},{"../../lib":168,"../../plots/cartesian/axes":212,"../histogram/average":332,"../histogram/bin_functions":334,"../histogram/bin_label_vals":335,"../histogram/norm_functions":343}],346:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../constants/numerical").BADNUM,i=t("../../plots/cartesian/axis_ids"),o=t("../../lib"),l=t("./attributes"),s=["x","y"];function c(t,e,r,l){var s=r[i.id2name(t[e+"axis"])].type,c=e+"bins",u=t[c],f=t[e+"calendar"];u||(u=t[c]={});var d="date"===s?function(t,e){return t||0===t?o.cleanDate(t,a,f):e}:function(t,e){return n(t)?Number(t):e};u.start=d(u.start,l.start),u.end=d(u.end,l.end);var p=l.size,h=u.size;if(n(h))u.size=h>0?Number(h):p;else if("string"!=typeof h)u.size=p;else{var g=h.charAt(0),v=h.substr(1);((v=n(v)?Number(v):0)<=0||"date"!==s||"M"!==g||v!==Math.round(v))&&(u.size=p)}}e.exports=function(t,e){var r,n,a,i;function u(t){return o.coerce(a._input,a,l,t)}for(r=0;r<t.length;r++){var f=(a=t[r]).type;if("histogram2d"===f||"histogram2dcontour"===f)for(n=0;n<s.length;n++){var d=(i=s[n])+"bins",p=(a._autoBin||{})[i]||{};u(d+".start",p.start),u(d+".end",p.end),u(d+".size",p.size),c(a,i,e,p),(a[d]||{}).size||u("nbins"+i)}}}},{"../../constants/numerical":149,"../../lib":168,"../../plots/cartesian/axis_ids":215,"./attributes":344,"fast-isnumeric":18}],347:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./sample_defaults"),i=t("../heatmap/style_defaults"),o=t("../../components/colorscale/defaults"),l=t("./attributes");e.exports=function(t,e,r,s){function c(r,a){return n.coerce(t,e,l,r,a)}a(t,e,c,s),!1!==e.visible&&(i(t,e,c,s),o(t,e,s,c,{prefix:"",cLetter:"z"}))}},{"../../components/colorscale/defaults":61,"../../lib":168,"../heatmap/style_defaults":329,"./attributes":344,"./sample_defaults":350}],348:[function(t,e,r){"use strict";var n=t("../heatmap/hover"),a=t("../../plots/cartesian/axes").hoverLabelText;e.exports=function(t,e,r,i,o,l){var s=n(t,e,r,i,o,l);if(s){var c=(t=s[0]).index,u=c[0],f=c[1],d=t.cd[0],p=d.xRanges[f],h=d.yRanges[u];return t.xLabel=a(t.xa,p[0],p[1]),t.yLabel=a(t.ya,h[0],h[1]),s}}},{"../../plots/cartesian/axes":212,"../heatmap/hover":323}],349:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.crossTraceDefaults=t("./cross_trace_defaults"),n.calc=t("../heatmap/calc"),n.plot=t("../heatmap/plot"),n.layerName="heatmaplayer",n.colorbar=t("../heatmap/colorbar"),n.style=t("../heatmap/style"),n.hoverPoints=t("./hover"),n.eventData=t("../histogram/event_data"),n.moduleType="trace",n.name="histogram2d",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","svg","2dMap","histogram"],n.meta={},e.exports=n},{"../../plots/cartesian":224,"../heatmap/calc":317,"../heatmap/colorbar":319,"../heatmap/plot":327,"../heatmap/style":328,"../histogram/event_data":340,"./attributes":344,"./cross_trace_defaults":346,"./defaults":347,"./hover":348}],350:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib");e.exports=function(t,e,r,i){var o=r("x"),l=r("y"),s=a.minRowLength(o),c=a.minRowLength(l);s&&c?(e._length=Math.min(s,c),n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],i),(r("z")||r("marker.color"))&&r("histfunc"),r("histnorm"),r("autobinx"),r("autobiny")):e.visible=!1}},{"../../lib":168,"../../registry":257}],351:[function(t,e,r){"use strict";var n=t("../histogram2d/attributes"),a=t("../contour/attributes"),i=t("../../components/colorscale/attributes"),o=t("../../components/colorbar/attributes"),l=t("../../lib/extend").extendFlat;e.exports=l({x:n.x,y:n.y,z:n.z,marker:n.marker,histnorm:n.histnorm,histfunc:n.histfunc,nbinsx:n.nbinsx,xbins:n.xbins,nbinsy:n.nbinsy,ybins:n.ybins,autobinx:n.autobinx,autobiny:n.autobiny,autocontour:a.autocontour,ncontours:a.ncontours,contours:a.contours,line:a.line,zhoverformat:n.zhoverformat},i("",{cLetter:"z",editTypeOverride:"calc"}),{colorbar:o})},{"../../components/colorbar/attributes":52,"../../components/colorscale/attributes":58,"../../lib/extend":162,"../contour/attributes":294,"../histogram2d/attributes":344}],352:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../histogram2d/sample_defaults"),i=t("../contour/contours_defaults"),o=t("../contour/style_defaults"),l=t("./attributes");e.exports=function(t,e,r,s){function c(r,a){return n.coerce(t,e,l,r,a)}a(t,e,c,s),!1!==e.visible&&(i(t,e,c,function(r){return n.coerce2(t,e,l,r)}),o(t,e,c,s))}},{"../../lib":168,"../contour/contours_defaults":301,"../contour/style_defaults":315,"../histogram2d/sample_defaults":350,"./attributes":351}],353:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.crossTraceDefaults=t("../histogram2d/cross_trace_defaults"),n.calc=t("../contour/calc"),n.plot=t("../contour/plot").plot,n.layerName="contourlayer",n.style=t("../contour/style"),n.colorbar=t("../contour/colorbar"),n.hoverPoints=t("../contour/hover"),n.moduleType="trace",n.name="histogram2dcontour",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","svg","2dMap","contour","histogram","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":224,"../contour/calc":295,"../contour/colorbar":297,"../contour/hover":307,"../contour/plot":312,"../contour/style":314,"../histogram2d/cross_trace_defaults":346,"./attributes":351,"./defaults":352}],354:[function(t,e,r){"use strict";var n=t("../../components/color/attributes"),a=t("../../plots/font_attributes"),i=t("../../plots/attributes"),o=t("../../components/fx/hovertemplate_attributes"),l=t("../../plots/domain").attributes,s=t("../../lib/extend").extendFlat,c=a({editType:"calc",arrayOk:!0,colorEditType:"plot"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:n.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},editType:"calc"},text:{valType:"data_array",editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:s({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc"},textfont:s({},c,{}),insidetextfont:s({},c,{}),outsidetextfont:s({},c,{}),title:{text:{valType:"string",dflt:"",editType:"calc"},font:s({},c,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"calc"},editType:"calc"},domain:l({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"number",min:-360,max:360,dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"},_deprecated:{title:{valType:"string",dflt:"",editType:"calc"},titlefont:s({},c,{}),titleposition:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"calc"}}}},{"../../components/color/attributes":50,"../../components/fx/hovertemplate_attributes":89,"../../lib/extend":162,"../../plots/attributes":209,"../../plots/domain":238,"../../plots/font_attributes":239}],355:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/get_data").getModuleCalcData;r.name="pie",r.plot=function(t){var e=n.getModule("pie"),r=a(t.calcdata,e)[0];r.length&&e.plot(t,r)},r.clean=function(t,e,r,n){var a=n._has&&n._has("pie"),i=e._has&&e._has("pie");a&&!i&&n._pielayer.selectAll("g.trace").remove()}},{"../../plots/get_data":241,"../../registry":257}],356:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib").isArrayOrTypedArray,i=t("tinycolor2"),o=t("../../components/color"),l=t("./helpers");r.calc=function(t,e){var r,s,c,u,f,d=e.values,p=a(d)&&d.length,h=e.labels,g=e.marker.colors||[],v=[],y=t._fullLayout,m=y._piecolormap,x={},b=0,_=y.hiddenlabels||[];if(e.dlabel)for(h=new Array(d.length),r=0;r<d.length;r++)h[r]=String(e.label0+r*e.dlabel);function w(t,e){return!!t&&(!!(t=i(t)).isValid()&&(t=o.addOpacity(t,t.getAlpha()),m[e]||(m[e]=t),t))}var k=(p?d:h).length;for(r=0;r<k;r++){if(p){if(s=d[r],!n(s))continue;if((s=+s)<0)continue}else s=1;void 0!==(c=h[r])&&""!==c||(c=r);var T=x[c=String(c)];void 0===T?(x[c]=v.length,(u=-1!==_.indexOf(c))||(b+=s),v.push({v:s,label:c,color:w(g[r],c),i:r,pts:[r],hidden:u})):((f=v[T]).v+=s,f.pts.push(r),f.hidden||(b+=s),!1===f.color&&g[r]&&(f.color=w(g[r],c)))}if(e.sort&&v.sort(function(t,e){return e.v-t.v}),v[0]&&(v[0].vTotal=b),e.textinfo&&"none"!==e.textinfo){var M,A=-1!==e.textinfo.indexOf("label"),L=-1!==e.textinfo.indexOf("text"),S=-1!==e.textinfo.indexOf("value"),C=-1!==e.textinfo.indexOf("percent"),O=y.separators;for(r=0;r<v.length;r++){if(f=v[r],M=A?[f.label]:[],L){var z=l.getFirstFilled(e.text,f.pts);z&&M.push(z)}S&&M.push(l.formatPieValue(f.v,O)),C&&M.push(l.formatPiePercent(f.v/b,O)),f.text=M.join("<br>")}}return v},r.crossTraceCalc=function(t){var e=t._fullLayout,r=t.calcdata,n=e.piecolorway,a=e._piecolormap;e.extendpiecolors&&(n=function(t){var e,r=JSON.stringify(t),n=s[r];if(!n){for(n=t.slice(),e=0;e<t.length;e++)n.push(i(t[e]).lighten(20).toHexString());for(e=0;e<t.length;e++)n.push(i(t[e]).darken(20).toHexString());s[r]=n}return n}(n));var o,l,c,u,f=0;for(o=0;o<r.length;o++)if("pie"===(c=r[o])[0].trace.type)for(l=0;l<c.length;l++)!1===(u=c[l]).color&&(a[u.label]?u.color=a[u.label]:(a[u.label]=u.color=n[f%n.length],f++))};var s={}},{"../../components/color":51,"../../lib":168,"./helpers":359,"fast-isnumeric":18,tinycolor2:34}],357:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("../../plots/domain").defaults;e.exports=function(t,e,r,o){function l(r,i){return n.coerce(t,e,a,r,i)}var s,c=n.coerceFont,u=l("values"),f=n.isArrayOrTypedArray(u),d=l("labels");if(Array.isArray(d)?(s=d.length,f&&(s=Math.min(s,u.length))):f&&(s=u.length,l("label0"),l("dlabel")),s){e._length=s,l("marker.line.width")&&l("marker.line.color"),l("marker.colors"),l("scalegroup");var p=l("text"),h=l("textinfo",Array.isArray(p)?"text+percent":"percent");if(l("hovertext"),l("hovertemplate"),h&&"none"!==h){var g=l("textposition"),v=Array.isArray(g)||"auto"===g,y=v||"inside"===g,m=v||"outside"===g;if(y||m){var x=c(l,"textfont",o.font);if(y){var b=n.extendFlat({},x);!(t.textfont&&t.textfont.color)&&delete b.color,c(l,"insidetextfont",b)}m&&c(l,"outsidetextfont",x)}}i(e,o,l);var _=l("hole");if(l("title.text")){var w=l("title.position",_?"middle center":"top center");_||"middle center"!==w||(e.title.position="top center"),c(l,"title.font",o.font)}l("sort"),l("direction"),l("rotation"),l("pull")}else e.visible=!1}},{"../../lib":168,"../../plots/domain":238,"./attributes":354}],358:[function(t,e,r){"use strict";var n=t("../../components/fx/helpers").appendArrayMultiPointValues;e.exports=function(t,e){var r={curveNumber:e.index,pointNumbers:t.pts,data:e._input,fullData:e,label:t.label,color:t.color,value:t.v,percent:t.percent,text:t.text,v:t.v};return 1===t.pts.length&&(r.pointNumber=r.i=t.pts[0]),n(r,e,t.pts),r}},{"../../components/fx/helpers":86}],359:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r<e.length;r++){var n=t[e[r]];if(n||0===n)return n}},r.castOption=function(t,e){return Array.isArray(t)?r.getFirstFilled(t,e):t||void 0}},{"../../lib":168}],360:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("./layout_defaults"),n.layoutAttributes=t("./layout_attributes");var a=t("./calc");n.calc=a.calc,n.crossTraceCalc=a.crossTraceCalc,n.plot=t("./plot"),n.style=t("./style"),n.styleOne=t("./style_one"),n.moduleType="trace",n.name="pie",n.basePlotModule=t("./base_plot"),n.categories=["pie","showLegend"],n.meta={},e.exports=n},{"./attributes":354,"./base_plot":355,"./calc":356,"./defaults":357,"./layout_attributes":361,"./layout_defaults":362,"./plot":363,"./style":364,"./style_one":365}],361:[function(t,e,r){"use strict";e.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],362:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){function r(r,i){return n.coerce(t,e,a,r,i)}r("hiddenlabels"),r("piecolorway",e.colorway),r("extendpiecolors")}},{"../../lib":168,"./layout_attributes":361}],363:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/fx"),i=t("../../components/color"),o=t("../../components/drawing"),l=t("../../lib"),s=t("../../lib/svg_text_utils"),c=t("./helpers"),u=t("./event_data");function f(t,e){if(t.v===e.vTotal&&!e.trace.hole)return 1;var r=Math.PI*Math.min(t.v/e.vTotal,.5);return Math.min(1/(1+1/Math.sin(r)),(1-e.trace.hole)/2)}function d(t,e){var r=e.pxmid[0],n=e.pxmid[1],a=t.width/2,i=t.height/2;return r<0&&(a*=-1),n<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+r*r/(n*n)),outside:!0}}function p(t,e){var r=t.trace,n=e.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(t.titleBox.height,n/2)}function h(t){var e,r=t.pull;if(Array.isArray(r))for(r=0,e=0;e<t.pull.length;e++)t.pull[e]>r&&(r=t.pull[e]);return r}e.exports=function(t,e){var r=t._fullLayout;!function(t,e){for(var r,n,a=e._fullLayout,i=0;i<t.length;i++)if(r=t[i][0],(n=r.trace).title.text){var c=a.meta?l.templateString(n.title.text,{meta:a.meta}):n.title.text,u=o.tester.append("text").attr("data-notex",1).text(c).call(o.font,n.title.font).call(s.convertToTspans,e),f=o.bBox(u.node(),!0);r.titleBox={width:f.width,height:f.height},u.remove()}}(e,t),function(t,e){var r,n,a,i,o,l,s,c,u,f=[];for(a=0;a<t.length;a++)o=t[a][0],l=o.trace,r=e.w*(l.domain.x[1]-l.domain.x[0]),n=e.h*(l.domain.y[1]-l.domain.y[0]),l.title.text&&"middle center"!==l.title.position&&(n-=p(o,e)),s=h(l),o.r=Math.min(r,n)/(2+2*s),o.cx=e.l+e.w*(l.domain.x[1]+l.domain.x[0])/2,o.cy=e.t+e.h*(1-l.domain.y[0])-n/2,l.title.text&&-1!==l.title.position.indexOf("bottom")&&(o.cy-=p(o,e)),l.scalegroup&&-1===f.indexOf(l.scalegroup)&&f.push(l.scalegroup);for(i=0;i<f.length;i++){for(u=1/0,c=f[i],a=0;a<t.length;a++)(o=t[a][0]).trace.scalegroup===c&&(u=Math.min(u,o.r*o.r/o.vTotal));for(a=0;a<t.length;a++)(o=t[a][0]).trace.scalegroup===c&&(o.r=Math.sqrt(u*o.vTotal))}}(e,r._size);var g=l.makeTraceGroups(r._pielayer,e,"trace").each(function(e){var g=n.select(this),v=e[0],y=v.trace;!function(t){var e,r,n,a=t[0],i=a.trace,o=i.rotation*Math.PI/180,l=2*Math.PI/a.vTotal,s="px0",c="px1";if("counterclockwise"===i.direction){for(e=0;e<t.length&&t[e].hidden;e++);if(e===t.length)return;o+=l*t[e].v,l*=-1,s="px1",c="px0"}function u(t){return[a.r*Math.sin(t),-a.r*Math.cos(t)]}for(n=u(o),e=0;e<t.length;e++)(r=t[e]).hidden||(r[s]=n,o+=l*r.v/2,r.pxmid=u(o),r.midangle=o,o+=l*r.v/2,n=u(o),r[c]=n,r.largeArc=r.v>a.vTotal/2?1:0)}(e),g.attr("stroke-linejoin","round"),g.each(function(){var g=n.select(this).selectAll("g.slice").data(e);g.enter().append("g").classed("slice",!0),g.exit().remove();var m=[[[],[]],[[],[]]],x=!1;g.each(function(e){if(e.hidden)n.select(this).selectAll("path,g").remove();else{e.pointNumber=e.i,e.curveNumber=y.index,m[e.pxmid[1]<0?0:1][e.pxmid[0]<0?0:1].push(e);var p=v.cx,h=v.cy,g=n.select(this),b=g.selectAll("path.surface").data([e]),_=!1,w=!1;if(b.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),g.select("path.textline").remove(),g.on("mouseover",function(){var i=t._fullLayout,o=t._fullData[y.index];if(!t._dragging&&!1!==i.hovermode){var l=o.hoverinfo;if(Array.isArray(l)&&(l=a.castHoverinfo({hoverinfo:[c.castOption(l,e.pts)],_module:y._module},i,0)),"all"===l&&(l="label+text+value+percent+name"),o.hovertemplate||"none"!==l&&"skip"!==l&&l){var s=f(e,v),d=p+e.pxmid[0]*(1-s),g=h+e.pxmid[1]*(1-s),m=r.separators,x=[];if(l&&-1!==l.indexOf("label")&&x.push(e.label),e.text=c.castOption(o.hovertext||o.text,e.pts),l&&-1!==l.indexOf("text")){var b=e.text;b&&x.push(b)}e.value=e.v,e.valueLabel=c.formatPieValue(e.v,m),l&&-1!==l.indexOf("value")&&x.push(e.valueLabel),e.percent=e.v/v.vTotal,e.percentLabel=c.formatPiePercent(e.percent,m),l&&-1!==l.indexOf("percent")&&x.push(e.percentLabel);var k=y.hoverlabel,T=k.font;a.loneHover({x0:d-s*v.r,x1:d+s*v.r,y:g,text:x.join("<br>"),name:o.hovertemplate||-1!==l.indexOf("name")?o.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:c.castOption(k.bgcolor,e.pts)||e.color,borderColor:c.castOption(k.bordercolor,e.pts),fontFamily:c.castOption(T.family,e.pts),fontSize:c.castOption(T.size,e.pts),fontColor:c.castOption(T.color,e.pts),trace:o,hovertemplate:c.castOption(o.hovertemplate,e.pts),hovertemplateLabels:e,eventData:[u(e,o)]},{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:t}),_=!0}t.emit("plotly_hover",{points:[u(e,o)],event:n.event}),w=!0}}).on("mouseout",function(r){var i=t._fullLayout,o=t._fullData[y.index];w&&(r.originalEvent=n.event,t.emit("plotly_unhover",{points:[u(e,o)],event:n.event}),w=!1),_&&(a.loneUnhover(i._hoverlayer.node()),_=!1)}).on("click",function(){var r=t._fullLayout,i=t._fullData[y.index];t._dragging||!1===r.hovermode||(t._hoverdata=[u(e,i)],a.click(t,n.event))}),y.pull){var k=+c.castOption(y.pull,e.pts)||0;k>0&&(p+=k*e.pxmid[0],h+=k*e.pxmid[1])}e.cxFinal=p,e.cyFinal=h;var T=y.hole;if(e.v===v.vTotal){var M="M"+(p+e.px0[0])+","+(h+e.px0[1])+O(e.px0,e.pxmid,!0,1)+O(e.pxmid,e.px0,!0,1)+"Z";T?b.attr("d","M"+(p+T*e.px0[0])+","+(h+T*e.px0[1])+O(e.px0,e.pxmid,!1,T)+O(e.pxmid,e.px0,!1,T)+"Z"+M):b.attr("d",M)}else{var A=O(e.px0,e.px1,!0,1);if(T){var L=1-T;b.attr("d","M"+(p+T*e.px1[0])+","+(h+T*e.px1[1])+O(e.px1,e.px0,!1,T)+"l"+L*e.px0[0]+","+L*e.px0[1]+A+"Z")}else b.attr("d","M"+p+","+h+"l"+e.px0[0]+","+e.px0[1]+A+"Z")}var S=c.castOption(y.textposition,e.pts),C=g.selectAll("g.slicetext").data(e.text&&"none"!==S?[0]:[]);C.enter().append("g").classed("slicetext",!0),C.exit().remove(),C.each(function(){var r=l.ensureSingle(n.select(this),"text","",function(t){t.attr("data-notex",1)});r.text(e.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(o.font,"outside"===S?function(t,e,r){var n=c.castOption(t.outsidetextfont.color,e.pts)||c.castOption(t.textfont.color,e.pts)||r.color,a=c.castOption(t.outsidetextfont.family,e.pts)||c.castOption(t.textfont.family,e.pts)||r.family,i=c.castOption(t.outsidetextfont.size,e.pts)||c.castOption(t.textfont.size,e.pts)||r.size;return{color:n,family:a,size:i}}(y,e,t._fullLayout.font):function(t,e,r){var n=c.castOption(t.insidetextfont.color,e.pts);!n&&t._input.textfont&&(n=c.castOption(t._input.textfont.color,e.pts));var a=c.castOption(t.insidetextfont.family,e.pts)||c.castOption(t.textfont.family,e.pts)||r.family,o=c.castOption(t.insidetextfont.size,e.pts)||c.castOption(t.textfont.size,e.pts)||r.size;return{color:n||i.contrast(e.color),family:a,size:o}}(y,e,t._fullLayout.font)).call(s.convertToTspans,t);var a,u=o.bBox(r.node());"outside"===S?a=d(u,e):(a=function(t,e,r){var n=Math.sqrt(t.width*t.width+t.height*t.height),a=t.width/t.height,i=Math.PI*Math.min(e.v/r.vTotal,.5),o=1-r.trace.hole,l=f(e,r),s={scale:l*r.r*2/n,rCenter:1-l,rotate:0};if(s.scale>=1)return s;var c=a+1/(2*Math.tan(i)),u=r.r*Math.min(1/(Math.sqrt(c*c+.5)+c),o/(Math.sqrt(a*a+o/2)+a)),d={scale:2*u/t.height,rCenter:Math.cos(u/r.r)-u*a/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},p=1/a,h=p+1/(2*Math.tan(i)),g=r.r*Math.min(1/(Math.sqrt(h*h+.5)+h),o/(Math.sqrt(p*p+o/2)+p)),v={scale:2*g/t.width,rCenter:Math.cos(g/r.r)-g/a/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},y=v.scale>d.scale?v:d;return s.scale<1&&y.scale>s.scale?y:s}(u,e,v),"auto"===S&&a.scale<1&&(r.call(o.font,y.outsidetextfont),y.outsidetextfont.family===y.insidetextfont.family&&y.outsidetextfont.size===y.insidetextfont.size||(u=o.bBox(r.node())),a=d(u,e)));var g=p+e.pxmid[0]*a.rCenter+(a.x||0),m=h+e.pxmid[1]*a.rCenter+(a.y||0);a.outside&&(e.yLabelMin=m-u.height/2,e.yLabelMid=m,e.yLabelMax=m+u.height/2,e.labelExtraX=0,e.labelExtraY=0,x=!0),r.attr("transform","translate("+g+","+m+")"+(a.scale<1?"scale("+a.scale+")":"")+(a.rotate?"rotate("+a.rotate+")":"")+"translate("+-(u.left+u.right)/2+","+-(u.top+u.bottom)/2+")")})}function O(t,r,n,a){return"a"+a*v.r+","+a*v.r+" 0 "+e.largeArc+(n?" 1 ":" 0 ")+a*(r[0]-t[0])+","+a*(r[1]-t[1])}});var b=n.select(this).selectAll("g.titletext").data(y.title.text?[0]:[]);b.enter().append("g").classed("titletext",!0),b.exit().remove(),b.each(function(){var e,a=l.ensureSingle(n.select(this),"text","",function(t){t.attr("data-notex",1)}),i=r.meta?l.templateString(y.title.text,{meta:r.meta}):y.title.text;a.text(i).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(o.font,y.title.font).call(s.convertToTspans,t),e="middle center"===y.title.position?function(t){var e=Math.sqrt(t.titleBox.width*t.titleBox.width+t.titleBox.height*t.titleBox.height);return{x:t.cx,y:t.cy,scale:t.trace.hole*t.r*2/e,tx:0,ty:-t.titleBox.height/2+t.trace.title.font.size}}(v):function(t,e){var r,n,a=1,i=1,o=t.trace,l={x:t.cx,y:t.cy},s={tx:0,ty:0};s.ty+=o.title.font.size,n=h(o),-1!==o.title.position.indexOf("top")?(l.y-=(1+n)*t.r,s.ty-=t.titleBox.height):-1!==o.title.position.indexOf("bottom")&&(l.y+=(1+n)*t.r);-1!==o.title.position.indexOf("left")?(r=e.w*(o.domain.x[1]-o.domain.x[0])/2+t.r,l.x-=(1+n)*t.r,s.tx+=t.titleBox.width/2):-1!==o.title.position.indexOf("center")?r=e.w*(o.domain.x[1]-o.domain.x[0]):-1!==o.title.position.indexOf("right")&&(r=e.w*(o.domain.x[1]-o.domain.x[0])/2+t.r,l.x+=(1+n)*t.r,s.tx-=t.titleBox.width/2);return a=r/t.titleBox.width,i=p(t,e)/t.titleBox.height,{x:l.x,y:l.y,scale:Math.min(a,i),tx:s.tx,ty:s.ty}}(v,r._size),a.attr("transform","translate("+e.x+","+e.y+")"+(e.scale<1?"scale("+e.scale+")":"")+"translate("+e.tx+","+e.ty+")")}),x&&function(t,e){var r,n,a,i,o,l,s,u,f,d,p,h,g;function v(t,e){return t.pxmid[1]-e.pxmid[1]}function y(t,e){return e.pxmid[1]-t.pxmid[1]}function m(t,r){r||(r={});var a,u,f,p,h,g,v=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),y=n?t.yLabelMin:t.yLabelMax,m=n?t.yLabelMax:t.yLabelMin,x=t.cyFinal+o(t.px0[1],t.px1[1]),b=v-y;if(b*s>0&&(t.labelExtraY=b),Array.isArray(e.pull))for(u=0;u<d.length;u++)(f=d[u])===t||(c.castOption(e.pull,t.pts)||0)>=(c.castOption(e.pull,f.pts)||0)||((t.pxmid[1]-f.pxmid[1])*s>0?(p=f.cyFinal+o(f.px0[1],f.px1[1]),(b=p-y-t.labelExtraY)*s>0&&(t.labelExtraY+=b)):(m+t.labelExtraY-x)*s>0&&(a=3*l*Math.abs(u-d.indexOf(t)),h=f.cxFinal+i(f.px0[0],f.px1[0]),(g=h+a-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*l>0&&(t.labelExtraX+=g)))}for(n=0;n<2;n++)for(a=n?v:y,o=n?Math.max:Math.min,s=n?1:-1,r=0;r<2;r++){for(i=r?Math.max:Math.min,l=r?1:-1,(u=t[n][r]).sort(a),f=t[1-n][r],d=f.concat(u),h=[],p=0;p<u.length;p++)void 0!==u[p].yLabelMid&&h.push(u[p]);for(g=!1,p=0;n&&p<f.length;p++)if(void 0!==f[p].yLabelMid){g=f[p];break}for(p=0;p<h.length;p++){var x=p&&h[p-1];g&&!p&&(x=g),m(h[p],x)}}}(m,y),g.each(function(t){if(t.labelExtraX||t.labelExtraY){var e=n.select(this),r=e.select("g.slicetext text");r.attr("transform","translate("+t.labelExtraX+","+t.labelExtraY+")"+r.attr("transform"));var a=t.cxFinal+t.pxmid[0],o="M"+a+","+(t.cyFinal+t.pxmid[1]),l=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var s=t.labelExtraX*t.pxmid[1]/t.pxmid[0],c=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);Math.abs(s)>Math.abs(c)?o+="l"+c*t.pxmid[0]/t.pxmid[1]+","+c+"H"+(a+t.labelExtraX+l):o+="l"+t.labelExtraX+","+s+"v"+(c-s)+"h"+l}else o+="V"+(t.yLabelMid+t.labelExtraY)+"h"+l;e.append("path").classed("textline",!0).call(i.stroke,y.outsidetextfont.color).attr({"stroke-width":Math.min(2,y.outsidetextfont.size/8),d:o,fill:"none"})}})})});setTimeout(function(){g.selectAll("tspan").each(function(){var t=n.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{"../../components/color":51,"../../components/drawing":72,"../../components/fx":90,"../../lib":168,"../../lib/svg_text_utils":189,"./event_data":358,"./helpers":359,d3:16}],364:[function(t,e,r){"use strict";var n=t("d3"),a=t("./style_one");e.exports=function(t){t._fullLayout._pielayer.selectAll(".trace").each(function(t){var e=t[0].trace,r=n.select(this);r.style({opacity:e.opacity}),r.selectAll("path.surface").each(function(t){n.select(this).call(a,t,e)})})}},{"./style_one":365,d3:16}],365:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("./helpers").castOption;e.exports=function(t,e,r){var i=r.marker.line,o=a(i.color,e.pts)||n.defaultLine,l=a(i.width,e.pts)||0;t.style({"stroke-width":l}).call(n.fill,e.color).call(n.stroke,o)}},{"../../components/color":51,"./helpers":359}],366:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;r<t.length;r++)t[r].i=r;n.mergeArray(e.text,t,"tx"),n.mergeArray(e.hovertext,t,"htx"),n.mergeArray(e.customdata,t,"data"),n.mergeArray(e.textposition,t,"tp"),e.textfont&&(n.mergeArray(e.textfont.size,t,"ts"),n.mergeArray(e.textfont.color,t,"tc"),n.mergeArray(e.textfont.family,t,"tf"));var a=e.marker;if(a){n.mergeArray(a.size,t,"ms"),n.mergeArray(a.opacity,t,"mo"),n.mergeArray(a.symbol,t,"mx"),n.mergeArray(a.color,t,"mc");var i=a.line;a.line&&(n.mergeArray(i.color,t,"mlc"),n.mergeArray(i.width,t,"mlw"));var o=a.gradient;o&&"none"!==o.type&&(n.mergeArray(o.type,t,"mgt"),n.mergeArray(o.color,t,"mgc"))}}},{"../../lib":168}],367:[function(t,e,r){"use strict";var n=t("../../components/fx/hovertemplate_attributes"),a=t("../../components/colorscale/attributes"),i=t("../../components/colorbar/attributes"),o=t("../../plots/font_attributes"),l=t("../../components/drawing/attributes").dash,s=t("../../components/drawing"),c=t("./constants"),u=t("../../lib/extend").extendFlat;e.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dx:{valType:"number",dflt:1,editType:"calc",anim:!0},y:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dy:{valType:"number",dflt:1,editType:"calc",anim:!0},stackgroup:{valType:"string",dflt:"",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc"},groupnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},stackgaps:{valType:"enumerated",values:["infer zero","interpolate"],dflt:"infer zero",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],editType:"calc"},hoveron:{valType:"flaglist",flags:["points","fills"],editType:"style"},hovertemplate:n({},{keys:c.eventDataKeys}),line:{color:{valType:"color",editType:"style",anim:!0},width:{valType:"number",min:0,dflt:2,editType:"style",anim:!0},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},smoothing:{valType:"number",min:0,max:1.3,dflt:1,editType:"plot"},dash:u({},l,{editType:"style"}),simplify:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},cliponaxis:{valType:"boolean",dflt:!0,editType:"plot"},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],editType:"calc"},fillcolor:{valType:"color",editType:"style",anim:!0},marker:u({symbol:{valType:"enumerated",values:s.symbolList,dflt:"circle",arrayOk:!0,editType:"style"},opacity:{valType:"number",min:0,max:1,arrayOk:!0,editType:"style",anim:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0,editType:"calc",anim:!0},maxdisplayed:{valType:"number",min:0,dflt:0,editType:"plot"},sizeref:{valType:"number",dflt:1,editType:"calc"},sizemin:{valType:"number",min:0,dflt:0,editType:"calc"},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter",editType:"calc"},colorbar:i,line:u({width:{valType:"number",min:0,arrayOk:!0,editType:"style",anim:!0},editType:"calc"},a("marker.line",{anim:!0})),gradient:{type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],arrayOk:!0,dflt:"none",editType:"calc"},color:{valType:"color",arrayOk:!0,editType:"calc"},editType:"calc"},editType:"calc"},a("marker",{anim:!0})),selected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},unselected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0,editType:"calc"},textfont:o({editType:"calc",colorEditType:"style",arrayOk:!0}),r:{valType:"data_array",editType:"calc"},t:{valType:"data_array",editType:"calc"}}},{"../../components/colorbar/attributes":52,"../../components/colorscale/attributes":58,"../../components/drawing":72,"../../components/drawing/attributes":71,"../../components/fx/hovertemplate_attributes":89,"../../lib/extend":162,"../../plots/font_attributes":239,"./constants":371}],368:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=t("../../constants/numerical").BADNUM,l=t("./subtypes"),s=t("./colorscale_calc"),c=t("./arrays_to_calcdata"),u=t("./calc_selection");function f(t,e,r,n,a,o,s){var c=e._length,u=t._fullLayout,f=r._id,d=n._id,p=u._firstScatter[h(e)]===e.uid,v=(g(e,u,r,n)||{}).orientation,y=e.fill;r._minDtick=0,n._minDtick=0;var m={padded:!0},x={padded:!0};s&&(m.ppad=x.ppad=s);var b=c<2||a[0]!==a[c-1]||o[0]!==o[c-1];b&&("tozerox"===y||"tonextx"===y&&(p||"h"===v))?m.tozero=!0:(e.error_y||{}).visible||"tonexty"!==y&&"tozeroy"!==y&&(l.hasMarkers(e)||l.hasText(e))||(m.padded=!1,m.ppad=0),b&&("tozeroy"===y||"tonexty"===y&&(p||"v"===v))?x.tozero=!0:"tonextx"!==y&&"tozerox"!==y||(x.padded=!1),f&&(e._extremes[f]=i.findExtremes(r,a,m)),d&&(e._extremes[d]=i.findExtremes(n,o,x))}function d(t,e){if(l.hasMarkers(t)){var r,n=t.marker,o=1.6*(t.marker.sizeref||1);if(r="area"===t.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/o),3)}:function(t){return Math.max((t||0)/o,3)},a.isArrayOrTypedArray(n.size)){var s={type:"linear"};i.setConvert(s);for(var c=s.makeCalcdata(t.marker,"size"),u=new Array(e),f=0;f<e;f++)u[f]=r(c[f]);return u}return r(n.size)}}function p(t,e){var r=h(e),n=t._firstScatter;n[r]||(n[r]=e.uid)}function h(t){var e=t.stackgroup;return t.xaxis+t.yaxis+t.type+(e?"-"+e:"")}function g(t,e,r,n){var a=t.stackgroup;if(a){var i=e._scatterStackOpts[r._id+n._id][a],o="v"===i.orientation?n:r;return"linear"===o.type||"log"===o.type?i:void 0}}e.exports={calc:function(t,e){var r,l,h,v,y,m,x=t._fullLayout,b=i.getFromId(t,e.xaxis||"x"),_=i.getFromId(t,e.yaxis||"y"),w=b.makeCalcdata(e,"x"),k=_.makeCalcdata(e,"y"),T=e._length,M=new Array(T),A=e.ids,L=g(e,x,b,_),S=!1;p(x,e);var C,O="x",z="y";for(L?(L.traceIndices.push(e.index),(r="v"===L.orientation)?(z="s",C="x"):(O="s",C="y"),y="interpolate"===L.stackgaps):f(t,e,b,_,w,k,d(e,T)),l=0;l<T;l++){var D=M[l]={},P=n(w[l]),E=n(k[l]);P&&E?(D[O]=w[l],D[z]=k[l]):L&&(r?P:E)?(D[C]=r?w[l]:k[l],D.gap=!0,y?(D.s=o,S=!0):D.s=0):D[O]=D[z]=o,A&&(D.id=String(A[l]))}if(c(M,e),s(t,e),u(M,e),L){for(l=0;l<M.length;)M[l][C]===o?M.splice(l,1):l++;if(a.sort(M,function(t,e){return t[C]-e[C]||t.i-e.i}),S){for(l=0;l<M.length-1&&M[l].gap;)l++;for((m=M[l].s)||(m=M[l].s=0),h=0;h<l;h++)M[h].s=m;for(v=M.length-1;v>l&&M[v].gap;)v--;for(m=M[v].s,h=M.length-1;h>v;h--)M[h].s=m;for(;l<v;)if(M[++l].gap){for(h=l+1;M[h].gap;)h++;for(var R=M[l-1][C],I=M[l-1].s,F=(M[h].s-I)/(M[h][C]-R);l<h;)M[l].s=I+(M[l][C]-R)*F,l++}}}return M},calcMarkerSize:d,calcAxisExpansion:f,setFirstScatter:p,getStackOpts:g}},{"../../constants/numerical":149,"../../lib":168,"../../plots/cartesian/axes":212,"./arrays_to_calcdata":366,"./calc_selection":369,"./colorscale_calc":370,"./subtypes":391,"fast-isnumeric":18}],369:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){n.isArrayOrTypedArray(e.selectedpoints)&&n.tagSelected(t,e)}},{"../../lib":168}],370:[function(t,e,r){"use strict";var n=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/calc"),i=t("./subtypes");e.exports=function(t,e){i.hasLines(e)&&n(e,"line")&&a(t,e,{vals:e.line.color,containerStr:"line",cLetter:"c"}),i.hasMarkers(e)&&(n(e,"marker")&&a(t,e,{vals:e.marker.color,containerStr:"marker",cLetter:"c"}),n(e,"marker.line")&&a(t,e,{vals:e.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}},{"../../components/colorscale/calc":59,"../../components/colorscale/helpers":62,"./subtypes":391}],371:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}},{}],372:[function(t,e,r){"use strict";var n=t("./calc");function a(t,e,r,n,a,i,o){a[n]=!0;var l={i:null,gap:!0,s:0};if(l[o]=r,t.splice(e,0,l),e&&r===t[e-1][o]){var s=t[e-1];l.s=s.s,l.i=s.i,l.gap=s.gap}else i&&(l.s=function(t,e,r,n){var a=t[e-1],i=t[e+1];return i?a?a.s+(i.s-a.s)*(r-a[n])/(i[n]-a[n]):i.s:a.s}(t,e,r,o));e||(t[0].t=t[1].t,t[0].trace=t[1].trace,delete t[1].t,delete t[1].trace)}e.exports=function(t,e){var r=e.xaxis,i=e.yaxis,o=r._id+i._id,l=t._fullLayout._scatterStackOpts[o];if(l){var s,c,u,f,d,p,h,g,v,y,m,x,b,_,w,k=t.calcdata;for(var T in l){var M=(y=l[T]).traceIndices;if(M.length){for(m="interpolate"===y.stackgaps,x=y.groupnorm,"v"===y.orientation?(b="x",_="y"):(b="y",_="x"),w=new Array(M.length),s=0;s<w.length;s++)w[s]=!1;p=k[M[0]];var A=new Array(p.length);for(s=0;s<p.length;s++)A[s]=p[s][b];for(s=1;s<M.length;s++){for(d=k[M[s]],c=u=0;c<d.length;c++){for(h=d[c][b];h>A[u]&&u<A.length;u++)a(d,c,A[u],s,w,m,b),c++;if(h!==A[u]){for(f=0;f<s;f++)a(k[M[f]],u,h,f,w,m,b);A.splice(u,0,h)}u++}for(;u<A.length;u++)a(d,c,A[u],s,w,m,b),c++}var L=A.length;for(c=0;c<p.length;c++){for(g=p[c][_]=p[c].s,s=1;s<M.length;s++)(d=k[M[s]])[0].trace._rawLength=d[0].trace._length,d[0].trace._length=L,g+=d[c].s,d[c][_]=g;if(x)for(v=("fraction"===x?g:g/100)||1,s=0;s<M.length;s++){var S=k[M[s]][c];S[_]/=v,S.sNorm=S.s/v}}for(s=0;s<M.length;s++){var C=(d=k[M[s]])[0].trace,O=n.calcMarkerSize(C,C._rawLength),z=Array.isArray(O);if(O&&w[s]||z){var D=O;for(O=new Array(L),c=0;c<L;c++)O[c]=d[c].gap?0:z?D[d[c].i]:D}var P=new Array(L),E=new Array(L);for(c=0;c<L;c++)P[c]=d[c].x,E[c]=d[c].y;n.calcAxisExpansion(t,C,r,i,P,E,O),d[0].t.orientation=y.orientation}}}}}},{"./calc":368}],373:[function(t,e,r){"use strict";e.exports=function(t){for(var e=0;e<t.length;e++){var r=t[e];if("scatter"===r.type){var n=r.fill;if("none"!==n&&"toself"!==n&&(r.opacity=void 0,"tonexty"===n||"tonextx"===n))for(var a=e-1;a>=0;a--){var i=t[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],374:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("./attributes"),o=t("./constants"),l=t("./subtypes"),s=t("./xy_defaults"),c=t("./stack_defaults"),u=t("./marker_defaults"),f=t("./line_defaults"),d=t("./line_shape_defaults"),p=t("./text_defaults"),h=t("./fillcolor_defaults");e.exports=function(t,e,r,g){function v(r,a){return n.coerce(t,e,i,r,a)}var y=s(t,e,g,v);if(y||(e.visible=!1),e.visible){var m=c(t,e,g,v),x=!m&&y<o.PTS_LINESONLY?"lines+markers":"lines";v("text"),v("hovertext"),v("mode",x),l.hasLines(e)&&(f(t,e,r,g,v),d(t,e,v),v("connectgaps"),v("line.simplify")),l.hasMarkers(e)&&u(t,e,r,g,v,{gradient:!0}),l.hasText(e)&&p(t,e,g,v);var b=[];(l.hasMarkers(e)||l.hasText(e))&&(v("cliponaxis"),v("marker.maxdisplayed"),b.push("points")),v("fill",m?m.fillDflt:"none"),"none"!==e.fill&&(h(t,e,r,v),l.hasLines(e)||d(t,e,v));var _=(e.line||{}).color,w=(e.marker||{}).color;"tonext"!==e.fill&&"toself"!==e.fill||b.push("fills"),v("hoveron",b.join("+")||"points"),"fills"!==e.hoveron&&v("hovertemplate");var k=a.getComponentMethod("errorbars","supplyDefaults");k(t,e,_||w||r,{axis:"y"}),k(t,e,_||w||r,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(e,v)}}},{"../../lib":168,"../../registry":257,"./attributes":367,"./constants":371,"./fillcolor_defaults":376,"./line_defaults":380,"./line_shape_defaults":382,"./marker_defaults":386,"./stack_defaults":389,"./subtypes":391,"./text_defaults":392,"./xy_defaults":393}],375:[function(t,e,r){"use strict";var n=t("../../lib");function a(t){return t||0===t}e.exports=function(t,e,r){var i=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},o=n.extractOption(t,e,"htx","hovertext");if(a(o))return i(o);var l=n.extractOption(t,e,"tx","text");return a(l)?i(l):void 0}},{"../../lib":168}],376:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,i){var o=!1;if(e.marker){var l=e.marker.color,s=(e.marker.line||{}).color;l&&!a(l)?o=l:s&&!a(s)&&(o=s)}i("fillcolor",n.addOpacity((e.line||{}).color||o||r,.5))}},{"../../components/color":51,"../../lib":168}],377:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("./subtypes");e.exports=function(t,e){var r,i;if("lines"===t.mode)return(r=t.line.color)&&n.opacity(r)?r:t.fillcolor;if("none"===t.mode)return t.fill?t.fillcolor:"";var o=e.mcc||(t.marker||{}).color,l=e.mlcc||((t.marker||{}).line||{}).color;return(i=o&&n.opacity(o)?o:l&&n.opacity(l)&&(e.mlw||((t.marker||{}).line||{}).width)?l:"")?n.opacity(i)<.3?n.addOpacity(i,.3):i:(r=(t.line||{}).color)&&n.opacity(r)&&a.hasLines(t)&&t.line.width?r:t.fillcolor}},{"../../components/color":51,"./subtypes":391}],378:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/fx"),i=t("../../registry"),o=t("./get_trace_color"),l=t("../../components/color"),s=t("./fill_hover_text");e.exports=function(t,e,r,c){var u=t.cd,f=u[0].trace,d=t.xa,p=t.ya,h=d.c2p(e),g=p.c2p(r),v=[h,g],y=f.hoveron||"",m=-1!==f.mode.indexOf("markers")?3:.5;if(-1!==y.indexOf("points")){var x=function(t){var e=Math.max(m,t.mrc||0),r=d.c2p(t.x)-h,n=p.c2p(t.y)-g;return Math.max(Math.sqrt(r*r+n*n)-e,1-m/e)},b=a.getDistanceFunction(c,function(t){var e=Math.max(3,t.mrc||0),r=1-1/e,n=Math.abs(d.c2p(t.x)-h);return n<e?r*n/e:n-e+r},function(t){var e=Math.max(3,t.mrc||0),r=1-1/e,n=Math.abs(p.c2p(t.y)-g);return n<e?r*n/e:n-e+r},x);if(a.getClosest(u,b,t),!1!==t.index){var _=u[t.index],w=d.c2p(_.x,!0),k=p.c2p(_.y,!0),T=_.mrc||1;t.index=_.i;var M=u[0].t.orientation,A=M&&(_.sNorm||_.s),L="h"===M?A:_.x,S="v"===M?A:_.y;return n.extendFlat(t,{color:o(f,_),x0:w-T,x1:w+T,xLabelVal:L,y0:k-T,y1:k+T,yLabelVal:S,spikeDistance:x(_),hovertemplate:f.hovertemplate}),s(_,f,t),i.getComponentMethod("errorbars","hoverInfo")(_,f,t),[t]}}if(-1!==y.indexOf("fills")&&f._polygons){var C,O,z,D,P,E,R,I,F,N=f._polygons,B=[],j=!1,H=1/0,q=-1/0,V=1/0,U=-1/0;for(C=0;C<N.length;C++)(z=N[C]).contains(v)&&(j=!j,B.push(z),V=Math.min(V,z.ymin),U=Math.max(U,z.ymax));if(j){var G=((V=Math.max(V,0))+(U=Math.min(U,p._length)))/2;for(C=0;C<B.length;C++)for(D=B[C].pts,O=1;O<D.length;O++)(I=D[O-1][1])>G!=(F=D[O][1])>=G&&(E=D[O-1][0],R=D[O][0],F-I&&(P=E+(R-E)*(G-I)/(F-I),H=Math.min(H,P),q=Math.max(q,P)));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(t,{distance:t.maxHoverDistance,x0:H,x1:q,y0:G,y1:G,color:Z,hovertemplate:"%{name}"}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":51,"../../components/fx":90,"../../lib":168,"../../registry":257,"./fill_hover_text":375,"./get_trace_color":377}],379:[function(t,e,r){"use strict";var n={},a=t("./subtypes");n.hasLines=a.hasLines,n.hasMarkers=a.hasMarkers,n.hasText=a.hasText,n.isBubble=a.isBubble,n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.crossTraceDefaults=t("./cross_trace_defaults"),n.calc=t("./calc").calc,n.crossTraceCalc=t("./cross_trace_calc"),n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.colorbar=t("./marker_colorbar"),n.style=t("./style").style,n.styleOnSelect=t("./style").styleOnSelect,n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.animatable=!0,n.moduleType="trace",n.name="scatter",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],n.meta={},e.exports=n},{"../../plots/cartesian":224,"./arrays_to_calcdata":366,"./attributes":367,"./calc":368,"./cross_trace_calc":372,"./cross_trace_defaults":373,"./defaults":374,"./hover":378,"./marker_colorbar":385,"./plot":387,"./select":388,"./style":390,"./subtypes":391}],380:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,l,s){var c=(t.marker||{}).color;(l("line.color",r),a(t,"line"))?i(t,e,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!n(c)&&c||r);l("line.width"),(s||{}).noDash||l("line.dash")}},{"../../components/colorscale/defaults":61,"../../components/colorscale/helpers":62,"../../lib":168}],381:[function(t,e,r){"use strict";var n=t("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,l=i-.5,s=t("../../lib"),c=s.segmentsIntersect,u=s.constrain,f=t("./constants");e.exports=function(t,e){var r,n,i,d,p,h,g,v,y,m,x,b,_,w,k,T,M,A,L=e.xaxis,S=e.yaxis,C="log"===L.type,O="log"===S.type,z=L._length,D=S._length,P=e.connectGaps,E=e.baseTolerance,R=e.shape,I="linear"===R,F=[],N=f.minTolerance,B=new Array(t.length),j=0;function H(e){var r=t[e];if(!r)return!1;var n=L.c2p(r.x),i=S.c2p(r.y);if(n===a){if(C&&(n=L.c2p(r.x,!0)),n===a)return!1;O&&i===a&&(n*=Math.abs(L._m*D*(L._m>0?o:l)/(S._m*z*(S._m>0?o:l)))),n*=1e3}if(i===a){if(O&&(i=S.c2p(r.y,!0)),i===a)return!1;i*=1e3}return[n,i]}function q(t,e,r,n){var a=r-t,i=n-e,o=.5-t,l=.5-e,s=a*a+i*i,c=a*o+i*l;if(c>0&&c<s){var u=o*i-l*a;if(u*u<s)return!0}}function V(t,e){var r=t[0]/z,n=t[1]/D,a=Math.max(0,-r,r-1,-n,n-1);return a&&void 0!==M&&q(r,n,M,A)&&(a=0),a&&e&&q(r,n,e[0]/z,e[1]/D)&&(a=0),(1+f.toleranceGrowth*a)*E}function U(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}var G,Z,X,Y,W,J,$,Q=f.maxScreensAway,K=-z*Q,tt=z*(1+Q),et=-D*Q,rt=D*(1+Q),nt=[[K,et,tt,et],[tt,et,tt,rt],[tt,rt,K,rt],[K,rt,K,et]];function at(t){if(t[0]<K||t[0]>tt||t[1]<et||t[1]>rt)return[u(t[0],K,tt),u(t[1],et,rt)]}function it(t,e){return t[0]===e[0]&&(t[0]===K||t[0]===tt)||(t[1]===e[1]&&(t[1]===et||t[1]===rt)||void 0)}function ot(t,e,r){return function(n,a){var i=at(n),o=at(a),l=[];if(i&&o&&it(i,o))return l;i&&l.push(i),o&&l.push(o);var c=2*s.constrain((n[t]+a[t])/2,e,r)-((i||n)[t]+(o||a)[t]);c&&((i&&o?c>0==i[t]>o[t]?i:o:i||o)[t]+=c);return l}}function lt(t){var e=t[0],r=t[1],n=e===B[j-1][0],a=r===B[j-1][1];if(!n||!a)if(j>1){var i=e===B[j-2][0],o=r===B[j-2][1];n&&(e===K||e===tt)&&i?o?j--:B[j-1]=t:a&&(r===et||r===rt)&&o?i?j--:B[j-1]=t:B[j++]=t}else B[j++]=t}function st(t){B[j-1][0]!==t[0]&&B[j-1][1]!==t[1]&<([X,Y]),lt(t),W=null,X=Y=0}function ct(t){if(M=t[0]/z,A=t[1]/D,G=t[0]<K?K:t[0]>tt?tt:0,Z=t[1]<et?et:t[1]>rt?rt:0,G||Z){if(j)if(W){var e=$(W,t);e.length>1&&(st(e[0]),B[j++]=e[1])}else J=$(B[j-1],t)[0],B[j++]=J;else B[j++]=[G||t[0],Z||t[1]];var r=B[j-1];G&&Z&&(r[0]!==G||r[1]!==Z)?(W&&(X!==G&&Y!==Z?lt(X&&Y?(n=W,i=(a=t)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?K:tt,rt]:[o>0?tt:K,et]):[X||G,Y||Z]):X&&Y&<([X,Y])),lt([G,Z])):X-G&&Y-Z&<([G||X,Z||Y]),W=t,X=G,Y=Z}else W&&st($(W,t)[0]),B[j++]=t;var n,a,i,o}for("linear"===R||"spline"===R?$=function(t,e){for(var r=[],n=0,a=0;a<4;a++){var i=nt[a],o=c(t[0],t[1],e[0],e[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&U(o,t)<U(r[0],t)?r.unshift(o):r.push(o),n++)}return r}:"hv"===R||"vh"===R?$=function(t,e){var r=[],n=at(t),a=at(e);return n&&a&&it(n,a)?r:(n&&r.push(n),a&&r.push(a),r)}:"hvh"===R?$=ot(0,K,tt):"vhv"===R&&($=ot(1,et,rt)),r=0;r<t.length;r++)if(n=H(r)){for(j=0,W=null,ct(n),r++;r<t.length;r++){if(!(d=H(r))){if(P)continue;break}if(I&&e.simplify){var ut=H(r+1);if(!((m=U(d,n))<V(d,ut)*N)){for(v=[(d[0]-n[0])/m,(d[1]-n[1])/m],p=n,x=m,b=w=k=0,g=!1,i=d,r++;r<t.length;r++){if(h=ut,ut=H(r+1),!h){if(P)continue;break}if(T=(y=[h[0]-n[0],h[1]-n[1]])[0]*v[1]-y[1]*v[0],w=Math.min(w,T),(k=Math.max(k,T))-w>V(h,ut))break;i=h,(_=y[0]*v[0]+y[1]*v[1])>x?(x=_,d=h,g=!1):_<b&&(b=_,p=h,g=!0)}if(g?(ct(d),i!==p&&ct(p)):(p!==n&&ct(p),i!==d&&ct(d)),ct(i),r>=t.length||!h)break;ct(h),n=h}}else ct(d)}W&<([X||W[0],Y||W[1]]),F.push(B.slice(0,j))}return F}},{"../../constants/numerical":149,"../../lib":168,"./constants":371}],382:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],383:[function(t,e,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};e.exports=function(t,e,r){var a,i,o,l,s,c={},u=!1,f=-1,d=0,p=-1;for(i=0;i<r.length;i++)(o=(a=r[i][0].trace).stackgroup||"")?o in c?s=c[o]:(s=c[o]=d,d++):a.fill in n&&p>=0?s=p:(s=p=d,d++),s<f&&(u=!0),a._groupIndex=f=s;var h=r.slice();u&&h.sort(function(t,e){var r=t[0].trace,n=e[0].trace;return r._groupIndex-n._groupIndex||r.index-n.index});var g={};for(i=0;i<h.length;i++)o=(a=h[i][0].trace).stackgroup||"",!0===a.visible?(a._nexttrace=null,a.fill in n&&(l=g[o],a._prevtrace=l||null,l&&(l._nexttrace=a)),a._ownfill=a.fill&&("tozero"===a.fill.substr(0,6)||"toself"===a.fill||"to"===a.fill.substr(0,2)&&!a._prevtrace),g[o]=a):a._prevtrace=a._nexttrace=a._ownfill=null;return h}},{}],384:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t){var e=t.marker,r=e.sizeref||1,a=e.sizemin||0,i="area"===e.sizemode?function(t){return Math.sqrt(t/r)}:function(t){return t/r};return function(t){var e=i(t/2);return n(e)&&e>0?Math.max(e,a):0}}},{"fast-isnumeric":18}],385:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],386:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,l,s,c){var u=o.isBubble(t),f=(t.line||{}).color;(c=c||{},f&&(r=f),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),s("marker.color",r),a(t,"marker")&&i(t,e,l,s,{prefix:"marker.",cLetter:"c"}),c.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:u?n.background:n.defaultLine),a(t,"marker.line")&&i(t,e,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0)),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":51,"../../components/colorscale/defaults":61,"../../components/colorscale/helpers":62,"./subtypes":391}],387:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../lib"),o=i.ensureSingle,l=i.identity,s=t("../../components/drawing"),c=t("./subtypes"),u=t("./line_points"),f=t("./link_traces"),d=t("../../lib/polygon").tester;function p(t,e,r,f,p,h,g){var v;!function(t,e,r,a,o){var l=r.xaxis,s=r.yaxis,u=n.extent(i.simpleMap(l.range,l.r2c)),f=n.extent(i.simpleMap(s.range,s.r2c)),d=a[0].trace;if(!c.hasMarkers(d))return;var p=d.marker.maxdisplayed;if(0===p)return;var h=a.filter(function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=f[0]&&t.y<=f[1]}),g=Math.ceil(h.length/p),v=0;o.forEach(function(t,r){var n=t[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r<e&&v++});var y=Math.round(v*g/3+Math.floor(v/3)*g/7.1);a.forEach(function(t){delete t.vis}),h.forEach(function(t,e){0===Math.round((e+y)%g)&&(t.vis=!0)})}(0,e,r,f,p);var y=!!g&&g.duration>0;function m(t){return y?t.transition():t}var x=r.xaxis,b=r.yaxis,_=f[0].trace,w=_.line,k=n.select(h),T=o(k,"g","errorbars"),M=o(k,"g","lines"),A=o(k,"g","points"),L=o(k,"g","text");if(a.getComponentMethod("errorbars","plot")(t,T,r,g),!0===_.visible){var S,C;m(k).style("opacity",_.opacity);var O=_.fill.charAt(_.fill.length-1);"x"!==O&&"y"!==O&&(O=""),r.isRangePlot||(f[0].node3=k);var z,D,P="",E=[],R=_._prevtrace;R&&(P=R._prevRevpath||"",C=R._nextFill,E=R._polygons);var I,F,N,B,j,H,q,V="",U="",G=[],Z=i.noop;if(S=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(C&&C.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(I=s.steps(w.shape),F=s.steps(w.shape.split("").reverse().join(""))):I=F="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?s.smoothclosed(t.slice(1),w.smoothing):s.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},N=function(t){return F(t.reverse())},G=u(f,{xaxis:x,yaxis:b,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify}),q=_._polygons=new Array(G.length),v=0;v<G.length;v++)_._polygons[v]=d(G[v]);G.length&&(B=G[0][0],H=(j=G[G.length-1])[j.length-1]),Z=function(t){return function(e){if(z=I(e),D=N(e),V?O?(V+="L"+z.substr(1),U=D+"L"+U.substr(1)):(V+="Z"+z,U=D+"Z"+U):(V=z,U=D),c.hasLines(_)&&e.length>1){var r=n.select(this);if(r.datum(f),t)m(r.style("opacity",0).attr("d",z).call(s.lineGroupStyle)).style("opacity",1);else{var a=m(r);a.attr("d",z),s.singleLineStyle(f,a)}}}}}var X=M.selectAll(".js-line").data(G);m(X.exit()).style("opacity",0).remove(),X.each(Z(!1)),X.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(Z(!0)),s.setClipUrl(X,r.layerClipId,t),G.length?(S?(S.datum(f),B&&H&&(O?("y"===O?B[1]=H[1]=b.c2p(0,!0):"x"===O&&(B[0]=H[0]=x.c2p(0,!0)),m(S).attr("d","M"+H+"L"+B+"L"+V.substr(1)).call(s.singleFillStyle)):m(S).attr("d",V+"Z").call(s.singleFillStyle))):C&&("tonext"===_.fill.substr(0,6)&&V&&P?("tonext"===_.fill?m(C).attr("d",V+"Z"+P+"Z").call(s.singleFillStyle):m(C).attr("d",V+"L"+P.substr(1)+"Z").call(s.singleFillStyle),_._polygons=_._polygons.concat(E)):(W(C),_._polygons=null)),_._prevRevpath=U,_._prevPolygons=q):(S?W(S):C&&W(C),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(f),L.datum(f),function(e,a,i){var o,u=i[0].trace,f=c.hasMarkers(u),d=c.hasText(u),p=tt(u),h=et,g=et;if(f||d){var v=l,_=u.stackgroup,w=_&&"infer zero"===t._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?v=w?$:J:_&&!w&&(v=Q),f&&(h=v),d&&(g=v)}var k,T=(o=e.selectAll("path.point").data(h,p)).enter().append("path").classed("point",!0);y&&T.call(s.pointStyle,u,t).call(s.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),f&&(k=s.makePointStyleFns(u)),o.each(function(e){var a=n.select(this),i=m(a);s.translatePoint(e,i,x,b)?(s.singlePointStyle(e,i,u,k,t),r.layerClipId&&s.hideOutsideRangePoint(e,i,x,b,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):i.remove()}),y?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(g,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each(function(t){var e=n.select(this),a=m(e.select("text"));s.translatePoint(t,a,x,b)?r.layerClipId&&s.hideOutsideRangePoint(t,e,x,b,u.xcalendar,u.ycalendar):e.remove()}),o.selectAll("text").call(s.textPointStyle,u,t).each(function(t){var e=x.c2p(t.x),r=b.c2p(t.y);n.select(this).selectAll("tspan.line").each(function(){m(n.select(this)).attr({x:e,y:r})})}),o.exit().remove()}(A,L,f);var Y=!1===_.cliponaxis?null:r.layerClipId;s.setClipUrl(A,Y,t),s.setClipUrl(L,Y,t)}function W(t){m(t).attr("d","M0,0Z")}function J(t){return t.filter(function(t){return!t.gap&&t.vis})}function $(t){return t.filter(function(t){return t.vis})}function Q(t){return t.filter(function(t){return!t.gap})}function K(t){return t.id}function tt(t){if(t.ids)return K}function et(){return!1}}e.exports=function(t,e,r,a,i,c){var u,d,h=!i,g=!!i&&i.duration>0,v=f(t,e,r);((u=a.selectAll("g.trace").data(v,function(t){return t[0].trace.uid})).enter().append("g").attr("class",function(t){return"trace scatter trace"+t[0].trace.uid}).style("stroke-miterlimit",2),u.order(),function(t,e,r){e.each(function(e){var a=o(n.select(this),"g","fills");s.setClipUrl(a,r.layerClipId,t);var i=e[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,l);u.enter().append("g"),u.exit().each(function(t){i[t]=null}).remove(),u.order().each(function(t){i[t]=o(n.select(this),"path","js-fill")})})}(t,u,e),g)?(c&&(d=c()),n.transition().duration(i.duration).ease(i.easing).each("end",function(){d&&d()}).each("interrupt",function(){d&&d()}).each(function(){a.selectAll("g.trace").each(function(r,n){p(t,n,e,r,v,this,i)})})):u.each(function(r,n){p(t,n,e,r,v,this,i)});h&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":72,"../../lib":168,"../../lib/polygon":180,"../../registry":257,"./line_points":381,"./link_traces":383,"./subtypes":391,d3:16}],388:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,a,i,o,l=t.cd,s=t.xaxis,c=t.yaxis,u=[],f=l[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r<l.length;r++)l[r].selected=0;else for(r=0;r<l.length;r++)a=l[r],i=s.c2p(a.x),o=c.c2p(a.y),null!==a.i&&e.contains([i,o],!1,r,t)?(u.push({pointNumber:a.i,x:s.c2d(a.x),y:c.c2d(a.y)}),a.selected=1):a.selected=0;return u}},{"./subtypes":391}],389:[function(t,e,r){"use strict";var n=["orientation","groupnorm","stackgaps"];e.exports=function(t,e,r,a){var i=r._scatterStackOpts,o=a("stackgroup");if(o){var l=e.xaxis+e.yaxis,s=i[l];s||(s=i[l]={});var c=s[o],u=!1;c?c.traces.push(e):(c=s[o]={traceIndices:[],traces:[e]},u=!0);for(var f={orientation:e.x&&!e.y?"h":"v"},d=0;d<n.length;d++){var p=n[d],h=p+"Found";if(!c[h]){var g=void 0!==t[p],v="orientation"===p;if((g||u)&&(c[p]=a(p,f[p]),v&&(c.fillDflt="h"===c[p]?"tonextx":"tonexty"),g&&(c[h]=!0,!u&&(delete c.traces[0][p],v))))for(var y=0;y<c.traces.length-1;y++){var m=c.traces[y];m._input.fill!==m.fill&&(m.fill=c.fillDflt)}}}return c}}},{}],390:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/drawing"),i=t("../../registry");function o(t,e,r){a.pointStyle(t.selectAll("path.point"),e,r)}function l(t,e,r){a.textPointStyle(t.selectAll("text"),e,r)}e.exports={style:function(t,e){var r=e?e[0].node3:n.select(t).selectAll("g.trace.scatter");r.style("opacity",function(t){return t[0].trace.opacity}),r.selectAll("g.points").each(function(e){o(n.select(this),e.trace||e[0].trace,t)}),r.selectAll("g.text").each(function(e){l(n.select(this),e.trace||e[0].trace,t)}),r.selectAll("g.trace path.js-line").call(a.lineGroupStyle),r.selectAll("g.trace path.js-fill").call(a.fillGroupStyle),i.getComponentMethod("errorbars","style")(r)},stylePoints:o,styleText:l,styleOnSelect:function(t,e){var r=e[0].node3,n=e[0].trace;n.selectedpoints?(a.selectedPointStyle(r.selectAll("path.point"),n),a.selectedTextStyle(r.selectAll("text"),n)):(o(r,n,t),l(r,n,t))}}},{"../../components/drawing":72,"../../registry":257,d3:16}],391:[function(t,e,r){"use strict";var n=t("../../lib");e.exports={hasLines:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("lines")},hasMarkers:function(t){return t.visible&&(t.mode&&-1!==t.mode.indexOf("markers")||"splom"===t.type)},hasText:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("text")},isBubble:function(t){return n.isPlainObject(t.marker)&&n.isArrayOrTypedArray(t.marker.size)}}},{"../../lib":168}],392:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,a,i){i=i||{},a("textposition"),n.coerceFont(a,"textfont",r.font),i.noSelect||(a("selected.textfont.color"),a("unselected.textfont.color"))}},{"../../lib":168}],393:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry");e.exports=function(t,e,r,i){var o,l=i("x"),s=i("y");if(a.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],r),l){var c=n.minRowLength(l);s?o=Math.min(c,n.minRowLength(s)):(o=c,i("y0"),i("dy"))}else{if(!s)return 0;o=n.minRowLength(s),i("x0"),i("dx")}return e._length=o,o}},{"../../lib":168,"../../registry":257}],394:[function(t,e,r){"use strict";var n=t("../../components/fx/hovertemplate_attributes"),a=t("../scatter/attributes"),i=t("../../plots/attributes"),o=t("../../components/colorscale/attributes"),l=t("../../components/colorbar/attributes"),s=t("../../components/drawing/attributes").dash,c=t("../../lib/extend").extendFlat,u=a.marker,f=a.line,d=u.line;e.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:c({},a.mode,{dflt:"markers"}),text:c({},a.text,{}),hovertext:c({},a.hovertext,{}),line:{color:f.color,width:f.width,dash:s,shape:c({},f.shape,{values:["linear","spline"]}),smoothing:f.smoothing,editType:"calc"},connectgaps:a.connectgaps,cliponaxis:a.cliponaxis,fill:c({},a.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:a.fillcolor,marker:c({symbol:u.symbol,opacity:u.opacity,maxdisplayed:u.maxdisplayed,size:u.size,sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,line:c({width:d.width,editType:"calc"},o("marker.line")),gradient:u.gradient,editType:"calc"},o("marker"),{colorbar:l}),textfont:a.textfont,textposition:a.textposition,selected:a.selected,unselected:a.unselected,hoverinfo:c({},i.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:a.hoveron,hovertemplate:n()}},{"../../components/colorbar/attributes":52,"../../components/colorscale/attributes":58,"../../components/drawing/attributes":71,"../../components/fx/hovertemplate_attributes":89,"../../lib/extend":162,"../../plots/attributes":209,"../scatter/attributes":367}],395:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../scatter/colorscale_calc"),i=t("../scatter/arrays_to_calcdata"),o=t("../scatter/calc_selection"),l=t("../scatter/calc").calcMarkerSize,s=["a","b","c"],c={a:["b","c"],b:["a","c"],c:["a","b"]};e.exports=function(t,e){var r,u,f,d,p,h,g=t._fullLayout[e.subplot].sum,v=e.sum||g,y={a:e.a,b:e.b,c:e.c};for(r=0;r<s.length;r++)if(!y[f=s[r]]){for(p=y[c[f][0]],h=y[c[f][1]],d=new Array(p.length),u=0;u<p.length;u++)d[u]=v-p[u]-h[u];y[f]=d}var m,x,b,_,w,k,T=e._length,M=new Array(T);for(r=0;r<T;r++)m=y.a[r],x=y.b[r],b=y.c[r],n(m)&&n(x)&&n(b)?(1!==(_=g/((m=+m)+(x=+x)+(b=+b)))&&(m*=_,x*=_,b*=_),k=m,w=b-x,M[r]={x:w,y:k,a:m,b:x,c:b}):M[r]={x:!1,y:!1};return l(e,T),a(t,e),i(M,e),o(M,e),M}},{"../scatter/arrays_to_calcdata":366,"../scatter/calc":368,"../scatter/calc_selection":369,"../scatter/colorscale_calc":370,"fast-isnumeric":18}],396:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../scatter/constants"),i=t("../scatter/subtypes"),o=t("../scatter/marker_defaults"),l=t("../scatter/line_defaults"),s=t("../scatter/line_shape_defaults"),c=t("../scatter/text_defaults"),u=t("../scatter/fillcolor_defaults"),f=t("./attributes");e.exports=function(t,e,r,d){function p(r,a){return n.coerce(t,e,f,r,a)}var h,g=p("a"),v=p("b"),y=p("c");if(g?(h=g.length,v?(h=Math.min(h,v.length),y&&(h=Math.min(h,y.length))):h=y?Math.min(h,y.length):0):v&&y&&(h=Math.min(v.length,y.length)),h){e._length=h,p("sum"),p("text"),p("hovertext"),"fills"!==e.hoveron&&p("hovertemplate"),p("mode",h<a.PTS_LINESONLY?"lines+markers":"lines"),i.hasLines(e)&&(l(t,e,r,d,p),s(t,e,p),p("connectgaps")),i.hasMarkers(e)&&o(t,e,r,d,p,{gradient:!0}),i.hasText(e)&&c(t,e,d,p);var m=[];(i.hasMarkers(e)||i.hasText(e))&&(p("cliponaxis"),p("marker.maxdisplayed"),m.push("points")),p("fill"),"none"!==e.fill&&(u(t,e,r,p),i.hasLines(e)||s(t,e,p)),"tonext"!==e.fill&&"toself"!==e.fill||m.push("fills"),p("hoveron",m.join("+")||"points"),n.coerceSelectionMarkerOpacity(e,p)}else e.visible=!1}},{"../../lib":168,"../scatter/constants":371,"../scatter/fillcolor_defaults":376,"../scatter/line_defaults":380,"../scatter/line_shape_defaults":382,"../scatter/marker_defaults":386,"../scatter/subtypes":391,"../scatter/text_defaults":392,"./attributes":394}],397:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,a){if(e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),n[a]){var i=n[a];t.a=i.a,t.b=i.b,t.c=i.c}else t.a=e.a,t.b=e.b,t.c=e.c;return t}},{}],398:[function(t,e,r){"use strict";var n=t("../scatter/hover"),a=t("../../plots/cartesian/axes");e.exports=function(t,e,r,i){var o=n(t,e,r,i);if(o&&!1!==o[0].index){var l=o[0];if(void 0===l.index){var s=1-l.y0/t.ya._length,c=t.xa._length,u=c*s/2,f=c-u;return l.x0=Math.max(Math.min(l.x0,f),u),l.x1=Math.max(Math.min(l.x1,f),u),o}var d=l.cd[l.index];l.a=d.a,l.b=d.b,l.c=d.c,l.xLabelVal=void 0,l.yLabelVal=void 0;var p=l.trace,h=l.subplot,g=d.hi||p.hoverinfo,v=[];if(!p.hovertemplate){var y=g.split("+");-1!==y.indexOf("all")&&(y=["a","b","c"]),-1!==y.indexOf("a")&&m(h.aaxis,d.a),-1!==y.indexOf("b")&&m(h.baxis,d.b),-1!==y.indexOf("c")&&m(h.caxis,d.c)}return l.extraText=v.join("<br>"),l.hovertemplate=p.hovertemplate,o}function m(t,e){v.push(t._hovertitle+": "+a.tickText(t,e,"hover").text)}}},{"../../plots/cartesian/axes":212,"../scatter/hover":378}],399:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/marker_colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("../scatter/style").style,n.styleOnSelect=t("../scatter/style").styleOnSelect,n.hoverPoints=t("./hover"),n.selectPoints=t("../scatter/select"),n.eventData=t("./event_data"),n.moduleType="trace",n.name="scatterternary",n.basePlotModule=t("../../plots/ternary"),n.categories=["ternary","symbols","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/ternary":253,"../scatter/marker_colorbar":385,"../scatter/select":388,"../scatter/style":390,"./attributes":394,"./calc":395,"./defaults":396,"./event_data":397,"./hover":398,"./plot":400}],400:[function(t,e,r){"use strict";var n=t("../scatter/plot");e.exports=function(t,e,r){var a=e.plotContainer;a.select(".scatterlayer").selectAll("*").remove();var i={xaxis:e.xaxis,yaxis:e.yaxis,plot:a,layerClipId:e._hasClipOnAxisFalse?e.clipIdRelative:null},o=e.layers.frontplot.select("g.scatterlayer");n(t,i,r,o)}},{"../scatter/plot":387}],401:[function(t,e,r){"use strict";var n=t("../box/attributes"),a=t("../../lib/extend").extendFlat;e.exports={y:n.y,x:n.x,x0:n.x0,y0:n.y0,name:n.name,orientation:a({},n.orientation,{}),bandwidth:{valType:"number",min:0,editType:"calc"},scalegroup:{valType:"string",dflt:"",editType:"calc"},scalemode:{valType:"enumerated",values:["width","count"],dflt:"width",editType:"calc"},spanmode:{valType:"enumerated",values:["soft","hard","manual"],dflt:"soft",editType:"calc"},span:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,points:a({},n.boxpoints,{}),jitter:a({},n.jitter,{}),pointpos:a({},n.pointpos,{}),width:a({},n.width,{}),marker:n.marker,text:n.text,box:{visible:{valType:"boolean",dflt:!1,editType:"plot"},width:{valType:"number",min:0,max:1,dflt:.25,editType:"plot"},fillcolor:{valType:"color",editType:"style"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"style"},editType:"plot"},meanline:{visible:{valType:"boolean",dflt:!1,editType:"plot"},color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"plot"},side:{valType:"enumerated",values:["both","positive","negative"],dflt:"both",editType:"calc"},selected:n.selected,unselected:n.unselected,hoveron:{valType:"flaglist",flags:["violins","points","kde"],dflt:"violins+points+kde",extras:["all"],editType:"style"}}},{"../../lib/extend":162,"../box/attributes":282}],402:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../box/calc"),o=t("./helpers"),l=t("../../constants/numerical").BADNUM;function s(t,e,r){var a=e.max-e.min;if(!a)return 1;if(t.bandwidth)return Math.max(t.bandwidth,a/1e4);var i=r.length,o=n.stdev(r,i-1,e.mean);return Math.max(function(t,e,r){return 1.059*Math.min(e,r/1.349)*Math.pow(t,-.2)}(i,o,e.q3-e.q1),a/100)}function c(t,e,r,n){var i,o=t.spanmode,s=t.span||[],c=[e.min,e.max],u=[e.min-2*n,e.max+2*n];function f(n){var a=s[n],i="multicategory"===r.type?r.r2c(a):r.d2c(a,0,t[e.valLetter+"calendar"]);return i===l?u[n]:i}var d={type:"linear",range:i="soft"===o?u:"hard"===o?c:[f(0),f(1)]};return a.setConvert(d),d.cleanRange(),i}e.exports=function(t,e){var r=i(t,e);if(r[0].t.empty)return r;for(var l=t._fullLayout,u=a.getFromId(t,e["h"===e.orientation?"xaxis":"yaxis"]),f=1/0,d=-1/0,p=0,h=0,g=0;g<r.length;g++){var v=r[g],y=v.pts.map(o.extractVal),m=v.bandwidth=s(e,v,y),x=v.span=c(e,v,u,m),b=x[1]-x[0],_=Math.ceil(b/(m/3)),w=b/_;if(!isFinite(w)||!isFinite(_))return n.error("Something went wrong with computing the violin span"),r[0].t.empty=!0,r;var k=o.makeKDE(v,e,y);v.density=new Array(_);for(var T=0,M=x[0];M<x[1]+w/2;T++,M+=w){var A=k(M);v.density[T]={v:A,t:M},p=Math.max(p,A)}h=Math.max(h,y.length),f=Math.min(f,x[0]),d=Math.max(d,x[1])}var L=a.findExtremes(u,[f,d],{padded:!0});if(e._extremes[u._id]=L,e.width)r[0].t.maxKDE=p;else{var S=l._violinScaleGroupStats,C=e.scalegroup,O=S[C];O?(O.maxKDE=Math.max(O.maxKDE,p),O.maxCount=Math.max(O.maxCount,h)):S[C]={maxKDE:p,maxCount:h}}return r[0].t.labels.kde=n._(t,"kde:"),r}},{"../../constants/numerical":149,"../../lib":168,"../../plots/cartesian/axes":212,"../box/calc":283,"./helpers":405}],403:[function(t,e,r){"use strict";var n=t("../box/cross_trace_calc").setPositionOffset,a=["v","h"];e.exports=function(t,e){for(var r=t.calcdata,i=e.xaxis,o=e.yaxis,l=0;l<a.length;l++){for(var s=a[l],c="h"===s?o:i,u=[],f=0;f<r.length;f++){var d=r[f],p=d[0].t,h=d[0].trace;!0!==h.visible||"violin"!==h.type||p.empty||h.orientation!==s||h.xaxis!==i._id||h.yaxis!==o._id||u.push(f)}n("violin",t,u,c)}}},{"../box/cross_trace_calc":284}],404:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/color"),i=t("../box/defaults"),o=t("./attributes");e.exports=function(t,e,r,l){function s(r,a){return n.coerce(t,e,o,r,a)}function c(r,a){return n.coerce2(t,e,o,r,a)}if(i.handleSampleDefaults(t,e,s,l),!1!==e.visible){s("bandwidth"),s("side"),s("width")||(s("scalegroup",e.name),s("scalemode"));var u,f=s("span");Array.isArray(f)&&(u="manual"),s("spanmode",u);var d=s("line.color",(t.marker||{}).color||r),p=s("line.width"),h=s("fillcolor",a.addOpacity(e.line.color,.5));i.handlePointsDefaults(t,e,s,{prefix:""});var g=c("box.width"),v=c("box.fillcolor",h),y=c("box.line.color",d),m=c("box.line.width",p);s("box.visible",Boolean(g||v||y||m))||(e.box={visible:!1});var x=c("meanline.color",d),b=c("meanline.width",p);s("meanline.visible",Boolean(x||b))||(e.meanline={visible:!1})}}},{"../../components/color":51,"../../lib":168,"../box/defaults":285,"./attributes":401}],405:[function(t,e,r){"use strict";var n=t("../../lib"),a=function(t){return 1/Math.sqrt(2*Math.PI)*Math.exp(-.5*t*t)};r.makeKDE=function(t,e,r){var n=r.length,i=a,o=t.bandwidth,l=1/(n*o);return function(t){for(var e=0,a=0;a<n;a++)e+=i((t-r[a])/o);return l*e}},r.getPositionOnKdePath=function(t,e,r){var a,i;"h"===e.orientation?(a="y",i="x"):(a="x",i="y");var o=n.findPointOnPath(t.path,r,i,{pathLength:t.pathLength}),l=t.posCenterPx,s=o[a];return[s,"both"===e.side?2*l-s:l]},r.getKdeValue=function(t,e,n){var a=t.pts.map(r.extractVal);return r.makeKDE(t,e,a)(n)/t.posDensityScale},r.extractVal=function(t){return t.v}},{"../../lib":168}],406:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../box/hover"),o=t("./helpers");e.exports=function(t,e,r,l,s){var c,u,f=t.cd,d=f[0].trace,p=d.hoveron,h=-1!==p.indexOf("violins"),g=-1!==p.indexOf("kde"),v=[];if(h||g){var y=i.hoverOnBoxes(t,e,r,l);if(h&&(v=v.concat(y)),g&&y.length>0){var m,x,b,_,w,k=t.xa,T=t.ya;"h"===d.orientation?(w=e,m="y",b=T,x="x",_=k):(w=r,m="x",b=k,x="y",_=T);var M=f[t.index];if(w>=M.span[0]&&w<=M.span[1]){var A=n.extendFlat({},t),L=_.c2p(w,!0),S=o.getKdeValue(M,d,w),C=o.getPositionOnKdePath(M,d,L),O=b._offset,z=b._length;A[m+"0"]=C[0],A[m+"1"]=C[1],A[x+"0"]=A[x+"1"]=L,A[x+"Label"]=x+": "+a.hoverLabelText(_,w)+", "+f[0].t.labels.kde+" "+S.toFixed(3),A.spikeDistance=y[0].spikeDistance;var D=m+"Spike";A[D]=y[0][D],y[0].spikeDistance=void 0,y[0][D]=void 0,v.push(A),(u={stroke:t.color})[m+"1"]=n.constrain(O+C[0],O,O+z),u[m+"2"]=n.constrain(O+C[1],O,O+z),u[x+"1"]=u[x+"2"]=_._offset+L}}}-1!==p.indexOf("points")&&(c=i.hoverOnPoints(t,e,r));var P=s.selectAll(".violinline-"+d.uid).data(u?[0]:[]);return P.enter().append("line").classed("violinline-"+d.uid,!0).attr("stroke-width",1.5),P.exit().remove(),P.attr(u),"closest"===l?c?[c]:v:c?(v.push(c),v):v}},{"../../lib":168,"../../plots/cartesian/axes":212,"../box/hover":287,"./helpers":405}],407:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc"),plot:t("./plot"),style:t("./style"),styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../box/select"),moduleType:"trace",name:"violin",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","violinLayout","zoomScale"],meta:{}}},{"../../plots/cartesian":224,"../box/select":292,"../scatter/style":390,"./attributes":401,"./calc":402,"./cross_trace_calc":403,"./defaults":404,"./hover":406,"./layout_attributes":408,"./layout_defaults":409,"./plot":410,"./style":411}],408:[function(t,e,r){"use strict";var n=t("../box/layout_attributes"),a=t("../../lib").extendFlat;e.exports={violinmode:a({},n.boxmode,{}),violingap:a({},n.boxgap,{}),violingroupgap:a({},n.boxgroupgap,{})}},{"../../lib":168,"../box/layout_attributes":289}],409:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes"),i=t("../box/layout_defaults");e.exports=function(t,e,r){i._supply(t,e,r,function(r,i){return n.coerce(t,e,a,r,i)},"violin")}},{"../../lib":168,"../box/layout_defaults":290,"./layout_attributes":408}],410:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../components/drawing"),o=t("../box/plot"),l=t("../scatter/line_points"),s=t("./helpers");e.exports=function(t,e,r,c){var u=t._fullLayout,f=e.xaxis,d=e.yaxis;function p(t){var e=l(t,{xaxis:f,yaxis:d,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0});return i.smoothopen(e[0],1)}a.makeTraceGroups(c,r,"trace violins").each(function(t){var r=n.select(this),i=t[0],l=i.t,c=i.trace;if(e.isRangePlot||(i.node3=r),!0!==c.visible||l.empty)r.remove();else{var h=l.bPos,g=l.bdPos,v=e[l.valLetter+"axis"],y=e[l.posLetter+"axis"],m="both"===c.side,x=m||"positive"===c.side,b=m||"negative"===c.side,_=r.selectAll("path.violin").data(a.identity);_.enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","violin"),_.exit().remove(),_.each(function(t){var e,r,a,i,o,s,f,d,_=n.select(this),w=t.density,k=w.length,T=t.pos+h,M=y.c2p(T);if(c.width)e=l.maxKDE/g;else{var A=u._violinScaleGroupStats[c.scalegroup];e="count"===c.scalemode?A.maxKDE/g*(A.maxCount/t.pts.length):A.maxKDE/g}if(x){for(f=new Array(k),o=0;o<k;o++)(d=f[o]={})[l.posLetter]=T+w[o].v/e,d[l.valLetter]=w[o].t;r=p(f)}if(b){for(f=new Array(k),s=0,o=k-1;s<k;s++,o--)(d=f[s]={})[l.posLetter]=T-w[o].v/e,d[l.valLetter]=w[o].t;a=p(f)}if(m)i=r+"L"+a.substr(1)+"Z";else{var L=[M,v.c2p(w[0].t)],S=[M,v.c2p(w[k-1].t)];"h"===c.orientation&&(L.reverse(),S.reverse()),i=x?"M"+L+"L"+r.substr(1)+"L"+S:"M"+S+"L"+a.substr(1)+"L"+L}_.attr("d",i),t.posCenterPx=M,t.posDensityScale=e*g,t.path=_.node(),t.pathLength=t.path.getTotalLength()/(m?2:1)});var w,k,T,M=c.box,A=M.width,L=(M.line||{}).width;m?(w=g*A,k=0):x?(w=[0,g*A/2],k=-L):(w=[g*A/2,0],k=L),o.plotBoxAndWhiskers(r,{pos:y,val:v},c,{bPos:h,bdPos:w,bPosPxOffset:k}),o.plotBoxMean(r,{pos:y,val:v},c,{bPos:h,bdPos:w,bPosPxOffset:k}),!c.box.visible&&c.meanline.visible&&(T=a.identity);var S=r.selectAll("path.meanline").data(T||[]);S.enter().append("path").attr("class","meanline").style("fill","none").style("vector-effect","non-scaling-stroke"),S.exit().remove(),S.each(function(t){var e=v.c2p(t.mean,!0),r=s.getPositionOnKdePath(t,c,e);n.select(this).attr("d","h"===c.orientation?"M"+e+","+r[0]+"V"+r[1]:"M"+r[0]+","+e+"H"+r[1])}),o.plotPoints(r,{x:f,y:d},c,l)}})}},{"../../components/drawing":72,"../../lib":168,"../box/plot":291,"../scatter/line_points":381,"./helpers":405,d3:16}],411:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/color"),i=t("../scatter/style").stylePoints;e.exports=function(t,e){var r=e?e[0].node3:n.select(t).selectAll("g.trace.violins");r.style("opacity",function(t){return t[0].trace.opacity}),r.each(function(e){var r=e[0].trace,o=n.select(this),l=r.box||{},s=l.line||{},c=r.meanline||{},u=c.width;o.selectAll("path.violin").style("stroke-width",r.line.width+"px").call(a.stroke,r.line.color).call(a.fill,r.fillcolor),o.selectAll("path.box").style("stroke-width",s.width+"px").call(a.stroke,s.color).call(a.fill,l.fillcolor);var f={"stroke-width":u+"px","stroke-dasharray":2*u+"px,"+u+"px"};o.selectAll("path.mean").style(f).call(a.stroke,c.color),o.selectAll("path.meanline").style(f).call(a.stroke,c.color),i(o,r,t)})}},{"../../components/color":51,"../scatter/style":390,d3:16}]},{},[11])(11)});
|