diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bffba97e86..326d5d3263e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,13 @@ https://github.com/plotly/plotly.js/compare/vX.Y.Z...master where X.Y.Z is the semver of most recent plotly.js release. + +## [1.20.2-d26] -- 2016-11-25 + +### Fixed + +- Fix pie plots not propagating original click event + ## [1.20.2] -- 2016-11-17 ### Fixed diff --git a/dist/plotly-cartesian.min.js b/dist/plotly-cartesian.min.js index 5616ce9ba4f..eff4475b12c 100644 --- a/dist/plotly-cartesian.min.js +++ b/dist/plotly-cartesian.min.js @@ -1,5 +1,5 @@ /** -* plotly.js (cartesian - minified) v1.20.2-d25 +* plotly.js (cartesian - minified) v1.20.2-d26 * Copyright 2012-2016, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -14,7 +14,7 @@ O[0]=f[P],O[1]=d[N]}else ui.event.altKey&&(x=O.slice());M.style("pointer-events" r.attributes=t("./attributes"),r.handleDefaults=t("./defaults"),r.calc=t("./calc"),r.hasColorscale=t("./has_colorscale"),r.isValidScale=t("./is_valid_scale"),r.getScale=t("./get_scale"),r.flipScale=t("./flip_scale"),r.extractScale=t("./extract_scale"),r.makeColorScaleFunc=t("./make_color_scale_func")},{"./attributes":35,"./calc":36,"./default_scale":38,"./defaults":39,"./extract_scale":40,"./flip_scale":41,"./get_scale":42,"./has_colorscale":43,"./is_valid_scale":45,"./make_color_scale_func":47,"./scales":48}],45:[function(t,e,r){"use strict";var n=t("./scales"),a=t("./is_valid_scale_array");e.exports=function(t){return void 0!==n[t]||a(t)}},{"./is_valid_scale_array":46,"./scales":48}],46:[function(t,e,r){"use strict";var n=t("tinycolor2");e.exports=function(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;r4/3-l?i:l}},{}],50:[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,o){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===o?0:"middle"===o?1:"top"===o?2:n.constrain(Math.floor(3*e),0,2),a[e][t]}},{"../../lib":122}],51:[function(t,e,r){"use strict";function n(){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 a(t){t._dragging=!1,t._replotPending&&o.plot(t)}var o=t("../../plotly"),i=t("../../lib"),l=t("../../plots/cartesian/constants"),s=e.exports={};s.align=t("./align"),s.getCursor=t("./cursor");var c=t("./unhover");s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(t){function e(e){return t.element.onmousemove=p,g._dragged=!1,g._dragging=!0,c=e.clientX,u=e.clientY,h=e.target,f=(new Date).getTime(),f-g._mouseDownTimev&&(m=Math.max(m-1,1)),t.doneFn&&t.doneFn(g._dragged,m),!g._dragged){var r=document.createEvent("MouseEvents");r.initMouseEvent("click",e.bubbles,e.cancelable,e.view,0,0,0,0,0,!1,!1,!1,!1,e.button,null),h.dispatchEvent(r)}return a(g),g._dragged=!1,i.pauseEvent(e)}var c,u,f,d,h,p,g=i.getPlotDiv(t.element)||{},m=1,v=l.DBLCLICKDELAY;g._mouseDownTime||(g._mouseDownTime=0),p=t.element.onmousemove,t.setCursor&&(t.element.onmousemove=t.setCursor),t.element.onmousedown=e,t.element.style.pointerEvents="all"},s.coverSlip=n},{"../../lib":122,"../../plotly":144,"../../plots/cartesian/constants":154,"./align":49,"./cursor":50,"./unhover":52}],52:[function(t,e,r){"use strict";var n=t("../../lib/events"),a=e.exports={};a.wrapped=function(t,e,r){"string"==typeof t&&(t=document.getElementById(t)),t._hoverTimer&&(clearTimeout(t._hoverTimer),t._hoverTimer=void 0),a.raw(t,e,r)},a.raw=function(t,e){var r=t._fullLayout;e||(e={}),e.target&&n.triggerHandler(t,"plotly_beforehover",e)===!1||(r._hoverlayer.selectAll("g").remove(),e.target&&t._hoverdata&&t.emit("plotly_unhover",{points:t._hoverdata}),t._hoverdata=void 0)}},{"../../lib/events":118}],53:[function(t,e,r){"use strict";function n(t,e,r,n,a,o,i){if(l.traceIs(r,"symbols")){var c=p(r);e.attr("d",function(t){var e;e="various"===t.ms||"various"===o.size?3:h.isBubble(r)?c(t.ms):(o.size||6)/2,t.mrc=e;var n=g.symbolNumber(t.mx||o.symbol)||0,a=n%100;return t.om=n%200>=100,g.symbolFuncs[a](e)+(n>=200?y:"")}).style("opacity",function(t){return(t.mo+1||o.opacity+1)-1})}var u,f,d;t.so?(d=i.outlierwidth,f=i.outliercolor,u=o.outliercolor):(d=(t.mlw+1||i.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,f="mlc"in t?t.mlcc=a(t.mlc):Array.isArray(i.color)?s.defaultLine:i.color,u="mc"in t?t.mcc=n(t.mc):Array.isArray(o.color)?s.defaultLine:o.color||"rgba(0,0,0,0)"),t.om?e.call(s.stroke,u).style({"stroke-width":(d||1)+"px",fill:"none"}):(e.style("stroke-width",d+"px").call(s.fill,u),d&&e.call(s.stroke,f))}function a(t,e,r,n){var a=t[0]-e[0],i=t[1]-e[1],l=r[0]-e[0],s=r[1]-e[1],c=Math.pow(a*a+i*i,_/2),u=Math.pow(l*l+s*s,_/2),f=(u*u*a-c*c*l)*n,d=(u*u*i-c*c*s)*n,h=3*u*(c+u),p=3*c*(c+u);return[[o.round(e[0]+(h&&f/h),2),o.round(e[1]+(h&&d/h),2)],[o.round(e[0]-(p&&f/p),2),o.round(e[1]-(p&&d/p),2)]]}var o=t("d3"),i=t("fast-isnumeric"),l=t("../../registry"),s=t("../color"),c=t("../colorscale"),u=t("../../lib"),f=t("../../lib/svg_text_utils"),d=t("../../constants/xmlns_namespaces"),h=t("../../traces/scatter/subtypes"),p=t("../../traces/scatter/make_bubble_size_func"),g=e.exports={};g.font=function(t,e,r,n){e&&e.family&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(s.fill,n)},g.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},g.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},g.setRect=function(t,e,r,n,a){t.call(g.setPosition,e,r).call(g.setSize,n,a)},g.translatePoint=function(t,e,r,n){var a=t.xp||r.c2p(t.x),o=t.yp||n.c2p(t.y);i(a)&&i(o)?"text"===e.node().nodeName?e.attr("x",a).attr("y",o):e.attr("transform","translate("+a+","+o+")"):e.remove()},g.translatePoints=function(t,e,r,n){t.each(function(t){var a=o.select(this);g.translatePoint(t,a,e,r,n)})},g.getPx=function(t,e){return Number(t.style(e).replace(/px$/,""))},g.crispRound=function(t,e,r){return e&&i(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},g.singleLineStyle=function(t,e,r,n,a){e.style("fill","none");var o=(((t||[])[0]||{}).trace||{}).line||{},i=r||o.width||0,l=a||o.dash||"";s.stroke(e,n||o.color),g.dashLine(e,l,i)},g.lineGroupStyle=function(t,e,r,n){t.style("fill","none").each(function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},i=e||a.width||0,l=n||a.dash||"";o.select(this).call(s.stroke,r||a.color).call(g.dashLine,l,i)})},g.dashLine=function(t,e,r){var n=Math.max(r,3);"solid"===e?e="":"dot"===e?e=n+"px,"+n+"px":"dash"===e?e=3*n+"px,"+3*n+"px":"longdash"===e?e=5*n+"px,"+5*n+"px":"dashdot"===e?e=3*n+"px,"+n+"px,"+n+"px,"+n+"px":"longdashdot"===e&&(e=5*n+"px,"+2*n+"px,"+n+"px,"+2*n+"px"),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},g.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var r=o.select(this);try{r.call(s.fill,e[0].trace.fillcolor)}catch(e){u.error(e,t),r.remove()}})};var m=t("./symbol_defs");g.symbolNames=[],g.symbolFuncs=[],g.symbolNeedLines={},g.symbolNoDot={},g.symbolList=[],Object.keys(m).forEach(function(t){var e=m[t];g.symbolList=g.symbolList.concat([e.n,t,e.n+100,t+"-open"]),g.symbolNames[e.n]=t,g.symbolFuncs[e.n]=e.f,e.needLine&&(g.symbolNeedLines[e.n]=!0),e.noDot?g.symbolNoDot[e.n]=!0:g.symbolList=g.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"])});var v=g.symbolNames.length,y="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";g.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),t=g.symbolNames.indexOf(t),t>=0&&(t+=e)}return t%100>=v||t>=400?0:Math.floor(Math.max(t,0))},g.singlePointStyle=function(t,e,r){var a=r.marker,o=a.line,i=g.tryColorscale(a,""),l=g.tryColorscale(a,"line");n(t,e,r,i,l,a,o)},g.pointStyle=function(t,e){if(t.size()){var r=e.marker,n=g.tryColorscale(r,""),a=g.tryColorscale(r,"line");t.each(function(t){g.singlePointStyle(t,o.select(this),e,n,a)})}},g.tryColorscale=function(t,e){var r=e?u.nestedProperty(t,e).get():t,n=r.colorscale,a=r.color;return n&&Array.isArray(a)?c.makeColorScaleFunc(c.extractScale(n,r.cmin,r.cmax)):u.identity};var x={start:1,end:-1,middle:0,bottom:1,top:-1},b=1.3;g.textPointStyle=function(t,e){t.each(function(t){var r=o.select(this),n=t.tx||e.text;if(!n||Array.isArray(n))return void r.remove();var a=t.tp||e.textposition,l=a.indexOf("top")!==-1?"top":a.indexOf("bottom")!==-1?"bottom":"middle",s=a.indexOf("left")!==-1?"end":a.indexOf("right")!==-1?"start":"middle",c=t.ts||e.textfont.size,u=t.mrc?t.mrc/.8+1:0;c=i(c)&&c>0?c:0,r.call(g.font,t.tf||e.textfont.family,c,t.tc||e.textfont.color).attr("text-anchor",s).text(n).call(f.convertToTspans);var d=o.select(this.parentNode),h=r.selectAll("tspan.line"),p=((h[0].length||1)-1)*b+1,m=x[s]*u,v=.75*c+x[l]*u+(x[l]-1)*p*c/2;d.attr("transform","translate("+m+","+v+")"),p>1&&h.attr({x:r.attr("x"),y:r.attr("y")})})};var _=.5;g.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],o=[];for(r=1;r=A&&(o.selectAll("[data-bb]").attr("data-bb",null),M=[]),t.setAttribute("data-bb",M.length),M.push(s),u.extendFlat({},s)},g.setClipUrl=function(t,e){if(!e)return void t.attr("clip-path",null);var r="#"+e,n=o.select("base");n.size()&&n.attr("href")&&(r=window.location.href+r),t.attr("clip-path","url("+r+")")}},{"../../constants/xmlns_namespaces":112,"../../lib":122,"../../lib/svg_text_utils":134,"../../registry":188,"../../traces/scatter/make_bubble_size_func":286,"../../traces/scatter/subtypes":291,"../color":30,"../colorscale":44,"./symbol_defs":54,d3:14,"fast-isnumeric":17}],54:[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,o="l-"+e+",-"+e,i="l-"+e+","+e;return"M0,"+e+r+a+o+a+o+i+o+i+r+i+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),a=n.round(t,2);return"M-"+e+","+r+"H"+e+"L0,-"+a+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),a=n.round(t,2);return"M-"+e+",-"+r+"H"+e+"L0,"+a+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),a=n.round(t,2);return"M"+r+",-"+e+"V"+e+"L-"+a+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),a=n.round(t,2);return"M-"+r+",-"+e+"V"+e+"L"+a+",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),o=n.round(t*-.309,2),i=n.round(.809*t,2);return"M"+e+","+o+"L"+r+","+i+"H-"+r+"L-"+e+","+o+"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),o=n.round(.363*e,2),i=n.round(.588*e,2),l=n.round(-e,2),s=n.round(e*-.309,2),c=n.round(.118*e,2),u=n.round(.809*e,2),f=n.round(.382*e,2);return"M"+r+","+s+"H"+a+"L"+o+","+c+"L"+i+","+u+"L0,"+f+"L-"+i+","+u+"L-"+o+","+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),o=n.round(4*t,2),i="A "+o+","+o+" 0 0 1 ";return"M-"+e+","+r+i+e+","+r+i+"0,-"+a+i+"-"+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),o=n.round(4*t,2),i="A "+o+","+o+" 0 0 1 ";return"M"+e+",-"+r+i+"-"+e+",-"+r+i+"0,"+a+i+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},"x-thin":{n:34,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0},asterisk:{n:35,f:function(t){var e=n.round(1.2*t,2),r=n.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0},hash:{n:36,f:function(t){var e=n.round(t/2,2),r=n.round(t,2);return"M"+e+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+e+"H-"+r+"m0,-"+r+"H"+r},needLine:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+","+a+"L0,0M"+e+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+",-"+a+"L0,0M"+e+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M"+a+","+e+"L0,0M"+a+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+a+","+e+"L0,0M-"+a+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0},"line-ew":{n:41,f:function(t){var e=n.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0},"line-ns":{n:42,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0},"line-ne":{n:43,f:function(t){var e=n.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0},"line-nw":{n:44,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0}}},{d3:14}],55:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"]},symmetric:{valType:"boolean"},array:{valType:"data_array"},arrayminus:{valType:"data_array"},value:{valType:"number",min:0,dflt:10},valueminus:{valType:"number",min:0,dflt:10},traceref:{valType:"integer",min:0,dflt:0},tracerefminus:{valType:"integer",min:0,dflt:0},copy_ystyle:{valType:"boolean"},copy_zstyle:{valType:"boolean"},color:{valType:"color"},thickness:{valType:"number",min:0,dflt:2},width:{valType:"number",min:0},_deprecated:{opacity:{valType:"number"}}}},{}],56:[function(t,e,r){"use strict";function n(t,e,r,n){var o=e["error_"+n]||{},s=o.visible&&["linear","log"].indexOf(r.type)!==-1,c=[];if(s){for(var u=l(o),f=0;f0;t.each(function(t){var e,f=t[0].trace,d=f.error_x||{},h=f.error_y||{};f.ids&&(e=function(t){return t.id});var p=i.hasMarkers(f)&&f.marker.maxdisplayed>0;if(h.visible||d.visible){var g=a.select(this).selectAll("g.errorbar").data(t,e);g.exit().remove(),g.style("opacity",1);var m=g.enter().append("g").classed("errorbar",!0);u&&m.style("opacity",0).transition().duration(r.duration).style("opacity",1),g.each(function(t){var e=a.select(this),i=n(t,s,c);if(!p||t.vis){var f;if(h.visible&&o(i.x)&&o(i.yh)&&o(i.ys)){var g=h.width;f="M"+(i.x-g)+","+i.yh+"h"+2*g+"m-"+g+",0V"+i.ys,i.noYS||(f+="m-"+g+",0h"+2*g);var m=e.select("path.yerror");l=!m.size(),l?m=e.append("path").classed("yerror",!0):u&&(m=m.transition().duration(r.duration).ease(r.easing)),m.attr("d",f)}if(d.visible&&o(i.y)&&o(i.xh)&&o(i.xs)){var v=(d.copy_ystyle?h:d).width;f="M"+i.xh+","+(i.y-v)+"v"+2*v+"m0,-"+v+"H"+i.xs,i.noXS||(f+="m0,-"+v+"v"+2*v);var y=e.select("path.xerror");l=!y.size(),l?y=e.append("path").classed("xerror",!0):u&&(y=y.transition().duration(r.duration).ease(r.easing)),y.attr("d",f)}}})}})}},{"../../traces/scatter/subtypes":291,d3:14,"fast-isnumeric":17}],61:[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||{},o=e.error_x||{},i=n.select(this);i.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),o.copy_ystyle&&(o=r),i.selectAll("path.xerror").style("stroke-width",o.thickness+"px").call(a.stroke,o.color)})}},{"../color":30,d3:14}],62:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/constants");e.exports={_isLinkedToArray:"image",visible:{valType:"boolean",dflt:!0},source:{valType:"string"},layer:{valType:"enumerated",values:["below","above"],dflt:"above"},sizex:{valType:"number",dflt:0},sizey:{valType:"number",dflt:0},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain"},opacity:{valType:"number",min:0,max:1,dflt:1},x:{valType:"any",dflt:0},y:{valType:"any",dflt:0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top"},xref:{valType:"enumerated",values:["paper",n.idRegex.x.toString()],dflt:"paper"},yref:{valType:"enumerated",values:["paper",n.idRegex.y.toString()],dflt:"paper"}}},{"../../plots/cartesian/constants":154}],63:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return a.coerce(t,e,l,r,n)}var i=n("source"),s=n("visible",!!i);if(!s)return e;n("layer"),n("x"),n("y"),n("xanchor"),n("yanchor"),n("sizex"),n("sizey"),n("sizing"),n("opacity");for(var c={_fullLayout:r},u=["x","y"],f=0;f<2;f++)o.coerceRef(t,e,c,u[f],"paper");return e}var a=t("../../lib"),o=t("../../plots/cartesian/axes"),i=t("../../plots/array_container_defaults"),l=t("./attributes"),s="images";e.exports=function(t,e){var r={name:s,handleItemDefaults:n};i(t,e,r)}},{"../../lib":122,"../../plots/array_container_defaults":146,"../../plots/cartesian/axes":149,"./attributes":62}],64:[function(t,e,r){"use strict";var n=t("d3"),a=t("../drawing"),o=t("../../plots/cartesian/axes"),i=t("../../constants/xmlns_namespaces");e.exports=function(t){function e(e){var r=n.select(this);if(!this.img||this.img.src!==e.source){r.attr("xmlns",i.svg);var a=new Promise(function(t){function n(){r.remove(),t()}var a=new Image;this.img=a,a.setAttribute("crossOrigin","anonymous"),a.onerror=n,a.onload=function(){var t=document.createElement("canvas");t.width=this.width,t.height=this.height;var e=t.getContext("2d");e.drawImage(this,0,0);var n=t.toDataURL("image/png");r.attr("xlink:href",n)},r.on("error",n),r.on("load",t),a.src=e.source}.bind(this));t._promises.push(a)}}function r(e){var r=n.select(this),i=o.getFromId(t,e.xref),s=o.getFromId(t,e.yref),c=l._size,u=i?Math.abs(i.l2p(e.sizex)-i.l2p(0)):e.sizex*c.w,f=s?Math.abs(s.l2p(e.sizey)-s.l2p(0)):e.sizey*c.h,d=u*h.x[e.xanchor].offset,p=f*h.y[e.yanchor].offset,g=h.x[e.xanchor].sizing+h.y[e.yanchor].sizing,m=(i?i.r2p(e.x)+i._offset:e.x*c.w+c.l)+d,v=(s?s.r2p(e.y)+s._offset:c.h-e.y*c.h+c.t)+p;switch(e.sizing){case"fill":g+=" slice";break;case"stretch":g="none"}r.attr({x:m,y:v,width:u,height:f,preserveAspectRatio:g,opacity:e.opacity});var y=i?i._id:"",x=s?s._id:"",b=y+x;b&&r.call(a.setClipUrl,"clip"+l._uid+b)}for(var l=t._fullLayout,s=[],c=[],u=[],f=0;f=2/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3},r.isMiddleAnchor=function(t){ return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3}},{}],67:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),o=t("../../lib/extend").extendFlat;e.exports={bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.defaultLine},borderwidth:{valType:"number",min:0,dflt:0},font:o({},n,{}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"]},tracegroupgap:{valType:"number",min:0,dflt:10},x:{valType:"number",min:-2,max:3,dflt:1.02},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"}}},{"../../lib/extend":119,"../../plots/font_attributes":169,"../color/attributes":29}],68:[function(t,e,r){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],69:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),o=t("./attributes"),i=t("../../plots/layout_attributes"),l=t("./helpers");e.exports=function(t,e,r){function s(t,e){return a.coerce(h,p,o,t,e)}for(var c,u,f,d,h=t.legend||{},p=e.legend={},g=0,m="normal",v=0;v1);if(x!==!1){if(s("bgcolor",e.paper_bgcolor),s("bordercolor"),s("borderwidth"),a.coerceFont(s,"font",e.font),s("orientation"),"h"===p.orientation){var b=t.xaxis;b&&b.rangeslider&&b.rangeslider.visible?(c=0,f="left",u=1.1,d="bottom"):(c=0,f="left",u=-.1,d="top")}s("traceorder",m),l.isGrouped(e.legend)&&s("tracegroupgap"),s("x",c),s("xanchor",f),s("y",u),s("yanchor",d),a.noneOrAll(h,p,["x","y"])}}},{"../../lib":122,"../../plots/layout_attributes":171,"../../registry":188,"./attributes":67,"./helpers":72}],70:[function(t,e,r){"use strict";function n(t,e){function r(r){v.convertToTspans(r,function(){r.selectAll("tspan.line").attr({x:r.attr("x")}),t.call(o,e)})}var n=t.data()[0][0],a=e._fullLayout,i=n.trace,l=h.traceIs(i,"pie"),s=i.index,c=l?n.label:i.name,f=t.selectAll("text.legendtext").data([0]);f.enter().append("text").classed("legendtext",!0),f.attr({x:40,y:0,"data-unformatted":c}).style("text-anchor","start").classed("user-select-none",!0).call(g.font,a.legend.font).text(c),e._context.editable&&!l?f.call(v.makeEditable).call(r).on("edit",function(t){this.attr({"data-unformatted":t}),this.text(t).call(r),this.text()||(t=" ");var a,o=n.trace._fullInput||{};if(["ohlc","candlestick"].indexOf(o.type)!==-1){var i=n.trace.transforms,l=i[i.length-1].direction;a=l+".legenditem.name"}else a="name";u.restyle(e,a,t,s)}):f.call(r)}function a(t,e){var r=e._fullLayout.hiddenlabels?e._fullLayout.hiddenlabels.slice():[],n=t.selectAll("rect").data([0]);n.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(m.fill,"rgba(0,0,0,0)"),n.on("click",function(){if(!e._dragged){var n,a,o=t.data()[0][0],i=e._fullData,l=o.trace,s=l.legendgroup,c=[];if(h.traceIs(l,"pie")){var f=o.label,d=r.indexOf(f);d===-1?r.push(f):r.splice(d,1),u.relayout(e,"hiddenlabels",r)}else{if(""===s)c=[l.index];else for(var p=0;ptspan"),d=u[0].length||1;r=l*d,n=c.node()&&g.bBox(c.node()).width;var h=l*(.3+(1-d)/2);c.attr("y",h),u.attr("y",h)}r=Math.max(r,16)+3,a.height=r,a.width=n}function i(t,e,r){var n=t._fullLayout,a=n.legend,o=a.borderwidth,i=_.isGrouped(a);if(_.isVertical(a))i&&e.each(function(t,e){f.setTranslate(this,0,e*a.tracegroupgap)}),a.width=0,a.height=0,r.each(function(t){var e=t[0],r=e.height,n=e.width;f.setTranslate(this,o,5+o+a.height+r/2),a.height+=r,a.width=Math.max(a.width,n)}),a.width+=45+2*o,a.height+=10+2*o,i&&(a.height+=(a._lgroupsLength-1)*a.tracegroupgap),a.width=Math.ceil(a.width),a.height=Math.ceil(a.height),r.each(function(e){var r=e[0],n=c.select(this).select(".legendtoggle");n.call(g.setRect,0,-r.height/2,(t._context.editable?0:a.width)+40,r.height)});else if(i){a.width=0,a.height=0;for(var l=[a.width],s=e.data(),u=0,d=s.length;un.width-(n.margin.r+n.margin.l)&&(x=0,m+=v,a.height=a.height+v,v=0),f.setTranslate(this,o+x,5+o+e.height/2+m),a.width+=i+r,a.height=Math.max(a.height,e.height),x+=i+r,v=Math.max(e.height,v)}),a.width+=2*o,a.height+=10+2*o,a.width=Math.ceil(a.width),a.height=Math.ceil(a.height),r.each(function(e){var r=e[0],n=c.select(this).select(".legendtoggle");n.call(g.setRect,0,-r.height/2,t._context.editable?0:a.width,r.height)})}}function l(t){var e=t._fullLayout,r=e.legend,n="left";w.isRightAnchor(r)?n="right":w.isCenterAnchor(r)&&(n="center");var a="top";w.isBottomAnchor(r)?a="bottom":w.isMiddleAnchor(r)&&(a="middle"),d.autoMargin(t,"legend",{x:r.x,y:r.y,l:r.width*({right:1,center:.5}[n]||0),r:r.width*({left:1,center:.5}[n]||0),b:r.height*({top:1,middle:.5}[a]||0),t:r.height*({bottom:1,middle:.5}[a]||0)})}function s(t){var e=t._fullLayout,r=e.legend,n="left";w.isRightAnchor(r)?n="right":w.isCenterAnchor(r)&&(n="center"),d.autoMargin(t,"legend",{x:r.x,y:.5,l:r.width*({right:1,center:.5}[n]||0),r:r.width*({left:1,center:.5}[n]||0),b:0,t:0})}var c=t("d3"),u=t("../../plotly"),f=t("../../lib"),d=t("../../plots/plots"),h=t("../../registry"),p=t("../dragelement"),g=t("../drawing"),m=t("../color"),v=t("../../lib/svg_text_utils"),y=t("./constants"),x=t("./get_legend_data"),b=t("./style"),_=t("./helpers"),w=t("./anchor_utils");e.exports=function(t){function e(t,e){L.attr("data-scroll",e).call(f.setTranslate,0,e),z.call(g.setRect,j,t,y.scrollBarWidth,y.scrollBarHeight),A.select("rect").attr({y:v.borderwidth-e})}var r=t._fullLayout,o="legend"+r._uid;if(r._infolayer&&t.calcdata){var v=r.legend,_=r.showlegend&&x(t.calcdata,v),k=r.hiddenlabels||[];if(!r.showlegend||!_.length)return r._infolayer.selectAll(".legend").remove(),r._topdefs.select("#"+o).remove(),void d.autoMargin(t,"legend");var M=r._infolayer.selectAll("g.legend").data([0]);M.enter().append("g").attr({class:"legend","pointer-events":"all"});var A=r._topdefs.selectAll("#"+o).data([0]);A.enter().append("clipPath").attr("id",o).append("rect");var T=M.selectAll("rect.bg").data([0]);T.enter().append("rect").attr({class:"bg","shape-rendering":"crispEdges"}),T.call(m.stroke,v.bordercolor),T.call(m.fill,v.bgcolor),T.style("stroke-width",v.borderwidth+"px");var L=M.selectAll("g.scrollbox").data([0]);L.enter().append("g").attr("class","scrollbox");var z=M.selectAll("rect.scrollbar").data([0]);z.enter().append("rect").attr({class:"scrollbar",rx:20,ry:2,width:0,height:0}).call(m.fill,"#808BA4");var C=L.selectAll("g.groups").data(_);C.enter().append("g").attr("class","groups"),C.exit().remove();var S=C.selectAll("g.traces").data(f.identity);S.enter().append("g").attr("class","traces"),S.exit().remove(),S.call(b).style("opacity",function(t){var e=t[0].trace;return h.traceIs(e,"pie")?k.indexOf(t[0].label)!==-1?.5:1:"legendonly"===e.visible?.5:1}).each(function(){c.select(this).call(n,t).call(a,t)});var O=0!==M.enter().size();O&&(i(t,C,S),l(t));var D=0,P=r.width,N=0,E=r.height;i(t,C,S),v.height>E?s(t):l(t);var I=r._size,R=I.l+I.w*v.x,F=I.t+I.h*(1-v.y);w.isRightAnchor(v)?R-=v.width:w.isCenterAnchor(v)&&(R-=v.width/2),w.isBottomAnchor(v)?F-=v.height:w.isMiddleAnchor(v)&&(F-=v.height/2);var j=v.width;I.w;R+j>P&&(R=P-j),RB?(F=I.t,q=B):(F+q>E&&(F=E-q),Fr[1])return r[1]}return a}function r(t){return t[0]}var n,a,o=t[0],i=o.trace,l=h.hasMarkers(i),c=h.hasText(i),d=h.hasLines(i);if(l||c||d){var p={},g={};l&&(p.mc=e("marker.color",r),p.mo=e("marker.opacity",u.mean,[.2,1]),p.ms=e("marker.size",u.mean,[2,16]),p.mlc=e("marker.line.color",r),p.mlw=e("marker.line.width",u.mean,[0,5]),g.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),d&&(g.line={width:e("line.width",r,[0,10])}),c&&(p.tx="Aa",p.tp=e("textposition",r),p.ts=10,p.tc=e("textfont.color",r),p.tf=e("textfont.family",r)),n=[u.minExtend(o,p)],a=u.minExtend(i,g)}var m=s.select(this).select("g.legendpoints"),v=m.selectAll("path.scatterpts").data(l?n:[]);v.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),v.exit().remove(),v.call(f.pointStyle,a),l&&(n[0].mrc=3);var y=m.selectAll("g.pointtext").data(c?n:[]);y.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),y.exit().remove(),y.selectAll("text").call(f.textPointStyle,a)}function o(t){var e=t[0].trace,r=e.marker||{},n=r.line||{},a=s.select(this).select("g.legendpoints").selectAll("path.legendbar").data(c.traceIs(e,"bar")?[t]:[]);a.enter().append("path").classed("legendbar",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),a.exit().remove(),a.each(function(t){var e=(t.mlw+1||n.width+1)-1,a=s.select(this);a.style("stroke-width",e+"px").call(d.fill,t.mc||r.color),e&&a.call(d.stroke,t.mlc||n.color)})}function i(t){var e=t[0].trace,r=s.select(this).select("g.legendpoints").selectAll("path.legendbox").data(c.traceIs(e,"box")&&e.visible?[t]:[]);r.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.each(function(t){var r=(t.lw+1||e.line.width+1)-1,n=s.select(this);n.style("stroke-width",r+"px").call(d.fill,t.fc||e.fillcolor),r&&n.call(d.stroke,t.lc||e.line.color)})}function l(t){var e=t[0].trace,r=s.select(this).select("g.legendpoints").selectAll("path.legendpie").data(c.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(p,t[0],e)}var s=t("d3"),c=t("../../registry"),u=t("../../lib"),f=t("../drawing"),d=t("../color"),h=t("../../traces/scatter/subtypes"),p=t("../../traces/pie/style_one");e.exports=function(t){t.each(function(t){var e=s.select(this),r=e.selectAll("g.legendfill").data([t]);r.enter().append("g").classed("legendfill",!0);var n=e.selectAll("g.legendlines").data([t]);n.enter().append("g").classed("legendlines",!0);var a=e.selectAll("g.legendsymbols").data([t]);a.enter().append("g").classed("legendsymbols",!0),a.style("opacity",t[0].trace.opacity),a.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(o).each(i).each(l).each(n).each(a)}},{"../../lib":122,"../../registry":188,"../../traces/pie/style_one":269,"../../traces/scatter/subtypes":291,"../color":30,"../drawing":53,d3:14}],75:[function(t,e,r){"use strict";function n(t,e){var r=e.currentTarget,n=r.getAttribute("data-attr"),a=r.getAttribute("data-val")||!0,o=t._fullLayout,i={};if("zoom"===n){for(var l,s,u="in"===a?.5:2,d=(1+u)/2,h=(1-u)/2,p=f.list(t,null,!0),g=0;g1)return n(["resetViews","toggleHover"]),i(m,r);u&&(n(["zoom3d","pan3d","orbitRotation","tableRotation"]),n(["resetCameraDefault3d","resetCameraLastSave3d"]),n(["hoverClosest3d"])),d&&(n(["zoomInGeo","zoomOutGeo","resetGeo"]),n(["hoverClosestGeo"]));var v=a(l),y=[];return((c||p)&&!v||g)&&(y=["zoom2d","pan2d"]),(c||g)&&o(s)&&(y.push("select2d"),y.push("lasso2d")),y.length&&n(y),!c&&!p||v||g||n(["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"]),c&&h?n(["toggleHover"]):p?n(["hoverClosestGl2d"]):c?n(["hoverClosestCartesian","hoverCompareCartesian"]):h&&n(["hoverClosestPie"]),i(m,r)}function a(t){for(var e=s.list({_fullLayout:t},null,!0),r=!0,n=0;n0);if(p){var g=a(e,r,s);u("x",g[0]),u("y",g[1]),o.noneOrAll(t,e,["x","y"]),u("xanchor"),u("yanchor"),o.coerceFont(u,"font",r.font);var m=u("bgcolor");u("activecolor",i.contrast(m,c.lightAmount,c.darkAmount)),u("bordercolor"),u("borderwidth")}}},{"../../lib":122,"../color":30,"./attributes":79,"./button_attributes":80,"./constants":81}],83:[function(t,e,r){"use strict";function n(t){for(var e=v.list(t,"x",!0),r=[],n=0;np&&(p=d)));return p>=h?[h,p]:void 0}}var a=t("../../lib"),o=t("../../plots/cartesian/axes"),i=t("./constants"),l=t("./helpers");e.exports=function(t){var e=t._fullLayout,r=a.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var l=0;le;o--)f(t,o).selectAll('[data-index="'+(o-1)+'"]').attr("data-index",o),a(t,o)}function u(t,e,r,n){function a(r){var n={"data-index":e,"fill-rule":"evenodd",d:h(t,z)},a=z.line.width?z.line.color:"rgba(0,0,0,0)",o=r.append("path").attr(n).style("opacity",z.opacity).call(y.stroke,a).call(y.fill,z.fillcolor).call(x.dashLine,z.line.dash,z.line.width);z.classes&&o.classed(z.classes,!0),C&&o.call(x.setClipUrl,"clip"+t._fullLayout._uid+C)}var o,i;f(t,e).selectAll('[data-index="'+e+'"]').remove();var l=t.layout.shapes[e];if(l){var s={};"string"==typeof r&&r?s[r]=n:m.isPlainObject(r)&&(s=r);var c=Object.keys(s);for(o=0;ol&&(t="X"),t});return n>l&&(s=s.replace(/[\s,]*X.*/,""),m.log("Ignoring extra params in segment "+t)),a+s})}var g=t("fast-isnumeric"),m=(t("../../plotly"),t("../../lib")),v=t("../../plots/cartesian/axes"),y=t("../color"),x=t("../drawing"),b=(t("../dragelement"),t("../../lib/setcursor"),t("./constants")),_=t("./helpers"),w=t("./shape_defaults"),k=t("./defaults");e.exports={draw:n,drawOne:a}},{"../../lib":122,"../../lib/setcursor":132,"../../plotly":144,"../../plots/cartesian/axes":149,"../color":30,"../dragelement":51,"../drawing":53,"./constants":93,"./defaults":94,"./helpers":96,"./shape_defaults":98,"fast-isnumeric":17}],96:[function(t,e,r){"use strict";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.getDataToPixel=function(t,e,n){var a,o=t._fullLayout._size;if(e){var i=r.shapePositionToRange(e);a=function(t){return e._offset+e.r2p(i(t,!0))},"date"===e.type&&(a=r.decodeDate(a))}else a=n?function(t){return o.t+o.h*(1-t)}:function(t){return o.l+o.w*t};return a},r.getPixelToData=function(t,e,n){var a,o=t._fullLayout._size;if(e){var i=r.rangeToShapePosition(e);a=function(t){return i(e.p2r(t-e._offset))}}else a=n?function(t){return 1-(t-o.t)/o.h}:function(t){return(t-o.l)/o.w};return a}},{}],97:[function(t,e,r){"use strict";var n=t("./draw");e.exports={moduleType:"component",name:"shapes",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne}},{"./attributes":91,"./calc_autorange":92,"./defaults":94,"./draw":95}],98:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./attributes"),i=t("./helpers");e.exports=function(t,e,r,l,s){function c(r,a){return n.coerce(t,e,o,r,a)}l=l||{},s=s||{};var u=c("visible",!s.itemIsNotPlainObject);if(!u)return e;c("layer"),c("opacity"),c("fillcolor"),c("line.color"),c("line.width"),c("line.dash");for(var f=t.path?"path":"rect",d=c("type",f),h=["x","y"],p=0;p<2;p++){var g=h[p],m={_fullLayout:r},v=a.coerceRef(t,e,m,g,"","paper");if("path"!==d){var y,x,b,_=.25,w=.75;"paper"!==v?(y=a.getFromId(m,v),b=i.rangeToShapePosition(y),x=i.shapePositionToRange(y)):x=b=n.identity;var k=g+"0",M=g+"1",A=t[k],T=t[M];t[k]=x(t[k],!0),t[M]=x(t[M],!0),a.coercePosition(e,m,c,v,k,_),a.coercePosition(e,m,c,v,M,w),e[k]=b(e[k]),e[M]=b(e[M]),t[k]=A,t[M]=T}}return"path"===d?c("path"):n.noneOrAll(t,e,["x0","x1","y0","y1"]),t.classes&&(e.classes=t.classes),e}},{"../../lib":122,"../../plots/cartesian/axes":149,"./attributes":91,"./helpers":96}],99:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../../plots/pad_attributes"),o=t("../../lib/extend").extendFlat,i=t("../../lib/extend").extendDeep,l=t("../../plots/animation_attributes"),s=t("./constants"),c={_isLinkedToArray:"step",method:{valType:"enumerated",values:["restyle","relayout","animate","update"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"}};e.exports={_isLinkedToArray:"slider",visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:c,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,{},{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:o({},n,{})},font:o({},n,{}),activebgcolor:{valType:"color",dflt:s.gripBgActiveColor},bgcolor:{valType:"color",dflt:s.railBgColor},bordercolor:{valType:"color",dflt:s.railBorderColor},borderwidth:{valType:"number",min:0,dflt:s.railBorderWidth},ticklen:{valType:"number",min:0,dflt:s.tickLength},tickcolor:{valType:"color",dflt:s.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:s.minorTickLength}}},{"../../lib/extend":119,"../../plots/animation_attributes":145,"../../plots/font_attributes":169,"../../plots/pad_attributes":172,"./constants":100}],100:[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,fontSizeToHeight:1.3,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}},{}],101:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return o.coerce(t,e,l,r,n)}var i=a(t,e),s=n("visible",i.length>0);if(s){n("active"),n("x"),n("y"),o.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("len"),n("lenmode"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),o.coerceFont(n,"font",r.font);var c=n("currentvalue.visible");c&&(n("currentvalue.xanchor"),n("currentvalue.prefix"),n("currentvalue.suffix"),n("currentvalue.offset"),o.coerceFont(n,"currentvalue.font",e.font)),n("transition.duration"),n("transition.easing"),n("bgcolor"),n("activebgcolor"),n("bordercolor"),n("borderwidth"),n("ticklen"),n("tickwidth"),n("tickcolor"),n("minorticklen")}}function a(t,e){function r(t,e){return o.coerce(n,a,u,t,e)}for(var n,a,i=t.steps||[],l=e.steps=[],s=0;s0&&(i=i.transition().duration(e.transition.duration).ease(e.transition.easing)),i.attr("transform","translate("+(o-.5*C.gripWidth)+","+e.currentValueTotalHeight+")")}}function v(t,e){return t.inputAreaStart+C.stepInset+(t.inputAreaLength-2*C.stepInset)*Math.min(1,Math.max(0,e))}function y(t,e){return Math.min(1,Math.max(0,(e-C.stepInset-t.inputAreaStart)/(t.inputAreaLength-2*C.stepInset-2*t.inputAreaStart)))}function x(t,e,r){var n=t.selectAll("rect."+C.railTouchRectClass).data([0]);n.enter().append("rect").classed(C.railTouchRectClass,!0).call(h,e,t,r).style("pointer-events","all"),n.attr({width:r.inputAreaLength,height:Math.max(r.inputAreaWidth,C.tickOffset+r.ticklen+r.labelHeight)}).call(A.fill,r.bgcolor).attr("opacity",0),M.setTranslate(n,0,r.currentValueTotalHeight)}function b(t,e){var r=t.selectAll("rect."+C.railRectClass).data([0]);r.enter().append("rect").classed(C.railRectClass,!0);var n=e.inputAreaLength-2*C.railInset;r.attr({width:n,height:C.railWidth,rx:C.railRadius,ry:C.railRadius,"shape-rendering":"crispEdges"}).call(A.stroke,e.bordercolor).call(A.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),M.setTranslate(r,C.railInset,.5*(e.inputAreaWidth-C.railWidth)+e.currentValueTotalHeight); -}function _(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n0?[0]:[]);if(l.enter().append("g").classed(C.containerClassName,!0).style("cursor","ew-resize"),l.exit().remove(),l.exit().size()&&_(t),0!==r.length){var s=l.selectAll("g."+C.groupClassName).data(r,a);s.enter().append("g").classed(C.groupClassName,!0),s.exit().each(function(e){w.select(this).remove(),e._commandObserver.remove(),delete e._commandObserver,k.autoMargin(t,C.autoMarginIdRoot+e._index)});for(var c=0;c0||d<0){var h={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[x.side];e.attr("transform","translate("+h+")")}}}function p(){L=0,z=!0,C=O,k._infolayer.select("."+e).attr({"data-unformatted":C}).text(C).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=r.propContainer,m=r.propName,v=r.traceIndex,y=r.dfltName,x=r.avoid||{},b=r.attributes,_=r.transform,w=r.containerGroup,k=t._fullLayout,M=g.titlefont.family,A=g.titlefont.size,T=g.titlefont.color,L=1,z=!1,C=g.title.trim();""===C&&(L=0),C.match(/Click to enter .+ title/)&&(L=.2,z=!0),w||(w=k._infolayer.selectAll(".g-"+e).data([0]),w.enter().append("g").classed("g-"+e,!0));var S=w.selectAll("text").data([0]);S.enter().append("text"),S.text(C).attr("class",e),S.attr({"data-unformatted":C}).call(f);var O="Click to enter "+y+" title",D=t._context.editable;D&&(g===k?D=t._context.editableMainTitle:g===k.xaxis?D=t._context.editableAxisXTitle:g===k.yaxis?D=t._context.editableAxisYTitle:g===k.yaxis2?D=t._context.editableAxisY2Title:g===k.xaxis2&&(D=t._context.editableAxisX2Title)),D?(C||p(),S.call(u.makeEditable).on("edit",function(e){void 0!==v?o.restyle(t,m,e,v):o.relayout(t,m,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(f)}).on("input",function(t){this.text(t||" ").attr(b).selectAll("tspan.line").attr(b)})):C&&!C.match(/Click to enter .+ title/)||S.remove(),S.classed("js-placeholder",z),g._titleElement=S}},{"../../lib":122,"../../lib/svg_text_utils":134,"../../plotly":144,"../../plots/plots":173,"../color":30,"../drawing":53,d3:14,"fast-isnumeric":17}],105:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),o=t("../../lib/extend").extendFlat,i=t("../../plots/pad_attributes"),l={_isLinkedToArray:"button",method:{valType:"enumerated",values:["restyle","relayout","animate","update"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""}};e.exports={_isLinkedToArray:"updatemenu",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:l,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:o({},i,{}),font:o({},n,{}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1}}},{"../../lib/extend":119,"../../plots/font_attributes":169,"../../plots/pad_attributes":172,"../color/attributes":29}],106:[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,fontSizeToHeight:1.3,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF"}},{}],107:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return o.coerce(t,e,l,r,n)}var i=a(t,e),s=n("visible",i.length>0);s&&(n("active"),n("direction"),n("type"),n("showactive"),n("x"),n("y"),o.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),o.coerceFont(n,"font",r.font),n("bgcolor",r.paper_bgcolor),n("bordercolor"),n("borderwidth"))}function a(t,e){function r(t,e){return o.coerce(n,a,u,t,e)}for(var n,a,i=t.buttons||[],l=e.buttons=[],s=0;s0?[0]:[]);if(c.enter().append("g").classed(T.containerClassName,!0).style("cursor","pointer"),c.exit().remove(),c.exit().size()&&y(t),0!==r.length){var u=c.selectAll("g."+T.headerGroupClassName).data(r,a);u.enter().append("g").classed(T.headerGroupClassName,!0);var f=c.selectAll("g."+T.dropdownButtonGroupClassName).data([0]);f.enter().append("g").classed(T.dropdownButtonGroupClassName,!0).style("pointer-events","all"),u.enter().size()&&f.call(v).attr(T.menuIndexAttrName,"-1"),u.exit().each(function(e){x.select(this).remove(),f.call(v).attr(T.menuIndexAttrName,"-1"),b.autoMargin(t,T.autoMarginIdRoot+e._index)});for(var d=0;d",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},unicodeToEntity:{"&":"amp","<":"lt",">":"gt",'"':"quot","'":"#x27","/":"#x2F"}}},{}],112:[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}},{}],113:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.20.2-d25",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config"),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.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.purge=n.purge,r.setPlotConfig=t("./plot_api/set_plot_config"),r.register=t("./plot_api/register"),r.toImage=t("./plot_api/to_image"),r.downloadImage=t("./snapshot/download"),r.validate=t("./plot_api/validate"),r.addFrames=n.addFrames,r.deleteFrames=n.deleteFrames,r.animate=n.animate,r.register(t("./traces/scatter")),r.register([t("./components/legend"),t("./components/annotations"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=n.Fx,r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue");var a=t("./components/color");r.colorDefaults=a.overrideColorDefaults,r.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":28,"./components/color":30,"./components/images":65,"./components/legend":73,"./components/rangeselector":85,"./components/rangeslider":90,"./components/shapes":97,"./components/sliders":103,"./components/updatemenus":109,"./fonts/mathjax_config":114,"./lib/queue":130,"./plot_api/plot_schema":138,"./plot_api/register":139,"./plot_api/set_plot_config":140,"./plot_api/to_image":142,"./plot_api/validate":143,"./plotly":144,"./snapshot":193,"./snapshot/download":190,"./traces/scatter":281,d3:14,"es6-promise":15}],114:[function(t,e,r){"use strict";"undefined"!=typeof MathJax?(r.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):r.MathJax=!1},{}],115:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../constants/numerical").BADNUM,o=/^['"%,$#\s']+/,i=/['"%,$#\s']+$/;e.exports=function(t){return"string"==typeof t&&(t=t.replace(o,"").replace(i,"")),n(t)?Number(t):a}},{"../constants/numerical":110,"fast-isnumeric":17}],116:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("tinycolor2"),o=t("../components/colorscale/get_scale"),i=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),l=/^([2-9]|[1-9][0-9]+)$/;r.valObjects={data_array:{coerceFunction:function(t,e,r){Array.isArray(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),n.values.indexOf(t)===-1?e.set(r):e.set(t)}},boolean:{coerceFunction:function(t,e,r){t===!0||t===!1?e.set(t):e.set(r)}},number:{coerceFunction:function(t,e,r,a){!n(t)||void 0!==a.min&&ta.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,a){t%1||!n(t)||void 0!==a.min&&ta.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var a="number"==typeof t;n.strict!==!0&&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)}},colorscale:{coerceFunction:function(t,e,r){e.set(o(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?(Math.abs(t)>180&&(t-=360*Math.round(t/360)),e.set(+t)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r){var n=r.length;return"string"==typeof t&&t.substr(0,n)===r&&l.test(t.substr(n))?void e.set(t):void e.set(r)},validateFunction:function(t,e){var r=e.dflt,n=r.length;return t===r||"string"==typeof t&&!(t.substr(0,n)!==r||!l.test(t.substr(n)))}},flaglist:{coerceFunction:function(t,e,r,n){if("string"!=typeof t)return void e.set(r);if((n.extras||[]).indexOf(t)!==-1)return void e.set(t);for(var a=t.split("+"),o=0;o=h&&t<=p?t:s;if("string"!=typeof t&&"number"!=typeof t)return s;var e,n,a,i,l=String(t).trim().split(" ");if(l.length>2)return s;var c=l[0].split("-"),u=!0;""===c[0]&&(u=!1,c.splice(0,1));var g=c.length;if(g>3||3!==g&&l[1]||!g)return s;if(4===c[0].length)e=Number(c[0]);else{if(2!==c[0].length)return s;if(!u)return s;var m=(new Date).getFullYear();e=((Number(c[0])-m+70)%100+200)%100+m-70}if(!o(e))return s;var v=new Date(0,0,1);if(v.setFullYear(u?e:-e),c.length>1){if(n=Number(c[1])-1,c[1].length>2||!(n>=0&&n<=11))return s;if(v.setMonth(n),c.length>2){if(a=Number(c[2]),c[2].length>2||!(a>=1&&a<=31))return s;if(v.setDate(a),v.getDate()!==a)return s;if(l[1]){if(c=l[1].split(":"),c.length>3)return s;if(i=Number(c[0]),c[0].length>2||!c[0].length||!(i>=0&&i<=23))return s;if(v.setHours(i),v.getHours()!==i)return s;if(c.length>1)return a=v.getTime(),n=Number(c[1]),2===c[1].length&&n>=0&&n<=59?(a+=f*n,2===c.length?a:2!==c[2].split(".")[0].length?s:(t=Number(c[2]),t>=0&&t<60?a+t*d:s)):s}}}return v.getTime()},h=r.MIN_MS=r.dateTime2ms("-9999"),p=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t){return r.dateTime2ms(t)!==s};var g=90*c,m=3*u,v=5*f;r.ms2DateTime=function(t,e){if("number"!=typeof t||!(t>=h&&t<=p))return s;e||(e=0);var r=new Date(Math.floor(t)),o=a.time.format("%Y-%m-%d")(r),i=er?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},a.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},a.identity=function(t){return t},a.noop=function(){},a.randstr=function t(e,r,n){if(n||(n=16),void 0===r&&(r=24),r<=0)return"0";var a,o,i,l=Math.log(Math.pow(2,r))/Math.log(n),s="";for(a=2;l===1/0;a*=2)l=Math.log(Math.pow(2,r/a))/Math.log(n)*a;var c=l-Math.floor(l);for(a=0;a-1||u!==1/0&&u>=Math.pow(2,r)?t(e,r,n):s},a.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={};return r.optionList=[],r._newoption=function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)},r["_"+e]=t,r},a.smooth=function(t,e){if(e=Math.round(e)||0,e<2)return t;var r,n,a,o,i=t.length,l=2*i,s=2*e-1,c=new Array(s),u=new Array(i);for(r=0;r=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=i&&(a=l-1-a),o+=t[a]*c[n];u[r]=o}return u},a.syncOrAsync=function(t,e,r){function n(){return a.syncOrAsync(t,e,r)}for(var o,i;t.length;)if(i=t.splice(0,1)[0],o=i(e),o&&o.then)return o.then(n).then(void 0,a.promiseError);return r&&r(e)},a.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},a.noneOrAll=function(t,e,r){if(t){var n,a,o=!1,i=!0;for(n=0;n0?[0]:[]);if(l.enter().append("g").classed(C.containerClassName,!0).style("cursor","ew-resize"),l.exit().remove(),l.exit().size()&&_(t),0!==r.length){var s=l.selectAll("g."+C.groupClassName).data(r,a);s.enter().append("g").classed(C.groupClassName,!0),s.exit().each(function(e){w.select(this).remove(),e._commandObserver.remove(),delete e._commandObserver,k.autoMargin(t,C.autoMarginIdRoot+e._index)});for(var c=0;c0||d<0){var h={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[x.side];e.attr("transform","translate("+h+")")}}}function p(){L=0,z=!0,C=O,k._infolayer.select("."+e).attr({"data-unformatted":C}).text(C).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=r.propContainer,m=r.propName,v=r.traceIndex,y=r.dfltName,x=r.avoid||{},b=r.attributes,_=r.transform,w=r.containerGroup,k=t._fullLayout,M=g.titlefont.family,A=g.titlefont.size,T=g.titlefont.color,L=1,z=!1,C=g.title.trim();""===C&&(L=0),C.match(/Click to enter .+ title/)&&(L=.2,z=!0),w||(w=k._infolayer.selectAll(".g-"+e).data([0]),w.enter().append("g").classed("g-"+e,!0));var S=w.selectAll("text").data([0]);S.enter().append("text"),S.text(C).attr("class",e),S.attr({"data-unformatted":C}).call(f);var O="Click to enter "+y+" title",D=t._context.editable;D&&(g===k?D=t._context.editableMainTitle:g===k.xaxis?D=t._context.editableAxisXTitle:g===k.yaxis?D=t._context.editableAxisYTitle:g===k.yaxis2?D=t._context.editableAxisY2Title:g===k.xaxis2&&(D=t._context.editableAxisX2Title)),D?(C||p(),S.call(u.makeEditable).on("edit",function(e){void 0!==v?o.restyle(t,m,e,v):o.relayout(t,m,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(f)}).on("input",function(t){this.text(t||" ").attr(b).selectAll("tspan.line").attr(b)})):C&&!C.match(/Click to enter .+ title/)||S.remove(),S.classed("js-placeholder",z),g._titleElement=S}},{"../../lib":122,"../../lib/svg_text_utils":134,"../../plotly":144,"../../plots/plots":173,"../color":30,"../drawing":53,d3:14,"fast-isnumeric":17}],105:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),o=t("../../lib/extend").extendFlat,i=t("../../plots/pad_attributes"),l={_isLinkedToArray:"button",method:{valType:"enumerated",values:["restyle","relayout","animate","update"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""}};e.exports={_isLinkedToArray:"updatemenu",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:l,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:o({},i,{}),font:o({},n,{}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1}}},{"../../lib/extend":119,"../../plots/font_attributes":169,"../../plots/pad_attributes":172,"../color/attributes":29}],106:[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,fontSizeToHeight:1.3,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF"}},{}],107:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return o.coerce(t,e,l,r,n)}var i=a(t,e),s=n("visible",i.length>0);s&&(n("active"),n("direction"),n("type"),n("showactive"),n("x"),n("y"),o.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),o.coerceFont(n,"font",r.font),n("bgcolor",r.paper_bgcolor),n("bordercolor"),n("borderwidth"))}function a(t,e){function r(t,e){return o.coerce(n,a,u,t,e)}for(var n,a,i=t.buttons||[],l=e.buttons=[],s=0;s0?[0]:[]);if(c.enter().append("g").classed(T.containerClassName,!0).style("cursor","pointer"),c.exit().remove(),c.exit().size()&&y(t),0!==r.length){var u=c.selectAll("g."+T.headerGroupClassName).data(r,a);u.enter().append("g").classed(T.headerGroupClassName,!0);var f=c.selectAll("g."+T.dropdownButtonGroupClassName).data([0]);f.enter().append("g").classed(T.dropdownButtonGroupClassName,!0).style("pointer-events","all"),u.enter().size()&&f.call(v).attr(T.menuIndexAttrName,"-1"),u.exit().each(function(e){x.select(this).remove(),f.call(v).attr(T.menuIndexAttrName,"-1"),b.autoMargin(t,T.autoMarginIdRoot+e._index)});for(var d=0;d",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},unicodeToEntity:{"&":"amp","<":"lt",">":"gt",'"':"quot","'":"#x27","/":"#x2F"}}},{}],112:[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}},{}],113:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.20.2-d26",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config"),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.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.purge=n.purge,r.setPlotConfig=t("./plot_api/set_plot_config"),r.register=t("./plot_api/register"),r.toImage=t("./plot_api/to_image"),r.downloadImage=t("./snapshot/download"),r.validate=t("./plot_api/validate"),r.addFrames=n.addFrames,r.deleteFrames=n.deleteFrames,r.animate=n.animate,r.register(t("./traces/scatter")),r.register([t("./components/legend"),t("./components/annotations"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=n.Fx,r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue");var a=t("./components/color");r.colorDefaults=a.overrideColorDefaults,r.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":28,"./components/color":30,"./components/images":65,"./components/legend":73,"./components/rangeselector":85,"./components/rangeslider":90,"./components/shapes":97,"./components/sliders":103,"./components/updatemenus":109,"./fonts/mathjax_config":114,"./lib/queue":130,"./plot_api/plot_schema":138,"./plot_api/register":139,"./plot_api/set_plot_config":140,"./plot_api/to_image":142,"./plot_api/validate":143,"./plotly":144,"./snapshot":193,"./snapshot/download":190,"./traces/scatter":281,d3:14,"es6-promise":15}],114:[function(t,e,r){"use strict";"undefined"!=typeof MathJax?(r.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):r.MathJax=!1},{}],115:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../constants/numerical").BADNUM,o=/^['"%,$#\s']+/,i=/['"%,$#\s']+$/;e.exports=function(t){return"string"==typeof t&&(t=t.replace(o,"").replace(i,"")),n(t)?Number(t):a}},{"../constants/numerical":110,"fast-isnumeric":17}],116:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("tinycolor2"),o=t("../components/colorscale/get_scale"),i=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),l=/^([2-9]|[1-9][0-9]+)$/;r.valObjects={data_array:{coerceFunction:function(t,e,r){Array.isArray(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),n.values.indexOf(t)===-1?e.set(r):e.set(t)}},boolean:{coerceFunction:function(t,e,r){t===!0||t===!1?e.set(t):e.set(r)}},number:{coerceFunction:function(t,e,r,a){!n(t)||void 0!==a.min&&ta.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,a){t%1||!n(t)||void 0!==a.min&&ta.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var a="number"==typeof t;n.strict!==!0&&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)}},colorscale:{coerceFunction:function(t,e,r){e.set(o(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?(Math.abs(t)>180&&(t-=360*Math.round(t/360)),e.set(+t)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r){var n=r.length;return"string"==typeof t&&t.substr(0,n)===r&&l.test(t.substr(n))?void e.set(t):void e.set(r)},validateFunction:function(t,e){var r=e.dflt,n=r.length;return t===r||"string"==typeof t&&!(t.substr(0,n)!==r||!l.test(t.substr(n)))}},flaglist:{coerceFunction:function(t,e,r,n){if("string"!=typeof t)return void e.set(r);if((n.extras||[]).indexOf(t)!==-1)return void e.set(t);for(var a=t.split("+"),o=0;o=h&&t<=p?t:s;if("string"!=typeof t&&"number"!=typeof t)return s;var e,n,a,i,l=String(t).trim().split(" ");if(l.length>2)return s;var c=l[0].split("-"),u=!0;""===c[0]&&(u=!1,c.splice(0,1));var g=c.length;if(g>3||3!==g&&l[1]||!g)return s;if(4===c[0].length)e=Number(c[0]);else{if(2!==c[0].length)return s;if(!u)return s;var m=(new Date).getFullYear();e=((Number(c[0])-m+70)%100+200)%100+m-70}if(!o(e))return s;var v=new Date(0,0,1);if(v.setFullYear(u?e:-e),c.length>1){if(n=Number(c[1])-1,c[1].length>2||!(n>=0&&n<=11))return s;if(v.setMonth(n),c.length>2){if(a=Number(c[2]),c[2].length>2||!(a>=1&&a<=31))return s;if(v.setDate(a),v.getDate()!==a)return s;if(l[1]){if(c=l[1].split(":"),c.length>3)return s;if(i=Number(c[0]),c[0].length>2||!c[0].length||!(i>=0&&i<=23))return s;if(v.setHours(i),v.getHours()!==i)return s;if(c.length>1)return a=v.getTime(),n=Number(c[1]),2===c[1].length&&n>=0&&n<=59?(a+=f*n,2===c.length?a:2!==c[2].split(".")[0].length?s:(t=Number(c[2]),t>=0&&t<60?a+t*d:s)):s}}}return v.getTime()},h=r.MIN_MS=r.dateTime2ms("-9999"),p=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t){return r.dateTime2ms(t)!==s};var g=90*c,m=3*u,v=5*f;r.ms2DateTime=function(t,e){if("number"!=typeof t||!(t>=h&&t<=p))return s;e||(e=0);var r=new Date(Math.floor(t)),o=a.time.format("%Y-%m-%d")(r),i=er?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},a.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},a.identity=function(t){return t},a.noop=function(){},a.randstr=function t(e,r,n){if(n||(n=16),void 0===r&&(r=24),r<=0)return"0";var a,o,i,l=Math.log(Math.pow(2,r))/Math.log(n),s="";for(a=2;l===1/0;a*=2)l=Math.log(Math.pow(2,r/a))/Math.log(n)*a;var c=l-Math.floor(l);for(a=0;a-1||u!==1/0&&u>=Math.pow(2,r)?t(e,r,n):s},a.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={};return r.optionList=[],r._newoption=function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)},r["_"+e]=t,r},a.smooth=function(t,e){if(e=Math.round(e)||0,e<2)return t;var r,n,a,o,i=t.length,l=2*i,s=2*e-1,c=new Array(s),u=new Array(i);for(r=0;r=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=i&&(a=l-1-a),o+=t[a]*c[n];u[r]=o}return u},a.syncOrAsync=function(t,e,r){function n(){return a.syncOrAsync(t,e,r)}for(var o,i;t.length;)if(i=t.splice(0,1)[0],o=i(e),o&&o.then)return o.then(n).then(void 0,a.promiseError);return r&&r(e)},a.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},a.noneOrAll=function(t,e,r){if(t){var n,a,o=!1,i=!0;for(n=0;n1?a+i[1]:"";if(o&&(i.length>1||l.length>4||r))for(;n.test(l);)l=l.replace(n,"$1"+o+"$2");return l+s}},{"./clean_number":115,"./coerce":116,"./dates":117,"./extend":119,"./filter_unique":120,"./filter_visible":121,"./is_array":123,"./is_plain_object":124,"./loggers":125,"./matrix":126,"./nested_property":127,"./notifier":128,"./search":131,"./stats":133,d3:14}],123:[function(t,e,r){"use strict";e.exports=function(t){return Array.isArray(t)||ArrayBuffer.isView(t)}},{}],124:[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}},{}],125:[function(t,e,r){"use strict";var n=t("../plot_api/plot_config"),a=e.exports={};a.log=function(){if(n.logging>1){for(var t=["LOG:"],e=0;e0){for(var t=["WARN:"],e=0;e0){for(var t=["ERROR:"],e=0;e=0;e--){if(n=t[e],i=!1,d(n))for(r=n.length-1;r>=0;r--)c(n[r])?i?n[r]=void 0:n.pop():i=!0;else if("object"==typeof n&&null!==n)for(o=Object.keys(n),i=!1,r=o.length-1;r>=0;r--)c(n[o[r]])&&!a(n[o[r]],o[r])?delete n[o[r]]:i=!0;if(i)return}}function c(t){return void 0===t||null===t||"object"==typeof t&&(d(t)?!t.length:!Object.keys(t).length)}function u(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}var f=t("fast-isnumeric"),d=t("./is_array");e.exports=function(t,e){if(f(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,a,i,l=0,s=e.split(".");lo||nl)&&(!e||!c(t))}function r(t,e){var r=t[0],s=t[1];if(ro||sl)return!1;var c,u,f,d,h,p=n.length,g=n[0][0],m=n[0][1],v=0;for(c=1;cMath.max(u,g)||s>Math.max(f,m)))if(su||Math.abs(n(i,d))>a)return!0;return!1};a.filter=function(t,e){function r(r){t.push(r);var l=n.length,s=a;n.splice(i+1);for(var c=s+1;c1){var l=t.pop();r(l)}return{addPt:r,raw:t,filtered:n}}},{"./matrix":126}],130:[function(t,e,r){"use strict";function n(t,e){for(var r,n=[],o=0;oo.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--)))},i.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},i.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},i.undo=function(t){var e,r;if(t.framework&&t.framework.isPolar)return void t.framework.undo();if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}function i(t,e){return t>=e}var l=t("fast-isnumeric"),s=t("./loggers");r.findBin=function(t,e,r){if(l(e.start))return r?Math.ceil((t-e.start)/e.size)-1:Math.floor((t-e.start)/e.size);var c,u,f=0,d=e.length,h=0;for(u=e[e.length-1]>=e[0]?r?n:a:r?i:o;f90&&s.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,o=a/(n||1)/1e4,i=[e[0]],l=0;le[l]+o&&(a=Math.min(a,e[l+1]-e[l]),i.push(e[l+1]));return{vals:i,minDiff:a}},r.roundUp=function(t,e,r){for(var n,a=0,o=e.length-1,i=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;at.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"fast-isnumeric":17}],134:[function(t,e,r){"use strict";function n(t,e){return t.node().getBoundingClientRect()[e]}function a(t){return t.replace(/(<|<|<)/g,"\\lt ").replace(/(>|>|>)/g,"\\gt ")}function o(t,e,r){var n="math-output-"+d.randstr([],64),o=f.select("body").append("div").attr({id:n}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(a(t));MathJax.Hub.Queue(["Typeset",MathJax.Hub,o.node()],function(){var e=f.select("body").select("#MathJax_SVG_glyphs");if(o.select(".MathJax_SVG").empty()||!o.select("svg").node())d.log("There was an error in the tex syntax.",t),r();else{var n=o.select("svg").node().getBoundingClientRect();r(o.select(".MathJax_SVG"),e,n)}o.remove()})}function i(t,e){for(var r=t||"",n=0;n]*>)/).map(function(t){var e=t.match(/<(\/?)([^ >]*)\s*(.*)>/i),n=e&&e[2].toLowerCase(),a=g[n];if(void 0!==a){var o=e[1],i=e[3],l=i.match(/^style\s*=\s*"([^"]+)"\s*/i);if("a"===n){if(o)return"";if("href"!==i.substr(0,4).toLowerCase())return"";var c=i.substr(4).replace(/["']/g,"").replace(/=/,""),u=document.createElement("a");return u.href=c,m.indexOf(u.protocol)===-1?"":''}if("br"===n)return"
";if(o)return"sup"===n?'':"sub"===n?'':"";var f=""}return r.xml_entity_encode(t).replace(/");a>0;a=e.indexOf("
",a+1))n.push(a);var o=0;n.forEach(function(t){for(var r=t+o,n=e.slice(0,r),a="",i=n.length-1;i>=0;i--){var l=n[i].match(/<(\/?).*>/i);if(l&&"
"!==n[i]){l[1]||(a=n[i]);break}}a&&(e.splice(r+1,0,a),e.splice(r,0,""),o+=2)});var i=e.join(""),c=i.split(/
/gi);return c.length>1&&(e=c.map(function(t,e){return''+t+""})),e.join("")}function u(t,e,r){var n,a,o,i=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},o="right"===i?function(){return s.right-n.width}:"center"===i?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:o()-c.left+"px","z-index":1e3}),this}}var f=t("d3"),d=t("../lib"),h=t("../constants/xmlns_namespaces"),p=t("../constants/string_mappings");f.selection.prototype.appendSVG=function(t){for(var e=['',t,""].join(""),r=(new DOMParser).parseFromString(e,"application/xml"),n=r.documentElement.firstChild;n;)this.node().appendChild(this.node().ownerDocument.importNode(n,!0)),n=n.nextSibling;return r.querySelector("parsererror")?(d.log(r.querySelector("parsererror div").textContent),null):f.select(this.node().lastChild)},r.html_entity_decode=function(t){var e=f.select("body").append("div").style({display:"none"}).html(""),r=t.replace(/(&[^;]*;)/gi,function(t){return"<"===t?"<":"&rt;"===t?">":e.html(t).text()});return e.remove(),r},r.xml_entity_encode=function(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")},r.convertToTspans=function(t,e){function r(){h.empty()||(p=l.attr("class")+"-math",h.select("svg."+p).remove()),t.text("").style({visibility:"inherit","white-space":"pre"}),u=t.appendSVG(i),u||t.text(a),t.select("a").size()&&t.style("pointer-events","all"),e&&e.call(l)}var a=t.text(),i=c(a),l=t,s=!l.attr("data-notex")&&i.match(/([^$]*)([$]+[^$]*[$]+)([^$]*)/),u=a,h=f.select(l.node().parentNode);if(!h.empty()){var p=l.attr("class")?l.attr("class").split(" ")[0]:"text";p+="-math",h.selectAll("svg."+p).remove(),h.selectAll("g."+p+"-group").remove(),t.style({visibility:null});for(var g=t.node();g&&g.removeAttribute;g=g.parentNode)g.removeAttribute("data-bb");if(s){var m=d.getPlotDiv(l.node());(m&&m._promises||[]).push(new Promise(function(t){l.style({visibility:"hidden"});var a={fontSize:parseInt(l.style("font-size"),10)};o(s[2],a,function(a,o,i){h.selectAll("svg."+p).remove(),h.selectAll("g."+p+"-group").remove();var s=a&&a.select("svg");if(!s||!s.node())return r(),void t();var c=h.append("g").classed(p+"-group",!0).attr({"pointer-events":"none"});c.node().appendChild(s.node()),o&&o.node()&&s.node().insertBefore(o.node().cloneNode(!0),s.node().firstChild),s.attr({class:p,height:i.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=l.style("fill")||"black";s.select("g").attr({fill:u,stroke:u});var f=n(s,"width"),d=n(s,"height"),g=+l.attr("x")-f*{start:0,middle:.5,end:1}[l.attr("text-anchor")||"start"],m=parseInt(l.style("font-size"),10)||n(l,"height"),v=-m/4;"y"===p[0]?(c.attr({transform:"rotate("+[-90,+l.attr("x"),+l.attr("y")]+") translate("+[-f/2,v-d/2]+")"}),s.attr({x:+l.attr("x"),y:+l.attr("y")})):"l"===p[0]?s.attr({x:l.attr("x"),y:v-d/2}):"a"===p[0]?s.attr({x:0,y:v}):s.attr({x:g,y:+l.attr("y")+v-d/2}),e&&e.call(l,c),t(c)})}))}else r();return t}};var g={sup:'font-size:70%" dy="-0.6em',sub:'font-size:70%" dy="0.3em',b:"font-weight:bold",i:"font-style:italic",a:"",span:"",br:"",em:"font-style:italic;font-weight:bold"},m=["http:","https:","mailto:"],v=new RegExp("]*)?/?>","g"),y=Object.keys(p.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:p.entityToUnicode[t]}}),x=Object.keys(p.unicodeToEntity).map(function(t){return{regExp:new RegExp(t,"g"),sub:"&"+p.unicodeToEntity[t]+";"}});r.plainText=function(t){return(t||"").replace(v," ")},r.makeEditable=function(t,e,r){function n(){o(),i.style({opacity:0});var t,e=c.attr("class");t=e?"."+e.split(" ")[0]+"-math-group":"[class*=-math-group]",t&&f.select(i.node().parentNode).select(t).style({opacity:0})}function a(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}function o(){var t=f.select(d.getPlotDiv(i.node())),e=t.select(".svg-container"),n=e.append("div");n.classed("plugin-editable editable",!0).style({position:"absolute","font-family":i.style("font-family")||"Arial","font-size":i.style("font-size")||12,color:r.fill||i.style("fill")||"black",opacity:1,"background-color":r.background||"transparent",outline:"#ffffff33 1px solid",margin:[-parseFloat(i.style("font-size"))/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(r.text||i.attr("data-unformatted")).call(u(i,e,r)).on("blur",function(){i.text(this.textContent).style({opacity:1});var t,e=f.select(this).attr("class");t=e?"."+e.split(" ")[0]+"-math-group":"[class*=-math-group]",t&&f.select(i.node().parentNode).select(t).style({opacity:0});var r=this.textContent;f.select(this).transition().duration(0).remove(),f.select(document).on("mouseup",null),l.edit.call(i,r)}).on("focus",function(){var t=this;f.select(document).on("mouseup",function(){return f.event.target!==t&&void(document.activeElement===n.node()&&n.node().blur())})}).on("keyup",function(){27===f.event.which?(i.style({opacity:1}),f.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),l.cancel.call(i,this.textContent)):(l.input.call(i,this.textContent),f.select(this).call(u(i,e,r)))}).on("keydown",function(){13===f.event.which&&this.blur()}).call(a)}r||(r={});var i=this,l=f.dispatch("edit","input","cancel"),s=f.select(this.node()).style({"pointer-events":"all"}),c=e||s;return e&&s.style({"pointer-events":"none"}),r.immediate?n():c.on("click",n),f.rebind(this,l,"on")}},{"../constants/string_mappings":111,"../constants/xmlns_namespaces":112,"../lib":122,d3:14}],135:[function(t,e,r){"use strict";function n(t,e){var r=t[e],n=e.charAt(0);r&&"paper"!==r&&(t[e]=f.cleanId(r,n))}function a(t){var e="middle",r="center";return t.indexOf("top")!==-1?e="top":t.indexOf("bottom")!==-1&&(e="bottom"),t.indexOf("left")!==-1?r="left":t.indexOf("right")!==-1&&(r="right"),e+" "+r}function o(t,e){return e in t&&"object"==typeof t[e]&&0===Object.keys(t[e]).length}var i=t("fast-isnumeric"),l=t("gl-mat4/fromQuat"),s=t("../registry"),c=t("../lib"),u=t("../plots/plots"),f=t("../plots/cartesian/axes"),d=t("../components/color");r.getGraphDiv=function(t){var e;if("string"==typeof t){if(e=document.getElementById(t),null===e)throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t},r.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&c.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,r;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1);var a=f.list({_fullLayout:t});for(e=0;e3?(m.x=1.02,m.xanchor="left"):m.x<-2&&(m.x=-.02,m.xanchor="right"),m.y>3?(m.y=1.02,m.yanchor="bottom"):m.y<-2&&(m.y=-.02,m.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var v=u.getSubplotIds(t,"gl3d");for(e=0;e=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 s(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]),l(t,e,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&l(t,r,"newIndices"),"undefined"!=typeof r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function c(t,e,r){var n,a;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&sO.range[0]?[1,2]:[2,1]);else{var D=O.range[0],P=O.range[1];"log"===b?(D<=0&&P<=0&&r(L+".autorange",!0),D<=0?D=P/1e6:P<=0&&(P=D/1e6),r(L+".range[0]",Math.log(D)/Math.LN10),r(L+".range[1]",Math.log(P)/Math.LN10)):(r(L+".range[0]",Math.pow(10,D)),r(L+".range[1]",Math.pow(10,P)))}else r(L+".autorange",!0)}if("reverse"===A)z.range?z.range.reverse():(r(L+".autorange",!0),z.range=[1,0]),C.autorange?h.docalc=!0:h.doplot=!0;else if("annotations"===v.parts[0]||"shapes"===v.parts[0]){var N=v.parts[1],E=v.parts[0],I=o[E]||[],R=I[N]||{};2===v.parts.length&&(null===b&&(e[m]="remove"),"add"===e[m]||x.isPlainObject(e[m])?g[m]="remove":"remove"===e[m]?N===-1?(g[E]=I,delete g[m]):g[m]=R:x.log("???",e)),!n(R,"x")&&!n(R,"y")||x.containsAny(m,["color","opacity","align","dash"])||(h.docalc=!0);var F=w.getComponentMethod(E,"drawOne");F(t,N,v.parts.slice(2).join("."),e[m]),delete e[m]}else if(k.layoutArrayContainers.indexOf(v.parts[0])!==-1||"mapbox"===v.parts[0]&&"layers"===v.parts[1])S.manageArrayContainers(v,b,g),h.doplot=!0;else{var j=String(v.parts[1]||"");0===v.parts[0].indexOf("scene")?h.doplot=!0:0===v.parts[0].indexOf("geo")?h.doplot=!0:0===v.parts[0].indexOf("ternary")?h.doplot=!0:"paper_bgcolor"===m?h.doplot=!0:!i._has("gl2d")||m.indexOf("axis")===-1&&"plot_bgcolor"!==v.parts[0]?"hiddenlabels"===m?h.docalc=!0:v.parts[0].indexOf("legend")!==-1?h.dolegend=!0:m.indexOf("title")!==-1?h.doticks=!0:v.parts[0].indexOf("bgcolor")!==-1?h.dolayoutstyle=!0:v.parts.length>1&&x.containsAny(j,["tick","exponent","grid","zeroline"])?h.doticks=!0:m.indexOf(".linewidth")!==-1&&m.indexOf("axis")!==-1?h.doticks=h.dolayoutstyle=!0:v.parts.length>1&&j.indexOf("line")!==-1?h.dolayoutstyle=!0:v.parts.length>1&&"mirror"===j?h.doticks=h.dolayoutstyle=!0:"margin.pad"===m?h.doticks=h.dolayoutstyle=!0:"margin"===v.parts[0]||"autorange"===v.parts[1]||"rangemode"===v.parts[1]||"type"===v.parts[1]||"domain"===v.parts[1]||m.match(/^(bar|box|font)/)?h.docalc=!0:["hovermode","dragmode"].indexOf(m)!==-1?h.domodebar=!0:["hovermode","dragmode","height","width","autosize"].indexOf(m)===-1&&(h.doplot=!0):h.doplot=!0,v.set(b)}}}var q=t._fullLayout.width,B=t._fullLayout.height;k.supplyDefaults(t),t.layout.autosize&&k.plotAutoSize(t,t.layout,t._fullLayout);var H=e.height||e.width||t._fullLayout.width!==q||t._fullLayout.height!==B;return H&&(h.docalc=!0),(h.doplot||h.docalc)&&(h.layoutReplot=!0),{flags:h,undoit:g,redoit:p,eventData:x.extendDeep({},p)}}function g(t){var e=m.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([0]),r._glcontainer.enter().append("div").classed("gl-container",!0),r._geocontainer=r._paperdiv.selectAll(".geo-container").data([0]),r._geocontainer.enter().append("div").classed("geo-container",!0),r._paperdiv.selectAll(".main-svg").remove(),r._paper=r._paperdiv.insert("svg",":first-child").classed("main-svg",!0),r._toppaper=r._paperdiv.append("svg").classed("main-svg",!0),!r._uid){var n=[];m.selectAll("defs").each(function(){this.id&&n.push(this.id.split("-")[1])}),r._uid=x.randstr(n)}r._paperdiv.selectAll(".main-svg").attr(z.svgAttrs),r._defs=r._paper.append("defs").attr("id","defs-"+r._uid),r._topdefs=r._toppaper.append("defs").attr("id","topdefs-"+r._uid),r._draggers=r._paper.append("g").classed("draglayer",!0);var a=r._paper.append("g").classed("layer-below",!0);r._imageLowerLayer=a.append("g").classed("imagelayer",!0),r._shapeLowerLayer=a.append("g").classed("shapelayer",!0),r._cartesianlayer=r._paper.append("g").classed("cartesianlayer",!0),r._ternarylayer=r._paper.append("g").classed("ternarylayer",!0);var o=r._paper.append("g").classed("layer-above",!0);r._imageUpperLayer=o.append("g").classed("imagelayer",!0),r._shapeUpperLayer=o.append("g").classed("shapelayer",!0),r._pielayer=r._paper.append("g").classed("pielayer",!0),r._glimages=r._paper.append("g").classed("glimages",!0),r._geoimages=r._paper.append("g").classed("geoimages",!0),r._infolayer=r._toppaper.append("g").classed("infolayer",!0),r._zoomlayer=r._toppaper.append("g").classed("zoomlayer",!0),r._hoverlayer=r._toppaper.append("g").classed("hoverlayer",!0),t.emit("plotly_framework")}var m=t("d3"),v=t("fast-isnumeric"),y=t("../plotly"),x=t("../lib"),b=t("../lib/events"),_=t("../lib/queue"),w=t("../registry"),k=t("../plots/plots"),M=t("../plots/cartesian/graph_interact"),A=t("../plots/polar"),T=t("../components/drawing"),L=t("../components/errorbars"),z=t("../constants/xmlns_namespaces"),C=t("../lib/svg_text_utils"),S=t("./helpers"),O=t("./subroutines");y.plot=function(t,e,r,n){function i(){if(_)return y.addFrames(t,_)}function l(){for(var e=D._basePlotModules,r=0;r=l.length?l[0]:l[t]:l}function a(t){return Array.isArray(s)?t>=s.length?s[0]:s[t]:s}function o(t,e){var r=0;return function(){if(t&&++r===e)return t()}}if(t=S.getGraphDiv(t),!x.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 i=t._transitionData;i._frameQueue||(i._frameQueue=[]),r=k.supplyAnimationDefaults(r);var l=r.transition,s=r.frame;return void 0===i._frameWaitingCnt&&(i._frameWaitingCnt=0),new Promise(function(s,c){function u(){if(0!==i._frameQueue.length){for(;i._frameQueue.length;){var e=i._frameQueue.pop();e.onInterrupt&&e.onInterrupt()}t.emit("plotly_animationinterrupted",[])}}function f(e){if(0!==e.length){for(var l=0;li._timeToNext&&h()};e()}function g(t){return Array.isArray(l)?y>=l.length?t.transitionOpts=l[y]:t.transitionOpts=l[0]:t.transitionOpts=l,y++,t}var m,v,y=0,b=[],_=void 0===e||null===e,w=Array.isArray(e),M=!_&&!w&&x.isPlainObject(e);if(M)b.push({type:"object",data:g(x.extendFlat({},e))});else if(_||"string"==typeof e)for(m=0;m0&&LL)&&z.push(v);b=z}}b.length>0?f(b):(t.emit("plotly_animated"),s())})},y.addFrames=function(t,e,r){if(t=S.getGraphDiv(t),null===e||void 0===e)return Promise.resolve();if(!x.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,o,i,l=t._transitionData._frames,s=t._transitionData._frameHash;if(!Array.isArray(e))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+e);var c=l.length+2*e.length,u=[];for(n=e.length-1;n>=0;n--)u.push({frame:k.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:c+n});u.sort(function(t,e){return t.index>e.index?-1:t.index=0;n--){if(a=u[n].frame,!a.name)for(;s[a.name="frame "+t._transitionData._counter++];);if(s[a.name]){for(o=0;o=0;r--)n=e[r],o.push({type:"delete",index:n}),i.unshift({type:"insert",index:n,value:a[n]});var l=k.modifyFrames,s=k.modifyFrames,c=[t,i],u=[t,o];return _&&_.add(t,l,c,s,u),k.modifyFrames(t,o)},y.purge=function(t){t=S.getGraphDiv(t);var e=t._fullLayout||{},r=t._fullData||[];return k.cleanPlot([],{},r,e),k.purge(t),b.purge(t),e._container&&e._container.remove(),delete t._context,delete t._replotPending,delete t._mouseDownTime,delete t._hmpixcount,delete t._hmlumcount,t}},{"../components/drawing":53,"../components/errorbars":59,"../constants/xmlns_namespaces":112,"../lib":122,"../lib/events":118,"../lib/queue":130,"../lib/svg_text_utils":134,"../plotly":144,"../plots/cartesian/graph_interact":156,"../plots/plots":173,"../plots/polar":176,"../registry":188,"./helpers":135,"./subroutines":141,d3:14,"fast-isnumeric":17}],137:[function(t,e,r){"use strict";function n(t,r){try{t._fullLayout._paper.style("background",r)}catch(t){e.exports.logging>0&&console.error(t)}}e.exports={staticPlot:!1,editable:!1,editableMainTitle:!0,editableAxisXTitle:!0,editableAxisX2Title:!0,editableAxisYTitle:!0,editableAxisY2Title:!0,autosizable:!1,queueLength:0,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:n,topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:!1,globalTransforms:[]}},{}],138:[function(t,e,r){"use strict";function n(t){var e,r;"area"===t?(e={attributes:y},r={}):(e=d.modules[t]._module,r=e.basePlotModule);var n={};n.type=null,_(n,p),_(n,e.attributes),r.attributes&&_(n,r.attributes),n.type=t;var a={meta:e.meta||{},attributes:i(n)};if(e.layoutAttributes){var o={};_(o,e.layoutAttributes),a.layoutAttributes=i(o)}return a}function a(){var t={};return _(t,g),Object.keys(d.subplotsRegistry).forEach(function(e){var r=d.subplotsRegistry[e];if(r.layoutAttributes)if("cartesian"===r.name)u(t,r,"xaxis"),u(t,r,"yaxis");else{var n="subplot"===r.attr?r.name:r.attr;u(t,r,n)}}),t=c(t),Object.keys(d.componentsRegistry).forEach(function(e){var r=d.componentsRegistry[e];r.layoutAttributes&&(Array.isArray(r.layoutNodes)?r.layoutNodes.forEach(function(e){f(t,r,e+r.name)}):f(t,r,r.name))}),{layoutAttributes:i(t)}}function o(t){var e=d.transformsRegistry[t];return{attributes:i(e.attributes)}}function i(t){return l(t),s(t),t}function l(t){function e(t){return{valType:"string"}}function n(t,n,a){r.isValObject(t)?"data_array"===t.valType?(t.role="data",a[n+"src"]=e(n)):t.arrayOk===!0&&(a[n+"src"]=e(n)):h.isPlainObject(t)&&(t.role="object")}r.crawl(t,n)}function s(t){function e(t,e,r){if(t){var n=t[k];n&&(delete t[k],r[e]={items:{}},r[e].items[n]=t,r[e].role="object")}}r.crawl(t,e)}function c(t){return b(t,{radialaxis:x.radialaxis,angularaxis:x.angularaxis}),b(t,x.layout),t}function u(t,e,r){var n=h.nestedProperty(t,r),a=_({},e.layoutAttributes);a[w]=!0,n.set(a)}function f(t,e,r){var n=h.nestedProperty(t,r),a=_(n.get()||{},e.layoutAttributes);n.set(a)}var d=t("../registry"),h=t("../lib"),p=t("../plots/attributes"),g=t("../plots/layout_attributes"),m=t("../plots/frame_attributes"),v=t("../plots/animation_attributes"),y=t("../plots/polar/area_attributes"),x=t("../plots/polar/axis_attributes"),b=h.extendFlat,_=h.extendDeep,w="_isSubplotObj",k="_isLinkedToArray",M="_deprecated",A=[w,k,M];r.IS_SUBPLOT_OBJ=w,r.IS_LINKED_TO_ARRAY=k,r.DEPRECATED=M,r.UNDERSCORE_ATTRS=A,r.get=function(){var t={};d.allTypes.concat("area").forEach(function(e){t[e]=n(e)});var e={};return Object.keys(d.transformsRegistry).forEach(function(t){e[t]=o(t)}),{defs:{valObjects:h.valObjects,metaKeys:A.concat.role},traces:t,layout:a(),transforms:e,frames:i(m),animation:i(v)}},r.crawl=function(t,e,n){var a=n||0;Object.keys(t).forEach(function(n){var o=t[n];A.indexOf(n)===-1&&(e(o,n,t,a),r.isValObject(o)||h.isPlainObject(o)&&r.crawl(o,e,a+1))})},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){function e(e,r,i,l){o=o.slice(0,l).concat([r]);var s="data_array"===e.valType||e.arrayOk===!0;if(s){var c=n(o),u=h.nestedProperty(t,c).get();Array.isArray(u)&&a.push(c)}}function n(t){return t.join(".")}var a=[],o=[];if(r.crawl(t._module.attributes,e),t.transforms)for(var i=t.transforms,l=0;l1)};d(e.width)&&d(e.height)||n(new Error("Height and width should be pixel values."));var h=s(t,{format:"png",height:e.height,width:e.width}),p=h.gd;p.style.position="absolute",p.style.left="-5000px",document.body.appendChild(p);var g=l.getRedrawFunc(p);o.plot(p,h.data,h.layout,h.config).then(g).then(f).then(function(t){r(t)}).catch(function(t){n(t)})});return r}var a=t("fast-isnumeric"),o=t("../plotly"),i=t("../lib"),l=t("../snapshot/helpers"),s=t("../snapshot/cloneplot"),c=t("../snapshot/tosvg"),u=t("../snapshot/svgtoimg");e.exports=n},{"../lib":122,"../plotly":144,"../snapshot/cloneplot":189,"../snapshot/helpers":192,"../snapshot/svgtoimg":194,"../snapshot/tosvg":196,"fast-isnumeric":17}],143:[function(t,e,r){"use strict";function n(t,e,r,a,o,c){c=c||[];for(var u=Object.keys(t),d=0;d1&&s.push(i("object","layout"))),d.supplyDefaults(c);for(var u=c._fullData,m=r.length,v=0;vu&&e10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12===0?"y":"m";else if(e>=O&&a<=10||e>=15*O)t._tickround="d";else if(e>=P&&a<=16||e>=D)t._tickround="M";else if(e>=N&&a<=19||e>=P)t._tickround="S";else{var o=w.ms2DateTime(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20}}else if(x(e)||"L"===e.charAt(0)){var i=t.range.map(t.r2d||Number);x(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(i[0]),Math.abs(i[1])),s=Math.floor(Math.log(l)/Math.LN10+.01);Math.abs(s)>3&&("SI"===t.exponentformat||"B"===t.exponentformat?t._tickexponent=3*Math.round((s-1)/3):t._tickexponent=s)}else t._tickround=null}function i(t,e){var r=t.match(W),n=new Date(e);if(r){var a=Math.min(+r[1]||6,6),o=String(e/1e3%1+2.0000005).substr(2,a).replace(/0+$/,"")||"0";return y.time.format(t.replace(W,o))(n)}return y.time.format(t)(n)}function l(t,e,r){var n=t.tickfont||t._gd._fullLayout.font;return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}function s(t,e,r,n){var a,o,l=e.x,s=t._tickround,c=s,u=new Date(l);r&&t.hoverformat?o=i(t.hoverformat,l):t.tickformat?o=i(t.tickformat,l):(n&&(x(s)?s+=2:s={y:"m",m:"d",d:"M",M:"S",S:2}[s]),"y"===s?o=V(u):"m"===s?o=Z(u):"d"===s?(r||(a="
"+V(u)),o=X(u)):(r||(a="
"+U(u)),o=Y(u),"M"!==s?(o+=G(u),"S"!==s&&(o+=d(y.round(v(l/1e3,1),4),t,"none",r).substr(1))):"d"===c&&(o=X(u)+" "+o))),!a||t._inCalcTicks&&a===t._prevSuffix||(o+=a,t._prevSuffix=a),e.text=o}function c(t,e,r,n,a){var o=t.dtick,i=e.x;if(!n||"string"==typeof o&&"L"===o.charAt(0)||(o="L3"),t.tickformat||"string"==typeof o&&"L"===o.charAt(0))e.text=d(Math.pow(10,i),t,a,n);else if(x(o)||"D"===o.charAt(0)&&v(i+.01,1)<.1)if(["e","E","power"].indexOf(t.exponentformat)!==-1){var l=Math.round(i);0===l?e.text=1:1===l?e.text="10":l>1?e.text="10"+l+"":e.text="10\u2212"+-l+"",e.fontSize*=1.25}else e.text=d(Math.pow(10,i),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6);else{if("D"!==o.charAt(0))throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,v(i,1)))),e.fontSize*=.75}if("D1"===t.dtick){var s=String(e.text).charAt(0);"0"!==s&&"1"!==s||("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*(i<0?.5:.25)))}}function u(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}function f(t,e,r,n,a){"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide"),e.text=d(e.x,t,a,n)}function d(t,e,r,n){var a=t<0,i=e._tickround,l=r||e.exponentformat||"B",s=e._tickexponent,c=e.tickformat,u=e.separatethousands;if(n){var f={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:x(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};o(f),i=(Number(f._tickround)||0)+4,s=f._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return y.format(c)(t).replace(/-/g,"\u2212");var d=Math.pow(10,-i)/2;if("none"===l&&(s=0),t=Math.abs(t),t12||s<-15)?t+="e"+g:"E"===l?t+="E"+g:"power"===l?t+="\xd710"+g+"":"B"===l&&9===s?t+="B":"SI"!==l&&"B"!==l||(t+=Q[s/3+5])}return a?"\u2212"+t:t}function h(t,e){var r,n,a=[];for(r=0;r1)for(n=1;n2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},E.getAutoRange=function(t){var e,r=[],n=t._min[0].val,a=t._max[0].val;for(e=1;e0&&u>0&&f/u>d&&(s=i,c=l,d=f/u);if(n===a){var g=n-1,m=n+1;r="tozero"===t.rangemode?n<0?[g,0]:[0,m]:"nonnegative"===t.rangemode?[Math.max(0,g),Math.max(0,m)]:[g,m]}else d&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(s.val>=0&&(s={val:0,pad:0}),c.val<=0&&(c={val:0,pad:0})):"nonnegative"===t.rangemode&&(s.val-d*s.pad<0&&(s={val:0,pad:0}),c.val<0&&(c={val:1,pad:0})),d=(c.val-s.val)/(t._length-s.pad-c.pad)),r=[s.val-d*s.pad,c.val+d*c.pad]);return r[0]===r[1]&&("tozero"===t.rangemode?r=r[0]<0?[r[0],0]:r[0]>0?[0,r[0]]:[0,1]:(r=[r[0]-1,r[0]+1],"nonnegative"===t.rangemode&&(r[0]=Math.max(0,r[0])))),h&&r.reverse(),r.map(t.l2r||Number)},E.doAutoRange=function(t){t._length||t.setScale();var e=t._min&&t._max&&t._min.length&&t._max.length;if(t.autorange&&e){t.range=E.getAutoRange(t);var r=t._gd.layout[t._name];r||(t._gd.layout[t._name]=r={}),r!==t&&(r.range=t.range.slice(),r.autorange=t.autorange)}},E.saveRangeInitial=function(t,e){for(var r=E.list(t,"",!0),n=!1,a=0;a=d?h=!1:l.val>=c&&l.pad<=d&&(t._min.splice(i,1),i--);h&&t._min.push({val:c,pad:y&&0===c?0:d})}if(n(u)){for(h=!0,i=0;i=u&&l.pad>=f?h=!1:l.val<=u&&l.pad<=f&&(t._max.splice(i,1),i--);h&&t._max.push({val:u,pad:y&&0===u?0:f})}}}if((t.autorange||t._needsExpand)&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var o,i,l,s,c,u,f,d,h,p,g,m=e.length,v=r.padded?.05*t._length:0,y=r.tozero&&("linear"===t.type||"-"===t.type),b=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),_=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),w=n(r.vpadplus||r.vpad),k=n(r.vpadminus||r.vpad);for(o=0;o<6;o++)a(o);for(o=m-1;o>5;o--)a(o)}},E.autoBin=function(t,e,r,n){function a(t){return(1+100*(t-h)/f.dtick)%100<2}var o=w.aggNums(Math.min,null,t),i=w.aggNums(Math.max,null,t);if("category"===e.type)return{start:o-.5,end:i+.5,size:1};var l;if(r)l=(i-o)/r;else{var s=w.distinctVals(t),c=Math.pow(10,Math.floor(Math.log(s.minDiff)/Math.LN10)),u=c*w.roundUp(s.minDiff/c,[.9,1.9,4.9,9.9],!0);l=Math.max(u,2*w.stdev(t)/Math.pow(t.length,n?.25:.4))}var f;f="log"===e.type?{type:"linear",range:[o,i],r2l:Number}:{type:e.type,range:[o,i].map(e.l2r),r2l:e.r2l},E.autoTicks(f,l);var d,h=E.tickIncrement(E.tickFirst(f),f.dtick,"reverse");if("number"==typeof f.dtick){for(var p=0,g=0,m=0,v=0,y=0;y.3*b||a(o)||a(i))){var _=f.dtick/2;h+=h+_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),o(t),t._tmin=E.tickFirst(t);var i=e[1]=s:c<=s)&&(l.push(c),!(l.length>1e3));c=E.tickIncrement(c,t.dtick,i));t._tmax=l[l.length-1],t._prevSuffix="",t._inCalcTicks=!0;for(var u=new Array(l.length),f=0;fC?(e/=C,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*a(e,r,R)):n>S?(e/=S,t.dtick="M"+a(e,1,F)):n>O?(t.dtick=a(e,O,q),t.tick0="2000-01-02"):n>D?t.dtick=a(e,D,F):n>P?t.dtick=a(e,P,j):n>N?t.dtick=a(e,N,j):(r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=a(e,r,R))}else if("log"===t.type){t.tick0=0;var o=t.range.map(t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(o[1]-o[0])<1){var i=1.5*Math.abs((o[1]-o[0])/e);e=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/i,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+a(e,r,R)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):(t.tick0=0,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=a(e,r,R));if(0===t.dtick&&(t.dtick=1),!x(t.dtick)&&"string"!=typeof t.dtick){var l=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(l)}},E.tickIncrement=function(t,e,r){var n=r?-1:1;if(x(e))return t+n*e;var a=e.charAt(0),o=n*Number(e.substr(1));if("M"===a){var i=new Date(t);return i.setMonth(i.getMonth()+o)}if("L"===a)return Math.log(Math.pow(10,t)+o)/Math.LN10;if("D"===a){var l="D2"===e?H:B,s=t+.01*n,c=w.roundUp(v(s,1),l,r);return Math.floor(s)+Math.log(y.round(Math.pow(10,c),1))/Math.LN10}throw"unrecognized dtick "+String(e)},E.tickFirst=function(t){var e=t.r2l||Number,r=t.range.map(e),n=r[1]o:f1&&en){var o=t.text,i=Math.round(n/(a/o.length)),l=Math.floor(i/2),s=i-l-1;o=o.substr(0,l)+"\u2026"+o.substr(-s);var c=e.select("text");c.text(o),e.insert("title","text").text(t.text)}})}function u(){var e,r,n=c._boundingBox,a=0,o=0;if("x"===c._id.charAt(0)?(e="height","2"===c._id.charAt(1)?(o=1,r="t"):r="b"):"y"===c._id.charAt(0)&&(e="width","2"===c._id.charAt(1)?(a=1,r="r"):r="l"),e&&r){var i=n[e];if(c._titleElement){var l=c._titleElement.node().getBoundingClientRect();i+=l[e]+2}var s=.5*t._fullLayout[e];i=Math.min(i,s);var u={x:a,y:o,l:0,r:0,b:0,t:0};u[r]=i,_.autoMargin(t,c._name,u)}}function f(){c._boundingBox=r.node().getBoundingClientRect()}r.style("pointer-events","all");var d=r.selectAll("g."+C).data(L,z);if(!c.showticklabels||!x(n))return d.remove(),void i(e);var p,v,b,M,A;"x"===m?(A="bottom"===B?1:-1,p=function(t){return t.dx+N*A},M=n+(P+D)*A,v=function(t){return t.dy+M+t.fontSize*("bottom"===B?1:-.5)},b=function(t){return x(t)&&0!==t&&180!==t?t*A<0?"end":"start":"middle"}):(A="right"===B?1:-1,v=function(t){return t.dy+t.fontSize/2-N*A},p=function(t){return t.dx+n+(P+D+(90===Math.abs(c.tickangle)?t.fontSize/2:0))*A},b=function(t){return x(t)&&90===Math.abs(t)?"middle":"right"===B?"start":"end"});var S=0,O=0,E=[],I=d.enter().append("g").classed(C,1);I.append("text").attr("text-anchor","middle").each(function(e){var r=y.select(this),n=t._promises.length;r.call(T.setPosition,p(e),v(e)).call(T.font,e.font,e.fontSize,e.fontColor).text(e.text).call(k.convertToTspans),n=t._promises[n],n?E.push(t._promises.pop().then(function(){a(r,c.tickangle)})):a(r,c.tickangle)}),d.exit().remove(),d.each(function(t){S=Math.max(S,t.fontSize)}),a(d,c._lastangle||c.tickangle);var R=w.syncOrAsync([o,l,f,u]);return R&&R.then&&t._promises.push(R),R}function i(e){if(!r){var n,a,o,i,l=I.getFromId(t,e),s=y.select(t).selectAll("g."+e+"tick"),c={selection:s,side:l.side},f=e.charAt(0),d=t._fullLayout._size,h=1.5,p=l.titlefont.size;if(s.size()){var g=y.select(s.node().parentNode).attr("transform").match(/translate\(([-\.\d]+),([-\.\d]+)\)/);g&&(c.offsetLeft=+g[1],c.offsetTop=+g[2])}"x"===f?(a="free"===l.anchor?{_offset:d.t+(1-(l.position||0))*d.h,_length:0}:I.getFromId(t,l.anchor),o=l._offset+l._length/2,i=a._offset+("top"===l.side?-10-p*(h+(l.showticklabels?1:0)):a._length+10+p*(h+(l.showticklabels?1.5:.5))),l.rangeslider&&l.rangeslider.visible&&l._boundingBox&&(i+=(u.height-u.margin.b-u.margin.t)*l.rangeslider.thickness+l._boundingBox.height),c.side||(c.side="bottom")):(a="free"===l.anchor?{_offset:d.l+(l.position||0)*d.w,_length:0}:I.getFromId(t,l.anchor),i=l._offset+l._length/2,o=a._offset+("right"===l.side?a._length+10+p*(h+(l.showticklabels?1:.5)):-10-p*(h+(l.showticklabels?.5:0))),n={rotate:"-90",offset:0},c.side||(c.side="left")),M.draw(t,e+"title",{propContainer:l,propName:l._name+".title",dfltName:f.toUpperCase()+" axis",avoid:c,transform:n,attributes:{x:o,y:i,"text-anchor":"middle"}})}}function l(t,e){return t.visible===!0&&t.xaxis+t.yaxis===e&&(!(!b.traceIs(t,"bar")||t.orientation!=={x:"h",y:"v"}[m])||t.fill&&t.fill.charAt(t.fill.length-1)===m)}function s(e,r,a){var o=e.gridlayer,i=e.zerolinelayer,s=e["hidegrid"+m]?[]:V,u=c._gridpath||"M0,0"+("x"===m?"v":"h")+r._length,f=o.selectAll("path."+S).data(c.showgrid===!1?[]:s,z); @@ -24,5 +24,5 @@ p.fontWeight="normal";var v=p.subplotsRegistry,y=p.transformsRegistry,x=t("../co visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}};return r},i.util={},i.DATAEXTENT="dataExtent",i.AREA="AreaChart",i.LINE="LinePlot",i.DOT="DotPlot",i.BAR="BarChart",i.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},i.util._extend=function(t,e){for(var r in t)e[r]=t[r]},i.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},i.util.dataFromEquation2=function(t,e){var r=e||6,a=n.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180,a=t(n);return[e,a]});return a},i.util.dataFromEquation=function(t,e,r){var a=e||6,o=[],i=[];n.range(0,360+a,a).forEach(function(e,r){var n=e*Math.PI/180,a=t(n);o.push(e),i.push(a)});var l={t:o,r:i};return r&&(l.name=r),l},i.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]})},i.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=i.util.ensureArray(t[e],r)}),t},i.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},i.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},i.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},i.util.arrayLast=function(t){return t[t.length-1]},i.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return r===-2},i.util.flattenArray=function(t){for(var e=[];!i.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},i.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},i.util.convertToCartesian=function(t,e){var r=e*Math.PI/180,n=t*Math.cos(r),a=t*Math.sin(r);return[n,a]},i.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},i.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],a=e[1],o={};return o.x=r,o.y=a,o.pos=e,o.angle=180*(Math.atan2(a,r)+Math.PI)/Math.PI,o.radius=Math.sqrt(r*r+a*a),o},i.util.duplicatesCount=function(t){for(var e,r={},n={},a=0,o=t.length;a0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:d(i),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return m.fill(r,a,o)},"fill-opacity":0,stroke:function(t,e){return m.stroke(r,a,o)},"stroke-width":function(t,e){return m["stroke-width"](r,a,o)},"stroke-dasharray":function(t,e){return m["stroke-dasharray"](r,a,o)},opacity:function(t,e){return m.opacity(r,a,o)},display:function(t,e){return m.display(r,a,o)}})}};var h=t.angularScale.range(),p=Math.abs(h[1]-h[0])/s[0].length*Math.PI/180,g=n.svg.arc().startAngle(function(t){return-p/2}).endAngle(function(t){return p/2}).innerRadius(function(e){return t.radialScale(u+(e[2]||0))}).outerRadius(function(e){return t.radialScale(u+(e[2]||0))+t.radialScale(e[1])});f.arc=function(e,r,a){n.select(this).attr({class:"mark arc",d:g,transform:function(e,r){return"rotate("+(t.orientation+c(e[0])+90)+")"}})};var m={fill:function(t,r,n){return e[n].data.color},stroke:function(t,r,n){return e[n].data.strokeColor},"stroke-width":function(t,r,n){return e[n].data.strokeSize+"px"},"stroke-dasharray":function(t,r,n){return l[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return"undefined"==typeof e[n].data.visible||e[n].data.visible?"block":"none"}},v=n.select(this).selectAll("g.layer").data(s);v.enter().append("g").attr({class:"layer"});var y=v.selectAll("path.mark").data(function(t,e){return t});y.enter().append("path").attr({class:"mark"}),y.style(m).each(f[t.geometryType]),y.exit().remove(),v.exit().remove()})}var e,r=[i.PolyChart.defaultConfig()],a=n.dispatch("hover"),l={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,e){r[e]||(r[e]={}),o(r[e],i.PolyChart.defaultConfig()),o(r[e],t)}),this):r},t.getColorScale=function(){return e},n.rebind(t,a,"on"),t},i.PolyChart.defaultConfig=function(){var t={data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}};return t},i.BarChart=function(){return i.PolyChart()},i.BarChart.defaultConfig=function(){var t={geometryConfig:{geometryType:"bar"}};return t},i.AreaChart=function(){return i.PolyChart()},i.AreaChart.defaultConfig=function(){var t={geometryConfig:{geometryType:"arc"}};return t},i.DotPlot=function(){return i.PolyChart()},i.DotPlot.defaultConfig=function(){var t={geometryConfig:{geometryType:"dot",dotType:"circle"}};return t},i.LinePlot=function(){return i.PolyChart()},i.LinePlot.defaultConfig=function(){var t={geometryConfig:{geometryType:"line"}};return t},i.Legend=function(){function t(){var r=e.legendConfig,a=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var a=o({},r.elements[e]);return a.name=t,a.color=[].concat(r.elements[e].color)[n],a})}),i=n.merge(a);i=i.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||"undefined"==typeof r.elements[e].visibleInLegend)}),r.reverseOrder&&(i=i.reverse());var l=r.container;("string"==typeof l||l.nodeName)&&(l=n.select(l));var s=i.map(function(t,e){return t.color}),c=r.fontSize,u=null==r.isContinuous?"number"==typeof i[0]:r.isContinuous,f=u?r.height:c*i.length,d=l.classed("legend-group",!0),h=d.selectAll("svg").data([0]),p=h.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 g=n.range(i.length),m=n.scale[u?"linear":"ordinal"]().domain(g).range(s),v=n.scale[u?"linear":"ordinal"]().domain(g)[u?"range":"rangePoints"]([0,f]),y=function(t,e){var r=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":n.svg.symbolTypes.indexOf(t)!=-1?n.svg.symbol().type(t).size(r)():n.svg.symbol().type("square").size(r)()};if(u){var x=h.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(s);x.enter().append("stop"),x.attr({offset:function(t,e){return e/(s.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),h.append("rect").classed("legend-mark",!0).attr({height:r.height,width:r.colorBandWidth,fill:"url(#grad1)"})}else{var b=h.select(".legend-marks").selectAll("path.legend-mark").data(i);b.enter().append("path").classed("legend-mark",!0),b.attr({transform:function(t,e){return"translate("+[c/2,v(e)+c/2]+")"},d:function(t,e){var r=t.symbol;return y(r,c)},fill:function(t,e){return m(e)}}),b.exit().remove()}var _=n.svg.axis().scale(v).orient("right"),w=h.select("g.legend-axis").attr({transform:"translate("+[u?r.colorBandWidth:c,c/2]+")"}).call(_);return w.selectAll(".domain").style({fill:"none",stroke:"none"}),w.selectAll("line").style({fill:"none",stroke:u?r.textColor:"none"}),w.selectAll("text").style({fill:r.textColor,"font-size":r.fontSize}).text(function(t,e){return i[e].name}),t}var e=i.Legend.defaultConfig(),r=n.dispatch("hover");return t.config=function(t){return arguments.length?(o(e,t),this):e},n.rebind(t,r,"on"),t},i.Legend.defaultConfig=function(t,e){var r={data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}};return r},i.tooltipPanel=function(){var t,e,r,a={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},l="tooltip-"+i.tooltipPanel.uid++,s=10,c=function(){t=a.container.selectAll("g."+l).data([0]);var n=t.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:a.padding+s,dy:.3*+a.fontSize}),c};return c.text=function(o){var i=n.hsl(a.color).l,l=i>=.5?"#aaa":"white",u=i>=.5?"black":"white",f=o||"";e.style({fill:u,"font-size":a.fontSize+"px"}).text(f);var d=a.padding,h=e.node().getBBox(),p={fill:a.color,stroke:l,"stroke-width":"2px"},g=h.width+2*d+s,m=h.height+2*d;return r.attr({d:"M"+[[s,-m/2],[s,-m/4],[a.hasTick?0:s,0],[s,m/4],[s,m/2],[g,m/2],[g,-m/2]].join("L")+"Z"}).style(p),t.attr({transform:"translate("+[s,-m/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 o(a,t),c},c},i.tooltipPanel.uid=1,i.adapter={},i.adapter.plotly=function(){var t={};return t.convert=function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=o({},t),a=[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]];return a.forEach(function(t,r){i.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",n.dotVisible===!0?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var a=i.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=a.indexOf(t.geometry);n!=-1&&(r.data[e].groupId=n)})}if(t.layout){var l=o({},t.layout),s=[[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"]]];if(s.forEach(function(t,r){i.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 c=["t","r","b","l","pad"],u=["top","right","bottom","left","pad"],f={};n.entries(l.margin).forEach(function(t,e){f[u[c.indexOf(t.key)]]=t.value}),l.margin=f}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},t}},{"../../lib":122,d3:14}],178:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),o=t("../../components/color"),i=t("./micropolar"),l=t("./undo_manager"),s=a.extendDeepAll,c=e.exports={};c.framework=function(t){function e(e,a){return a&&(f=a),n.select(n.select(f).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),r=r?s(r,e):e,o||(o=i.Axis()),u=i.adapter.plotly().convert(r),o.config(u).render(f),t.data=r.data,t.layout=r.layout,c.fillLayout(t),r}var r,a,o,u,f,d=new l;return e.isPolar=!0,e.svg=function(){return o.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return i.adapter.plotly().convert(o.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:o.angularScale(),r:o.radialScale()}},e.setUndoPoint=function(){var t=this,e=i.util.cloneJson(r);!function(e,r){d.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,a),a=i.util.cloneJson(e)},e.undo=function(){d.undo()},e.redo=function(){d.redo()},e},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(),i={width:800,height:600,paper_bgcolor:o.background,_container:e,_paperdiv:r,_paper:a};t._fullLayout=s(i,t.layout)}},{"../../components/color":30,"../../lib":122,"./micropolar":177,"./undo_manager":179,d3:14}],179:[function(t,e,r){"use strict";e.exports=function(){function t(t,e){return t?(a=!0,t[e](),a=!1,this):this}var e,r=[],n=-1,a=!1;return{add:function(t){return a?this:(r.splice(n+1,r.length-n),r.push(t),n=r.length-1,this)},setCallback:function(t){e=t},undo:function(){var a=r[n];return a?(t(a,"undo"),n-=1,e&&e(a.undo),this):this},redo:function(){var a=r[n+1];return a?(t(a,"redo"),n+=1,e&&e(a.redo),this):this},clear:function(){r=[],n=-1},hasUndo:function(){return n!==-1},hasRedo:function(){return n=i&&(h.min=0,p.min=0,g.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}var a=t("../../../components/color"),o=t("../../subplot_defaults"),i=t("./layout_attributes"),l=t("./axis_defaults"),s=["aaxis","baxis","caxis"];e.exports=function(t,e,r){o(t,e,r,{type:"ternary",attributes:i,handleDefaults:n,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../../components/color":30,"../../subplot_defaults":180,"./axis_defaults":184,"./layout_attributes":186}],186:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),a=t("./axis_attributes");e.exports={domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},bgcolor:{valType:"color",dflt:n.background},sum:{valType:"number",dflt:1,min:0},aaxis:a,baxis:a,caxis:a}},{"../../../components/color/attributes":29,"./axis_attributes":183}],187:[function(t,e,r){"use strict";function n(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework()}function a(t){o.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}var o=t("d3"),i=t("tinycolor2"),l=t("../../plotly"),s=t("../../lib"),c=t("../../components/color"),u=t("../../components/drawing"),f=t("../cartesian/set_convert"),d=t("../../lib/extend").extendFlat,h=t("../cartesian/axes"),p=t("../../components/dragelement"),g=t("../../components/titles"),m=t("../cartesian/select"),v=t("../cartesian/constants"),y=t("../cartesian/graph_interact");e.exports=n;var x=n.prototype;x.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={}},x.plot=function(t,e){var r,n=this,a=e[n.id],o=e._size;s.getPlotDiv(n.plotContainer.node())!==n.graphDiv&&(n.init(n.graphDiv._fullLayout),n.makeFramework()),n.adjustLayout(a,o);var i=n.traceHash,l={};for(r=0;rb*y?(o=y,a=o*b):(a=v,o=a/b),i=g*a/v,l=m*o/y,r=e.l+e.w*h-a/2,n=e.t+e.h*(1-p)-o/2,s.x0=r,s.y0=n,s.w=a,s.h=o,s.sum=x,s.xaxis={type:"linear",range:[_+2*k-x,x-_-2*w],domain:[h-i/2,h+i/2],_id:"x",_gd:s.graphDiv},f(s.xaxis),s.xaxis.setScale(),s.yaxis={type:"linear",range:[_,x-w-k],domain:[p-l/2,p+l/2],_id:"y",_gd:s.graphDiv},f(s.yaxis),s.yaxis.setScale();var M=s.yaxis.domain[0],A=s.aaxis=d({},t.aaxis,{range:[_,x-w-k],side:"left",_counterangle:30,tickangle:(+t.aaxis.tickangle||0)-30,domain:[M,M+l*b],_axislayer:s.layers.aaxis,_gridlayer:s.layers.agrid,_pos:0,_gd:s.graphDiv,_id:"y",_length:a,_gridpath:"M0,0l"+o+",-"+a/2});f(A);var T=s.baxis=d({},t.baxis,{range:[x-_-k,w],side:"bottom",_counterangle:30,domain:s.xaxis.domain,_axislayer:s.layers.baxis,_gridlayer:s.layers.bgrid,_counteraxis:s.aaxis,_pos:0,_gd:s.graphDiv,_id:"x",_length:a,_gridpath:"M0,0l-"+a/2+",-"+o});f(T),A._counteraxis=T;var L=s.caxis=d({},t.caxis,{range:[x-_-w,k],side:"right",_counterangle:30,tickangle:(+t.caxis.tickangle||0)+30,domain:[M,M+l*b],_axislayer:s.layers.caxis,_gridlayer:s.layers.cgrid,_counteraxis:s.baxis,_pos:0,_gd:s.graphDiv,_id:"y",_length:a,_gridpath:"M0,0l-"+o+","+a/2});f(L);var z="M"+r+","+(n+o)+"h"+a+"l-"+a/2+",-"+o+"Z";s.clipDef.select("path").attr("d",z),s.layers.plotbg.select("path").attr("d",z);var C="translate("+r+","+n+")";s.plotContainer.selectAll(".scatterlayer,.maplayer,.zoom").attr("transform",C);var S="translate("+r+","+(n+o)+")";s.layers.baxis.attr("transform",S),s.layers.bgrid.attr("transform",S);var O="translate("+(r+a/2)+","+n+")rotate(30)";s.layers.aaxis.attr("transform",O),s.layers.agrid.attr("transform",O);var D="translate("+(r+a/2)+","+n+")rotate(-30)";s.layers.caxis.attr("transform",D),s.layers.cgrid.attr("transform",D),s.drawAxes(!0),s.plotContainer.selectAll(".crisp").classed("crisp",!1);var P=s.layers.axlines;P.select(".aline").attr("d",A.showline?"M"+r+","+(n+o)+"l"+a/2+",-"+o:"M0,0").call(c.stroke,A.linecolor||"#000").style("stroke-width",(A.linewidth||0)+"px"),P.select(".bline").attr("d",T.showline?"M"+r+","+(n+o)+"h"+a:"M0,0").call(c.stroke,T.linecolor||"#000").style("stroke-width",(T.linewidth||0)+"px"),P.select(".cline").attr("d",L.showline?"M"+(r+a/2)+","+n+"l"+a/2+","+o:"M0,0").call(c.stroke,L.linecolor||"#000").style("stroke-width",(L.linewidth||0)+"px")},x.drawAxes=function(t){var e=this,r=e.graphDiv,n=e.id.substr(7)+"title",a=e.aaxis,o=e.baxis,i=e.caxis;if(h.doTicks(r,a,!0),h.doTicks(r,o,!0),h.doTicks(r,i,!0),t){var l=Math.max(a.showticklabels?a.tickfont.size/2:0,(i.showticklabels?.75*i.tickfont.size:0)+("outside"===i.ticks?.87*i.ticklen:0));g.draw(r,"a"+n,{propContainer:a,propName:e.id+".aaxis.title",dfltName:"Component A",attributes:{x:e.x0+e.w/2,y:e.y0-a.titlefont.size/3-l,"text-anchor":"middle"}});var s=(o.showticklabels?o.tickfont.size:0)+("outside"===o.ticks?o.ticklen:0)+3;g.draw(r,"b"+n,{propContainer:o,propName:e.id+".baxis.title",dfltName:"Component B",attributes:{x:e.x0-s,y:e.y0+e.h+.83*o.titlefont.size+s,"text-anchor":"middle"}}),g.draw(r,"c"+n,{propContainer:i,propName:e.id+".caxis.title",dfltName:"Component C",attributes:{x:e.x0+e.w+s,y:e.y0+e.h+.83*i.titlefont.size+s,"text-anchor":"middle"}})}};var _=v.MINZOOM/2+.87,w="m-0.87,.5h"+_+"v3h-"+(_+5.2)+"l"+(_/2+2.6)+",-"+(.87*_+4.5)+"l2.6,1.5l-"+_/2+","+.87*_+"Z",k="m0.87,.5h-"+_+"v3h"+(_+5.2)+"l-"+(_/2+2.6)+",-"+(.87*_+4.5)+"l-2.6,1.5l"+_/2+","+.87*_+"Z",M="m0,1l"+_/2+","+.87*_+"l2.6,-1.5l-"+(_/2+2.6)+",-"+(.87*_+4.5)+"l-"+(_/2+2.6)+","+(.87*_+4.5)+"l2.6,1.5l"+_/2+",-"+.87*_+"Z",A="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",T=!0;x.initInteractions=function(){function t(t,e,r){var n=R.getBoundingClientRect();_=e-n.left,L=r-n.top,z={a:I.aaxis.range[0],b:I.baxis.range[1],c:I.caxis.range[1]},S=z,C=I.aaxis.range[1]-z.a,O=i(I.graphDiv._fullLayout[I.id].bgcolor).getLuminance(),D="M0,"+I.h+"L"+I.w/2+", 0L"+I.w+","+I.h+"Z",P=!1,N=j.append("path").attr("class","zoombox").style({fill:O>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",D),E=j.append("path").attr("class","zoombox-corners").style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),g()}function e(t,e){return 1-e/I.h}function r(t,e){return 1-(t+(I.h-e)/Math.sqrt(3))/I.w}function n(t,e){return(t-(I.h-e)/Math.sqrt(3))/I.w}function o(t,a){var o=_+t,i=L+a,l=Math.max(0,Math.min(1,e(_,L),e(o,i))),s=Math.max(0,Math.min(1,r(_,L),r(o,i))),c=Math.max(0,Math.min(1,n(_,L),n(o,i))),u=(l/2+c)*I.w,f=(1-l/2-s)*I.w,d=(u+f)/2,h=f-u,p=(1-l)*I.h,g=p-h/b;h.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),E.transition().style("opacity",1).duration(200),P=!0)}function u(t,e){if(S===z)return 2===e&&x(),a(F);a(F);var r={};r[I.id+".aaxis.min"]=S.a,r[I.id+".baxis.min"]=S.b,r[I.id+".caxis.min"]=S.c,l.relayout(F,r),T&&F.data&&F._context.showTips&&(s.notifier("Double-click to
zoom back out","long"),T=!1)}function f(){z={a:I.aaxis.range[0],b:I.baxis.range[1],c:I.caxis.range[1]},S=z}function d(t,e){var r=t/I.xaxis._m,n=e/I.yaxis._m;S={a:z.a-n,b:z.b+(r+n)/2,c:z.c-(r-n)/2};var a=[S.a,S.b,S.c].sort(),o={a:a.indexOf(S.a),b:a.indexOf(S.b),c:a.indexOf(S.c)};a[0]<0&&(a[1]+a[0]/2<0?(a[2]+=a[0]+a[1],a[0]=a[1]=0):(a[2]+=a[0]/2,a[1]+=a[0]/2,a[0]=0),S={a:a[o.a],b:a[o.b],c:a[o.c]},e=(z.a-S.a)*I.yaxis._m,t=(z.c-S.c-z.b+S.b)*I.xaxis._m);var i="translate("+(I.x0+t)+","+(I.y0+e)+")";I.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",i),I.aaxis.range=[S.a,I.sum-S.b-S.c],I.baxis.range=[I.sum-S.a-S.c,S.b],I.caxis.range=[I.sum-S.a-S.b,S.c],I.drawAxes(!1),I.plotContainer.selectAll(".crisp").classed("crisp",!1)}function h(t,e){if(t){var r={};r[I.id+".aaxis.min"]=S.a,r[I.id+".baxis.min"]=S.b,r[I.id+".caxis.min"]=S.c,l.relayout(F,r)}else 2===e&&x()}function g(){I.plotContainer.selectAll(".select-outline").remove()}function x(){var t={};t[I.id+".aaxis.min"]=0,t[I.id+".baxis.min"]=0,t[I.id+".caxis.min"]=0,F.emit("plotly_doubleclick",null),l.relayout(F,t)}var _,L,z,C,S,O,D,P,N,E,I=this,R=I.layers.plotbg.select("path").node(),F=I.graphDiv,j=I.layers.zoom,q={element:R,gd:F,plotinfo:{plot:j},doubleclick:x,subplot:I.id,prepFn:function(e,r,n){q.xaxes=[I.xaxis],q.yaxes=[I.yaxis];var a=F._fullLayout.dragmode;e.shiftKey&&(a="pan"===a?"zoom":"pan"),"lasso"===a?q.minDrag=1:q.minDrag=void 0,"zoom"===a?(q.moveFn=o,q.doneFn=u,t(e,r,n)):"pan"===a?(q.moveFn=d,q.doneFn=h,f(),g()):"select"!==a&&"lasso"!==a||m(e,r,n,q,a)}};R.onmousemove=function(t){y.hover(F,t,I.id),F._fullLayout._lasthover=R,F._fullLayout._hoversubplot=I.id},R.onmouseout=function(t){F._dragging||p.unhover(F,t)},R.onclick=function(t){y.click(F,t)},p.init(q)}},{"../../components/color":30,"../../components/dragelement":51,"../../components/drawing":53,"../../components/titles":104,"../../lib":122,"../../lib/extend":119,"../../plotly":144,"../cartesian/axes":149, "../cartesian/constants":154,"../cartesian/graph_interact":156,"../cartesian/select":162,"../cartesian/set_convert":163,d3:14,tinycolor2:20}],188:[function(t,e,r){"use strict";function n(t){return"object"==typeof t&&(t=t.type),t}var a=t("./lib"),o=t("./plots/attributes");r.modules={},r.allCategories={},r.allTypes=[],r.subplotsRegistry={},r.transformsRegistry={},r.componentsRegistry={},r.layoutArrayContainers=[],r.register=function(t,e,n,o){if(r.modules[e])return void a.log("Type "+e+" already registered");for(var i={},l=0;l-1}var o=t("../lib"),i=t("../plots/plots"),l=o.extendFlat,s=o.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,o=t.data,c=t.layout,u=s([],o),f=s({},c,n(e.tileClass));if(e.width&&(f.width=e.width),e.height&&(f.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){f.annotations=[];var d=Object.keys(f);for(r=0;r=2?o(t):t>e?Math.ceil(t):Math.floor(t)}var m,v,y,x,b=e.p+(h?d[r]:d),_=b+(g?p[r]:p),w=e.b,k=w+e.s;if("h"===l.orientation?(y=u.c2p(b,!0),x=u.c2p(_,!0),m=c.c2p(w,!0),v=c.c2p(k,!0)):(m=c.c2p(b,!0),v=c.c2p(_,!0),y=u.c2p(w,!0),x=u.c2p(k,!0)),!(a(m)&&a(v)&&a(y)&&a(x)&&m!==v&&y!==x))return void n.select(this).remove();var M=(e.mlw+1||l.marker.line.width+1||(e.trace?e.trace.marker.line.width:0)+1)-1,A=n.round(M/2%1,2);if(!t._context.staticPlot){var T=i.opacity(e.mc||l.marker.color),L=T<1||M>.01?o:s;m=L(m,v),v=L(v,m),y=L(y,x),x=L(x,y)}n.select(this).attr("d","M"+m+","+y+"V"+x+"H"+v+"V"+y+"Z")})}),d.call(l.plot,e)}},{"../../components/color":30,"../../components/errorbars":59,"../../lib":122,"./arrays_to_calcdata":197,d3:14,"fast-isnumeric":17}],206:[function(t,e,r){"use strict";function n(t,e,r,n){if(n.length){var l,s,c,u,f,d=t._fullLayout.barmode,h="overlay"===d,p="group"===d;if(h)a(t,e,r,n);else if(p){for(l=[],s=[],c=0;cs+i&&(c=!0,s=y)),v(e.c2l(g))&&(gs+i&&(c=!0,s=g))}}x.expand(e,[l,s],{tozero:!0,padded:c})}function m(t){return t._id.charAt(0)}var v=t("fast-isnumeric"),y=t("../../registry"),x=t("../../plots/cartesian/axes"),b=t("./sieve.js");e.exports=function(t,e){var r,a=e.xaxis,o=e.yaxis,i=t._fullData,l=t.calcdata,s=[],c=[];for(r=0;r1||0===l.bargap&&0===l.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")}),e.selectAll("g.points").each(function(t){var e=t[0].trace,r=e.marker,i=r.line,l=o.tryColorscale(r,""),s=o.tryColorscale(r,"line");n.select(this).selectAll("path").each(function(t){var e,o,c=(t.mlw+1||i.width+1)-1,u=n.select(this);e="mc"in t?t.mcc=l(t.mc):Array.isArray(r.color)?a.defaultLine:r.color,u.style("stroke-width",c+"px").call(a.fill,e),c&&(o="mlc"in t?t.mlcc=s(t.mlc):Array.isArray(i.color)?a.defaultLine:i.color,u.call(a.stroke,o))})}),e.call(i.style)}},{"../../components/color":30,"../../components/drawing":53,"../../components/errorbars":59,d3:14}],209:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),o=t("../../components/colorscale/defaults");e.exports=function(t,e,r,i,l){r("marker.color",i),a(t,"marker")&&o(t,e,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(t,"marker.line")&&o(t,e,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width")}},{"../../components/color":30,"../../components/colorscale/defaults":39,"../../components/colorscale/has_colorscale":43}],210:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../../components/color/attributes"),o=t("../../lib/extend").extendFlat,i=n.marker,l=i.line;e.exports={y:{valType:"data_array"},x:{valType:"data_array"},x0:{valType:"any"},y0:{valType:"any"},whiskerwidth:{valType:"number",min:0,max:1,dflt:.5},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1},jitter:{valType:"number",min:0,max:1},pointpos:{valType:"number",min:-2,max:2},orientation:{valType:"enumerated",values:["v","h"]},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)"},symbol:o({},i.symbol,{arrayOk:!1}),opacity:o({},i.opacity,{arrayOk:!1,dflt:1}),size:o({},i.size,{arrayOk:!1}),color:o({},i.color,{arrayOk:!1}),line:{color:o({},l.color,{arrayOk:!1,dflt:a.defaultLine}),width:o({},l.width,{arrayOk:!1,dflt:0}),outliercolor:{valType:"color"},outlierwidth:{valType:"number",min:0,dflt:1}}},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2}},fillcolor:n.fillcolor}},{"../../components/color/attributes":29,"../../lib/extend":119,"../scatter/attributes":271}],211:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),o=t("../../plots/cartesian/axes");e.exports=function(t,e){function r(t,e,r,o,i){var l;return r in e?p=o.makeCalcdata(e,r):(l=r+"0"in e?e[r+"0"]:"name"in e&&("category"===o.type||n(e.name)&&["linear","log"].indexOf(o.type)!==-1||a.isDateTime(e.name)&&"date"===o.type)?e.name:t.numboxes,l=o.d2c(l),p=i.map(function(){return l})),p}function i(t,e,r,o,i){var l,s,c,u,f=o.length,d=e.length,h=[],p=[];for(l=0;l=0&&c1,v=r.dPos*(1-d.boxgap)*(1-d.boxgroupgap)/(m?t.numboxes:1),y=m?2*r.dPos*(-.5+(r.boxnum+.5)/t.numboxes)*(1-d.boxgap):0,x=v*g.whiskerwidth;return g.visible!==!0||r.emptybox?void o.select(this).remove():("h"===g.orientation?(s=p,f=h):(s=h,f=p),r.bPos=y,r.bdPos=v,n(),o.select(this).selectAll("path.box").data(i.identity).enter().append("path").attr("class","box").each(function(t){var e=s.c2p(t.pos+y,!0),r=s.c2p(t.pos+y-v,!0),n=s.c2p(t.pos+y+v,!0),a=s.c2p(t.pos+y-x,!0),l=s.c2p(t.pos+y+x,!0),c=f.c2p(t.q1,!0),u=f.c2p(t.q3,!0),d=i.constrain(f.c2p(t.med,!0),Math.min(c,u)+1,Math.max(c,u)-1),h=f.c2p(g.boxpoints===!1?t.min:t.lf,!0),p=f.c2p(g.boxpoints===!1?t.max:t.uf,!0);"h"===g.orientation?o.select(this).attr("d","M"+d+","+r+"V"+n+"M"+c+","+r+"V"+n+"H"+u+"V"+r+"ZM"+c+","+e+"H"+h+"M"+u+","+e+"H"+p+(0===g.whiskerwidth?"":"M"+h+","+a+"V"+l+"M"+p+","+a+"V"+l)):o.select(this).attr("d","M"+r+","+d+"H"+n+"M"+r+","+c+"H"+n+"V"+u+"H"+r+"ZM"+e+","+c+"V"+h+"M"+e+","+u+"V"+p+(0===g.whiskerwidth?"":"M"+a+","+h+"H"+l+"M"+a+","+p+"H"+l))}),g.boxpoints&&o.select(this).selectAll("g.points").data(function(t){return t.forEach(function(t){t.t=r,t.trace=g}),t}).enter().append("g").attr("class","points").selectAll("path").data(function(t){var e,r,n,o,l,s,f,d="all"===g.boxpoints?t.val:t.val.filter(function(e){return et.uf}),h=Math.max((t.max-t.min)/10,t.q3-t.q1),p=1e-9*h,m=h*u,x=[],b=0;if(g.jitter){if(0===h)for(b=1,x=new Array(d.length),e=0;et.lo&&(n.so=!0),n})}).enter().append("path").call(l.translatePoints,h,p),void(g.boxmean&&o.select(this).selectAll("path.mean").data(i.identity).enter().append("path").attr("class","mean").style("fill","none").each(function(t){var e=s.c2p(t.pos+y,!0),r=s.c2p(t.pos+y-v,!0),n=s.c2p(t.pos+y+v,!0),a=f.c2p(t.mean,!0),i=f.c2p(t.mean-t.sd,!0),l=f.c2p(t.mean+t.sd,!0);"h"===g.orientation?o.select(this).attr("d","M"+a+","+r+"V"+n+("sd"!==g.boxmean?"":"m0,0L"+i+","+e+"L"+a+","+r+"L"+l+","+e+"Z")):o.select(this).attr("d","M"+r+","+a+"H"+n+("sd"!==g.boxmean?"":"m0,0L"+e+","+i+"L"+r+","+a+"L"+e+","+l+"Z")); })))})}},{"../../components/drawing":53,"../../lib":122,d3:14}],218:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/cartesian/axes"),o=t("../../lib");e.exports=function(t,e){var r,i,l,s,c=t._fullLayout,u=e.xaxis,f=e.yaxis,d=["v","h"];for(i=0;it?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);if(5===r||10===r){var n=(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4;return t>n?5===r?713:1114:5===r?104:208}return 15===r?0:r}function i(t){var e,r,n,a,i,l,s,c,u,f=t[0].z,d=f.length,h=f[0].length,p=2===d||2===h;for(r=0;r20?(l=C[l][(s[0]||s[1])<0?0:1],t.crossings[i]=S[l]):delete t.crossings[i],s=z[l],!s){_.log("Found bad marching index:",l,e,t.level);break}if(h.push(d(t,e,s)),e[0]+=s[0],e[1]+=s[1],u(h[h.length-1],h[h.length-2])&&h.pop(),i=e.join(","),i===o&&s.join(",")===p||r&&(s[0]&&(e[0]<0||e[0]>m-2)||s[1]&&(e[1]<0||e[1]>g-2)))break;l=t.crossings[i]}1e4===a&&_.log("Infinite loop in contour?");var v,y,x,b,w,k,M,A=u(h[0],h[h.length-1]),T=0,L=.2*t.smoothing,O=[],D=0;for(a=1;a=D;a--)if(v=O[a],v=D&&v+O[y]20&&e?208===t||1114===t?n=0===r[0]?1:-1:a=0===r[1]?1:-1:M.indexOf(t)!==-1?a=1:T.indexOf(t)!==-1?n=1:A.indexOf(t)!==-1?a=-1:n=-1,[n,a]}function u(t,e){return Math.abs(t[0]-e[0])<.01&&Math.abs(t[1]-e[1])<.01}function f(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function d(t,e,r){var n=e[0]+Math.max(r[0],0),a=e[1]+Math.max(r[1],0),o=t.z[a][n],i=t.xaxis,l=t.yaxis;if(r[1]){var s=(t.level-o)/(t.z[a][n+1]-o);return[i.c2p((1-s)*t.x[n]+s*t.x[n+1],!0),l.c2p(t.y[a],!0)]}var c=(t.level-o)/(t.z[a+1][n]-o);return[i.c2p(t.x[n],!0),l.c2p((1-c)*t.y[a]+c*t.y[a+1],!0)]}function h(t,e,r){var n=t.plot.select(".maplayer").selectAll("g.contour."+r).data(e);return n.enter().append("g").classed("contour",!0).classed(r,!0),n.exit().remove(),n}function p(t,e,r){var n=t.selectAll("g.contourbg").data([0]);n.enter().append("g").classed("contourbg",!0);var a=n.selectAll("path").data("fill"===r.coloring?[0]:[]);a.enter().append("path"),a.exit().remove(),a.attr("d","M"+e.join("L")+"Z").style("stroke","none")}function g(t,e,r,n){var a=t.selectAll("g.contourfill").data([0]);a.enter().append("g").classed("contourfill",!0);var o=a.selectAll("path").data("fill"===n.coloring?e:[]);o.enter().append("path"),o.exit().remove(),o.each(function(t){var e=m(t,r);e?b.select(this).attr("d",e).style("stroke","none"):b.select(this).remove()})}function m(t,e){function r(t){return Math.abs(t[1]-e[0][1])<.01}function n(t){return Math.abs(t[1]-e[2][1])<.01}function a(t){return Math.abs(t[0]-e[0][0])<.01}function o(t){return Math.abs(t[0]-e[2][0])<.01}for(var i,l,s,c,u,f,d=t.edgepaths.length||t.z[0][0]=0&&(l=m,c=u):Math.abs(i[1]-l[1])<.01?Math.abs(i[1]-m[1])<.01&&(m[0]-i[0])*(l[0]-m[0])>=0&&(l=m,c=u):_.log("endpt to newendpt is not vert. or horz.",i,l,m)}if(i=l,c>=0)break;d+="L"+l}if(c===t.edgepaths.length){_.log("unclosed perimeter path");break}h=c,g=p.indexOf(h)===-1,g&&(h=p[0],d+="Z")}for(h=0;h1;if(p&&!d&&"category"!==o.type){var g=e.length;if(!(g<=a))return f?e.slice(0,a):e.slice(0,a+1);if(f||h)c=e.slice(0,a);else if(1===a)c=[e[0]-.5,e[0]+.5];else{for(c=[1.5*e[0]-.5*e[1]],s=1;sy;n++)i=s(t,e,o(i));return i>y&&f.log("interp2d didn't converge quickly",i),t}function l(t){var e,r,n,a,o,i,l,s,c=[],u={},f=[],d=t[0],h=[],p=[0,0,0],g=v(t);for(r=0;r=0;o--)a=f[o],r=a[0],n=a[1],i=((u[[r-1,n]]||p)[2]+(u[[r+1,n]]||p)[2]+(u[[r,n-1]]||p)[2]+(u[[r,n+1]]||p)[2])/20,i&&(l[a]=[r,n,i],f.splice(o,1),s=!0);if(!s)throw"findEmpties iterated with no new neighbors";for(a in l)u[a]=l[a],c.push(l[a])}return c.sort(function(t,e){return e[2]-t[2]})}function s(t,e,r){var n,a,o,i,l,s,c,u,f,d,h,p,g,m=0;for(i=0;ip&&(m=Math.max(m,Math.abs(t[a][o]-h)/(g-p))))}return m}var c=t("fast-isnumeric"),u=t("../../registry"),f=t("../../lib"),d=t("../../plots/cartesian/axes"),h=t("../histogram2d/calc"),p=t("../../components/colorscale/calc"),g=t("./has_columns"),m=t("./convert_column_xyz"),v=t("./max_row_length");e.exports=function(t,e){function r(t){z=e._input.zsmooth=e.zsmooth=!1,f.notifier("cannot fast-zsmooth: "+t)}var o,s,c,y,x,b,_,w,k=d.getFromId(t,e.xaxis||"x"),M=d.getFromId(t,e.yaxis||"y"),A=u.traceIs(e,"contour"),T=u.traceIs(e,"histogram"),L=u.traceIs(e,"gl2d"),z=A?"best":e.zsmooth;if(k._minDtick=0,M._minDtick=0,T){var C=h(t,e);o=C.x,s=C.x0,c=C.dx,y=C.y,x=C.y0,b=C.dy,_=C.z}else g(e)&&m(e,k,M),o=e.x?k.makeCalcdata(e,"x"):[],y=e.y?M.makeCalcdata(e,"y"):[],s=e.x0||0,c=e.dx||1,x=e.y0||0,b=e.dy||1,_=n(e),(A||e.connectgaps)&&(e._emptypoints=l(_),e._interpz=i(_,e._emptypoints,e._interpz));if("fast"===z)if("log"===k.type||"log"===M.type)r("log axis found");else if(!T){if(o.length){var S=(o[o.length-1]-o[0])/(o.length-1),O=Math.abs(S/100);for(w=0;wO){r("x scale is not linear");break}}if(y.length&&"fast"===z){var D=(y[y.length-1]-y[0])/(y.length-1),P=Math.abs(D/100);for(w=0;wP){r("y scale is not linear");break}}}var N=v(_),E="scaled"===e.xtype?"":o,I=a(e,E,s,c,N,k),R="scaled"===e.ytype?"":y,F=a(e,R,x,b,_.length,M);L||(d.expand(k,I),d.expand(M,F));var j={x:I,y:F,z:_};if(p(e,_,"","z"),A&&e.contours&&"heatmap"===e.contours.coloring){var q="contour"===e.type?"heatmap":"histogram2d";j.xfill=a(q,E,s,c,N,k),j.yfill=a(q,R,x,b,_.length,M)}return[j]};var y=.01,x=[[-1,0],[1,0],[0,-1],[0,1]]},{"../../components/colorscale/calc":36,"../../lib":122,"../../plots/cartesian/axes":149,"../../registry":188,"../histogram2d/calc":243,"./convert_column_xyz":233,"./has_columns":235,"./max_row_length":238,"fast-isnumeric":17}],232:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),o=t("../../plots/plots"),i=t("../../components/colorscale"),l=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,s="cb"+r.uid,c=r.zmin,u=r.zmax;if(n(c)||(c=a.aggNums(Math.min,null,r.z)),n(u)||(u=a.aggNums(Math.max,null,r.z)),t._fullLayout._infolayer.selectAll("."+s).remove(),!r.showscale)return void o.autoMargin(t,s);var f=e[0].t.cb=l(t,s),d=i.makeColorScaleFunc(i.extractScale(r.colorscale,c,u),{noNumericCheck:!0});f.fillcolor(d).filllevels({start:c,end:u,size:(u-c)/254}).options(r.colorbar)()}},{"../../components/colorbar/draw":33,"../../components/colorscale":44,"../../lib":122,"../../plots/plots":173,"fast-isnumeric":17}],233:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){var a,o=t.x.slice(),i=t.y.slice(),l=t.z,s=t.text,c=Math.min(o.length,i.length,l.length),u=void 0!==s&&!Array.isArray(s[0]);for(c=y[0].length||f<0||f>y.length)return}else{if(n.inbox(e-m[0],e-m[m.length-1])>o||n.inbox(r-v[0],r-v[v.length-1])>o)return;if(l){var w;for(b=[2*m[0]-m[1]],w=1;w0&&o0&&l0;)_=m.c2p(L[A]),A--;for(_0;)M=v.c2p(z[A]),A--;if(M0&&(n=!0);for(var l=0;ly&&g.splice(y,g.length-y),v.length>y&&v.splice(y,v.length-y),!e.autobinx&&"xbins"in e||(e.xbins=a.autoBin(g,p,e.nbinsx,"2d"),"histogram2dcontour"===e.type&&(e.xbins.start=p.c2r(a.tickIncrement(p.r2c(e.xbins.start),e.xbins.size,!0)),e.xbins.end=p.c2r(a.tickIncrement(p.r2c(e.xbins.end),e.xbins.size))),e._input.xbins=e.xbins),!e.autobiny&&"ybins"in e||(e.ybins=a.autoBin(v,m,e.nbinsy,"2d"),"histogram2dcontour"===e.type&&(e.ybins.start=m.c2r(a.tickIncrement(m.r2c(e.ybins.start),e.ybins.size,!0)),e.ybins.end=m.c2r(a.tickIncrement(m.r2c(e.ybins.end),e.ybins.size))),e._input.ybins=e.ybins),d=[];var x,b,_=[],w=[],k="string"==typeof e.xbins.size?[]:e.xbins,M="string"==typeof e.xbins.size?[]:e.ybins,A=0,T=[],L=e.histnorm,z=e.histfunc,C=L.indexOf("density")!==-1,S="max"===z||"min"===z,O=S?null:0,D=o.count,P=i[L],N=!1,E=[],I=[],R="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";R&&"count"!==z&&(N="avg"===z,D=o[z]);var F=e.xbins,j=p.r2c(F.start),q=p.r2c(F.end)+(j-a.tickIncrement(j,F.size))/1e6;for(h=j;h=0&&x=0&&bo)return r[t]=o,o-r[t]}return 0},max:function(t,e,r,a){var o=a[e];if(n(o)){if(o=Number(o),!n(r[t]))return r[t]=o,o;if(r[t]=0&&yR;r--)if(f[r]){F=r;break}for(r=R;r<=F;r++)n(u[r])&&n(f[r])&&I.push({p:u[r],s:f[r],b:0});return I}}},{"../../lib":122,"../../plots/cartesian/axes":149,"./average":251,"./bin_functions":253,"./clean_bins":255,"./norm_functions":258,"fast-isnumeric":17}],255:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib").cleanDate,o=t("../../constants/numerical").ONEDAY;e.exports=function(t,e,r){var i=e.type,l=r+"bins",s=t[l];s||(s=t[l]={});var c="date"===i?function(t){return t||0===t?a(t):null}:function(t){return n(t)?Number(t):null};s.start=c(s.start),s.end=c(s.end);var u="date"===i?o:1,f=s.size;if(n(f))s.size=f>0?Number(f):u;else if("string"!=typeof f)s.size=u;else{var d=f.charAt(0),h=f.substr(1);h=n(h)?Number(h):0,(h<=0||"date"!==i||"M"!==d||h!==Math.round(h))&&(s.size=u)}var p="autobin"+r;"boolean"!=typeof t[p]&&(t[p]=!((s.start||0===s.start)&&(s.end||0===s.end))),t[p]||delete t["nbins"+r]}},{"../../constants/numerical":110,"../../lib":122,"fast-isnumeric":17}],256:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/color"),o=t("./bin_defaults"),i=t("../bar/style_defaults"),l=t("../../components/errorbars/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=u("x"),d=u("y");u("text");var h=u("orientation",d&&!f?"h":"v"),p=e["v"===h?"x":"y"];if(!p||!p.length)return void(e.visible=!1);var g=e["h"===h?"x":"y"];g&&u("histfunc");var m="h"===h?["y"]:["x"];o(t,e,u,m),i(t,e,u,r,c),l(t,e,a.defaultLine,{axis:"y"}),l(t,e,a.defaultLine,{axis:"x",inherit:"y"})}},{"../../components/color":30,"../../components/errorbars/defaults":58,"../../lib":122,"../bar/style_defaults":209,"./attributes":250,"./bin_defaults":252}],257:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.layoutAttributes=t("../bar/layout_attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("../bar/layout_defaults"),n.calc=t("./calc"),n.setPositions=t("../bar/set_positions"),n.plot=t("../bar/plot"),n.style=t("../bar/style"),n.colorbar=t("../scatter/colorbar"),n.hoverPoints=t("../bar/hover"),n.moduleType="trace",n.name="histogram",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","bar","histogram","oriented","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":157,"../bar/hover":201,"../bar/layout_attributes":203,"../bar/layout_defaults":204,"../bar/plot":205,"../bar/set_positions":206,"../bar/style":208,"../scatter/colorbar":274,"./attributes":250,"./calc":254,"./defaults":256}],258:[function(t,e,r){"use strict";e.exports={percent:function(t,e){for(var r=t.length,n=100/e,a=0;a")}return g};var s},{"../../components/color":30,"./helpers":263,"fast-isnumeric":17,tinycolor2:20}],262:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes");e.exports=function(t,e,r,o){function i(r,o){return n.coerce(t,e,a,r,o)}var l=n.coerceFont,s=i("values");if(!Array.isArray(s)||!s.length)return void(e.visible=!1);var c=i("labels");Array.isArray(c)||(i("label0"),i("dlabel"));var u=i("marker.line.width");u&&i("marker.line.color");var f=i("marker.colors");Array.isArray(f)||(e.marker.colors=[]),i("scalegroup");var d=i("text"),h=i("textinfo",Array.isArray(d)?"text+percent":"percent");if(i("hoverinfo",1===o._dataLength?"label+text+value+percent":void 0),h&&"none"!==h){var p=i("textposition"),g=Array.isArray(p)||"auto"===p,m=g||"inside"===p,v=g||"outside"===p;if(m||v){var y=l(i,"textfont",o.font);m&&l(i,"insidetextfont",y),v&&l(i,"outsidetextfont",y)}}i("domain.x"),i("domain.y"),i("hole"),i("sort"),i("direction"),i("rotation"),i("pull")}},{"../../lib":122,"./attributes":259}],263:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return r.lastIndexOf(".")!==-1&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return r.lastIndexOf(".")!==-1&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)}},{"../../lib":122}],264:[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"),n.calc=t("./calc"),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":259,"./base_plot":260,"./calc":261,"./defaults":262,"./layout_attributes":265,"./layout_defaults":266,"./plot":267,"./style":268,"./style_one":269}],265:[function(t,e,r){"use strict";e.exports={hiddenlabels:{valType:"data_array"}}},{}],266:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){function r(r,o){return n.coerce(t,e,a,r,o)}r("hiddenlabels")}},{"../../lib":122,"./layout_attributes":265}],267:[function(t,e,r){"use strict";function n(t,e,r){var n=Math.sqrt(t.width*t.width+t.height*t.height),o=t.width/t.height,i=Math.PI*Math.min(e.v/r.vTotal,.5),l=1-r.trace.hole,s=a(e,r),c={scale:s*r.r*2/n,rCenter:1-s,rotate:0};if(c.scale>=1)return c;var u=o+1/(2*Math.tan(i)),f=r.r*Math.min(1/(Math.sqrt(u*u+.5)+u),l/(Math.sqrt(o*o+l/2)+o)),d={scale:2*f/t.height,rCenter:Math.cos(f/r.r)-f*o/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},h=1/o,p=h+1/(2*Math.tan(i)),g=r.r*Math.min(1/(Math.sqrt(p*p+.5)+p),l/(Math.sqrt(h*h+l/2)+h)),m={scale:2*g/t.width,rCenter:Math.cos(g/r.r)-g/o/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},v=m.scale>d.scale?m:d;return c.scale<1&&v.scale>c.scale?v:c}function a(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 o(t,e){var r=e.pxmid[0],n=e.pxmid[1],a=t.width/2,o=t.height/2;return r<0&&(a*=-1),n<0&&(o*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(o)*(a>0?1:-1)/2,y:o/(1+r*r/(n*n)),outside:!0}}function i(t,e){function r(t,e){return t.pxmid[1]-e.pxmid[1]}function n(t,e){return e.pxmid[1]-t.pxmid[1]}function a(t,r){r||(r={});var n,a,o,l,d,h,g=r.labelExtraY+(i?r.yLabelMax:r.yLabelMin),m=i?t.yLabelMin:t.yLabelMax,v=i?t.yLabelMax:t.yLabelMin,y=t.cyFinal+c(t.px0[1],t.px1[1]),x=g-m;if(x*f>0&&(t.labelExtraY=x),Array.isArray(e.pull))for(a=0;a=e.pull[o.i]||((t.pxmid[1]-o.pxmid[1])*f>0?(l=o.cyFinal+c(o.px0[1],o.px1[1]),x=l-m-t.labelExtraY,x*f>0&&(t.labelExtraY+=x)):(v+t.labelExtraY-y)*f>0&&(n=3*u*Math.abs(a-p.indexOf(t)),d=o.cxFinal+s(o.px0[0],o.px1[0]),h=d+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX,h*u>0&&(t.labelExtraX+=h)))}var o,i,l,s,c,u,f,d,h,p,g,m,v;for(i=0;i<2;i++)for(l=i?r:n,c=i?Math.max:Math.min,f=i?1:-1,o=0;o<2;o++){for(s=o?Math.max:Math.min,u=o?1:-1,d=t[i][o],d.sort(l),h=t[1-i][o],p=h.concat(d),m=[],g=0;gu&&(u=l.pull[o]);i.r=Math.min(r/c(l.tilt,Math.sin(s),l.depth),n/c(l.tilt,Math.cos(s),l.depth))/(2+2*u),i.cx=e.l+e.w*(l.domain.x[1]+l.domain.x[0])/2,i.cy=e.t+e.h*(2-l.domain.y[1]-l.domain.y[0])/2,l.scalegroup&&h.indexOf(l.scalegroup)===-1&&h.push(l.scalegroup)}for(o=0;of.vTotal/2?1:0)}function c(t,e,r){if(!t)return 1;var n=Math.sin(t*Math.PI/180);return Math.max(.01,r*n*Math.abs(e)+2*Math.sqrt(1-n*n*e*e))}var u=t("d3"),f=t("../../plots/cartesian/graph_interact"),d=t("../../components/color"),h=t("../../components/drawing"),p=t("../../lib/svg_text_utils"),g=t("./helpers");e.exports=function(t,e){var r=t._fullLayout;l(e,r._size);var c=r._pielayer.selectAll("g.trace").data(e);c.enter().append("g").attr({"stroke-linejoin":"round",class:"trace"}),c.exit().remove(),c.order(),c.each(function(e){var l=u.select(this),c=e[0],m=c.trace,v=0,y=(m.depth||0)*c.r*Math.sin(v)/2,x=m.tiltaxis||0,b=x*Math.PI/180,_=[y*Math.sin(b),y*Math.cos(b)],w=c.r*Math.cos(v),k=l.selectAll("g.part").data(m.tilt?["top","sides"]:["top"]);k.enter().append("g").attr("class",function(t){return t+" part"}),k.exit().remove(),k.order(),s(e),l.selectAll(".top").each(function(){var l=u.select(this).selectAll("g.slice").data(e);l.enter().append("g").classed("slice",!0),l.exit().remove();var s=[[[],[]],[[],[]]],v=!1;l.each(function(i){function l(e){var n=t._fullLayout,o=t._fullData[m.index],l=o.hoverinfo;if("all"===l&&(l="label+text+value+percent+name"),!t._dragging&&n.hovermode!==!1&&"none"!==l&&"skip"!==l&&l){var s=a(i,c),u=k+i.pxmid[0]*(1-s),d=M+i.pxmid[1]*(1-s),h=r.separators,p=[];l.indexOf("label")!==-1&&p.push(i.label),o.text&&o.text[i.i]&&l.indexOf("text")!==-1&&p.push(o.text[i.i]),l.indexOf("value")!==-1&&p.push(g.formatPieValue(i.v,h)),l.indexOf("percent")!==-1&&p.push(g.formatPiePercent(i.v/c.vTotal,h)),f.loneHover({x0:u-s*c.r,x1:u+s*c.r,y:d,text:p.join("
"),name:l.indexOf("name")!==-1?o.name:void 0,color:i.color,idealAlign:i.pxmid[0]<0?"left":"right"},{container:n._hoverlayer.node(),outerContainer:n._paper.node()}),f.hover(t,e,"pie"),L=!0}}function d(e){t.emit("plotly_unhover",{points:[e]}),L&&(f.loneUnhover(r._hoverlayer.node()),L=!1)}function y(){t._hoverdata=[i],i.curveNumber=e[0].trace.index,t._hoverdata.trace=e[0].trace,f.click(t,{target:!0})}function b(t,e,r,n){return"a"+n*c.r+","+n*w+" "+x+" "+i.largeArc+(r?" 1 ":" 0 ")+n*(e[0]-t[0])+","+n*(e[1]-t[1])}if(i.hidden)return void u.select(this).selectAll("path,g").remove();s[i.pxmid[1]<0?0:1][i.pxmid[0]<0?0:1].push(i);var k=c.cx+_[0],M=c.cy+_[1],A=u.select(this),T=A.selectAll("path.surface").data([i]),L=!1;if(T.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),A.select("path.textline").remove(),A.on("mouseover",l).on("mouseout",d).on("click",y).on("contextmenu",y),m.pull){var z=+(Array.isArray(m.pull)?m.pull[i.i]:m.pull)||0;z>0&&(k+=z*i.pxmid[0],M+=z*i.pxmid[1])}i.cxFinal=k,i.cyFinal=M;var C=m.hole;if(i.v===c.vTotal){var S="M"+(k+i.px0[0])+","+(M+i.px0[1])+b(i.px0,i.pxmid,!0,1)+b(i.pxmid,i.px0,!0,1)+"Z";C?T.attr("d","M"+(k+C*i.px0[0])+","+(M+C*i.px0[1])+b(i.px0,i.pxmid,!1,C)+b(i.pxmid,i.px0,!1,C)+"Z"+S):T.attr("d",S)}else{var O=b(i.px0,i.px1,!0,1);if(C){var D=1-C;T.attr("d","M"+(k+C*i.px1[0])+","+(M+C*i.px1[1])+b(i.px1,i.px0,!1,C)+"l"+D*i.px0[0]+","+D*i.px0[1]+O+"Z")}else T.attr("d","M"+k+","+M+"l"+i.px0[0]+","+i.px0[1]+O+"Z")}var P=Array.isArray(m.textposition)?m.textposition[i.i]:m.textposition,N=A.selectAll("g.slicetext").data(i.text&&"none"!==P?[0]:[]);N.enter().append("g").classed("slicetext",!0),N.exit().remove(),N.each(function(){var t=u.select(this).selectAll("text").data([0]);t.enter().append("text").attr("data-notex",1),t.exit().remove(),t.text(i.text).attr({class:"slicetext",transform:"","data-bb":"","text-anchor":"middle",x:0,y:0}).call(h.font,"outside"===P?m.outsidetextfont:m.insidetextfont).call(p.convertToTspans),t.selectAll("tspan.line").attr({x:0,y:0});var e,r=h.bBox(t.node());"outside"===P?e=o(r,i):(e=n(r,i,c),"auto"===P&&e.scale<1&&(t.call(h.font,m.outsidetextfont),m.outsidetextfont.family===m.insidetextfont.family&&m.outsidetextfont.size===m.insidetextfont.size||(t.attr({"data-bb":""}),r=h.bBox(t.node())),e=o(r,i)));var a=k+i.pxmid[0]*e.rCenter+(e.x||0),l=M+i.pxmid[1]*e.rCenter+(e.y||0);e.outside&&(i.yLabelMin=l-r.height/2,i.yLabelMid=l,i.yLabelMax=l+r.height/2,i.labelExtraX=0,i.labelExtraY=0,v=!0),t.attr("transform","translate("+a+","+l+")"+(e.scale<1?"scale("+e.scale+")":"")+(e.rotate?"rotate("+e.rotate+")":"")+"translate("+-(r.left+r.right)/2+","+-(r.top+r.bottom)/2+")")})}),v&&i(s,m),l.each(function(t){if(t.labelExtraX||t.labelExtraY){var e=u.select(this),r=e.select("g.slicetext text");r.attr("transform","translate("+t.labelExtraX+","+t.labelExtraY+")"+r.attr("transform"));var n=t.cxFinal+t.pxmid[0],a=t.cyFinal+t.pxmid[1],o="M"+n+","+a,i=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var l=t.labelExtraX*t.pxmid[1]/t.pxmid[0],s=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);o+=Math.abs(l)>Math.abs(s)?"l"+s*t.pxmid[0]/t.pxmid[1]+","+s+"H"+(n+t.labelExtraX+i):"l"+t.labelExtraX+","+l+"v"+(s-l)+"h"+i}else o+="V"+(t.yLabelMid+t.labelExtraY)+"h"+i;e.append("path").classed("textline",!0).call(d.stroke,m.outsidetextfont.color).attr({"stroke-width":Math.min(2,m.outsidetextfont.size/8),d:o,fill:"none"})}})})}),setTimeout(function(){c.selectAll("tspan").each(function(){var t=u.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{"../../components/color":30,"../../components/drawing":53,"../../lib/svg_text_utils":134,"../../plots/cartesian/graph_interact":156,"./helpers":263,d3:14}],268:[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],r=e.trace,o=n.select(this);o.style({opacity:r.opacity}),o.selectAll(".top path.surface").each(function(t){n.select(this).call(a,t,r)})})}},{"./style_one":269,d3:14}],269:[function(t,e,r){"use strict";var n=t("../../components/color");e.exports=function(t,e,r){var a=r.marker.line.color;Array.isArray(a)&&(a=a[e.i]||n.defaultLine);var o=r.marker.line.width||0;Array.isArray(o)&&(o=o[e.i]||0),t.style({"stroke-width":o,fill:e.color}).call(n.stroke,a)}},{"../../components/color":30}],270:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){var e=t[0].trace,r=e.marker;if(n.mergeArray(e.text,t,"tx"),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")),r&&r.line){var a=r.line;n.mergeArray(r.opacity,t,"mo"),n.mergeArray(r.symbol,t,"mx"),n.mergeArray(r.color,t,"mc"),n.mergeArray(a.color,t,"mlc"),n.mergeArray(a.width,t,"mlw")}}},{"../../lib":122}],271:[function(t,e,r){"use strict";var n=t("../../components/colorscale/color_attributes"),a=t("../../components/errorbars/attributes"),o=t("../../components/colorbar/attributes"),i=t("../../components/drawing"),l=(t("./constants"),t("../../lib/extend").extendFlat);e.exports={x:{valType:"data_array"},x0:{valType:"any",dflt:0},dx:{valType:"number",dflt:1},y:{valType:"data_array"},y0:{valType:"any",dflt:0},dy:{valType:"number",dflt:1},ids:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},hoveron:{valType:"flaglist",flags:["points","fills"]},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear"},smoothing:{valType:"number",min:0,max:1.3,dflt:1},dash:{valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid"},simplify:{valType:"boolean",dflt:!0}},connectgaps:{valType:"boolean",dflt:!1},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],dflt:"none"},fillcolor:{valType:"color"},marker:l({},{symbol:{valType:"enumerated",values:i.symbolList,dflt:"circle",arrayOk:!0},opacity:{valType:"number",min:0,max:1,arrayOk:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0},maxdisplayed:{valType:"number",min:0,dflt:0},sizeref:{valType:"number",dflt:1},sizemin:{valType:"number",min:0,dflt:0},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter"},showscale:{valType:"boolean",dflt:!1},colorbar:o,line:l({},{width:{valType:"number",min:0,arrayOk:!0}},n("marker.line"))},n("marker")),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0},textfont:{family:{valType:"string",noBlank:!0,strict:!0,arrayOk:!0},size:{valType:"number",min:1,arrayOk:!0},color:{valType:"color",arrayOk:!0}},r:{valType:"data_array"},t:{valType:"data_array"},error_y:a,error_x:a}},{"../../components/colorbar/attributes":31,"../../components/colorscale/color_attributes":37,"../../components/drawing":53,"../../components/errorbars/attributes":55,"../../lib/extend":119,"./constants":276}],272:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../plots/cartesian/axes"),o=t("../../lib"),i=t("./subtypes"),l=t("./colorscale_calc");e.exports=function(t,e){var r,s,c,u=a.getFromId(t,e.xaxis||"x"),f=a.getFromId(t,e.yaxis||"y"),d=u.makeCalcdata(e,"x"),h=f.makeCalcdata(e,"y"),p=Math.min(d.length,h.length);u._minDtick=0,f._minDtick=0,d.length>p&&d.splice(p,d.length-p),h.length>p&&h.splice(p,h.length-p);var g={padded:!0},m={padded:!0};if(i.hasMarkers(e)){if(r=e.marker,s=r.size,Array.isArray(s)){var v={type:"linear"};a.setConvert(v),s=v.makeCalcdata(e.marker,"size"),s.length>p&&s.splice(p,s.length-p)}var y,x=1.6*(e.marker.sizeref||1);y="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/x),3)}:function(t){return Math.max((t||0)/x,3)},g.ppad=m.ppad=Array.isArray(s)?s.map(y):y(s)}l(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||d[0]===d[p-1]&&h[0]===h[p-1]?e.error_y.visible||["tonexty","tozeroy"].indexOf(e.fill)===-1&&(i.hasMarkers(e)||i.hasText(e))||(g.padded=!1,g.ppad=0):g.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||d[0]===d[p-1]&&h[0]===h[p-1]?["tonextx","tozerox"].indexOf(e.fill)!==-1&&(m.padded=!1):m.tozero=!0,a.expand(u,d,g),a.expand(f,h,m);var b=new Array(p);for(c=0;c=0;a--){var o=t[a];if("scatter"===o.type&&o.xaxis===r.xaxis&&o.yaxis===r.yaxis){o.opacity=void 0;break}}}}}},{}],274:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),o=t("../../plots/plots"),i=t("../../components/colorscale"),l=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,s=r.marker,c="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+c).remove(),void 0===s||!s.showscale)return void o.autoMargin(t,c);var u=s.color,f=s.cmin,d=s.cmax;n(f)||(f=a.aggNums(Math.min,null,u)),n(d)||(d=a.aggNums(Math.max,null,u));var h=e[0].t.cb=l(t,c),p=i.makeColorScaleFunc(i.extractScale(s.colorscale,f,d),{noNumericCheck:!0});h.fillcolor(p).filllevels({start:f,end:d,size:(d-f)/254}).options(s.colorbar)()}},{"../../components/colorbar/draw":33,"../../components/colorscale":44,"../../lib":122,"../../plots/plots":173,"fast-isnumeric":17}],275:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/calc"),o=t("./subtypes");e.exports=function(t){o.hasLines(t)&&n(t,"line")&&a(t,t.line.color,"line","c"),o.hasMarkers(t)&&(n(t,"marker")&&a(t,t.marker.color,"marker","c"),n(t,"marker.line")&&a(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":36,"../../components/colorscale/has_colorscale":43,"./subtypes":291}],276:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20}},{}],277:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),o=t("./constants"),i=t("./subtypes"),l=t("./xy_defaults"),s=t("./marker_defaults"),c=t("./line_defaults"),u=t("./line_shape_defaults"),f=t("./text_defaults"),d=t("./fillcolor_defaults"),h=t("../../components/errorbars/defaults");e.exports=function(t,e,r,p){function g(r,o){return n.coerce(t,e,a,r,o)}var m=l(t,e,g),v=m=0&&x=0&&bo)return r[t]=o,o-r[t]}return 0},max:function(t,e,r,a){var o=a[e];if(n(o)){if(o=Number(o),!n(r[t]))return r[t]=o,o;if(r[t]=0&&yR;r--)if(f[r]){F=r;break}for(r=R;r<=F;r++)n(u[r])&&n(f[r])&&I.push({p:u[r],s:f[r],b:0});return I}}},{"../../lib":122,"../../plots/cartesian/axes":149,"./average":251,"./bin_functions":253,"./clean_bins":255,"./norm_functions":258,"fast-isnumeric":17}],255:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib").cleanDate,o=t("../../constants/numerical").ONEDAY;e.exports=function(t,e,r){var i=e.type,l=r+"bins",s=t[l];s||(s=t[l]={});var c="date"===i?function(t){return t||0===t?a(t):null}:function(t){return n(t)?Number(t):null};s.start=c(s.start),s.end=c(s.end);var u="date"===i?o:1,f=s.size;if(n(f))s.size=f>0?Number(f):u;else if("string"!=typeof f)s.size=u;else{var d=f.charAt(0),h=f.substr(1);h=n(h)?Number(h):0,(h<=0||"date"!==i||"M"!==d||h!==Math.round(h))&&(s.size=u)}var p="autobin"+r;"boolean"!=typeof t[p]&&(t[p]=!((s.start||0===s.start)&&(s.end||0===s.end))),t[p]||delete t["nbins"+r]}},{"../../constants/numerical":110,"../../lib":122,"fast-isnumeric":17}],256:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/color"),o=t("./bin_defaults"),i=t("../bar/style_defaults"),l=t("../../components/errorbars/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=u("x"),d=u("y");u("text");var h=u("orientation",d&&!f?"h":"v"),p=e["v"===h?"x":"y"];if(!p||!p.length)return void(e.visible=!1);var g=e["h"===h?"x":"y"];g&&u("histfunc");var m="h"===h?["y"]:["x"];o(t,e,u,m),i(t,e,u,r,c),l(t,e,a.defaultLine,{axis:"y"}),l(t,e,a.defaultLine,{axis:"x",inherit:"y"})}},{"../../components/color":30,"../../components/errorbars/defaults":58,"../../lib":122,"../bar/style_defaults":209,"./attributes":250,"./bin_defaults":252}],257:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.layoutAttributes=t("../bar/layout_attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("../bar/layout_defaults"),n.calc=t("./calc"),n.setPositions=t("../bar/set_positions"),n.plot=t("../bar/plot"),n.style=t("../bar/style"),n.colorbar=t("../scatter/colorbar"),n.hoverPoints=t("../bar/hover"),n.moduleType="trace",n.name="histogram",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","bar","histogram","oriented","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":157,"../bar/hover":201,"../bar/layout_attributes":203,"../bar/layout_defaults":204,"../bar/plot":205,"../bar/set_positions":206,"../bar/style":208,"../scatter/colorbar":274,"./attributes":250,"./calc":254,"./defaults":256}],258:[function(t,e,r){"use strict";e.exports={percent:function(t,e){for(var r=t.length,n=100/e,a=0;a")}return g};var s},{"../../components/color":30,"./helpers":263,"fast-isnumeric":17,tinycolor2:20}],262:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes");e.exports=function(t,e,r,o){function i(r,o){return n.coerce(t,e,a,r,o)}var l=n.coerceFont,s=i("values");if(!Array.isArray(s)||!s.length)return void(e.visible=!1);var c=i("labels");Array.isArray(c)||(i("label0"),i("dlabel"));var u=i("marker.line.width");u&&i("marker.line.color");var f=i("marker.colors");Array.isArray(f)||(e.marker.colors=[]),i("scalegroup");var d=i("text"),h=i("textinfo",Array.isArray(d)?"text+percent":"percent");if(i("hoverinfo",1===o._dataLength?"label+text+value+percent":void 0),h&&"none"!==h){var p=i("textposition"),g=Array.isArray(p)||"auto"===p,m=g||"inside"===p,v=g||"outside"===p;if(m||v){var y=l(i,"textfont",o.font);m&&l(i,"insidetextfont",y),v&&l(i,"outsidetextfont",y)}}i("domain.x"),i("domain.y"),i("hole"),i("sort"),i("direction"),i("rotation"),i("pull")}},{"../../lib":122,"./attributes":259}],263:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return r.lastIndexOf(".")!==-1&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return r.lastIndexOf(".")!==-1&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)}},{"../../lib":122}],264:[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"),n.calc=t("./calc"),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":259,"./base_plot":260,"./calc":261,"./defaults":262,"./layout_attributes":265,"./layout_defaults":266,"./plot":267,"./style":268,"./style_one":269}],265:[function(t,e,r){"use strict";e.exports={hiddenlabels:{valType:"data_array"}}},{}],266:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){function r(r,o){return n.coerce(t,e,a,r,o)}r("hiddenlabels")}},{"../../lib":122,"./layout_attributes":265}],267:[function(t,e,r){"use strict";function n(t,e,r){var n=Math.sqrt(t.width*t.width+t.height*t.height),o=t.width/t.height,i=Math.PI*Math.min(e.v/r.vTotal,.5),l=1-r.trace.hole,s=a(e,r),c={scale:s*r.r*2/n,rCenter:1-s,rotate:0};if(c.scale>=1)return c;var u=o+1/(2*Math.tan(i)),f=r.r*Math.min(1/(Math.sqrt(u*u+.5)+u),l/(Math.sqrt(o*o+l/2)+o)),d={scale:2*f/t.height,rCenter:Math.cos(f/r.r)-f*o/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},h=1/o,p=h+1/(2*Math.tan(i)),g=r.r*Math.min(1/(Math.sqrt(p*p+.5)+p),l/(Math.sqrt(h*h+l/2)+h)),m={scale:2*g/t.width,rCenter:Math.cos(g/r.r)-g/o/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},v=m.scale>d.scale?m:d;return c.scale<1&&v.scale>c.scale?v:c}function a(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 o(t,e){var r=e.pxmid[0],n=e.pxmid[1],a=t.width/2,o=t.height/2;return r<0&&(a*=-1),n<0&&(o*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(o)*(a>0?1:-1)/2,y:o/(1+r*r/(n*n)),outside:!0}}function i(t,e){function r(t,e){return t.pxmid[1]-e.pxmid[1]}function n(t,e){return e.pxmid[1]-t.pxmid[1]}function a(t,r){r||(r={});var n,a,o,l,d,h,g=r.labelExtraY+(i?r.yLabelMax:r.yLabelMin),m=i?t.yLabelMin:t.yLabelMax,v=i?t.yLabelMax:t.yLabelMin,y=t.cyFinal+c(t.px0[1],t.px1[1]),x=g-m;if(x*f>0&&(t.labelExtraY=x),Array.isArray(e.pull))for(a=0;a=e.pull[o.i]||((t.pxmid[1]-o.pxmid[1])*f>0?(l=o.cyFinal+c(o.px0[1],o.px1[1]),x=l-m-t.labelExtraY,x*f>0&&(t.labelExtraY+=x)):(v+t.labelExtraY-y)*f>0&&(n=3*u*Math.abs(a-p.indexOf(t)),d=o.cxFinal+s(o.px0[0],o.px1[0]),h=d+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX,h*u>0&&(t.labelExtraX+=h)))}var o,i,l,s,c,u,f,d,h,p,g,m,v;for(i=0;i<2;i++)for(l=i?r:n,c=i?Math.max:Math.min,f=i?1:-1,o=0;o<2;o++){for(s=o?Math.max:Math.min,u=o?1:-1,d=t[i][o],d.sort(l),h=t[1-i][o],p=h.concat(d),m=[],g=0;gu&&(u=l.pull[o]);i.r=Math.min(r/c(l.tilt,Math.sin(s),l.depth),n/c(l.tilt,Math.cos(s),l.depth))/(2+2*u),i.cx=e.l+e.w*(l.domain.x[1]+l.domain.x[0])/2,i.cy=e.t+e.h*(2-l.domain.y[1]-l.domain.y[0])/2,l.scalegroup&&h.indexOf(l.scalegroup)===-1&&h.push(l.scalegroup)}for(o=0;of.vTotal/2?1:0)}function c(t,e,r){if(!t)return 1;var n=Math.sin(t*Math.PI/180);return Math.max(.01,r*n*Math.abs(e)+2*Math.sqrt(1-n*n*e*e))}var u=t("d3"),f=t("../../plots/cartesian/graph_interact"),d=t("../../components/color"),h=t("../../components/drawing"),p=t("../../lib/svg_text_utils"),g=t("./helpers");e.exports=function(t,e){var r=t._fullLayout;l(e,r._size);var c=r._pielayer.selectAll("g.trace").data(e);c.enter().append("g").attr({"stroke-linejoin":"round",class:"trace"}),c.exit().remove(),c.order(),c.each(function(e){var l=u.select(this),c=e[0],m=c.trace,v=0,y=(m.depth||0)*c.r*Math.sin(v)/2,x=m.tiltaxis||0,b=x*Math.PI/180,_=[y*Math.sin(b),y*Math.cos(b)],w=c.r*Math.cos(v),k=l.selectAll("g.part").data(m.tilt?["top","sides"]:["top"]);k.enter().append("g").attr("class",function(t){return t+" part"}),k.exit().remove(),k.order(),s(e),l.selectAll(".top").each(function(){var l=u.select(this).selectAll("g.slice").data(e);l.enter().append("g").classed("slice",!0),l.exit().remove();var s=[[[],[]],[[],[]]],v=!1;l.each(function(i){function l(e){var n=t._fullLayout,o=t._fullData[m.index],l=o.hoverinfo;if("all"===l&&(l="label+text+value+percent+name"),!t._dragging&&n.hovermode!==!1&&"none"!==l&&"skip"!==l&&l){var s=a(i,c),u=k+i.pxmid[0]*(1-s),d=M+i.pxmid[1]*(1-s),h=r.separators,p=[];l.indexOf("label")!==-1&&p.push(i.label),o.text&&o.text[i.i]&&l.indexOf("text")!==-1&&p.push(o.text[i.i]),l.indexOf("value")!==-1&&p.push(g.formatPieValue(i.v,h)),l.indexOf("percent")!==-1&&p.push(g.formatPiePercent(i.v/c.vTotal,h)),f.loneHover({x0:u-s*c.r,x1:u+s*c.r,y:d,text:p.join("
"),name:l.indexOf("name")!==-1?o.name:void 0,color:i.color,idealAlign:i.pxmid[0]<0?"left":"right"},{container:n._hoverlayer.node(),outerContainer:n._paper.node()}),f.hover(t,e,"pie"),L=!0}}function d(e){t.emit("plotly_unhover",{points:[e]}),L&&(f.loneUnhover(r._hoverlayer.node()),L=!1)}function y(){t._hoverdata=[i],i.curveNumber=e[0].trace.index,t._hoverdata.trace=e[0].trace,f.click(t,window.event||{target:!0})}function b(t,e,r,n){return"a"+n*c.r+","+n*w+" "+x+" "+i.largeArc+(r?" 1 ":" 0 ")+n*(e[0]-t[0])+","+n*(e[1]-t[1])}if(i.hidden)return void u.select(this).selectAll("path,g").remove();s[i.pxmid[1]<0?0:1][i.pxmid[0]<0?0:1].push(i);var k=c.cx+_[0],M=c.cy+_[1],A=u.select(this),T=A.selectAll("path.surface").data([i]),L=!1;if(T.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),A.select("path.textline").remove(),A.on("mouseover",l).on("mouseout",d).on("click",y).on("contextmenu",y),m.pull){var z=+(Array.isArray(m.pull)?m.pull[i.i]:m.pull)||0;z>0&&(k+=z*i.pxmid[0],M+=z*i.pxmid[1])}i.cxFinal=k,i.cyFinal=M;var C=m.hole;if(i.v===c.vTotal){var S="M"+(k+i.px0[0])+","+(M+i.px0[1])+b(i.px0,i.pxmid,!0,1)+b(i.pxmid,i.px0,!0,1)+"Z";C?T.attr("d","M"+(k+C*i.px0[0])+","+(M+C*i.px0[1])+b(i.px0,i.pxmid,!1,C)+b(i.pxmid,i.px0,!1,C)+"Z"+S):T.attr("d",S)}else{var O=b(i.px0,i.px1,!0,1);if(C){var D=1-C;T.attr("d","M"+(k+C*i.px1[0])+","+(M+C*i.px1[1])+b(i.px1,i.px0,!1,C)+"l"+D*i.px0[0]+","+D*i.px0[1]+O+"Z")}else T.attr("d","M"+k+","+M+"l"+i.px0[0]+","+i.px0[1]+O+"Z")}var P=Array.isArray(m.textposition)?m.textposition[i.i]:m.textposition,N=A.selectAll("g.slicetext").data(i.text&&"none"!==P?[0]:[]);N.enter().append("g").classed("slicetext",!0),N.exit().remove(),N.each(function(){var t=u.select(this).selectAll("text").data([0]);t.enter().append("text").attr("data-notex",1),t.exit().remove(),t.text(i.text).attr({class:"slicetext",transform:"","data-bb":"","text-anchor":"middle",x:0,y:0}).call(h.font,"outside"===P?m.outsidetextfont:m.insidetextfont).call(p.convertToTspans),t.selectAll("tspan.line").attr({x:0,y:0});var e,r=h.bBox(t.node());"outside"===P?e=o(r,i):(e=n(r,i,c),"auto"===P&&e.scale<1&&(t.call(h.font,m.outsidetextfont),m.outsidetextfont.family===m.insidetextfont.family&&m.outsidetextfont.size===m.insidetextfont.size||(t.attr({"data-bb":""}),r=h.bBox(t.node())),e=o(r,i)));var a=k+i.pxmid[0]*e.rCenter+(e.x||0),l=M+i.pxmid[1]*e.rCenter+(e.y||0);e.outside&&(i.yLabelMin=l-r.height/2,i.yLabelMid=l,i.yLabelMax=l+r.height/2,i.labelExtraX=0,i.labelExtraY=0,v=!0),t.attr("transform","translate("+a+","+l+")"+(e.scale<1?"scale("+e.scale+")":"")+(e.rotate?"rotate("+e.rotate+")":"")+"translate("+-(r.left+r.right)/2+","+-(r.top+r.bottom)/2+")")})}),v&&i(s,m),l.each(function(t){if(t.labelExtraX||t.labelExtraY){var e=u.select(this),r=e.select("g.slicetext text");r.attr("transform","translate("+t.labelExtraX+","+t.labelExtraY+")"+r.attr("transform"));var n=t.cxFinal+t.pxmid[0],a=t.cyFinal+t.pxmid[1],o="M"+n+","+a,i=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var l=t.labelExtraX*t.pxmid[1]/t.pxmid[0],s=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);o+=Math.abs(l)>Math.abs(s)?"l"+s*t.pxmid[0]/t.pxmid[1]+","+s+"H"+(n+t.labelExtraX+i):"l"+t.labelExtraX+","+l+"v"+(s-l)+"h"+i}else o+="V"+(t.yLabelMid+t.labelExtraY)+"h"+i;e.append("path").classed("textline",!0).call(d.stroke,m.outsidetextfont.color).attr({"stroke-width":Math.min(2,m.outsidetextfont.size/8),d:o,fill:"none"})}})})}),setTimeout(function(){c.selectAll("tspan").each(function(){var t=u.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{"../../components/color":30,"../../components/drawing":53,"../../lib/svg_text_utils":134,"../../plots/cartesian/graph_interact":156,"./helpers":263,d3:14}],268:[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],r=e.trace,o=n.select(this);o.style({opacity:r.opacity}),o.selectAll(".top path.surface").each(function(t){n.select(this).call(a,t,r)})})}},{"./style_one":269,d3:14}],269:[function(t,e,r){"use strict";var n=t("../../components/color");e.exports=function(t,e,r){var a=r.marker.line.color;Array.isArray(a)&&(a=a[e.i]||n.defaultLine);var o=r.marker.line.width||0;Array.isArray(o)&&(o=o[e.i]||0),t.style({"stroke-width":o,fill:e.color}).call(n.stroke,a)}},{"../../components/color":30}],270:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){var e=t[0].trace,r=e.marker;if(n.mergeArray(e.text,t,"tx"),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")),r&&r.line){var a=r.line;n.mergeArray(r.opacity,t,"mo"),n.mergeArray(r.symbol,t,"mx"),n.mergeArray(r.color,t,"mc"),n.mergeArray(a.color,t,"mlc"),n.mergeArray(a.width,t,"mlw")}}},{"../../lib":122}],271:[function(t,e,r){"use strict";var n=t("../../components/colorscale/color_attributes"),a=t("../../components/errorbars/attributes"),o=t("../../components/colorbar/attributes"),i=t("../../components/drawing"),l=(t("./constants"),t("../../lib/extend").extendFlat);e.exports={x:{valType:"data_array"},x0:{valType:"any",dflt:0},dx:{valType:"number",dflt:1},y:{valType:"data_array"},y0:{valType:"any",dflt:0},dy:{valType:"number",dflt:1},ids:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},hoveron:{valType:"flaglist",flags:["points","fills"]},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear"},smoothing:{valType:"number",min:0,max:1.3,dflt:1},dash:{valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid"},simplify:{valType:"boolean",dflt:!0}},connectgaps:{valType:"boolean",dflt:!1},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],dflt:"none"},fillcolor:{valType:"color"},marker:l({},{symbol:{valType:"enumerated",values:i.symbolList,dflt:"circle",arrayOk:!0},opacity:{valType:"number",min:0,max:1,arrayOk:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0},maxdisplayed:{valType:"number",min:0,dflt:0},sizeref:{valType:"number",dflt:1},sizemin:{valType:"number",min:0,dflt:0},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter"},showscale:{valType:"boolean",dflt:!1},colorbar:o,line:l({},{width:{valType:"number",min:0,arrayOk:!0}},n("marker.line"))},n("marker")),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0},textfont:{family:{valType:"string",noBlank:!0,strict:!0,arrayOk:!0},size:{valType:"number",min:1,arrayOk:!0},color:{valType:"color",arrayOk:!0}},r:{valType:"data_array"},t:{valType:"data_array"},error_y:a,error_x:a}},{"../../components/colorbar/attributes":31,"../../components/colorscale/color_attributes":37,"../../components/drawing":53,"../../components/errorbars/attributes":55,"../../lib/extend":119,"./constants":276}],272:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../plots/cartesian/axes"),o=t("../../lib"),i=t("./subtypes"),l=t("./colorscale_calc");e.exports=function(t,e){var r,s,c,u=a.getFromId(t,e.xaxis||"x"),f=a.getFromId(t,e.yaxis||"y"),d=u.makeCalcdata(e,"x"),h=f.makeCalcdata(e,"y"),p=Math.min(d.length,h.length);u._minDtick=0,f._minDtick=0,d.length>p&&d.splice(p,d.length-p),h.length>p&&h.splice(p,h.length-p);var g={padded:!0},m={padded:!0};if(i.hasMarkers(e)){if(r=e.marker,s=r.size,Array.isArray(s)){var v={type:"linear"};a.setConvert(v),s=v.makeCalcdata(e.marker,"size"),s.length>p&&s.splice(p,s.length-p)}var y,x=1.6*(e.marker.sizeref||1);y="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/x),3)}:function(t){return Math.max((t||0)/x,3)},g.ppad=m.ppad=Array.isArray(s)?s.map(y):y(s)}l(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||d[0]===d[p-1]&&h[0]===h[p-1]?e.error_y.visible||["tonexty","tozeroy"].indexOf(e.fill)===-1&&(i.hasMarkers(e)||i.hasText(e))||(g.padded=!1,g.ppad=0):g.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||d[0]===d[p-1]&&h[0]===h[p-1]?["tonextx","tozerox"].indexOf(e.fill)!==-1&&(m.padded=!1):m.tozero=!0,a.expand(u,d,g),a.expand(f,h,m);var b=new Array(p);for(c=0;c=0;a--){var o=t[a];if("scatter"===o.type&&o.xaxis===r.xaxis&&o.yaxis===r.yaxis){o.opacity=void 0;break}}}}}},{}],274:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),o=t("../../plots/plots"),i=t("../../components/colorscale"),l=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,s=r.marker,c="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+c).remove(),void 0===s||!s.showscale)return void o.autoMargin(t,c);var u=s.color,f=s.cmin,d=s.cmax;n(f)||(f=a.aggNums(Math.min,null,u)),n(d)||(d=a.aggNums(Math.max,null,u));var h=e[0].t.cb=l(t,c),p=i.makeColorScaleFunc(i.extractScale(s.colorscale,f,d),{noNumericCheck:!0});h.fillcolor(p).filllevels({start:f,end:d,size:(d-f)/254}).options(s.colorbar)()}},{"../../components/colorbar/draw":33,"../../components/colorscale":44,"../../lib":122,"../../plots/plots":173,"fast-isnumeric":17}],275:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/calc"),o=t("./subtypes");e.exports=function(t){o.hasLines(t)&&n(t,"line")&&a(t,t.line.color,"line","c"),o.hasMarkers(t)&&(n(t,"marker")&&a(t,t.marker.color,"marker","c"),n(t,"marker.line")&&a(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":36,"../../components/colorscale/has_colorscale":43,"./subtypes":291}],276:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20}},{}],277:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),o=t("./constants"),i=t("./subtypes"),l=t("./xy_defaults"),s=t("./marker_defaults"),c=t("./line_defaults"),u=t("./line_shape_defaults"),f=t("./text_defaults"),d=t("./fillcolor_defaults"),h=t("../../components/errorbars/defaults");e.exports=function(t,e,r,p){function g(r,o){return n.coerce(t,e,a,r,o)}var m=l(t,e,g),v=my[x].x0&&ey[x].y0&&rV!=E>=V&&(D=S[z-1][0],P=S[z][0],O=D+(P-D)*(V-N)/(E-N),j=Math.min(j,O),q=Math.max(q,O));j=Math.max(j,0),q=Math.min(q,d._length);var Z=s.defaultLine;return s.opacity(f.fillcolor)?Z=f.fillcolor:s.opacity((f.line||{}).color)&&(Z=f.line.color),n.extendFlat(t,{distance:o.MAXDIST+10,x0:j,x1:q,y0:V,y1:V,color:Z}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":30,"../../components/errorbars":59,"../../lib":122,"../../plots/cartesian/constants":154,"../../plots/cartesian/graph_interact":156,"./get_trace_color":279}],281:[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.cleanData=t("./clean_data"),n.calc=t("./calc"),n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.style=t("./style"),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","symbols","markerColorscale","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":157,"./arrays_to_calcdata":270,"./attributes":271,"./calc":272,"./clean_data":273,"./colorbar":274,"./defaults":277,"./hover":280,"./plot":288,"./select":289,"./style":290,"./subtypes":291}],282:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,i){var l=(t.marker||{}).color;if(i("line.color",r),n(t,"line"))a(t,e,o,i,{prefix:"line.",cLetter:"c"});else{var s=!Array.isArray(l)&&l||r;i("line.color",s)}i("line.width"),i("line.dash")}},{"../../components/colorscale/defaults":39,"../../components/colorscale/has_colorscale":43}],283:[function(t,e,r){"use strict";var n=t("../../constants/numerical").BADNUM;e.exports=function(t,e){function r(e){var r=w.c2p(t[e].x),a=k.c2p(t[e].y);return r!==n&&a!==n&&[r,a]}function a(t){var e=t[0]/w._length,r=t[1]/k._length;return(1+10*Math.max(0,-e,e-1,-r,r-1))*T}function o(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}var i,l,s,c,u,f,d,h,p,g,m,v,y,x,b,_,w=e.xaxis,k=e.yaxis,M=e.simplify,A=e.connectGaps,T=e.baseTolerance,L=e.linear,z=[],C=.2,S=new Array(t.length),O=0;for(M||(T=C=-1),i=0;ia(f))break;s=f,y=g[0]*p[0]+g[1]*p[1],y>m?(m=y,c=f,h=!1):y=t.length||!f)break;S[O++]=f,l=f}}else S[O++]=c}z.push(S.slice(0,O))}return z}},{"../../constants/numerical":110}],284:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n=r("line.shape");"spline"===n&&r("line.smoothing")}},{}],285:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n,a,o=null,i=0;i0?Math.max(e,a):0}}},{"fast-isnumeric":17}],287:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),o=t("../../components/colorscale/defaults"),i=t("./subtypes");e.exports=function(t,e,r,l,s){var c,u=i.isBubble(t),f=(t.line||{}).color;f&&(r=f),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),s("marker.color",r),a(t,"marker")&&o(t,e,l,s,{prefix:"marker.",cLetter:"c"}),c=f&&!Array.isArray(f)&&e.marker.color!==f?f:u?n.background:n.defaultLine,s("marker.line.color",c),a(t,"marker.line")&&o(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"))}},{"../../components/color":30,"../../components/colorscale/defaults":39,"../../components/colorscale/has_colorscale":43,"./subtypes":291}],288:[function(t,e,r){"use strict";function n(t,e){var r;e.selectAll("g.trace").each(function(t){var e=i.select(this);if(r=t[0].trace,r._nexttrace){if(r._nextFill=e.select(".js-fill.js-tonext"),!r._nextFill.size()){var n=":first-child";e.select(".js-fill.js-tozero").size()&&(n+=" + *"),r._nextFill=e.insert("path",n).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),r._nextFill=null;r.fill&&("tozero"===r.fill.substr(0,6)||"toself"===r.fill||"to"===r.fill.substr(0,2)&&!r._prevtrace)?(r._ownFill=e.select(".js-fill.js-tozero"),r._ownFill.size()||(r._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),r._ownFill=null)})}function a(t,e,r,n,a,h,g){function m(t){return M?t.transition():t}function v(t){return t.filter(function(t){return t.vis})}function y(t){return t.id}function x(t){if(t.ids)return y}function b(){return!1}function _(t){var e,r,n=t[0].trace,a=i.select(this),o=u.hasMarkers(n),c=u.hasText(n),f=x(n),d=b,h=b;o&&(d=n.marker.maxdisplayed?v:l.identity),c&&(h=n.marker.maxdisplayed?v:l.identity),r=a.selectAll("path.point"),e=r.data(d,f);var p=e.enter().append("path").classed("point",!0);p.call(s.pointStyle,n).call(s.translatePoints,A,T,n),M&&p.style("opacity",0).transition().style("opacity",1),e.each(function(t){var e=m(i.select(this));s.translatePoint(t,e,A,T),s.singlePointStyle(t,e,n)}),M?e.exit().transition().style("opacity",0).remove():e.exit().remove(),r=a.selectAll("g"),e=r.data(h,f),e.enter().append("g").append("text"),e.each(function(t){var e=m(i.select(this).select("text"));s.translatePoint(t,e,A,T)}),e.selectAll("text").call(s.textPointStyle,n).each(function(t){var e=t.xp||A.c2p(t.x),r=t.yp||T.c2p(t.y);i.select(this).selectAll("tspan").each(function(){m(i.select(this)).attr({x:e,y:r})})}),e.exit().remove()}var w,k;o(t,e,r,n,a);var M=!!g&&g.duration>0,A=r.xaxis,T=r.yaxis,L=n[0].trace,z=L.line,C=i.select(h);if(C.call(c.plot,r,g),L.visible===!0){m(C).style("opacity",L.opacity);var S,O,D=L.fill.charAt(L.fill.length-1);"x"!==D&&"y"!==D&&(D=""),n[0].node3=C,f(n);var P="",N=[],E=L._prevtrace;E&&(P=E._prevRevpath||"",O=E._nextFill,N=E._polygons);var I,R,F,j,q,B,H,V,Z,X="",U="",Y=[],G=[],W=l.noop;if(S=L._ownFill,u.hasLines(L)||"none"!==L.fill){for(O&&O.datum(n),["hv","vh","hvh","vhv"].indexOf(z.shape)!==-1?(F=s.steps(z.shape),j=s.steps(z.shape.split("").reverse().join(""))):F=j="spline"===z.shape?function(t){var e=t[t.length-1];return t[0][0]===e[0]&&t[0][1]===e[1]?s.smoothclosed(t.slice(1),z.smoothing):s.smoothopen(t,z.smoothing)}:function(t){return"M"+t.join("L")},q=function(t){return j(t.reverse())},Y=d(n,{xaxis:A,yaxis:T,connectGaps:L.connectgaps,baseTolerance:Math.max(z.width||1,3)/4,linear:"linear"===z.shape,simplify:z.simplify}),Z=L._polygons=new Array(Y.length),k=0;k1}),W=function(t){return function(e){if(I=F(e),R=q(e),X?D?(X+="L"+I.substr(1),U=R+("L"+U.substr(1))):(X+="Z"+I,U=R+"Z"+U):(X=I,U=R),u.hasLines(L)&&e.length>1){var r=i.select(this);if(r.datum(n),t)m(r.style("opacity",0).attr("d",I).call(s.lineGroupStyle)).style("opacity",1);else{var a=m(r);a.attr("d",I),s.singleLineStyle(n,a)}}}}}var Q=C.selectAll(".js-line").data(G);m(Q.exit()).style("opacity",0).remove(),Q.each(W(!1)),Q.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(W(!0)),Y.length&&(S?B&&V&&(D?("y"===D?B[1]=V[1]=T.c2p(0,!0):"x"===D&&(B[0]=V[0]=A.c2p(0,!0)),m(S).attr("d","M"+V+"L"+B+"L"+X.substr(1))):m(S).attr("d",X+"Z")):"tonext"===L.fill.substr(0,6)&&X&&P&&("tonext"===L.fill?m(O).attr("d",X+"Z"+P+"Z"):m(O).attr("d",X+"L"+P.substr(1)+"Z"),L._polygons=L._polygons.concat(N)),L._prevRevpath=U,L._prevPolygons=Z);var $=C.selectAll(".points");w=$.data([n]),$.each(_),w.enter().append("g").classed("points",!0).each(_),w.exit().remove()}}function o(t,e,r,n,a){var o=r.xaxis,l=r.yaxis,s=i.extent(o.range.map(o.r2l).map(o.l2c)),c=i.extent(l.range.map(l.r2l).map(l.l2c)),f=n[0].trace;if(u.hasMarkers(f)){var d=f.marker.maxdisplayed;if(0!==d){var h=n.filter(function(t){return t.x>=s[0]&&t.x<=s[1]&&t.y>=c[0]&&t.y<=c[1]}),p=Math.ceil(h.length/d),g=0;a.forEach(function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;for(u=p.selectAll("g.trace"),f=u.data(r,function(t){return t[0].trace.uid}),f.enter().append("g").attr("class",function(t){return"trace scatter trace"+t[0].trace.uid}).style("stroke-miterlimit",2),h(t,e,r),n(t,p),s=0,c=[];sn?1:-1}),m){l&&(d=l());var v=i.transition().duration(o.duration).ease(o.easing).each("end",function(){d&&d()}).each("interrupt",function(){d&&d()});v.each(function(){p.selectAll("g.trace").each(function(n,i){a(t,i,e,n,r,this,o)})})}else p.selectAll("g.trace").each(function(n,i){a(t,i,e,n,r,this,o)});g&&f.exit().remove(),p.selectAll("path:not([d])").remove()}},{"../../components/drawing":53,"../../components/errorbars":59,"../../lib":122,"../../lib/polygon":129,"./arrays_to_calcdata":270,"./line_points":283,"./link_traces":285,"./subtypes":291,d3:14}],289:[function(t,e,r){"use strict";var n=t("./subtypes"),a=.2;e.exports=function(t,e){var r,o,i,l,s=t.cd,c=t.xaxis,u=t.yaxis,f=[],d=s[0].trace,h=d.index,p=d.marker,g=!n.hasMarkers(d)&&!n.hasText(d);if(d.visible===!0&&!g){var m=Array.isArray(p.opacity)?1:p.opacity;if(e===!1)for(r=0;rM&&L.splice(M,L.length-M)}return l(e),"undefined"!=typeof L&&o.mergeArray(L,A,"ms"),A}},{"../../lib":122,"../../plots/cartesian/axes":149,"../scatter/colorscale_calc":275,"../scatter/subtypes":291,"fast-isnumeric":17}],296:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../scatter/constants"),o=t("../scatter/subtypes"),i=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 h(r,a){return n.coerce(t,e,f,r,a)}var p,g=h("a"),m=h("b"),v=h("c");if(g?(p=g.length,m?(p=Math.min(p,m.length),v&&(p=Math.min(p,v.length))):p=v?Math.min(p,v.length):0):m&&v&&(p=Math.min(m.length,v.length)),!p)return void(e.visible=!1);g&&p"),l}}},{"../../plots/cartesian/axes":149,"../scatter/hover":280}],298:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="scatterternary",n.basePlotModule=t("../../plots/ternary"),n.categories=["ternary","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../plots/ternary":181,"../scatter/colorbar":274,"./attributes":294,"./calc":295,"./defaults":296,"./hover":297,"./plot":299,"./select":300,"./style":301}],299:[function(t,e,r){"use strict";var n=t("../scatter/plot");e.exports=function(t,e){var r=t.plotContainer;r.select(".scatterlayer").selectAll("*").remove();for(var a={xaxis:t.xaxis,yaxis:t.yaxis,plot:r},o=new Array(e.length),i=t.graphDiv.calcdata,l=0;l + + + + + + + + + +
+ +
+
+ +
+ + + + + \ No newline at end of file diff --git a/src/assets/geo_assets.js b/src/assets/geo_assets.js index 0318d26b8d4..9ac98cedb97 100644 --- a/src/assets/geo_assets.js +++ b/src/assets/geo_assets.js @@ -12,6 +12,6 @@ var saneTopojson = require('sane-topojson'); // package version injected by `npm run preprocess` -exports.version = '1.20.2-d25'; +exports.version = '1.20.2-d26'; exports.topojson = saneTopojson; diff --git a/src/core.js b/src/core.js index 3b5c513fc03..a95fe854c77 100644 --- a/src/core.js +++ b/src/core.js @@ -15,7 +15,7 @@ var Plotly = require('./plotly'); // package version injected by `npm run preprocess` -exports.version = '1.20.2-d25'; +exports.version = '1.20.2-d26'; // inject promise polyfill require('es6-promise').polyfill(); diff --git a/src/traces/pie/plot.js b/src/traces/pie/plot.js index 7ac5a0d429c..823a5c61b49 100644 --- a/src/traces/pie/plot.js +++ b/src/traces/pie/plot.js @@ -146,7 +146,7 @@ module.exports = function plot(gd, cdpie) { gd._hoverdata = [pt]; pt.curveNumber = cd[0].trace.index; gd._hoverdata.trace = cd[0].trace; - Fx.click(gd, { target: true }); + Fx.click(gd, window.event || { target: true }); } slicePath.enter().append('path')