diff --git a/CHANGELOG.md b/CHANGELOG.md index 583b6533f25..f9709f30c1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,14 @@ 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.31.2] -- 2017-10-23 + +### Fixed +- Fix multiple `table` restyle bugs [#2107] +- Fix selection work when `visible: false` choropleth traces are present [#2099, #2109] +- Fix (another) contour generation bug [#2091] + + ## [1.31.1] -- 2017-10-16 ### Fixed diff --git a/dist/README.md b/dist/README.md index b7f98f27439..a64c1196075 100644 --- a/dist/README.md +++ b/dist/README.md @@ -37,11 +37,11 @@ The main plotly.js bundle includes all the official (non-beta) trace modules. It be can imported as minified javascript - using dist file `dist/plotly.min.js` -- using CDN URL https://cdn.plot.ly/plotly-latest.min.js OR https://cdn.plot.ly/plotly-1.31.1.min.js +- using CDN URL https://cdn.plot.ly/plotly-latest.min.js OR https://cdn.plot.ly/plotly-1.31.2.min.js or as raw javascript: - using dist file `dist/plotly.js` -- using CDN URL https://cdn.plot.ly/plotly-latest.js OR https://cdn.plot.ly/plotly-1.31.1.js +- using CDN URL https://cdn.plot.ly/plotly-latest.js OR https://cdn.plot.ly/plotly-1.31.2.js - using CommonJS with `require('plotly.js')` If you would like to have access to the attribute meta information (including attribute descriptions as on the [schema reference page](https://plot.ly/javascript/reference/)), use dist file `dist/plotly-with-meta.js` @@ -50,7 +50,7 @@ The main plotly.js bundle weights in at: | plotly.js | plotly.min.js | plotly.min.js + gzip | plotly-with-meta.js | |-----------|---------------|----------------------|---------------------| -| 5.6 MB | 2.2 MB | 684.4 kB | 5.8 MB | +| 5.6 MB | 2.2 MB | 684.5 kB | 5.8 MB | ## Partial bundles @@ -74,13 +74,13 @@ The `basic` partial bundle contains the `scatter`, `bar` and `pie` trace modules | dist bundle (minified) | `dist/plotly-basic.min.js` | | CDN URL (latest) | https://cdn.plot.ly/plotly-basic-latest.js | | CDN URL (latest minified) | https://cdn.plot.ly/plotly-basic-latest.min.js | -| CDN URL (tagged) | https://cdn.plot.ly/plotly-basic-1.31.1.js | -| CDN URL (tagged minified) | https://cdn.plot.ly/plotly-basic-1.31.1.min.js | +| CDN URL (tagged) | https://cdn.plot.ly/plotly-basic-1.31.2.js | +| CDN URL (tagged minified) | https://cdn.plot.ly/plotly-basic-1.31.2.min.js | | CommonJS | `require('plotly.js/lib/index-basic')` | | Raw size | Minified size | Minified + gzip size | |------|-----------------|------------------------| -| 1.9 MB | 686.3 kB | 223.1 kB | +| 1.9 MB | 686.2 kB | 223.1 kB | ### plotly.js cartesian @@ -92,8 +92,8 @@ The `cartesian` partial bundle contains the `scatter`, `bar`, `box`, `heatmap`, | dist bundle (minified) | `dist/plotly-cartesian.min.js` | | CDN URL (latest) | https://cdn.plot.ly/plotly-cartesian-latest.js | | CDN URL (latest minified) | https://cdn.plot.ly/plotly-cartesian-latest.min.js | -| CDN URL (tagged) | https://cdn.plot.ly/plotly-cartesian-1.31.1.js | -| CDN URL (tagged minified) | https://cdn.plot.ly/plotly-cartesian-1.31.1.min.js | +| CDN URL (tagged) | https://cdn.plot.ly/plotly-cartesian-1.31.2.js | +| CDN URL (tagged minified) | https://cdn.plot.ly/plotly-cartesian-1.31.2.min.js | | CommonJS | `require('plotly.js/lib/index-cartesian')` | | Raw size | Minified size | Minified + gzip size | @@ -110,8 +110,8 @@ The `geo` partial bundle contains the `scatter`, `scattergeo` and `choropleth` t | dist bundle (minified) | `dist/plotly-geo.min.js` | | CDN URL (latest) | https://cdn.plot.ly/plotly-geo-latest.js | | CDN URL (latest minified) | https://cdn.plot.ly/plotly-geo-latest.min.js | -| CDN URL (tagged) | https://cdn.plot.ly/plotly-geo-1.31.1.js | -| CDN URL (tagged minified) | https://cdn.plot.ly/plotly-geo-1.31.1.min.js | +| CDN URL (tagged) | https://cdn.plot.ly/plotly-geo-1.31.2.js | +| CDN URL (tagged minified) | https://cdn.plot.ly/plotly-geo-1.31.2.min.js | | CommonJS | `require('plotly.js/lib/index-geo')` | | Raw size | Minified size | Minified + gzip size | @@ -128,8 +128,8 @@ The `gl3d` partial bundle contains the `scatter`, `scatter3d`, `surface` and `me | dist bundle (minified) | `dist/plotly-gl3d.min.js` | | CDN URL (latest) | https://cdn.plot.ly/plotly-gl3d-latest.js | | CDN URL (latest minified) | https://cdn.plot.ly/plotly-gl3d-latest.min.js | -| CDN URL (tagged) | https://cdn.plot.ly/plotly-gl3d-1.31.1.js | -| CDN URL (tagged minified) | https://cdn.plot.ly/plotly-gl3d-1.31.1.min.js | +| CDN URL (tagged) | https://cdn.plot.ly/plotly-gl3d-1.31.2.js | +| CDN URL (tagged minified) | https://cdn.plot.ly/plotly-gl3d-1.31.2.min.js | | CommonJS | `require('plotly.js/lib/index-gl3d')` | | Raw size | Minified size | Minified + gzip size | @@ -146,8 +146,8 @@ The `gl2d` partial bundle contains the `scatter`, `scattergl`, `pointcloud`, `he | dist bundle (minified) | `dist/plotly-gl2d.min.js` | | CDN URL (latest) | https://cdn.plot.ly/plotly-gl2d-latest.js | | CDN URL (latest minified) | https://cdn.plot.ly/plotly-gl2d-latest.min.js | -| CDN URL (tagged) | https://cdn.plot.ly/plotly-gl2d-1.31.1.js | -| CDN URL (tagged minified) | https://cdn.plot.ly/plotly-gl2d-1.31.1.min.js | +| CDN URL (tagged) | https://cdn.plot.ly/plotly-gl2d-1.31.2.js | +| CDN URL (tagged minified) | https://cdn.plot.ly/plotly-gl2d-1.31.2.min.js | | CommonJS | `require('plotly.js/lib/index-gl2d')` | | Raw size | Minified size | Minified + gzip size | @@ -164,8 +164,8 @@ The `mapbox` partial bundle contains the `scatter` and `scattermapbox` trace mod | dist bundle (minified) | `dist/plotly-mapbox.min.js` | | CDN URL (latest) | https://cdn.plot.ly/plotly-mapbox-latest.js | | CDN URL (latest minified) | https://cdn.plot.ly/plotly-mapbox-latest.min.js | -| CDN URL (tagged) | https://cdn.plot.ly/plotly-mapbox-1.31.1.js | -| CDN URL (tagged minified) | https://cdn.plot.ly/plotly-mapbox-1.31.1.min.js | +| CDN URL (tagged) | https://cdn.plot.ly/plotly-mapbox-1.31.2.js | +| CDN URL (tagged minified) | https://cdn.plot.ly/plotly-mapbox-1.31.2.min.js | | CommonJS | `require('plotly.js/lib/index-mapbox')` | | Raw size | Minified size | Minified + gzip size | @@ -182,8 +182,8 @@ The `finance` partial bundle contains the `scatter`, `bar`, `histogram`, `pie`, | dist bundle (minified) | `dist/plotly-finance.min.js` | | CDN URL (latest) | https://cdn.plot.ly/plotly-finance-latest.js | | CDN URL (latest minified) | https://cdn.plot.ly/plotly-finance-latest.min.js | -| CDN URL (tagged) | https://cdn.plot.ly/plotly-finance-1.31.1.js | -| CDN URL (tagged minified) | https://cdn.plot.ly/plotly-finance-1.31.1.min.js | +| CDN URL (tagged) | https://cdn.plot.ly/plotly-finance-1.31.2.js | +| CDN URL (tagged minified) | https://cdn.plot.ly/plotly-finance-1.31.2.min.js | | CommonJS | `require('plotly.js/lib/index-finance')` | | Raw size | Minified size | Minified + gzip size | diff --git a/dist/npm-ls.json b/dist/npm-ls.json index 11b54bd4c27..d287a9d19a8 100644 --- a/dist/npm-ls.json +++ b/dist/npm-ls.json @@ -1,6 +1,6 @@ { "name": "plotly.js", - "version": "1.31.1", + "version": "1.31.2", "dependencies": { "3d-view": { "version": "2.0.0", diff --git a/dist/plot-schema.json b/dist/plot-schema.json index bac58927622..dd80737747e 100644 --- a/dist/plot-schema.json +++ b/dist/plot-schema.json @@ -21758,7 +21758,7 @@ "arrayOk": true, "dflt": null, "role": "style", - "description": "The width of cells.", + "description": "The width of columns expressed as a ratio. Columns fill the available width in proportion of their specified column widths.", "editType": "calc" }, "columnorder": { diff --git a/dist/plotly-basic.js b/dist/plotly-basic.js index 74f69cf1fbf..db960660f7d 100644 --- a/dist/plotly-basic.js +++ b/dist/plotly-basic.js @@ -1,5 +1,5 @@ /** -* plotly.js (basic) v1.31.1 +* plotly.js (basic) v1.31.2 * Copyright 2012-2017, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -29568,7 +29568,7 @@ exports.svgAttrs = { var Plotly = require('./plotly'); // package version injected by `npm run preprocess` -exports.version = '1.31.1'; +exports.version = '1.31.2'; // inject promise polyfill require('es6-promise').polyfill(); @@ -46595,7 +46595,7 @@ module.exports = function prepSelect(e, startX, startY, dragOptions, mode) { for(i = 0; i < gd.calcdata.length; i++) { cd = gd.calcdata[i]; trace = cd[0].trace; - if(!trace._module || !trace._module.selectPoints) continue; + if(trace.visible !== true || !trace._module || !trace._module.selectPoints) continue; if(dragOptions.subplot) { if( @@ -54927,12 +54927,9 @@ var DESELECTDIM = require('../../constants/interactions').DESELECTDIM; module.exports = function selectPoints(searchInfo, polygon) { var cd = searchInfo.cd; var selection = []; - var trace = cd[0].trace; var node3 = cd[0].node3; var i; - if(trace.visible !== true) return []; - if(polygon === false) { // clear selection for(i = 0; i < cd.length; i++) { @@ -59450,7 +59447,7 @@ module.exports = function selectPoints(searchInfo, polygon) { // TODO: include lines? that would require per-segment line properties var hasOnlyLines = (!subtypes.hasMarkers(trace) && !subtypes.hasText(trace)); - if(trace.visible !== true || hasOnlyLines) return []; + if(hasOnlyLines) return []; var opacity = Array.isArray(marker.opacity) ? 1 : marker.opacity; diff --git a/dist/plotly-basic.min.js b/dist/plotly-basic.min.js index 2c3915d8789..f8ab3b03f4c 100644 --- a/dist/plotly-basic.min.js +++ b/dist/plotly-basic.min.js @@ -1,5 +1,5 @@ /** -* plotly.js (basic - minified) v1.31.1 +* plotly.js (basic - minified) v1.31.2 * Copyright 2012-2017, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -15,14 +15,14 @@ ticklen:k.ticklen,tickwidth:k.tickwidth,tickcolor:k.tickcolor,showticklabels:k.s ;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:7}],60:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],61:[function(t,e,r){"use strict";function n(t,e,r,n){var i=e["error_"+n]||{},s=i.visible&&-1!==["linear","log"].indexOf(r.type),c=[];if(s){for(var u=l(i),f=0;f0;t.each(function(t){var d,p=t[0].trace,h=p.error_x||{},g=p.error_y||{};p.ids&&(d=function(t){return t.id});var v=l.hasMarkers(p)&&p.marker.maxdisplayed>0;g.visible||h.visible||(t=[]);var y=a.select(this).selectAll("g.errorbar").data(t,d);if(y.exit().remove(),t.length){h.visible||y.selectAll("path.xerror").remove(),g.visible||y.selectAll("path.yerror").remove(),y.style("opacity",1);var m=y.enter().append("g").classed("errorbar",!0);f&&m.style("opacity",0).transition().duration(r.duration).style("opacity",1),o.setClipUrl(y,e.layerClipId),y.each(function(t){var e=a.select(this),o=n(t,c,u);if(!v||t.vis){var l;if(g.visible&&i(o.x)&&i(o.yh)&&i(o.ys)){var d=g.width;l="M"+(o.x-d)+","+o.yh+"h"+2*d+"m-"+d+",0V"+o.ys,o.noYS||(l+="m-"+d+",0h"+2*d);var p=e.select("path.yerror");s=!p.size(),s?p=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):f&&(p=p.transition().duration(r.duration).ease(r.easing)),p.attr("d",l)}if(h.visible&&i(o.y)&&i(o.xh)&&i(o.xs)){var y=(h.copy_ystyle?g:h).width;l="M"+o.xh+","+(o.y-y)+"v"+2*y+"m0,-"+y+"H"+o.xs,o.noXS||(l+="m0,-"+y+"v"+2*y);var m=e.select("path.xerror");s=!m.size(),s?m=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):f&&(m=m.transition().duration(r.duration).ease(r.easing)),m.attr("d",l)}}})}})}},{"../../traces/scatter/subtypes":281,"../drawing":58,d3:7,"fast-isnumeric":10}],66:[function(t,e,r){"use strict";var n=t("d3"),a=t("../color");e.exports=function(t){t.each(function(t){var e=t[0].trace,r=e.error_y||{},i=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)})}},{"../color":34,d3:7}],67:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes");e.exports={hoverlabel:{bgcolor:{valType:"color",arrayOk:!0,editType:"none"},bordercolor:{valType:"color",arrayOk:!0,editType:"none"},font:n({arrayOk:!0,editType:"none"}),namelength:{valType:"integer",min:-1,arrayOk:!0,editType:"none"},editType:"calc"}}},{"../../plots/font_attributes":213}],68:[function(t,e,r){"use strict";function n(t,e,r,n){n=n||a.identity,Array.isArray(t)&&(e[0][r]=n(t))}var a=t("../../lib"),i=t("../../registry");e.exports=function(t){for(var e=t.calcdata,r=t._fullLayout,o=0;o=0&&r.indexJ.width||Q<0||Q>J.height)return x.unhoverRaw(t,e)}if(E="xval"in e?w.flat(d,e.xval):w.p2c(L,W),N="yval"in e?w.flat(d,e.yval):w.p2c(C,Q),!f(E[0])||!f(N[0]))return p.warn("Fx.hover failed",e,t),x.unhoverRaw(t,e)}var K=1/0;for(R=0;RX&&(Y.splice(0,X),K=Y[0].distance)}if(0===Y.length)return x.unhoverRaw(t,e);Y.sort(function(t,e){return t.distance-e.distance});var at=t._hoverdata,it=[];for(I=0;I1,ct=m.combine(g.plot_bgcolor||m.background,g.paper_bgcolor),ut={hovermode:P,rotateLabels:st,bgColor:ct,container:g._hoverlayer,outerContainer:g._paperdiv,commonLabelOpts:g.hoverlabel},ft=a(Y,ut,t);if(i(Y,st?"xa":"ya"),o(ft,st),e.target&&e.target.tagName){var dt=_.getComponentMethod("annotations","hasClickToShow")(t,it);v(u.select(e.target),dt?"pointer":"")}e.target&&!n&&c(t,e,at)&&(at&&t.emit("plotly_unhover",{event:e,points:at}),t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:L,yaxes:C,xvals:E,yvals:N}))}function a(t,e,r){var n,a,i=e.hovermode,o=e.rotateLabels,l=e.bgColor,s=e.container,c=e.outerContainer,f=e.commonLabelOpts||{},d=e.fontFamily||k.HOVERFONT,p=e.fontSize||k.HOVERFONTSIZE,h=t[0],v=h.xa,x=h.ya,b="y"===i?"yLabel":"xLabel",_=h[b],w=(String(_)||"").split(" ")[0],A=c.node().getBoundingClientRect(),T=A.top,L=A.width,C=A.height,z=h.distance<=k.MAXDIST&&("x"===i||"y"===i);for(n=0;n-1&&n.length>h&&(n=h>3?n.substr(0,h-3)+"...":n.substr(0,h))}void 0!==t.extraText&&(a+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(a+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(a+="y: "+t.yLabel+"
"),a+=(a?"z: ":"")+t.zLabel):z&&t[i+"Label"]===_?a=t[("x"===i?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(a=t.yLabel):a=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(a+=(a?"
":"")+t.text),""===a&&(""===n&&e.remove(),a=n);var v=e.select("text.nums").call(y.font,t.fontFamily||d,t.fontSize||p,t.fontColor||f).text(a).attr("data-notex",1).call(g.positionText,0,0).call(g.convertToTspans,r),x=e.select("text.name"),b=0;n&&n!==a?(x.call(y.font,t.fontFamily||d,t.fontSize||p,c).text(n).attr("data-notex",1).call(g.positionText,0,0).call(g.convertToTspans,r),b=x.node().getBoundingClientRect().width+2*O):(x.remove(),e.select("rect").remove()),e.select("path").style({fill:c,stroke:f});var w,k,A=v.node().getBoundingClientRect(),D=t.xa._offset+(t.x0+t.x1)/2,P=t.ya._offset+(t.y0+t.y1)/2,E=Math.abs(t.x1-t.x0),N=Math.abs(t.y1-t.y0),I=A.width+S+O+b;t.ty0=T-A.top,t.bx=A.width+2*O,t.by=A.height+2*O,t.anchor="start",t.txwidth=A.width,t.tx2width=b,t.offset=0,o?(t.pos=D,w=P+N/2+I<=C,k=P-N/2-I>=0,"top"!==t.idealAlign&&w||!k?w?(P+=N/2,t.anchor="start"):t.anchor="middle":(P-=N/2,t.anchor="end")):(t.pos=P,w=D+E/2+I<=L,k=D-E/2-I>=0,"left"!==t.idealAlign&&w||!k?w?(D+=E/2,t.anchor="start"):t.anchor="middle":(D-=E/2,t.anchor="end")),v.attr("text-anchor",t.anchor),b&&x.attr("text-anchor",t.anchor),e.attr("transform","translate("+D+","+P+")"+(o?"rotate("+M+")":""))}),E}function i(t,e){function r(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,i=r.pos+r.dp+r.size-e.pmax,a>.01){for(l=t.length-1;l>=0;l--)t[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=t.length-1;l>=0;l--)t[l].dp-=i;n=!1}if(n){var c=0;for(o=0;oe.pmax&&c++;for(o=t.length-1;o>=0&&!(c<=0);o--)s=t[o],s.pos>e.pmax-1&&(s.del=!0,c--);for(o=0;o=0;l--)t[l].dp-=i;for(o=t.length-1;o>=0&&!(c<=0);o--)s=t[o],s.pos+s.dp+s.size>e.pmax&&(s.del=!0,c--)}}}for(var n,a,i,o,l,s,c,u=0,f=t.map(function(t,r){var n=t[e];return[{i:r,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===n._id.charAt(0)?T:1)/2,pmin:n._offset,pmax:n._offset+n._length}]}).sort(function(t,e){return t[0].posref-e[0].posref});!n&&u<=t.length;){for(u++,n=!0,o=0;o.01&&h.pmin===g.pmin&&h.pmax===g.pmax){for(l=p.length-1;l>=0;l--)p[l].dp+=a;for(d.push.apply(d,p),f.splice(o+1,1),c=0,l=d.length-1;l>=0;l--)c+=d[l].dp;for(i=c/d.length,l=d.length-1;l>=0;l--)d[l].dp-=i;n=!1}else o++}f.forEach(r)}for(o=f.length-1;o>=0;o--){var v=f[o];for(l=v.length-1;l>=0;l--){var y=v[l],m=t[y.i];m.offset=y.dp,m.del=y.del}}}function o(t,e){t.each(function(t){var r=u.select(this);if(t.del)return void r.remove();var n="end"===t.anchor?-1:1,a=r.select("text.nums"),i={start:1,end:-1,middle:0}[t.anchor],o=i*(S+O),l=o+i*(t.txwidth+O),s=0,c=t.offset;"middle"===t.anchor&&(o-=t.tx2width/2,l-=t.tx2width/2),e&&(c*=-C,s=t.offset*L),r.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(n*S+s)+","+(S+c)+"v"+(t.by/2-S)+"h"+n*t.bx+"v-"+t.by+"H"+(n*S+s)+"V"+(c-S)+"Z"),a.call(g.positionText,o+s,c+t.ty0-t.by/2+O),t.tx2width&&(r.select("text.name").call(g.positionText,l+i*O+s,c+t.ty0-t.by/2+O),r.select("rect").call(y.setRect,l+(i-1)*t.tx2width/2+s,c-t.by/2-1,t.tx2width,t.by+2))})}function l(t,e){function r(e,r,n){var a=l(r,n);a&&(t[e]=a)}var n=t.index,a=t.trace||{},i=t.cd[0],o=t.cd[n]||{},l=Array.isArray(n)?function(t,e){return p.castOption(i,n,t)||p.extractOption({},a,"",e)}:function(t,e){return p.extractOption(o,a,t,e)};r("hoverinfo","hi","hoverinfo"),r("color","hbg","hoverlabel.bgcolor"),r("borderColor","hbc","hoverlabel.bordercolor"),r("fontFamily","htf","hoverlabel.font.family"),r("fontSize","hts","hoverlabel.font.size"),r("fontColor","htc","hoverlabel.font.color"),r("nameLength","hnl","hoverlabel.namelength"),t.posref="y"===e?(t.x0+t.x1)/2:(t.y0+t.y1)/2,t.x0=p.constrain(t.x0,0,t.xa._length),t.x1=p.constrain(t.x1,0,t.xa._length),t.y0=p.constrain(t.y0,0,t.ya._length),t.y1=p.constrain(t.y1,0,t.ya._length);var s;if(void 0!==t.xLabelVal){s="log"===t.xa.type&&t.xLabelVal<=0;var c=b.tickText(t.xa,t.xa.c2l(s?-t.xLabelVal:t.xLabelVal),"hover");s?0===t.xLabelVal?t.xLabel="0":t.xLabel="-"+c.text:t.xLabel=c.text,t.xVal=t.xa.c2d(t.xLabelVal)}if(void 0!==t.yLabelVal){s="log"===t.ya.type&&t.yLabelVal<=0;var u=b.tickText(t.ya,t.ya.c2l(s?-t.yLabelVal:t.yLabelVal),"hover");s?0===t.yLabelVal?t.yLabel="0":t.yLabel="-"+u.text:t.yLabel=u.text,t.yVal=t.ya.c2d(t.yLabelVal)}if(void 0!==t.zLabelVal&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var f=b.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+f+" / -"+b.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+f,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var d=b.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+d+" / -"+b.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+d,"y"===e&&(t.distance+=1)}var h=t.hoverinfo||t.trace.hoverinfo;return"all"!==h&&(h=h.split("+"),-1===h.indexOf("x")&&(t.xLabel=void 0),-1===h.indexOf("y")&&(t.yLabel=void 0),-1===h.indexOf("z")&&(t.zLabel=void 0),-1===h.indexOf("text")&&(t.text=void 0),-1===h.indexOf("name")&&(t.name=void 0)),t}function s(t,e){var r=e.hovermode,n=e.container,a=t[0],i=a.xa,o=a.ya,l=i.showspikes,s=o.showspikes;if(n.selectAll(".spikeline").remove(),"closest"===r&&(l||s)){var c=e.fullLayout,u=i._offset+(a.x0+a.x1)/2,f=o._offset+(a.y0+a.y1)/2,p=m.combine(c.plot_bgcolor,c.paper_bgcolor),h=d.readability(a.color,p)<1.5?m.contrast(p):a.color;if(s){var g=o.spikemode,v=o.spikethickness,x=o.spikecolor||h,b=o._boundingBox,_=(b.left+b.right)/2=0;n--){var a=r[n],i=t._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber))return!0}return!1}var u=t("d3"),f=t("fast-isnumeric"),d=t("tinycolor2"),p=t("../../lib"),h=t("../../lib/events"),g=t("../../lib/svg_text_utils"),v=t("../../lib/override_cursor"),y=t("../drawing"),m=t("../color"),x=t("../dragelement"),b=t("../../plots/cartesian/axes"),_=t("../../registry"),w=t("./helpers"),k=t("./constants"),M=k.YANGLE,A=Math.PI*M/180,T=1/Math.sin(A),L=Math.cos(A),C=Math.sin(A),S=k.HOVERARROWSIZE,O=k.HOVERTEXTPAD;r.hover=function(t,e,r,a){t=p.getGraphDiv(t),p.throttle(t._fullLayout._uid+k.HOVERID,k.HOVERMINTIME,function(){n(t,e,r,a)})},r.loneHover=function(t,e){var r={color:t.color||m.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,trace:{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0},n=u.select(e.container),i=e.outerContainer?u.select(e.outerContainer):n,l={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||m.background,container:n,outerContainer:i},s=a([r],l,e.gd);return o(s,l.rotateLabels),s.node()}},{"../../lib":149,"../../lib/events":142,"../../lib/override_cursor":159,"../../lib/svg_text_utils":169,"../../plots/cartesian/axes":189,"../../registry":225,"../color":34,"../dragelement":55,"../drawing":58,"./constants":70,"./helpers":72,d3:7,"fast-isnumeric":10,tinycolor2:16}],74:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,a){a=a||{},r("hoverlabel.bgcolor",a.bgcolor),r("hoverlabel.bordercolor",a.bordercolor),r("hoverlabel.namelength",a.namelength),n.coerceFont(r,"hoverlabel.font",a.font)}},{"../../lib":149}],75:[function(t,e,r){"use strict";function n(t){var e=l.isD3Selection(t)?t:o.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()}function a(t,e,r){return l.castOption(t,e,"hoverlabel."+r)}function i(t,e,r){function n(r){return l.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}return l.castOption(t,r,"hoverinfo",n)}var o=t("d3"),l=t("../../lib"),s=t("../dragelement"),c=t("./helpers"),u=t("./layout_attributes");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:u},attributes:t("./attributes"),layoutAttributes:u,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:c.getDistanceFunction,getClosest:c.getClosest,inbox:c.inbox,appendArrayPointValue:c.appendArrayPointValue,castHoverOption:a,castHoverinfo:i,hover:t("./hover").hover,unhover:s.unhover,loneHover:t("./hover").loneHover,loneUnhover:n,click:t("./click")}},{"../../lib":149,"../dragelement":55,"./attributes":67,"./calc":68,"./click":69,"./constants":70,"./defaults":71,"./helpers":72,"./hover":73,"./layout_attributes":76,"./layout_defaults":77,"./layout_global_defaults":78,d3:7}],76:[function(t,e,r){"use strict";var n=t("./constants"),a=t("../../plots/font_attributes")({editType:"none"});a.family.dflt=n.HOVERFONT,a.size.dflt=n.HOVERFONTSIZE,e.exports={dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1],editType:"modebar"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"}}},{"../../plots/font_attributes":213,"./constants":70}],77:[function(t,e,r){"use strict";function n(t){for(var e=!0,r=0;r=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}},{}],85:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes");e.exports={bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:a.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:n({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},x:{valType:"number",min:-2,max:3,dflt:1.02,editType:"legend"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",min:-2,max:3,dflt:1,editType:"legend"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"legend"},editType:"legend"}},{"../../plots/font_attributes":213,"../color/attributes":33}],86:[function(t,e,r){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],87:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("./attributes"),o=t("../../plots/layout_attributes"),l=t("./helpers");e.exports=function(t,e,r){function s(t,e){return a.coerce(p,h,i,t,e)}for(var c,u,f,d,p=t.legend||{},h=e.legend={},g=0,v="normal",y=0;y1)){if(s("bgcolor",e.paper_bgcolor),s("bordercolor"),s("borderwidth"),a.coerceFont(s,"font",e.font),s("orientation"),"h"===h.orientation){var x=t.xaxis;x&&x.rangeslider&&x.rangeslider.visible?(c=0,f="left",u=1.1,d="bottom"):(c=0,f="left",u=-.1,d="top")}s("traceorder",v),l.isGrouped(e.legend)&&s("tracegroupgap"),s("x",c),s("xanchor",f),s("y",u),s("yanchor",d),a.noneOrAll(p,h,["x","y"])}}},{"../../lib":149,"../../plots/layout_attributes":216,"../../registry":225,"./attributes":85,"./helpers":91}],88:[function(t,e,r){"use strict";function n(t,e){function r(r){y.convertToTspans(r,e,function(){i(t,e)})}var n=t.data()[0][0],a=e._fullLayout,o=n.trace,l=p.traceIs(o,"pie"),s=o.index,c=l?n.label:o.name,d=t.selectAll("text.legendtext").data([0]);d.enter().append("text").classed("legendtext",!0),d.attr("text-anchor","start").classed("user-select-none",!0).call(g.font,a.legend.font).text(c),e._context.edits.legendText&&!l?d.call(y.makeEditable,{gd:e}).call(r).on("edit",function(t){this.text(t).call(r);var a=t;this.text()||(t=" ");var i,o,l=n.trace._fullInput||{},c={};if(-1!==["ohlc","candlestick"].indexOf(l.type))i=n.trace.transforms,o=i[i.length-1].direction,c[o+".name"]=t;else if(p.hasTransform(l,"groupby")){var d=p.getTransformIndices(l,"groupby"),h=d[d.length-1],g=f.keyedContainer(l,"transforms["+h+"].styles","target","value.name");""===a?g.remove(n.trace._group):g.set(n.trace._group,t),c=g.constructUpdate()}else c.name=t;return u.restyle(e,c,s)}):d.call(r)}function a(t,e){var r,n=1,a=t.selectAll("rect").data([0]);a.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(v.fill,"rgba(0,0,0,0)"),a.on("mousedown",function(){r=(new Date).getTime(),r-e._legendMouseDownTimeT&&(n=Math.max(n-1,1)),1===n?r._clickTimeout=setTimeout(function(){m(t,e,n)},T):2===n&&(r._clickTimeout&&clearTimeout(r._clickTimeout),e._legendMouseDownTime=0,m(t,e,n))}})}function i(t,e){var r=t.data()[0][0];if(!r.trace.showlegend)return void t.remove();var n,a,i=t.select("g[class*=math-group]"),o=i.node(),l=e._fullLayout.legend,s=l.font.size*_;if(o){var c=g.bBox(o);n=c.height,a=c.width,g.setTranslate(i,0,n/4)}else{var u=t.select(".legendtext"),f=y.lineCount(u),d=u.node();n=s*f,a=d?g.bBox(d).width:0;var p=s*(.3+(1-f)/2);y.positionText(u,40,p)}n=Math.max(n,16)+3,r.height=n,r.width=a}function o(t,e,r){var n=t._fullLayout,a=n.legend,i=a.borderwidth,o=M.isGrouped(a),l=0;if(a.width=0,a.height=0,M.isVertical(a))o&&e.each(function(t,e){g.setTranslate(this,0,e*a.tracegroupgap)}),r.each(function(t){var e=t[0],r=e.height,n=e.width;g.setTranslate(this,i,5+i+a.height+r/2),a.height+=r,a.width=Math.max(a.width,n)}),a.width+=45+2*i,a.height+=10+2*i,o&&(a.height+=(a._lgroupsLength-1)*a.tracegroupgap),l=40;else if(o){for(var s=[a.width],u=e.data(),f=0,d=u.length;fn.width-(n.margin.r+n.margin.l)&&(x=0,v+=y,a.height=a.height+y,y=0),g.setTranslate(this,i+x,5+i+e.height/2+v),a.width+=o+r,a.height=Math.max(a.height,e.height),x+=o+r,y=Math.max(e.height,y)}),a.width+=2*i,a.height+=10+2*i}a.width=Math.ceil(a.width),a.height=Math.ceil(a.height),r.each(function(e){var r=e[0];c.select(this).select(".legendtoggle").call(g.setRect,0,-r.height/2,(t._context.edits.legendText?0:a.width)+l,r.height)})}function l(t){var e=t._fullLayout,r=e.legend,n="left";A.isRightAnchor(r)?n="right":A.isCenterAnchor(r)&&(n="center");var a="top";A.isBottomAnchor(r)?a="bottom":A.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";A.isRightAnchor(r)?n="right":A.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"),p=t("../../registry"),h=t("../dragelement"),g=t("../drawing"),v=t("../color"),y=t("../../lib/svg_text_utils"),m=t("./handle_click"),x=t("./constants"),b=t("../../constants/interactions"),_=t("../../constants/alignment").LINE_SPACING,w=t("./get_legend_data"),k=t("./style"),M=t("./helpers"),A=t("./anchor_utils"),T=b.DBLCLICKDELAY;e.exports=function(t){function e(t,e){S.attr("data-scroll",e).call(g.setTranslate,0,e),O.call(g.setRect,j,t,x.scrollBarWidth,x.scrollBarHeight),L.select("rect").attr({y:y.borderwidth-e})}var r=t._fullLayout,i="legend"+r._uid;if(r._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var y=r.legend,b=r.showlegend&&w(t.calcdata,y),_=r.hiddenlabels||[];if(!r.showlegend||!b.length)return r._infolayer.selectAll(".legend").remove(),r._topdefs.select("#"+i).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 L=r._topdefs.selectAll("#"+i).data([0]);L.enter().append("clipPath").attr("id",i).append("rect");var C=M.selectAll("rect.bg").data([0]);C.enter().append("rect").attr({class:"bg","shape-rendering":"crispEdges"}),C.call(v.stroke,y.bordercolor),C.call(v.fill,y.bgcolor),C.style("stroke-width",y.borderwidth+"px");var S=M.selectAll("g.scrollbox").data([0]);S.enter().append("g").attr("class","scrollbox");var O=M.selectAll("rect.scrollbar").data([0]);O.enter().append("rect").attr({class:"scrollbar",rx:20,ry:2,width:0,height:0}).call(v.fill,"#808BA4");var z=S.selectAll("g.groups").data(b);z.enter().append("g").attr("class","groups"),z.exit().remove();var D=z.selectAll("g.traces").data(f.identity);D.enter().append("g").attr("class","traces"),D.exit().remove(),D.call(k,t).style("opacity",function(t){var e=t[0].trace;return p.traceIs(e,"pie")?-1!==_.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){c.select(this).call(n,t).call(a,t)});var P=0!==M.enter().size();P&&(o(t,z,D),l(t));var E=r.width,N=r.height;o(t,z,D),y.height>N?s(t):l(t);var I=r._size,R=I.l+I.w*y.x,F=I.t+I.h*(1-y.y);A.isRightAnchor(y)?R-=y.width:A.isCenterAnchor(y)&&(R-=y.width/2),A.isBottomAnchor(y)?F-=y.height:A.isMiddleAnchor(y)&&(F-=y.height/2);var j=y.width,B=I.w;j>B?(R=I.l,j=B):(R+j>E&&(R=E-j),R<0&&(R=0),j=Math.min(E-R,y.width));var q=y.height,H=I.h;q>H?(F=I.t,q=H):(F+q>N&&(F=N-q),F<0&&(F=0),q=Math.min(N-F,y.height)),g.setTranslate(M,R,F);var V,U,G=q-x.scrollBarHeight-2*x.scrollBarMargin,X=y.height-q;if(y.height<=q||t._context.staticPlot)C.attr({width:j-y.borderwidth,height:q-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),g.setTranslate(S,0,0),L.select("rect").attr({width:j-2*y.borderwidth,height:q-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth}),S.call(g.setClipUrl,i);else{V=x.scrollBarMargin,U=S.attr("data-scroll")||0,C.attr({width:j-2*y.borderwidth+x.scrollBarWidth+x.scrollBarMargin,height:q-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),L.select("rect").attr({width:j-2*y.borderwidth+x.scrollBarWidth+x.scrollBarMargin,height:q-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth-U}),S.call(g.setClipUrl,i),P&&e(V,U),M.on("wheel",null),M.on("wheel",function(){U=f.constrain(S.attr("data-scroll")-c.event.deltaY/G*X,-X,0),V=x.scrollBarMargin-U/X*G,e(V,U),0!==U&&U!==-X&&c.event.preventDefault()}),O.on(".drag",null),S.on(".drag",null);var Y=c.behavior.drag().on("drag",function(){V=f.constrain(c.event.y-x.scrollBarHeight/2,x.scrollBarMargin,x.scrollBarMargin+G),U=-(V-x.scrollBarMargin)/G*X,e(V,U)});O.call(Y),S.call(Y)}if(t._context.edits.legendPosition){var Z,W,Q,$;M.classed("cursor-move",!0),h.init({element:M.node(),gd:t,prepFn:function(){var t=g.getTranslate(M);Q=t.x,$=t.y},moveFn:function(t,e){var r=Q+t,n=$+e;g.setTranslate(M,r,n),Z=h.align(r,0,I.l,I.l+I.w,y.xanchor),W=h.align(n,0,I.t+I.h,I.t,y.yanchor)},doneFn:function(e,n,a){if(e&&void 0!==Z&&void 0!==W)u.relayout(t,{"legend.x":Z,"legend.y":W});else{var i=r._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return a.clientX>=t.left&&a.clientX<=t.right&&a.clientY>=t.top&&a.clientY<=t.bottom});i.size()>0&&(1===n?M._clickTimeout=setTimeout(function(){m(i,t,n)},T):2===n&&(M._clickTimeout&&clearTimeout(M._clickTimeout),m(i,t,n)))}}})}}}},{"../../constants/alignment":131,"../../constants/interactions":132,"../../lib":149,"../../lib/svg_text_utils":169,"../../plotly":184,"../../plots/plots":218,"../../registry":225,"../color":34,"../dragelement":55,"../drawing":58,"./anchor_utils":84,"./constants":86,"./get_legend_data":89,"./handle_click":90,"./helpers":91,"./style":93,d3:7}],89:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./helpers");e.exports=function(t,e){function r(t,r){if(""!==t&&a.isGrouped(e))-1===s.indexOf(t)?(s.push(t),c=!0,l[t]=[[r]]):l[t].push([r]);else{var n="~~i"+f;s.push(n),l[n]=[[r]],f++}}var i,o,l={},s=[],c=!1,u={},f=0;for(i=0;ir[1])return r[1]}return a}function a(t){return t[0]}var l,c,u=t[0],f=u.trace,d=s.hasMarkers(f),p=s.hasText(f),h=s.hasLines(f);if(d||p||h){var g={},v={};d&&(g.mc=r("marker.color",a),g.mo=r("marker.opacity",i.mean,[.2,1]),g.ms=r("marker.size",i.mean,[2,16]),g.mlc=r("marker.line.color",a),g.mlw=r("marker.line.width",i.mean,[0,5]),v.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),h&&(v.line={width:r("line.width",a,[0,10])}),p&&(g.tx="Aa",g.tp=r("textposition",a),g.ts=10,g.tc=r("textfont.color",a),g.tf=r("textfont.family",a)),l=[i.minExtend(u,g)],c=i.minExtend(f,v)}var y=n.select(this).select("g.legendpoints"),m=y.selectAll("path.scatterpts").data(d?l:[]);m.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),m.exit().remove(),m.call(o.pointStyle,c,e),d&&(l[0].mrc=3);var x=y.selectAll("g.pointtext").data(p?l:[]);x.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),x.exit().remove(),x.selectAll("text").call(o.textPointStyle,c,e)}function f(t){var e=t[0].trace,r=e.marker||{},i=r.line||{},o=n.select(this).select("g.legendpoints").selectAll("path.legendbar").data(a.traceIs(e,"bar")?[t]:[]);o.enter().append("path").classed("legendbar",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),o.exit().remove(),o.each(function(t){var e=n.select(this),a=t[0],o=(a.mlw+1||i.width+1)-1;e.style("stroke-width",o+"px").call(l.fill,a.mc||r.color),o&&e.call(l.stroke,a.mlc||i.color)})}function d(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(a.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(){var t=e.line.width,r=n.select(this);r.style("stroke-width",t+"px").call(l.fill,e.fillcolor),t&&r.call(l.stroke,e.line.color)})}function p(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendpie").data(a.traceIs(e,"pie")&&e.visible?[t]:[]);r.enter().append("path").classed("legendpie",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.size()&&r.call(c,t[0],e)}t.each(function(t){var e=n.select(this),r=e.selectAll("g.layers").data([0]);r.enter().append("g").classed("layers",!0),r.style("opacity",t[0].trace.opacity),r.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),r.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var a=r.selectAll("g.legendsymbols").data([t]);a.enter().append("g").classed("legendsymbols",!0),a.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(f).each(d).each(p).each(r).each(u)}},{"../../lib":149,"../../registry":225,"../../traces/pie/style_one":258,"../../traces/scatter/subtypes":281,"../color":34,"../drawing":58,d3:7}],94:[function(t,e,r){"use strict";function n(t,e){var r,n,a=e.currentTarget,i=a.getAttribute("data-attr"),o=a.getAttribute("data-val")||!0,l=t._fullLayout,s={},c=p.list(t,null,!0),u="on";if("zoom"===i){var d,h="in"===o?.5:2,g=(1+h)/2,v=(1-h)/2;for(n=0;n1)return n(["resetViews","toggleHover"]),o(y,r);u&&(n(["zoom3d","pan3d","orbitRotation","tableRotation"]),n(["resetCameraDefault3d","resetCameraLastSave3d"]),n(["hoverClosest3d"]));var m=a(l),x=[];return((c||h)&&!m||g)&&(x=["zoom2d","pan2d"]),(v||f)&&(x=["pan2d"]),i(s)&&(x.push("select2d"),x.push("lasso2d")),x.length&&n(x),!c&&!h||m||g||n(["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"]),c&&p?n(["toggleHover"]):h?n(["hoverClosestGl2d"]):c?n(["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]):p?n(["hoverClosestPie"]):v?n(["resetViewMapbox","toggleHover"]):f&&(n(["zoomInGeo","zoomOutGeo","resetGeo"]),n(["hoverClosestGeo"])),o(y,r)}function a(t){for(var e=s.list({_fullLayout:t},null,!0),r=!0,n=0;n0)){var h=a(e,r,s);f("x",h[0]),f("y",h[1]),i.noneOrAll(t,e,["x","y"]),f("xanchor"),f("yanchor"),i.coerceFont(f,"font",r.font);var g=f("bgcolor");f("activecolor",o.contrast(g,c.lightAmount,c.darkAmount)),f("bordercolor"),f("borderwidth")}}},{"../../lib":149,"../color":34,"./attributes":98,"./button_attributes":99,"./constants":100}],102:[function(t,e,r){"use strict";function n(t){for(var e=y.list(t,"x",!0),r=[],n=0;nh&&(h=d)));return h>=p?[p,h]:void 0}}var a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=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;lX&&n>Y&&!t.shiftKey?h.getCursor(a/r,1-i/n):"move";g(e,o),G=o.split("-")[0]}function i(e){j=f.getFromId(t,r.xref),B=f.getFromId(t,r.yref),q=y.getDataToPixel(t,j),H=y.getDataToPixel(t,B,!0),V=y.getPixelToData(t,j),U=y.getPixelToData(t,B,!0);var i="shapes["+n+"]";"path"===r.type?(R=r.path,F=i+".path"):(v=q(r.x0),m=H(r.y0),x=q(r.x1),b=H(r.y1),_=i+".x0",w=i+".y0",k=i+".x1",M=i+".y1"),vY&&(p[S]=r[P]=U(c),p[O]=r[E]=U(u)),d-f>X&&(p[z]=r[N]=V(f),p[D]=r[I]=V(d))}e.attr("d",o(t,r))}var p,v,m,x,b,_,w,k,M,A,T,L,C,S,O,z,D,P,E,N,I,R,F,j,B,q,H,V,U,G,X=10,Y=10,Z={element:e.node(),gd:t,prepFn:i,doneFn:l},W=Z.element.getBoundingClientRect();h.init(Z),e.node().onmousemove=a}function o(t,e){var r,n,a,i,o=e.type,s=f.getFromId(t,e.xref),c=f.getFromId(t,e.yref),u=t._fullLayout._size;if(s?(r=y.shapePositionToRange(s),n=function(t){return s._offset+s.r2p(r(t,!0))}):n=function(t){return u.l+u.w*t},c?(a=y.shapePositionToRange(c),i=function(t){return c._offset+c.r2p(a(t,!0))}):i=function(t){return u.t+u.h*(1-t)},"path"===o)return s&&"date"===s.type&&(n=y.decodeDate(n)),c&&"date"===c.type&&(i=y.decodeDate(i)),l(e.path,n,i);var d=n(e.x0),p=n(e.x1),h=i(e.y0),g=i(e.y1);if("line"===o)return"M"+d+","+h+"L"+p+","+g;if("rect"===o)return"M"+d+","+h+"H"+p+"V"+g+"H"+d+"Z";var v=(d+p)/2,m=(h+g)/2,x=Math.abs(v-d),b=Math.abs(m-h),_="A"+x+","+b,w=v+x+","+m;return"M"+w+_+" 0 1,1 "+v+","+(m-b)+_+" 0 0,1 "+w+"Z"}function l(t,e,r){return t.replace(v.segmentRE,function(t){var n=0,a=t.charAt(0),i=v.paramIsX[a],o=v.paramIsY[a],l=v.numParams[a],s=t.substr(1).replace(v.paramRE,function(t){return i[n]?t=e(t):o[n]&&(t=r(t)),n++,n>l&&(t="X"),t});return n>l&&(s=s.replace(/[\s,]*X.*/,""),u.log("Ignoring extra params in segment "+t)),a+s})}function s(t,e,r){return t.replace(v.segmentRE,function(t){var n=0,a=t.charAt(0),i=v.paramIsX[a],o=v.paramIsY[a],l=v.numParams[a];return a+t.substr(1).replace(v.paramRE,function(t){return n>=l?t:(i[n]?t=e(t):o[n]&&(t=r(t)),n++,t)})})}var c=t("../../plotly"),u=t("../../lib"),f=t("../../plots/cartesian/axes"),d=t("../color"),p=t("../drawing"),h=t("../dragelement"),g=t("../../lib/setcursor"),v=t("./constants"),y=t("./helpers");e.exports={draw:n,drawOne:a}},{"../../lib":149,"../../lib/setcursor":167,"../../plotly":184,"../../plots/cartesian/axes":189,"../color":34,"../dragelement":55,"../drawing":58,"./constants":113,"./helpers":116}],116:[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,i=t._fullLayout._size;if(e){var o=r.shapePositionToRange(e);a=function(t){return e._offset+e.r2p(o(t,!0))},"date"===e.type&&(a=r.decodeDate(a))}else a=n?function(t){return i.t+i.h*(1-t)}:function(t){return i.l+i.w*t};return a},r.getPixelToData=function(t,e,n){var a,i=t._fullLayout._size;if(e){var o=r.rangeToShapePosition(e);a=function(t){return o(e.p2r(t-e._offset))}}else a=n?function(t){return 1-(t-i.t)/i.h}:function(t){return(t-i.l)/i.w};return a}},{}],117:[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":111,"./calc_autorange":112,"./defaults":114,"./draw":115}],118:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("./attributes"),o=t("./helpers");e.exports=function(t,e,r,l,s){function c(r,a){return n.coerce(t,e,i,r,a)}if(l=l||{},s=s||{},!c("visible",!s.itemIsNotPlainObject))return e;c("layer"),c("opacity"),c("fillcolor"),c("line.color"),c("line.width"),c("line.dash");for(var u=t.path?"path":"rect",f=c("type",u),d=["x","y"],p=0;p<2;p++){var h=d[p],g={_fullLayout:r},v=a.coerceRef(t,e,g,h,"","paper");if("path"!==f){var y,m,x;"paper"!==v?(y=a.getFromId(g,v),x=o.rangeToShapePosition(y),m=o.shapePositionToRange(y)):m=x=n.identity;var b=h+"0",_=h+"1",w=t[b],k=t[_];t[b]=m(t[b],!0),t[_]=m(t[_],!0),a.coercePosition(e,g,c,v,b,.25),a.coercePosition(e,g,c,v,_,.75),e[b]=x(e[b]),e[_]=x(e[_]),t[b]=w,t[_]=k}}return"path"===f?c("path"):n.noneOrAll(t,e,["x0","x1","y0","y1"]),e}},{"../../lib":149,"../../plots/cartesian/axes":189,"./attributes":111,"./helpers":116}],119:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../../plots/pad_attributes"),i=t("../../lib/extend").extendDeepAll,o=t("../../plot_api/edit_types").overrideAll,l=t("../../plots/animation_attributes"),s=t("./constants"),c={_isLinkedToArray:"step",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}};e.exports=o({_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:n({})},font: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}},"arraydraw","from-root")},{"../../lib/extend":143,"../../plot_api/edit_types":173,"../../plots/animation_attributes":185,"../../plots/font_attributes":213,"../../plots/pad_attributes":217,"./constants":120}],120:[function(t,e,r){"use strict";e.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}], -121:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return i.coerce(t,e,l,r,n)}n("visible",a(t,e).length>0)&&(n("active"),n("x"),n("y"),i.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"),i.coerceFont(n,"font",r.font),n("currentvalue.visible")&&(n("currentvalue.xanchor"),n("currentvalue.prefix"),n("currentvalue.suffix"),n("currentvalue.offset"),i.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 i.coerce(n,a,u,t,e)}for(var n,a,o=t.steps||[],l=e.steps=[],s=0;s=r.steps.length&&(r.active=0),e.call(l,r).call(b,r).call(u,r).call(h,r).call(x,t,r).call(s,t,r),A.setTranslate(e,r.lx+r.pad.l,r.ly+r.pad.t),e.call(v,r,r.active/(r.steps.length-1),!1),e.call(l,r)}function l(t,e,r){if(e.currentvalue.visible){var n,a,i=t.selectAll("text").data([0]);switch(e.currentvalue.xanchor){case"right":n=e.inputAreaLength-C.currentValueInset-e.currentValueMaxWidth,a="left";break;case"center":n=.5*e.inputAreaLength,a="middle";break;default:n=C.currentValueInset,a="left"}i.enter().append("text").classed(C.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":a,"data-notex":1});var o=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)o+=r;else{o+=e.steps[e.active].label}e.currentvalue.suffix&&(o+=e.currentvalue.suffix),i.call(A.font,e.currentvalue.font).text(o).call(T.convertToTspans,e.gd);var l=T.lineCount(i),s=(e.currentValueMaxLines+1-l)*e.currentvalue.font.size*S;return T.positionText(i,n,s),i}}function s(t,e,r){var n=t.selectAll("rect."+C.gripRectClass).data([0]);n.enter().append("rect").classed(C.gripRectClass,!0).call(p,e,t,r).style("pointer-events","all"),n.attr({width:C.gripWidth,height:C.gripHeight,rx:C.gripRadius,ry:C.gripRadius}).call(M.stroke,r.bordercolor).call(M.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function c(t,e,r){var n=t.selectAll("text").data([0]);return n.enter().append("text").classed(C.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1}),n.call(A.font,r.font).text(e.step.label).call(T.convertToTspans,r.gd),n}function u(t,e){var r=t.selectAll("g."+C.labelsClass).data([0]);r.enter().append("g").classed(C.labelsClass,!0);var n=r.selectAll("g."+C.labelGroupClass).data(e.labelSteps);n.enter().append("g").classed(C.labelGroupClass,!0),n.exit().remove(),n.each(function(t){var r=w.select(this);r.call(c,t,e),A.setTranslate(r,y(e,t.fraction),C.tickOffset+e.ticklen+e.font.size*S+C.labelOffset+e.currentValueTotalHeight)})}function f(t,e,r,n,a){var i=Math.round(n*(r.steps.length-1));i!==r.active&&d(t,e,r,i,!0,a)}function d(t,e,r,n,a,i){var o=r.active;r._input.active=r.active=n;var s=r.steps[r.active];e.call(v,r,r.active/(r.steps.length-1),i),e.call(l,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:a,previousActive:o}),s&&s.method&&a&&(e._nextMethod?(e._nextMethod.step=s,e._nextMethod.doCallback=a,e._nextMethod.doTransition=i):(e._nextMethod={step:s,doCallback:a,doTransition:i},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(r.execute&&k.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function p(t,e,r){function n(){return r.data()[0]}var a=r.node(),i=w.select(e);t.on("mousedown",function(){var t=n();e.emit("plotly_sliderstart",{slider:t});var o=r.select("."+C.gripRectClass);w.event.stopPropagation(),w.event.preventDefault(),o.call(M.fill,t.activebgcolor);var l=m(t,w.mouse(a)[0]);f(e,r,t,l,!0),t._dragging=!0,i.on("mousemove",function(){var t=n(),i=m(t,w.mouse(a)[0]);f(e,r,t,i,!1)}),i.on("mouseup",function(){var t=n();t._dragging=!1,o.call(M.fill,t.bgcolor),i.on("mouseup",null),i.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function h(t,e){var r=t.selectAll("rect."+C.tickRectClass).data(e.steps);r.enter().append("rect").classed(C.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each(function(t,r){var n=r%e.labelStride==0,a=w.select(this);a.attr({height:n?e.ticklen:e.minorticklen}).call(M.fill,e.tickcolor),A.setTranslate(a,y(e,r/(e.steps.length-1))-.5*e.tickwidth,(n?C.tickOffset:C.minorTickOffset)+e.currentValueTotalHeight)})}function g(t){t.labelSteps=[];for(var e=t.steps.length,r=0;r0&&(o=o.transition().duration(e.transition.duration).ease(e.transition.easing)),o.attr("transform","translate("+(i-.5*C.gripWidth)+","+e.currentValueTotalHeight+")")}}function y(t,e){return t.inputAreaStart+C.stepInset+(t.inputAreaLength-2*C.stepInset)*Math.min(1,Math.max(0,e))}function m(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(p,e,t,r).style("pointer-events","all"),n.attr({width:r.inputAreaLength,height:Math.max(r.inputAreaWidth,C.tickOffset+r.ticklen+r.labelHeight)}).call(M.fill,r.bgcolor).attr("opacity",0),A.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(M.stroke,e.bordercolor).call(M.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),A.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 g={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[_.side];e.attr("transform","translate("+g+")")}}}var v,y=r.propContainer,m=r.propName,x=r.traceIndex,b=r.dfltName,_=r.avoid||{},w=r.attributes,k=r.transform,M=r.containerGroup,A=t._fullLayout,T=y.titlefont.family,L=y.titlefont.size,C=y.titlefont.color,S=1,O=!1,z=y.title.trim();"title"===m?v="titleText":-1!==m.indexOf("axis")?v="axisTitleText":m.indexOf(!0)&&(v="colorbarTitleText");var D=t._context.edits[v];""===z&&(S=0),z.match(d)&&(S=.2,O=!0,D||(z=""));var P=z||D;M||(M=A._infolayer.selectAll(".g-"+e).data([0]),M.enter().append("g").classed("g-"+e,!0));var E=M.selectAll("text").data(P?[0]:[]);if(E.enter().append("text"),E.text(z).attr("class",e),E.exit().remove(),P){E.call(p);var N="Click to enter "+b+" title";D&&(z?E.on(".opacity",null):function(){S=0,O=!0,z=N,E.text(z).on("mouseover.opacity",function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)})}(),E.call(u.makeEditable,{gd:t}).on("edit",function(e){void 0!==x?i.restyle(t,m,e,x):i.relayout(t,m,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(p)}).on("input",function(t){this.text(t||" ").call(u.positionText,w.x,w.y)})),E.classed("js-placeholder",O)}}},{"../../constants/interactions":132,"../../lib":149,"../../lib/svg_text_utils":169,"../../plotly":184,"../../plots/plots":218,"../color":34,"../drawing":58,d3:7,"fast-isnumeric":10}],125:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,l=t("../../plots/pad_attributes"),s={_isLinkedToArray:"button",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}};e.exports=o({_isLinkedToArray:"updatemenu",_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:s,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i({},l,{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}},"arraydraw","from-root")},{"../../lib/extend":143,"../../plot_api/edit_types":173,"../../plots/font_attributes":213,"../../plots/pad_attributes":217,"../color/attributes":33}],126:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],127:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return i.coerce(t,e,l,r,n)}n("visible",a(t,e).length>0)&&(n("active"),n("direction"),n("type"),n("showactive"),n("x"),n("y"),i.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),i.coerceFont(n,"font",r.font),n("bgcolor",r.paper_bgcolor),n("bordercolor"),n("borderwidth"))}function a(t,e){function r(t,e){return i.coerce(n,a,u,t,e)}for(var n,a,o=t.buttons||[],l=e.buttons=[],s=0;s0?[0]:[]);if(i.enter().append("g").classed(S.containerClassName,!0).style("cursor","pointer"),i.exit().remove(),i.exit().size()&&_(t),0!==r.length){var u=i.selectAll("g."+S.headerGroupClassName).data(r,a);u.enter().append("g").classed(S.headerGroupClassName,!0);var f=i.selectAll("g."+S.dropdownButtonGroupClassName).data([0]);f.enter().append("g").classed(S.dropdownButtonGroupClassName,!0).style("pointer-events","all");for(var d=0;dk,T=n.barLength+2*n.barPad,L=n.barWidth+2*n.barPad,C=h,S=v+y;S+L>c&&(S=c-L);var O=this.container.selectAll("rect.scrollbar-horizontal").data(A?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,n.barColor),A?(this.hbar=O.attr({rx:n.barRadius,ry:n.barRadius,x:C,y:S,width:T,height:L}),this._hbarXMin=C+T/2,this._hbarTranslateMax=k-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var z=y>M,D=n.barWidth+2*n.barPad,P=n.barLength+2*n.barPad,E=h+g,N=v;E+D>s&&(E=s-D);var I=this.container.selectAll("rect.scrollbar-vertical").data(z?[0]:[]);I.exit().on(".drag",null).remove(),I.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,n.barColor),z?(this.vbar=I.attr({rx:n.barRadius,ry:n.barRadius,x:E,y:N,width:D,height:P}),this._vbarYMin=N+P/2,this._vbarTranslateMax=M-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,j=z?f+D+.5:f+.5,B=d-.5,q=A?p+L+.5:p+.5,H=l._topdefs.selectAll("#"+R).data(A||z?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",R).append("rect"),A||z?(this._clipRect=H.select("rect").attr({x:Math.floor(F),y:Math.floor(B),width:Math.ceil(j)-Math.floor(F),height:Math.ceil(q)-Math.floor(B)}),this.container.call(o.setClipUrl,R),this.bg.attr({x:h,y:v,width:g,height:y})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),A||z){var V=a.behavior.drag().on("dragstart",function(){a.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var U=a.behavior.drag().on("dragstart",function(){a.event.sourceEvent.preventDefault(),a.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));A&&this.hbar.on(".drag",null).call(U),z&&this.vbar.on(".drag",null).call(U)}this.setTranslate(e,r)},n.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},n.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=a.event.dx),this.vbar&&(e-=a.event.dy),this.setTranslate(t,e)},n.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=a.event.deltaY),this.vbar&&(e+=a.event.deltaY),this.setTranslate(t,e)},n.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,n=r+this._hbarTranslateMax;t=(l.constrain(a.event.x,r,n)-r)/(n-r)*(this.position.w-this._box.w)}if(this.vbar){var i=e+this._vbarYMin,o=i+this._vbarTranslateMax;e=(l.constrain(a.event.y,i,o)-i)/(o-i)*(this.position.h-this._box.h)}this.setTranslate(t,e)},n.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=l.constrain(t||0,0,r),e=l.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(o.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var a=t/r;this.hbar.call(o.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var i=e/n;this.vbar.call(o.setTranslate,t,e+i*this._vbarTranslateMax)}}},{"../../lib":149,"../color":34,"../drawing":58,d3:7}],131:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},LINE_SPACING:1.3,MID_SHIFT:.35}},{}],132:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300,DESELECTDIM:.2}},{}],133:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,MINUS_SIGN:"\u2212"}},{}],134:[function(t,e,r){"use strict";e.exports={entityToUnicode:{mu:"\u03bc","#956":"\u03bc",amp:"&","#28":"&",lt:"<","#60":"<",gt:">","#62":">",nbsp:"\xa0","#160":"\xa0",times:"\xd7","#215":"\xd7",plusmn:"\xb1","#177":"\xb1",deg:"\xb0","#176":"\xb0"}}},{}],135:[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}},{}],136:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.31.1",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/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":27,"./components/annotations3d":32,"./components/fx":75,"./components/images":83,"./components/legend":92,"./components/rangeselector":104,"./components/rangeslider":110,"./components/shapes":117,"./components/sliders":123,"./components/updatemenus":129,"./fonts/mathjax_config":137,"./lib/queue":162,"./plot_api/plot_schema":178,"./plot_api/register":179,"./plot_api/set_plot_config":180,"./plot_api/to_image":182,"./plot_api/validate":183,"./plotly":184,"./snapshot":230, +121:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return i.coerce(t,e,l,r,n)}n("visible",a(t,e).length>0)&&(n("active"),n("x"),n("y"),i.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"),i.coerceFont(n,"font",r.font),n("currentvalue.visible")&&(n("currentvalue.xanchor"),n("currentvalue.prefix"),n("currentvalue.suffix"),n("currentvalue.offset"),i.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 i.coerce(n,a,u,t,e)}for(var n,a,o=t.steps||[],l=e.steps=[],s=0;s=r.steps.length&&(r.active=0),e.call(l,r).call(b,r).call(u,r).call(h,r).call(x,t,r).call(s,t,r),A.setTranslate(e,r.lx+r.pad.l,r.ly+r.pad.t),e.call(v,r,r.active/(r.steps.length-1),!1),e.call(l,r)}function l(t,e,r){if(e.currentvalue.visible){var n,a,i=t.selectAll("text").data([0]);switch(e.currentvalue.xanchor){case"right":n=e.inputAreaLength-C.currentValueInset-e.currentValueMaxWidth,a="left";break;case"center":n=.5*e.inputAreaLength,a="middle";break;default:n=C.currentValueInset,a="left"}i.enter().append("text").classed(C.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":a,"data-notex":1});var o=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)o+=r;else{o+=e.steps[e.active].label}e.currentvalue.suffix&&(o+=e.currentvalue.suffix),i.call(A.font,e.currentvalue.font).text(o).call(T.convertToTspans,e.gd);var l=T.lineCount(i),s=(e.currentValueMaxLines+1-l)*e.currentvalue.font.size*S;return T.positionText(i,n,s),i}}function s(t,e,r){var n=t.selectAll("rect."+C.gripRectClass).data([0]);n.enter().append("rect").classed(C.gripRectClass,!0).call(p,e,t,r).style("pointer-events","all"),n.attr({width:C.gripWidth,height:C.gripHeight,rx:C.gripRadius,ry:C.gripRadius}).call(M.stroke,r.bordercolor).call(M.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function c(t,e,r){var n=t.selectAll("text").data([0]);return n.enter().append("text").classed(C.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1}),n.call(A.font,r.font).text(e.step.label).call(T.convertToTspans,r.gd),n}function u(t,e){var r=t.selectAll("g."+C.labelsClass).data([0]);r.enter().append("g").classed(C.labelsClass,!0);var n=r.selectAll("g."+C.labelGroupClass).data(e.labelSteps);n.enter().append("g").classed(C.labelGroupClass,!0),n.exit().remove(),n.each(function(t){var r=w.select(this);r.call(c,t,e),A.setTranslate(r,y(e,t.fraction),C.tickOffset+e.ticklen+e.font.size*S+C.labelOffset+e.currentValueTotalHeight)})}function f(t,e,r,n,a){var i=Math.round(n*(r.steps.length-1));i!==r.active&&d(t,e,r,i,!0,a)}function d(t,e,r,n,a,i){var o=r.active;r._input.active=r.active=n;var s=r.steps[r.active];e.call(v,r,r.active/(r.steps.length-1),i),e.call(l,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:a,previousActive:o}),s&&s.method&&a&&(e._nextMethod?(e._nextMethod.step=s,e._nextMethod.doCallback=a,e._nextMethod.doTransition=i):(e._nextMethod={step:s,doCallback:a,doTransition:i},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(r.execute&&k.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function p(t,e,r){function n(){return r.data()[0]}var a=r.node(),i=w.select(e);t.on("mousedown",function(){var t=n();e.emit("plotly_sliderstart",{slider:t});var o=r.select("."+C.gripRectClass);w.event.stopPropagation(),w.event.preventDefault(),o.call(M.fill,t.activebgcolor);var l=m(t,w.mouse(a)[0]);f(e,r,t,l,!0),t._dragging=!0,i.on("mousemove",function(){var t=n(),i=m(t,w.mouse(a)[0]);f(e,r,t,i,!1)}),i.on("mouseup",function(){var t=n();t._dragging=!1,o.call(M.fill,t.bgcolor),i.on("mouseup",null),i.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function h(t,e){var r=t.selectAll("rect."+C.tickRectClass).data(e.steps);r.enter().append("rect").classed(C.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each(function(t,r){var n=r%e.labelStride==0,a=w.select(this);a.attr({height:n?e.ticklen:e.minorticklen}).call(M.fill,e.tickcolor),A.setTranslate(a,y(e,r/(e.steps.length-1))-.5*e.tickwidth,(n?C.tickOffset:C.minorTickOffset)+e.currentValueTotalHeight)})}function g(t){t.labelSteps=[];for(var e=t.steps.length,r=0;r0&&(o=o.transition().duration(e.transition.duration).ease(e.transition.easing)),o.attr("transform","translate("+(i-.5*C.gripWidth)+","+e.currentValueTotalHeight+")")}}function y(t,e){return t.inputAreaStart+C.stepInset+(t.inputAreaLength-2*C.stepInset)*Math.min(1,Math.max(0,e))}function m(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(p,e,t,r).style("pointer-events","all"),n.attr({width:r.inputAreaLength,height:Math.max(r.inputAreaWidth,C.tickOffset+r.ticklen+r.labelHeight)}).call(M.fill,r.bgcolor).attr("opacity",0),A.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(M.stroke,e.bordercolor).call(M.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),A.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 g={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[_.side];e.attr("transform","translate("+g+")")}}}var v,y=r.propContainer,m=r.propName,x=r.traceIndex,b=r.dfltName,_=r.avoid||{},w=r.attributes,k=r.transform,M=r.containerGroup,A=t._fullLayout,T=y.titlefont.family,L=y.titlefont.size,C=y.titlefont.color,S=1,O=!1,z=y.title.trim();"title"===m?v="titleText":-1!==m.indexOf("axis")?v="axisTitleText":m.indexOf(!0)&&(v="colorbarTitleText");var D=t._context.edits[v];""===z&&(S=0),z.match(d)&&(S=.2,O=!0,D||(z=""));var P=z||D;M||(M=A._infolayer.selectAll(".g-"+e).data([0]),M.enter().append("g").classed("g-"+e,!0));var E=M.selectAll("text").data(P?[0]:[]);if(E.enter().append("text"),E.text(z).attr("class",e),E.exit().remove(),P){E.call(p);var N="Click to enter "+b+" title";D&&(z?E.on(".opacity",null):function(){S=0,O=!0,z=N,E.text(z).on("mouseover.opacity",function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)})}(),E.call(u.makeEditable,{gd:t}).on("edit",function(e){void 0!==x?i.restyle(t,m,e,x):i.relayout(t,m,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(p)}).on("input",function(t){this.text(t||" ").call(u.positionText,w.x,w.y)})),E.classed("js-placeholder",O)}}},{"../../constants/interactions":132,"../../lib":149,"../../lib/svg_text_utils":169,"../../plotly":184,"../../plots/plots":218,"../color":34,"../drawing":58,d3:7,"fast-isnumeric":10}],125:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,l=t("../../plots/pad_attributes"),s={_isLinkedToArray:"button",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}};e.exports=o({_isLinkedToArray:"updatemenu",_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:s,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i({},l,{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}},"arraydraw","from-root")},{"../../lib/extend":143,"../../plot_api/edit_types":173,"../../plots/font_attributes":213,"../../plots/pad_attributes":217,"../color/attributes":33}],126:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],127:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return i.coerce(t,e,l,r,n)}n("visible",a(t,e).length>0)&&(n("active"),n("direction"),n("type"),n("showactive"),n("x"),n("y"),i.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),i.coerceFont(n,"font",r.font),n("bgcolor",r.paper_bgcolor),n("bordercolor"),n("borderwidth"))}function a(t,e){function r(t,e){return i.coerce(n,a,u,t,e)}for(var n,a,o=t.buttons||[],l=e.buttons=[],s=0;s0?[0]:[]);if(i.enter().append("g").classed(S.containerClassName,!0).style("cursor","pointer"),i.exit().remove(),i.exit().size()&&_(t),0!==r.length){var u=i.selectAll("g."+S.headerGroupClassName).data(r,a);u.enter().append("g").classed(S.headerGroupClassName,!0);var f=i.selectAll("g."+S.dropdownButtonGroupClassName).data([0]);f.enter().append("g").classed(S.dropdownButtonGroupClassName,!0).style("pointer-events","all");for(var d=0;dk,T=n.barLength+2*n.barPad,L=n.barWidth+2*n.barPad,C=h,S=v+y;S+L>c&&(S=c-L);var O=this.container.selectAll("rect.scrollbar-horizontal").data(A?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,n.barColor),A?(this.hbar=O.attr({rx:n.barRadius,ry:n.barRadius,x:C,y:S,width:T,height:L}),this._hbarXMin=C+T/2,this._hbarTranslateMax=k-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var z=y>M,D=n.barWidth+2*n.barPad,P=n.barLength+2*n.barPad,E=h+g,N=v;E+D>s&&(E=s-D);var I=this.container.selectAll("rect.scrollbar-vertical").data(z?[0]:[]);I.exit().on(".drag",null).remove(),I.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,n.barColor),z?(this.vbar=I.attr({rx:n.barRadius,ry:n.barRadius,x:E,y:N,width:D,height:P}),this._vbarYMin=N+P/2,this._vbarTranslateMax=M-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,j=z?f+D+.5:f+.5,B=d-.5,q=A?p+L+.5:p+.5,H=l._topdefs.selectAll("#"+R).data(A||z?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",R).append("rect"),A||z?(this._clipRect=H.select("rect").attr({x:Math.floor(F),y:Math.floor(B),width:Math.ceil(j)-Math.floor(F),height:Math.ceil(q)-Math.floor(B)}),this.container.call(o.setClipUrl,R),this.bg.attr({x:h,y:v,width:g,height:y})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),A||z){var V=a.behavior.drag().on("dragstart",function(){a.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var U=a.behavior.drag().on("dragstart",function(){a.event.sourceEvent.preventDefault(),a.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));A&&this.hbar.on(".drag",null).call(U),z&&this.vbar.on(".drag",null).call(U)}this.setTranslate(e,r)},n.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},n.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=a.event.dx),this.vbar&&(e-=a.event.dy),this.setTranslate(t,e)},n.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=a.event.deltaY),this.vbar&&(e+=a.event.deltaY),this.setTranslate(t,e)},n.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,n=r+this._hbarTranslateMax;t=(l.constrain(a.event.x,r,n)-r)/(n-r)*(this.position.w-this._box.w)}if(this.vbar){var i=e+this._vbarYMin,o=i+this._vbarTranslateMax;e=(l.constrain(a.event.y,i,o)-i)/(o-i)*(this.position.h-this._box.h)}this.setTranslate(t,e)},n.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=l.constrain(t||0,0,r),e=l.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(o.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var a=t/r;this.hbar.call(o.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var i=e/n;this.vbar.call(o.setTranslate,t,e+i*this._vbarTranslateMax)}}},{"../../lib":149,"../color":34,"../drawing":58,d3:7}],131:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},LINE_SPACING:1.3,MID_SHIFT:.35}},{}],132:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300,DESELECTDIM:.2}},{}],133:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,MINUS_SIGN:"\u2212"}},{}],134:[function(t,e,r){"use strict";e.exports={entityToUnicode:{mu:"\u03bc","#956":"\u03bc",amp:"&","#28":"&",lt:"<","#60":"<",gt:">","#62":">",nbsp:"\xa0","#160":"\xa0",times:"\xd7","#215":"\xd7",plusmn:"\xb1","#177":"\xb1",deg:"\xb0","#176":"\xb0"}}},{}],135:[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}},{}],136:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.31.2",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/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":27,"./components/annotations3d":32,"./components/fx":75,"./components/images":83,"./components/legend":92,"./components/rangeselector":104,"./components/rangeslider":110,"./components/shapes":117,"./components/sliders":123,"./components/updatemenus":129,"./fonts/mathjax_config":137,"./lib/queue":162,"./plot_api/plot_schema":178,"./plot_api/register":179,"./plot_api/set_plot_config":180,"./plot_api/to_image":182,"./plot_api/validate":183,"./plotly":184,"./snapshot":230, "./snapshot/download":227,"./traces/scatter":271,d3:7,"es6-promise":8}],137:[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},{}],138:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../constants/numerical").BADNUM,i=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(i,"")),n(t)?Number(t):a}},{"../constants/numerical":133,"fast-isnumeric":10}],139:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("tinycolor2"),i=t("../plots/attributes"),o=t("../components/colorscale/get_scale"),l=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),s=t("./regex").counter;r.valObjectMeta={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),-1===n.values.indexOf(t)?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;na.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,a){t%1||!n(t)||void 0!==a.min&&ta.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var a="number"==typeof t;!0!==n.strict&&a?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){a(t).isValid()?e.set(t):e.set(r)}},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){if("string"==typeof t&&s(r).test(t))return void e.set(t);e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!s(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"!=typeof t)return void e.set(r);if(-1!==(n.extras||[]).indexOf(t))return void e.set(t);for(var a=t.split("+"),i=0;i0&&(o=o.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+o}return n}function s(t){return t.formatDate("yyyy")}function c(t){return t.formatDate("M yyyy")}function u(t){return t.formatDate("M d")}function f(t){return t.formatDate("M d, yyyy")}var d=t("d3"),p=t("fast-isnumeric"),h=t("./loggers").error,g=t("./mod"),v=t("../constants/numerical"),y=v.BADNUM,m=v.ONEDAY,x=v.ONEHOUR,b=v.ONEMIN,_=v.ONESEC,w=v.EPOCHJD,k=t("../registry"),M=d.time.format.utc,A=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,T=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,L=(new Date).getFullYear()-70;r.dateTick0=function(t,e){return n(t)?e?k.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:k.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},r.dfltRange=function(t){return n(t)?k.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},r.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime};var C,S;r.dateTime2ms=function(t,e){if(r.isJSDate(t))return t=Number(t)-t.getTimezoneOffset()*b,t>=C&&t<=S?t:y;if("string"!=typeof t&&"number"!=typeof t)return y;t=String(t);var a=n(e),i=t.charAt(0);!a||"G"!==i&&"g"!==i||(t=t.substr(1),e="");var o=a&&"chinese"===e.substr(0,7),l=t.match(o?T:A);if(!l)return y;var s=l[1],c=l[3]||"1",u=Number(l[5]||1),f=Number(l[7]||0),d=Number(l[9]||0),p=Number(l[11]||0);if(a){if(2===s.length)return y;s=Number(s);var h;try{var g=k.getComponentMethod("calendars","getCal")(e);if(o){var v="i"===c.charAt(c.length-1);c=parseInt(c,10),h=g.newDate(s,g.toMonthIndex(s,c,v),u)}else h=g.newDate(s,Number(c),u)}catch(t){return y}return h?(h.toJD()-w)*m+f*x+d*b+p*_:y}s=2===s.length?(Number(s)+2e3-L)%100+L:Number(s),c-=1;var M=new Date(Date.UTC(2e3,c,u,f,d));return M.setUTCFullYear(s),M.getUTCMonth()!==c?y:M.getUTCDate()!==u?y:M.getTime()+p*_},C=r.MIN_MS=r.dateTime2ms("-9999"),S=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==y};var O=90*m,z=3*x,D=5*b;r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=C&&t<=S))return y;e||(e=0);var a,o,l,s,c,u,f=Math.floor(10*g(t+.05,1)),d=Math.round(t-f/10);if(n(r)){var p=Math.floor(d/m)+w,h=Math.floor(g(t,m));try{a=k.getComponentMethod("calendars","getCal")(r).fromJD(p).formatDate("yyyy-mm-dd")}catch(t){a=M("G%Y-%m-%d")(new Date(d))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;o=e=C+m&&t<=S-m))return y;var e=Math.floor(10*g(t+.05,1)),r=new Date(Math.round(t-e/10));return i(d.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,a){if(r.isJSDate(t)||"number"==typeof t){if(n(a))return h("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,a))return h("unrecognized date",t),e;return t};var P=/%\d?f/g,E=[59,59.9,59.99,59.999,59.9999],N=M("%Y"),I=M("%b %Y"),R=M("%b %-d"),F=M("%b %-d, %Y");r.formatDate=function(t,e,r,a){var i,d;if(a=n(a)&&a,e)return o(e,t,a);if(a)try{var p=Math.floor((t+.05)/m)+w,h=k.getComponentMethod("calendars","getCal")(a).fromJD(p);"y"===r?d=s(h):"m"===r?d=c(h):"d"===r?(i=s(h),d=u(h)):(i=f(h),d=l(t,r))}catch(t){return"Invalid"}else{var g=new Date(Math.floor(t+.05));"y"===r?d=N(g):"m"===r?d=I(g):"d"===r?(i=N(g),d=R(g)):(i=F(g),d=l(t,r))}return d+(i?"\n"+i:"")};var j=3*m;r.incrementMonth=function(t,e,r){r=n(r)&&r;var a=g(t,m);if(t=Math.round(t-a),r)try{var i=Math.round(t/m)+w,o=k.getComponentMethod("calendars","getCal")(r),l=o.fromJD(i);return e%12?o.add(l,e,"m"):o.add(l,e/12,"y"),(l.toJD()-w)*m+a}catch(e){h("invalid ms "+t+" in calendar "+r)}var s=new Date(t+j);return s.setUTCMonth(s.getUTCMonth()+e)+a-j},r.findExactDates=function(t,e){for(var r,a,i=0,o=0,l=0,s=0,c=n(e)&&k.getComponentMethod("calendars","getCal")(e),u=0;u1||g<0||g>1?null:{x:t+s*g,y:e+f*g}}function a(t,e,r,n,a){var i=n*t+a*e;if(i<0)return n*n+a*a;if(i>r){var o=n-t,l=a-e;return o*o+l*l}var s=n*e-a*t;return s*s/r}var i=t("./mod");r.segmentsIntersect=n,r.segmentDistance=function(t,e,r,i,o,l,s,c){if(n(t,e,r,i,o,l,s,c))return 0;var u=r-t,f=i-e,d=s-o,p=c-l,h=u*u+f*f,g=d*d+p*p,v=Math.min(a(u,f,h,o-t,l-e),a(u,f,h,s-t,c-e),a(d,p,g,t-o,e-l),a(d,p,g,r-o,i-l));return Math.sqrt(v)};var o,l,s;r.getTextLocation=function(t,e,r,n){if(t===l&&n===s||(o={},l=t,s=n),o[r])return o[r];var a=t.getPointAtLength(i(r-n/2,e)),c=t.getPointAtLength(i(r+n/2,e)),u=Math.atan((c.y-a.y)/(c.x-a.x)),f=t.getPointAtLength(i(r,e)),d=(4*f.x+a.x+c.x)/6,p=(4*f.y+a.y+c.y)/6,h={x:d,y:p,theta:u};return o[r]=h,h},r.clearLocationCache=function(){l=null},r.getVisibleSegment=function(t,e,r){function n(e){var r=t.getPointAtLength(e);0===e?a=r:e===f&&(i=r);var n=r.xl?r.x-l:0,u=r.yc?r.y-c:0;return Math.sqrt(n*n+u*u)}for(var a,i,o=e.left,l=e.right,s=e.top,c=e.bottom,u=0,f=t.getTotalLength(),d=f,p=n(u);p;){if((u+=p+r)>d)return;p=n(u)}for(p=n(d);p;){if(d-=p+r,u>d)return;p=n(d)}return{min:u,max:d,len:d-u,total:f,isClosed:0===u&&d===f&&Math.abs(a.x-i.x)<.1&&Math.abs(a.y-i.y)<.1}}},{"./mod":155}],147:[function(t,e,r){"use strict";e.exports=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t}},{}],148:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],149:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../constants/numerical"),o=i.FP_SAFE,l=i.BADNUM,s=e.exports={};s.nestedProperty=t("./nested_property"),s.keyedContainer=t("./keyed_container"),s.relativeAttr=t("./relative_attr"),s.isPlainObject=t("./is_plain_object"),s.isArray=t("./is_array"),s.mod=t("./mod"),s.toLogRange=t("./to_log_range"),s.relinkPrivateKeys=t("./relink_private"),s.ensureArray=t("./ensure_array");var c=t("./coerce");s.valObjectMeta=c.valObjectMeta,s.coerce=c.coerce,s.coerce2=c.coerce2,s.coerceFont=c.coerceFont,s.coerceHoverinfo=c.coerceHoverinfo,s.validate=c.validate;var u=t("./dates");s.dateTime2ms=u.dateTime2ms,s.isDateTime=u.isDateTime,s.ms2DateTime=u.ms2DateTime,s.ms2DateTimeLocal=u.ms2DateTimeLocal,s.cleanDate=u.cleanDate,s.isJSDate=u.isJSDate,s.formatDate=u.formatDate,s.incrementMonth=u.incrementMonth,s.dateTick0=u.dateTick0,s.dfltRange=u.dfltRange,s.findExactDates=u.findExactDates,s.MIN_MS=u.MIN_MS,s.MAX_MS=u.MAX_MS;var f=t("./search");s.findBin=f.findBin,s.sorterAsc=f.sorterAsc,s.sorterDes=f.sorterDes,s.distinctVals=f.distinctVals,s.roundUp=f.roundUp;var d=t("./stats");s.aggNums=d.aggNums,s.len=d.len,s.mean=d.mean,s.variance=d.variance,s.stdev=d.stdev,s.interp=d.interp;var p=t("./matrix");s.init2dArray=p.init2dArray,s.transposeRagged=p.transposeRagged,s.dot=p.dot,s.translationMatrix=p.translationMatrix,s.rotationMatrix=p.rotationMatrix,s.rotationXYMatrix=p.rotationXYMatrix,s.apply2DTransform=p.apply2DTransform,s.apply2DTransform2=p.apply2DTransform2;var h=t("./geometry2d");s.segmentsIntersect=h.segmentsIntersect,s.segmentDistance=h.segmentDistance,s.getTextLocation=h.getTextLocation,s.clearLocationCache=h.clearLocationCache,s.getVisibleSegment=h.getVisibleSegment;var g=t("./extend");s.extendFlat=g.extendFlat,s.extendDeep=g.extendDeep,s.extendDeepAll=g.extendDeepAll,s.extendDeepNoArrays=g.extendDeepNoArrays;var v=t("./loggers");s.log=v.log,s.warn=v.warn,s.error=v.error;var y=t("./regex");s.counterRegex=y.counter;var m=t("./throttle");s.throttle=m.throttle,s.throttleDone=m.done,s.clearThrottle=m.clear,s.getGraphDiv=t("./get_graph_div"),s.notifier=t("./notifier"),s.filterUnique=t("./filter_unique"),s.filterVisible=t("./filter_visible"),s.pushUnique=t("./push_unique"),s.cleanNumber=t("./clean_number"),s.ensureNumber=function(t){return a(t)?(t=Number(t),t<-o||t>o?l:a(t)?Number(t):l):l},s.noop=t("./noop"),s.identity=t("./identity"),s.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var a=0;ar?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},s.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},s.simpleMap=function(t,e,r,n){for(var a=t.length,i=new Array(a),o=0;o-1||u!==1/0&&u>=Math.pow(2,r)?t(e,r,n):s},s.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},s.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,a,i,o=t.length,l=2*o,s=2*e-1,c=new Array(s),u=new Array(o);for(r=0;r=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=t[a]*c[n];u[r]=i}return u},s.syncOrAsync=function(t,e,r){function n(){return s.syncOrAsync(t,e,r)}for(var a,i;t.length;)if(i=t.splice(0,1)[0],(a=i(e))&&a.then)return a.then(n).then(void 0,s.promiseError);return r&&r(e)},s.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},s.noneOrAll=function(t,e,r){if(t){var n,a,i=!1,o=!0;for(n=0;n1?a+o[1]:"";if(i&&(o.length>1||l.length>4||r))for(;n.test(l);)l=l.replace(n,"$1"+i+"$2");return l+s};var _=/%{([^\s%{}]*)}/g,w=/^\w*$/;s.templateString=function(t,e){var r={};return t.replace(_,function(t,n){return w.test(n)?e[n]||"":(r[n]=r[n]||s.nestedProperty(e,n).get,r[n]()||"")})}},{"../constants/numerical":133,"./clean_number":138,"./coerce":139,"./dates":140,"./ensure_array":141,"./extend":143,"./filter_unique":144,"./filter_visible":145,"./geometry2d":146,"./get_graph_div":147,"./identity":148,"./is_array":150,"./is_plain_object":151,"./keyed_container":152,"./loggers":153,"./matrix":154,"./mod":155,"./nested_property":156,"./noop":157,"./notifier":158,"./push_unique":161,"./regex":163,"./relative_attr":164,"./relink_private":165,"./search":166,"./stats":168,"./throttle":170,"./to_log_range":171,d3:7,"fast-isnumeric":10}],150:[function(t,e,r){"use strict";var n="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}};e.exports=function(t){return Array.isArray(t)||n.isView(t)}},{}],151:[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}},{}],152:[function(t,e,r){"use strict";var n=t("./nested_property"),a=/^\w*$/;e.exports=function(t,e,r,i){r=r||"name",i=i||"value";var o,l,s={};l=e&&e.length?n(t,e).get():t,e=e||"",l=l||[];var c={};for(o=0;o2)return s[e]=2|s[e],f.set(t,null);if(u){for(o=e;o1){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][0],i=t[e][1],s=!1,p(n))for(r=n.length-1;r>=0;r--)a(n[r],o(i,r))?s?n[r]=void 0:n.pop():s=!0;else if("object"==typeof n&&null!==n)for(l=Object.keys(n),s=!1,r=l.length-1;r>=0;r--)a(n[l[r]],o(i,l[r]))?delete n[l[r]]:s=!0;if(s)return}}function u(t){return void 0===t||null===t||"object"==typeof t&&(p(t)?!t.length:!Object.keys(t).length)}function f(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}var d=t("fast-isnumeric"),p=t("./is_array"),h=t("./is_plain_object"),g=t("../plot_api/container_array_match");e.exports=function(t,e){if(d(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,a,o,l=0,s=e.split(".");l/g),l=0;lo||n===a||ns)&&(!e||!u(t))}function r(t,e){var r=t[0],c=t[1];if(r===a||ro||c===a||cs)return!1;var u,f,d,p,h,g=n.length,v=n[0][0],y=n[0][1],m=0;for(u=1;uMath.max(f,v)||c>Math.max(d,y)))if(cu||Math.abs(n(o,d))>a)return!0;return!1};i.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){r(t.pop())}return{addPt:r,raw:t,filtered:n}}},{"../constants/numerical":133,"./matrix":154}],161:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){var r,n=e.toString();for(r=0;ri.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--)},o.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},o.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},o.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 o(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,p=0;for(u=e[e.length-1]>=e[0]?r?n:a:r?o:i;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,i=a/(n||1)/1e4,o=[e[0]],l=0;le[l]+i&&(a=Math.min(a,e[l+1]-e[l]),o.push(e[l+1]));return{vals:o,minDiff:a}},r.roundUp=function(t,e,r){for(var n,a=0,i=e.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;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":10}],169:[function(t,e,r){"use strict";function n(t,e){return t.node().getBoundingClientRect()[e]}function a(t){return t.replace(y,"\\lt ").replace(m,"\\gt ")}function i(t,e,r){var n="math-output-"+d.randstr([],64),i=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,i.node()],function(){var e=f.select("body").select("#MathJax_SVG_glyphs");if(i.select(".MathJax_SVG").empty()||!i.select("svg").node())d.log("There was an error in the tex syntax.",t),r();else{var n=i.select("svg").node().getBoundingClientRect();r(i.select(".MathJax_SVG"),e,n)}i.remove()})}function o(t,e){if(!t)return null;var r=t.match(e);return r&&(r[3]||r[4])}function l(t,e){if(!t)return"";for(var r=0;r1)for(var a=1;a.",e);var r=c.pop();t!==r.type&&d.log("Start tag <"+r.type+"> doesnt match end tag <"+t+">. Pretending it did match.",e),i=c[c.length-1].node}(M);else{var N=m[4],I={type:M},R=o(N,O);if(R?(R=R.replace(E,"$1 fill:"),A&&(R+=";"+A)):A&&(R=A),R&&(I.style=R),"a"===M){l=!0;var F=o(N,z);if(F){var j=document.createElement("a");j.href=F,-1!==k.indexOf(j.protocol)&&(I.href=encodeURI(F),I.target=o(N,D)||"_blank",I.popup=o(N,P))}}n(I)}}return l}function u(t,e,r){var n,a,i,o=r.horizontalAlign,l=r.verticalAlign||"top",s=t.node().getBoundingClientRect(),c=e.node().getBoundingClientRect();return a="bottom"===l?function(){return s.bottom-n.height}:"middle"===l?function(){return s.top+(s.height-n.height)/2}:function(){return s.top},i="right"===o?function(){return s.right-n.width}:"center"===o?function(){return s.left+(s.width-n.width)/2}:function(){return s.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:a()-c.top+"px",left:i()-c.left+"px","z-index":1e3}),this}}var f=t("d3"),d=t("../lib"),p=t("../constants/xmlns_namespaces"),h=t("../constants/string_mappings"),g=t("../constants/alignment").LINE_SPACING,v=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,a){function o(){u.empty()||(d=t.attr("class")+"-math",u.select("svg."+d).remove()),t.text("").style("white-space","pre"),c(t.node(),l)&&t.style("pointer-events","all"),r.positionText(t),a&&a.call(t)}var l=t.text(),s=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&l.match(v),u=f.select(t.node().parentNode);if(!u.empty()){var d=t.attr("class")?t.attr("class").split(" ")[0]:"text";return d+="-math",u.selectAll("svg."+d).remove(),u.selectAll("g."+d+"-group").remove(),t.style("display",null).attr({"data-unformatted":l,"data-math":"N"}),s?(e&&e._promises||[]).push(new Promise(function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10);i(s[2],{fontSize:r},function(i,s,c){u.selectAll("svg."+d).remove(),u.selectAll("g."+d+"-group").remove();var f=i&&i.select("svg");if(!f||!f.node())return o(),void e();var p=u.append("g").classed(d+"-group",!0).attr({"pointer-events":"none","data-unformatted":l,"data-math":"Y"});p.node().appendChild(f.node()),s&&s.node()&&f.node().insertBefore(s.node().cloneNode(!0),f.node().firstChild),f.attr({class:d,height:c.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var h=t.node().style.fill||"black";f.select("g").attr({fill:h,stroke:h});var g=n(f,"width"),v=n(f,"height"),y=+t.attr("x")-g*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],m=r||n(t,"height"),x=-m/4;"y"===d[0]?(p.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-g/2,x-v/2]+")"}),f.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===d[0]?f.attr({x:t.attr("x"),y:x-v/2}):"a"===d[0]?f.attr({x:0,y:x}):f.attr({x:y,y:+t.attr("y")+x-v/2}),a&&a.call(t,p),e(p)})})):o(),t}};var y=/(<|<|<)/g,m=/(>|>|>)/g,x={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},b={sub:"0.3em",sup:"-0.6em"},_={sub:"-0.21em",sup:"0.42em"},w="\u200b",k=["http:","https:","mailto:","",void 0,":"],M=new RegExp("]*)?/?>","g"),A=Object.keys(h.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:h.entityToUnicode[t]}}),T=/(\r\n?|\n)/g,L=/(<[^<>]*>)/,C=/<(\/?)([^ >]*)(\s+(.*))?>/i,S=//i,O=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,z=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,D=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,P=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i,E=/(^|;)\s*color:/;r.plainText=function(t){return(t||"").replace(M," ")},r.lineCount=function(t){return t.selectAll("tspan.line").size()||1},r.positionText=function(t,e,r){return t.each(function(){function t(t,e){return void 0===e?null===(e=n.attr(t))&&(n.attr(t,0),e=0):n.attr(t,e),e}var n=f.select(this),a=t("x",e),i=t("y",r);"text"===this.nodeName&&n.selectAll("tspan.line").attr({x:a,y:i})})},r.makeEditable=function(t,e){function r(){a(),t.style({opacity:0});var e,r=s.attr("class");(e=r?"."+r.split(" ")[0]+"-math-group":"[class*=-math-group]")&&f.select(t.node().parentNode).select(e).style({opacity:0})}function n(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}function a(){var r=f.select(i),a=r.select(".svg-container"),o=a.append("div"),s=t.node().style,c=parseFloat(s.fontSize||12);o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":s.fontFamily||"Arial","font-size":c,color:e.fill||s.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-c/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(e.text||t.attr("data-unformatted")).call(u(t,a,e)).on("blur",function(){i._editing=!1,t.text(this.textContent).style({opacity:1});var e,r=f.select(this).attr("class");(e=r?"."+r.split(" ")[0]+"-math-group":"[class*=-math-group]")&&f.select(t.node().parentNode).select(e).style({opacity:0});var n=this.textContent;f.select(this).transition().duration(0).remove(),f.select(document).on("mouseup",null),l.edit.call(t,n)}).on("focus",function(){var t=this;i._editing=!0,f.select(document).on("mouseup",function(){if(f.event.target===t)return!1;document.activeElement===o.node()&&o.node().blur()})}).on("keyup",function(){27===f.event.which?(i._editing=!1,t.style({opacity:1}),f.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),l.cancel.call(t,this.textContent)):(l.input.call(t,this.textContent),f.select(this).call(u(t,a,e)))}).on("keydown",function(){13===f.event.which&&this.blur()}).call(n)}var i=e.gd,o=e.delegate,l=f.dispatch("edit","input","cancel"),s=o||t;if(t.style({"pointer-events":o?"none":"all"}),1!==t.size())throw new Error("boo");return e.immediate?r():s.on("click",r),f.rebind(t,l,"on")}},{"../constants/alignment":131,"../constants/string_mappings":134,"../constants/xmlns_namespaces":135,"../lib":149,d3:7}],170:[function(t,e,r){"use strict";function n(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}var a={};r.throttle=function(t,e,r){function i(){r(),o.ts=Date.now(),o.onDone&&(o.onDone(),o.onDone=null)}var o=a[t],l=Date.now();if(!o){for(var s in a)a[s].tso.ts+e)return void i();o.timer=setTimeout(function(){i(),o.timer=null},e)},r.done=function(t){var e=a[t];return e&&e.timer?new Promise(function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}}):Promise.resolve()},r.clear=function(t){if(t)n(a[t]),delete a[t];else for(var e in a)r.clear(e)}},{}],171:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},{"fast-isnumeric":10}],172:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=t.split("[")[0],l=0;l0)return t.substr(0,e)}var l=t("fast-isnumeric"),s=t("gl-mat4/fromQuat"),c=t("../registry"),u=t("../lib"),f=t("../plots/plots"),d=t("../plots/cartesian/axes"),p=t("../components/color");r.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&u.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=d.list({_fullLayout:t});for(e=0;e3?(v.x=1.02,v.xanchor="left"):v.x<-2&&(v.x=-.02,v.xanchor="right"),v.y>3?(v.y=1.02,v.yanchor="bottom"):v.y<-2&&(v.y=-.02,v.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var y=f.getSubplotIds(t,"gl3d");for(e=0;e1&&o.warn("Full array edits are incompatible with other edits",f);var m=r[""][""];if(u(m))e.set(null);else{if(!Array.isArray(m))return o.warn("Unrecognized full array edit value",f,m),!0;e.set(m)}return!g&&(d(v,y),p(t),!0)}var x,b,_,w,k,M,A,T=Object.keys(r).map(Number).sort(l),L=e.get(),C=L||[],S=n(y,f).get(),O=[],z=-1,D=C.length;for(x=0;xC.length-(A?0:1))o.warn("index out of range",f,_);else if(void 0!==M)k.length>1&&o.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(M)?O.push(_):A?("add"===M&&(M={}),C.splice(_,0,M),S&&S.splice(_,0,{})):o.warn("Unrecognized full object edit value",f,_,M),-1===z&&(z=_);else for(b=0;b=0;x--)C.splice(O[x],1),S&&S.splice(O[x],1);if(C.length?L||e.set(C):e.set(null),g)return!1;if(d(v,y),h!==i){var P;if(-1===z)P=T;else{for(D=Math.max(C.length,D),P=[],x=0;x=z);x++)P.push(_);for(x=z;x=t.data.length||a<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(a,n+1)>-1||a>=0&&e.indexOf(-t.data.length+a)>-1||a<0&&e.indexOf(t.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function c(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),s(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&s(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function u(t,e,r){var n,a;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&sX.range[0]?[1,2]:[2,1]);else{var W=X.range[0],Q=X.range[1];Y?(W<=0&&Q<=0&&r(E+".autorange",!0),W<=0?W=Q/1e6:Q<=0&&(Q=W/1e6),r(E+".range[0]",Math.log(W)/Math.LN10),r(E+".range[1]",Math.log(Q)/Math.LN10)):(r(E+".range[0]",Math.pow(10,W)),r(E+".range[1]",Math.pow(10,Q)))}else r(E+".autorange",!0);A.getComponentMethod("annotations","convertCoords")(t,B,S,r),A.getComponentMethod("images","convertCoords")(t,B,S,r)}else r(E+".autorange",!0),r(E+".range",null);w.nestedProperty(c,E+"._inputRange").set(null)}else if(D.match(j.AX_NAME_PATTERN)){var $=w.nestedProperty(c,M).get(),J=(S||{}).type;J&&"-"!==J||(J="linear"),A.getComponentMethod("annotations","convertCoords")(t,$,J,r),A.getComponentMethod("images","convertCoords")(t,$,J,r)}var K=N.containerArrayMatch(M);if(K){i=K.array,o=K.index;var tt=K.property,et=w.nestedProperty(s,i),rt=(et||[])[o]||{},nt=rt,at=H||{editType:"calc"},it=-1!==at.editType.indexOf("calcIfAutorange");""===o?(it?m.calc=!0:F.update(m,at),it=!1):""===tt&&(nt=S,N.isAddVal(S)?b[M]=null:N.isRemoveVal(S)?(b[M]=rt,nt=rt):w.warn("unrecognized full object value",e)),it&&(n(nt,"x")||n(nt,"y"))?m.calc=!0:F.update(m,at),d[i]||(d[i]={});var ot=d[i][o];ot||(ot=d[i][o]={}),ot[tt]=S,delete e[M]}else"reverse"===D?(R.range?R.range.reverse():(r(E+".autorange",!0),R.range=[1,0]),B.autorange?m.calc=!0:m.plot=!0):((!c._has("gl2d")||"dragmode"!==M||"lasso"!==S&&"select"!==S||"lasso"===q||"select"===q)&&H?F.update(m,H):m.calc=!0,C.set(S))}}for(i in d){N.applyContainerArrayChanges(t,w.nestedProperty(s,i),d[i],m)||(m.plot=!0)}var lt=c._axisConstraintGroups;for(y in k)for(o=0;o=l.length?l[0]:l[t]:l}function a(t){return Array.isArray(s)?t>=s.length?s[0]:s[t]:s}function i(t,e){var r=0;return function(){if(t&&++r===e)return t()}}if(t=w.getGraphDiv(t),!w.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 o=t._transitionData;o._frameQueue||(o._frameQueue=[]),r=L.supplyAnimationDefaults(r);var l=r.transition,s=r.frame;return void 0===o._frameWaitingCnt&&(o._frameWaitingCnt=0),new Promise(function(s,c){function u(){t.emit("plotly_animated"),window.cancelAnimationFrame(o._animationRaf),o._animationRaf=null}function f(){o._currentFrame&&o._currentFrame.onComplete&&o._currentFrame.onComplete();var e=o._currentFrame=o._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,o._lastFrameAt=Date.now(),o._timeToNext=e.frameOpts.duration,L.transition(t,e.frame.data,e.frame.layout,I.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then(function(){e.onComplete&&e.onComplete()}),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else u()}function d(){t.emit("plotly_animating"),o._lastFrameAt=-1/0,o._timeToNext=0,o._runningTransitions=0,o._currentFrame=null;var e=function(){o._animationRaf=window.requestAnimationFrame(e),Date.now()-o._lastFrameAt>o._timeToNext&&f()};e()}function p(t){return Array.isArray(l)?v>=l.length?t.transitionOpts=l[v]:t.transitionOpts=l[0]:t.transitionOpts=l,v++,t}var h,g,v=0,y=[],m=void 0===e||null===e,x=Array.isArray(e);if(m||x||!w.isPlainObject(e)){if(m||-1!==["string","number"].indexOf(typeof e))for(h=0;h0&&kk)&&M.push(g);y=M}}y.length>0?function(e){if(0!==e.length){for(var l=0;l=0;a--)if(w.isPlainObject(e[a])){var d=(c[e[a].name]||{}).name,p=e[a].name;d&&p&&"number"==typeof p&&c[d]&&(n++,w.warn('addFrames: overwriting frame "'+c[d].name+'" with a frame whose name of type "number" also equates to "'+d+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),n>5&&w.warn("addFrames: This API call has yielded too many warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),f.push({frame:L.supplyFrameDefaults(e[a]),index:r&&void 0!==r[a]&&null!==r[a]?r[a]:u+a})}f.sort(function(t,e){return t.index>e.index?-1:t.index=0;a--){if(i=f[a].frame,"number"==typeof i.name&&w.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!i.name)for(;c[i.name="frame "+t._transitionData._counter++];);if(c[i.name]){for(o=0;o=0;r--)n=e[r],i.push({type:"delete",index:n}),o.unshift({type:"insert",index:n,value:a[n]});var l=L.modifyFrames,s=L.modifyFrames,c=[t,o],u=[t,i];return M&&M.add(t,l,c,s,u),L.modifyFrames(t,i)},_.purge=function(t){t=w.getGraphDiv(t);var e=t._fullLayout||{},r=t._fullData||[];return L.cleanPlot([],{},r,e),L.purge(t),k.purge(t),e._container&&e._container.remove(),delete t._context,t}},{"../components/color":34,"../components/drawing":58,"../components/errorbars":64,"../constants/xmlns_namespaces":135,"../lib":149,"../lib/events":142,"../lib/queue":162,"../lib/svg_text_utils":169,"../plotly":184,"../plots/cartesian/axis_ids":192,"../plots/cartesian/constants":194,"../plots/cartesian/constraints":196,"../plots/cartesian/graph_interact":198,"../plots/plots":218,"../plots/polar":221,"../registry":225,"./edit_types":173,"./helpers":174,"./manage_arrays":175,"./plot_schema":178,"./subroutines":181,d3:7,"fast-isnumeric":10,"has-hover":12}],177:[function(t,e,r){"use strict";e.exports={staticPlot:!1,editable:!1,edits:{annotationPosition:!1,annotationTail:!1,annotationText:!1,axisTitleText:!1,colorbarPosition:!1,colorbarTitleText:!1,legendPosition:!1,legendText:!1,shapePosition:!1,titleText:!1},autosizable:!1,queueLength:0,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showAxisDragHandles:!0,showAxisRangeEntryBoxes:!0,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:"transparent",topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:!1,globalTransforms:[]}},{}],178:[function(t,e,r){"use strict";function n(t,e){var r,n,a,i,o=t._basePlotModules;if(o){var l;for(r=0;r=t.items.length)return!1;t=t.items[a]}}return t}function i(t){return t===Math.round(t)&&t>=0}function o(t){var e,r;"area"===t?(e={attributes:w},r={}):(e=v.modules[t]._module,r=e.basePlotModule);var n={};n.type=null,T(n,m),T(n,e.attributes),r.attributes&&T(n,r.attributes),n.type=t;var a={meta:e.meta||{},attributes:u(n)};if(e.layoutAttributes){var i={};T(i,e.layoutAttributes),a.layoutAttributes=u(i)}return a}function l(){var t,e,r={};T(r,x);for(t in v.subplotsRegistry)if(e=v.subplotsRegistry[t],e.layoutAttributes)if("cartesian"===e.name)h(r,e,"xaxis"),h(r,e,"yaxis");else{var n="subplot"===e.attr?e.name:e.attr;h(r,e,n)}r=p(r);for(t in v.componentsRegistry){e=v.componentsRegistry[t];var a=e.schema;if(a&&(a.subplots||a.layout)){var i=a.subplots;if(i&&i.xaxis&&!i.yaxis)for(var o in i.xaxis)delete r.yaxis[o]}else e.layoutAttributes&&g(r,e.layoutAttributes,e.name)}return{layoutAttributes:u(r)}}function s(t){var e=v.transformsRegistry[t],r=T({},e.attributes);return Object.keys(v.componentsRegistry).forEach(function(e){var n=v.componentsRegistry[e];n.schema&&n.schema.transforms&&n.schema.transforms[t]&&Object.keys(n.schema.transforms[t]).forEach(function(e){g(r,n.schema.transforms[t][e],e)})}),{attributes:u(r)}}function c(){var t={frames:y.extendDeepAll({},b)};return u(t),t.frames}function u(t){return f(t),d(t),t}function f(t){function e(t){return{valType:"string",editType:"none"}}function n(t,n,a){r.isValObject(t)?"data_array"===t.valType?(t.role="data",a[n+"src"]=e(n)):!0===t.arrayOk&&(a[n+"src"]=e(n)):y.isPlainObject(t)&&(t.role="object")}r.crawl(t,n)}function d(t){function e(t,e,r){if(t){var n=t[C];n&&(delete t[C],r[e]={items:{}},r[e].items[n]=t,r[e].role="object")}}r.crawl(t,e)}function p(t){return A(t,{radialaxis:k.radialaxis,angularaxis:k.angularaxis}),A(t,k.layout),t}function h(t,e,r){var n=y.nestedProperty(t,r),a=T({},e.layoutAttributes);a[L]=!0,n.set(a)}function g(t,e,r){var n=y.nestedProperty(t,r);n.set(T(n.get()||{},e))}var v=t("../registry"),y=t("../lib"),m=t("../plots/attributes"),x=t("../plots/layout_attributes"),b=t("../plots/frame_attributes"),_=t("../plots/animation_attributes"),w=t("../plots/polar/area_attributes"),k=t("../plots/polar/axis_attributes"),M=t("./edit_types"),A=y.extendFlat,T=y.extendDeepAll,L="_isSubplotObj",C="_isLinkedToArray",S=[L,C,"_arrayAttrRegexps","_deprecated"];r.IS_SUBPLOT_OBJ=L,r.IS_LINKED_TO_ARRAY=C,r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=S,r.get=function(){var t={};v.allTypes.concat("area").forEach(function(e){t[e]=o(e)});var e={};return Object.keys(v.transformsRegistry).forEach(function(t){e[t]=s(t)}),{defs:{valObjects:y.valObjectMeta,metaKeys:S.concat(["description","role","editType","impliedEdits"]),editType:{traces:M.traces,layout:M.layout},impliedEdits:{}},traces:t,layout:l(),transforms:e,frames:c(),animation:u(_)}},r.crawl=function(t,e,n,a){var i=n||0;a=a||"",Object.keys(t).forEach(function(n){var o=t[n];if(-1===S.indexOf(n)){var l=(a?a+".":"")+n;e(o,n,t,i,l),r.isValObject(o)||y.isPlainObject(o)&&"impliedEdits"!==n&&r.crawl(o,e,i+1,l)}})},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){function e(e,r,o,l){if(i=i.slice(0,l).concat([r]),e&&("data_array"===e.valType||!0===e.arrayOk)&&!("colorbar"===i[l-1]&&("ticktext"===r||"tickvals"===r))){var s=n(i),c=y.nestedProperty(t,s).get();Array.isArray(c)&&a.push(s)}}function n(t){return t.join(".")}var a=[],i=[];if(r.crawl(m,e),t._module&&t._module.attributes&&r.crawl(t._module.attributes,e),t.transforms)for(var o=t.transforms,l=0;l=t.transforms.length)return!1;r=(v.transformsRegistry[t.transforms[s].type]||{}).attributes,n=r&&r[e[2]],l=3}else if("area"===t.type)n=w[o];else{var c=t._module;if(c||(c=(v.modules[t.type||m.type.dflt]||{})._module),!c)return!1;if(r=c.attributes,!(n=r&&r[o])){var u=c.basePlotModule;u&&u.attributes&&(n=u.attributes[o])}n||(n=m[o])}return a(n,e,l)},r.getLayoutValObject=function(t,e){return a(n(t,e[0]),e,1)}},{"../lib":149,"../plots/animation_attributes":185,"../plots/attributes":187,"../plots/frame_attributes":214,"../plots/layout_attributes":216,"../plots/polar/area_attributes":219,"../plots/polar/axis_attributes":220,"../registry":225,"./edit_types":173}],179:[function(t,e,r){"use strict";function n(t){o.register(t,t.name,t.categories,t.meta),o.subplotsRegistry[t.basePlotModule.name]||o.registerSubplot(t.basePlotModule)}function a(t){if("string"!=typeof t.name)throw new Error("Transform module *name* must be a string.");var e="Transform module "+t.name,r="function"==typeof t.transform,n="function"==typeof t.calcTransform;if(!r&&!n)throw new Error(e+" is missing a *transform* or *calcTransform* method.");r&&n&&l.log([e+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),l.isPlainObject(t.attributes)||l.log(e+" registered without an *attributes* object."),"function"!=typeof t.supplyDefaults&&l.log(e+" registered without a *supplyDefaults* method."),o.registerTransform(t)}function i(t){if("string"!=typeof t.name)throw new Error("Component module *name* must be a string.");o.registerComponent(t)}var o=t("../registry"),l=t("../lib");e.exports=function(t){if(!t)throw new Error("No argument passed to Plotly.register.");t&&!Array.isArray(t)&&(t=[t]);for(var e=0;e=t[1]||a[1]<=t[0])&&(i[0]e[0]))return!0}return!1}function a(t,e,r){return t._anchorAxis===e&&(t.mirror||t.side===r)||"all"===t.mirror||"allticks"===t.mirror||t.mirrors&&t.mirrors[e._id+r]}function i(t,e,r){var n=[],a=e._anchorAxis;if(a){var i=a._mainAxis;if(-1===n.indexOf(i)){n.push(i);for(var o=0;o1&&s.push(o("object","layout"))),d.supplyDefaults(c);for(var u=c._fullData,v=r.length,y=0;y.3*f||i(n)||i(a))){var d=r.dtick/2;t+=t+d.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?t=B.tickIncrement(t,"M6","reverse")+1.5*E:i.exactMonths>.8?t=B.tickIncrement(t,"M1","reverse")+15.5*E:t-=E/2;var l=B.tickIncrement(t,r);if(l<=n)return l}return t}function l(t){var e,r,n=t.tickvals,a=t.ticktext,i=new Array(n.length),o=A.simpleMap(t.range,t.r2l),l=1.0001*o[0]-1e-4*o[1],s=1.0001*o[1]-1e-4*o[0],c=Math.min(l,s),f=Math.max(l,s),d=0;Array.isArray(a)||(a=[]);var p="category"===t.type?t.d2l_noadd:t.d2l;for("log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1)),r=0;rc&&e10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=E&&a<=10||e>=15*E)t._tickround="d";else if(e>=I&&a<=16||e>=N)t._tickround="M";else if(e>=R&&a<=19||e>=I)t._tickround="S";else{var i=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,i)-20}}else if(k(e)||"L"===e.charAt(0)){var o=t.range.map(t.r2d||Number);k(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(o[0]),Math.abs(o[1])),s=Math.floor(Math.log(l)/Math.LN10+.01);Math.abs(s)>3&&(g(t.exponentformat)&&!v(s)?t._tickexponent=3*Math.round((s-1)/3):t._tickexponent=s)}else t._tickround=null}function u(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}function f(t,e,r,n){var a=t._tickround,i=r&&t.hoverformat||t.tickformat;n&&(a=k(a)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[a]);var o,l=A.formatDate(e.x,i,a,t.calendar),s=l.indexOf("\n");-1!==s&&(o=l.substr(s+1),l=l.substr(0,s)),n&&("00:00:00"===l||"00:00"===l?(l=o,o=""):8===l.length&&(l=l.replace(/:00$/,""))),o&&(r?"d"===a?l+=", "+o:l=o+(l?", "+l:""):t._inCalcTicks&&o===t._prevDateHead||(l+="
"+o,t._prevDateHead=o)),e.text=l}function d(t,e,r,n,a){var i=t.dtick,o=e.x;if("never"===a&&(a=""),!n||"string"==typeof i&&"L"===i.charAt(0)||(i="L3"),t.tickformat||"string"==typeof i&&"L"===i.charAt(0))e.text=y(Math.pow(10,o),t,a,n);else if(k(i)||"D"===i.charAt(0)&&A.mod(o+.01,1)<.1){var l=Math.round(o);-1!==["e","E","power"].indexOf(t.exponentformat)||g(t.exponentformat)&&v(l)?(e.text=0===l?1:1===l?"10":l>1?"10"+l+"":"10"+F+-l+"",e.fontSize*=1.25):(e.text=y(Math.pow(10,o),t,"","fakehover"),"D1"===i&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==i.charAt(0))throw"unrecognized dtick "+String(i);e.text=String(Math.round(Math.pow(10,A.mod(o,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*(o<0?.5:.25)))}}function p(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}function h(t,e,r,n,a){"never"===a?a="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide"),e.text=y(e.x,t,a,n)}function g(t){return"SI"===t||"B"===t}function v(t){return t>14||t<-15}function y(t,e,r,n){var a=t<0,i=e._tickround,o=r||e.exponentformat||"B",l=e._tickexponent,s=e.tickformat,u=e.separatethousands;if(n){var f={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:k(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};c(f),i=(Number(f._tickround)||0)+4,l=f._tickexponent,e.hoverformat&&(s=e.hoverformat)}if(s)return w.format(s)(t).replace(/-/g,F);var d=Math.pow(10,-i)/2;if("none"===o&&(l=0),(t=Math.abs(t))"+y+"":"B"===o&&9===l?t+="B":g(o)&&(t+=Q[l/3+5])}return a?F+t:t}function m(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},B.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=o,c=l,d=f/u);if(n===a){var g=n-1,v=n+1;r="tozero"===t.rangemode?n<0?[g,0]:[0,v]:"nonnegative"===t.rangemode?[Math.max(0,g),Math.max(0,v)]:[g,v]}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])))),p&&r.reverse(),A.simpleMap(r,t.l2r||Number)},B.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=B.getAutoRange(t),t._r=t.range.slice(),t._rl=A.simpleMap(t._r,t.r2l);var r=t._input;r.range=t.range.slice(),r.autorange=t.autorange}},B.saveRangeInitial=function(t,e){for(var r=B.list(t,"",!0),n=!1,a=0;a=d?p=!1:l.val>=c&&l.pad<=d&&(t._min.splice(o,1),o--);p&&t._min.push({val:c,pad:m&&0===c?0:d})}if(n(u)){for(p=!0,o=0;o=u&&l.pad>=f?p=!1:l.val<=u&&l.pad<=f&&(t._max.splice(o,1),o--);p&&t._max.push({val:u,pad:m&&0===u?0:f})}}}if((t.autorange||!!A.nestedProperty(t,"rangeslider.autorange").get())&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var i,o,l,s,c,u,f,d,p,h,g,v=e.length,y=r.padded?.05*t._length:0,m=r.tozero&&("linear"===t.type||"-"===t.type);y&&"domain"===t.constrain&&t._inputDomain&&(y*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0]));var x=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),b=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),_=n(r.vpadplus||r.vpad),w=n(r.vpadminus||r.vpad);for(i=0;i<6;i++)a(i);for(i=v-1;i>5;i--)a(i)}},B.autoBin=function(t,e,r,n,a){var l=A.aggNums(Math.min,null,t),s=A.aggNums(Math.max,null,t);if(a||(a=e.calendar),"category"===e.type)return{start:l-.5,end:s+.5,size:1,_count:s-l+1};var c;if(r)c=(s-l)/r;else{var u=A.distinctVals(t),f=Math.pow(10,Math.floor(Math.log(u.minDiff)/Math.LN10)),d=f*A.roundUp(u.minDiff/f,[.9,1.9,4.9,9.9],!0);c=Math.max(d,2*A.stdev(t)/Math.pow(t.length,n?.25:.4)),k(c)||(c=1)}var p;p="log"===e.type?{type:"linear",range:[l,s]}:{type:e.type,range:A.simpleMap([l,s],e.c2r,0,a),calendar:a},B.setConvert(p),B.autoTicks(p,c);var h,g,v=B.tickIncrement(B.tickFirst(p),p.dtick,"reverse",a);if("number"==typeof p.dtick)v=i(v,t,p,l,s),g=1+Math.floor((s-v)/p.dtick),h=v+g*p.dtick;else for("M"===p.dtick.charAt(0)&&(v=o(v,t,p.dtick,l,a)),h=v,g=0;h<=s;)h=B.tickIncrement(h,p.dtick,!1,a),g++;return{start:e.c2r(v,0,a),end:e.c2r(h,0,a),size:p.dtick,_count:g}},B.calcTicks=function(t){var e=A.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var r,n=t.nticks;n||("category"===t.type?(r=t.tickfont?1.2*(t.tickfont.size||12):15,n=t._length/r):(r="y"===t._id.charAt(0)?40:80,n=A.constrain(t._length/r,4,9)+1)),"array"===t.tickmode&&(n*=100),B.autoTicks(t,Math.abs(e[1]-e[0])/n),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}if(t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),c(t),"array"===t.tickmode)return l(t);t._tmin=B.tickFirst(t);var a=e[1]=o:f<=o)&&!(i.length>u||f===s);f=B.tickIncrement(f,t.dtick,a,t.calendar))s=f,i.push(f);t._tmax=i[i.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var d=new Array(i.length),p=0;pD?(e/=D,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*s(e,r,U)):n>P?(e/=P,t.dtick="M"+s(e,1,G)):n>E?(t.dtick=s(e,E,Y),t.tick0=A.dateTick0(t.calendar,!0)):n>N?t.dtick=s(e,N,G):n>I?t.dtick=s(e,I,X):n>R?t.dtick=s(e,R,X):(r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=s(e,r,U))}else if("log"===t.type){t.tick0=0;var a=A.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(a[1]-a[0])<1){var i=1.5*Math.abs((a[1]-a[0])/e);e=Math.abs(Math.pow(10,a[1])-Math.pow(10,a[0]))/i,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+s(e,r,U)}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=s(e,r,U));if(0===t.dtick&&(t.dtick=1),!k(t.dtick)&&"string"!=typeof t.dtick){var o=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(o)}},B.tickIncrement=function(t,e,r,n){var a=r?-1:1;if(k(e))return t+a*e;var i=e.charAt(0),o=a*Number(e.substr(1));if("M"===i)return A.incrementMonth(t,o,n);if("L"===i)return Math.log(Math.pow(10,t)+o)/Math.LN10;if("D"===i){var l="D2"===e?W:Z,s=t+.01*a,c=A.roundUp(A.mod(s,1),l,r);return Math.floor(s)+Math.log(w.round(Math.pow(10,c),1))/Math.LN10}throw"unrecognized dtick "+String(e)},B.tickFirst=function(t){var e=t.r2l||Number,r=A.simpleMap(t.range,e),n=r[1]1&&e2*a}function i(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,a=0,i=0;i2*n}var o=t("fast-isnumeric"),l=t("../../lib"),s=t("../../constants/numerical").BADNUM;e.exports=function(t,e){return a(t,e)?"date":i(t)?"category":n(t)?"linear":"-"}},{"../../constants/numerical":133,"../../lib":149,"fast-isnumeric":10}],191:[function(t,e,r){"use strict";var n=t("tinycolor2").mix,a=t("../../registry"),i=t("../../lib"),o=t("../../components/color/attributes").lightFraction,l=t("./layout_attributes"),s=t("./tick_value_defaults"),c=t("./tick_mark_defaults"),u=t("./tick_label_defaults"),f=t("./category_order_defaults"),d=t("./set_convert"),p=t("./ordered_categories");e.exports=function(t,e,r,h,g){function v(r,n){return i.coerce2(t,e,l,r,n)}var y=h.letter,m=h.font||{},x="Click to enter "+(h.title||y.toUpperCase()+" axis")+" title",b=r("visible",!h.cheateronly),_=e.type;if("date"===_){a.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",h.calendar)}if(d(e,g),r("autorange",!e.isValidRange(t.range))&&r("rangemode"),r("range"),e.cleanRange(),f(t,e,r),e._initialCategories="category"===_?p(y,e.categoryorder,e.categoryarray,h.data):[],!b)return e;var w=r("color"),k=w===t.color?w:m.color;r("title",x),i.coerceFont(r,"titlefont",{family:m.family,size:Math.round(1.2*m.size),color:k}),s(t,e,r,_),u(t,e,r,_,h),c(t,e,r,h);var M=v("linecolor",w),A=v("linewidth"),T=r("showline",!!M||!!A);T||(delete e.linecolor,delete e.linewidth),(T||e.ticks)&&r("mirror");var L=v("gridcolor",n(w,h.bgColor,o).toRgbString()),C=v("gridwidth");r("showgrid",h.showGrid||!!L||!!C)||(delete e.gridcolor,delete e.gridwidth);var S=v("zerolinecolor",w),O=v("zerolinewidth");return r("zeroline",h.showGrid||!!S||!!O)||(delete e.zerolinecolor,delete e.zerolinewidth),e}},{"../../components/color/attributes":33,"../../lib":149,"../../registry":225,"./category_order_defaults":193,"./layout_attributes":200,"./ordered_categories":202,"./set_convert":206,"./tick_label_defaults":207,"./tick_mark_defaults":208,"./tick_value_defaults":209,tinycolor2:16}],192:[function(t,e,r){"use strict";function n(t,e,r){function n(t,r){for(var n=Object.keys(t),a=/^[xyz]axis[0-9]*/,i=[],o=0;o0;i&&(n="array");var o=r("categoryorder",n);"array"===o&&r("categoryarray"),i||"array"!==o||(e.categoryorder="trace")}}},{}],194:[function(t,e,r){"use strict";var n=t("../../lib").counterRegex;e.exports={idRegex:{x:n("x"),y:n("y")},attrRegex:n("[xy]axis"),xAxisMatch:n("xaxis"),yAxisMatch:n("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,SELECTDELAY:100,SELECTID:"-select",DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","maplayer","barlayer","carpetlayer","boxlayer","scatterlayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},{"../../lib":149}],195:[function(t,e,r){"use strict";function n(t,e,r,n){var a,i,l,s,c=n[o(e)].type,u=[];for(i=0;io*y)||_)for(r=0;rz&&PS&&(S=P);var I=(S-C)/(2*O);f/=I,C=s.l2r(C),S=s.l2r(S),s.range=s._input.range=A=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function c(t,e){return t?"nsew"===t?"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}function u(t,e,r,n,a){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",a+"Z")}function f(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:T.background,stroke:T.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function d(t){t.selectAll(".select-outline").remove()}function p(t,e,r,n,a,i){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),a||(t.transition().style("fill",i>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function h(t){b.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function g(t){return-1!==["lasso","select"].indexOf(t)}function v(t,e){return"M"+(t.l-.5)+","+(e-F-.5)+"h-3v"+(2*F+1)+"h3ZM"+(t.r+.5)+","+(e-F-.5)+"h3v"+(2*F+1)+"h-3Z"}function y(t,e){return"M"+(e-F-.5)+","+(t.t-.5)+"v-3h"+(2*F+1)+"v3ZM"+(e-F-.5)+","+(t.b+.5)+"v3h"+(2*F+1)+"v-3Z"}function m(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,F)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function x(t,e,r){var n,a,i,o,l,s,c=!1,u={},f={};for(n=0;nF||l>F?(Mt="xy",o/it>l/ot?(l=o*ot/it,xt>i?bt.t=xt-l:bt.b=xt+l):(o=l*it/ot,mt>a?bt.l=mt-o:bt.r=mt+o),Tt.attr("d",m(bt))):n():!st||lzoom back out","long"),j=!1)}function Y(e,r){var n=1===(q+H).length;if(e)J();else if(2!==r||n){if(1===r&&n){var a=q?rt[0]:et[0],o="s"===q||"w"===H?0:1,l=a._name+".range["+o+"]",s=i(a,o),c="left",u="middle";if(a.fixedrange)return;q?(u="n"===q?"top":"bottom","right"===a.side&&(c="right")):"e"===H&&(c="right"),t._context.showAxisRangeEntryBoxes&&b.select(vt).call(A.makeEditable,{gd:t,immediate:!0,background:pt.paper_bgcolor,text:String(s),fill:a.tickfont?a.tickfont.color:"#444",horizontalAlign:c,verticalAlign:u}).on("edit",function(e){var r=a.d2r(e);void 0!==r&&w.relayout(t,l,r)})}}else $()}function Z(e){function r(t,e,r){function n(e){return t.l2r(i+(e-i)*r)}if(!t.fixedrange){var a=M.simpleMap(t.range,t.r2l),i=a[0]+(a[1]-a[0])*e;t.range=a.map(n)}}if(t._context.scrollZoom||pt._enablescrollzoom){if(t._transitioningWithDuration)return M.pauseEvent(e);var n=t.querySelector(".plotly");if(V(),!(n.scrollHeight-n.clientHeight>10||n.scrollWidth-n.clientWidth>10)){clearTimeout(St);var a=-e.deltaY;if(isFinite(a)||(a=e.wheelDelta/10),!isFinite(a))return void M.log("Did not find wheel motion attributes: ",e);var i,o=Math.exp(-Math.min(Math.max(a,-20),20)/200),l=zt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),s=(e.clientX-l.left)/l.width,c=(l.bottom-e.clientY)/l.height;if(H||ut){for(H||(s=.5),i=0;i rect").call(L.setTranslate,l,s).call(L.setScale,i,o);var w=g.plot.selectAll(".scatterlayer .points, .boxlayer .points");g.plot.call(L.setTranslate,b,_).call(L.setScale,1/i,1/o),w.selectAll(".point").call(L.setPointGroupScale,i,o).call(L.hideOutsideRangePoints,g),w.selectAll(".textpoint").call(L.setTextPointsScale,i,o).call(L.hideOutsideRangePoints,g)}}}var tt,et,rt,nt,at,it,ot,lt,st,ct,ut,ft,dt,pt=t._fullLayout,ht=t._fullLayout._zoomlayer,gt=q+H==="nsew";V();var vt=n(e,q+H+"drag",ct,r,T,C,B);if(!st&&!lt&&!g(pt.dragmode))return vt.onmousedown=null,vt.style.pointerEvents=gt?"all":"none",vt;var yt={element:vt,gd:t,plotinfo:e,prepFn:function(e,r,n){var a=t._fullLayout.dragmode;gt?e.shiftKey&&(a="pan"===a?"zoom":"pan"):a="pan",yt.minDrag="lasso"===a?1:void 0,"zoom"===a?(yt.moveFn=G,yt.doneFn=X,yt.minDrag=1,U(e,r,n)):"pan"===a?(yt.moveFn=W,yt.doneFn=Y,d(ht)):g(a)&&(yt.xaxes=et,yt.yaxes=rt,E(e,r,n,yt,a))}};S.init(yt);var mt,xt,bt,_t,wt,kt,Mt,At,Tt,Lt={},Ct=[0,0,it,ot],St=null,Ot=I.REDRAWDELAY,zt=e.mainplot?pt._plots[e.mainplot]:e;return q.length*H.length!=1&&(void 0!==vt.onwheel?vt.onwheel=Z:void 0!==vt.onmousewheel&&(vt.onmousewheel=Z)),vt}},{"../../components/color":34,"../../components/dragelement":55,"../../components/drawing":58,"../../constants/alignment":131,"../../lib":149,"../../lib/setcursor":167,"../../lib/svg_text_utils":169,"../../plotly":184,"../../registry":225,"../plots":218,"./axes":189,"./axis_ids":192,"./constants":194,"./scale_zoom":204,"./select":205,d3:7,tinycolor2:16}],198:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../components/fx"),i=t("../../components/dragelement"),o=t("./constants"),l=t("./dragbox");e.exports=function(t){var e=t._fullLayout;if((e._has("cartesian")||e._has("gl2d"))&&!t._context.staticPlot){Object.keys(e._plots||{}).sort(function(t,r){if((e._plots[t].mainplot&&!0)===(e._plots[r].mainplot&&!0)){var n=t.split("y"),a=r.split("y");return n[0]===a[0]?Number(n[1]||1)-Number(a[1]||1):Number(n[0]||1)-Number(a[0]||1)}return e._plots[t].mainplot?1:-1}).forEach(function(r){var s=e._plots[r],c=s.xaxis,u=s.yaxis,f=(c._linepositions[r]||[])[3],d=(u._linepositions[r]||[])[3],p=o.DRAGGERSIZE;if(n(f)&&"top"===c.side&&(f-=p),n(d)&&"right"!==u.side&&(d-=p),!s.mainplot){var h=l(t,s,0,0,c._length,u._length,"ns","ew");h.onmousemove=function(e){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===r&&a.hover(t,e,r)},a.hover(t,e,r),t._fullLayout._lasthover=h,t._fullLayout._hoversubplot=r},h.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,i.unhover(t,e))},h.onclick=function(e){a.click(t,e,r)},t._context.showAxisDragHandles&&(l(t,s,-p,-p,p,p,"n","w"),l(t,s,c._length,-p,p,p,"n","e"),l(t,s,-p,u._length,p,p,"s","w"),l(t,s,c._length,u._length,p,p,"s","e"))}t._context.showAxisDragHandles&&(n(f)&&("free"===c.anchor&&(f-=e._size.h*(1-u.domain[1])),l(t,s,.1*c._length,f,.8*c._length,p,"","ew"),l(t,s,0,f,.1*c._length,p,"","w"),l(t,s,.9*c._length,f,.1*c._length,p,"","e")),n(d)&&("free"===u.anchor&&(d-=e._size.w*c.domain[0]),l(t,s,d,.1*u._length,p,.8*u._length,"ns",""),l(t,s,d,.9*u._length,p,.1*u._length,"s",""),l(t,s,d,0,p,.1*u._length,"n","")))});var r=e._hoverlayer.node();r.onmousemove=function(r){r.target=e._lasthover,a.hover(t,r,e._hoversubplot)},r.onclick=function(r){r.target=e._lasthover,a.click(t,r)},r.onmousedown=function(t){e._lasthover.onmousedown(t)}}}},{"../../components/dragelement":55,"../../components/fx":75,"./constants":194,"./dragbox":197,"fast-isnumeric":10}],199:[function(t,e,r){"use strict";function n(t,e,r,n,a){var i=t._fullLayout,o=i._modules;e.plot&&e.plot.selectAll("g:not(.scatterlayer)").selectAll("g.trace").remove();for(var l=0;lu[1]-.01&&(e.domain=[0,1]),a.noneOrAll(t.domain,e.domain,[0,1])}return r("layer"),e}},{"../../lib":149,"fast-isnumeric":10}],204:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var a=[t.r2l(t.range[0]),t.r2l(t.range[1])],i=a[0]+(a[1]-a[0])*r;t.range=t._input.range=[t.l2r(i+(a[0]-i)*e),t.l2r(i+(a[1]-i)*e)]}},{"../../constants/alignment":131}],205:[function(t,e,r){"use strict";function n(t){return t._id}function a(t,e){if(Array.isArray(t))for(var r=e.cd[0].trace,n=0;n0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],a=t.range[1];return.5*(n+a-3*k*Math.abs(n-a))}return p}function f(e,r,n){var a=c(e,n||t.calendar);if(a===p){if(!i(e))return p;a=c(new Date(+e))}return a}function v(e,r,n){return s(e,r,n||t.calendar)}function y(e){return t._categories[Math.round(e)]}function m(e){if(null!==e&&void 0!==e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return p}function x(e){if(t._categoriesMap){var r=t._categoriesMap[e];if(void 0!==r)return r}if(i(e))return+e}function b(e){return i(e)?a.round(t._b+t._m*e,2):p}function _(e){return(e-t._b)/t._m}e=e||{};var w=(t._id||"x").charAt(0),k=10;t.c2l="log"===t.type?r:u,t.l2c="log"===t.type?n:u,t.l2p=b,t.p2l=_,t.c2p="log"===t.type?function(t,e){return b(r(t,e))}:b,t.p2c="log"===t.type?function(t){return n(_(t))}:_,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=l,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=_,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return r(l(t),e)},t.r2d=t.r2c=function(t){return n(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=u,t.c2r=r,t.l2d=n,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return n(_(t))},t.r2p=function(e){return t.l2p(l(e))},t.p2r=_,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=o.identity,t.d2c=t.r2c=t.d2l=t.r2l=f,t.c2d=t.c2r=t.l2d=t.l2r=v,t.d2p=t.r2p=function(e,r,n){return t.l2p(f(e,0,n))},t.p2d=t.p2r=function(t,e,r){return v(_(t),e,r)},t.cleanPos=function(e){return o.cleanDate(e,p,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=m,t.r2d=t.c2d=t.l2d=y,t.d2r=t.d2l_noadd=x,t.r2c=function(e){var r=x(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=x,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return y(_(t))},t.r2p=t.d2p,t.p2r=_,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e){e||(e="range");var r,n,a=o.nestedProperty(t,e).get();if(n="date"===t.type?o.dfltRange(t.calendar):"y"===w?h.DFLTRANGEY:h.DFLTRANGEX,n=n.slice(),!a||2!==a.length)return void o.nestedProperty(t,e).set(n);for("date"===t.type&&(a[0]=o.cleanDate(a[0],p,t.calendar),a[1]=o.cleanDate(a[1],p,t.calendar)),r=0;r<2;r++)if("date"===t.type){if(!o.isDateTime(a[r],t.calendar)){t[e]=n;break}if(t.r2l(a[0])===t.r2l(a[1])){var l=o.constrain(t.r2l(a[0]),o.MIN_MS+1e3,o.MAX_MS-1e3);a[0]=t.l2r(l-1e3),a[1]=t.l2r(l+1e3);break}}else{if(!i(a[r])){if(!i(a[1-r])){t[e]=n;break}a[r]=a[1-r]*(r?10:.1)}if(a[r]<-d?a[r]=-d:a[r]>d&&(a[r]=d),a[0]===a[1]){var s=Math.max(1,Math.abs(1e-6*a[0]));a[0]-=s,a[1]+=s}}},t.setScale=function(r){var n=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var a=g.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var i=r&&t._r?"_r":"range",l=t.calendar;t.cleanRange(i);var s=t.r2l(t[i][0],l),c=t.r2l(t[i][1],l);if("y"===w?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(s-c),t._b=-t._m*c):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-s),t._b=-t._m*s),!isFinite(t._m)||!isFinite(t._b))throw o.notifier("Something went wrong with axis scaling","long"),e._replotting=!1,new Error("axis scaling")},t.makeCalcdata=function(e,r){var n,a,i,o="date"===t.type&&e[r+"calendar"];if(r in e)for(n=e[r],a=new Array(n.length),i=0;i=t.range[0]&&r<=t.range[1]}:function(e){var r=e.y;return r>=t.range[0]&&r<=t.range[1]},t._min=[],t._max=[],t._separators=e.separators,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":133,"../../lib":149,"./axis_ids":192,"./constants":194,d3:7,"fast-isnumeric":10}],207:[function(t,e,r){"use strict";function n(t){var e=["showexponent","showtickprefix","showticksuffix"],r=e.filter(function(e){return void 0!==t[e]}),n=function(e){return t[e]===t[r[0]]};if(r.every(n)||1===r.length)return t[r[0]]}var a=t("../../lib");e.exports=function(t,e,r,i,o){var l=n(t);if(r("tickprefix")&&r("showtickprefix",l),r("ticksuffix")&&r("showticksuffix",l),r("showticklabels")){var s=o.font||{},c=e.color===t.color?e.color:s.color;a.coerceFont(r,"tickfont",{family:s.family,size:s.size,color:c}),r("tickangle"),"category"!==i&&(r("tickformat")||"date"===i||(r("showexponent",l),r("exponentformat"),r("separatethousands")))}"category"===i||o.noHover||r("hoverformat")}},{"../../lib":149}],208:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r,i){var o=n.coerce2(t,e,a,"ticklen"),l=n.coerce2(t,e,a,"tickwidth"),s=n.coerce2(t,e,a,"tickcolor",e.color);r("ticks",i.outerTicks||o||l||s?"outside":"")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":149,"./layout_attributes":200}],209:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").ONEDAY;e.exports=function(t,e,r,o){var l="auto";"array"!==t.tickmode||"log"!==o&&"date"!==o||(t.tickmode="auto"),Array.isArray(t.tickvals)?l="array":t.dtick&&(l="linear");var s=r("tickmode",l);if("auto"===s)r("nticks");else if("linear"===s){var c="date"===o?i:1,u=r("dtick",c);if(n(u))e.dtick=u>0?Number(u):c;else if("string"!=typeof u)e.dtick=c;else{var f=u.charAt(0),d=u.substr(1);d=n(d)?Number(d):0,(d<=0||!("date"===o&&"M"===f&&d===Math.round(d)||"log"===o&&"L"===f||"log"===o&&"D"===f&&(1===d||2===d)))&&(e.dtick=c)}var p="date"===o?a.dateTick0(e.calendar):0,h=r("tick0",p);"date"===o?e.tick0=a.cleanDate(h,p):n(h)&&"D1"!==u&&"D2"!==u?e.tick0=Number(h):e.tick0=p}else{var g=r("tickvals");void 0===g?e.tickmode="auto":r("ticktext")}}},{"../../constants/numerical":133,"../../lib":149,"fast-isnumeric":10}],210:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plotly"),i=t("../../registry"),o=t("../../components/drawing"),l=t("./axes"),s=t("./constants").attrRegex;e.exports=function(t,e,r,c){function u(e,r){function n(e,r,n){for(a=0;a rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.select(".scatterlayer").selectAll(".points");n.selectAll(".point").call(o.setPointGroupScale,1,1).call(o.hideOutsideRangePoints,t),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1).call(o.hideOutsideRangePoints,t)}function d(e,r){var n,a,i,l=m[e.xaxis._id],s=m[e.yaxis._id],c=[];if(l){n=t._fullLayout[l.axisName],a=n._r,i=l.to,c[0]=(a[0]*(1-r)+r*i[0]-a[0])/(a[1]-a[0])*e.xaxis._length;var f=a[1]-a[0],d=i[1]-i[0];n.range[0]=a[0]*(1-r)+r*i[0],n.range[1]=a[1]*(1-r)+r*i[1],c[2]=e.xaxis._length*(1-r+r*d/f)}else c[0]=0,c[2]=e.xaxis._length;if(s){n=t._fullLayout[s.axisName],a=n._r,i=s.to,c[1]=(a[1]*(1-r)+r*i[1]-a[1])/(a[0]-a[1])*e.yaxis._length;var p=a[1]-a[0],h=i[1]-i[0];n.range[0]=a[0]*(1-r)+r*i[0],n.range[1]=a[1]*(1-r)+r*i[1],c[3]=e.yaxis._length*(1-r+r*h/p)}else c[1]=0,c[3]=e.yaxis._length;u(e.xaxis,e.yaxis);var g=e.xaxis,y=e.yaxis,x=!!l,b=!!s,_=x?g._length/c[2]:1,w=b?y._length/c[3]:1,k=x?c[0]:0,M=b?c[1]:0,A=x?c[0]/c[2]*g._length:0,T=b?c[1]/c[3]*y._length:0,L=g._offset-A,C=y._offset-T;v._defs.select("#"+e.clipId+"> rect").call(o.setTranslate,k,M).call(o.setScale,1/_,1/w),e.plot.call(o.setTranslate,L,C).call(o.setScale,_,w).selectAll(".points").selectAll(".point").call(o.setPointGroupScale,1/_,1/w),e.plot.selectAll(".points").selectAll(".textpoint").call(o.setTextPointsScale,1/_,1/w)}function p(){for(var e={},r=0;rr.duration?(p(),M=window.cancelAnimationFrame(g)):M=window.requestAnimationFrame(g)}var v=t._fullLayout,y=[],m=function(t){var e,r,n,a,i={};for(e in t)if(r=e.split("."),r[0].match(s)){var o=e.charAt(0),l=r[0];if(n=v[l],a={},Array.isArray(t[e])?a.to=t[e].slice(0):Array.isArray(t[e].range)&&(a.to=t[e].range.slice(0)),!a.to)continue;a.axisName=l,a.length=n._length,y.push(o),i[o]=a}return i}(e),x=Object.keys(m),b=function(t,e,r){var n,a,i,o=t._plots,l=[];for(n in o){var s=o[n];if(-1===l.indexOf(s)){var c=s.xaxis._id,u=s.yaxis._id,f=s.xaxis.range,d=s.yaxis.range;s.xaxis._r=s.xaxis.range.slice(),s.yaxis._r=s.yaxis.range.slice(),a=r[c]?r[c].to:f,i=r[u]?r[u].to:d,f[0]===a[0]&&f[1]===a[1]&&d[0]===i[0]&&d[1]===i[1]||-1===e.indexOf(c)&&-1===e.indexOf(u)||l.push(s)}}return l}(v,x,m);if(!b.length)return function(){function e(e,r,n){for(var a=0;a0?".":"")+a;c.isPlainObject(i)?l(i,e,o,n+1):e(o,a,i)}})}var s=t("../plotly"),c=t("../lib");r.manageCommandObserver=function(t,e,a,i){var o={},l=!0;e&&e._commandObserver&&(o=e._commandObserver),o.cache||(o.cache={}),o.lookupTable={};var s=r.hasSimpleAPICommandBindings(t,a,o.lookupTable);if(e&&e._commandObserver){if(s)return o;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,o}if(s){n(t,s,o.cache),o.check=function(){if(l){var e=n(t,s,o.cache);return e.changed&&i&&void 0!==o.lookupTable[e.value]&&(o.disable(),Promise.resolve(i({value:e.value,type:s.type,prop:s.prop,traces:s.traces,index:o.lookupTable[e.value]})).then(o.enable,o.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f=e.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=e._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),c=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&n(t,o),l.text(o.text()&&c.text()?" - ":"")}},v.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=s.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return n.append("input").attr({type:"text",name:"data"}).node().value=v.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},v.supplyDefaults=function(t){var e,r=t._fullLayout||{},n=t._fullLayout={},i=t.layout||{},o=t._fullData||[],l=t._fullData=[],s=t.data||[];if(t._transitionData||v.createTransitionData(t),r._initialAutoSizeIsDone){var c=r.width,f=r.height;v.supplyLayoutGlobalDefaults(i,n),i.width||(n.width=c),i.height||(n.height=f)}else{v.supplyLayoutGlobalDefaults(i,n);var d=!i.width||!i.height,p=n.autosize,h=t._context&&t._context.autosizable;d&&(p||h)?v.plotAutoSize(t,i,n):d&&v.sanitizeMargins(t),!p&&d&&(i.width=n.width,i.height=n.height)}n._initialAutoSizeIsDone=!0,n._dataLength=s.length,n._globalTransforms=(t._context||{}).globalTransforms,v.supplyDataDefaults(s,l,i,n),n._has=v._hasPlotType.bind(n);var g=n._modules;for(e=0;e0){var u=o(t._boundingBoxMargins),f=u.left+u.right,d=u.bottom+u.top,h=1-2*l,g=r._container&&r._container.node?r._container.node().getBoundingClientRect():{width:r.width,height:r.height};n=Math.round(h*(g.width-f)),a=Math.round(h*(g.height-d))}else{var y=s?window.getComputedStyle(t):{};n=parseFloat(y.width)||r.width,a=parseFloat(y.height)||r.height}var m=v.layoutAttributes.width.min,x=v.layoutAttributes.height.min;n1,_=!e.height&&Math.abs(r.height-a)>1;(_||b)&&(b&&(r.width=n),_&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),v.sanitizeMargins(r)},v.supplyLayoutModuleDefaults=function(t,e,r,n){var a,i;u.Axes.supplyLayoutDefaults(t,e,r);var o=e._basePlotModules;for(a=0;a.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+a},r:{val:r.x,size:r.r+a},b:{val:r.y,size:r.b+a},t:{val:r.y,size:r.t+a}}}else delete n._pushmargin[e];n._replotting||v.doAutoMargin(t)}},v.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),a=Math.max(e.margin.l||0,0),i=Math.max(e.margin.r||0,0),o=Math.max(e.margin.t||0,0),l=Math.max(e.margin.b||0,0),s=e._pushmargin;if(!1!==e.margin.autoexpand){s.base={l:{val:0,size:a},r:{val:1,size:i},t:{val:1,size:o},b:{val:0,size:l}};for(var f=Object.keys(s),d=0;dv){var M=(y*w+(k-e.width)*v)/(w-v),A=(k*(1-v)+(y-e.width)*(1-w))/(w-v);M>=0&&A>=0&&M+A>a+i&&(a=M,i=A)}}if(c(x)&&s[_].t){var T=s[_].t.val,L=s[_].t.size;if(T>m){var C=(x*T+(L-e.height)*m)/(T-m),S=(L*(1-m)+(x-e.height)*(1-T))/(T-m);C>=0&&S>=0&&C+S>l+o&&(l=C,o=S)}}}}if(r.l=Math.round(a),r.r=Math.round(i),r.t=Math.round(o),r.b=Math.round(l),r.p=Math.round(e.margin.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,!e._replotting&&"{}"!==n&&n!==JSON.stringify(e._size))return u.plot(t)},v.graphJson=function(t,e,r,n,a){function i(t){if("function"==typeof t)return null;if(p.isPlainObject(t)){var e,n,a={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0&&!p.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;a[e]=i(t[e])}return a}return Array.isArray(t)?t.map(i):p.isJSDate(t)?p.ms2DateTimeLocal(+t):t}(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&v.supplyDefaults(t);var o=a?t._fullData:t.data,l=a?t._fullLayout:t.layout,s=(t._transitionData||{})._frames,c={data:(o||[]).map(function(t){var r=i(t);return e&&delete r.fit,r})};return e||(c.layout=i(l)),t.framework&&t.framework.isPolar&&(c=t.framework.getConfig()),s&&(c.frames=i(s)),"object"===n?c:JSON.stringify(c)},v.modifyFrames=function(t,e){var r,n,a,i=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){b=!0}),a.redraw&&t._transitionData._interruptCallbacks.push(function(){return u.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var o,l,s=0,c=0,d=t._fullLayout._basePlotModules,h=!1;if(r)for(l=0;l=0,S=C?d.angularAxis.domain:n.extent(M),O=Math.abs(M[1]-M[0]);T&&!A&&(O=0);var z=S.slice();L&&A&&(z[1]+=O);var D=d.angularAxis.ticksCount||4;D>8&&(D=D/(D/8)+D%8),d.angularAxis.ticksStep&&(D=(z[1]-z[0])/D);var P=d.angularAxis.ticksStep||(z[1]-z[0])/(D*(d.minorTicks+1));k&&(P=Math.max(Math.round(P),1)),z[2]||(z[2]=P);var E=n.range.apply(this,z);if(E=E.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=n.scale.linear().domain(z.slice(0,2)).range("clockwise"===d.direction?[0,360]:[360,0]),f.layout.angularAxis.domain=s.domain(),f.layout.angularAxis.endPadding=L?O:0,void 0===(e=n.select(this).select("svg.chart-root"))||e.empty()){var N=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),I=this.appendChild(this.ownerDocument.importNode(N.documentElement,!0));e=n.select(I)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var R,F=e.select(".chart-group"),j={fill:"none",stroke:d.tickColor},B={"font-size":d.font.size,"font-family":d.font.family,fill:d.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+d.font.outlineColor}).join(",")};if(d.showLegend){R=e.select(".legend-group").attr({transform:"translate("+[b,d.margin.top]+")"}).style({display:"block"});var q=h.map(function(t,e){var r=l.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});l.Legend().config({data:h.map(function(t,e){return t.name||"Element"+e}),legendConfig:i({},l.Legend.defaultConfig().legendConfig,{container:R,elements:q,reverseOrder:d.legend.reverseOrder})})();var H=R.node().getBBox();b=Math.min(d.width-H.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2,b=Math.max(10,b),w=[d.margin.left+b,d.margin.top+b],a.range([0,b]),f.layout.radialAxis.domain=a.domain(),R.attr("transform","translate("+[w[0]+b,w[1]-b]+")")}else R=e.select(".legend-group").style({display:"none"});e.attr({width:d.width,height:d.height}).style({opacity:d.opacity}),F.attr("transform","translate("+w+")").style({cursor:"crosshair"});var V=[(d.width-(d.margin.left+d.margin.right+2*b+(H?H.width:0)))/2,(d.height-(d.margin.top+d.margin.bottom+2*b))/2];if(V[0]=Math.max(0,V[0]),V[1]=Math.max(0,V[1]),e.select(".outer-group").attr("transform","translate("+V+")"),d.title){var U=e.select("g.title-group text").style(B).text(d.title),G=U.node().getBBox();U.attr({x:w[0]-G.width/2,y:w[1]-b-20})}var X=e.select(".radial.axis-group");if(d.radialAxis.gridLinesVisible){var Y=X.selectAll("circle.grid-circle").data(a.ticks(5));Y.enter().append("circle").attr({class:"grid-circle"}).style(j),Y.attr("r",a),Y.exit().remove()}X.select("circle.outside-circle").attr({r:b}).style(j);var Z=e.select("circle.background-circle").attr({r:b}).style({fill:d.backgroundColor,stroke:d.stroke});if(d.radialAxis.visible){var W=n.svg.axis().scale(a).ticks(5).tickSize(5);X.call(W).attr({transform:"rotate("+d.radialAxis.orientation+")"}),X.selectAll(".domain").style(j),X.selectAll("g>text").text(function(t,e){return this.textContent+d.radialAxis.ticksSuffix}).style(B).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){ +r.transitionAxes=t("./transition_axes"),r.plot=function(t,e,r,a){var i,o=t._fullLayout,l=u.getSubplotIds(o,"cartesian"),s=t.calcdata;if(!Array.isArray(e))for(e=[],i=0;iu[1]-.01&&(e.domain=[0,1]),a.noneOrAll(t.domain,e.domain,[0,1])}return r("layer"),e}},{"../../lib":149,"fast-isnumeric":10}],204:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var a=[t.r2l(t.range[0]),t.r2l(t.range[1])],i=a[0]+(a[1]-a[0])*r;t.range=t._input.range=[t.l2r(i+(a[0]-i)*e),t.l2r(i+(a[1]-i)*e)]}},{"../../constants/alignment":131}],205:[function(t,e,r){"use strict";function n(t){return t._id}function a(t,e){if(Array.isArray(t))for(var r=e.cd[0].trace,n=0;n0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],a=t.range[1];return.5*(n+a-3*k*Math.abs(n-a))}return p}function f(e,r,n){var a=c(e,n||t.calendar);if(a===p){if(!i(e))return p;a=c(new Date(+e))}return a}function v(e,r,n){return s(e,r,n||t.calendar)}function y(e){return t._categories[Math.round(e)]}function m(e){if(null!==e&&void 0!==e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return p}function x(e){if(t._categoriesMap){var r=t._categoriesMap[e];if(void 0!==r)return r}if(i(e))return+e}function b(e){return i(e)?a.round(t._b+t._m*e,2):p}function _(e){return(e-t._b)/t._m}e=e||{};var w=(t._id||"x").charAt(0),k=10;t.c2l="log"===t.type?r:u,t.l2c="log"===t.type?n:u,t.l2p=b,t.p2l=_,t.c2p="log"===t.type?function(t,e){return b(r(t,e))}:b,t.p2c="log"===t.type?function(t){return n(_(t))}:_,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=l,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=_,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return r(l(t),e)},t.r2d=t.r2c=function(t){return n(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=u,t.c2r=r,t.l2d=n,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return n(_(t))},t.r2p=function(e){return t.l2p(l(e))},t.p2r=_,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=o.identity,t.d2c=t.r2c=t.d2l=t.r2l=f,t.c2d=t.c2r=t.l2d=t.l2r=v,t.d2p=t.r2p=function(e,r,n){return t.l2p(f(e,0,n))},t.p2d=t.p2r=function(t,e,r){return v(_(t),e,r)},t.cleanPos=function(e){return o.cleanDate(e,p,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=m,t.r2d=t.c2d=t.l2d=y,t.d2r=t.d2l_noadd=x,t.r2c=function(e){var r=x(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=x,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return y(_(t))},t.r2p=t.d2p,t.p2r=_,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e){e||(e="range");var r,n,a=o.nestedProperty(t,e).get();if(n="date"===t.type?o.dfltRange(t.calendar):"y"===w?h.DFLTRANGEY:h.DFLTRANGEX,n=n.slice(),!a||2!==a.length)return void o.nestedProperty(t,e).set(n);for("date"===t.type&&(a[0]=o.cleanDate(a[0],p,t.calendar),a[1]=o.cleanDate(a[1],p,t.calendar)),r=0;r<2;r++)if("date"===t.type){if(!o.isDateTime(a[r],t.calendar)){t[e]=n;break}if(t.r2l(a[0])===t.r2l(a[1])){var l=o.constrain(t.r2l(a[0]),o.MIN_MS+1e3,o.MAX_MS-1e3);a[0]=t.l2r(l-1e3),a[1]=t.l2r(l+1e3);break}}else{if(!i(a[r])){if(!i(a[1-r])){t[e]=n;break}a[r]=a[1-r]*(r?10:.1)}if(a[r]<-d?a[r]=-d:a[r]>d&&(a[r]=d),a[0]===a[1]){var s=Math.max(1,Math.abs(1e-6*a[0]));a[0]-=s,a[1]+=s}}},t.setScale=function(r){var n=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var a=g.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var i=r&&t._r?"_r":"range",l=t.calendar;t.cleanRange(i);var s=t.r2l(t[i][0],l),c=t.r2l(t[i][1],l);if("y"===w?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(s-c),t._b=-t._m*c):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-s),t._b=-t._m*s),!isFinite(t._m)||!isFinite(t._b))throw o.notifier("Something went wrong with axis scaling","long"),e._replotting=!1,new Error("axis scaling")},t.makeCalcdata=function(e,r){var n,a,i,o="date"===t.type&&e[r+"calendar"];if(r in e)for(n=e[r],a=new Array(n.length),i=0;i=t.range[0]&&r<=t.range[1]}:function(e){var r=e.y;return r>=t.range[0]&&r<=t.range[1]},t._min=[],t._max=[],t._separators=e.separators,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":133,"../../lib":149,"./axis_ids":192,"./constants":194,d3:7,"fast-isnumeric":10}],207:[function(t,e,r){"use strict";function n(t){var e=["showexponent","showtickprefix","showticksuffix"],r=e.filter(function(e){return void 0!==t[e]}),n=function(e){return t[e]===t[r[0]]};if(r.every(n)||1===r.length)return t[r[0]]}var a=t("../../lib");e.exports=function(t,e,r,i,o){var l=n(t);if(r("tickprefix")&&r("showtickprefix",l),r("ticksuffix")&&r("showticksuffix",l),r("showticklabels")){var s=o.font||{},c=e.color===t.color?e.color:s.color;a.coerceFont(r,"tickfont",{family:s.family,size:s.size,color:c}),r("tickangle"),"category"!==i&&(r("tickformat")||"date"===i||(r("showexponent",l),r("exponentformat"),r("separatethousands")))}"category"===i||o.noHover||r("hoverformat")}},{"../../lib":149}],208:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r,i){var o=n.coerce2(t,e,a,"ticklen"),l=n.coerce2(t,e,a,"tickwidth"),s=n.coerce2(t,e,a,"tickcolor",e.color);r("ticks",i.outerTicks||o||l||s?"outside":"")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":149,"./layout_attributes":200}],209:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").ONEDAY;e.exports=function(t,e,r,o){var l="auto";"array"!==t.tickmode||"log"!==o&&"date"!==o||(t.tickmode="auto"),Array.isArray(t.tickvals)?l="array":t.dtick&&(l="linear");var s=r("tickmode",l);if("auto"===s)r("nticks");else if("linear"===s){var c="date"===o?i:1,u=r("dtick",c);if(n(u))e.dtick=u>0?Number(u):c;else if("string"!=typeof u)e.dtick=c;else{var f=u.charAt(0),d=u.substr(1);d=n(d)?Number(d):0,(d<=0||!("date"===o&&"M"===f&&d===Math.round(d)||"log"===o&&"L"===f||"log"===o&&"D"===f&&(1===d||2===d)))&&(e.dtick=c)}var p="date"===o?a.dateTick0(e.calendar):0,h=r("tick0",p);"date"===o?e.tick0=a.cleanDate(h,p):n(h)&&"D1"!==u&&"D2"!==u?e.tick0=Number(h):e.tick0=p}else{var g=r("tickvals");void 0===g?e.tickmode="auto":r("ticktext")}}},{"../../constants/numerical":133,"../../lib":149,"fast-isnumeric":10}],210:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plotly"),i=t("../../registry"),o=t("../../components/drawing"),l=t("./axes"),s=t("./constants").attrRegex;e.exports=function(t,e,r,c){function u(e,r){function n(e,r,n){for(a=0;a rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.select(".scatterlayer").selectAll(".points");n.selectAll(".point").call(o.setPointGroupScale,1,1).call(o.hideOutsideRangePoints,t),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1).call(o.hideOutsideRangePoints,t)}function d(e,r){var n,a,i,l=m[e.xaxis._id],s=m[e.yaxis._id],c=[];if(l){n=t._fullLayout[l.axisName],a=n._r,i=l.to,c[0]=(a[0]*(1-r)+r*i[0]-a[0])/(a[1]-a[0])*e.xaxis._length;var f=a[1]-a[0],d=i[1]-i[0];n.range[0]=a[0]*(1-r)+r*i[0],n.range[1]=a[1]*(1-r)+r*i[1],c[2]=e.xaxis._length*(1-r+r*d/f)}else c[0]=0,c[2]=e.xaxis._length;if(s){n=t._fullLayout[s.axisName],a=n._r,i=s.to,c[1]=(a[1]*(1-r)+r*i[1]-a[1])/(a[0]-a[1])*e.yaxis._length;var p=a[1]-a[0],h=i[1]-i[0];n.range[0]=a[0]*(1-r)+r*i[0],n.range[1]=a[1]*(1-r)+r*i[1],c[3]=e.yaxis._length*(1-r+r*h/p)}else c[1]=0,c[3]=e.yaxis._length;u(e.xaxis,e.yaxis);var g=e.xaxis,y=e.yaxis,x=!!l,b=!!s,_=x?g._length/c[2]:1,w=b?y._length/c[3]:1,k=x?c[0]:0,M=b?c[1]:0,A=x?c[0]/c[2]*g._length:0,T=b?c[1]/c[3]*y._length:0,L=g._offset-A,C=y._offset-T;v._defs.select("#"+e.clipId+"> rect").call(o.setTranslate,k,M).call(o.setScale,1/_,1/w),e.plot.call(o.setTranslate,L,C).call(o.setScale,_,w).selectAll(".points").selectAll(".point").call(o.setPointGroupScale,1/_,1/w),e.plot.selectAll(".points").selectAll(".textpoint").call(o.setTextPointsScale,1/_,1/w)}function p(){for(var e={},r=0;rr.duration?(p(),M=window.cancelAnimationFrame(g)):M=window.requestAnimationFrame(g)}var v=t._fullLayout,y=[],m=function(t){var e,r,n,a,i={};for(e in t)if(r=e.split("."),r[0].match(s)){var o=e.charAt(0),l=r[0];if(n=v[l],a={},Array.isArray(t[e])?a.to=t[e].slice(0):Array.isArray(t[e].range)&&(a.to=t[e].range.slice(0)),!a.to)continue;a.axisName=l,a.length=n._length,y.push(o),i[o]=a}return i}(e),x=Object.keys(m),b=function(t,e,r){var n,a,i,o=t._plots,l=[];for(n in o){var s=o[n];if(-1===l.indexOf(s)){var c=s.xaxis._id,u=s.yaxis._id,f=s.xaxis.range,d=s.yaxis.range;s.xaxis._r=s.xaxis.range.slice(),s.yaxis._r=s.yaxis.range.slice(),a=r[c]?r[c].to:f,i=r[u]?r[u].to:d,f[0]===a[0]&&f[1]===a[1]&&d[0]===i[0]&&d[1]===i[1]||-1===e.indexOf(c)&&-1===e.indexOf(u)||l.push(s)}}return l}(v,x,m);if(!b.length)return function(){function e(e,r,n){for(var a=0;a0?".":"")+a;c.isPlainObject(i)?l(i,e,o,n+1):e(o,a,i)}})}var s=t("../plotly"),c=t("../lib");r.manageCommandObserver=function(t,e,a,i){var o={},l=!0;e&&e._commandObserver&&(o=e._commandObserver),o.cache||(o.cache={}),o.lookupTable={};var s=r.hasSimpleAPICommandBindings(t,a,o.lookupTable);if(e&&e._commandObserver){if(s)return o;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,o}if(s){n(t,s,o.cache),o.check=function(){if(l){var e=n(t,s,o.cache);return e.changed&&i&&void 0!==o.lookupTable[e.value]&&(o.disable(),Promise.resolve(i({value:e.value,type:s.type,prop:s.prop,traces:s.traces,index:o.lookupTable[e.value]})).then(o.enable,o.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f=e.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=e._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),c=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&n(t,o),l.text(o.text()&&c.text()?" - ":"")}},v.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=s.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return n.append("input").attr({type:"text",name:"data"}).node().value=v.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},v.supplyDefaults=function(t){var e,r=t._fullLayout||{},n=t._fullLayout={},i=t.layout||{},o=t._fullData||[],l=t._fullData=[],s=t.data||[];if(t._transitionData||v.createTransitionData(t),r._initialAutoSizeIsDone){var c=r.width,f=r.height;v.supplyLayoutGlobalDefaults(i,n),i.width||(n.width=c),i.height||(n.height=f)}else{v.supplyLayoutGlobalDefaults(i,n);var d=!i.width||!i.height,p=n.autosize,h=t._context&&t._context.autosizable;d&&(p||h)?v.plotAutoSize(t,i,n):d&&v.sanitizeMargins(t),!p&&d&&(i.width=n.width,i.height=n.height)}n._initialAutoSizeIsDone=!0,n._dataLength=s.length,n._globalTransforms=(t._context||{}).globalTransforms,v.supplyDataDefaults(s,l,i,n),n._has=v._hasPlotType.bind(n);var g=n._modules;for(e=0;e0){var u=o(t._boundingBoxMargins),f=u.left+u.right,d=u.bottom+u.top,h=1-2*l,g=r._container&&r._container.node?r._container.node().getBoundingClientRect():{width:r.width,height:r.height};n=Math.round(h*(g.width-f)),a=Math.round(h*(g.height-d))}else{var y=s?window.getComputedStyle(t):{};n=parseFloat(y.width)||r.width,a=parseFloat(y.height)||r.height}var m=v.layoutAttributes.width.min,x=v.layoutAttributes.height.min;n1,_=!e.height&&Math.abs(r.height-a)>1;(_||b)&&(b&&(r.width=n),_&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),v.sanitizeMargins(r)},v.supplyLayoutModuleDefaults=function(t,e,r,n){var a,i;u.Axes.supplyLayoutDefaults(t,e,r);var o=e._basePlotModules;for(a=0;a.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+a},r:{val:r.x,size:r.r+a},b:{val:r.y,size:r.b+a},t:{val:r.y,size:r.t+a}}}else delete n._pushmargin[e];n._replotting||v.doAutoMargin(t)}},v.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),a=Math.max(e.margin.l||0,0),i=Math.max(e.margin.r||0,0),o=Math.max(e.margin.t||0,0),l=Math.max(e.margin.b||0,0),s=e._pushmargin;if(!1!==e.margin.autoexpand){s.base={l:{val:0,size:a},r:{val:1,size:i},t:{val:1,size:o},b:{val:0,size:l}};for(var f=Object.keys(s),d=0;dv){var M=(y*w+(k-e.width)*v)/(w-v),A=(k*(1-v)+(y-e.width)*(1-w))/(w-v);M>=0&&A>=0&&M+A>a+i&&(a=M,i=A)}}if(c(x)&&s[_].t){var T=s[_].t.val,L=s[_].t.size;if(T>m){var C=(x*T+(L-e.height)*m)/(T-m),S=(L*(1-m)+(x-e.height)*(1-T))/(T-m);C>=0&&S>=0&&C+S>l+o&&(l=C,o=S)}}}}if(r.l=Math.round(a),r.r=Math.round(i),r.t=Math.round(o),r.b=Math.round(l),r.p=Math.round(e.margin.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,!e._replotting&&"{}"!==n&&n!==JSON.stringify(e._size))return u.plot(t)},v.graphJson=function(t,e,r,n,a){function i(t){if("function"==typeof t)return null;if(p.isPlainObject(t)){var e,n,a={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0&&!p.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;a[e]=i(t[e])}return a}return Array.isArray(t)?t.map(i):p.isJSDate(t)?p.ms2DateTimeLocal(+t):t}(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&v.supplyDefaults(t);var o=a?t._fullData:t.data,l=a?t._fullLayout:t.layout,s=(t._transitionData||{})._frames,c={data:(o||[]).map(function(t){var r=i(t);return e&&delete r.fit,r})};return e||(c.layout=i(l)),t.framework&&t.framework.isPolar&&(c=t.framework.getConfig()),s&&(c.frames=i(s)),"object"===n?c:JSON.stringify(c)},v.modifyFrames=function(t,e){var r,n,a,i=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){b=!0}),a.redraw&&t._transitionData._interruptCallbacks.push(function(){return u.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var o,l,s=0,c=0,d=t._fullLayout._basePlotModules,h=!1;if(r)for(l=0;l=0,S=C?d.angularAxis.domain:n.extent(M),O=Math.abs(M[1]-M[0]);T&&!A&&(O=0);var z=S.slice();L&&A&&(z[1]+=O);var D=d.angularAxis.ticksCount||4;D>8&&(D=D/(D/8)+D%8),d.angularAxis.ticksStep&&(D=(z[1]-z[0])/D);var P=d.angularAxis.ticksStep||(z[1]-z[0])/(D*(d.minorTicks+1));k&&(P=Math.max(Math.round(P),1)),z[2]||(z[2]=P);var E=n.range.apply(this,z);if(E=E.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=n.scale.linear().domain(z.slice(0,2)).range("clockwise"===d.direction?[0,360]:[360,0]),f.layout.angularAxis.domain=s.domain(),f.layout.angularAxis.endPadding=L?O:0,void 0===(e=n.select(this).select("svg.chart-root"))||e.empty()){var N=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),I=this.appendChild(this.ownerDocument.importNode(N.documentElement,!0));e=n.select(I)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var R,F=e.select(".chart-group"),j={fill:"none",stroke:d.tickColor},B={"font-size":d.font.size,"font-family":d.font.family,fill:d.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+d.font.outlineColor}).join(",")};if(d.showLegend){R=e.select(".legend-group").attr({transform:"translate("+[b,d.margin.top]+")"}).style({display:"block"});var q=h.map(function(t,e){var r=l.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});l.Legend().config({data:h.map(function(t,e){return t.name||"Element"+e}),legendConfig:i({},l.Legend.defaultConfig().legendConfig,{container:R,elements:q,reverseOrder:d.legend.reverseOrder})})();var H=R.node().getBBox();b=Math.min(d.width-H.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2,b=Math.max(10,b),w=[d.margin.left+b,d.margin.top+b],a.range([0,b]),f.layout.radialAxis.domain=a.domain(),R.attr("transform","translate("+[w[0]+b,w[1]-b]+")")}else R=e.select(".legend-group").style({display:"none"});e.attr({width:d.width,height:d.height}).style({opacity:d.opacity}),F.attr("transform","translate("+w+")").style({cursor:"crosshair"});var V=[(d.width-(d.margin.left+d.margin.right+2*b+(H?H.width:0)))/2,(d.height-(d.margin.top+d.margin.bottom+2*b))/2];if(V[0]=Math.max(0,V[0]),V[1]=Math.max(0,V[1]),e.select(".outer-group").attr("transform","translate("+V+")"),d.title){var U=e.select("g.title-group text").style(B).text(d.title),G=U.node().getBBox();U.attr({x:w[0]-G.width/2,y:w[1]-b-20})}var X=e.select(".radial.axis-group");if(d.radialAxis.gridLinesVisible){var Y=X.selectAll("circle.grid-circle").data(a.ticks(5));Y.enter().append("circle").attr({class:"grid-circle"}).style(j),Y.attr("r",a),Y.exit().remove()}X.select("circle.outside-circle").attr({r:b}).style(j);var Z=e.select("circle.background-circle").attr({r:b}).style({fill:d.backgroundColor,stroke:d.stroke});if(d.radialAxis.visible){var W=n.svg.axis().scale(a).ticks(5).tickSize(5);X.call(W).attr({transform:"rotate("+d.radialAxis.orientation+")"}),X.selectAll(".domain").style(j),X.selectAll("g>text").text(function(t,e){return this.textContent+d.radialAxis.ticksSuffix}).style(B).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){ return"horizontal"===d.radialAxis.tickOrientation?"rotate("+-d.radialAxis.orientation+") translate("+[0,B["font-size"]]+")":"translate("+[0,B["font-size"]]+")"}}),X.selectAll("g>line").style({stroke:"black"})}var Q=e.select(".angular.axis-group").selectAll("g.angular-tick").data(E),$=Q.enter().append("g").classed("angular-tick",!0);Q.attr({transform:function(t,e){return"rotate("+c(t,e)+")"}}).style({display:d.angularAxis.visible?"block":"none"}),Q.exit().remove(),$.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(d.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(d.minorTicks+1)==0)}).style(j),$.selectAll(".minor").style({stroke:d.minorTickColor}),Q.select("line.grid-line").attr({x1:d.tickLength?b-d.tickLength:0,x2:b}).style({display:d.angularAxis.gridLinesVisible?"block":"none"}),$.append("text").classed("axis-text",!0).style(B);var J=Q.select("text.axis-text").attr({x:b+d.labelOffset,dy:o+"em",transform:function(t,e){var r=c(t,e),n=b+d.labelOffset,a=d.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-r+" "+n+" 0)":"radial"==a?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:d.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(d.minorTicks+1)!=0?"":k?k[t]+d.angularAxis.ticksSuffix:t+d.angularAxis.ticksSuffix}).style(B);d.angularAxis.rewriteTicks&&J.text(function(t,e){return e%(d.minorTicks+1)!=0?"":d.angularAxis.rewriteTicks(this.textContent,e)});var K=n.max(F.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));R.attr({transform:"translate("+[b+K,d.margin.top]+")"});var tt=e.select("g.geometry-group").selectAll("g").size()>0,et=e.select("g.geometry-group").selectAll("g.geometry").data(h);if(et.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),et.exit().remove(),h[0]||tt){var rt=[];h.forEach(function(t,e){var r={};r.radialScale=a,r.angularScale=s,r.container=et.filter(function(t,r){return r==e}),r.geometry=t.geometry,r.orientation=d.orientation,r.direction=d.direction,r.index=e,rt.push({data:t,geometryConfig:r})});var nt=n.nest().key(function(t,e){return void 0!==t.data.groupId||"unstacked"}).entries(rt),at=[];nt.forEach(function(t,e){"unstacked"===t.key?at=at.concat(t.values.map(function(t,e){return[t]})):at.push(t.values)}),at.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return i(l[r].defaultConfig(),t)});l[r]().config(n)()})}var it,ot,lt=e.select(".guides-group"),st=e.select(".tooltips-group"),ct=l.tooltipPanel().config({container:st,fontSize:8})(),ut=l.tooltipPanel().config({container:st,fontSize:8})(),ft=l.tooltipPanel().config({container:st,hasTick:!0})();if(!A){var dt=lt.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});F.on("mousemove.angular-guide",function(t,e){var r=l.util.getMousePos(Z).angle;dt.attr({x2:-b,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-d.orientation)%360;it=s.invert(n);var a=l.util.convertToCartesian(b+12,r+180);ct.text(l.util.round(it)).move([a[0]+w[0],a[1]+w[1]])}).on("mouseout.angular-guide",function(t,e){lt.select("line").style({opacity:0})})}var pt=lt.select("circle").style({stroke:"grey",fill:"none"});F.on("mousemove.radial-guide",function(t,e){var r=l.util.getMousePos(Z).radius;pt.attr({r:r}).style({opacity:.5}),ot=a.invert(l.util.getMousePos(Z).radius);var n=l.util.convertToCartesian(r,d.radialAxis.orientation);ut.text(l.util.round(ot)).move([n[0]+w[0],n[1]+w[1]])}).on("mouseout.radial-guide",function(t,e){pt.style({opacity:0}),ft.hide(),ct.hide(),ut.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,r){var a=n.select(this),i=this.style.fill,o="black",s=this.style.opacity||1;if(a.attr({"data-opacity":s}),i&&"none"!==i){a.attr({"data-fill":i}),o=n.hsl(i).darker().toString(),a.style({fill:o,opacity:1});var c={t:l.util.round(t[0]),r:l.util.round(t[1])};A&&(c.t=k[t[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),d=e.node().getBoundingClientRect(),p=[f.left+f.width/2-V[0]-d.left,f.top+f.height/2-V[1]-d.top];ft.config({color:o}).text(u),ft.move(p)}else i=this.style.stroke||"black",a.attr({"data-stroke":i}),o=n.hsl(i).darker().toString(),a.style({stroke:o,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ft.show()}).on("mouseout.tooltip",function(t,e){ft.hide();var r=n.select(this),a=r.attr("data-fill");a?r.style({fill:a,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})}),p}var e,r,a,s,c={data:[],layout:{}},u={},f={},d=n.dispatch("hover"),p={};return p.render=function(e){return t(e),this},p.config=function(t){if(!arguments.length)return c;var e=l.util.cloneJson(t);return e.data.forEach(function(t,e){c.data[e]||(c.data[e]={}),i(c.data[e],l.Axis.defaultConfig().data[0]),i(c.data[e],t)}),i(c.layout,l.Axis.defaultConfig().layout),i(c.layout,e.layout),this},p.getLiveConfig=function(){return f},p.getinputConfig=function(){return u},p.radialScale=function(t){return a},p.angularScale=function(t){return s},p.svg=function(){return e},n.rebind(p,d,"on"),p},l.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},l.util={},l.DATAEXTENT="dataExtent",l.AREA="AreaChart",l.LINE="LinePlot",l.DOT="DotPlot",l.BAR="BarChart",l.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},l.util._extend=function(t,e){for(var r in t)e[r]=t[r]},l.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},l.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180;return[e,t(n)]})},l.util.dataFromEquation=function(t,e,r){var a=e||6,i=[],o=[];n.range(0,360+a,a).forEach(function(e,r){var n=e*Math.PI/180,a=t(n);i.push(e),o.push(a)});var l={t:i,r:o};return r&&(l.name=r),l},l.util.ensureArray=function(t,e){if(void 0===t)return null;var r=[].concat(t);return n.range(e).map(function(t,e){return r[e]||r[0]})},l.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=l.util.ensureArray(t[e],r)}),t},l.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},l.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},l.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},l.util.arrayLast=function(t){return t[t.length-1]},l.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},l.util.flattenArray=function(t){for(var e=[];!l.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},l.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},l.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},l.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},l.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],a=e[1],i={};return i.x=r,i.y=a,i.pos=e,i.angle=180*(Math.atan2(a,r)+Math.PI)/Math.PI,i.radius=Math.sqrt(r*r+a*a),i},l.util.duplicatesCount=function(t){for(var e,r={},n={},a=0,i=t.length;a0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:d(o),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return v.fill(r,a,i)},"fill-opacity":0,stroke:function(t,e){return v.stroke(r,a,i)},"stroke-width":function(t,e){return v["stroke-width"](r,a,i)},"stroke-dasharray":function(t,e){return v["stroke-dasharray"](r,a,i)},opacity:function(t,e){return v.opacity(r,a,i)},display:function(t,e){return v.display(r,a,i)}})}};var p=t.angularScale.range(),h=Math.abs(p[1]-p[0])/s[0].length*Math.PI/180,g=n.svg.arc().startAngle(function(t){return-h/2}).endAngle(function(t){return h/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 v={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 a[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return void 0===e[n].data.visible||e[n].data.visible?"block":"none"}},y=n.select(this).selectAll("g.layer").data(s);y.enter().append("g").attr({class:"layer"});var m=y.selectAll("path.mark").data(function(t,e){return t});m.enter().append("path").attr({class:"mark"}),m.style(v).each(f[t.geometryType]),m.exit().remove(),y.exit().remove()})}var e=[l.PolyChart.defaultConfig()],r=n.dispatch("hover"),a={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,r){e[r]||(e[r]={}),i(e[r],l.PolyChart.defaultConfig()),i(e[r],t)}),this):e},t.getColorScale=function(){},n.rebind(t,r,"on"),t},l.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},l.BarChart=function(){return l.PolyChart()},l.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},l.AreaChart=function(){return l.PolyChart()},l.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},l.DotPlot=function(){return l.PolyChart()},l.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},l.LinePlot=function(){return l.PolyChart()},l.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},l.Legend=function(){function t(){var r=e.legendConfig,a=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var a=i({},r.elements[e]);return a.name=t,a.color=[].concat(r.elements[e].color)[n],a})}),o=n.merge(a);o=o.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||void 0===r.elements[e].visibleInLegend)}),r.reverseOrder&&(o=o.reverse());var l=r.container;("string"==typeof l||l.nodeName)&&(l=n.select(l));var s=o.map(function(t,e){return t.color}),c=r.fontSize,u=null==r.isContinuous?"number"==typeof o[0]:r.isContinuous,f=u?r.height:c*o.length,d=l.classed("legend-group",!0),p=d.selectAll("svg").data([0]),h=p.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"});h.append("g").classed("legend-axis",!0),h.append("g").classed("legend-marks",!0);var g=n.range(o.length),v=n.scale[u?"linear":"ordinal"]().domain(g).range(s),y=n.scale[u?"linear":"ordinal"]().domain(g)[u?"range":"rangePoints"]([0,f]),m=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":-1!=n.svg.symbolTypes.indexOf(t)?n.svg.symbol().type(t).size(r)():n.svg.symbol().type("square").size(r)()};if(u){var x=p.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}}),p.append("rect").classed("legend-mark",!0).attr({height:r.height,width:r.colorBandWidth,fill:"url(#grad1)"})}else{var b=p.select(".legend-marks").selectAll("path.legend-mark").data(o);b.enter().append("path").classed("legend-mark",!0),b.attr({transform:function(t,e){return"translate("+[c/2,y(e)+c/2]+")"},d:function(t,e){var r=t.symbol;return m(r,c)},fill:function(t,e){return v(e)}}),b.exit().remove()}var _=n.svg.axis().scale(y).orient("right"),w=p.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 o[e].name}),t}var e=l.Legend.defaultConfig(),r=n.dispatch("hover");return t.config=function(t){return arguments.length?(i(e,t),this):e},n.rebind(t,r,"on"),t},l.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},l.tooltipPanel=function(){var t,e,r,a={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},o="tooltip-"+l.tooltipPanel.uid++,s=function(){t=a.container.selectAll("g."+o).data([0]);var n=t.enter().append("g").classed(o,!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+10,dy:.3*+a.fontSize}),s};return s.text=function(i){var o=n.hsl(a.color).l,l=o>=.5?"#aaa":"white",c=o>=.5?"black":"white",u=i||"";e.style({fill:c,"font-size":a.fontSize+"px"}).text(u);var f=a.padding,d=e.node().getBBox(),p={fill:a.color,stroke:l,"stroke-width":"2px"},h=d.width+2*f+10,g=d.height+2*f;return r.attr({d:"M"+[[10,-g/2],[10,-g/4],[a.hasTick?0:10,0],[10,g/4],[10,g/2],[h,g/2],[h,-g/2]].join("L")+"Z"}).style(p),t.attr({transform:"translate("+[10,-g/2+2*f]+")"}),t.style({display:"block"}),s},s.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),s},s.hide=function(){if(t)return t.style({display:"none"}),s},s.show=function(){if(t)return t.style({display:"block"}),s},s.config=function(t){return i(a,t),s},s},l.tooltipPanel.uid=1,l.adapter={},l.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=i({},t);return[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]].forEach(function(t,r){l.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var a=l.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=a.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)})}if(t.layout){var o=i({},t.layout);if([[o,["plot_bgcolor"],["backgroundColor"]],[o,["showlegend"],["showLegend"]],[o,["radialaxis"],["radialAxis"]],[o,["angularaxis"],["angularAxis"]],[o.angularaxis,["showline"],["gridLinesVisible"]],[o.angularaxis,["showticklabels"],["labelsVisible"]],[o.angularaxis,["nticks"],["ticksCount"]],[o.angularaxis,["tickorientation"],["tickOrientation"]],[o.angularaxis,["ticksuffix"],["ticksSuffix"]],[o.angularaxis,["range"],["domain"]],[o.angularaxis,["endpadding"],["endPadding"]],[o.radialaxis,["showline"],["gridLinesVisible"]],[o.radialaxis,["tickorientation"],["tickOrientation"]],[o.radialaxis,["ticksuffix"],["ticksSuffix"]],[o.radialaxis,["range"],["domain"]],[o.angularAxis,["showline"],["gridLinesVisible"]],[o.angularAxis,["showticklabels"],["labelsVisible"]],[o.angularAxis,["nticks"],["ticksCount"]],[o.angularAxis,["tickorientation"],["tickOrientation"]],[o.angularAxis,["ticksuffix"],["ticksSuffix"]],[o.angularAxis,["range"],["domain"]],[o.angularAxis,["endpadding"],["endPadding"]],[o.radialAxis,["showline"],["gridLinesVisible"]],[o.radialAxis,["tickorientation"],["tickOrientation"]],[o.radialAxis,["ticksuffix"],["ticksSuffix"]],[o.radialAxis,["range"],["domain"]],[o.font,["outlinecolor"],["outlineColor"]],[o.legend,["traceorder"],["reverseOrder"]],[o,["labeloffset"],["labelOffset"]],[o,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(t,r){l.util.translator.apply(null,t.concat(e))}),e?(void 0!==o.tickLength&&(o.angularaxis.ticklen=o.tickLength,delete o.tickLength),o.tickColor&&(o.angularaxis.tickcolor=o.tickColor,delete o.tickColor)):(o.angularAxis&&void 0!==o.angularAxis.ticklen&&(o.tickLength=o.angularAxis.ticklen),o.angularAxis&&void 0!==o.angularAxis.tickcolor&&(o.tickColor=o.angularAxis.tickcolor)),o.legend&&"boolean"!=typeof o.legend.reverseOrder&&(o.legend.reverseOrder="normal"!=o.legend.reverseOrder),o.legend&&"boolean"==typeof o.legend.traceorder&&(o.legend.traceorder=o.legend.traceorder?"reversed":"normal",delete o.legend.reverseOrder),o.margin&&void 0!==o.margin.t){var s=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(o.margin).forEach(function(t,e){u[c[s.indexOf(t.key)]]=t.value}),o.margin=u}e&&(delete o.needsEndSpacing,delete o.minorTickColor,delete o.minorTicks,delete o.angularaxis.ticksCount,delete o.angularaxis.ticksCount,delete o.angularaxis.ticksStep,delete o.angularaxis.rewriteTicks,delete o.angularaxis.nticks,delete o.radialaxis.ticksCount,delete o.radialaxis.ticksCount,delete o.radialaxis.ticksStep,delete o.radialaxis.rewriteTicks,delete o.radialaxis.nticks),r.layout=o}return r},t}},{"../../constants/alignment":131,"../../lib":149,d3:7}],223:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../components/color"),o=t("./micropolar"),l=t("./undo_manager"),s=a.extendDeepAll,c=e.exports={};c.framework=function(t){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,i||(i=o.Axis()),u=o.adapter.plotly().convert(r),i.config(u).render(f),t.data=r.data,t.layout=r.layout,c.fillLayout(t),r}var r,a,i,u,f,d=new l;return e.isPolar=!0,e.svg=function(){return i.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return o.adapter.plotly().convert(i.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:i.angularScale(),r:i.radialScale()}},e.setUndoPoint=function(){var t=this,e=o.util.cloneJson(r);!function(e,r){d.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,a),a=o.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(),o={width:800,height:600,paper_bgcolor:i.background,_container:e,_paperdiv:r,_paper:a};t._fullLayout=s(o,t.layout)}},{"../../components/color":34,"../../lib":149,"./micropolar":222,"./undo_manager":224,d3:7}],224:[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-1!==n},hasRedo:function(){return n-1}var i=t("../lib"),o=t("../plots/plots"),l=i.extendFlat,s=i.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,i=t.data,c=t.layout,u=s([],i),f=s({},c,n(e.tileClass)),d=t._context||{};if(e.width&&(f.width=e.width),e.height&&(f.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){f.annotations=[];var p=Object.keys(f);for(r=0;r")?"":e.html(t).text()});return e.remove(),r}function a(t){ -return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}var i=t("d3"),o=t("../lib"),l=t("../components/drawing"),s=t("../components/color"),c=t("../constants/xmlns_namespaces"),u=/"/g,f=new RegExp('("TOBESTRIPPED)|(TOBESTRIPPED")',"g");e.exports=function(t,e,r){var d,p=t._fullLayout,h=p._paper,g=p._toppaper,v=p.width,y=p.height;h.insert("rect",":first-child").call(l.setRect,0,0,v,y).call(s.fill,p.paper_bgcolor);var m=p._basePlotModules||[];for(d=0;d0&&A>0,j=k<=I&&A<=R,B=k<=R&&A<=I,q="h"===y?I>=k*(R/A):R>=A*(I/k);F&&(j||B||q)?x="inside":(x="outside",b.remove(),b=null)}else x="inside";if(!b&&(b=g(e,m,"outside"===x?C:L),_=M.bBox(b.node()),k=_.width,A=_.height,k<=0||A<=0))return void b.remove();var H,V;"outside"===x?(V="both"===v.constraintext||"outside"===v.constraintext,H=i(o,d,p,h,_,y,V)):(V="both"===v.constraintext||"inside"===v.constraintext,H=a(o,d,p,h,_,y,V)),b.attr("transform",H)}}}function a(t,e,r,n,a,i,l){var s,c,u,f,d,p=a.width,h=a.height,g=(a.left+a.right)/2,v=(a.top+a.bottom)/2,y=Math.abs(e-t),m=Math.abs(n-r);y>2*D&&m>2*D?(d=D,y-=2*d,m-=2*d):d=0;var x,b;return p<=y&&h<=m?(x=!1,b=1):p<=m&&h<=y?(x=!0,b=1):pr?(u=(t+e)/2,f=n-d-c/2):(u=(t+e)/2,f=n+d+c/2),o(g,v,u,f,b,x)}function i(t,e,r,n,a,i,l){var s,c="h"===i?Math.abs(n-r):Math.abs(e-t);c>2*D&&(s=D);var u=1;l&&(u="h"===i?Math.min(1,c/a.height):Math.min(1,c/a.width));var f,d,p,h,g=(a.left+a.right)/2,v=(a.top+a.bottom)/2;return f=u*a.width,d=u*a.height,"h"===i?er?(p=(t+e)/2,h=n+s+d/2):(p=(t+e)/2,h=n-s-d/2),o(g,v,p,h,u,!1)}function o(t,e,r,n,a,i){var o,l;return a<1?o="scale("+a+") ":(a=1,o=""),l=i?"rotate("+i+" "+t+" "+e+") ":"","translate("+(r-a*t)+" "+(n-a*e)+")"+o+l}function l(t,e){var r=p(t.text,e);return h(L,r)}function s(t,e){var r=p(t.textposition,e);return g(C,r)}function c(t,e,r){return d(S,t.textfont,e,r)}function u(t,e,r){return d(O,t.insidetextfont,e,r)}function f(t,e,r){return d(z,t.outsidetextfont,e,r)}function d(t,e,r,n){e=e||{};var a=p(e.family,r),i=p(e.size,r),o=p(e.color,r);return{family:h(t.family,a,n.family),size:v(t.size,i,n.size),color:y(t.color,o,n.color)}}function p(t,e){var r;return Array.isArray(t)?ea))return e}return void 0!==r?r:t.dflt}function y(t,e,r){return b(e).isValid()?e:void 0!==r?r:t.dflt}var m=t("d3"),x=t("fast-isnumeric"),b=t("tinycolor2"),_=t("../../lib"),w=t("../../lib/svg_text_utils"),k=t("../../components/color"),M=t("../../components/drawing"),A=t("../../components/errorbars"),T=t("./attributes"),L=T.text,C=T.textposition,S=T.textfont,O=T.insidetextfont,z=T.outsidetextfont,D=3;e.exports=function(t,e,r){var a=e.xaxis,i=e.yaxis,o=t._fullLayout,l=e.plot.select(".barlayer").selectAll("g.trace.bars").data(r);l.enter().append("g").attr("class","trace bars"),l.append("g").attr("class","points").each(function(e){var r=e[0].node3=m.select(this),l=e[0].t,s=e[0].trace,c=l.poffset,u=Array.isArray(c);r.selectAll("g.point").data(_.identity).enter().append("g").classed("point",!0).each(function(r,l){function f(t){return 0===o.bargap&&0===o.bargroupgap?m.round(Math.round(t)-A,2):t}function d(t,e){return Math.abs(t-e)>=2?f(t):t>e?Math.ceil(t):Math.floor(t)}var p,h,g,v,y=r.p+(u?c[l]:c),b=y+r.w,_=r.b,w=_+r.s;if("h"===s.orientation?(g=i.c2p(y,!0),v=i.c2p(b,!0),p=a.c2p(_,!0),h=a.c2p(w,!0),r.ct=[h,(g+v)/2]):(p=a.c2p(y,!0),h=a.c2p(b,!0),g=i.c2p(_,!0),v=i.c2p(w,!0),r.ct=[(p+h)/2,v]),!(x(p)&&x(h)&&x(g)&&x(v)&&p!==h&&g!==v))return void m.select(this).remove();var M=(r.mlw+1||s.marker.line.width+1||(r.trace?r.trace.marker.line.width:0)+1)-1,A=m.round(M/2%1,2);if(!t._context.staticPlot){var T=k.opacity(r.mc||s.marker.color),L=T<1||M>.01?f:d;p=L(p,h),h=L(h,p),g=L(g,v),v=L(v,g)}var C=m.select(this);C.append("path").style("vector-effect","non-scaling-stroke").attr("d","M"+p+","+g+"V"+v+"H"+h+"V"+g+"Z"),n(t,C,e,l,p,h,g,v)})}),l.call(A.plot,e)}},{"../../components/color":34,"../../components/drawing":58,"../../components/errorbars":64,"../../lib":149,"../../lib/svg_text_utils":169,"./attributes":235,d3:7,"fast-isnumeric":10,tinycolor2:16}],243:[function(t,e,r){"use strict";var n=t("../../constants/interactions").DESELECTDIM;e.exports=function(t,e){var r,a=t.cd,i=[],o=a[0].trace,l=a[0].node3;if(!0!==o.visible)return[];if(!1===e)for(r=0;rc+l||!m(s))&&(f=!0,d(u,t))}for(var a=r.traces,i=y(e),o="fraction"===t._fullLayout.barnorm?1:100,l=o/1e9,s=e.l2c(e.c2l(0)),c="stack"===t._fullLayout.barmode?o:s,u=[s,c],f=!1,p=0;p1||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,o=r.line,l=i.tryColorscale(r,""),s=i.tryColorscale(r,"line");n.select(this).selectAll("path").each(function(t){var e,i,c=(t.mlw+1||o.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&&(i="mlc"in t?t.mlcc=s(t.mlc):Array.isArray(o.color)?a.defaultLine:o.color,u.call(a.stroke,i))})}),e.call(o.style)}},{"../../components/color":34,"../../components/drawing":58,"../../components/errorbars":64,d3:7}],247:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,l){r("marker.color",o),a(t,"marker")&&i(t,e,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(t,"marker.line")&&i(t,e,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width")}},{"../../components/color":34,"../../components/colorscale/defaults":43,"../../components/colorscale/has_colorscale":47}],248:[function(t,e,r){"use strict";var n=t("../../components/color/attributes"),a=t("../../plots/font_attributes"),i=t("../../plots/attributes"),o=t("../../lib/extend").extendFlat,l=a({editType:"calc",colorEditType:"style"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:n.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},editType:"calc"},text:{valType:"data_array",editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:o({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc"},textfont:o({},l,{}),insidetextfont:o({},l,{}),outsidetextfont:o({},l,{}),domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},y:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},editType:"calc"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"number",min:-360,max:360,dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}},{"../../components/color/attributes":33,"../../lib/extend":143,"../../plots/attributes":187,"../../plots/font_attributes":213}],249:[function(t,e,r){"use strict";function n(t,e){for(var r=[],n=0;n")}return g};var s},{"../../components/color":34,"./helpers":252,"fast-isnumeric":10,tinycolor2:16}],251:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes");e.exports=function(t,e,r,i){function o(r,i){return n.coerce(t,e,a,r,i)}var l=n.coerceFont,s=o("values");if(!Array.isArray(s)||!s.length)return void(e.visible=!1);var c=o("labels");Array.isArray(c)||(o("label0"),o("dlabel")),o("marker.line.width")&&o("marker.line.color");var u=o("marker.colors");Array.isArray(u)||(e.marker.colors=[]),o("scalegroup");var f=o("text"),d=o("textinfo",Array.isArray(f)?"text+percent":"percent");if(o("hovertext"),d&&"none"!==d){var p=o("textposition"),h=Array.isArray(p)||"auto"===p,g=h||"inside"===p,v=h||"outside"===p;if(g||v){var y=l(o,"textfont",i.font);g&&l(o,"insidetextfont",y),v&&l(o,"outsidetextfont",y)}}o("domain.x"),o("domain.y"),o("hole"),o("sort"),o("direction"),o("rotation"),o("pull")}},{"../../lib":149,"./attributes":248}],252:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)}},{"../../lib":149}],253:[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":248,"./base_plot":249,"./calc":250,"./defaults":251,"./layout_attributes":254,"./layout_defaults":255,"./plot":256,"./style":257,"./style_one":258}],254:[function(t,e,r){"use strict";e.exports={hiddenlabels:{valType:"data_array",editType:"calc"}}},{}],255:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){!function(r,i){n.coerce(t,e,a,r,i)}("hiddenlabels")}},{"../../lib":149,"./layout_attributes":254}],256:[function(t,e,r){"use strict";function n(t,e,r){var n=Math.sqrt(t.width*t.width+t.height*t.height),i=t.width/t.height,o=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=i+1/(2*Math.tan(o)),f=r.r*Math.min(1/(Math.sqrt(u*u+.5)+u),l/(Math.sqrt(i*i+l/2)+i)),d={scale:2*f/t.height,rCenter:Math.cos(f/r.r)-f*i/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},p=1/i,h=p+1/(2*Math.tan(o)),g=r.r*Math.min(1/(Math.sqrt(h*h+.5)+h),l/(Math.sqrt(p*p+l/2)+p)),v={scale:2*g/t.width,rCenter:Math.cos(g/r.r)-g/i/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},y=v.scale>d.scale?v:d;return c.scale<1&&y.scale>c.scale?y: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 i(t,e){var r=e.pxmid[0],n=e.pxmid[1],a=t.width/2,i=t.height/2;return r<0&&(a*=-1),n<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+r*r/(n*n)),outside:!0}}function o(t,e){function r(t,e){return t.pxmid[1]-e.pxmid[1]}function n(t,e){return e.pxmid[1]-t.pxmid[1]}var a,i,o,l,s,c,u,f,d,p,h,g,v;for(i=0;i<2;i++)for(o=i?r:n,s=i?Math.max:Math.min,u=i?1:-1,a=0;a<2;a++){for(l=a?Math.max:Math.min,c=a?1:-1,f=t[i][a],f.sort(o),d=t[1-i][a],p=d.concat(f),g=[],h=0;h0&&(t.labelExtraY=x),Array.isArray(e.pull))for(a=0;a=e.pull[o.i]||((t.pxmid[1]-o.pxmid[1])*u>0?(f=o.cyFinal+s(o.px0[1],o.px1[1]),(x=f-v-t.labelExtraY)*u>0&&(t.labelExtraY+=x)):(y+t.labelExtraY-m)*u>0&&(n=3*c*Math.abs(a-p.indexOf(t)),d=o.cxFinal+l(o.px0[0],o.px1[0]),(h=d+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*c>0&&(t.labelExtraX+=h)))}(g[h],y)}}}function l(t,e){var r,n,a,i,o,l,s,u,f,d,p=[];for(a=0;au&&(u=l.pull[i]);o.r=Math.min(r/c(l.tilt,Math.sin(s),l.depth),n/c(l.tilt,Math.cos(s),l.depth))/(2+2*u),o.cx=e.l+e.w*(l.domain.x[1]+l.domain.x[0])/2,o.cy=e.t+e.h*(2-l.domain.y[1]-l.domain.y[0])/2,l.scalegroup&&-1===p.indexOf(l.scalegroup)&&p.push(l.scalegroup)}for(i=0;if.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("../../components/fx"),d=t("../../components/color"),p=t("../../components/drawing"),h=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],v=c.trace,y=(v.depth||0)*c.r*Math.sin(0)/2,m=v.tiltaxis||0,x=m*Math.PI/180,b=[y*Math.sin(x),y*Math.cos(x)],_=c.r*Math.cos(0),w=l.selectAll("g.part").data(v.tilt?["top","sides"]:["top"]);w.enter().append("g").attr("class",function(t){return t+" part"}),w.exit().remove(),w.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=[[[],[]],[[],[]]],y=!1;l.each(function(e){function o(n){n.originalEvent=u.event;var i=t._fullLayout,o=t._fullData[v.index],l=f.castHoverinfo(o,i,e.i);if("all"===l&&(l="label+text+value+percent+name"), -t._dragging||!1===i.hovermode||"none"===l||"skip"===l||!l)return void f.hover(t,n,"pie");var s=a(e,c),d=w+e.pxmid[0]*(1-s),p=k+e.pxmid[1]*(1-s),h=r.separators,y=[];-1!==l.indexOf("label")&&y.push(e.label),-1!==l.indexOf("text")&&(o.hovertext?y.push(Array.isArray(o.hovertext)?o.hovertext[e.i]:o.hovertext):o.text&&o.text[e.i]&&y.push(o.text[e.i])),-1!==l.indexOf("value")&&y.push(g.formatPieValue(e.v,h)),-1!==l.indexOf("percent")&&y.push(g.formatPiePercent(e.v/c.vTotal,h)),f.loneHover({x0:d-s*c.r,x1:d+s*c.r,y:p,text:y.join("
"),name:-1!==l.indexOf("name")?o.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:f.castHoverOption(v,e.i,"bgcolor")||e.color,borderColor:f.castHoverOption(v,e.i,"bordercolor"),fontFamily:f.castHoverOption(v,e.i,"font.family"),fontSize:f.castHoverOption(v,e.i,"font.size"),fontColor:f.castHoverOption(v,e.i,"font.color")},{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:t}),f.hover(t,n,"pie"),T=!0}function l(e){e.originalEvent=u.event,t.emit("plotly_unhover",{event:u.event,points:[e]}),T&&(f.loneUnhover(r._hoverlayer.node()),T=!1)}function d(){t._hoverdata=[e],t._hoverdata.trace=c.trace,f.click(t,u.event)}function x(t,r,n,a){return"a"+a*c.r+","+a*_+" "+m+" "+e.largeArc+(n?" 1 ":" 0 ")+a*(r[0]-t[0])+","+a*(r[1]-t[1])}if(e.hidden)return void u.select(this).selectAll("path,g").remove();e.pointNumber=e.i,e.curveNumber=v.index,s[e.pxmid[1]<0?0:1][e.pxmid[0]<0?0:1].push(e);var w=c.cx+b[0],k=c.cy+b[1],M=u.select(this),A=M.selectAll("path.surface").data([e]),T=!1;if(A.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),M.select("path.textline").remove(),M.on("mouseover",o).on("mouseout",l).on("click",d),v.pull){var L=+(Array.isArray(v.pull)?v.pull[e.i]:v.pull)||0;L>0&&(w+=L*e.pxmid[0],k+=L*e.pxmid[1])}e.cxFinal=w,e.cyFinal=k;var C=v.hole;if(e.v===c.vTotal){var S="M"+(w+e.px0[0])+","+(k+e.px0[1])+x(e.px0,e.pxmid,!0,1)+x(e.pxmid,e.px0,!0,1)+"Z";C?A.attr("d","M"+(w+C*e.px0[0])+","+(k+C*e.px0[1])+x(e.px0,e.pxmid,!1,C)+x(e.pxmid,e.px0,!1,C)+"Z"+S):A.attr("d",S)}else{var O=x(e.px0,e.px1,!0,1);if(C){var z=1-C;A.attr("d","M"+(w+C*e.px1[0])+","+(k+C*e.px1[1])+x(e.px1,e.px0,!1,C)+"l"+z*e.px0[0]+","+z*e.px0[1]+O+"Z")}else A.attr("d","M"+w+","+k+"l"+e.px0[0]+","+e.px0[1]+O+"Z")}var D=Array.isArray(v.textposition)?v.textposition[e.i]:v.textposition,P=M.selectAll("g.slicetext").data(e.text&&"none"!==D?[0]:[]);P.enter().append("g").classed("slicetext",!0),P.exit().remove(),P.each(function(){var r=u.select(this).selectAll("text").data([0]);r.enter().append("text").attr("data-notex",1),r.exit().remove(),r.text(e.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(p.font,"outside"===D?v.outsidetextfont:v.insidetextfont).call(h.convertToTspans,t);var a,o=p.bBox(r.node());"outside"===D?a=i(o,e):(a=n(o,e,c),"auto"===D&&a.scale<1&&(r.call(p.font,v.outsidetextfont),v.outsidetextfont.family===v.insidetextfont.family&&v.outsidetextfont.size===v.insidetextfont.size||(o=p.bBox(r.node())),a=i(o,e)));var l=w+e.pxmid[0]*a.rCenter+(a.x||0),s=k+e.pxmid[1]*a.rCenter+(a.y||0);a.outside&&(e.yLabelMin=s-o.height/2,e.yLabelMid=s,e.yLabelMax=s+o.height/2,e.labelExtraX=0,e.labelExtraY=0,y=!0),r.attr("transform","translate("+l+","+s+")"+(a.scale<1?"scale("+a.scale+")":"")+(a.rotate?"rotate("+a.rotate+")":"")+"translate("+-(o.left+o.right)/2+","+-(o.top+o.bottom)/2+")")})}),y&&o(s,v),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],i="M"+n+","+a,o=(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]);Math.abs(l)>Math.abs(s)?i+="l"+s*t.pxmid[0]/t.pxmid[1]+","+s+"H"+(n+t.labelExtraX+o):i+="l"+t.labelExtraX+","+l+"v"+(s-l)+"h"+o}else i+="V"+(t.yLabelMid+t.labelExtraY)+"h"+o;e.append("path").classed("textline",!0).call(d.stroke,v.outsidetextfont.color).attr({"stroke-width":Math.min(2,v.outsidetextfont.size/8),d:i,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":34,"../../components/drawing":58,"../../components/fx":75,"../../lib/svg_text_utils":169,"./helpers":252,d3:7}],257:[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,i=n.select(this);i.style({opacity:r.opacity}),i.selectAll(".top path.surface").each(function(t){n.select(this).call(a,t,r)})})}},{"./style_one":258,d3:7}],258:[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 i=r.marker.line.width||0;Array.isArray(i)&&(i=i[e.i]||0),t.style({"stroke-width":i}).call(n.fill,e.color).call(n.stroke,a)}},{"../../components/color":34}],259:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rg&&p.splice(g,p.length-g),h.length>g&&h.splice(g,h.length-g);var v={padded:!0},y={padded:!0};if(o.hasMarkers(e)){if(r=e.marker,c=r.size,Array.isArray(c)){var m={type:"linear"};a.setConvert(m),c=m.makeCalcdata(e.marker,"size"),c.length>g&&c.splice(g,c.length-g)}var x,b=1.6*(e.marker.sizeref||1);x="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/b),3)}:function(t){return Math.max((t||0)/b,3)},v.ppad=y.ppad=Array.isArray(c)?c.map(x):x(c)}l(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||p[0]===p[g-1]&&h[0]===h[g-1]?e.error_y.visible||-1===["tonexty","tozeroy"].indexOf(e.fill)&&(o.hasMarkers(e)||o.hasText(e))||(v.padded=!1,v.ppad=0):v.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||p[0]===p[g-1]&&h[0]===h[g-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(y.padded=!1):y.tozero=!0,a.expand(f,p,v),a.expand(d,h,y);var _=new Array(g);for(u=0;u=0;a--){var i=t[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],263:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../plots/plots"),o=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 i.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 p=e[0].t.cb=l(t,c),h=o.makeColorScaleFunc(o.extractScale(s.colorscale,f,d),{noNumericCheck:!0});p.fillcolor(h).filllevels({start:f,end:d,size:(d-f)/254}).options(s.colorbar)()}},{"../../components/colorbar/draw":37,"../../components/colorscale":48,"../../lib":149,"../../plots/plots":218,"fast-isnumeric":10}],264:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/calc"),i=t("./subtypes");e.exports=function(t){i.hasLines(t)&&n(t,"line")&&a(t,t.line.color,"line","c"),i.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":40,"../../components/colorscale/has_colorscale":47,"./subtypes":281}],265:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20}},{}],266:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("./constants"),o=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"),p=t("../../components/errorbars/defaults");e.exports=function(t,e,r,h){function g(r,i){return n.coerce(t,e,a,r,i)}var v=l(t,e,h,g),y=vV!=N>=V&&(D=O[C-1][0],P=O[C][0],z=D+(P-D)*(V-E)/(N-E),j=Math.min(j,z),B=Math.max(B,z));j=Math.max(j,0),B=Math.min(B,p._length);var U=l.defaultLine;return l.opacity(d.fillcolor)?U=d.fillcolor:l.opacity((d.line||{}).color)&&(U=d.line.color),n.extendFlat(t,{distance:c+10,x0:j,x1:B,y0:V,y1:V,color:U}),delete t.index,d.text&&!Array.isArray(d.text)?t.text=String(d.text):t.text=d.name,[t]}}}},{"../../components/color":34,"../../components/errorbars":64,"../../components/fx":75,"../../lib":149,"./fill_hover_text":267,"./get_trace_color":269}],271:[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","scatter-like"],n.meta={},e.exports=n},{"../../plots/cartesian":199,"./arrays_to_calcdata":259,"./attributes":260,"./calc":261,"./clean_data":262,"./colorbar":263,"./defaults":266,"./hover":270,"./plot":278,"./select":279,"./style":280,"./subtypes":281}],272:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,i,o,l){var s=(t.marker||{}).color;if(o("line.color",r),n(t,"line"))a(t,e,i,o,{prefix:"line.",cLetter:"c"});else{o("line.color",!Array.isArray(s)&&s||r)}o("line.width"),(l||{}).noDash||o("line.dash")}},{"../../components/colorscale/defaults":43,"../../components/colorscale/has_colorscale":47}],273:[function(t,e,r){"use strict";var n=t("../../constants/numerical").BADNUM,a=t("../../lib"),i=a.segmentsIntersect,o=a.constrain,l=t("./constants");e.exports=function(t,e){function r(e){var r=N.c2p(t[e].x),a=I.c2p(t[e].y);return r!==n&&a!==n&&[r,a]}function s(t){var e=t[0]/N._length,r=t[1]/I._length;return(1+l.toleranceGrowth*Math.max(0,-e,e-1,-r,r-1))*j}function c(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function u(t,e){for(var r=[],n=0,a=0;a<4;a++){var o=at[a],l=i(t[0],t[1],e[0],e[1],o[0],o[1],o[2],o[3]);l&&(!n||Math.abs(l.x-r[0][0])>1||Math.abs(l.y-r[0][1])>1)&&(l=[l.x,l.y],n&&c(l,t)et||t[1]nt)return[o(t[0],tt,et),o(t[1],rt,nt)]}function d(t,e){return t[0]===e[0]&&(t[0]===tt||t[0]===et)||(t[1]===e[1]&&(t[1]===rt||t[1]===nt)||void 0)}function p(t,e){var r=[],n=f(t),a=f(e);return n&&a&&d(n,a)?r:(n&&r.push(n),a&&r.push(a),r)}function h(t,e,r){return function(n,i){var o=f(n),l=f(i),s=[];if(o&&l&&d(o,l))return s;o&&s.push(o),l&&s.push(l);var c=2*a.constrain((n[t]+i[t])/2,e,r)-((o||n)[t]+(l||i)[t]);if(c){var u;u=o&&l?c>0==o[t]>l[t]?o:l:o||l,u[t]+=c}return s}}function g(t,e){var r=e[0]-t[0],n=(e[1]-t[1])/r;return(t[1]*e[0]-e[1]*t[0])/r>0?[n>0?tt:et,nt]:[n>0?et:tt,rt]}function v(t){var e=t[0],r=t[1],n=e===U[G-1][0],a=r===U[G-1][1];if(!n||!a)if(G>1){var i=e===U[G-2][0],o=r===U[G-2][1];n&&(e===tt||e===et)&&i?o?G--:U[G-1]=t:a&&(r===rt||r===nt)&&o?i?G--:U[G-1]=t:U[G++]=t}else U[G++]=t}function y(t){U[G-1][0]!==t[0]&&U[G-1][1]!==t[1]&&v([Z,W]),v(t),Q=null,Z=W=0}function m(t){if(X=t[0]et?et:0,Y=t[1]nt?nt:0,X||Y){if(G)if(Q){var e=J(Q,t);e.length>1&&(y(e[0]),U[G++]=e[1])}else $=J(U[G-1],t)[0],U[G++]=$;else U[G++]=[X||t[0],Y||t[1]];var r=U[G-1];X&&Y&&(r[0]!==X||r[1]!==Y)?(Q&&(Z!==X&&W!==Y?v(Z&&W?g(Q,t):[Z||X,W||Y]):Z&&W&&v([Z,W])),v([X,Y])):Z-X&&W-Y&&v([X||Z,Y||W]),Q=t,Z=X,W=Y}else Q&&y(J(Q,t)[0]),U[G++]=t}var x,b,_,w,k,M,A,T,L,C,S,O,z,D,P,E,N=e.xaxis,I=e.yaxis,R=e.simplify,F=e.connectGaps,j=e.baseTolerance,B=e.shape,q="linear"===B,H=[],V=l.minTolerance,U=new Array(t.length),G=0;R||(j=V=-1);var X,Y,Z,W,Q,$,J,K=l.maxScreensAway,tt=-N._length*K,et=N._length*(1+K),rt=-I._length*K,nt=I._length*(1+K),at=[[tt,rt,et,rt],[et,rt,et,nt],[et,nt,tt,nt],[tt,nt,tt,rt]];for("linear"===B||"spline"===B?J=u:"hv"===B||"vh"===B?J=p:"hvh"===B?J=h(0,tt,et):"vhv"===B&&(J=h(1,rt,nt)),x=0;xs(M))break;_=M,z=L[0]*T[0]+L[1]*T[1],z>S?(S=z,w=M,A=!1):z=t.length||!M)break;m(M),b=M}}else m(w)}Q&&v([Z||Q[0],W||Q[1]]),H.push(U.slice(0,G))}return H}},{"../../constants/numerical":133,"../../lib":149,"./constants":265}],274:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],275:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n,a,i=null,o=0;o0?Math.max(e,a):0}}},{"fast-isnumeric":10}],277:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,l,s,c){var u,f=o.isBubble(t),d=(t.line||{}).color;if(c=c||{},d&&(r=d),s("marker.symbol"),s("marker.opacity",f?.7:1),s("marker.size"),s("marker.color",r),a(t,"marker")&&i(t,e,l,s,{prefix:"marker.",cLetter:"c"}),c.noLine||(u=d&&!Array.isArray(d)&&e.marker.color!==d?d:f?n.background:n.defaultLine,s("marker.line.color",u),a(t,"marker.line")&&i(t,e,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",f?1:0)),f&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient){"none"!==s("marker.gradient.type")&&s("marker.gradient.color")}}},{"../../components/color":34,"../../components/colorscale/defaults":43,"../../components/colorscale/has_colorscale":47,"./subtypes":281}],278:[function(t,e,r){"use strict";function n(t,e,r){var n;e.selectAll("g.trace").each(function(t){var e=o.select(this);if(n=t[0].trace,n._nexttrace){if(n._nextFill=e.select(".js-fill.js-tonext"),!n._nextFill.size()){var a=":first-child";e.select(".js-fill.js-tozero").size()&&(a+=" + *"),n._nextFill=e.insert("path",a).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),n._nextFill=null;n.fill&&("tozero"===n.fill.substr(0,6)||"toself"===n.fill||"to"===n.fill.substr(0,2)&&!n._prevtrace)?(n._ownFill=e.select(".js-fill.js-tozero"),n._ownFill.size()||(n._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),n._ownFill=null),e.selectAll(".js-fill").call(s.setClipUrl,r.layerClipId)})}function a(t,e,r,n,a,d,h){function g(t){return k?t.transition():t}function v(t){return t.filter(function(t){return t.vis})}function y(t){return t.id}function m(t){if(t.ids)return y}function x(){return!1}function b(e){var n,a,i,c=e[0].trace,f=o.select(this),d=u.hasMarkers(c),p=u.hasText(c),h=m(c),y=x,b=x;d&&(y=c.marker.maxdisplayed||c._needsCull?v:l.identity),p&&(b=c.marker.maxdisplayed||c._needsCull?v:l.identity),a=f.selectAll("path.point"),n=a.data(y,h);var _=n.enter().append("path").classed("point",!0);k&&_.call(s.pointStyle,c,t).call(s.translatePoints,M,A).style("opacity",0).transition().style("opacity",1);var w=d&&s.tryColorscale(c.marker,""),T=d&&s.tryColorscale(c.marker,"line");n.order(),n.each(function(e){var n=o.select(this),a=g(n);i=s.translatePoint(e,a,M,A),i?(s.singlePointStyle(e,a,c,w,T,t),r.layerClipId&&s.hideOutsideRangePoint(e,a,M,A),c.customdata&&n.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()}),k?n.exit().transition().style("opacity",0).remove():n.exit().remove(),a=f.selectAll("g"),n=a.data(b,h),n.enter().append("g").classed("textpoint",!0).append("text"),n.order(),n.each(function(t){var e=o.select(this),n=g(e.select("text"));i=s.translatePoint(t,n,M,A),i?r.layerClipId&&s.hideOutsideRangePoint(t,e,M,A):e.remove()}),n.selectAll("text").call(s.textPointStyle,c,t).each(function(t){var e=M.c2p(t.x),r=A.c2p(t.y);o.select(this).selectAll("tspan.line").each(function(){g(o.select(this)).attr({x:e,y:r})})}),n.exit().remove()}var _,w;i(t,e,r,n,a);var k=!!h&&h.duration>0,M=r.xaxis,A=r.yaxis,T=n[0].trace,L=T.line,C=o.select(d);if(C.call(c.plot,r,h),!0===T.visible){g(C).style("opacity",T.opacity);var S,O,z=T.fill.charAt(T.fill.length-1);"x"!==z&&"y"!==z&&(z=""),n[0].node3=C;var D="",P=[],E=T._prevtrace;E&&(D=E._prevRevpath||"",O=E._nextFill,P=E._polygons);var N,I,R,F,j,B,q,H,V,U="",G="",X=[],Y=l.noop;if(S=T._ownFill,u.hasLines(T)||"none"!==T.fill){for(O&&O.datum(n),-1!==["hv","vh","hvh","vhv"].indexOf(L.shape)?(R=s.steps(L.shape),F=s.steps(L.shape.split("").reverse().join(""))):R=F="spline"===L.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?s.smoothclosed(t.slice(1),L.smoothing):s.smoothopen(t,L.smoothing)}:function(t){return"M"+t.join("L")},j=function(t){return F(t.reverse())},X=f(n,{xaxis:M,yaxis:A,connectGaps:T.connectgaps,baseTolerance:Math.max(L.width||1,3)/4,shape:L.shape,simplify:L.simplify}),V=T._polygons=new Array(X.length),w=0;w1){var r=o.select(this);if(r.datum(n),t)g(r.style("opacity",0).attr("d",N).call(s.lineGroupStyle)).style("opacity",1);else{var a=g(r);a.attr("d",N),s.singleLineStyle(n,a)}}}}}var Z=C.selectAll(".js-line").data(X);g(Z.exit()).style("opacity",0).remove(),Z.each(Y(!1)),Z.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(Y(!0)),s.setClipUrl(Z,r.layerClipId),X.length&&(S?B&&H&&(z?("y"===z?B[1]=H[1]=A.c2p(0,!0):"x"===z&&(B[0]=H[0]=M.c2p(0,!0)),g(S).attr("d","M"+H+"L"+B+"L"+U.substr(1)).call(s.singleFillStyle)):g(S).attr("d",U+"Z").call(s.singleFillStyle)):"tonext"===T.fill.substr(0,6)&&U&&D&&("tonext"===T.fill?g(O).attr("d",U+"Z"+D+"Z").call(s.singleFillStyle):g(O).attr("d",U+"L"+D.substr(1)+"Z").call(s.singleFillStyle),T._polygons=T._polygons.concat(P)),T._prevRevpath=G,T._prevPolygons=V);var W=C.selectAll(".points");_=W.data([n]),W.each(b),_.enter().append("g").classed("points",!0).each(b),_.exit().remove(),_.each(function(t){var e=!1===t[0].trace.cliponaxis;s.setClipUrl(o.select(this),e?null:r.layerClipId)})}}function i(t,e,r,n,a){var i=r.xaxis,s=r.yaxis,c=o.extent(l.simpleMap(i.range,i.r2c)),f=o.extent(l.simpleMap(s.range,s.r2c)),d=n[0].trace;if(u.hasMarkers(d)){var p=d.marker.maxdisplayed;if(0!==p){var h=n.filter(function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=f[0]&&t.y<=f[1]}),g=Math.ceil(h.length/p),v=0;a.forEach(function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;for(u=h.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),d(t,e,r),n(t,h,e),s=0,c={};sc[e[0].trace.uid]?1:-1}),v){l&&(p=l());o.transition().duration(i.duration).ease(i.easing).each("end",function(){p&&p()}).each("interrupt",function(){p&&p()}).each(function(){h.selectAll("g.trace").each(function(n,o){a(t,o,e,n,r,this,i)})})}else h.selectAll("g.trace").each(function(n,o){a(t,o,e,n,r,this,i)});g&&f.exit().remove(),h.selectAll("path:not([d])").remove()}},{"../../components/drawing":58,"../../components/errorbars":64,"../../lib":149,"../../lib/polygon":160,"./line_points":273,"./link_traces":275,"./subtypes":281,d3:7}],279:[function(t,e,r){"use strict";var n=t("./subtypes"),a=t("../../constants/interactions").DESELECTDIM;e.exports=function(t,e){var r,i,o,l,s=t.cd,c=t.xaxis,u=t.yaxis,f=[],d=s[0].trace,p=d.marker,h=!n.hasMarkers(d)&&!n.hasText(d);if(!0!==d.visible||h)return[];var g=Array.isArray(p.opacity)?1:p.opacity;if(!1===e)for(r=0;r0&&A>0,j=k<=I&&A<=R,B=k<=R&&A<=I,q="h"===y?I>=k*(R/A):R>=A*(I/k);F&&(j||B||q)?x="inside":(x="outside",b.remove(),b=null)}else x="inside";if(!b&&(b=g(e,m,"outside"===x?C:L),_=M.bBox(b.node()),k=_.width,A=_.height,k<=0||A<=0))return void b.remove();var H,V;"outside"===x?(V="both"===v.constraintext||"outside"===v.constraintext,H=i(o,d,p,h,_,y,V)):(V="both"===v.constraintext||"inside"===v.constraintext,H=a(o,d,p,h,_,y,V)),b.attr("transform",H)}}}function a(t,e,r,n,a,i,l){var s,c,u,f,d,p=a.width,h=a.height,g=(a.left+a.right)/2,v=(a.top+a.bottom)/2,y=Math.abs(e-t),m=Math.abs(n-r);y>2*D&&m>2*D?(d=D,y-=2*d,m-=2*d):d=0;var x,b;return p<=y&&h<=m?(x=!1,b=1):p<=m&&h<=y?(x=!0,b=1):pr?(u=(t+e)/2,f=n-d-c/2):(u=(t+e)/2,f=n+d+c/2),o(g,v,u,f,b,x)}function i(t,e,r,n,a,i,l){var s,c="h"===i?Math.abs(n-r):Math.abs(e-t);c>2*D&&(s=D);var u=1;l&&(u="h"===i?Math.min(1,c/a.height):Math.min(1,c/a.width));var f,d,p,h,g=(a.left+a.right)/2,v=(a.top+a.bottom)/2;return f=u*a.width,d=u*a.height,"h"===i?er?(p=(t+e)/2,h=n+s+d/2):(p=(t+e)/2,h=n-s-d/2),o(g,v,p,h,u,!1)}function o(t,e,r,n,a,i){var o,l;return a<1?o="scale("+a+") ":(a=1,o=""),l=i?"rotate("+i+" "+t+" "+e+") ":"","translate("+(r-a*t)+" "+(n-a*e)+")"+o+l}function l(t,e){var r=p(t.text,e);return h(L,r)}function s(t,e){var r=p(t.textposition,e);return g(C,r)}function c(t,e,r){return d(S,t.textfont,e,r)}function u(t,e,r){return d(O,t.insidetextfont,e,r)}function f(t,e,r){return d(z,t.outsidetextfont,e,r)}function d(t,e,r,n){e=e||{};var a=p(e.family,r),i=p(e.size,r),o=p(e.color,r);return{family:h(t.family,a,n.family),size:v(t.size,i,n.size),color:y(t.color,o,n.color)}}function p(t,e){var r;return Array.isArray(t)?ea))return e}return void 0!==r?r:t.dflt}function y(t,e,r){return b(e).isValid()?e:void 0!==r?r:t.dflt}var m=t("d3"),x=t("fast-isnumeric"),b=t("tinycolor2"),_=t("../../lib"),w=t("../../lib/svg_text_utils"),k=t("../../components/color"),M=t("../../components/drawing"),A=t("../../components/errorbars"),T=t("./attributes"),L=T.text,C=T.textposition,S=T.textfont,O=T.insidetextfont,z=T.outsidetextfont,D=3;e.exports=function(t,e,r){var a=e.xaxis,i=e.yaxis,o=t._fullLayout,l=e.plot.select(".barlayer").selectAll("g.trace.bars").data(r);l.enter().append("g").attr("class","trace bars"),l.append("g").attr("class","points").each(function(e){var r=e[0].node3=m.select(this),l=e[0].t,s=e[0].trace,c=l.poffset,u=Array.isArray(c);r.selectAll("g.point").data(_.identity).enter().append("g").classed("point",!0).each(function(r,l){function f(t){return 0===o.bargap&&0===o.bargroupgap?m.round(Math.round(t)-A,2):t}function d(t,e){return Math.abs(t-e)>=2?f(t):t>e?Math.ceil(t):Math.floor(t)}var p,h,g,v,y=r.p+(u?c[l]:c),b=y+r.w,_=r.b,w=_+r.s;if("h"===s.orientation?(g=i.c2p(y,!0),v=i.c2p(b,!0),p=a.c2p(_,!0),h=a.c2p(w,!0),r.ct=[h,(g+v)/2]):(p=a.c2p(y,!0),h=a.c2p(b,!0),g=i.c2p(_,!0),v=i.c2p(w,!0),r.ct=[(p+h)/2,v]),!(x(p)&&x(h)&&x(g)&&x(v)&&p!==h&&g!==v))return void m.select(this).remove();var M=(r.mlw+1||s.marker.line.width+1||(r.trace?r.trace.marker.line.width:0)+1)-1,A=m.round(M/2%1,2);if(!t._context.staticPlot){var T=k.opacity(r.mc||s.marker.color),L=T<1||M>.01?f:d;p=L(p,h),h=L(h,p),g=L(g,v),v=L(v,g)}var C=m.select(this);C.append("path").style("vector-effect","non-scaling-stroke").attr("d","M"+p+","+g+"V"+v+"H"+h+"V"+g+"Z"),n(t,C,e,l,p,h,g,v)})}),l.call(A.plot,e)}},{"../../components/color":34,"../../components/drawing":58,"../../components/errorbars":64,"../../lib":149,"../../lib/svg_text_utils":169,"./attributes":235,d3:7,"fast-isnumeric":10,tinycolor2:16}],243:[function(t,e,r){"use strict";var n=t("../../constants/interactions").DESELECTDIM;e.exports=function(t,e){var r,a=t.cd,i=[],o=a[0].node3;if(!1===e)for(r=0;rc+l||!m(s))&&(f=!0,d(u,t))}for(var a=r.traces,i=y(e),o="fraction"===t._fullLayout.barnorm?1:100,l=o/1e9,s=e.l2c(e.c2l(0)),c="stack"===t._fullLayout.barmode?o:s,u=[s,c],f=!1,p=0;p1||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,o=r.line,l=i.tryColorscale(r,""),s=i.tryColorscale(r,"line");n.select(this).selectAll("path").each(function(t){var e,i,c=(t.mlw+1||o.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&&(i="mlc"in t?t.mlcc=s(t.mlc):Array.isArray(o.color)?a.defaultLine:o.color,u.call(a.stroke,i))})}),e.call(o.style)}},{"../../components/color":34,"../../components/drawing":58,"../../components/errorbars":64,d3:7}],247:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,l){r("marker.color",o),a(t,"marker")&&i(t,e,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(t,"marker.line")&&i(t,e,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width")}},{"../../components/color":34,"../../components/colorscale/defaults":43,"../../components/colorscale/has_colorscale":47}],248:[function(t,e,r){"use strict";var n=t("../../components/color/attributes"),a=t("../../plots/font_attributes"),i=t("../../plots/attributes"),o=t("../../lib/extend").extendFlat,l=a({editType:"calc",colorEditType:"style"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:n.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},editType:"calc"},text:{valType:"data_array",editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:o({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc"},textfont:o({},l,{}),insidetextfont:o({},l,{}),outsidetextfont:o({},l,{}),domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},y:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},editType:"calc"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"number",min:-360,max:360,dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}},{"../../components/color/attributes":33,"../../lib/extend":143,"../../plots/attributes":187,"../../plots/font_attributes":213}],249:[function(t,e,r){"use strict";function n(t,e){for(var r=[],n=0;n")}return g};var s},{"../../components/color":34,"./helpers":252,"fast-isnumeric":10,tinycolor2:16}],251:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes");e.exports=function(t,e,r,i){function o(r,i){return n.coerce(t,e,a,r,i)}var l=n.coerceFont,s=o("values");if(!Array.isArray(s)||!s.length)return void(e.visible=!1);var c=o("labels");Array.isArray(c)||(o("label0"),o("dlabel")),o("marker.line.width")&&o("marker.line.color");var u=o("marker.colors");Array.isArray(u)||(e.marker.colors=[]),o("scalegroup");var f=o("text"),d=o("textinfo",Array.isArray(f)?"text+percent":"percent");if(o("hovertext"),d&&"none"!==d){var p=o("textposition"),h=Array.isArray(p)||"auto"===p,g=h||"inside"===p,v=h||"outside"===p;if(g||v){var y=l(o,"textfont",i.font);g&&l(o,"insidetextfont",y),v&&l(o,"outsidetextfont",y)}}o("domain.x"),o("domain.y"),o("hole"),o("sort"),o("direction"),o("rotation"),o("pull")}},{"../../lib":149,"./attributes":248}],252:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)}},{"../../lib":149}],253:[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":248,"./base_plot":249,"./calc":250,"./defaults":251,"./layout_attributes":254,"./layout_defaults":255,"./plot":256,"./style":257,"./style_one":258}],254:[function(t,e,r){"use strict";e.exports={hiddenlabels:{valType:"data_array",editType:"calc"}}},{}],255:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){!function(r,i){n.coerce(t,e,a,r,i)}("hiddenlabels")}},{"../../lib":149,"./layout_attributes":254}],256:[function(t,e,r){"use strict";function n(t,e,r){var n=Math.sqrt(t.width*t.width+t.height*t.height),i=t.width/t.height,o=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=i+1/(2*Math.tan(o)),f=r.r*Math.min(1/(Math.sqrt(u*u+.5)+u),l/(Math.sqrt(i*i+l/2)+i)),d={scale:2*f/t.height,rCenter:Math.cos(f/r.r)-f*i/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},p=1/i,h=p+1/(2*Math.tan(o)),g=r.r*Math.min(1/(Math.sqrt(h*h+.5)+h),l/(Math.sqrt(p*p+l/2)+p)),v={scale:2*g/t.width,rCenter:Math.cos(g/r.r)-g/i/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},y=v.scale>d.scale?v:d;return c.scale<1&&y.scale>c.scale?y: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 i(t,e){var r=e.pxmid[0],n=e.pxmid[1],a=t.width/2,i=t.height/2;return r<0&&(a*=-1),n<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+r*r/(n*n)),outside:!0}}function o(t,e){function r(t,e){return t.pxmid[1]-e.pxmid[1]}function n(t,e){return e.pxmid[1]-t.pxmid[1]}var a,i,o,l,s,c,u,f,d,p,h,g,v;for(i=0;i<2;i++)for(o=i?r:n,s=i?Math.max:Math.min,u=i?1:-1,a=0;a<2;a++){for(l=a?Math.max:Math.min,c=a?1:-1,f=t[i][a],f.sort(o),d=t[1-i][a],p=d.concat(f),g=[],h=0;h0&&(t.labelExtraY=x),Array.isArray(e.pull))for(a=0;a=e.pull[o.i]||((t.pxmid[1]-o.pxmid[1])*u>0?(f=o.cyFinal+s(o.px0[1],o.px1[1]),(x=f-v-t.labelExtraY)*u>0&&(t.labelExtraY+=x)):(y+t.labelExtraY-m)*u>0&&(n=3*c*Math.abs(a-p.indexOf(t)),d=o.cxFinal+l(o.px0[0],o.px1[0]),(h=d+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*c>0&&(t.labelExtraX+=h)))}(g[h],y)}}}function l(t,e){var r,n,a,i,o,l,s,u,f,d,p=[];for(a=0;au&&(u=l.pull[i]);o.r=Math.min(r/c(l.tilt,Math.sin(s),l.depth),n/c(l.tilt,Math.cos(s),l.depth))/(2+2*u),o.cx=e.l+e.w*(l.domain.x[1]+l.domain.x[0])/2,o.cy=e.t+e.h*(2-l.domain.y[1]-l.domain.y[0])/2,l.scalegroup&&-1===p.indexOf(l.scalegroup)&&p.push(l.scalegroup)}for(i=0;if.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("../../components/fx"),d=t("../../components/color"),p=t("../../components/drawing"),h=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],v=c.trace,y=(v.depth||0)*c.r*Math.sin(0)/2,m=v.tiltaxis||0,x=m*Math.PI/180,b=[y*Math.sin(x),y*Math.cos(x)],_=c.r*Math.cos(0),w=l.selectAll("g.part").data(v.tilt?["top","sides"]:["top"]);w.enter().append("g").attr("class",function(t){return t+" part"}),w.exit().remove(),w.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=[[[],[]],[[],[]]],y=!1;l.each(function(e){function o(n){n.originalEvent=u.event;var i=t._fullLayout,o=t._fullData[v.index],l=f.castHoverinfo(o,i,e.i);if("all"===l&&(l="label+text+value+percent+name"),t._dragging||!1===i.hovermode||"none"===l||"skip"===l||!l)return void f.hover(t,n,"pie") +;var s=a(e,c),d=w+e.pxmid[0]*(1-s),p=k+e.pxmid[1]*(1-s),h=r.separators,y=[];-1!==l.indexOf("label")&&y.push(e.label),-1!==l.indexOf("text")&&(o.hovertext?y.push(Array.isArray(o.hovertext)?o.hovertext[e.i]:o.hovertext):o.text&&o.text[e.i]&&y.push(o.text[e.i])),-1!==l.indexOf("value")&&y.push(g.formatPieValue(e.v,h)),-1!==l.indexOf("percent")&&y.push(g.formatPiePercent(e.v/c.vTotal,h)),f.loneHover({x0:d-s*c.r,x1:d+s*c.r,y:p,text:y.join("
"),name:-1!==l.indexOf("name")?o.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:f.castHoverOption(v,e.i,"bgcolor")||e.color,borderColor:f.castHoverOption(v,e.i,"bordercolor"),fontFamily:f.castHoverOption(v,e.i,"font.family"),fontSize:f.castHoverOption(v,e.i,"font.size"),fontColor:f.castHoverOption(v,e.i,"font.color")},{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:t}),f.hover(t,n,"pie"),T=!0}function l(e){e.originalEvent=u.event,t.emit("plotly_unhover",{event:u.event,points:[e]}),T&&(f.loneUnhover(r._hoverlayer.node()),T=!1)}function d(){t._hoverdata=[e],t._hoverdata.trace=c.trace,f.click(t,u.event)}function x(t,r,n,a){return"a"+a*c.r+","+a*_+" "+m+" "+e.largeArc+(n?" 1 ":" 0 ")+a*(r[0]-t[0])+","+a*(r[1]-t[1])}if(e.hidden)return void u.select(this).selectAll("path,g").remove();e.pointNumber=e.i,e.curveNumber=v.index,s[e.pxmid[1]<0?0:1][e.pxmid[0]<0?0:1].push(e);var w=c.cx+b[0],k=c.cy+b[1],M=u.select(this),A=M.selectAll("path.surface").data([e]),T=!1;if(A.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),M.select("path.textline").remove(),M.on("mouseover",o).on("mouseout",l).on("click",d),v.pull){var L=+(Array.isArray(v.pull)?v.pull[e.i]:v.pull)||0;L>0&&(w+=L*e.pxmid[0],k+=L*e.pxmid[1])}e.cxFinal=w,e.cyFinal=k;var C=v.hole;if(e.v===c.vTotal){var S="M"+(w+e.px0[0])+","+(k+e.px0[1])+x(e.px0,e.pxmid,!0,1)+x(e.pxmid,e.px0,!0,1)+"Z";C?A.attr("d","M"+(w+C*e.px0[0])+","+(k+C*e.px0[1])+x(e.px0,e.pxmid,!1,C)+x(e.pxmid,e.px0,!1,C)+"Z"+S):A.attr("d",S)}else{var O=x(e.px0,e.px1,!0,1);if(C){var z=1-C;A.attr("d","M"+(w+C*e.px1[0])+","+(k+C*e.px1[1])+x(e.px1,e.px0,!1,C)+"l"+z*e.px0[0]+","+z*e.px0[1]+O+"Z")}else A.attr("d","M"+w+","+k+"l"+e.px0[0]+","+e.px0[1]+O+"Z")}var D=Array.isArray(v.textposition)?v.textposition[e.i]:v.textposition,P=M.selectAll("g.slicetext").data(e.text&&"none"!==D?[0]:[]);P.enter().append("g").classed("slicetext",!0),P.exit().remove(),P.each(function(){var r=u.select(this).selectAll("text").data([0]);r.enter().append("text").attr("data-notex",1),r.exit().remove(),r.text(e.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(p.font,"outside"===D?v.outsidetextfont:v.insidetextfont).call(h.convertToTspans,t);var a,o=p.bBox(r.node());"outside"===D?a=i(o,e):(a=n(o,e,c),"auto"===D&&a.scale<1&&(r.call(p.font,v.outsidetextfont),v.outsidetextfont.family===v.insidetextfont.family&&v.outsidetextfont.size===v.insidetextfont.size||(o=p.bBox(r.node())),a=i(o,e)));var l=w+e.pxmid[0]*a.rCenter+(a.x||0),s=k+e.pxmid[1]*a.rCenter+(a.y||0);a.outside&&(e.yLabelMin=s-o.height/2,e.yLabelMid=s,e.yLabelMax=s+o.height/2,e.labelExtraX=0,e.labelExtraY=0,y=!0),r.attr("transform","translate("+l+","+s+")"+(a.scale<1?"scale("+a.scale+")":"")+(a.rotate?"rotate("+a.rotate+")":"")+"translate("+-(o.left+o.right)/2+","+-(o.top+o.bottom)/2+")")})}),y&&o(s,v),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],i="M"+n+","+a,o=(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]);Math.abs(l)>Math.abs(s)?i+="l"+s*t.pxmid[0]/t.pxmid[1]+","+s+"H"+(n+t.labelExtraX+o):i+="l"+t.labelExtraX+","+l+"v"+(s-l)+"h"+o}else i+="V"+(t.yLabelMid+t.labelExtraY)+"h"+o;e.append("path").classed("textline",!0).call(d.stroke,v.outsidetextfont.color).attr({"stroke-width":Math.min(2,v.outsidetextfont.size/8),d:i,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":34,"../../components/drawing":58,"../../components/fx":75,"../../lib/svg_text_utils":169,"./helpers":252,d3:7}],257:[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,i=n.select(this);i.style({opacity:r.opacity}),i.selectAll(".top path.surface").each(function(t){n.select(this).call(a,t,r)})})}},{"./style_one":258,d3:7}],258:[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 i=r.marker.line.width||0;Array.isArray(i)&&(i=i[e.i]||0),t.style({"stroke-width":i}).call(n.fill,e.color).call(n.stroke,a)}},{"../../components/color":34}],259:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rg&&p.splice(g,p.length-g),h.length>g&&h.splice(g,h.length-g);var v={padded:!0},y={padded:!0};if(o.hasMarkers(e)){if(r=e.marker,c=r.size,Array.isArray(c)){var m={type:"linear"};a.setConvert(m),c=m.makeCalcdata(e.marker,"size"),c.length>g&&c.splice(g,c.length-g)}var x,b=1.6*(e.marker.sizeref||1);x="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/b),3)}:function(t){return Math.max((t||0)/b,3)},v.ppad=y.ppad=Array.isArray(c)?c.map(x):x(c)}l(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||p[0]===p[g-1]&&h[0]===h[g-1]?e.error_y.visible||-1===["tonexty","tozeroy"].indexOf(e.fill)&&(o.hasMarkers(e)||o.hasText(e))||(v.padded=!1,v.ppad=0):v.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||p[0]===p[g-1]&&h[0]===h[g-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(y.padded=!1):y.tozero=!0,a.expand(f,p,v),a.expand(d,h,y);var _=new Array(g);for(u=0;u=0;a--){var i=t[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],263:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../plots/plots"),o=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 i.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 p=e[0].t.cb=l(t,c),h=o.makeColorScaleFunc(o.extractScale(s.colorscale,f,d),{noNumericCheck:!0});p.fillcolor(h).filllevels({start:f,end:d,size:(d-f)/254}).options(s.colorbar)()}},{"../../components/colorbar/draw":37,"../../components/colorscale":48,"../../lib":149,"../../plots/plots":218,"fast-isnumeric":10}],264:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/calc"),i=t("./subtypes");e.exports=function(t){i.hasLines(t)&&n(t,"line")&&a(t,t.line.color,"line","c"),i.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":40,"../../components/colorscale/has_colorscale":47,"./subtypes":281}],265:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20}},{}],266:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("./constants"),o=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"),p=t("../../components/errorbars/defaults");e.exports=function(t,e,r,h){function g(r,i){return n.coerce(t,e,a,r,i)}var v=l(t,e,h,g),y=vV!=N>=V&&(D=O[C-1][0],P=O[C][0],z=D+(P-D)*(V-E)/(N-E),j=Math.min(j,z),B=Math.max(B,z));j=Math.max(j,0),B=Math.min(B,p._length);var U=l.defaultLine;return l.opacity(d.fillcolor)?U=d.fillcolor:l.opacity((d.line||{}).color)&&(U=d.line.color),n.extendFlat(t,{distance:c+10,x0:j,x1:B,y0:V,y1:V,color:U}),delete t.index,d.text&&!Array.isArray(d.text)?t.text=String(d.text):t.text=d.name,[t]}}}},{"../../components/color":34,"../../components/errorbars":64,"../../components/fx":75,"../../lib":149,"./fill_hover_text":267,"./get_trace_color":269}],271:[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","scatter-like"],n.meta={},e.exports=n},{"../../plots/cartesian":199,"./arrays_to_calcdata":259,"./attributes":260,"./calc":261,"./clean_data":262,"./colorbar":263,"./defaults":266,"./hover":270,"./plot":278,"./select":279,"./style":280,"./subtypes":281}],272:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,i,o,l){var s=(t.marker||{}).color;if(o("line.color",r),n(t,"line"))a(t,e,i,o,{prefix:"line.",cLetter:"c"});else{o("line.color",!Array.isArray(s)&&s||r)}o("line.width"),(l||{}).noDash||o("line.dash")}},{"../../components/colorscale/defaults":43,"../../components/colorscale/has_colorscale":47}],273:[function(t,e,r){"use strict";var n=t("../../constants/numerical").BADNUM,a=t("../../lib"),i=a.segmentsIntersect,o=a.constrain,l=t("./constants");e.exports=function(t,e){function r(e){var r=N.c2p(t[e].x),a=I.c2p(t[e].y);return r!==n&&a!==n&&[r,a]}function s(t){var e=t[0]/N._length,r=t[1]/I._length;return(1+l.toleranceGrowth*Math.max(0,-e,e-1,-r,r-1))*j}function c(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function u(t,e){for(var r=[],n=0,a=0;a<4;a++){var o=at[a],l=i(t[0],t[1],e[0],e[1],o[0],o[1],o[2],o[3]);l&&(!n||Math.abs(l.x-r[0][0])>1||Math.abs(l.y-r[0][1])>1)&&(l=[l.x,l.y],n&&c(l,t)et||t[1]nt)return[o(t[0],tt,et),o(t[1],rt,nt)]}function d(t,e){return t[0]===e[0]&&(t[0]===tt||t[0]===et)||(t[1]===e[1]&&(t[1]===rt||t[1]===nt)||void 0)}function p(t,e){var r=[],n=f(t),a=f(e);return n&&a&&d(n,a)?r:(n&&r.push(n),a&&r.push(a),r)}function h(t,e,r){return function(n,i){var o=f(n),l=f(i),s=[];if(o&&l&&d(o,l))return s;o&&s.push(o),l&&s.push(l);var c=2*a.constrain((n[t]+i[t])/2,e,r)-((o||n)[t]+(l||i)[t]);if(c){var u;u=o&&l?c>0==o[t]>l[t]?o:l:o||l,u[t]+=c}return s}}function g(t,e){var r=e[0]-t[0],n=(e[1]-t[1])/r;return(t[1]*e[0]-e[1]*t[0])/r>0?[n>0?tt:et,nt]:[n>0?et:tt,rt]}function v(t){var e=t[0],r=t[1],n=e===U[G-1][0],a=r===U[G-1][1];if(!n||!a)if(G>1){var i=e===U[G-2][0],o=r===U[G-2][1];n&&(e===tt||e===et)&&i?o?G--:U[G-1]=t:a&&(r===rt||r===nt)&&o?i?G--:U[G-1]=t:U[G++]=t}else U[G++]=t}function y(t){U[G-1][0]!==t[0]&&U[G-1][1]!==t[1]&&v([Z,W]),v(t),Q=null,Z=W=0}function m(t){if(X=t[0]et?et:0,Y=t[1]nt?nt:0,X||Y){if(G)if(Q){var e=J(Q,t);e.length>1&&(y(e[0]),U[G++]=e[1])}else $=J(U[G-1],t)[0],U[G++]=$;else U[G++]=[X||t[0],Y||t[1]];var r=U[G-1];X&&Y&&(r[0]!==X||r[1]!==Y)?(Q&&(Z!==X&&W!==Y?v(Z&&W?g(Q,t):[Z||X,W||Y]):Z&&W&&v([Z,W])),v([X,Y])):Z-X&&W-Y&&v([X||Z,Y||W]),Q=t,Z=X,W=Y}else Q&&y(J(Q,t)[0]),U[G++]=t}var x,b,_,w,k,M,A,T,L,C,S,O,z,D,P,E,N=e.xaxis,I=e.yaxis,R=e.simplify,F=e.connectGaps,j=e.baseTolerance,B=e.shape,q="linear"===B,H=[],V=l.minTolerance,U=new Array(t.length),G=0;R||(j=V=-1);var X,Y,Z,W,Q,$,J,K=l.maxScreensAway,tt=-N._length*K,et=N._length*(1+K),rt=-I._length*K,nt=I._length*(1+K),at=[[tt,rt,et,rt],[et,rt,et,nt],[et,nt,tt,nt],[tt,nt,tt,rt]];for("linear"===B||"spline"===B?J=u:"hv"===B||"vh"===B?J=p:"hvh"===B?J=h(0,tt,et):"vhv"===B&&(J=h(1,rt,nt)),x=0;xs(M))break;_=M,z=L[0]*T[0]+L[1]*T[1],z>S?(S=z,w=M,A=!1):z=t.length||!M)break;m(M),b=M}}else m(w)}Q&&v([Z||Q[0],W||Q[1]]),H.push(U.slice(0,G))}return H}},{"../../constants/numerical":133,"../../lib":149,"./constants":265}],274:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],275:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n,a,i=null,o=0;o0?Math.max(e,a):0}}},{"fast-isnumeric":10}],277:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,l,s,c){var u,f=o.isBubble(t),d=(t.line||{}).color;if(c=c||{},d&&(r=d),s("marker.symbol"),s("marker.opacity",f?.7:1),s("marker.size"),s("marker.color",r),a(t,"marker")&&i(t,e,l,s,{prefix:"marker.",cLetter:"c"}),c.noLine||(u=d&&!Array.isArray(d)&&e.marker.color!==d?d:f?n.background:n.defaultLine,s("marker.line.color",u),a(t,"marker.line")&&i(t,e,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",f?1:0)),f&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient){"none"!==s("marker.gradient.type")&&s("marker.gradient.color")}}},{"../../components/color":34,"../../components/colorscale/defaults":43,"../../components/colorscale/has_colorscale":47,"./subtypes":281}],278:[function(t,e,r){"use strict";function n(t,e,r){var n;e.selectAll("g.trace").each(function(t){var e=o.select(this);if(n=t[0].trace,n._nexttrace){if(n._nextFill=e.select(".js-fill.js-tonext"),!n._nextFill.size()){var a=":first-child";e.select(".js-fill.js-tozero").size()&&(a+=" + *"),n._nextFill=e.insert("path",a).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),n._nextFill=null;n.fill&&("tozero"===n.fill.substr(0,6)||"toself"===n.fill||"to"===n.fill.substr(0,2)&&!n._prevtrace)?(n._ownFill=e.select(".js-fill.js-tozero"),n._ownFill.size()||(n._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),n._ownFill=null),e.selectAll(".js-fill").call(s.setClipUrl,r.layerClipId)})}function a(t,e,r,n,a,d,h){function g(t){return k?t.transition():t}function v(t){return t.filter(function(t){return t.vis})}function y(t){return t.id}function m(t){if(t.ids)return y}function x(){return!1}function b(e){var n,a,i,c=e[0].trace,f=o.select(this),d=u.hasMarkers(c),p=u.hasText(c),h=m(c),y=x,b=x;d&&(y=c.marker.maxdisplayed||c._needsCull?v:l.identity),p&&(b=c.marker.maxdisplayed||c._needsCull?v:l.identity),a=f.selectAll("path.point"),n=a.data(y,h);var _=n.enter().append("path").classed("point",!0);k&&_.call(s.pointStyle,c,t).call(s.translatePoints,M,A).style("opacity",0).transition().style("opacity",1);var w=d&&s.tryColorscale(c.marker,""),T=d&&s.tryColorscale(c.marker,"line");n.order(),n.each(function(e){var n=o.select(this),a=g(n);i=s.translatePoint(e,a,M,A),i?(s.singlePointStyle(e,a,c,w,T,t),r.layerClipId&&s.hideOutsideRangePoint(e,a,M,A),c.customdata&&n.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()}),k?n.exit().transition().style("opacity",0).remove():n.exit().remove(),a=f.selectAll("g"),n=a.data(b,h),n.enter().append("g").classed("textpoint",!0).append("text"),n.order(),n.each(function(t){var e=o.select(this),n=g(e.select("text"));i=s.translatePoint(t,n,M,A),i?r.layerClipId&&s.hideOutsideRangePoint(t,e,M,A):e.remove()}),n.selectAll("text").call(s.textPointStyle,c,t).each(function(t){var e=M.c2p(t.x),r=A.c2p(t.y);o.select(this).selectAll("tspan.line").each(function(){g(o.select(this)).attr({x:e,y:r})})}),n.exit().remove()}var _,w;i(t,e,r,n,a);var k=!!h&&h.duration>0,M=r.xaxis,A=r.yaxis,T=n[0].trace,L=T.line,C=o.select(d);if(C.call(c.plot,r,h),!0===T.visible){g(C).style("opacity",T.opacity);var S,O,z=T.fill.charAt(T.fill.length-1);"x"!==z&&"y"!==z&&(z=""),n[0].node3=C;var D="",P=[],E=T._prevtrace;E&&(D=E._prevRevpath||"",O=E._nextFill,P=E._polygons);var N,I,R,F,j,B,q,H,V,U="",G="",X=[],Y=l.noop;if(S=T._ownFill,u.hasLines(T)||"none"!==T.fill){for(O&&O.datum(n),-1!==["hv","vh","hvh","vhv"].indexOf(L.shape)?(R=s.steps(L.shape),F=s.steps(L.shape.split("").reverse().join(""))):R=F="spline"===L.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?s.smoothclosed(t.slice(1),L.smoothing):s.smoothopen(t,L.smoothing)}:function(t){return"M"+t.join("L")},j=function(t){return F(t.reverse())},X=f(n,{xaxis:M,yaxis:A,connectGaps:T.connectgaps,baseTolerance:Math.max(L.width||1,3)/4,shape:L.shape,simplify:L.simplify}),V=T._polygons=new Array(X.length),w=0;w1){var r=o.select(this);if(r.datum(n),t)g(r.style("opacity",0).attr("d",N).call(s.lineGroupStyle)).style("opacity",1);else{var a=g(r);a.attr("d",N),s.singleLineStyle(n,a)}}}}}var Z=C.selectAll(".js-line").data(X);g(Z.exit()).style("opacity",0).remove(),Z.each(Y(!1)),Z.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(Y(!0)),s.setClipUrl(Z,r.layerClipId),X.length&&(S?B&&H&&(z?("y"===z?B[1]=H[1]=A.c2p(0,!0):"x"===z&&(B[0]=H[0]=M.c2p(0,!0)),g(S).attr("d","M"+H+"L"+B+"L"+U.substr(1)).call(s.singleFillStyle)):g(S).attr("d",U+"Z").call(s.singleFillStyle)):"tonext"===T.fill.substr(0,6)&&U&&D&&("tonext"===T.fill?g(O).attr("d",U+"Z"+D+"Z").call(s.singleFillStyle):g(O).attr("d",U+"L"+D.substr(1)+"Z").call(s.singleFillStyle),T._polygons=T._polygons.concat(P)),T._prevRevpath=G,T._prevPolygons=V);var W=C.selectAll(".points");_=W.data([n]),W.each(b),_.enter().append("g").classed("points",!0).each(b),_.exit().remove(),_.each(function(t){var e=!1===t[0].trace.cliponaxis;s.setClipUrl(o.select(this),e?null:r.layerClipId)})}}function i(t,e,r,n,a){var i=r.xaxis,s=r.yaxis,c=o.extent(l.simpleMap(i.range,i.r2c)),f=o.extent(l.simpleMap(s.range,s.r2c)),d=n[0].trace;if(u.hasMarkers(d)){var p=d.marker.maxdisplayed;if(0!==p){var h=n.filter(function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=f[0]&&t.y<=f[1]}),g=Math.ceil(h.length/p),v=0;a.forEach(function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;for(u=h.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),d(t,e,r),n(t,h,e),s=0,c={};sc[e[0].trace.uid]?1:-1}),v){l&&(p=l());o.transition().duration(i.duration).ease(i.easing).each("end",function(){p&&p()}).each("interrupt",function(){p&&p()}).each(function(){h.selectAll("g.trace").each(function(n,o){a(t,o,e,n,r,this,i)})})}else h.selectAll("g.trace").each(function(n,o){a(t,o,e,n,r,this,i)});g&&f.exit().remove(),h.selectAll("path:not([d])").remove()}},{"../../components/drawing":58,"../../components/errorbars":64,"../../lib":149,"../../lib/polygon":160,"./line_points":273,"./link_traces":275,"./subtypes":281,d3:7}],279:[function(t,e,r){"use strict";var n=t("./subtypes"),a=t("../../constants/interactions").DESELECTDIM;e.exports=function(t,e){var r,i,o,l,s=t.cd,c=t.xaxis,u=t.yaxis,f=[],d=s[0].trace,p=d.marker;if(!n.hasMarkers(d)&&!n.hasText(d))return[];var h=Array.isArray(p.opacity)?1:p.opacity;if(!1===e)for(r=0;r i) j--; + pi.edgepaths[j] = edgepathj.concat(pts, edgepathi); } + break; } - }); + } if(!doublemerged) { - pi.edgepaths[edgei] = pts.concat(edgepath); + pi.edgepaths[i] = pts.concat(edgepathi); } } - }); - pi.edgepaths.forEach(function(edgepath, edgei) { - if(!merged && equalPts(edgepath[edgepath.length - 1], pts[0], xtol, ytol)) { - pts.splice(0, 1); - pi.edgepaths[edgei] = edgepath.concat(pts); + } + for(i = 0; i < pi.edgepaths.length; i++) { + if(merged) break; + edgepathi = pi.edgepaths[i]; + if(equalPts(edgepathi[edgepathi.length - 1], pts[0], xtol, ytol)) { + pts.shift(); + pi.edgepaths[i] = edgepathi.concat(pts); merged = true; } - }); + } if(!merged) pi.edgepaths.push(pts); } @@ -66554,7 +66550,7 @@ module.exports = function selectPoints(searchInfo, polygon) { // TODO: include lines? that would require per-segment line properties var hasOnlyLines = (!subtypes.hasMarkers(trace) && !subtypes.hasText(trace)); - if(trace.visible !== true || hasOnlyLines) return []; + if(hasOnlyLines) return []; var opacity = Array.isArray(marker.opacity) ? 1 : marker.opacity; diff --git a/dist/plotly-cartesian.min.js b/dist/plotly-cartesian.min.js index 696963d1288..bc08a29292f 100644 --- a/dist/plotly-cartesian.min.js +++ b/dist/plotly-cartesian.min.js @@ -1,5 +1,5 @@ /** -* plotly.js (cartesian - minified) v1.31.1 +* plotly.js (cartesian - minified) v1.31.2 * Copyright 2012-2017, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -15,17 +15,17 @@ yellowgreen:"9acd32"},X=n.hexNames=function(t){var e={};for(var r in t)t.hasOwnP 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}],67:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],68:[function(t,e,r){"use strict";function n(t,e,r,n){var i=e["error_"+n]||{},s=i.visible&&-1!==["linear","log"].indexOf(r.type),c=[];if(s){for(var u=l(i),f=0;f0;t.each(function(t){var d,p=t[0].trace,h=p.error_x||{},g=p.error_y||{};p.ids&&(d=function(t){return t.id});var v=l.hasMarkers(p)&&p.marker.maxdisplayed>0;g.visible||h.visible||(t=[]);var y=a.select(this).selectAll("g.errorbar").data(t,d);if(y.exit().remove(),t.length){h.visible||y.selectAll("path.xerror").remove(),g.visible||y.selectAll("path.yerror").remove(),y.style("opacity",1);var m=y.enter().append("g").classed("errorbar",!0);f&&m.style("opacity",0).transition().duration(r.duration).style("opacity",1),o.setClipUrl(y,e.layerClipId),y.each(function(t){var e=a.select(this),o=n(t,c,u);if(!v||t.vis){var l;if(g.visible&&i(o.x)&&i(o.yh)&&i(o.ys)){var d=g.width;l="M"+(o.x-d)+","+o.yh+"h"+2*d+"m-"+d+",0V"+o.ys,o.noYS||(l+="m-"+d+",0h"+2*d);var p=e.select("path.yerror");s=!p.size(),s?p=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):f&&(p=p.transition().duration(r.duration).ease(r.easing)),p.attr("d",l)}if(h.visible&&i(o.y)&&i(o.xh)&&i(o.xs)){var y=(h.copy_ystyle?g:h).width;l="M"+o.xh+","+(o.y-y)+"v"+2*y+"m0,-"+y+"H"+o.xs,o.noXS||(l+="m0,-"+y+"v"+2*y);var m=e.select("path.xerror");s=!m.size(),s?m=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):f&&(m=m.transition().duration(r.duration).ease(r.easing)),m.attr("d",l)}}})}})}},{"../../traces/scatter/subtypes":354,"../drawing":65,d3:14,"fast-isnumeric":17}],73:[function(t,e,r){"use strict";var n=t("d3"),a=t("../color");e.exports=function(t){t.each(function(t){var e=t[0].trace,r=e.error_y||{},i=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)})}},{"../color":41,d3:14}],74:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes");e.exports={hoverlabel:{bgcolor:{valType:"color",arrayOk:!0,editType:"none"},bordercolor:{valType:"color",arrayOk:!0,editType:"none"},font:n({arrayOk:!0,editType:"none"}),namelength:{valType:"integer",min:-1,arrayOk:!0,editType:"none"},editType:"calc"}}},{"../../plots/font_attributes":220}],75:[function(t,e,r){"use strict";function n(t,e,r,n){n=n||a.identity,Array.isArray(t)&&(e[0][r]=n(t))}var a=t("../../lib"),i=t("../../registry");e.exports=function(t){for(var e=t.calcdata,r=t._fullLayout,o=0;o=0&&r.indexJ.width||Q<0||Q>J.height)return x.unhoverRaw(t,e)}if(P="xval"in e?w.flat(d,e.xval):w.p2c(L,W),I="yval"in e?w.flat(d,e.yval):w.p2c(C,Q),!f(P[0])||!f(I[0]))return p.warn("Fx.hover failed",e,t),x.unhoverRaw(t,e)}var K=1/0;for(R=0;RZ&&(X.splice(0,Z),K=X[0].distance)}if(0===X.length)return x.unhoverRaw(t,e);X.sort(function(t,e){return t.distance-e.distance});var at=t._hoverdata,it=[];for(N=0;N1,ct=m.combine(g.plot_bgcolor||m.background,g.paper_bgcolor),ut={hovermode:E,rotateLabels:st,bgColor:ct,container:g._hoverlayer,outerContainer:g._paperdiv,commonLabelOpts:g.hoverlabel},ft=a(X,ut,t);if(i(X,st?"xa":"ya"),o(ft,st),e.target&&e.target.tagName){var dt=_.getComponentMethod("annotations","hasClickToShow")(t,it);v(u.select(e.target),dt?"pointer":"")}e.target&&!n&&c(t,e,at)&&(at&&t.emit("plotly_unhover",{event:e,points:at}),t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:L,yaxes:C,xvals:P,yvals:I}))}function a(t,e,r){var n,a,i=e.hovermode,o=e.rotateLabels,l=e.bgColor,s=e.container,c=e.outerContainer,f=e.commonLabelOpts||{},d=e.fontFamily||k.HOVERFONT,p=e.fontSize||k.HOVERFONTSIZE,h=t[0],v=h.xa,x=h.ya,b="y"===i?"yLabel":"xLabel",_=h[b],w=(String(_)||"").split(" ")[0],A=c.node().getBoundingClientRect(),T=A.top,L=A.width,C=A.height,O=h.distance<=k.MAXDIST&&("x"===i||"y"===i);for(n=0;n-1&&n.length>h&&(n=h>3?n.substr(0,h-3)+"...":n.substr(0,h))}void 0!==t.extraText&&(a+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(a+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(a+="y: "+t.yLabel+"
"),a+=(a?"z: ":"")+t.zLabel):O&&t[i+"Label"]===_?a=t[("x"===i?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(a=t.yLabel):a=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(a+=(a?"
":"")+t.text),""===a&&(""===n&&e.remove(),a=n);var v=e.select("text.nums").call(y.font,t.fontFamily||d,t.fontSize||p,t.fontColor||f).text(a).attr("data-notex",1).call(g.positionText,0,0).call(g.convertToTspans,r),x=e.select("text.name"),b=0;n&&n!==a?(x.call(y.font,t.fontFamily||d,t.fontSize||p,c).text(n).attr("data-notex",1).call(g.positionText,0,0).call(g.convertToTspans,r),b=x.node().getBoundingClientRect().width+2*S):(x.remove(),e.select("rect").remove()),e.select("path").style({fill:c,stroke:f});var w,k,A=v.node().getBoundingClientRect(),D=t.xa._offset+(t.x0+t.x1)/2,E=t.ya._offset+(t.y0+t.y1)/2,P=Math.abs(t.x1-t.x0),I=Math.abs(t.y1-t.y0),N=A.width+z+S+b;t.ty0=T-A.top,t.bx=A.width+2*S,t.by=A.height+2*S,t.anchor="start",t.txwidth=A.width,t.tx2width=b,t.offset=0,o?(t.pos=D,w=E+I/2+N<=C,k=E-I/2-N>=0,"top"!==t.idealAlign&&w||!k?w?(E+=I/2,t.anchor="start"):t.anchor="middle":(E-=I/2,t.anchor="end")):(t.pos=E,w=D+P/2+N<=L,k=D-P/2-N>=0,"left"!==t.idealAlign&&w||!k?w?(D+=P/2,t.anchor="start"):t.anchor="middle":(D-=P/2,t.anchor="end")),v.attr("text-anchor",t.anchor),b&&x.attr("text-anchor",t.anchor),e.attr("transform","translate("+D+","+E+")"+(o?"rotate("+M+")":""))}),P}function i(t,e){function r(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,i=r.pos+r.dp+r.size-e.pmax,a>.01){for(l=t.length-1;l>=0;l--)t[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=t.length-1;l>=0;l--)t[l].dp-=i;n=!1}if(n){var c=0;for(o=0;oe.pmax&&c++;for(o=t.length-1;o>=0&&!(c<=0);o--)s=t[o],s.pos>e.pmax-1&&(s.del=!0,c--);for(o=0;o=0;l--)t[l].dp-=i;for(o=t.length-1;o>=0&&!(c<=0);o--)s=t[o],s.pos+s.dp+s.size>e.pmax&&(s.del=!0,c--)}}}for(var n,a,i,o,l,s,c,u=0,f=t.map(function(t,r){var n=t[e];return[{i:r,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===n._id.charAt(0)?T:1)/2,pmin:n._offset,pmax:n._offset+n._length}]}).sort(function(t,e){return t[0].posref-e[0].posref});!n&&u<=t.length;){for(u++,n=!0,o=0;o.01&&h.pmin===g.pmin&&h.pmax===g.pmax){for(l=p.length-1;l>=0;l--)p[l].dp+=a;for(d.push.apply(d,p),f.splice(o+1,1),c=0,l=d.length-1;l>=0;l--)c+=d[l].dp;for(i=c/d.length,l=d.length-1;l>=0;l--)d[l].dp-=i;n=!1}else o++}f.forEach(r)}for(o=f.length-1;o>=0;o--){var v=f[o];for(l=v.length-1;l>=0;l--){var y=v[l],m=t[y.i];m.offset=y.dp,m.del=y.del}}}function o(t,e){t.each(function(t){var r=u.select(this);if(t.del)return void r.remove();var n="end"===t.anchor?-1:1,a=r.select("text.nums"),i={start:1,end:-1,middle:0}[t.anchor],o=i*(z+S),l=o+i*(t.txwidth+S),s=0,c=t.offset;"middle"===t.anchor&&(o-=t.tx2width/2,l-=t.tx2width/2),e&&(c*=-C,s=t.offset*L),r.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(n*z+s)+","+(z+c)+"v"+(t.by/2-z)+"h"+n*t.bx+"v-"+t.by+"H"+(n*z+s)+"V"+(c-z)+"Z"),a.call(g.positionText,o+s,c+t.ty0-t.by/2+S),t.tx2width&&(r.select("text.name").call(g.positionText,l+i*S+s,c+t.ty0-t.by/2+S),r.select("rect").call(y.setRect,l+(i-1)*t.tx2width/2+s,c-t.by/2-1,t.tx2width,t.by+2))})}function l(t,e){function r(e,r,n){var a=l(r,n);a&&(t[e]=a)}var n=t.index,a=t.trace||{},i=t.cd[0],o=t.cd[n]||{},l=Array.isArray(n)?function(t,e){return p.castOption(i,n,t)||p.extractOption({},a,"",e)}:function(t,e){return p.extractOption(o,a,t,e)};r("hoverinfo","hi","hoverinfo"),r("color","hbg","hoverlabel.bgcolor"),r("borderColor","hbc","hoverlabel.bordercolor"),r("fontFamily","htf","hoverlabel.font.family"),r("fontSize","hts","hoverlabel.font.size"),r("fontColor","htc","hoverlabel.font.color"),r("nameLength","hnl","hoverlabel.namelength"),t.posref="y"===e?(t.x0+t.x1)/2:(t.y0+t.y1)/2,t.x0=p.constrain(t.x0,0,t.xa._length),t.x1=p.constrain(t.x1,0,t.xa._length),t.y0=p.constrain(t.y0,0,t.ya._length),t.y1=p.constrain(t.y1,0,t.ya._length);var s;if(void 0!==t.xLabelVal){s="log"===t.xa.type&&t.xLabelVal<=0;var c=b.tickText(t.xa,t.xa.c2l(s?-t.xLabelVal:t.xLabelVal),"hover");s?0===t.xLabelVal?t.xLabel="0":t.xLabel="-"+c.text:t.xLabel=c.text,t.xVal=t.xa.c2d(t.xLabelVal)}if(void 0!==t.yLabelVal){s="log"===t.ya.type&&t.yLabelVal<=0;var u=b.tickText(t.ya,t.ya.c2l(s?-t.yLabelVal:t.yLabelVal),"hover");s?0===t.yLabelVal?t.yLabel="0":t.yLabel="-"+u.text:t.yLabel=u.text,t.yVal=t.ya.c2d(t.yLabelVal)}if(void 0!==t.zLabelVal&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var f=b.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+f+" / -"+b.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+f,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var d=b.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+d+" / -"+b.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+d,"y"===e&&(t.distance+=1)}var h=t.hoverinfo||t.trace.hoverinfo;return"all"!==h&&(h=h.split("+"),-1===h.indexOf("x")&&(t.xLabel=void 0),-1===h.indexOf("y")&&(t.yLabel=void 0),-1===h.indexOf("z")&&(t.zLabel=void 0),-1===h.indexOf("text")&&(t.text=void 0),-1===h.indexOf("name")&&(t.name=void 0)),t}function s(t,e){var r=e.hovermode,n=e.container,a=t[0],i=a.xa,o=a.ya,l=i.showspikes,s=o.showspikes;if(n.selectAll(".spikeline").remove(),"closest"===r&&(l||s)){var c=e.fullLayout,u=i._offset+(a.x0+a.x1)/2,f=o._offset+(a.y0+a.y1)/2,p=m.combine(c.plot_bgcolor,c.paper_bgcolor),h=d.readability(a.color,p)<1.5?m.contrast(p):a.color;if(s){var g=o.spikemode,v=o.spikethickness,x=o.spikecolor||h,b=o._boundingBox,_=(b.left+b.right)/2=0;n--){var a=r[n],i=t._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber))return!0}return!1}var u=t("d3"),f=t("fast-isnumeric"),d=t("tinycolor2"),p=t("../../lib"),h=t("../../lib/events"),g=t("../../lib/svg_text_utils"),v=t("../../lib/override_cursor"),y=t("../drawing"),m=t("../color"),x=t("../dragelement"),b=t("../../plots/cartesian/axes"),_=t("../../registry"),w=t("./helpers"),k=t("./constants"),M=k.YANGLE,A=Math.PI*M/180,T=1/Math.sin(A),L=Math.cos(A),C=Math.sin(A),z=k.HOVERARROWSIZE,S=k.HOVERTEXTPAD;r.hover=function(t,e,r,a){t=p.getGraphDiv(t),p.throttle(t._fullLayout._uid+k.HOVERID,k.HOVERMINTIME,function(){n(t,e,r,a)})},r.loneHover=function(t,e){var r={color:t.color||m.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,trace:{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0},n=u.select(e.container),i=e.outerContainer?u.select(e.outerContainer):n,l={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||m.background,container:n,outerContainer:i},s=a([r],l,e.gd);return o(s,l.rotateLabels),s.node()}},{"../../lib":156,"../../lib/events":149,"../../lib/override_cursor":166,"../../lib/svg_text_utils":176,"../../plots/cartesian/axes":196,"../../registry":240,"../color":41,"../dragelement":62,"../drawing":65,"./constants":77,"./helpers":79,d3:14,"fast-isnumeric":17,tinycolor2:23}],81:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,a){a=a||{},r("hoverlabel.bgcolor",a.bgcolor),r("hoverlabel.bordercolor",a.bordercolor),r("hoverlabel.namelength",a.namelength),n.coerceFont(r,"hoverlabel.font",a.font)}},{"../../lib":156}],82:[function(t,e,r){"use strict";function n(t){var e=l.isD3Selection(t)?t:o.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()}function a(t,e,r){return l.castOption(t,e,"hoverlabel."+r)}function i(t,e,r){function n(r){return l.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}return l.castOption(t,r,"hoverinfo",n)}var o=t("d3"),l=t("../../lib"),s=t("../dragelement"),c=t("./helpers"),u=t("./layout_attributes");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:u},attributes:t("./attributes"),layoutAttributes:u,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:c.getDistanceFunction,getClosest:c.getClosest,inbox:c.inbox,appendArrayPointValue:c.appendArrayPointValue,castHoverOption:a,castHoverinfo:i,hover:t("./hover").hover,unhover:s.unhover,loneHover:t("./hover").loneHover,loneUnhover:n,click:t("./click")}},{"../../lib":156,"../dragelement":62,"./attributes":74,"./calc":75,"./click":76,"./constants":77,"./defaults":78,"./helpers":79,"./hover":80,"./layout_attributes":83,"./layout_defaults":84,"./layout_global_defaults":85,d3:14}],83:[function(t,e,r){"use strict";var n=t("./constants"),a=t("../../plots/font_attributes")({editType:"none"});a.family.dflt=n.HOVERFONT,a.size.dflt=n.HOVERFONTSIZE,e.exports={dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1],editType:"modebar"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"}}},{"../../plots/font_attributes":220,"./constants":77}],84:[function(t,e,r){"use strict";function n(t){for(var e=!0,r=0;r=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}},{}],92:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes");e.exports={bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:a.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:n({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},x:{valType:"number",min:-2,max:3,dflt:1.02,editType:"legend"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",min:-2,max:3,dflt:1,editType:"legend"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"legend"},editType:"legend"}},{"../../plots/font_attributes":220,"../color/attributes":40}],93:[function(t,e,r){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],94:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("./attributes"),o=t("../../plots/layout_attributes"),l=t("./helpers");e.exports=function(t,e,r){function s(t,e){return a.coerce(p,h,i,t,e)}for(var c,u,f,d,p=t.legend||{},h=e.legend={},g=0,v="normal",y=0;y1)){if(s("bgcolor",e.paper_bgcolor),s("bordercolor"),s("borderwidth"),a.coerceFont(s,"font",e.font),s("orientation"),"h"===h.orientation){var x=t.xaxis;x&&x.rangeslider&&x.rangeslider.visible?(c=0,f="left",u=1.1,d="bottom"):(c=0,f="left",u=-.1,d="top")}s("traceorder",v),l.isGrouped(e.legend)&&s("tracegroupgap"),s("x",c),s("xanchor",f),s("y",u),s("yanchor",d),a.noneOrAll(p,h,["x","y"])}}},{"../../lib":156,"../../plots/layout_attributes":223,"../../registry":240,"./attributes":92,"./helpers":98}],95:[function(t,e,r){"use strict";function n(t,e){function r(r){y.convertToTspans(r,e,function(){i(t,e)})}var n=t.data()[0][0],a=e._fullLayout,o=n.trace,l=p.traceIs(o,"pie"),s=o.index,c=l?n.label:o.name,d=t.selectAll("text.legendtext").data([0]);d.enter().append("text").classed("legendtext",!0),d.attr("text-anchor","start").classed("user-select-none",!0).call(g.font,a.legend.font).text(c),e._context.edits.legendText&&!l?d.call(y.makeEditable,{gd:e}).call(r).on("edit",function(t){this.text(t).call(r);var a=t;this.text()||(t=" ");var i,o,l=n.trace._fullInput||{},c={};if(-1!==["ohlc","candlestick"].indexOf(l.type))i=n.trace.transforms,o=i[i.length-1].direction,c[o+".name"]=t;else if(p.hasTransform(l,"groupby")){var d=p.getTransformIndices(l,"groupby"),h=d[d.length-1],g=f.keyedContainer(l,"transforms["+h+"].styles","target","value.name");""===a?g.remove(n.trace._group):g.set(n.trace._group,t),c=g.constructUpdate()}else c.name=t;return u.restyle(e,c,s)}):d.call(r)}function a(t,e){var r,n=1,a=t.selectAll("rect").data([0]);a.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(v.fill,"rgba(0,0,0,0)"),a.on("mousedown",function(){r=(new Date).getTime(),r-e._legendMouseDownTimeT&&(n=Math.max(n-1,1)),1===n?r._clickTimeout=setTimeout(function(){m(t,e,n)},T):2===n&&(r._clickTimeout&&clearTimeout(r._clickTimeout),e._legendMouseDownTime=0,m(t,e,n))}})}function i(t,e){var r=t.data()[0][0];if(!r.trace.showlegend)return void t.remove();var n,a,i=t.select("g[class*=math-group]"),o=i.node(),l=e._fullLayout.legend,s=l.font.size*_;if(o){var c=g.bBox(o);n=c.height,a=c.width,g.setTranslate(i,0,n/4)}else{var u=t.select(".legendtext"),f=y.lineCount(u),d=u.node();n=s*f,a=d?g.bBox(d).width:0;var p=s*(.3+(1-f)/2);y.positionText(u,40,p)}n=Math.max(n,16)+3,r.height=n,r.width=a}function o(t,e,r){var n=t._fullLayout,a=n.legend,i=a.borderwidth,o=M.isGrouped(a),l=0;if(a.width=0,a.height=0,M.isVertical(a))o&&e.each(function(t,e){g.setTranslate(this,0,e*a.tracegroupgap)}),r.each(function(t){var e=t[0],r=e.height,n=e.width;g.setTranslate(this,i,5+i+a.height+r/2),a.height+=r,a.width=Math.max(a.width,n)}),a.width+=45+2*i,a.height+=10+2*i,o&&(a.height+=(a._lgroupsLength-1)*a.tracegroupgap),l=40;else if(o){for(var s=[a.width],u=e.data(),f=0,d=u.length;fn.width-(n.margin.r+n.margin.l)&&(x=0,v+=y,a.height=a.height+y,y=0),g.setTranslate(this,i+x,5+i+e.height/2+v),a.width+=o+r,a.height=Math.max(a.height,e.height),x+=o+r,y=Math.max(e.height,y)}),a.width+=2*i,a.height+=10+2*i}a.width=Math.ceil(a.width),a.height=Math.ceil(a.height),r.each(function(e){var r=e[0];c.select(this).select(".legendtoggle").call(g.setRect,0,-r.height/2,(t._context.edits.legendText?0:a.width)+l,r.height)})}function l(t){var e=t._fullLayout,r=e.legend,n="left";A.isRightAnchor(r)?n="right":A.isCenterAnchor(r)&&(n="center");var a="top";A.isBottomAnchor(r)?a="bottom":A.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";A.isRightAnchor(r)?n="right":A.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"),p=t("../../registry"),h=t("../dragelement"),g=t("../drawing"),v=t("../color"),y=t("../../lib/svg_text_utils"),m=t("./handle_click"),x=t("./constants"),b=t("../../constants/interactions"),_=t("../../constants/alignment").LINE_SPACING,w=t("./get_legend_data"),k=t("./style"),M=t("./helpers"),A=t("./anchor_utils"),T=b.DBLCLICKDELAY;e.exports=function(t){function e(t,e){z.attr("data-scroll",e).call(g.setTranslate,0,e),S.call(g.setRect,j,t,x.scrollBarWidth,x.scrollBarHeight),L.select("rect").attr({y:y.borderwidth-e})}var r=t._fullLayout,i="legend"+r._uid;if(r._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var y=r.legend,b=r.showlegend&&w(t.calcdata,y),_=r.hiddenlabels||[];if(!r.showlegend||!b.length)return r._infolayer.selectAll(".legend").remove(),r._topdefs.select("#"+i).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 L=r._topdefs.selectAll("#"+i).data([0]);L.enter().append("clipPath").attr("id",i).append("rect");var C=M.selectAll("rect.bg").data([0]);C.enter().append("rect").attr({class:"bg","shape-rendering":"crispEdges"}),C.call(v.stroke,y.bordercolor),C.call(v.fill,y.bgcolor),C.style("stroke-width",y.borderwidth+"px");var z=M.selectAll("g.scrollbox").data([0]);z.enter().append("g").attr("class","scrollbox");var S=M.selectAll("rect.scrollbar").data([0]);S.enter().append("rect").attr({class:"scrollbar",rx:20,ry:2,width:0,height:0}).call(v.fill,"#808BA4");var O=z.selectAll("g.groups").data(b);O.enter().append("g").attr("class","groups"),O.exit().remove();var D=O.selectAll("g.traces").data(f.identity);D.enter().append("g").attr("class","traces"),D.exit().remove(),D.call(k,t).style("opacity",function(t){var e=t[0].trace;return p.traceIs(e,"pie")?-1!==_.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){c.select(this).call(n,t).call(a,t)});var E=0!==M.enter().size();E&&(o(t,O,D),l(t));var P=r.width,I=r.height;o(t,O,D),y.height>I?s(t):l(t);var N=r._size,R=N.l+N.w*y.x,F=N.t+N.h*(1-y.y);A.isRightAnchor(y)?R-=y.width:A.isCenterAnchor(y)&&(R-=y.width/2),A.isBottomAnchor(y)?F-=y.height:A.isMiddleAnchor(y)&&(F-=y.height/2);var j=y.width,B=N.w;j>B?(R=N.l,j=B):(R+j>P&&(R=P-j),R<0&&(R=0),j=Math.min(P-R,y.width));var q=y.height,H=N.h;q>H?(F=N.t,q=H):(F+q>I&&(F=I-q),F<0&&(F=0),q=Math.min(I-F,y.height)),g.setTranslate(M,R,F);var V,U,G=q-x.scrollBarHeight-2*x.scrollBarMargin,Z=y.height-q;if(y.height<=q||t._context.staticPlot)C.attr({width:j-y.borderwidth,height:q-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),g.setTranslate(z,0,0),L.select("rect").attr({width:j-2*y.borderwidth,height:q-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth}),z.call(g.setClipUrl,i);else{V=x.scrollBarMargin,U=z.attr("data-scroll")||0,C.attr({width:j-2*y.borderwidth+x.scrollBarWidth+x.scrollBarMargin,height:q-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),L.select("rect").attr({width:j-2*y.borderwidth+x.scrollBarWidth+x.scrollBarMargin,height:q-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth-U}),z.call(g.setClipUrl,i),E&&e(V,U),M.on("wheel",null),M.on("wheel",function(){U=f.constrain(z.attr("data-scroll")-c.event.deltaY/G*Z,-Z,0),V=x.scrollBarMargin-U/Z*G,e(V,U),0!==U&&U!==-Z&&c.event.preventDefault()}),S.on(".drag",null),z.on(".drag",null);var X=c.behavior.drag().on("drag",function(){V=f.constrain(c.event.y-x.scrollBarHeight/2,x.scrollBarMargin,x.scrollBarMargin+G),U=-(V-x.scrollBarMargin)/G*Z,e(V,U)});S.call(X),z.call(X)}if(t._context.edits.legendPosition){var Y,W,Q,$;M.classed("cursor-move",!0),h.init({element:M.node(),gd:t,prepFn:function(){var t=g.getTranslate(M);Q=t.x,$=t.y},moveFn:function(t,e){var r=Q+t,n=$+e;g.setTranslate(M,r,n),Y=h.align(r,0,N.l,N.l+N.w,y.xanchor),W=h.align(n,0,N.t+N.h,N.t,y.yanchor)},doneFn:function(e,n,a){if(e&&void 0!==Y&&void 0!==W)u.relayout(t,{"legend.x":Y,"legend.y":W});else{var i=r._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return a.clientX>=t.left&&a.clientX<=t.right&&a.clientY>=t.top&&a.clientY<=t.bottom});i.size()>0&&(1===n?M._clickTimeout=setTimeout(function(){m(i,t,n)},T):2===n&&(M._clickTimeout&&clearTimeout(M._clickTimeout),m(i,t,n)))}}})}}}},{"../../constants/alignment":138,"../../constants/interactions":139,"../../lib":156,"../../lib/svg_text_utils":176,"../../plotly":191,"../../plots/plots":225,"../../registry":240,"../color":41,"../dragelement":62,"../drawing":65,"./anchor_utils":91,"./constants":93,"./get_legend_data":96,"./handle_click":97,"./helpers":98,"./style":100,d3:14}],96:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./helpers");e.exports=function(t,e){function r(t,r){if(""!==t&&a.isGrouped(e))-1===s.indexOf(t)?(s.push(t),c=!0,l[t]=[[r]]):l[t].push([r]);else{var n="~~i"+f;s.push(n),l[n]=[[r]],f++}}var i,o,l={},s=[],c=!1,u={},f=0;for(i=0;ir[1])return r[1]}return a}function a(t){return t[0]}var l,c,u=t[0],f=u.trace,d=s.hasMarkers(f),p=s.hasText(f),h=s.hasLines(f);if(d||p||h){var g={},v={};d&&(g.mc=r("marker.color",a),g.mo=r("marker.opacity",i.mean,[.2,1]),g.ms=r("marker.size",i.mean,[2,16]),g.mlc=r("marker.line.color",a),g.mlw=r("marker.line.width",i.mean,[0,5]),v.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),h&&(v.line={width:r("line.width",a,[0,10])}),p&&(g.tx="Aa",g.tp=r("textposition",a),g.ts=10,g.tc=r("textfont.color",a),g.tf=r("textfont.family",a)),l=[i.minExtend(u,g)],c=i.minExtend(f,v)}var y=n.select(this).select("g.legendpoints"),m=y.selectAll("path.scatterpts").data(d?l:[]);m.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),m.exit().remove(),m.call(o.pointStyle,c,e),d&&(l[0].mrc=3);var x=y.selectAll("g.pointtext").data(p?l:[]);x.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),x.exit().remove(),x.selectAll("text").call(o.textPointStyle,c,e)}function f(t){var e=t[0].trace,r=e.marker||{},i=r.line||{},o=n.select(this).select("g.legendpoints").selectAll("path.legendbar").data(a.traceIs(e,"bar")?[t]:[]);o.enter().append("path").classed("legendbar",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),o.exit().remove(),o.each(function(t){var e=n.select(this),a=t[0],o=(a.mlw+1||i.width+1)-1;e.style("stroke-width",o+"px").call(l.fill,a.mc||r.color),o&&e.call(l.stroke,a.mlc||i.color)})}function d(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(a.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(){var t=e.line.width,r=n.select(this);r.style("stroke-width",t+"px").call(l.fill,e.fillcolor),t&&r.call(l.stroke,e.line.color)})}function p(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendpie").data(a.traceIs(e,"pie")&&e.visible?[t]:[]);r.enter().append("path").classed("legendpie",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.size()&&r.call(c,t[0],e)}t.each(function(t){var e=n.select(this),r=e.selectAll("g.layers").data([0]);r.enter().append("g").classed("layers",!0),r.style("opacity",t[0].trace.opacity),r.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),r.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var a=r.selectAll("g.legendsymbols").data([t]);a.enter().append("g").classed("legendsymbols",!0),a.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(f).each(d).each(p).each(r).each(u)}},{"../../lib":156,"../../registry":240,"../../traces/pie/style_one":331,"../../traces/scatter/subtypes":354,"../color":41,"../drawing":65,d3:14}],101:[function(t,e,r){"use strict";function n(t,e){var r,n,a=e.currentTarget,i=a.getAttribute("data-attr"),o=a.getAttribute("data-val")||!0,l=t._fullLayout,s={},c=p.list(t,null,!0),u="on";if("zoom"===i){var d,h="in"===o?.5:2,g=(1+h)/2,v=(1-h)/2;for(n=0;n1)return n(["resetViews","toggleHover"]),o(y,r);u&&(n(["zoom3d","pan3d","orbitRotation","tableRotation"]),n(["resetCameraDefault3d","resetCameraLastSave3d"]),n(["hoverClosest3d"]));var m=a(l),x=[];return((c||h)&&!m||g)&&(x=["zoom2d","pan2d"]),(v||f)&&(x=["pan2d"]),i(s)&&(x.push("select2d"),x.push("lasso2d")),x.length&&n(x),!c&&!h||m||g||n(["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"]),c&&p?n(["toggleHover"]):h?n(["hoverClosestGl2d"]):c?n(["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]):p?n(["hoverClosestPie"]):v?n(["resetViewMapbox","toggleHover"]):f&&(n(["zoomInGeo","zoomOutGeo","resetGeo"]),n(["hoverClosestGeo"])),o(y,r)}function a(t){for(var e=s.list({_fullLayout:t},null,!0),r=!0,n=0;n0)){var h=a(e,r,s);f("x",h[0]),f("y",h[1]),i.noneOrAll(t,e,["x","y"]),f("xanchor"),f("yanchor"),i.coerceFont(f,"font",r.font);var g=f("bgcolor");f("activecolor",o.contrast(g,c.lightAmount,c.darkAmount)),f("bordercolor"),f("borderwidth")}}},{"../../lib":156,"../color":41,"./attributes":105,"./button_attributes":106,"./constants":107}],109:[function(t,e,r){"use strict";function n(t){for(var e=y.list(t,"x",!0),r=[],n=0;nh&&(h=d)));return h>=p?[p,h]:void 0}}var a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=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;lZ&&n>X&&!t.shiftKey?h.getCursor(a/r,1-i/n):"move";g(e,o),G=o.split("-")[0]}function i(e){j=f.getFromId(t,r.xref),B=f.getFromId(t,r.yref),q=y.getDataToPixel(t,j),H=y.getDataToPixel(t,B,!0),V=y.getPixelToData(t,j),U=y.getPixelToData(t,B,!0);var i="shapes["+n+"]";"path"===r.type?(R=r.path,F=i+".path"):(v=q(r.x0),m=H(r.y0),x=q(r.x1),b=H(r.y1),_=i+".x0",w=i+".y0",k=i+".x1",M=i+".y1"),vX&&(p[z]=r[E]=U(c),p[S]=r[P]=U(u)),d-f>Z&&(p[O]=r[I]=V(f),p[D]=r[N]=V(d))}e.attr("d",o(t,r))}var p,v,m,x,b,_,w,k,M,A,T,L,C,z,S,O,D,E,P,I,N,R,F,j,B,q,H,V,U,G,Z=10,X=10,Y={element:e.node(),gd:t,prepFn:i,doneFn:l},W=Y.element.getBoundingClientRect();h.init(Y),e.node().onmousemove=a}function o(t,e){var r,n,a,i,o=e.type,s=f.getFromId(t,e.xref),c=f.getFromId(t,e.yref),u=t._fullLayout._size;if(s?(r=y.shapePositionToRange(s),n=function(t){return s._offset+s.r2p(r(t,!0))}):n=function(t){return u.l+u.w*t},c?(a=y.shapePositionToRange(c),i=function(t){return c._offset+c.r2p(a(t,!0))}):i=function(t){return u.t+u.h*(1-t)},"path"===o)return s&&"date"===s.type&&(n=y.decodeDate(n)),c&&"date"===c.type&&(i=y.decodeDate(i)),l(e.path,n,i);var d=n(e.x0),p=n(e.x1),h=i(e.y0),g=i(e.y1);if("line"===o)return"M"+d+","+h+"L"+p+","+g;if("rect"===o)return"M"+d+","+h+"H"+p+"V"+g+"H"+d+"Z";var v=(d+p)/2,m=(h+g)/2,x=Math.abs(v-d),b=Math.abs(m-h),_="A"+x+","+b,w=v+x+","+m;return"M"+w+_+" 0 1,1 "+v+","+(m-b)+_+" 0 0,1 "+w+"Z"}function l(t,e,r){return t.replace(v.segmentRE,function(t){var n=0,a=t.charAt(0),i=v.paramIsX[a],o=v.paramIsY[a],l=v.numParams[a],s=t.substr(1).replace(v.paramRE,function(t){return i[n]?t=e(t):o[n]&&(t=r(t)),n++,n>l&&(t="X"),t});return n>l&&(s=s.replace(/[\s,]*X.*/,""),u.log("Ignoring extra params in segment "+t)),a+s})}function s(t,e,r){return t.replace(v.segmentRE,function(t){var n=0,a=t.charAt(0),i=v.paramIsX[a],o=v.paramIsY[a],l=v.numParams[a];return a+t.substr(1).replace(v.paramRE,function(t){return n>=l?t:(i[n]?t=e(t):o[n]&&(t=r(t)),n++,t)})})}var c=t("../../plotly"),u=t("../../lib"),f=t("../../plots/cartesian/axes"),d=t("../color"),p=t("../drawing"),h=t("../dragelement"),g=t("../../lib/setcursor"),v=t("./constants"),y=t("./helpers");e.exports={draw:n,drawOne:a}},{"../../lib":156,"../../lib/setcursor":174,"../../plotly":191,"../../plots/cartesian/axes":196,"../color":41,"../dragelement":62,"../drawing":65,"./constants":120,"./helpers":123}],123:[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,i=t._fullLayout._size;if(e){var o=r.shapePositionToRange(e);a=function(t){return e._offset+e.r2p(o(t,!0))},"date"===e.type&&(a=r.decodeDate(a))}else a=n?function(t){return i.t+i.h*(1-t)}:function(t){return i.l+i.w*t};return a},r.getPixelToData=function(t,e,n){var a,i=t._fullLayout._size;if(e){var o=r.rangeToShapePosition(e);a=function(t){return o(e.p2r(t-e._offset))}}else a=n?function(t){return 1-(t-i.t)/i.h}:function(t){return(t-i.l)/i.w};return a}},{}],124:[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":118,"./calc_autorange":119,"./defaults":121,"./draw":122}],125:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("./attributes"),o=t("./helpers");e.exports=function(t,e,r,l,s){function c(r,a){return n.coerce(t,e,i,r,a)}if(l=l||{},s=s||{},!c("visible",!s.itemIsNotPlainObject))return e;c("layer"),c("opacity"),c("fillcolor"),c("line.color"),c("line.width"),c("line.dash");for(var u=t.path?"path":"rect",f=c("type",u),d=["x","y"],p=0;p<2;p++){var h=d[p],g={_fullLayout:r},v=a.coerceRef(t,e,g,h,"","paper");if("path"!==f){var y,m,x;"paper"!==v?(y=a.getFromId(g,v),x=o.rangeToShapePosition(y),m=o.shapePositionToRange(y)):m=x=n.identity;var b=h+"0",_=h+"1",w=t[b],k=t[_];t[b]=m(t[b],!0),t[_]=m(t[_],!0),a.coercePosition(e,g,c,v,b,.25),a.coercePosition(e,g,c,v,_,.75),e[b]=x(e[b]),e[_]=x(e[_]),t[b]=w,t[_]=k}}return"path"===f?c("path"):n.noneOrAll(t,e,["x0","x1","y0","y1"]),e}},{"../../lib":156,"../../plots/cartesian/axes":196,"./attributes":118,"./helpers":123}],126:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../../plots/pad_attributes"),i=t("../../lib/extend").extendDeepAll,o=t("../../plot_api/edit_types").overrideAll,l=t("../../plots/animation_attributes"),s=t("./constants"),c={_isLinkedToArray:"step",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}};e.exports=o({_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:n({})},font: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}},"arraydraw","from-root")},{"../../lib/extend":150,"../../plot_api/edit_types":180,"../../plots/animation_attributes":192,"../../plots/font_attributes":220, -"../../plots/pad_attributes":224,"./constants":127}],127:[function(t,e,r){"use strict";e.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],128:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return i.coerce(t,e,l,r,n)}n("visible",a(t,e).length>0)&&(n("active"),n("x"),n("y"),i.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"),i.coerceFont(n,"font",r.font),n("currentvalue.visible")&&(n("currentvalue.xanchor"),n("currentvalue.prefix"),n("currentvalue.suffix"),n("currentvalue.offset"),i.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 i.coerce(n,a,u,t,e)}for(var n,a,o=t.steps||[],l=e.steps=[],s=0;s=r.steps.length&&(r.active=0),e.call(l,r).call(b,r).call(u,r).call(h,r).call(x,t,r).call(s,t,r),A.setTranslate(e,r.lx+r.pad.l,r.ly+r.pad.t),e.call(v,r,r.active/(r.steps.length-1),!1),e.call(l,r)}function l(t,e,r){if(e.currentvalue.visible){var n,a,i=t.selectAll("text").data([0]);switch(e.currentvalue.xanchor){case"right":n=e.inputAreaLength-C.currentValueInset-e.currentValueMaxWidth,a="left";break;case"center":n=.5*e.inputAreaLength,a="middle";break;default:n=C.currentValueInset,a="left"}i.enter().append("text").classed(C.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":a,"data-notex":1});var o=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)o+=r;else{o+=e.steps[e.active].label}e.currentvalue.suffix&&(o+=e.currentvalue.suffix),i.call(A.font,e.currentvalue.font).text(o).call(T.convertToTspans,e.gd);var l=T.lineCount(i),s=(e.currentValueMaxLines+1-l)*e.currentvalue.font.size*z;return T.positionText(i,n,s),i}}function s(t,e,r){var n=t.selectAll("rect."+C.gripRectClass).data([0]);n.enter().append("rect").classed(C.gripRectClass,!0).call(p,e,t,r).style("pointer-events","all"),n.attr({width:C.gripWidth,height:C.gripHeight,rx:C.gripRadius,ry:C.gripRadius}).call(M.stroke,r.bordercolor).call(M.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function c(t,e,r){var n=t.selectAll("text").data([0]);return n.enter().append("text").classed(C.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1}),n.call(A.font,r.font).text(e.step.label).call(T.convertToTspans,r.gd),n}function u(t,e){var r=t.selectAll("g."+C.labelsClass).data([0]);r.enter().append("g").classed(C.labelsClass,!0);var n=r.selectAll("g."+C.labelGroupClass).data(e.labelSteps);n.enter().append("g").classed(C.labelGroupClass,!0),n.exit().remove(),n.each(function(t){var r=w.select(this);r.call(c,t,e),A.setTranslate(r,y(e,t.fraction),C.tickOffset+e.ticklen+e.font.size*z+C.labelOffset+e.currentValueTotalHeight)})}function f(t,e,r,n,a){var i=Math.round(n*(r.steps.length-1));i!==r.active&&d(t,e,r,i,!0,a)}function d(t,e,r,n,a,i){var o=r.active;r._input.active=r.active=n;var s=r.steps[r.active];e.call(v,r,r.active/(r.steps.length-1),i),e.call(l,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:a,previousActive:o}),s&&s.method&&a&&(e._nextMethod?(e._nextMethod.step=s,e._nextMethod.doCallback=a,e._nextMethod.doTransition=i):(e._nextMethod={step:s,doCallback:a,doTransition:i},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(r.execute&&k.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function p(t,e,r){function n(){return r.data()[0]}var a=r.node(),i=w.select(e);t.on("mousedown",function(){var t=n();e.emit("plotly_sliderstart",{slider:t});var o=r.select("."+C.gripRectClass);w.event.stopPropagation(),w.event.preventDefault(),o.call(M.fill,t.activebgcolor);var l=m(t,w.mouse(a)[0]);f(e,r,t,l,!0),t._dragging=!0,i.on("mousemove",function(){var t=n(),i=m(t,w.mouse(a)[0]);f(e,r,t,i,!1)}),i.on("mouseup",function(){var t=n();t._dragging=!1,o.call(M.fill,t.bgcolor),i.on("mouseup",null),i.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function h(t,e){var r=t.selectAll("rect."+C.tickRectClass).data(e.steps);r.enter().append("rect").classed(C.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each(function(t,r){var n=r%e.labelStride==0,a=w.select(this);a.attr({height:n?e.ticklen:e.minorticklen}).call(M.fill,e.tickcolor),A.setTranslate(a,y(e,r/(e.steps.length-1))-.5*e.tickwidth,(n?C.tickOffset:C.minorTickOffset)+e.currentValueTotalHeight)})}function g(t){t.labelSteps=[];for(var e=t.steps.length,r=0;r0&&(o=o.transition().duration(e.transition.duration).ease(e.transition.easing)),o.attr("transform","translate("+(i-.5*C.gripWidth)+","+e.currentValueTotalHeight+")")}}function y(t,e){return t.inputAreaStart+C.stepInset+(t.inputAreaLength-2*C.stepInset)*Math.min(1,Math.max(0,e))}function m(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(p,e,t,r).style("pointer-events","all"),n.attr({width:r.inputAreaLength,height:Math.max(r.inputAreaWidth,C.tickOffset+r.ticklen+r.labelHeight)}).call(M.fill,r.bgcolor).attr("opacity",0),A.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(M.stroke,e.bordercolor).call(M.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),A.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 g={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[_.side];e.attr("transform","translate("+g+")")}}}var v,y=r.propContainer,m=r.propName,x=r.traceIndex,b=r.dfltName,_=r.avoid||{},w=r.attributes,k=r.transform,M=r.containerGroup,A=t._fullLayout,T=y.titlefont.family,L=y.titlefont.size,C=y.titlefont.color,z=1,S=!1,O=y.title.trim();"title"===m?v="titleText":-1!==m.indexOf("axis")?v="axisTitleText":m.indexOf(!0)&&(v="colorbarTitleText");var D=t._context.edits[v];""===O&&(z=0),O.match(d)&&(z=.2,S=!0,D||(O=""));var E=O||D;M||(M=A._infolayer.selectAll(".g-"+e).data([0]),M.enter().append("g").classed("g-"+e,!0));var P=M.selectAll("text").data(E?[0]:[]);if(P.enter().append("text"),P.text(O).attr("class",e),P.exit().remove(),E){P.call(p);var I="Click to enter "+b+" title";D&&(O?P.on(".opacity",null):function(){z=0,S=!0,O=I,P.text(O).on("mouseover.opacity",function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)})}(),P.call(u.makeEditable,{gd:t}).on("edit",function(e){void 0!==x?i.restyle(t,m,e,x):i.relayout(t,m,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(p)}).on("input",function(t){this.text(t||" ").call(u.positionText,w.x,w.y)})),P.classed("js-placeholder",S)}}},{"../../constants/interactions":139,"../../lib":156,"../../lib/svg_text_utils":176,"../../plotly":191,"../../plots/plots":225,"../color":41,"../drawing":65,d3:14,"fast-isnumeric":17}],132:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,l=t("../../plots/pad_attributes"),s={_isLinkedToArray:"button",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}};e.exports=o({_isLinkedToArray:"updatemenu",_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:s,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i({},l,{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}},"arraydraw","from-root")},{"../../lib/extend":150,"../../plot_api/edit_types":180,"../../plots/font_attributes":220,"../../plots/pad_attributes":224,"../color/attributes":40}],133:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],134:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return i.coerce(t,e,l,r,n)}n("visible",a(t,e).length>0)&&(n("active"),n("direction"),n("type"),n("showactive"),n("x"),n("y"),i.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),i.coerceFont(n,"font",r.font),n("bgcolor",r.paper_bgcolor),n("bordercolor"),n("borderwidth"))}function a(t,e){function r(t,e){return i.coerce(n,a,u,t,e)}for(var n,a,o=t.buttons||[],l=e.buttons=[],s=0;s0?[0]:[]);if(i.enter().append("g").classed(z.containerClassName,!0).style("cursor","pointer"),i.exit().remove(),i.exit().size()&&_(t),0!==r.length){var u=i.selectAll("g."+z.headerGroupClassName).data(r,a);u.enter().append("g").classed(z.headerGroupClassName,!0);var f=i.selectAll("g."+z.dropdownButtonGroupClassName).data([0]);f.enter().append("g").classed(z.dropdownButtonGroupClassName,!0).style("pointer-events","all");for(var d=0;dk,T=n.barLength+2*n.barPad,L=n.barWidth+2*n.barPad,C=h,z=v+y;z+L>c&&(z=c-L);var S=this.container.selectAll("rect.scrollbar-horizontal").data(A?[0]:[]);S.exit().on(".drag",null).remove(),S.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,n.barColor),A?(this.hbar=S.attr({rx:n.barRadius,ry:n.barRadius,x:C,y:z,width:T,height:L}),this._hbarXMin=C+T/2,this._hbarTranslateMax=k-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var O=y>M,D=n.barWidth+2*n.barPad,E=n.barLength+2*n.barPad,P=h+g,I=v;P+D>s&&(P=s-D);var N=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);N.exit().on(".drag",null).remove(),N.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,n.barColor),O?(this.vbar=N.attr({rx:n.barRadius,ry:n.barRadius,x:P,y:I,width:D,height:E}),this._vbarYMin=I+E/2,this._vbarTranslateMax=M-E):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,j=O?f+D+.5:f+.5,B=d-.5,q=A?p+L+.5:p+.5,H=l._topdefs.selectAll("#"+R).data(A||O?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",R).append("rect"),A||O?(this._clipRect=H.select("rect").attr({x:Math.floor(F),y:Math.floor(B),width:Math.ceil(j)-Math.floor(F),height:Math.ceil(q)-Math.floor(B)}),this.container.call(o.setClipUrl,R),this.bg.attr({x:h,y:v,width:g,height:y})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),A||O){var V=a.behavior.drag().on("dragstart",function(){a.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var U=a.behavior.drag().on("dragstart",function(){a.event.sourceEvent.preventDefault(),a.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));A&&this.hbar.on(".drag",null).call(U),O&&this.vbar.on(".drag",null).call(U)}this.setTranslate(e,r)},n.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},n.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=a.event.dx),this.vbar&&(e-=a.event.dy),this.setTranslate(t,e)},n.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=a.event.deltaY),this.vbar&&(e+=a.event.deltaY),this.setTranslate(t,e)},n.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,n=r+this._hbarTranslateMax;t=(l.constrain(a.event.x,r,n)-r)/(n-r)*(this.position.w-this._box.w)}if(this.vbar){var i=e+this._vbarYMin,o=i+this._vbarTranslateMax;e=(l.constrain(a.event.y,i,o)-i)/(o-i)*(this.position.h-this._box.h)}this.setTranslate(t,e)},n.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=l.constrain(t||0,0,r),e=l.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(o.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var a=t/r;this.hbar.call(o.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var i=e/n;this.vbar.call(o.setTranslate,t,e+i*this._vbarTranslateMax)}}},{"../../lib":156,"../color":41,"../drawing":65,d3:14}],138:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},LINE_SPACING:1.3,MID_SHIFT:.35}},{}],139:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300,DESELECTDIM:.2}},{}],140:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,MINUS_SIGN:"\u2212"}},{}],141:[function(t,e,r){"use strict";e.exports={entityToUnicode:{mu:"\u03bc","#956":"\u03bc",amp:"&","#28":"&",lt:"<","#60":"<",gt:">","#62":">",nbsp:"\xa0","#160":"\xa0",times:"\xd7","#215":"\xd7",plusmn:"\xb1","#177":"\xb1",deg:"\xb0","#176":"\xb0"}}},{}],142:[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}},{}],143:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.31.1",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"), +"../../plots/pad_attributes":224,"./constants":127}],127:[function(t,e,r){"use strict";e.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],128:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return i.coerce(t,e,l,r,n)}n("visible",a(t,e).length>0)&&(n("active"),n("x"),n("y"),i.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"),i.coerceFont(n,"font",r.font),n("currentvalue.visible")&&(n("currentvalue.xanchor"),n("currentvalue.prefix"),n("currentvalue.suffix"),n("currentvalue.offset"),i.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 i.coerce(n,a,u,t,e)}for(var n,a,o=t.steps||[],l=e.steps=[],s=0;s=r.steps.length&&(r.active=0),e.call(l,r).call(b,r).call(u,r).call(h,r).call(x,t,r).call(s,t,r),A.setTranslate(e,r.lx+r.pad.l,r.ly+r.pad.t),e.call(v,r,r.active/(r.steps.length-1),!1),e.call(l,r)}function l(t,e,r){if(e.currentvalue.visible){var n,a,i=t.selectAll("text").data([0]);switch(e.currentvalue.xanchor){case"right":n=e.inputAreaLength-C.currentValueInset-e.currentValueMaxWidth,a="left";break;case"center":n=.5*e.inputAreaLength,a="middle";break;default:n=C.currentValueInset,a="left"}i.enter().append("text").classed(C.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":a,"data-notex":1});var o=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)o+=r;else{o+=e.steps[e.active].label}e.currentvalue.suffix&&(o+=e.currentvalue.suffix),i.call(A.font,e.currentvalue.font).text(o).call(T.convertToTspans,e.gd);var l=T.lineCount(i),s=(e.currentValueMaxLines+1-l)*e.currentvalue.font.size*z;return T.positionText(i,n,s),i}}function s(t,e,r){var n=t.selectAll("rect."+C.gripRectClass).data([0]);n.enter().append("rect").classed(C.gripRectClass,!0).call(p,e,t,r).style("pointer-events","all"),n.attr({width:C.gripWidth,height:C.gripHeight,rx:C.gripRadius,ry:C.gripRadius}).call(M.stroke,r.bordercolor).call(M.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function c(t,e,r){var n=t.selectAll("text").data([0]);return n.enter().append("text").classed(C.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1}),n.call(A.font,r.font).text(e.step.label).call(T.convertToTspans,r.gd),n}function u(t,e){var r=t.selectAll("g."+C.labelsClass).data([0]);r.enter().append("g").classed(C.labelsClass,!0);var n=r.selectAll("g."+C.labelGroupClass).data(e.labelSteps);n.enter().append("g").classed(C.labelGroupClass,!0),n.exit().remove(),n.each(function(t){var r=w.select(this);r.call(c,t,e),A.setTranslate(r,y(e,t.fraction),C.tickOffset+e.ticklen+e.font.size*z+C.labelOffset+e.currentValueTotalHeight)})}function f(t,e,r,n,a){var i=Math.round(n*(r.steps.length-1));i!==r.active&&d(t,e,r,i,!0,a)}function d(t,e,r,n,a,i){var o=r.active;r._input.active=r.active=n;var s=r.steps[r.active];e.call(v,r,r.active/(r.steps.length-1),i),e.call(l,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:a,previousActive:o}),s&&s.method&&a&&(e._nextMethod?(e._nextMethod.step=s,e._nextMethod.doCallback=a,e._nextMethod.doTransition=i):(e._nextMethod={step:s,doCallback:a,doTransition:i},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(r.execute&&k.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function p(t,e,r){function n(){return r.data()[0]}var a=r.node(),i=w.select(e);t.on("mousedown",function(){var t=n();e.emit("plotly_sliderstart",{slider:t});var o=r.select("."+C.gripRectClass);w.event.stopPropagation(),w.event.preventDefault(),o.call(M.fill,t.activebgcolor);var l=m(t,w.mouse(a)[0]);f(e,r,t,l,!0),t._dragging=!0,i.on("mousemove",function(){var t=n(),i=m(t,w.mouse(a)[0]);f(e,r,t,i,!1)}),i.on("mouseup",function(){var t=n();t._dragging=!1,o.call(M.fill,t.bgcolor),i.on("mouseup",null),i.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function h(t,e){var r=t.selectAll("rect."+C.tickRectClass).data(e.steps);r.enter().append("rect").classed(C.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each(function(t,r){var n=r%e.labelStride==0,a=w.select(this);a.attr({height:n?e.ticklen:e.minorticklen}).call(M.fill,e.tickcolor),A.setTranslate(a,y(e,r/(e.steps.length-1))-.5*e.tickwidth,(n?C.tickOffset:C.minorTickOffset)+e.currentValueTotalHeight)})}function g(t){t.labelSteps=[];for(var e=t.steps.length,r=0;r0&&(o=o.transition().duration(e.transition.duration).ease(e.transition.easing)),o.attr("transform","translate("+(i-.5*C.gripWidth)+","+e.currentValueTotalHeight+")")}}function y(t,e){return t.inputAreaStart+C.stepInset+(t.inputAreaLength-2*C.stepInset)*Math.min(1,Math.max(0,e))}function m(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(p,e,t,r).style("pointer-events","all"),n.attr({width:r.inputAreaLength,height:Math.max(r.inputAreaWidth,C.tickOffset+r.ticklen+r.labelHeight)}).call(M.fill,r.bgcolor).attr("opacity",0),A.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(M.stroke,e.bordercolor).call(M.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),A.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 g={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[_.side];e.attr("transform","translate("+g+")")}}}var v,y=r.propContainer,m=r.propName,x=r.traceIndex,b=r.dfltName,_=r.avoid||{},w=r.attributes,k=r.transform,M=r.containerGroup,A=t._fullLayout,T=y.titlefont.family,L=y.titlefont.size,C=y.titlefont.color,z=1,S=!1,O=y.title.trim();"title"===m?v="titleText":-1!==m.indexOf("axis")?v="axisTitleText":m.indexOf(!0)&&(v="colorbarTitleText");var D=t._context.edits[v];""===O&&(z=0),O.match(d)&&(z=.2,S=!0,D||(O=""));var E=O||D;M||(M=A._infolayer.selectAll(".g-"+e).data([0]),M.enter().append("g").classed("g-"+e,!0));var P=M.selectAll("text").data(E?[0]:[]);if(P.enter().append("text"),P.text(O).attr("class",e),P.exit().remove(),E){P.call(p);var I="Click to enter "+b+" title";D&&(O?P.on(".opacity",null):function(){z=0,S=!0,O=I,P.text(O).on("mouseover.opacity",function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)})}(),P.call(u.makeEditable,{gd:t}).on("edit",function(e){void 0!==x?i.restyle(t,m,e,x):i.relayout(t,m,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(p)}).on("input",function(t){this.text(t||" ").call(u.positionText,w.x,w.y)})),P.classed("js-placeholder",S)}}},{"../../constants/interactions":139,"../../lib":156,"../../lib/svg_text_utils":176,"../../plotly":191,"../../plots/plots":225,"../color":41,"../drawing":65,d3:14,"fast-isnumeric":17}],132:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,l=t("../../plots/pad_attributes"),s={_isLinkedToArray:"button",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}};e.exports=o({_isLinkedToArray:"updatemenu",_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:s,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i({},l,{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}},"arraydraw","from-root")},{"../../lib/extend":150,"../../plot_api/edit_types":180,"../../plots/font_attributes":220,"../../plots/pad_attributes":224,"../color/attributes":40}],133:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],134:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return i.coerce(t,e,l,r,n)}n("visible",a(t,e).length>0)&&(n("active"),n("direction"),n("type"),n("showactive"),n("x"),n("y"),i.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),i.coerceFont(n,"font",r.font),n("bgcolor",r.paper_bgcolor),n("bordercolor"),n("borderwidth"))}function a(t,e){function r(t,e){return i.coerce(n,a,u,t,e)}for(var n,a,o=t.buttons||[],l=e.buttons=[],s=0;s0?[0]:[]);if(i.enter().append("g").classed(z.containerClassName,!0).style("cursor","pointer"),i.exit().remove(),i.exit().size()&&_(t),0!==r.length){var u=i.selectAll("g."+z.headerGroupClassName).data(r,a);u.enter().append("g").classed(z.headerGroupClassName,!0);var f=i.selectAll("g."+z.dropdownButtonGroupClassName).data([0]);f.enter().append("g").classed(z.dropdownButtonGroupClassName,!0).style("pointer-events","all");for(var d=0;dk,T=n.barLength+2*n.barPad,L=n.barWidth+2*n.barPad,C=h,z=v+y;z+L>c&&(z=c-L);var S=this.container.selectAll("rect.scrollbar-horizontal").data(A?[0]:[]);S.exit().on(".drag",null).remove(),S.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,n.barColor),A?(this.hbar=S.attr({rx:n.barRadius,ry:n.barRadius,x:C,y:z,width:T,height:L}),this._hbarXMin=C+T/2,this._hbarTranslateMax=k-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var O=y>M,D=n.barWidth+2*n.barPad,E=n.barLength+2*n.barPad,P=h+g,I=v;P+D>s&&(P=s-D);var N=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);N.exit().on(".drag",null).remove(),N.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,n.barColor),O?(this.vbar=N.attr({rx:n.barRadius,ry:n.barRadius,x:P,y:I,width:D,height:E}),this._vbarYMin=I+E/2,this._vbarTranslateMax=M-E):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,j=O?f+D+.5:f+.5,B=d-.5,q=A?p+L+.5:p+.5,H=l._topdefs.selectAll("#"+R).data(A||O?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",R).append("rect"),A||O?(this._clipRect=H.select("rect").attr({x:Math.floor(F),y:Math.floor(B),width:Math.ceil(j)-Math.floor(F),height:Math.ceil(q)-Math.floor(B)}),this.container.call(o.setClipUrl,R),this.bg.attr({x:h,y:v,width:g,height:y})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),A||O){var V=a.behavior.drag().on("dragstart",function(){a.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var U=a.behavior.drag().on("dragstart",function(){a.event.sourceEvent.preventDefault(),a.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));A&&this.hbar.on(".drag",null).call(U),O&&this.vbar.on(".drag",null).call(U)}this.setTranslate(e,r)},n.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},n.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=a.event.dx),this.vbar&&(e-=a.event.dy),this.setTranslate(t,e)},n.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=a.event.deltaY),this.vbar&&(e+=a.event.deltaY),this.setTranslate(t,e)},n.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,n=r+this._hbarTranslateMax;t=(l.constrain(a.event.x,r,n)-r)/(n-r)*(this.position.w-this._box.w)}if(this.vbar){var i=e+this._vbarYMin,o=i+this._vbarTranslateMax;e=(l.constrain(a.event.y,i,o)-i)/(o-i)*(this.position.h-this._box.h)}this.setTranslate(t,e)},n.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=l.constrain(t||0,0,r),e=l.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(o.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var a=t/r;this.hbar.call(o.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var i=e/n;this.vbar.call(o.setTranslate,t,e+i*this._vbarTranslateMax)}}},{"../../lib":156,"../color":41,"../drawing":65,d3:14}],138:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},LINE_SPACING:1.3,MID_SHIFT:.35}},{}],139:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300,DESELECTDIM:.2}},{}],140:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,MINUS_SIGN:"\u2212"}},{}],141:[function(t,e,r){"use strict";e.exports={entityToUnicode:{mu:"\u03bc","#956":"\u03bc",amp:"&","#28":"&",lt:"<","#60":"<",gt:">","#62":">",nbsp:"\xa0","#160":"\xa0",times:"\xd7","#215":"\xd7",plusmn:"\xb1","#177":"\xb1",deg:"\xb0","#176":"\xb0"}}},{}],142:[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}},{}],143:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.31.2",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/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":34,"./components/annotations3d":39,"./components/fx":82,"./components/images":90,"./components/legend":99,"./components/rangeselector":111,"./components/rangeslider":117,"./components/shapes":124,"./components/sliders":130,"./components/updatemenus":136,"./fonts/mathjax_config":144,"./lib/queue":169,"./plot_api/plot_schema":185,"./plot_api/register":186,"./plot_api/set_plot_config":187,"./plot_api/to_image":189,"./plot_api/validate":190,"./plotly":191,"./snapshot":245,"./snapshot/download":242,"./traces/scatter":344,d3:14,"es6-promise":15}],144:[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},{}],145:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../constants/numerical").BADNUM,i=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(i,"")),n(t)?Number(t):a}},{"../constants/numerical":140,"fast-isnumeric":17}],146:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("tinycolor2"),i=t("../plots/attributes"),o=t("../components/colorscale/get_scale"),l=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),s=t("./regex").counter;r.valObjectMeta={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),-1===n.values.indexOf(t)?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;na.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,a){t%1||!n(t)||void 0!==a.min&&ta.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var a="number"==typeof t;!0!==n.strict&&a?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){a(t).isValid()?e.set(t):e.set(r)}},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){if("string"==typeof t&&s(r).test(t))return void e.set(t);e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!s(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"!=typeof t)return void e.set(r);if(-1!==(n.extras||[]).indexOf(t))return void e.set(t);for(var a=t.split("+"),i=0;i0&&(o=o.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+o}return n}function s(t){return t.formatDate("yyyy")}function c(t){return t.formatDate("M yyyy")}function u(t){return t.formatDate("M d")}function f(t){return t.formatDate("M d, yyyy")}var d=t("d3"),p=t("fast-isnumeric"),h=t("./loggers").error,g=t("./mod"),v=t("../constants/numerical"),y=v.BADNUM,m=v.ONEDAY,x=v.ONEHOUR,b=v.ONEMIN,_=v.ONESEC,w=v.EPOCHJD,k=t("../registry"),M=d.time.format.utc,A=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,T=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,L=(new Date).getFullYear()-70;r.dateTick0=function(t,e){return n(t)?e?k.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:k.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},r.dfltRange=function(t){return n(t)?k.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},r.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime};var C,z;r.dateTime2ms=function(t,e){if(r.isJSDate(t))return t=Number(t)-t.getTimezoneOffset()*b,t>=C&&t<=z?t:y;if("string"!=typeof t&&"number"!=typeof t)return y;t=String(t);var a=n(e),i=t.charAt(0);!a||"G"!==i&&"g"!==i||(t=t.substr(1),e="");var o=a&&"chinese"===e.substr(0,7),l=t.match(o?T:A);if(!l)return y;var s=l[1],c=l[3]||"1",u=Number(l[5]||1),f=Number(l[7]||0),d=Number(l[9]||0),p=Number(l[11]||0);if(a){if(2===s.length)return y;s=Number(s);var h;try{var g=k.getComponentMethod("calendars","getCal")(e);if(o){var v="i"===c.charAt(c.length-1);c=parseInt(c,10),h=g.newDate(s,g.toMonthIndex(s,c,v),u)}else h=g.newDate(s,Number(c),u)}catch(t){return y}return h?(h.toJD()-w)*m+f*x+d*b+p*_:y}s=2===s.length?(Number(s)+2e3-L)%100+L:Number(s),c-=1;var M=new Date(Date.UTC(2e3,c,u,f,d));return M.setUTCFullYear(s),M.getUTCMonth()!==c?y:M.getUTCDate()!==u?y:M.getTime()+p*_},C=r.MIN_MS=r.dateTime2ms("-9999"),z=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==y};var S=90*m,O=3*x,D=5*b;r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=C&&t<=z))return y;e||(e=0);var a,o,l,s,c,u,f=Math.floor(10*g(t+.05,1)),d=Math.round(t-f/10);if(n(r)){var p=Math.floor(d/m)+w,h=Math.floor(g(t,m));try{a=k.getComponentMethod("calendars","getCal")(r).fromJD(p).formatDate("yyyy-mm-dd")}catch(t){a=M("G%Y-%m-%d")(new Date(d))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;o=e=C+m&&t<=z-m))return y;var e=Math.floor(10*g(t+.05,1)),r=new Date(Math.round(t-e/10));return i(d.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,a){if(r.isJSDate(t)||"number"==typeof t){if(n(a))return h("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,a))return h("unrecognized date",t),e;return t};var E=/%\d?f/g,P=[59,59.9,59.99,59.999,59.9999],I=M("%Y"),N=M("%b %Y"),R=M("%b %-d"),F=M("%b %-d, %Y");r.formatDate=function(t,e,r,a){var i,d;if(a=n(a)&&a,e)return o(e,t,a);if(a)try{var p=Math.floor((t+.05)/m)+w,h=k.getComponentMethod("calendars","getCal")(a).fromJD(p);"y"===r?d=s(h):"m"===r?d=c(h):"d"===r?(i=s(h),d=u(h)):(i=f(h),d=l(t,r))}catch(t){return"Invalid"}else{var g=new Date(Math.floor(t+.05));"y"===r?d=I(g):"m"===r?d=N(g):"d"===r?(i=I(g),d=R(g)):(i=F(g),d=l(t,r))}return d+(i?"\n"+i:"")};var j=3*m;r.incrementMonth=function(t,e,r){r=n(r)&&r;var a=g(t,m);if(t=Math.round(t-a),r)try{var i=Math.round(t/m)+w,o=k.getComponentMethod("calendars","getCal")(r),l=o.fromJD(i);return e%12?o.add(l,e,"m"):o.add(l,e/12,"y"),(l.toJD()-w)*m+a}catch(e){h("invalid ms "+t+" in calendar "+r)}var s=new Date(t+j);return s.setUTCMonth(s.getUTCMonth()+e)+a-j},r.findExactDates=function(t,e){for(var r,a,i=0,o=0,l=0,s=0,c=n(e)&&k.getComponentMethod("calendars","getCal")(e),u=0;u1||g<0||g>1?null:{x:t+s*g,y:e+f*g}}function a(t,e,r,n,a){var i=n*t+a*e;if(i<0)return n*n+a*a;if(i>r){var o=n-t,l=a-e;return o*o+l*l}var s=n*e-a*t;return s*s/r}var i=t("./mod");r.segmentsIntersect=n,r.segmentDistance=function(t,e,r,i,o,l,s,c){if(n(t,e,r,i,o,l,s,c))return 0;var u=r-t,f=i-e,d=s-o,p=c-l,h=u*u+f*f,g=d*d+p*p,v=Math.min(a(u,f,h,o-t,l-e),a(u,f,h,s-t,c-e),a(d,p,g,t-o,e-l),a(d,p,g,r-o,i-l));return Math.sqrt(v)};var o,l,s;r.getTextLocation=function(t,e,r,n){if(t===l&&n===s||(o={},l=t,s=n),o[r])return o[r];var a=t.getPointAtLength(i(r-n/2,e)),c=t.getPointAtLength(i(r+n/2,e)),u=Math.atan((c.y-a.y)/(c.x-a.x)),f=t.getPointAtLength(i(r,e)),d=(4*f.x+a.x+c.x)/6,p=(4*f.y+a.y+c.y)/6,h={x:d,y:p,theta:u};return o[r]=h,h},r.clearLocationCache=function(){l=null},r.getVisibleSegment=function(t,e,r){function n(e){var r=t.getPointAtLength(e);0===e?a=r:e===f&&(i=r);var n=r.xl?r.x-l:0,u=r.yc?r.y-c:0;return Math.sqrt(n*n+u*u)}for(var a,i,o=e.left,l=e.right,s=e.top,c=e.bottom,u=0,f=t.getTotalLength(),d=f,p=n(u);p;){if((u+=p+r)>d)return;p=n(u)}for(p=n(d);p;){if(d-=p+r,u>d)return;p=n(d)}return{min:u,max:d,len:d-u,total:f,isClosed:0===u&&d===f&&Math.abs(a.x-i.x)<.1&&Math.abs(a.y-i.y)<.1}}},{"./mod":162}],154:[function(t,e,r){"use strict";e.exports=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t}},{}],155:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],156:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../constants/numerical"),o=i.FP_SAFE,l=i.BADNUM,s=e.exports={};s.nestedProperty=t("./nested_property"),s.keyedContainer=t("./keyed_container"),s.relativeAttr=t("./relative_attr"),s.isPlainObject=t("./is_plain_object"),s.isArray=t("./is_array"),s.mod=t("./mod"),s.toLogRange=t("./to_log_range"),s.relinkPrivateKeys=t("./relink_private"),s.ensureArray=t("./ensure_array");var c=t("./coerce");s.valObjectMeta=c.valObjectMeta,s.coerce=c.coerce,s.coerce2=c.coerce2,s.coerceFont=c.coerceFont,s.coerceHoverinfo=c.coerceHoverinfo,s.validate=c.validate;var u=t("./dates");s.dateTime2ms=u.dateTime2ms,s.isDateTime=u.isDateTime,s.ms2DateTime=u.ms2DateTime,s.ms2DateTimeLocal=u.ms2DateTimeLocal,s.cleanDate=u.cleanDate,s.isJSDate=u.isJSDate,s.formatDate=u.formatDate,s.incrementMonth=u.incrementMonth,s.dateTick0=u.dateTick0,s.dfltRange=u.dfltRange,s.findExactDates=u.findExactDates,s.MIN_MS=u.MIN_MS,s.MAX_MS=u.MAX_MS;var f=t("./search");s.findBin=f.findBin,s.sorterAsc=f.sorterAsc,s.sorterDes=f.sorterDes,s.distinctVals=f.distinctVals,s.roundUp=f.roundUp;var d=t("./stats");s.aggNums=d.aggNums,s.len=d.len,s.mean=d.mean,s.variance=d.variance,s.stdev=d.stdev,s.interp=d.interp;var p=t("./matrix");s.init2dArray=p.init2dArray,s.transposeRagged=p.transposeRagged,s.dot=p.dot,s.translationMatrix=p.translationMatrix,s.rotationMatrix=p.rotationMatrix,s.rotationXYMatrix=p.rotationXYMatrix,s.apply2DTransform=p.apply2DTransform,s.apply2DTransform2=p.apply2DTransform2;var h=t("./geometry2d");s.segmentsIntersect=h.segmentsIntersect,s.segmentDistance=h.segmentDistance,s.getTextLocation=h.getTextLocation,s.clearLocationCache=h.clearLocationCache,s.getVisibleSegment=h.getVisibleSegment;var g=t("./extend");s.extendFlat=g.extendFlat,s.extendDeep=g.extendDeep,s.extendDeepAll=g.extendDeepAll,s.extendDeepNoArrays=g.extendDeepNoArrays;var v=t("./loggers");s.log=v.log,s.warn=v.warn,s.error=v.error;var y=t("./regex");s.counterRegex=y.counter;var m=t("./throttle");s.throttle=m.throttle,s.throttleDone=m.done,s.clearThrottle=m.clear,s.getGraphDiv=t("./get_graph_div"),s.notifier=t("./notifier"),s.filterUnique=t("./filter_unique"),s.filterVisible=t("./filter_visible"),s.pushUnique=t("./push_unique"),s.cleanNumber=t("./clean_number"),s.ensureNumber=function(t){return a(t)?(t=Number(t),t<-o||t>o?l:a(t)?Number(t):l):l},s.noop=t("./noop"),s.identity=t("./identity"),s.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var a=0;ar?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},s.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},s.simpleMap=function(t,e,r,n){for(var a=t.length,i=new Array(a),o=0;o-1||u!==1/0&&u>=Math.pow(2,r)?t(e,r,n):s},s.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},s.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,a,i,o=t.length,l=2*o,s=2*e-1,c=new Array(s),u=new Array(o);for(r=0;r=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=t[a]*c[n];u[r]=i}return u},s.syncOrAsync=function(t,e,r){function n(){return s.syncOrAsync(t,e,r)}for(var a,i;t.length;)if(i=t.splice(0,1)[0],(a=i(e))&&a.then)return a.then(n).then(void 0,s.promiseError);return r&&r(e)},s.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},s.noneOrAll=function(t,e,r){if(t){var n,a,i=!1,o=!0;for(n=0;n1?a+o[1]:"";if(i&&(o.length>1||l.length>4||r))for(;n.test(l);)l=l.replace(n,"$1"+i+"$2");return l+s};var _=/%{([^\s%{}]*)}/g,w=/^\w*$/;s.templateString=function(t,e){var r={};return t.replace(_,function(t,n){return w.test(n)?e[n]||"":(r[n]=r[n]||s.nestedProperty(e,n).get,r[n]()||"")})}},{"../constants/numerical":140,"./clean_number":145,"./coerce":146,"./dates":147,"./ensure_array":148,"./extend":150,"./filter_unique":151,"./filter_visible":152,"./geometry2d":153,"./get_graph_div":154,"./identity":155,"./is_array":157,"./is_plain_object":158,"./keyed_container":159,"./loggers":160,"./matrix":161,"./mod":162,"./nested_property":163,"./noop":164,"./notifier":165,"./push_unique":168,"./regex":170,"./relative_attr":171,"./relink_private":172,"./search":173,"./stats":175,"./throttle":177,"./to_log_range":178,d3:14,"fast-isnumeric":17}],157:[function(t,e,r){"use strict";var n="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}};e.exports=function(t){return Array.isArray(t)||n.isView(t)}},{}],158:[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}},{}],159:[function(t,e,r){"use strict";var n=t("./nested_property"),a=/^\w*$/;e.exports=function(t,e,r,i){r=r||"name",i=i||"value";var o,l,s={};l=e&&e.length?n(t,e).get():t,e=e||"",l=l||[];var c={};for(o=0;o2)return s[e]=2|s[e],f.set(t,null);if(u){for(o=e;o1){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][0],i=t[e][1],s=!1,p(n))for(r=n.length-1;r>=0;r--)a(n[r],o(i,r))?s?n[r]=void 0:n.pop():s=!0;else if("object"==typeof n&&null!==n)for(l=Object.keys(n),s=!1,r=l.length-1;r>=0;r--)a(n[l[r]],o(i,l[r]))?delete n[l[r]]:s=!0;if(s)return}}function u(t){return void 0===t||null===t||"object"==typeof t&&(p(t)?!t.length:!Object.keys(t).length)}function f(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}var d=t("fast-isnumeric"),p=t("./is_array"),h=t("./is_plain_object"),g=t("../plot_api/container_array_match");e.exports=function(t,e){if(d(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,a,o,l=0,s=e.split(".");l/g),l=0;lo||n===a||ns)&&(!e||!u(t))}function r(t,e){var r=t[0],c=t[1];if(r===a||ro||c===a||cs)return!1;var u,f,d,p,h,g=n.length,v=n[0][0],y=n[0][1],m=0;for(u=1;uMath.max(f,v)||c>Math.max(d,y)))if(cu||Math.abs(n(o,d))>a)return!0;return!1};i.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){r(t.pop())}return{addPt:r,raw:t,filtered:n}}},{"../constants/numerical":140,"./matrix":161}],168:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){var r,n=e.toString();for(r=0;ri.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--)},o.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},o.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},o.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 o(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,p=0;for(u=e[e.length-1]>=e[0]?r?n:a:r?o:i;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,i=a/(n||1)/1e4,o=[e[0]],l=0;le[l]+i&&(a=Math.min(a,e[l+1]-e[l]),o.push(e[l+1]));return{vals:o,minDiff:a}},r.roundUp=function(t,e,r){for(var n,a=0,i=e.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;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}],176:[function(t,e,r){"use strict";function n(t,e){return t.node().getBoundingClientRect()[e]}function a(t){return t.replace(y,"\\lt ").replace(m,"\\gt ")}function i(t,e,r){var n="math-output-"+d.randstr([],64),i=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,i.node()],function(){var e=f.select("body").select("#MathJax_SVG_glyphs");if(i.select(".MathJax_SVG").empty()||!i.select("svg").node())d.log("There was an error in the tex syntax.",t),r();else{var n=i.select("svg").node().getBoundingClientRect();r(i.select(".MathJax_SVG"),e,n)}i.remove()})}function o(t,e){if(!t)return null;var r=t.match(e);return r&&(r[3]||r[4])}function l(t,e){if(!t)return"";for(var r=0;r1)for(var a=1;a.",e);var r=c.pop();t!==r.type&&d.log("Start tag <"+r.type+"> doesnt match end tag <"+t+">. Pretending it did match.",e),i=c[c.length-1].node}(M);else{var I=m[4],N={type:M},R=o(I,S);if(R?(R=R.replace(P,"$1 fill:"),A&&(R+=";"+A)):A&&(R=A),R&&(N.style=R),"a"===M){l=!0;var F=o(I,O);if(F){var j=document.createElement("a");j.href=F,-1!==k.indexOf(j.protocol)&&(N.href=encodeURI(F),N.target=o(I,D)||"_blank",N.popup=o(I,E))}}n(N)}}return l}function u(t,e,r){var n,a,i,o=r.horizontalAlign,l=r.verticalAlign||"top",s=t.node().getBoundingClientRect(),c=e.node().getBoundingClientRect();return a="bottom"===l?function(){return s.bottom-n.height}:"middle"===l?function(){return s.top+(s.height-n.height)/2}:function(){return s.top},i="right"===o?function(){return s.right-n.width}:"center"===o?function(){return s.left+(s.width-n.width)/2}:function(){return s.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:a()-c.top+"px",left:i()-c.left+"px","z-index":1e3}),this}}var f=t("d3"),d=t("../lib"),p=t("../constants/xmlns_namespaces"),h=t("../constants/string_mappings"),g=t("../constants/alignment").LINE_SPACING,v=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,a){function o(){u.empty()||(d=t.attr("class")+"-math",u.select("svg."+d).remove()),t.text("").style("white-space","pre"),c(t.node(),l)&&t.style("pointer-events","all"),r.positionText(t),a&&a.call(t)}var l=t.text(),s=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&l.match(v),u=f.select(t.node().parentNode);if(!u.empty()){var d=t.attr("class")?t.attr("class").split(" ")[0]:"text";return d+="-math",u.selectAll("svg."+d).remove(),u.selectAll("g."+d+"-group").remove(),t.style("display",null).attr({"data-unformatted":l,"data-math":"N"}),s?(e&&e._promises||[]).push(new Promise(function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10);i(s[2],{fontSize:r},function(i,s,c){u.selectAll("svg."+d).remove(),u.selectAll("g."+d+"-group").remove();var f=i&&i.select("svg");if(!f||!f.node())return o(),void e();var p=u.append("g").classed(d+"-group",!0).attr({"pointer-events":"none","data-unformatted":l,"data-math":"Y"});p.node().appendChild(f.node()),s&&s.node()&&f.node().insertBefore(s.node().cloneNode(!0),f.node().firstChild),f.attr({class:d,height:c.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var h=t.node().style.fill||"black";f.select("g").attr({fill:h,stroke:h});var g=n(f,"width"),v=n(f,"height"),y=+t.attr("x")-g*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],m=r||n(t,"height"),x=-m/4;"y"===d[0]?(p.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-g/2,x-v/2]+")"}),f.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===d[0]?f.attr({x:t.attr("x"),y:x-v/2}):"a"===d[0]?f.attr({x:0,y:x}):f.attr({x:y,y:+t.attr("y")+x-v/2}),a&&a.call(t,p),e(p)})})):o(),t}};var y=/(<|<|<)/g,m=/(>|>|>)/g,x={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},b={sub:"0.3em",sup:"-0.6em"},_={sub:"-0.21em",sup:"0.42em"},w="\u200b",k=["http:","https:","mailto:","",void 0,":"],M=new RegExp("]*)?/?>","g"),A=Object.keys(h.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:h.entityToUnicode[t]}}),T=/(\r\n?|\n)/g,L=/(<[^<>]*>)/,C=/<(\/?)([^ >]*)(\s+(.*))?>/i,z=//i,S=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,O=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,D=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,E=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i,P=/(^|;)\s*color:/;r.plainText=function(t){return(t||"").replace(M," ")},r.lineCount=function(t){return t.selectAll("tspan.line").size()||1},r.positionText=function(t,e,r){return t.each(function(){function t(t,e){return void 0===e?null===(e=n.attr(t))&&(n.attr(t,0),e=0):n.attr(t,e),e}var n=f.select(this),a=t("x",e),i=t("y",r);"text"===this.nodeName&&n.selectAll("tspan.line").attr({x:a,y:i})})},r.makeEditable=function(t,e){function r(){a(),t.style({opacity:0});var e,r=s.attr("class");(e=r?"."+r.split(" ")[0]+"-math-group":"[class*=-math-group]")&&f.select(t.node().parentNode).select(e).style({opacity:0})}function n(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}function a(){var r=f.select(i),a=r.select(".svg-container"),o=a.append("div"),s=t.node().style,c=parseFloat(s.fontSize||12);o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":s.fontFamily||"Arial","font-size":c,color:e.fill||s.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-c/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(e.text||t.attr("data-unformatted")).call(u(t,a,e)).on("blur",function(){i._editing=!1,t.text(this.textContent).style({opacity:1});var e,r=f.select(this).attr("class");(e=r?"."+r.split(" ")[0]+"-math-group":"[class*=-math-group]")&&f.select(t.node().parentNode).select(e).style({opacity:0});var n=this.textContent;f.select(this).transition().duration(0).remove(),f.select(document).on("mouseup",null),l.edit.call(t,n)}).on("focus",function(){var t=this;i._editing=!0,f.select(document).on("mouseup",function(){if(f.event.target===t)return!1;document.activeElement===o.node()&&o.node().blur()})}).on("keyup",function(){27===f.event.which?(i._editing=!1,t.style({opacity:1}),f.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),l.cancel.call(t,this.textContent)):(l.input.call(t,this.textContent),f.select(this).call(u(t,a,e)))}).on("keydown",function(){13===f.event.which&&this.blur()}).call(n)}var i=e.gd,o=e.delegate,l=f.dispatch("edit","input","cancel"),s=o||t;if(t.style({"pointer-events":o?"none":"all"}),1!==t.size())throw new Error("boo");return e.immediate?r():s.on("click",r),f.rebind(t,l,"on")}},{"../constants/alignment":138,"../constants/string_mappings":141,"../constants/xmlns_namespaces":142,"../lib":156,d3:14}],177:[function(t,e,r){"use strict";function n(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}var a={};r.throttle=function(t,e,r){function i(){r(),o.ts=Date.now(),o.onDone&&(o.onDone(),o.onDone=null)}var o=a[t],l=Date.now();if(!o){for(var s in a)a[s].tso.ts+e)return void i();o.timer=setTimeout(function(){i(),o.timer=null},e)},r.done=function(t){var e=a[t];return e&&e.timer?new Promise(function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}}):Promise.resolve()},r.clear=function(t){if(t)n(a[t]),delete a[t];else for(var e in a)r.clear(e)}},{}],178:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},{"fast-isnumeric":17}],179:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=t.split("[")[0],l=0;l0)return t.substr(0,e)}var l=t("fast-isnumeric"),s=t("gl-mat4/fromQuat"),c=t("../registry"),u=t("../lib"),f=t("../plots/plots"),d=t("../plots/cartesian/axes"),p=t("../components/color");r.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&u.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=d.list({_fullLayout:t});for(e=0;e3?(v.x=1.02,v.xanchor="left"):v.x<-2&&(v.x=-.02,v.xanchor="right"),v.y>3?(v.y=1.02,v.yanchor="bottom"):v.y<-2&&(v.y=-.02,v.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var y=f.getSubplotIds(t,"gl3d");for(e=0;e1&&o.warn("Full array edits are incompatible with other edits",f);var m=r[""][""];if(u(m))e.set(null);else{if(!Array.isArray(m))return o.warn("Unrecognized full array edit value",f,m),!0;e.set(m)}return!g&&(d(v,y),p(t),!0)}var x,b,_,w,k,M,A,T=Object.keys(r).map(Number).sort(l),L=e.get(),C=L||[],z=n(y,f).get(),S=[],O=-1,D=C.length;for(x=0;xC.length-(A?0:1))o.warn("index out of range",f,_);else if(void 0!==M)k.length>1&&o.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(M)?S.push(_):A?("add"===M&&(M={}),C.splice(_,0,M),z&&z.splice(_,0,{})):o.warn("Unrecognized full object edit value",f,_,M),-1===O&&(O=_);else for(b=0;b=0;x--)C.splice(S[x],1),z&&z.splice(S[x],1);if(C.length?L||e.set(C):e.set(null),g)return!1;if(d(v,y),h!==i){var E;if(-1===O)E=T;else{for(D=Math.max(C.length,D),E=[],x=0;x=O);x++)E.push(_);for(x=O;x=t.data.length||a<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(a,n+1)>-1||a>=0&&e.indexOf(-t.data.length+a)>-1||a<0&&e.indexOf(t.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function c(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),s(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&s(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function u(t,e,r){var n,a;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&sZ.range[0]?[1,2]:[2,1]);else{var W=Z.range[0],Q=Z.range[1];X?(W<=0&&Q<=0&&r(P+".autorange",!0),W<=0?W=Q/1e6:Q<=0&&(Q=W/1e6),r(P+".range[0]",Math.log(W)/Math.LN10),r(P+".range[1]",Math.log(Q)/Math.LN10)):(r(P+".range[0]",Math.pow(10,W)),r(P+".range[1]",Math.pow(10,Q)))}else r(P+".autorange",!0);A.getComponentMethod("annotations","convertCoords")(t,B,z,r),A.getComponentMethod("images","convertCoords")(t,B,z,r)}else r(P+".autorange",!0),r(P+".range",null);w.nestedProperty(c,P+"._inputRange").set(null)}else if(D.match(j.AX_NAME_PATTERN)){var $=w.nestedProperty(c,M).get(),J=(z||{}).type;J&&"-"!==J||(J="linear"),A.getComponentMethod("annotations","convertCoords")(t,$,J,r),A.getComponentMethod("images","convertCoords")(t,$,J,r)}var K=I.containerArrayMatch(M);if(K){i=K.array,o=K.index;var tt=K.property,et=w.nestedProperty(s,i),rt=(et||[])[o]||{},nt=rt,at=H||{editType:"calc"},it=-1!==at.editType.indexOf("calcIfAutorange");""===o?(it?m.calc=!0:F.update(m,at),it=!1):""===tt&&(nt=z,I.isAddVal(z)?b[M]=null:I.isRemoveVal(z)?(b[M]=rt,nt=rt):w.warn("unrecognized full object value",e)),it&&(n(nt,"x")||n(nt,"y"))?m.calc=!0:F.update(m,at),d[i]||(d[i]={});var ot=d[i][o];ot||(ot=d[i][o]={}),ot[tt]=z,delete e[M]}else"reverse"===D?(R.range?R.range.reverse():(r(P+".autorange",!0),R.range=[1,0]),B.autorange?m.calc=!0:m.plot=!0):((!c._has("gl2d")||"dragmode"!==M||"lasso"!==z&&"select"!==z||"lasso"===q||"select"===q)&&H?F.update(m,H):m.calc=!0,C.set(z))}}for(i in d){I.applyContainerArrayChanges(t,w.nestedProperty(s,i),d[i],m)||(m.plot=!0)}var lt=c._axisConstraintGroups;for(y in k)for(o=0;o=l.length?l[0]:l[t]:l}function a(t){return Array.isArray(s)?t>=s.length?s[0]:s[t]:s}function i(t,e){var r=0;return function(){if(t&&++r===e)return t()}}if(t=w.getGraphDiv(t),!w.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 o=t._transitionData;o._frameQueue||(o._frameQueue=[]),r=L.supplyAnimationDefaults(r);var l=r.transition,s=r.frame;return void 0===o._frameWaitingCnt&&(o._frameWaitingCnt=0),new Promise(function(s,c){function u(){t.emit("plotly_animated"),window.cancelAnimationFrame(o._animationRaf),o._animationRaf=null}function f(){o._currentFrame&&o._currentFrame.onComplete&&o._currentFrame.onComplete();var e=o._currentFrame=o._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,o._lastFrameAt=Date.now(),o._timeToNext=e.frameOpts.duration,L.transition(t,e.frame.data,e.frame.layout,N.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then(function(){e.onComplete&&e.onComplete()}),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else u()}function d(){t.emit("plotly_animating"),o._lastFrameAt=-1/0,o._timeToNext=0,o._runningTransitions=0,o._currentFrame=null;var e=function(){o._animationRaf=window.requestAnimationFrame(e),Date.now()-o._lastFrameAt>o._timeToNext&&f()};e()}function p(t){return Array.isArray(l)?v>=l.length?t.transitionOpts=l[v]:t.transitionOpts=l[0]:t.transitionOpts=l,v++,t}var h,g,v=0,y=[],m=void 0===e||null===e,x=Array.isArray(e);if(m||x||!w.isPlainObject(e)){if(m||-1!==["string","number"].indexOf(typeof e))for(h=0;h0&&kk)&&M.push(g);y=M}}y.length>0?function(e){if(0!==e.length){for(var l=0;l=0;a--)if(w.isPlainObject(e[a])){var d=(c[e[a].name]||{}).name,p=e[a].name;d&&p&&"number"==typeof p&&c[d]&&(n++,w.warn('addFrames: overwriting frame "'+c[d].name+'" with a frame whose name of type "number" also equates to "'+d+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),n>5&&w.warn("addFrames: This API call has yielded too many warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),f.push({frame:L.supplyFrameDefaults(e[a]),index:r&&void 0!==r[a]&&null!==r[a]?r[a]:u+a})}f.sort(function(t,e){return t.index>e.index?-1:t.index=0;a--){if(i=f[a].frame,"number"==typeof i.name&&w.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!i.name)for(;c[i.name="frame "+t._transitionData._counter++];);if(c[i.name]){for(o=0;o=0;r--)n=e[r],i.push({type:"delete",index:n}),o.unshift({type:"insert",index:n,value:a[n]});var l=L.modifyFrames,s=L.modifyFrames,c=[t,o],u=[t,i];return M&&M.add(t,l,c,s,u),L.modifyFrames(t,i)},_.purge=function(t){t=w.getGraphDiv(t);var e=t._fullLayout||{},r=t._fullData||[];return L.cleanPlot([],{},r,e),L.purge(t),k.purge(t),e._container&&e._container.remove(),delete t._context,t}},{"../components/color":41,"../components/drawing":65,"../components/errorbars":71,"../constants/xmlns_namespaces":142,"../lib":156,"../lib/events":149,"../lib/queue":169,"../lib/svg_text_utils":176,"../plotly":191,"../plots/cartesian/axis_ids":199,"../plots/cartesian/constants":201,"../plots/cartesian/constraints":203,"../plots/cartesian/graph_interact":205,"../plots/plots":225,"../plots/polar":228,"../registry":240,"./edit_types":180,"./helpers":181,"./manage_arrays":182,"./plot_schema":185,"./subroutines":188,d3:14,"fast-isnumeric":17,"has-hover":19}],184:[function(t,e,r){"use strict";e.exports={staticPlot:!1,editable:!1,edits:{annotationPosition:!1,annotationTail:!1,annotationText:!1,axisTitleText:!1,colorbarPosition:!1,colorbarTitleText:!1,legendPosition:!1,legendText:!1,shapePosition:!1,titleText:!1},autosizable:!1,queueLength:0,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showAxisDragHandles:!0,showAxisRangeEntryBoxes:!0,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:"transparent",topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:!1,globalTransforms:[]}},{}],185:[function(t,e,r){"use strict";function n(t,e){var r,n,a,i,o=t._basePlotModules;if(o){var l;for(r=0;r=t.items.length)return!1;t=t.items[a]}}return t}function i(t){return t===Math.round(t)&&t>=0}function o(t){var e,r;"area"===t?(e={attributes:w},r={}):(e=v.modules[t]._module,r=e.basePlotModule);var n={};n.type=null,T(n,m),T(n,e.attributes),r.attributes&&T(n,r.attributes),n.type=t;var a={meta:e.meta||{},attributes:u(n)};if(e.layoutAttributes){var i={};T(i,e.layoutAttributes),a.layoutAttributes=u(i)}return a}function l(){var t,e,r={};T(r,x);for(t in v.subplotsRegistry)if(e=v.subplotsRegistry[t],e.layoutAttributes)if("cartesian"===e.name)h(r,e,"xaxis"),h(r,e,"yaxis");else{var n="subplot"===e.attr?e.name:e.attr;h(r,e,n)}r=p(r);for(t in v.componentsRegistry){e=v.componentsRegistry[t];var a=e.schema;if(a&&(a.subplots||a.layout)){var i=a.subplots;if(i&&i.xaxis&&!i.yaxis)for(var o in i.xaxis)delete r.yaxis[o]}else e.layoutAttributes&&g(r,e.layoutAttributes,e.name)}return{layoutAttributes:u(r)}}function s(t){var e=v.transformsRegistry[t],r=T({},e.attributes);return Object.keys(v.componentsRegistry).forEach(function(e){var n=v.componentsRegistry[e];n.schema&&n.schema.transforms&&n.schema.transforms[t]&&Object.keys(n.schema.transforms[t]).forEach(function(e){g(r,n.schema.transforms[t][e],e)})}),{attributes:u(r)}}function c(){var t={frames:y.extendDeepAll({},b)};return u(t),t.frames}function u(t){return f(t),d(t),t}function f(t){function e(t){return{valType:"string",editType:"none"}}function n(t,n,a){r.isValObject(t)?"data_array"===t.valType?(t.role="data",a[n+"src"]=e(n)):!0===t.arrayOk&&(a[n+"src"]=e(n)):y.isPlainObject(t)&&(t.role="object")}r.crawl(t,n)}function d(t){function e(t,e,r){if(t){var n=t[C];n&&(delete t[C],r[e]={items:{}},r[e].items[n]=t,r[e].role="object")}}r.crawl(t,e)}function p(t){return A(t,{radialaxis:k.radialaxis,angularaxis:k.angularaxis}),A(t,k.layout),t}function h(t,e,r){var n=y.nestedProperty(t,r),a=T({},e.layoutAttributes);a[L]=!0,n.set(a)}function g(t,e,r){var n=y.nestedProperty(t,r);n.set(T(n.get()||{},e))}var v=t("../registry"),y=t("../lib"),m=t("../plots/attributes"),x=t("../plots/layout_attributes"),b=t("../plots/frame_attributes"),_=t("../plots/animation_attributes"),w=t("../plots/polar/area_attributes"),k=t("../plots/polar/axis_attributes"),M=t("./edit_types"),A=y.extendFlat,T=y.extendDeepAll,L="_isSubplotObj",C="_isLinkedToArray",z=[L,C,"_arrayAttrRegexps","_deprecated"];r.IS_SUBPLOT_OBJ=L,r.IS_LINKED_TO_ARRAY=C,r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=z,r.get=function(){var t={};v.allTypes.concat("area").forEach(function(e){t[e]=o(e)});var e={};return Object.keys(v.transformsRegistry).forEach(function(t){e[t]=s(t)}),{defs:{valObjects:y.valObjectMeta,metaKeys:z.concat(["description","role","editType","impliedEdits"]),editType:{traces:M.traces,layout:M.layout},impliedEdits:{}},traces:t,layout:l(),transforms:e,frames:c(),animation:u(_)}},r.crawl=function(t,e,n,a){var i=n||0;a=a||"",Object.keys(t).forEach(function(n){var o=t[n];if(-1===z.indexOf(n)){var l=(a?a+".":"")+n;e(o,n,t,i,l),r.isValObject(o)||y.isPlainObject(o)&&"impliedEdits"!==n&&r.crawl(o,e,i+1,l)}})},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){function e(e,r,o,l){if(i=i.slice(0,l).concat([r]),e&&("data_array"===e.valType||!0===e.arrayOk)&&!("colorbar"===i[l-1]&&("ticktext"===r||"tickvals"===r))){var s=n(i),c=y.nestedProperty(t,s).get();Array.isArray(c)&&a.push(s)}}function n(t){return t.join(".")}var a=[],i=[];if(r.crawl(m,e),t._module&&t._module.attributes&&r.crawl(t._module.attributes,e),t.transforms)for(var o=t.transforms,l=0;l=t.transforms.length)return!1;r=(v.transformsRegistry[t.transforms[s].type]||{}).attributes,n=r&&r[e[2]],l=3}else if("area"===t.type)n=w[o];else{var c=t._module;if(c||(c=(v.modules[t.type||m.type.dflt]||{})._module),!c)return!1;if(r=c.attributes,!(n=r&&r[o])){var u=c.basePlotModule;u&&u.attributes&&(n=u.attributes[o])}n||(n=m[o])}return a(n,e,l)},r.getLayoutValObject=function(t,e){return a(n(t,e[0]),e,1)}},{"../lib":156,"../plots/animation_attributes":192,"../plots/attributes":194,"../plots/frame_attributes":221,"../plots/layout_attributes":223,"../plots/polar/area_attributes":226,"../plots/polar/axis_attributes":227,"../registry":240,"./edit_types":180}],186:[function(t,e,r){"use strict";function n(t){o.register(t,t.name,t.categories,t.meta),o.subplotsRegistry[t.basePlotModule.name]||o.registerSubplot(t.basePlotModule)}function a(t){if("string"!=typeof t.name)throw new Error("Transform module *name* must be a string.");var e="Transform module "+t.name,r="function"==typeof t.transform,n="function"==typeof t.calcTransform;if(!r&&!n)throw new Error(e+" is missing a *transform* or *calcTransform* method.");r&&n&&l.log([e+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),l.isPlainObject(t.attributes)||l.log(e+" registered without an *attributes* object."),"function"!=typeof t.supplyDefaults&&l.log(e+" registered without a *supplyDefaults* method."),o.registerTransform(t)}function i(t){if("string"!=typeof t.name)throw new Error("Component module *name* must be a string.");o.registerComponent(t)}var o=t("../registry"),l=t("../lib");e.exports=function(t){if(!t)throw new Error("No argument passed to Plotly.register.");t&&!Array.isArray(t)&&(t=[t]);for(var e=0;e=t[1]||a[1]<=t[0])&&(i[0]e[0]))return!0}return!1}function a(t,e,r){return t._anchorAxis===e&&(t.mirror||t.side===r)||"all"===t.mirror||"allticks"===t.mirror||t.mirrors&&t.mirrors[e._id+r]}function i(t,e,r){var n=[],a=e._anchorAxis;if(a){var i=a._mainAxis;if(-1===n.indexOf(i)){n.push(i);for(var o=0;o1&&s.push(o("object","layout"))),d.supplyDefaults(c);for(var u=c._fullData,v=r.length,y=0;y.3*f||i(n)||i(a))){var d=r.dtick/2;t+=t+d.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?t=B.tickIncrement(t,"M6","reverse")+1.5*P:i.exactMonths>.8?t=B.tickIncrement(t,"M1","reverse")+15.5*P:t-=P/2;var l=B.tickIncrement(t,r);if(l<=n)return l}return t}function l(t){var e,r,n=t.tickvals,a=t.ticktext,i=new Array(n.length),o=A.simpleMap(t.range,t.r2l),l=1.0001*o[0]-1e-4*o[1],s=1.0001*o[1]-1e-4*o[0],c=Math.min(l,s),f=Math.max(l,s),d=0;Array.isArray(a)||(a=[]);var p="category"===t.type?t.d2l_noadd:t.d2l;for("log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1)),r=0;rc&&e10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=P&&a<=10||e>=15*P)t._tickround="d";else if(e>=N&&a<=16||e>=I)t._tickround="M";else if(e>=R&&a<=19||e>=N)t._tickround="S";else{var i=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,i)-20}}else if(k(e)||"L"===e.charAt(0)){var o=t.range.map(t.r2d||Number);k(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(o[0]),Math.abs(o[1])),s=Math.floor(Math.log(l)/Math.LN10+.01);Math.abs(s)>3&&(g(t.exponentformat)&&!v(s)?t._tickexponent=3*Math.round((s-1)/3):t._tickexponent=s)}else t._tickround=null}function u(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}function f(t,e,r,n){var a=t._tickround,i=r&&t.hoverformat||t.tickformat;n&&(a=k(a)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[a]);var o,l=A.formatDate(e.x,i,a,t.calendar),s=l.indexOf("\n");-1!==s&&(o=l.substr(s+1),l=l.substr(0,s)),n&&("00:00:00"===l||"00:00"===l?(l=o,o=""):8===l.length&&(l=l.replace(/:00$/,""))),o&&(r?"d"===a?l+=", "+o:l=o+(l?", "+l:""):t._inCalcTicks&&o===t._prevDateHead||(l+="
"+o,t._prevDateHead=o)),e.text=l}function d(t,e,r,n,a){var i=t.dtick,o=e.x;if("never"===a&&(a=""),!n||"string"==typeof i&&"L"===i.charAt(0)||(i="L3"),t.tickformat||"string"==typeof i&&"L"===i.charAt(0))e.text=y(Math.pow(10,o),t,a,n);else if(k(i)||"D"===i.charAt(0)&&A.mod(o+.01,1)<.1){var l=Math.round(o);-1!==["e","E","power"].indexOf(t.exponentformat)||g(t.exponentformat)&&v(l)?(e.text=0===l?1:1===l?"10":l>1?"10"+l+"":"10"+F+-l+"",e.fontSize*=1.25):(e.text=y(Math.pow(10,o),t,"","fakehover"),"D1"===i&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==i.charAt(0))throw"unrecognized dtick "+String(i);e.text=String(Math.round(Math.pow(10,A.mod(o,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*(o<0?.5:.25)))}}function p(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}function h(t,e,r,n,a){"never"===a?a="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide"),e.text=y(e.x,t,a,n)}function g(t){return"SI"===t||"B"===t}function v(t){return t>14||t<-15}function y(t,e,r,n){var a=t<0,i=e._tickround,o=r||e.exponentformat||"B",l=e._tickexponent,s=e.tickformat,u=e.separatethousands;if(n){var f={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:k(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};c(f),i=(Number(f._tickround)||0)+4,l=f._tickexponent,e.hoverformat&&(s=e.hoverformat)}if(s)return w.format(s)(t).replace(/-/g,F);var d=Math.pow(10,-i)/2;if("none"===o&&(l=0),(t=Math.abs(t))"+y+"":"B"===o&&9===l?t+="B":g(o)&&(t+=Q[l/3+5])}return a?F+t:t}function m(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},B.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=o,c=l,d=f/u);if(n===a){var g=n-1,v=n+1;r="tozero"===t.rangemode?n<0?[g,0]:[0,v]:"nonnegative"===t.rangemode?[Math.max(0,g),Math.max(0,v)]:[g,v]}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])))),p&&r.reverse(),A.simpleMap(r,t.l2r||Number)},B.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=B.getAutoRange(t),t._r=t.range.slice(),t._rl=A.simpleMap(t._r,t.r2l);var r=t._input;r.range=t.range.slice(),r.autorange=t.autorange}},B.saveRangeInitial=function(t,e){for(var r=B.list(t,"",!0),n=!1,a=0;a=d?p=!1:l.val>=c&&l.pad<=d&&(t._min.splice(o,1),o--);p&&t._min.push({val:c,pad:m&&0===c?0:d})}if(n(u)){for(p=!0,o=0;o=u&&l.pad>=f?p=!1:l.val<=u&&l.pad<=f&&(t._max.splice(o,1),o--);p&&t._max.push({val:u,pad:m&&0===u?0:f})}}}if((t.autorange||!!A.nestedProperty(t,"rangeslider.autorange").get())&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var i,o,l,s,c,u,f,d,p,h,g,v=e.length,y=r.padded?.05*t._length:0,m=r.tozero&&("linear"===t.type||"-"===t.type);y&&"domain"===t.constrain&&t._inputDomain&&(y*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0]));var x=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),b=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),_=n(r.vpadplus||r.vpad),w=n(r.vpadminus||r.vpad);for(i=0;i<6;i++)a(i);for(i=v-1;i>5;i--)a(i)}},B.autoBin=function(t,e,r,n,a){var l=A.aggNums(Math.min,null,t),s=A.aggNums(Math.max,null,t);if(a||(a=e.calendar),"category"===e.type)return{start:l-.5,end:s+.5,size:1,_count:s-l+1};var c;if(r)c=(s-l)/r;else{var u=A.distinctVals(t),f=Math.pow(10,Math.floor(Math.log(u.minDiff)/Math.LN10)),d=f*A.roundUp(u.minDiff/f,[.9,1.9,4.9,9.9],!0);c=Math.max(d,2*A.stdev(t)/Math.pow(t.length,n?.25:.4)),k(c)||(c=1)}var p;p="log"===e.type?{type:"linear",range:[l,s]}:{type:e.type,range:A.simpleMap([l,s],e.c2r,0,a),calendar:a},B.setConvert(p),B.autoTicks(p,c);var h,g,v=B.tickIncrement(B.tickFirst(p),p.dtick,"reverse",a);if("number"==typeof p.dtick)v=i(v,t,p,l,s),g=1+Math.floor((s-v)/p.dtick),h=v+g*p.dtick;else for("M"===p.dtick.charAt(0)&&(v=o(v,t,p.dtick,l,a)),h=v,g=0;h<=s;)h=B.tickIncrement(h,p.dtick,!1,a),g++;return{start:e.c2r(v,0,a),end:e.c2r(h,0,a),size:p.dtick,_count:g}},B.calcTicks=function(t){var e=A.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var r,n=t.nticks;n||("category"===t.type?(r=t.tickfont?1.2*(t.tickfont.size||12):15,n=t._length/r):(r="y"===t._id.charAt(0)?40:80,n=A.constrain(t._length/r,4,9)+1)),"array"===t.tickmode&&(n*=100),B.autoTicks(t,Math.abs(e[1]-e[0])/n),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}if(t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),c(t),"array"===t.tickmode)return l(t);t._tmin=B.tickFirst(t);var a=e[1]=o:f<=o)&&!(i.length>u||f===s);f=B.tickIncrement(f,t.dtick,a,t.calendar))s=f,i.push(f);t._tmax=i[i.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var d=new Array(i.length),p=0;pD?(e/=D,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*s(e,r,U)):n>E?(e/=E,t.dtick="M"+s(e,1,G)):n>P?(t.dtick=s(e,P,X),t.tick0=A.dateTick0(t.calendar,!0)):n>I?t.dtick=s(e,I,G):n>N?t.dtick=s(e,N,Z):n>R?t.dtick=s(e,R,Z):(r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=s(e,r,U))}else if("log"===t.type){t.tick0=0;var a=A.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(a[1]-a[0])<1){var i=1.5*Math.abs((a[1]-a[0])/e);e=Math.abs(Math.pow(10,a[1])-Math.pow(10,a[0]))/i,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+s(e,r,U)}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=s(e,r,U));if(0===t.dtick&&(t.dtick=1),!k(t.dtick)&&"string"!=typeof t.dtick){var o=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(o)}},B.tickIncrement=function(t,e,r,n){var a=r?-1:1;if(k(e))return t+a*e;var i=e.charAt(0),o=a*Number(e.substr(1));if("M"===i)return A.incrementMonth(t,o,n);if("L"===i)return Math.log(Math.pow(10,t)+o)/Math.LN10;if("D"===i){var l="D2"===e?W:Y,s=t+.01*a,c=A.roundUp(A.mod(s,1),l,r);return Math.floor(s)+Math.log(w.round(Math.pow(10,c),1))/Math.LN10}throw"unrecognized dtick "+String(e)},B.tickFirst=function(t){var e=t.r2l||Number,r=A.simpleMap(t.range,e),n=r[1]1&&e2*a}function i(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,a=0,i=0;i2*n}var o=t("fast-isnumeric"),l=t("../../lib"),s=t("../../constants/numerical").BADNUM;e.exports=function(t,e){return a(t,e)?"date":i(t)?"category":n(t)?"linear":"-"}},{"../../constants/numerical":140,"../../lib":156,"fast-isnumeric":17}],198:[function(t,e,r){"use strict";var n=t("tinycolor2").mix,a=t("../../registry"),i=t("../../lib"),o=t("../../components/color/attributes").lightFraction,l=t("./layout_attributes"),s=t("./tick_value_defaults"),c=t("./tick_mark_defaults"),u=t("./tick_label_defaults"),f=t("./category_order_defaults"),d=t("./set_convert"),p=t("./ordered_categories");e.exports=function(t,e,r,h,g){function v(r,n){return i.coerce2(t,e,l,r,n)}var y=h.letter,m=h.font||{},x="Click to enter "+(h.title||y.toUpperCase()+" axis")+" title",b=r("visible",!h.cheateronly),_=e.type;if("date"===_){a.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",h.calendar)}if(d(e,g),r("autorange",!e.isValidRange(t.range))&&r("rangemode"),r("range"),e.cleanRange(),f(t,e,r),e._initialCategories="category"===_?p(y,e.categoryorder,e.categoryarray,h.data):[],!b)return e;var w=r("color"),k=w===t.color?w:m.color;r("title",x),i.coerceFont(r,"titlefont",{family:m.family,size:Math.round(1.2*m.size),color:k}),s(t,e,r,_),u(t,e,r,_,h),c(t,e,r,h);var M=v("linecolor",w),A=v("linewidth"),T=r("showline",!!M||!!A);T||(delete e.linecolor,delete e.linewidth),(T||e.ticks)&&r("mirror");var L=v("gridcolor",n(w,h.bgColor,o).toRgbString()),C=v("gridwidth");r("showgrid",h.showGrid||!!L||!!C)||(delete e.gridcolor,delete e.gridwidth);var z=v("zerolinecolor",w),S=v("zerolinewidth");return r("zeroline",h.showGrid||!!z||!!S)||(delete e.zerolinecolor,delete e.zerolinewidth),e}},{"../../components/color/attributes":40,"../../lib":156,"../../registry":240,"./category_order_defaults":200,"./layout_attributes":207,"./ordered_categories":209,"./set_convert":213,"./tick_label_defaults":214,"./tick_mark_defaults":215,"./tick_value_defaults":216,tinycolor2:23}],199:[function(t,e,r){"use strict";function n(t,e,r){function n(t,r){for(var n=Object.keys(t),a=/^[xyz]axis[0-9]*/,i=[],o=0;o0;i&&(n="array");var o=r("categoryorder",n);"array"===o&&r("categoryarray"),i||"array"!==o||(e.categoryorder="trace")}}},{}],201:[function(t,e,r){"use strict";var n=t("../../lib").counterRegex;e.exports={idRegex:{x:n("x"),y:n("y")},attrRegex:n("[xy]axis"),xAxisMatch:n("xaxis"),yAxisMatch:n("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,SELECTDELAY:100,SELECTID:"-select",DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","maplayer","barlayer","carpetlayer","boxlayer","scatterlayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},{"../../lib":156}],202:[function(t,e,r){"use strict";function n(t,e,r,n){var a,i,l,s,c=n[o(e)].type,u=[];for(i=0;io*y)||_)for(r=0;rO&&Ez&&(z=E);var N=(z-C)/(2*S);f/=N,C=s.l2r(C),z=s.l2r(z),s.range=s._input.range=A=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function c(t,e){return t?"nsew"===t?"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}function u(t,e,r,n,a){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",a+"Z")}function f(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:T.background,stroke:T.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function d(t){t.selectAll(".select-outline").remove()}function p(t,e,r,n,a,i){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),a||(t.transition().style("fill",i>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function h(t){b.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function g(t){return-1!==["lasso","select"].indexOf(t)}function v(t,e){return"M"+(t.l-.5)+","+(e-F-.5)+"h-3v"+(2*F+1)+"h3ZM"+(t.r+.5)+","+(e-F-.5)+"h3v"+(2*F+1)+"h-3Z"}function y(t,e){return"M"+(e-F-.5)+","+(t.t-.5)+"v-3h"+(2*F+1)+"v3ZM"+(e-F-.5)+","+(t.b+.5)+"v3h"+(2*F+1)+"v-3Z"}function m(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,F)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function x(t,e,r){var n,a,i,o,l,s,c=!1,u={},f={};for(n=0;nF||l>F?(Mt="xy",o/it>l/ot?(l=o*ot/it,xt>i?bt.t=xt-l:bt.b=xt+l):(o=l*it/ot,mt>a?bt.l=mt-o:bt.r=mt+o),Tt.attr("d",m(bt))):n():!st||lzoom back out","long"),j=!1)}function X(e,r){var n=1===(q+H).length;if(e)J();else if(2!==r||n){if(1===r&&n){var a=q?rt[0]:et[0],o="s"===q||"w"===H?0:1,l=a._name+".range["+o+"]",s=i(a,o),c="left",u="middle";if(a.fixedrange)return;q?(u="n"===q?"top":"bottom","right"===a.side&&(c="right")):"e"===H&&(c="right"),t._context.showAxisRangeEntryBoxes&&b.select(vt).call(A.makeEditable,{gd:t,immediate:!0,background:pt.paper_bgcolor,text:String(s),fill:a.tickfont?a.tickfont.color:"#444",horizontalAlign:c,verticalAlign:u}).on("edit",function(e){var r=a.d2r(e);void 0!==r&&w.relayout(t,l,r)})}}else $()}function Y(e){function r(t,e,r){function n(e){return t.l2r(i+(e-i)*r)}if(!t.fixedrange){var a=M.simpleMap(t.range,t.r2l),i=a[0]+(a[1]-a[0])*e;t.range=a.map(n)}}if(t._context.scrollZoom||pt._enablescrollzoom){if(t._transitioningWithDuration)return M.pauseEvent(e);var n=t.querySelector(".plotly");if(V(),!(n.scrollHeight-n.clientHeight>10||n.scrollWidth-n.clientWidth>10)){clearTimeout(zt);var a=-e.deltaY;if(isFinite(a)||(a=e.wheelDelta/10),!isFinite(a))return void M.log("Did not find wheel motion attributes: ",e);var i,o=Math.exp(-Math.min(Math.max(a,-20),20)/200),l=Ot.draglayer.select(".nsewdrag").node().getBoundingClientRect(),s=(e.clientX-l.left)/l.width,c=(l.bottom-e.clientY)/l.height;if(H||ut){for(H||(s=.5),i=0;i rect").call(L.setTranslate,l,s).call(L.setScale,i,o);var w=g.plot.selectAll(".scatterlayer .points, .boxlayer .points");g.plot.call(L.setTranslate,b,_).call(L.setScale,1/i,1/o),w.selectAll(".point").call(L.setPointGroupScale,i,o).call(L.hideOutsideRangePoints,g),w.selectAll(".textpoint").call(L.setTextPointsScale,i,o).call(L.hideOutsideRangePoints,g)}}}var tt,et,rt,nt,at,it,ot,lt,st,ct,ut,ft,dt,pt=t._fullLayout,ht=t._fullLayout._zoomlayer,gt=q+H==="nsew";V();var vt=n(e,q+H+"drag",ct,r,T,C,B);if(!st&&!lt&&!g(pt.dragmode))return vt.onmousedown=null,vt.style.pointerEvents=gt?"all":"none",vt;var yt={element:vt,gd:t,plotinfo:e,prepFn:function(e,r,n){var a=t._fullLayout.dragmode;gt?e.shiftKey&&(a="pan"===a?"zoom":"pan"):a="pan",yt.minDrag="lasso"===a?1:void 0,"zoom"===a?(yt.moveFn=G,yt.doneFn=Z,yt.minDrag=1,U(e,r,n)):"pan"===a?(yt.moveFn=W,yt.doneFn=X,d(ht)):g(a)&&(yt.xaxes=et,yt.yaxes=rt,P(e,r,n,yt,a))}};z.init(yt);var mt,xt,bt,_t,wt,kt,Mt,At,Tt,Lt={},Ct=[0,0,it,ot],zt=null,St=N.REDRAWDELAY,Ot=e.mainplot?pt._plots[e.mainplot]:e;return q.length*H.length!=1&&(void 0!==vt.onwheel?vt.onwheel=Y:void 0!==vt.onmousewheel&&(vt.onmousewheel=Y)),vt}},{"../../components/color":41,"../../components/dragelement":62,"../../components/drawing":65,"../../constants/alignment":138,"../../lib":156,"../../lib/setcursor":174,"../../lib/svg_text_utils":176,"../../plotly":191,"../../registry":240,"../plots":225,"./axes":196,"./axis_ids":199,"./constants":201,"./scale_zoom":211,"./select":212,d3:14,tinycolor2:23}],205:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../components/fx"),i=t("../../components/dragelement"),o=t("./constants"),l=t("./dragbox");e.exports=function(t){var e=t._fullLayout;if((e._has("cartesian")||e._has("gl2d"))&&!t._context.staticPlot){Object.keys(e._plots||{}).sort(function(t,r){if((e._plots[t].mainplot&&!0)===(e._plots[r].mainplot&&!0)){var n=t.split("y"),a=r.split("y");return n[0]===a[0]?Number(n[1]||1)-Number(a[1]||1):Number(n[0]||1)-Number(a[0]||1)}return e._plots[t].mainplot?1:-1}).forEach(function(r){var s=e._plots[r],c=s.xaxis,u=s.yaxis,f=(c._linepositions[r]||[])[3],d=(u._linepositions[r]||[])[3],p=o.DRAGGERSIZE;if(n(f)&&"top"===c.side&&(f-=p),n(d)&&"right"!==u.side&&(d-=p),!s.mainplot){var h=l(t,s,0,0,c._length,u._length,"ns","ew");h.onmousemove=function(e){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===r&&a.hover(t,e,r)},a.hover(t,e,r),t._fullLayout._lasthover=h,t._fullLayout._hoversubplot=r},h.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,i.unhover(t,e))},h.onclick=function(e){a.click(t,e,r)},t._context.showAxisDragHandles&&(l(t,s,-p,-p,p,p,"n","w"),l(t,s,c._length,-p,p,p,"n","e"),l(t,s,-p,u._length,p,p,"s","w"),l(t,s,c._length,u._length,p,p,"s","e"))}t._context.showAxisDragHandles&&(n(f)&&("free"===c.anchor&&(f-=e._size.h*(1-u.domain[1])),l(t,s,.1*c._length,f,.8*c._length,p,"","ew"),l(t,s,0,f,.1*c._length,p,"","w"),l(t,s,.9*c._length,f,.1*c._length,p,"","e")),n(d)&&("free"===u.anchor&&(d-=e._size.w*c.domain[0]),l(t,s,d,.1*u._length,p,.8*u._length,"ns",""),l(t,s,d,.9*u._length,p,.1*u._length,"s",""),l(t,s,d,0,p,.1*u._length,"n","")))});var r=e._hoverlayer.node();r.onmousemove=function(r){r.target=e._lasthover,a.hover(t,r,e._hoversubplot)},r.onclick=function(r){r.target=e._lasthover,a.click(t,r)},r.onmousedown=function(t){e._lasthover.onmousedown(t)}}}},{"../../components/dragelement":62,"../../components/fx":82,"./constants":201,"./dragbox":204,"fast-isnumeric":17}],206:[function(t,e,r){"use strict";function n(t,e,r,n,a){var i=t._fullLayout,o=i._modules;e.plot&&e.plot.selectAll("g:not(.scatterlayer)").selectAll("g.trace").remove();for(var l=0;lu[1]-.01&&(e.domain=[0,1]),a.noneOrAll(t.domain,e.domain,[0,1])}return r("layer"),e}},{"../../lib":156,"fast-isnumeric":17}],211:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var a=[t.r2l(t.range[0]),t.r2l(t.range[1])],i=a[0]+(a[1]-a[0])*r;t.range=t._input.range=[t.l2r(i+(a[0]-i)*e),t.l2r(i+(a[1]-i)*e)]}},{"../../constants/alignment":138}],212:[function(t,e,r){"use strict";function n(t){return t._id}function a(t,e){if(Array.isArray(t))for(var r=e.cd[0].trace,n=0;n0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],a=t.range[1];return.5*(n+a-3*k*Math.abs(n-a))}return p}function f(e,r,n){var a=c(e,n||t.calendar);if(a===p){if(!i(e))return p;a=c(new Date(+e))}return a}function v(e,r,n){return s(e,r,n||t.calendar)}function y(e){return t._categories[Math.round(e)]}function m(e){if(null!==e&&void 0!==e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return p}function x(e){if(t._categoriesMap){var r=t._categoriesMap[e];if(void 0!==r)return r}if(i(e))return+e}function b(e){return i(e)?a.round(t._b+t._m*e,2):p}function _(e){return(e-t._b)/t._m}e=e||{};var w=(t._id||"x").charAt(0),k=10;t.c2l="log"===t.type?r:u,t.l2c="log"===t.type?n:u,t.l2p=b,t.p2l=_,t.c2p="log"===t.type?function(t,e){return b(r(t,e))}:b,t.p2c="log"===t.type?function(t){return n(_(t))}:_,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=l,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=_,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return r(l(t),e)},t.r2d=t.r2c=function(t){return n(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=u,t.c2r=r,t.l2d=n,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return n(_(t))},t.r2p=function(e){return t.l2p(l(e))},t.p2r=_,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=o.identity,t.d2c=t.r2c=t.d2l=t.r2l=f,t.c2d=t.c2r=t.l2d=t.l2r=v,t.d2p=t.r2p=function(e,r,n){return t.l2p(f(e,0,n))},t.p2d=t.p2r=function(t,e,r){return v(_(t),e,r)},t.cleanPos=function(e){return o.cleanDate(e,p,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=m,t.r2d=t.c2d=t.l2d=y,t.d2r=t.d2l_noadd=x,t.r2c=function(e){var r=x(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=x,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return y(_(t))},t.r2p=t.d2p,t.p2r=_,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e){e||(e="range");var r,n,a=o.nestedProperty(t,e).get();if(n="date"===t.type?o.dfltRange(t.calendar):"y"===w?h.DFLTRANGEY:h.DFLTRANGEX,n=n.slice(),!a||2!==a.length)return void o.nestedProperty(t,e).set(n);for("date"===t.type&&(a[0]=o.cleanDate(a[0],p,t.calendar),a[1]=o.cleanDate(a[1],p,t.calendar)),r=0;r<2;r++)if("date"===t.type){if(!o.isDateTime(a[r],t.calendar)){t[e]=n;break}if(t.r2l(a[0])===t.r2l(a[1])){var l=o.constrain(t.r2l(a[0]),o.MIN_MS+1e3,o.MAX_MS-1e3);a[0]=t.l2r(l-1e3),a[1]=t.l2r(l+1e3);break}}else{if(!i(a[r])){if(!i(a[1-r])){t[e]=n;break}a[r]=a[1-r]*(r?10:.1)}if(a[r]<-d?a[r]=-d:a[r]>d&&(a[r]=d),a[0]===a[1]){var s=Math.max(1,Math.abs(1e-6*a[0]));a[0]-=s,a[1]+=s}}},t.setScale=function(r){var n=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var a=g.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var i=r&&t._r?"_r":"range",l=t.calendar;t.cleanRange(i);var s=t.r2l(t[i][0],l),c=t.r2l(t[i][1],l);if("y"===w?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(s-c),t._b=-t._m*c):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-s),t._b=-t._m*s),!isFinite(t._m)||!isFinite(t._b))throw o.notifier("Something went wrong with axis scaling","long"),e._replotting=!1,new Error("axis scaling")},t.makeCalcdata=function(e,r){var n,a,i,o="date"===t.type&&e[r+"calendar"];if(r in e)for(n=e[r],a=new Array(n.length),i=0;i=t.range[0]&&r<=t.range[1]}:function(e){var r=e.y;return r>=t.range[0]&&r<=t.range[1]},t._min=[],t._max=[],t._separators=e.separators,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":140,"../../lib":156,"./axis_ids":199,"./constants":201,d3:14,"fast-isnumeric":17}],214:[function(t,e,r){"use strict";function n(t){var e=["showexponent","showtickprefix","showticksuffix"],r=e.filter(function(e){return void 0!==t[e]}),n=function(e){return t[e]===t[r[0]]};if(r.every(n)||1===r.length)return t[r[0]]}var a=t("../../lib");e.exports=function(t,e,r,i,o){var l=n(t);if(r("tickprefix")&&r("showtickprefix",l),r("ticksuffix")&&r("showticksuffix",l),r("showticklabels")){var s=o.font||{},c=e.color===t.color?e.color:s.color;a.coerceFont(r,"tickfont",{family:s.family,size:s.size,color:c}),r("tickangle"),"category"!==i&&(r("tickformat")||"date"===i||(r("showexponent",l),r("exponentformat"),r("separatethousands")))}"category"===i||o.noHover||r("hoverformat")}},{"../../lib":156}],215:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r,i){var o=n.coerce2(t,e,a,"ticklen"),l=n.coerce2(t,e,a,"tickwidth"),s=n.coerce2(t,e,a,"tickcolor",e.color);r("ticks",i.outerTicks||o||l||s?"outside":"")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":156,"./layout_attributes":207}],216:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").ONEDAY;e.exports=function(t,e,r,o){var l="auto";"array"!==t.tickmode||"log"!==o&&"date"!==o||(t.tickmode="auto"),Array.isArray(t.tickvals)?l="array":t.dtick&&(l="linear");var s=r("tickmode",l);if("auto"===s)r("nticks");else if("linear"===s){var c="date"===o?i:1,u=r("dtick",c);if(n(u))e.dtick=u>0?Number(u):c;else if("string"!=typeof u)e.dtick=c;else{var f=u.charAt(0),d=u.substr(1);d=n(d)?Number(d):0,(d<=0||!("date"===o&&"M"===f&&d===Math.round(d)||"log"===o&&"L"===f||"log"===o&&"D"===f&&(1===d||2===d)))&&(e.dtick=c)}var p="date"===o?a.dateTick0(e.calendar):0,h=r("tick0",p);"date"===o?e.tick0=a.cleanDate(h,p):n(h)&&"D1"!==u&&"D2"!==u?e.tick0=Number(h):e.tick0=p}else{var g=r("tickvals");void 0===g?e.tickmode="auto":r("ticktext")}}},{"../../constants/numerical":140,"../../lib":156,"fast-isnumeric":17}],217:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plotly"),i=t("../../registry"),o=t("../../components/drawing"),l=t("./axes"),s=t("./constants").attrRegex;e.exports=function(t,e,r,c){function u(e,r){function n(e,r,n){for(a=0;a rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.select(".scatterlayer").selectAll(".points");n.selectAll(".point").call(o.setPointGroupScale,1,1).call(o.hideOutsideRangePoints,t),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1).call(o.hideOutsideRangePoints,t)}function d(e,r){var n,a,i,l=m[e.xaxis._id],s=m[e.yaxis._id],c=[];if(l){n=t._fullLayout[l.axisName],a=n._r,i=l.to,c[0]=(a[0]*(1-r)+r*i[0]-a[0])/(a[1]-a[0])*e.xaxis._length;var f=a[1]-a[0],d=i[1]-i[0];n.range[0]=a[0]*(1-r)+r*i[0],n.range[1]=a[1]*(1-r)+r*i[1],c[2]=e.xaxis._length*(1-r+r*d/f)}else c[0]=0,c[2]=e.xaxis._length;if(s){n=t._fullLayout[s.axisName],a=n._r,i=s.to,c[1]=(a[1]*(1-r)+r*i[1]-a[1])/(a[0]-a[1])*e.yaxis._length;var p=a[1]-a[0],h=i[1]-i[0];n.range[0]=a[0]*(1-r)+r*i[0],n.range[1]=a[1]*(1-r)+r*i[1],c[3]=e.yaxis._length*(1-r+r*h/p)}else c[1]=0,c[3]=e.yaxis._length;u(e.xaxis,e.yaxis);var g=e.xaxis,y=e.yaxis,x=!!l,b=!!s,_=x?g._length/c[2]:1,w=b?y._length/c[3]:1,k=x?c[0]:0,M=b?c[1]:0,A=x?c[0]/c[2]*g._length:0,T=b?c[1]/c[3]*y._length:0,L=g._offset-A,C=y._offset-T;v._defs.select("#"+e.clipId+"> rect").call(o.setTranslate,k,M).call(o.setScale,1/_,1/w),e.plot.call(o.setTranslate,L,C).call(o.setScale,_,w).selectAll(".points").selectAll(".point").call(o.setPointGroupScale,1/_,1/w),e.plot.selectAll(".points").selectAll(".textpoint").call(o.setTextPointsScale,1/_,1/w)}function p(){for(var e={},r=0;rr.duration?(p(),M=window.cancelAnimationFrame(g)):M=window.requestAnimationFrame(g)}var v=t._fullLayout,y=[],m=function(t){var e,r,n,a,i={};for(e in t)if(r=e.split("."),r[0].match(s)){var o=e.charAt(0),l=r[0];if(n=v[l],a={},Array.isArray(t[e])?a.to=t[e].slice(0):Array.isArray(t[e].range)&&(a.to=t[e].range.slice(0)),!a.to)continue;a.axisName=l,a.length=n._length,y.push(o),i[o]=a}return i}(e),x=Object.keys(m),b=function(t,e,r){var n,a,i,o=t._plots,l=[];for(n in o){var s=o[n];if(-1===l.indexOf(s)){var c=s.xaxis._id,u=s.yaxis._id,f=s.xaxis.range,d=s.yaxis.range;s.xaxis._r=s.xaxis.range.slice(),s.yaxis._r=s.yaxis.range.slice(),a=r[c]?r[c].to:f,i=r[u]?r[u].to:d,f[0]===a[0]&&f[1]===a[1]&&d[0]===i[0]&&d[1]===i[1]||-1===e.indexOf(c)&&-1===e.indexOf(u)||l.push(s)}}return l}(v,x,m);if(!b.length)return function(){function e(e,r,n){for(var a=0;a0?".":"")+a;c.isPlainObject(i)?l(i,e,o,n+1):e(o,a,i)}})}var s=t("../plotly"),c=t("../lib");r.manageCommandObserver=function(t,e,a,i){var o={},l=!0;e&&e._commandObserver&&(o=e._commandObserver),o.cache||(o.cache={}),o.lookupTable={};var s=r.hasSimpleAPICommandBindings(t,a,o.lookupTable);if(e&&e._commandObserver){if(s)return o;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,o}if(s){n(t,s,o.cache),o.check=function(){if(l){var e=n(t,s,o.cache);return e.changed&&i&&void 0!==o.lookupTable[e.value]&&(o.disable(),Promise.resolve(i({value:e.value,type:s.type,prop:s.prop,traces:s.traces,index:o.lookupTable[e.value]})).then(o.enable,o.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f=e.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=e._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),c=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&n(t,o),l.text(o.text()&&c.text()?" - ":"")}},v.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=s.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return n.append("input").attr({type:"text",name:"data"}).node().value=v.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},v.supplyDefaults=function(t){var e,r=t._fullLayout||{},n=t._fullLayout={},i=t.layout||{},o=t._fullData||[],l=t._fullData=[],s=t.data||[];if(t._transitionData||v.createTransitionData(t),r._initialAutoSizeIsDone){var c=r.width,f=r.height;v.supplyLayoutGlobalDefaults(i,n),i.width||(n.width=c),i.height||(n.height=f)}else{v.supplyLayoutGlobalDefaults(i,n);var d=!i.width||!i.height,p=n.autosize,h=t._context&&t._context.autosizable;d&&(p||h)?v.plotAutoSize(t,i,n):d&&v.sanitizeMargins(t),!p&&d&&(i.width=n.width,i.height=n.height)}n._initialAutoSizeIsDone=!0,n._dataLength=s.length,n._globalTransforms=(t._context||{}).globalTransforms,v.supplyDataDefaults(s,l,i,n),n._has=v._hasPlotType.bind(n);var g=n._modules;for(e=0;e0){var u=o(t._boundingBoxMargins),f=u.left+u.right,d=u.bottom+u.top,h=1-2*l,g=r._container&&r._container.node?r._container.node().getBoundingClientRect():{width:r.width,height:r.height};n=Math.round(h*(g.width-f)),a=Math.round(h*(g.height-d))}else{var y=s?window.getComputedStyle(t):{};n=parseFloat(y.width)||r.width,a=parseFloat(y.height)||r.height}var m=v.layoutAttributes.width.min,x=v.layoutAttributes.height.min;n1,_=!e.height&&Math.abs(r.height-a)>1;(_||b)&&(b&&(r.width=n),_&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),v.sanitizeMargins(r)},v.supplyLayoutModuleDefaults=function(t,e,r,n){var a,i;u.Axes.supplyLayoutDefaults(t,e,r);var o=e._basePlotModules;for(a=0;a.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+a},r:{val:r.x,size:r.r+a},b:{val:r.y,size:r.b+a},t:{val:r.y,size:r.t+a}}}else delete n._pushmargin[e];n._replotting||v.doAutoMargin(t)}},v.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),a=Math.max(e.margin.l||0,0),i=Math.max(e.margin.r||0,0),o=Math.max(e.margin.t||0,0),l=Math.max(e.margin.b||0,0),s=e._pushmargin;if(!1!==e.margin.autoexpand){s.base={l:{val:0,size:a},r:{val:1,size:i},t:{val:1,size:o},b:{val:0,size:l}};for(var f=Object.keys(s),d=0;dv){var M=(y*w+(k-e.width)*v)/(w-v),A=(k*(1-v)+(y-e.width)*(1-w))/(w-v);M>=0&&A>=0&&M+A>a+i&&(a=M,i=A)}}if(c(x)&&s[_].t){var T=s[_].t.val,L=s[_].t.size;if(T>m){var C=(x*T+(L-e.height)*m)/(T-m),z=(L*(1-m)+(x-e.height)*(1-T))/(T-m);C>=0&&z>=0&&C+z>l+o&&(l=C,o=z)}}}}if(r.l=Math.round(a),r.r=Math.round(i),r.t=Math.round(o),r.b=Math.round(l),r.p=Math.round(e.margin.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,!e._replotting&&"{}"!==n&&n!==JSON.stringify(e._size))return u.plot(t)},v.graphJson=function(t,e,r,n,a){function i(t){if("function"==typeof t)return null;if(p.isPlainObject(t)){var e,n,a={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0&&!p.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;a[e]=i(t[e])}return a}return Array.isArray(t)?t.map(i):p.isJSDate(t)?p.ms2DateTimeLocal(+t):t}(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&v.supplyDefaults(t);var o=a?t._fullData:t.data,l=a?t._fullLayout:t.layout,s=(t._transitionData||{})._frames,c={data:(o||[]).map(function(t){var r=i(t);return e&&delete r.fit,r})};return e||(c.layout=i(l)),t.framework&&t.framework.isPolar&&(c=t.framework.getConfig()),s&&(c.frames=i(s)),"object"===n?c:JSON.stringify(c)},v.modifyFrames=function(t,e){var r,n,a,i=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){b=!0}),a.redraw&&t._transitionData._interruptCallbacks.push(function(){return u.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var o,l,s=0,c=0,d=t._fullLayout._basePlotModules,h=!1;if(r)for(l=0;l=0,z=C?d.angularAxis.domain:n.extent(M),S=Math.abs(M[1]-M[0]);T&&!A&&(S=0);var O=z.slice();L&&A&&(O[1]+=S);var D=d.angularAxis.ticksCount||4;D>8&&(D=D/(D/8)+D%8),d.angularAxis.ticksStep&&(D=(O[1]-O[0])/D);var E=d.angularAxis.ticksStep||(O[1]-O[0])/(D*(d.minorTicks+1));k&&(E=Math.max(Math.round(E),1)),O[2]||(O[2]=E);var P=n.range.apply(this,O);if(P=P.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=n.scale.linear().domain(O.slice(0,2)).range("clockwise"===d.direction?[0,360]:[360,0]),f.layout.angularAxis.domain=s.domain(),f.layout.angularAxis.endPadding=L?S:0,void 0===(e=n.select(this).select("svg.chart-root"))||e.empty()){var I=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),N=this.appendChild(this.ownerDocument.importNode(I.documentElement,!0));e=n.select(N)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var R,F=e.select(".chart-group"),j={fill:"none",stroke:d.tickColor},B={"font-size":d.font.size,"font-family":d.font.family,fill:d.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+d.font.outlineColor}).join(",")};if(d.showLegend){R=e.select(".legend-group").attr({transform:"translate("+[b,d.margin.top]+")"}).style({display:"block"});var q=h.map(function(t,e){var r=l.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});l.Legend().config({data:h.map(function(t,e){return t.name||"Element"+e}),legendConfig:i({},l.Legend.defaultConfig().legendConfig,{container:R,elements:q,reverseOrder:d.legend.reverseOrder})})();var H=R.node().getBBox();b=Math.min(d.width-H.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2,b=Math.max(10,b),w=[d.margin.left+b,d.margin.top+b],a.range([0,b]),f.layout.radialAxis.domain=a.domain(),R.attr("transform","translate("+[w[0]+b,w[1]-b]+")") +t.plot=l(e,"g","plot"),t.overplot=l(e,"g","overplot"),l(e,"path","xlines-above"),l(e,"path","ylines-above"),t.overlinesAbove=l(e,"g","overlines-above"),l(e,"g","xaxislayer-above"),l(e,"g","yaxislayer-above"),t.overaxesAbove=l(e,"g","overaxes-above"),t.xlines=e.select(".xlines-"+n),t.ylines=e.select(".ylines-"+a),t.xaxislayer=e.select(".xaxislayer-"+n),t.yaxislayer=e.select(".yaxislayer-"+a)}for(var f=0;fu[1]-.01&&(e.domain=[0,1]),a.noneOrAll(t.domain,e.domain,[0,1])}return r("layer"),e}},{"../../lib":156,"fast-isnumeric":17}],211:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var a=[t.r2l(t.range[0]),t.r2l(t.range[1])],i=a[0]+(a[1]-a[0])*r;t.range=t._input.range=[t.l2r(i+(a[0]-i)*e),t.l2r(i+(a[1]-i)*e)]}},{"../../constants/alignment":138}],212:[function(t,e,r){"use strict";function n(t){return t._id}function a(t,e){if(Array.isArray(t))for(var r=e.cd[0].trace,n=0;n0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],a=t.range[1];return.5*(n+a-3*k*Math.abs(n-a))}return p}function f(e,r,n){var a=c(e,n||t.calendar);if(a===p){if(!i(e))return p;a=c(new Date(+e))}return a}function v(e,r,n){return s(e,r,n||t.calendar)}function y(e){return t._categories[Math.round(e)]}function m(e){if(null!==e&&void 0!==e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return p}function x(e){if(t._categoriesMap){var r=t._categoriesMap[e];if(void 0!==r)return r}if(i(e))return+e}function b(e){return i(e)?a.round(t._b+t._m*e,2):p}function _(e){return(e-t._b)/t._m}e=e||{};var w=(t._id||"x").charAt(0),k=10;t.c2l="log"===t.type?r:u,t.l2c="log"===t.type?n:u,t.l2p=b,t.p2l=_,t.c2p="log"===t.type?function(t,e){return b(r(t,e))}:b,t.p2c="log"===t.type?function(t){return n(_(t))}:_,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=l,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=_,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return r(l(t),e)},t.r2d=t.r2c=function(t){return n(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=u,t.c2r=r,t.l2d=n,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return n(_(t))},t.r2p=function(e){return t.l2p(l(e))},t.p2r=_,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=o.identity,t.d2c=t.r2c=t.d2l=t.r2l=f,t.c2d=t.c2r=t.l2d=t.l2r=v,t.d2p=t.r2p=function(e,r,n){return t.l2p(f(e,0,n))},t.p2d=t.p2r=function(t,e,r){return v(_(t),e,r)},t.cleanPos=function(e){return o.cleanDate(e,p,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=m,t.r2d=t.c2d=t.l2d=y,t.d2r=t.d2l_noadd=x,t.r2c=function(e){var r=x(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=x,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return y(_(t))},t.r2p=t.d2p,t.p2r=_,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e){e||(e="range");var r,n,a=o.nestedProperty(t,e).get();if(n="date"===t.type?o.dfltRange(t.calendar):"y"===w?h.DFLTRANGEY:h.DFLTRANGEX,n=n.slice(),!a||2!==a.length)return void o.nestedProperty(t,e).set(n);for("date"===t.type&&(a[0]=o.cleanDate(a[0],p,t.calendar),a[1]=o.cleanDate(a[1],p,t.calendar)),r=0;r<2;r++)if("date"===t.type){if(!o.isDateTime(a[r],t.calendar)){t[e]=n;break}if(t.r2l(a[0])===t.r2l(a[1])){var l=o.constrain(t.r2l(a[0]),o.MIN_MS+1e3,o.MAX_MS-1e3);a[0]=t.l2r(l-1e3),a[1]=t.l2r(l+1e3);break}}else{if(!i(a[r])){if(!i(a[1-r])){t[e]=n;break}a[r]=a[1-r]*(r?10:.1)}if(a[r]<-d?a[r]=-d:a[r]>d&&(a[r]=d),a[0]===a[1]){var s=Math.max(1,Math.abs(1e-6*a[0]));a[0]-=s,a[1]+=s}}},t.setScale=function(r){var n=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var a=g.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var i=r&&t._r?"_r":"range",l=t.calendar;t.cleanRange(i);var s=t.r2l(t[i][0],l),c=t.r2l(t[i][1],l);if("y"===w?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(s-c),t._b=-t._m*c):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-s),t._b=-t._m*s),!isFinite(t._m)||!isFinite(t._b))throw o.notifier("Something went wrong with axis scaling","long"),e._replotting=!1,new Error("axis scaling")},t.makeCalcdata=function(e,r){var n,a,i,o="date"===t.type&&e[r+"calendar"];if(r in e)for(n=e[r],a=new Array(n.length),i=0;i=t.range[0]&&r<=t.range[1]}:function(e){var r=e.y;return r>=t.range[0]&&r<=t.range[1]},t._min=[],t._max=[],t._separators=e.separators,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":140,"../../lib":156,"./axis_ids":199,"./constants":201,d3:14,"fast-isnumeric":17}],214:[function(t,e,r){"use strict";function n(t){var e=["showexponent","showtickprefix","showticksuffix"],r=e.filter(function(e){return void 0!==t[e]}),n=function(e){return t[e]===t[r[0]]};if(r.every(n)||1===r.length)return t[r[0]]}var a=t("../../lib");e.exports=function(t,e,r,i,o){var l=n(t);if(r("tickprefix")&&r("showtickprefix",l),r("ticksuffix")&&r("showticksuffix",l),r("showticklabels")){var s=o.font||{},c=e.color===t.color?e.color:s.color;a.coerceFont(r,"tickfont",{family:s.family,size:s.size,color:c}),r("tickangle"),"category"!==i&&(r("tickformat")||"date"===i||(r("showexponent",l),r("exponentformat"),r("separatethousands")))}"category"===i||o.noHover||r("hoverformat")}},{"../../lib":156}],215:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r,i){var o=n.coerce2(t,e,a,"ticklen"),l=n.coerce2(t,e,a,"tickwidth"),s=n.coerce2(t,e,a,"tickcolor",e.color);r("ticks",i.outerTicks||o||l||s?"outside":"")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":156,"./layout_attributes":207}],216:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").ONEDAY;e.exports=function(t,e,r,o){var l="auto";"array"!==t.tickmode||"log"!==o&&"date"!==o||(t.tickmode="auto"),Array.isArray(t.tickvals)?l="array":t.dtick&&(l="linear");var s=r("tickmode",l);if("auto"===s)r("nticks");else if("linear"===s){var c="date"===o?i:1,u=r("dtick",c);if(n(u))e.dtick=u>0?Number(u):c;else if("string"!=typeof u)e.dtick=c;else{var f=u.charAt(0),d=u.substr(1);d=n(d)?Number(d):0,(d<=0||!("date"===o&&"M"===f&&d===Math.round(d)||"log"===o&&"L"===f||"log"===o&&"D"===f&&(1===d||2===d)))&&(e.dtick=c)}var p="date"===o?a.dateTick0(e.calendar):0,h=r("tick0",p);"date"===o?e.tick0=a.cleanDate(h,p):n(h)&&"D1"!==u&&"D2"!==u?e.tick0=Number(h):e.tick0=p}else{var g=r("tickvals");void 0===g?e.tickmode="auto":r("ticktext")}}},{"../../constants/numerical":140,"../../lib":156,"fast-isnumeric":17}],217:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plotly"),i=t("../../registry"),o=t("../../components/drawing"),l=t("./axes"),s=t("./constants").attrRegex;e.exports=function(t,e,r,c){function u(e,r){function n(e,r,n){for(a=0;a rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.select(".scatterlayer").selectAll(".points");n.selectAll(".point").call(o.setPointGroupScale,1,1).call(o.hideOutsideRangePoints,t),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1).call(o.hideOutsideRangePoints,t)}function d(e,r){var n,a,i,l=m[e.xaxis._id],s=m[e.yaxis._id],c=[];if(l){n=t._fullLayout[l.axisName],a=n._r,i=l.to,c[0]=(a[0]*(1-r)+r*i[0]-a[0])/(a[1]-a[0])*e.xaxis._length;var f=a[1]-a[0],d=i[1]-i[0];n.range[0]=a[0]*(1-r)+r*i[0],n.range[1]=a[1]*(1-r)+r*i[1],c[2]=e.xaxis._length*(1-r+r*d/f)}else c[0]=0,c[2]=e.xaxis._length;if(s){n=t._fullLayout[s.axisName],a=n._r,i=s.to,c[1]=(a[1]*(1-r)+r*i[1]-a[1])/(a[0]-a[1])*e.yaxis._length;var p=a[1]-a[0],h=i[1]-i[0];n.range[0]=a[0]*(1-r)+r*i[0],n.range[1]=a[1]*(1-r)+r*i[1],c[3]=e.yaxis._length*(1-r+r*h/p)}else c[1]=0,c[3]=e.yaxis._length;u(e.xaxis,e.yaxis);var g=e.xaxis,y=e.yaxis,x=!!l,b=!!s,_=x?g._length/c[2]:1,w=b?y._length/c[3]:1,k=x?c[0]:0,M=b?c[1]:0,A=x?c[0]/c[2]*g._length:0,T=b?c[1]/c[3]*y._length:0,L=g._offset-A,C=y._offset-T;v._defs.select("#"+e.clipId+"> rect").call(o.setTranslate,k,M).call(o.setScale,1/_,1/w),e.plot.call(o.setTranslate,L,C).call(o.setScale,_,w).selectAll(".points").selectAll(".point").call(o.setPointGroupScale,1/_,1/w),e.plot.selectAll(".points").selectAll(".textpoint").call(o.setTextPointsScale,1/_,1/w)}function p(){for(var e={},r=0;rr.duration?(p(),M=window.cancelAnimationFrame(g)):M=window.requestAnimationFrame(g)}var v=t._fullLayout,y=[],m=function(t){var e,r,n,a,i={};for(e in t)if(r=e.split("."),r[0].match(s)){var o=e.charAt(0),l=r[0];if(n=v[l],a={},Array.isArray(t[e])?a.to=t[e].slice(0):Array.isArray(t[e].range)&&(a.to=t[e].range.slice(0)),!a.to)continue;a.axisName=l,a.length=n._length,y.push(o),i[o]=a}return i}(e),x=Object.keys(m),b=function(t,e,r){var n,a,i,o=t._plots,l=[];for(n in o){var s=o[n];if(-1===l.indexOf(s)){var c=s.xaxis._id,u=s.yaxis._id,f=s.xaxis.range,d=s.yaxis.range;s.xaxis._r=s.xaxis.range.slice(),s.yaxis._r=s.yaxis.range.slice(),a=r[c]?r[c].to:f,i=r[u]?r[u].to:d,f[0]===a[0]&&f[1]===a[1]&&d[0]===i[0]&&d[1]===i[1]||-1===e.indexOf(c)&&-1===e.indexOf(u)||l.push(s)}}return l}(v,x,m);if(!b.length)return function(){function e(e,r,n){for(var a=0;a0?".":"")+a;c.isPlainObject(i)?l(i,e,o,n+1):e(o,a,i)}})}var s=t("../plotly"),c=t("../lib");r.manageCommandObserver=function(t,e,a,i){var o={},l=!0;e&&e._commandObserver&&(o=e._commandObserver),o.cache||(o.cache={}),o.lookupTable={};var s=r.hasSimpleAPICommandBindings(t,a,o.lookupTable);if(e&&e._commandObserver){if(s)return o;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,o}if(s){n(t,s,o.cache),o.check=function(){if(l){var e=n(t,s,o.cache);return e.changed&&i&&void 0!==o.lookupTable[e.value]&&(o.disable(),Promise.resolve(i({value:e.value,type:s.type,prop:s.prop,traces:s.traces,index:o.lookupTable[e.value]})).then(o.enable,o.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f=e.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=e._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),c=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&n(t,o),l.text(o.text()&&c.text()?" - ":"")}},v.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=s.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return n.append("input").attr({type:"text",name:"data"}).node().value=v.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},v.supplyDefaults=function(t){var e,r=t._fullLayout||{},n=t._fullLayout={},i=t.layout||{},o=t._fullData||[],l=t._fullData=[],s=t.data||[];if(t._transitionData||v.createTransitionData(t),r._initialAutoSizeIsDone){var c=r.width,f=r.height;v.supplyLayoutGlobalDefaults(i,n),i.width||(n.width=c),i.height||(n.height=f)}else{v.supplyLayoutGlobalDefaults(i,n);var d=!i.width||!i.height,p=n.autosize,h=t._context&&t._context.autosizable;d&&(p||h)?v.plotAutoSize(t,i,n):d&&v.sanitizeMargins(t),!p&&d&&(i.width=n.width,i.height=n.height)}n._initialAutoSizeIsDone=!0,n._dataLength=s.length,n._globalTransforms=(t._context||{}).globalTransforms,v.supplyDataDefaults(s,l,i,n),n._has=v._hasPlotType.bind(n);var g=n._modules;for(e=0;e0){var u=o(t._boundingBoxMargins),f=u.left+u.right,d=u.bottom+u.top,h=1-2*l,g=r._container&&r._container.node?r._container.node().getBoundingClientRect():{width:r.width,height:r.height};n=Math.round(h*(g.width-f)),a=Math.round(h*(g.height-d))}else{var y=s?window.getComputedStyle(t):{};n=parseFloat(y.width)||r.width,a=parseFloat(y.height)||r.height}var m=v.layoutAttributes.width.min,x=v.layoutAttributes.height.min;n1,_=!e.height&&Math.abs(r.height-a)>1;(_||b)&&(b&&(r.width=n),_&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),v.sanitizeMargins(r)},v.supplyLayoutModuleDefaults=function(t,e,r,n){var a,i;u.Axes.supplyLayoutDefaults(t,e,r);var o=e._basePlotModules;for(a=0;a.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+a},r:{val:r.x,size:r.r+a},b:{val:r.y,size:r.b+a},t:{val:r.y,size:r.t+a}}}else delete n._pushmargin[e];n._replotting||v.doAutoMargin(t)}},v.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),a=Math.max(e.margin.l||0,0),i=Math.max(e.margin.r||0,0),o=Math.max(e.margin.t||0,0),l=Math.max(e.margin.b||0,0),s=e._pushmargin;if(!1!==e.margin.autoexpand){s.base={l:{val:0,size:a},r:{val:1,size:i},t:{val:1,size:o},b:{val:0,size:l}};for(var f=Object.keys(s),d=0;dv){var M=(y*w+(k-e.width)*v)/(w-v),A=(k*(1-v)+(y-e.width)*(1-w))/(w-v);M>=0&&A>=0&&M+A>a+i&&(a=M,i=A)}}if(c(x)&&s[_].t){var T=s[_].t.val,L=s[_].t.size;if(T>m){var C=(x*T+(L-e.height)*m)/(T-m),z=(L*(1-m)+(x-e.height)*(1-T))/(T-m);C>=0&&z>=0&&C+z>l+o&&(l=C,o=z)}}}}if(r.l=Math.round(a),r.r=Math.round(i),r.t=Math.round(o),r.b=Math.round(l),r.p=Math.round(e.margin.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,!e._replotting&&"{}"!==n&&n!==JSON.stringify(e._size))return u.plot(t)},v.graphJson=function(t,e,r,n,a){function i(t){if("function"==typeof t)return null;if(p.isPlainObject(t)){var e,n,a={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0&&!p.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;a[e]=i(t[e])}return a}return Array.isArray(t)?t.map(i):p.isJSDate(t)?p.ms2DateTimeLocal(+t):t}(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&v.supplyDefaults(t);var o=a?t._fullData:t.data,l=a?t._fullLayout:t.layout,s=(t._transitionData||{})._frames,c={data:(o||[]).map(function(t){var r=i(t);return e&&delete r.fit,r})};return e||(c.layout=i(l)),t.framework&&t.framework.isPolar&&(c=t.framework.getConfig()),s&&(c.frames=i(s)),"object"===n?c:JSON.stringify(c)},v.modifyFrames=function(t,e){var r,n,a,i=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){b=!0}),a.redraw&&t._transitionData._interruptCallbacks.push(function(){return u.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var o,l,s=0,c=0,d=t._fullLayout._basePlotModules,h=!1;if(r)for(l=0;l=0,z=C?d.angularAxis.domain:n.extent(M),S=Math.abs(M[1]-M[0]);T&&!A&&(S=0);var O=z.slice();L&&A&&(O[1]+=S);var D=d.angularAxis.ticksCount||4;D>8&&(D=D/(D/8)+D%8),d.angularAxis.ticksStep&&(D=(O[1]-O[0])/D);var E=d.angularAxis.ticksStep||(O[1]-O[0])/(D*(d.minorTicks+1));k&&(E=Math.max(Math.round(E),1)),O[2]||(O[2]=E);var P=n.range.apply(this,O);if(P=P.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=n.scale.linear().domain(O.slice(0,2)).range("clockwise"===d.direction?[0,360]:[360,0]),f.layout.angularAxis.domain=s.domain(),f.layout.angularAxis.endPadding=L?S:0,void 0===(e=n.select(this).select("svg.chart-root"))||e.empty()){var I=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),N=this.appendChild(this.ownerDocument.importNode(I.documentElement,!0));e=n.select(N)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var R,F=e.select(".chart-group"),j={fill:"none",stroke:d.tickColor},B={"font-size":d.font.size,"font-family":d.font.family,fill:d.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+d.font.outlineColor}).join(",")};if(d.showLegend){R=e.select(".legend-group").attr({transform:"translate("+[b,d.margin.top]+")"}).style({display:"block"});var q=h.map(function(t,e){var r=l.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});l.Legend().config({data:h.map(function(t,e){return t.name||"Element"+e}),legendConfig:i({},l.Legend.defaultConfig().legendConfig,{container:R,elements:q,reverseOrder:d.legend.reverseOrder})})();var H=R.node().getBBox();b=Math.min(d.width-H.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2,b=Math.max(10,b),w=[d.margin.left+b,d.margin.top+b],a.range([0,b]),f.layout.radialAxis.domain=a.domain(),R.attr("transform","translate("+[w[0]+b,w[1]-b]+")") }else R=e.select(".legend-group").style({display:"none"});e.attr({width:d.width,height:d.height}).style({opacity:d.opacity}),F.attr("transform","translate("+w+")").style({cursor:"crosshair"});var V=[(d.width-(d.margin.left+d.margin.right+2*b+(H?H.width:0)))/2,(d.height-(d.margin.top+d.margin.bottom+2*b))/2];if(V[0]=Math.max(0,V[0]),V[1]=Math.max(0,V[1]),e.select(".outer-group").attr("transform","translate("+V+")"),d.title){var U=e.select("g.title-group text").style(B).text(d.title),G=U.node().getBBox();U.attr({x:w[0]-G.width/2,y:w[1]-b-20})}var Z=e.select(".radial.axis-group");if(d.radialAxis.gridLinesVisible){var X=Z.selectAll("circle.grid-circle").data(a.ticks(5));X.enter().append("circle").attr({class:"grid-circle"}).style(j),X.attr("r",a),X.exit().remove()}Z.select("circle.outside-circle").attr({r:b}).style(j);var Y=e.select("circle.background-circle").attr({r:b}).style({fill:d.backgroundColor,stroke:d.stroke});if(d.radialAxis.visible){var W=n.svg.axis().scale(a).ticks(5).tickSize(5);Z.call(W).attr({transform:"rotate("+d.radialAxis.orientation+")"}),Z.selectAll(".domain").style(j),Z.selectAll("g>text").text(function(t,e){return this.textContent+d.radialAxis.ticksSuffix}).style(B).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===d.radialAxis.tickOrientation?"rotate("+-d.radialAxis.orientation+") translate("+[0,B["font-size"]]+")":"translate("+[0,B["font-size"]]+")"}}),Z.selectAll("g>line").style({stroke:"black"})}var Q=e.select(".angular.axis-group").selectAll("g.angular-tick").data(P),$=Q.enter().append("g").classed("angular-tick",!0);Q.attr({transform:function(t,e){return"rotate("+c(t,e)+")"}}).style({display:d.angularAxis.visible?"block":"none"}),Q.exit().remove(),$.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(d.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(d.minorTicks+1)==0)}).style(j),$.selectAll(".minor").style({stroke:d.minorTickColor}),Q.select("line.grid-line").attr({x1:d.tickLength?b-d.tickLength:0,x2:b}).style({display:d.angularAxis.gridLinesVisible?"block":"none"}),$.append("text").classed("axis-text",!0).style(B);var J=Q.select("text.axis-text").attr({x:b+d.labelOffset,dy:o+"em",transform:function(t,e){var r=c(t,e),n=b+d.labelOffset,a=d.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-r+" "+n+" 0)":"radial"==a?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:d.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(d.minorTicks+1)!=0?"":k?k[t]+d.angularAxis.ticksSuffix:t+d.angularAxis.ticksSuffix}).style(B);d.angularAxis.rewriteTicks&&J.text(function(t,e){return e%(d.minorTicks+1)!=0?"":d.angularAxis.rewriteTicks(this.textContent,e)});var K=n.max(F.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));R.attr({transform:"translate("+[b+K,d.margin.top]+")"});var tt=e.select("g.geometry-group").selectAll("g").size()>0,et=e.select("g.geometry-group").selectAll("g.geometry").data(h);if(et.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),et.exit().remove(),h[0]||tt){var rt=[];h.forEach(function(t,e){var r={};r.radialScale=a,r.angularScale=s,r.container=et.filter(function(t,r){return r==e}),r.geometry=t.geometry,r.orientation=d.orientation,r.direction=d.direction,r.index=e,rt.push({data:t,geometryConfig:r})});var nt=n.nest().key(function(t,e){return void 0!==t.data.groupId||"unstacked"}).entries(rt),at=[];nt.forEach(function(t,e){"unstacked"===t.key?at=at.concat(t.values.map(function(t,e){return[t]})):at.push(t.values)}),at.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return i(l[r].defaultConfig(),t)});l[r]().config(n)()})}var it,ot,lt=e.select(".guides-group"),st=e.select(".tooltips-group"),ct=l.tooltipPanel().config({container:st,fontSize:8})(),ut=l.tooltipPanel().config({container:st,fontSize:8})(),ft=l.tooltipPanel().config({container:st,hasTick:!0})();if(!A){var dt=lt.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});F.on("mousemove.angular-guide",function(t,e){var r=l.util.getMousePos(Y).angle;dt.attr({x2:-b,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-d.orientation)%360;it=s.invert(n);var a=l.util.convertToCartesian(b+12,r+180);ct.text(l.util.round(it)).move([a[0]+w[0],a[1]+w[1]])}).on("mouseout.angular-guide",function(t,e){lt.select("line").style({opacity:0})})}var pt=lt.select("circle").style({stroke:"grey",fill:"none"});F.on("mousemove.radial-guide",function(t,e){var r=l.util.getMousePos(Y).radius;pt.attr({r:r}).style({opacity:.5}),ot=a.invert(l.util.getMousePos(Y).radius);var n=l.util.convertToCartesian(r,d.radialAxis.orientation);ut.text(l.util.round(ot)).move([n[0]+w[0],n[1]+w[1]])}).on("mouseout.radial-guide",function(t,e){pt.style({opacity:0}),ft.hide(),ct.hide(),ut.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,r){var a=n.select(this),i=this.style.fill,o="black",s=this.style.opacity||1;if(a.attr({"data-opacity":s}),i&&"none"!==i){a.attr({"data-fill":i}),o=n.hsl(i).darker().toString(),a.style({fill:o,opacity:1});var c={t:l.util.round(t[0]),r:l.util.round(t[1])};A&&(c.t=k[t[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),d=e.node().getBoundingClientRect(),p=[f.left+f.width/2-V[0]-d.left,f.top+f.height/2-V[1]-d.top];ft.config({color:o}).text(u),ft.move(p)}else i=this.style.stroke||"black",a.attr({"data-stroke":i}),o=n.hsl(i).darker().toString(),a.style({stroke:o,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ft.show()}).on("mouseout.tooltip",function(t,e){ft.hide();var r=n.select(this),a=r.attr("data-fill");a?r.style({fill:a,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})}),p}var e,r,a,s,c={data:[],layout:{}},u={},f={},d=n.dispatch("hover"),p={};return p.render=function(e){return t(e),this},p.config=function(t){if(!arguments.length)return c;var e=l.util.cloneJson(t);return e.data.forEach(function(t,e){c.data[e]||(c.data[e]={}),i(c.data[e],l.Axis.defaultConfig().data[0]),i(c.data[e],t)}),i(c.layout,l.Axis.defaultConfig().layout),i(c.layout,e.layout),this},p.getLiveConfig=function(){return f},p.getinputConfig=function(){return u},p.radialScale=function(t){return a},p.angularScale=function(t){return s},p.svg=function(){return e},n.rebind(p,d,"on"),p},l.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},l.util={},l.DATAEXTENT="dataExtent",l.AREA="AreaChart",l.LINE="LinePlot",l.DOT="DotPlot",l.BAR="BarChart",l.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},l.util._extend=function(t,e){for(var r in t)e[r]=t[r]},l.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},l.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180;return[e,t(n)]})},l.util.dataFromEquation=function(t,e,r){var a=e||6,i=[],o=[];n.range(0,360+a,a).forEach(function(e,r){var n=e*Math.PI/180,a=t(n);i.push(e),o.push(a)});var l={t:i,r:o};return r&&(l.name=r),l},l.util.ensureArray=function(t,e){if(void 0===t)return null;var r=[].concat(t);return n.range(e).map(function(t,e){return r[e]||r[0]})},l.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=l.util.ensureArray(t[e],r)}),t},l.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},l.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},l.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},l.util.arrayLast=function(t){return t[t.length-1]},l.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},l.util.flattenArray=function(t){for(var e=[];!l.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},l.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},l.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},l.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},l.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],a=e[1],i={};return i.x=r,i.y=a,i.pos=e,i.angle=180*(Math.atan2(a,r)+Math.PI)/Math.PI,i.radius=Math.sqrt(r*r+a*a),i},l.util.duplicatesCount=function(t){for(var e,r={},n={},a=0,i=t.length;a0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:d(o),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return v.fill(r,a,i)},"fill-opacity":0,stroke:function(t,e){return v.stroke(r,a,i)},"stroke-width":function(t,e){return v["stroke-width"](r,a,i)},"stroke-dasharray":function(t,e){return v["stroke-dasharray"](r,a,i)},opacity:function(t,e){return v.opacity(r,a,i)},display:function(t,e){return v.display(r,a,i)}})}};var p=t.angularScale.range(),h=Math.abs(p[1]-p[0])/s[0].length*Math.PI/180,g=n.svg.arc().startAngle(function(t){return-h/2}).endAngle(function(t){return h/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 v={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 a[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return void 0===e[n].data.visible||e[n].data.visible?"block":"none"}},y=n.select(this).selectAll("g.layer").data(s);y.enter().append("g").attr({class:"layer"});var m=y.selectAll("path.mark").data(function(t,e){return t});m.enter().append("path").attr({class:"mark"}),m.style(v).each(f[t.geometryType]),m.exit().remove(),y.exit().remove()})}var e=[l.PolyChart.defaultConfig()],r=n.dispatch("hover"),a={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,r){e[r]||(e[r]={}),i(e[r],l.PolyChart.defaultConfig()),i(e[r],t)}),this):e},t.getColorScale=function(){},n.rebind(t,r,"on"),t},l.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},l.BarChart=function(){return l.PolyChart()},l.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},l.AreaChart=function(){return l.PolyChart()},l.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},l.DotPlot=function(){return l.PolyChart()},l.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},l.LinePlot=function(){return l.PolyChart()},l.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},l.Legend=function(){function t(){var r=e.legendConfig,a=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var a=i({},r.elements[e]);return a.name=t,a.color=[].concat(r.elements[e].color)[n],a})}),o=n.merge(a);o=o.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||void 0===r.elements[e].visibleInLegend)}),r.reverseOrder&&(o=o.reverse());var l=r.container;("string"==typeof l||l.nodeName)&&(l=n.select(l));var s=o.map(function(t,e){return t.color}),c=r.fontSize,u=null==r.isContinuous?"number"==typeof o[0]:r.isContinuous,f=u?r.height:c*o.length,d=l.classed("legend-group",!0),p=d.selectAll("svg").data([0]),h=p.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"});h.append("g").classed("legend-axis",!0),h.append("g").classed("legend-marks",!0);var g=n.range(o.length),v=n.scale[u?"linear":"ordinal"]().domain(g).range(s),y=n.scale[u?"linear":"ordinal"]().domain(g)[u?"range":"rangePoints"]([0,f]),m=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":-1!=n.svg.symbolTypes.indexOf(t)?n.svg.symbol().type(t).size(r)():n.svg.symbol().type("square").size(r)()};if(u){var x=p.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}}),p.append("rect").classed("legend-mark",!0).attr({height:r.height,width:r.colorBandWidth,fill:"url(#grad1)"})}else{var b=p.select(".legend-marks").selectAll("path.legend-mark").data(o);b.enter().append("path").classed("legend-mark",!0),b.attr({transform:function(t,e){return"translate("+[c/2,y(e)+c/2]+")"},d:function(t,e){var r=t.symbol;return m(r,c)},fill:function(t,e){return v(e)}}),b.exit().remove()}var _=n.svg.axis().scale(y).orient("right"),w=p.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 o[e].name}),t}var e=l.Legend.defaultConfig(),r=n.dispatch("hover");return t.config=function(t){return arguments.length?(i(e,t),this):e},n.rebind(t,r,"on"),t},l.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},l.tooltipPanel=function(){var t,e,r,a={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},o="tooltip-"+l.tooltipPanel.uid++,s=function(){t=a.container.selectAll("g."+o).data([0]);var n=t.enter().append("g").classed(o,!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+10,dy:.3*+a.fontSize}),s};return s.text=function(i){var o=n.hsl(a.color).l,l=o>=.5?"#aaa":"white",c=o>=.5?"black":"white",u=i||"";e.style({fill:c,"font-size":a.fontSize+"px"}).text(u);var f=a.padding,d=e.node().getBBox(),p={fill:a.color,stroke:l,"stroke-width":"2px"},h=d.width+2*f+10,g=d.height+2*f;return r.attr({d:"M"+[[10,-g/2],[10,-g/4],[a.hasTick?0:10,0],[10,g/4],[10,g/2],[h,g/2],[h,-g/2]].join("L")+"Z"}).style(p),t.attr({transform:"translate("+[10,-g/2+2*f]+")"}),t.style({display:"block"}),s},s.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),s},s.hide=function(){if(t)return t.style({display:"none"}),s},s.show=function(){if(t)return t.style({display:"block"}),s},s.config=function(t){return i(a,t),s},s},l.tooltipPanel.uid=1,l.adapter={},l.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=i({},t);return[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]].forEach(function(t,r){l.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var a=l.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=a.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)})}if(t.layout){var o=i({},t.layout);if([[o,["plot_bgcolor"],["backgroundColor"]],[o,["showlegend"],["showLegend"]],[o,["radialaxis"],["radialAxis"]],[o,["angularaxis"],["angularAxis"]],[o.angularaxis,["showline"],["gridLinesVisible"]],[o.angularaxis,["showticklabels"],["labelsVisible"]],[o.angularaxis,["nticks"],["ticksCount"]],[o.angularaxis,["tickorientation"],["tickOrientation"]],[o.angularaxis,["ticksuffix"],["ticksSuffix"]],[o.angularaxis,["range"],["domain"]],[o.angularaxis,["endpadding"],["endPadding"]],[o.radialaxis,["showline"],["gridLinesVisible"]],[o.radialaxis,["tickorientation"],["tickOrientation"]],[o.radialaxis,["ticksuffix"],["ticksSuffix"]],[o.radialaxis,["range"],["domain"]],[o.angularAxis,["showline"],["gridLinesVisible"]],[o.angularAxis,["showticklabels"],["labelsVisible"]],[o.angularAxis,["nticks"],["ticksCount"]],[o.angularAxis,["tickorientation"],["tickOrientation"]],[o.angularAxis,["ticksuffix"],["ticksSuffix"]],[o.angularAxis,["range"],["domain"]],[o.angularAxis,["endpadding"],["endPadding"]],[o.radialAxis,["showline"],["gridLinesVisible"]],[o.radialAxis,["tickorientation"],["tickOrientation"]],[o.radialAxis,["ticksuffix"],["ticksSuffix"]],[o.radialAxis,["range"],["domain"]],[o.font,["outlinecolor"],["outlineColor"]],[o.legend,["traceorder"],["reverseOrder"]],[o,["labeloffset"],["labelOffset"]],[o,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(t,r){l.util.translator.apply(null,t.concat(e))}),e?(void 0!==o.tickLength&&(o.angularaxis.ticklen=o.tickLength,delete o.tickLength),o.tickColor&&(o.angularaxis.tickcolor=o.tickColor,delete o.tickColor)):(o.angularAxis&&void 0!==o.angularAxis.ticklen&&(o.tickLength=o.angularAxis.ticklen),o.angularAxis&&void 0!==o.angularAxis.tickcolor&&(o.tickColor=o.angularAxis.tickcolor)),o.legend&&"boolean"!=typeof o.legend.reverseOrder&&(o.legend.reverseOrder="normal"!=o.legend.reverseOrder),o.legend&&"boolean"==typeof o.legend.traceorder&&(o.legend.traceorder=o.legend.traceorder?"reversed":"normal",delete o.legend.reverseOrder),o.margin&&void 0!==o.margin.t){var s=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(o.margin).forEach(function(t,e){u[c[s.indexOf(t.key)]]=t.value}),o.margin=u}e&&(delete o.needsEndSpacing,delete o.minorTickColor,delete o.minorTicks,delete o.angularaxis.ticksCount,delete o.angularaxis.ticksCount,delete o.angularaxis.ticksStep,delete o.angularaxis.rewriteTicks,delete o.angularaxis.nticks,delete o.radialaxis.ticksCount,delete o.radialaxis.ticksCount,delete o.radialaxis.ticksStep,delete o.radialaxis.rewriteTicks,delete o.radialaxis.nticks),r.layout=o}return r},t}},{"../../constants/alignment":138,"../../lib":156,d3:14}],230:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../components/color"),o=t("./micropolar"),l=t("./undo_manager"),s=a.extendDeepAll,c=e.exports={};c.framework=function(t){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,i||(i=o.Axis()),u=o.adapter.plotly().convert(r),i.config(u).render(f),t.data=r.data,t.layout=r.layout,c.fillLayout(t),r}var r,a,i,u,f,d=new l;return e.isPolar=!0,e.svg=function(){return i.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return o.adapter.plotly().convert(i.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:i.angularScale(),r:i.radialScale()}},e.setUndoPoint=function(){var t=this,e=o.util.cloneJson(r);!function(e,r){d.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,a),a=o.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(),o={width:800,height:600,paper_bgcolor:i.background,_container:e,_paperdiv:r,_paper:a};t._fullLayout=s(o,t.layout)}},{"../../components/color":41,"../../lib":156,"./micropolar":229,"./undo_manager":231,d3:14}],231:[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-1!==n},hasRedo:function(){return n=o&&(p.min=0,h.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"),i=t("../../subplot_defaults"),o=t("./layout_attributes"),l=t("./axis_defaults"),s=["aaxis","baxis","caxis"];e.exports=function(t,e,r){i(t,e,r,{type:"ternary",attributes:o,handleDefaults:n,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../../components/color":41,"../../subplot_defaults":232,"./axis_defaults":236,"./layout_attributes":238}],238:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),a=t("./axis_attributes"),i=t("../../../plot_api/edit_types").overrideAll;e.exports=i({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},"plot","from-root")},{"../../../components/color/attributes":40,"../../../plot_api/edit_types":180,"./axis_attributes":235}],239:[function(t,e,r){"use strict";function n(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework(e)}function a(t){i.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}var i=t("d3"),o=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,p=t("../plots"),h=t("../cartesian/axes"),g=t("../../components/dragelement"),v=t("../../components/fx"),y=t("../../components/titles"),m=t("../cartesian/select"),x=t("../cartesian/constants");e.exports=n;var b=n.prototype;b.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},b.plot=function(t,e){var r=this,n=e[r.id],a=e._size;r._hasClipOnAxisFalse=!1;for(var i=0;i_*x?(i=x,a=i*_):(a=m,i=a/_),o=v*a/m,l=y*i/x,r=e.l+e.w*h-a/2,n=e.t+e.h*(1-g)-i/2,s.x0=r,s.y0=n,s.w=a,s.h=i,s.sum=b,s.xaxis={type:"linear",range:[w+2*M-b,b-w-2*k],domain:[h-o/2,h+o/2],_id:"x"},f(s.xaxis,s.graphDiv._fullLayout),s.xaxis.setScale(),s.xaxis.isPtWithinRange=function(t){return t.a>=s.aaxis.range[0]&&t.a<=s.aaxis.range[1]&&t.b>=s.baxis.range[1]&&t.b<=s.baxis.range[0]&&t.c>=s.caxis.range[1]&&t.c<=s.caxis.range[0]},s.yaxis={type:"linear",range:[w,b-k-M],domain:[g-l/2,g+l/2],_id:"y"},f(s.yaxis,s.graphDiv._fullLayout),s.yaxis.setScale(),s.yaxis.isPtWithinRange=function(){return!0};var A=s.yaxis.domain[0],T=s.aaxis=d({},t.aaxis,{visible:!0,range:[w,b-k-M],side:"left",_counterangle:30,tickangle:(+t.aaxis.tickangle||0)-30,domain:[A,A+l*_],_axislayer:s.layers.aaxis,_gridlayer:s.layers.agrid,_pos:0,_id:"y",_length:a,_gridpath:"M0,0l"+i+",-"+a/2});f(T,s.graphDiv._fullLayout),T.setScale();var L=s.baxis=d({},t.baxis,{visible:!0,range:[b-w-M,k],side:"bottom",_counterangle:30,domain:s.xaxis.domain,_axislayer:s.layers.baxis,_gridlayer:s.layers.bgrid,_counteraxis:s.aaxis,_pos:0,_id:"x",_length:a,_gridpath:"M0,0l-"+a/2+",-"+i});f(L,s.graphDiv._fullLayout),L.setScale(),T._counteraxis=L;var C=s.caxis=d({},t.caxis,{visible:!0,range:[b-w-k,M],side:"right",_counterangle:30,tickangle:(+t.caxis.tickangle||0)+30,domain:[A,A+l*_],_axislayer:s.layers.caxis,_gridlayer:s.layers.cgrid,_counteraxis:s.baxis,_pos:0,_id:"y",_length:a,_gridpath:"M0,0l-"+i+","+a/2});f(C,s.graphDiv._fullLayout),C.setScale();var z="M"+r+","+(n+i)+"h"+a+"l-"+a/2+",-"+i+"Z";s.clipDef.select("path").attr("d",z),s.layers.plotbg.select("path").attr("d",z);var S="M0,"+i+"h"+a+"l-"+a/2+",-"+i+"Z";s.clipDefRelative.select("path").attr("d",S);var O="translate("+r+","+n+")";s.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",O),s.clipDefRelative.select("path").attr("transform",null);var D="translate("+r+","+(n+i)+")";s.layers.baxis.attr("transform",D),s.layers.bgrid.attr("transform",D);var E="translate("+(r+a/2)+","+n+")rotate(30)";s.layers.aaxis.attr("transform",E),s.layers.agrid.attr("transform",E);var P="translate("+(r+a/2)+","+n+")rotate(-30)";s.layers.caxis.attr("transform",P),s.layers.cgrid.attr("transform",P),s.drawAxes(!0),s.plotContainer.selectAll(".crisp").classed("crisp",!1),s.layers.aline.select("path").attr("d",T.showline?"M"+r+","+(n+i)+"l"+a/2+",-"+i:"M0,0").call(c.stroke,T.linecolor||"#000").style("stroke-width",(T.linewidth||0)+"px"),s.layers.bline.select("path").attr("d",L.showline?"M"+r+","+(n+i)+"h"+a:"M0,0").call(c.stroke,L.linecolor||"#000").style("stroke-width",(L.linewidth||0)+"px"),s.layers.cline.select("path").attr("d",C.showline?"M"+(r+a/2)+","+n+"l"+a/2+","+i:"M0,0").call(c.stroke,C.linecolor||"#000").style("stroke-width",(C.linewidth||0)+"px"),s.graphDiv._context.staticPlot||s.initInteractions(),u.setClipUrl(s.layers.frontplot,s._hasClipOnAxisFalse?null:s.clipId)},b.drawAxes=function(t){var e=this,r=e.graphDiv,n=e.id.substr(7)+"title",a=e.aaxis,i=e.baxis,o=e.caxis;if(h.doTicks(r,a,!0),h.doTicks(r,i,!0),h.doTicks(r,o,!0),t){var l=Math.max(a.showticklabels?a.tickfont.size/2:0,(o.showticklabels?.75*o.tickfont.size:0)+("outside"===o.ticks?.87*o.ticklen:0));y.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=(i.showticklabels?i.tickfont.size:0)+("outside"===i.ticks?i.ticklen:0)+3;y.draw(r,"b"+n,{propContainer:i,propName:e.id+".baxis.title",dfltName:"Component B",attributes:{x:e.x0-s,y:e.y0+e.h+.83*i.titlefont.size+s,"text-anchor":"middle"}}),y.draw(r,"c"+n,{propContainer:o,propName:e.id+".caxis.title",dfltName:"Component C",attributes:{x:e.x0+e.w+s,y:e.y0+e.h+.83*o.titlefont.size+s,"text-anchor":"middle"}})}};var w=x.MINZOOM/2+.87,k="m-0.87,.5h"+w+"v3h-"+(w+5.2)+"l"+(w/2+2.6)+",-"+(.87*w+4.5)+"l2.6,1.5l-"+w/2+","+.87*w+"Z",M="m0.87,.5h-"+w+"v3h"+(w+5.2)+"l-"+(w/2+2.6)+",-"+(.87*w+4.5)+"l-2.6,1.5l"+w/2+","+.87*w+"Z",A="m0,1l"+w/2+","+.87*w+"l2.6,-1.5l-"+(w/2+2.6)+",-"+(.87*w+4.5)+"l-"+(w/2+2.6)+","+(.87*w+4.5)+"l2.6,1.5l"+w/2+",-"+.87*w+"Z",T=!0;b.initInteractions=function(){function t(t,e,r){var n=R.getBoundingClientRect();w=e-n.left,L=r-n.top,C={a:N.aaxis.range[0],b:N.baxis.range[1],c:N.caxis.range[1]},S=C,z=N.aaxis.range[1]-C.a,O=o(N.graphDiv._fullLayout[N.id].bgcolor).getLuminance(),D="M0,"+N.h+"L"+N.w/2+", 0L"+N.w+","+N.h+"Z",E=!1,P=j.append("path").attr("class","zoombox").attr("transform","translate("+N.x0+", "+N.y0+")").style({fill:O>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",D),I=j.append("path").attr("class","zoombox-corners").attr("transform","translate("+N.x0+", "+N.y0+")").style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),y()}function e(t,e){return 1-e/N.h}function r(t,e){return 1-(t+(N.h-e)/Math.sqrt(3))/N.w}function n(t,e){return(t-(N.h-e)/Math.sqrt(3))/N.w}function i(t,a){var i=w+t,o=L+a,l=Math.max(0,Math.min(1,e(w,L),e(i,o))),s=Math.max(0,Math.min(1,r(w,L),r(i,o))),c=Math.max(0,Math.min(1,n(w,L),n(i,o))),u=(l/2+c)*N.w,f=(1-l/2-s)*N.w,d=(u+f)/2,p=f-u,h=(1-l)*N.h,g=h-p/_;p.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),I.transition().style("opacity",1).duration(200),E=!0)}function f(t,e){if(S===C)return 2===e&&b(),a(F);a(F);var r={};r[N.id+".aaxis.min"]=S.a,r[N.id+".baxis.min"]=S.b,r[N.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 d(){C={a:N.aaxis.range[0],b:N.baxis.range[1],c:N.caxis.range[1]},S=C}function p(t,e){var r=t/N.xaxis._m,n=e/N.yaxis._m;S={a:C.a-n,b:C.b+(r+n)/2,c:C.c-(r-n)/2};var a=[S.a,S.b,S.c].sort(),i={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[i.a],b:a[i.b],c:a[i.c]},e=(C.a-S.a)*N.yaxis._m,t=(C.c-S.c-C.b+S.b)*N.xaxis._m);var o="translate("+(N.x0+t)+","+(N.y0+e)+")";N.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",o);var l="translate("+-t+","+-e+")";if(N.clipDefRelative.select("path").attr("transform",l),N.aaxis.range=[S.a,N.sum-S.b-S.c],N.baxis.range=[N.sum-S.a-S.c,S.b],N.caxis.range=[N.sum-S.a-S.b,S.c],N.drawAxes(!1),N.plotContainer.selectAll(".crisp").classed("crisp",!1),N._hasClipOnAxisFalse){var s=N.plotContainer.select(".scatterlayer").selectAll(".points");s.selectAll(".point").call(u.hideOutsideRangePoints,N),s.selectAll(".textpoint").call(u.hideOutsideRangePoints,N)}}function h(t,e){if(t){var r={};r[N.id+".aaxis.min"]=S.a,r[N.id+".baxis.min"]=S.b,r[N.id+".caxis.min"]=S.c,l.relayout(F,r)}else 2===e&&b()}function y(){j.selectAll(".select-outline").remove()}function b(){var t={};t[N.id+".aaxis.min"]=0,t[N.id+".baxis.min"]=0,t[N.id+".caxis.min"]=0,F.emit("plotly_doubleclick",null),l.relayout(F,t)}var w,L,C,z,S,O,D,E,P,I,N=this,R=N.layers.plotbg.select("path").node(),F=N.graphDiv,j=F._fullLayout._zoomlayer,B={element:R,gd:F,plotinfo:{xaxis:N.xaxis,yaxis:N.yaxis},doubleclick:b,subplot:N.id,prepFn:function(e,r,n){B.xaxes=[N.xaxis],B.yaxes=[N.yaxis];var a=F._fullLayout.dragmode;e.shiftKey&&(a="pan"===a?"zoom":"pan"),B.minDrag="lasso"===a?1:void 0,"zoom"===a?(B.moveFn=i,B.doneFn=f,t(e,r,n)):"pan"===a?(B.moveFn=p,B.doneFn=h,d(),y()):"select"!==a&&"lasso"!==a||m(e,r,n,B,a)}};R.onmousemove=function(t){v.hover(F,t,N.id),F._fullLayout._lasthover=R,F._fullLayout._hoversubplot=N.id},R.onmouseout=function(t){F._dragging||g.unhover(F,t)},R.onclick=function(t){v.click(F,t,N.id)},g.init(B)}},{"../../components/color":41,"../../components/dragelement":62,"../../components/drawing":65,"../../components/fx":82,"../../components/titles":131,"../../lib":156,"../../lib/extend":150,"../../plotly":191,"../cartesian/axes":196,"../cartesian/constants":201,"../cartesian/select":212,"../cartesian/set_convert":213,"../plots":225,d3:14,tinycolor2:23}],240:[function(t,e,r){"use strict";function n(t){if(t.layoutAttributes){var e=t.layoutAttributes._arrayAttrRegexps;if(e)for(var n=0;n-1}var i=t("../lib"),o=t("../plots/plots"),l=i.extendFlat,s=i.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,i=t.data,c=t.layout,u=s([],i),f=s({},c,n(e.tileClass)),d=t._context||{};if(e.width&&(f.width=e.width),e.height&&(f.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){f.annotations=[];var p=Object.keys(f);for(r=0;r")?"":e.html(t).text()});return e.remove(),r}function a(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}var i=t("d3"),o=t("../lib"),l=t("../components/drawing"),s=t("../components/color"),c=t("../constants/xmlns_namespaces"),u=/"/g,f=new RegExp('("TOBESTRIPPED)|(TOBESTRIPPED")',"g");e.exports=function(t,e,r){var d,p=t._fullLayout,h=p._paper,g=p._toppaper,v=p.width,y=p.height;h.insert("rect",":first-child").call(l.setRect,0,0,v,y).call(s.fill,p.paper_bgcolor);var m=p._basePlotModules||[];for(d=0;d0&&A>0,j=k<=N&&A<=R,B=k<=R&&A<=N,q="h"===y?N>=k*(R/A):R>=A*(N/k);F&&(j||B||q)?x="inside":(x="outside",b.remove(),b=null)}else x="inside";if(!b&&(b=g(e,m,"outside"===x?C:L),_=M.bBox(b.node()),k=_.width,A=_.height,k<=0||A<=0))return void b.remove();var H,V;"outside"===x?(V="both"===v.constraintext||"outside"===v.constraintext,H=i(o,d,p,h,_,y,V)):(V="both"===v.constraintext||"inside"===v.constraintext,H=a(o,d,p,h,_,y,V)),b.attr("transform",H)}}}function a(t,e,r,n,a,i,l){var s,c,u,f,d,p=a.width,h=a.height,g=(a.left+a.right)/2,v=(a.top+a.bottom)/2,y=Math.abs(e-t),m=Math.abs(n-r);y>2*D&&m>2*D?(d=D,y-=2*d,m-=2*d):d=0;var x,b;return p<=y&&h<=m?(x=!1,b=1):p<=m&&h<=y?(x=!0,b=1):pr?(u=(t+e)/2,f=n-d-c/2):(u=(t+e)/2,f=n+d+c/2),o(g,v,u,f,b,x)}function i(t,e,r,n,a,i,l){var s,c="h"===i?Math.abs(n-r):Math.abs(e-t);c>2*D&&(s=D);var u=1;l&&(u="h"===i?Math.min(1,c/a.height):Math.min(1,c/a.width));var f,d,p,h,g=(a.left+a.right)/2,v=(a.top+a.bottom)/2;return f=u*a.width,d=u*a.height,"h"===i?er?(p=(t+e)/2,h=n+s+d/2):(p=(t+e)/2,h=n-s-d/2),o(g,v,p,h,u,!1)}function o(t,e,r,n,a,i){var o,l;return a<1?o="scale("+a+") ":(a=1,o=""),l=i?"rotate("+i+" "+t+" "+e+") ":"","translate("+(r-a*t)+" "+(n-a*e)+")"+o+l}function l(t,e){var r=p(t.text,e);return h(L,r)}function s(t,e){var r=p(t.textposition,e);return g(C,r)}function c(t,e,r){return d(z,t.textfont,e,r)}function u(t,e,r){return d(S,t.insidetextfont,e,r)}function f(t,e,r){return d(O,t.outsidetextfont,e,r)}function d(t,e,r,n){e=e||{};var a=p(e.family,r),i=p(e.size,r),o=p(e.color,r);return{family:h(t.family,a,n.family),size:v(t.size,i,n.size),color:y(t.color,o,n.color)}}function p(t,e){var r;return Array.isArray(t)?ea))return e}return void 0!==r?r:t.dflt}function y(t,e,r){return b(e).isValid()?e:void 0!==r?r:t.dflt}var m=t("d3"),x=t("fast-isnumeric"),b=t("tinycolor2"),_=t("../../lib"),w=t("../../lib/svg_text_utils"),k=t("../../components/color"),M=t("../../components/drawing"),A=t("../../components/errorbars"),T=t("./attributes"),L=T.text,C=T.textposition,z=T.textfont,S=T.insidetextfont,O=T.outsidetextfont,D=3;e.exports=function(t,e,r){var a=e.xaxis,i=e.yaxis,o=t._fullLayout,l=e.plot.select(".barlayer").selectAll("g.trace.bars").data(r);l.enter().append("g").attr("class","trace bars"),l.append("g").attr("class","points").each(function(e){var r=e[0].node3=m.select(this),l=e[0].t,s=e[0].trace,c=l.poffset,u=Array.isArray(c);r.selectAll("g.point").data(_.identity).enter().append("g").classed("point",!0).each(function(r,l){function f(t){return 0===o.bargap&&0===o.bargroupgap?m.round(Math.round(t)-A,2):t}function d(t,e){return Math.abs(t-e)>=2?f(t):t>e?Math.ceil(t):Math.floor(t)}var p,h,g,v,y=r.p+(u?c[l]:c),b=y+r.w,_=r.b,w=_+r.s;if("h"===s.orientation?(g=i.c2p(y,!0),v=i.c2p(b,!0),p=a.c2p(_,!0),h=a.c2p(w,!0),r.ct=[h,(g+v)/2]):(p=a.c2p(y,!0),h=a.c2p(b,!0),g=i.c2p(_,!0),v=i.c2p(w,!0),r.ct=[(p+h)/2,v]),!(x(p)&&x(h)&&x(g)&&x(v)&&p!==h&&g!==v))return void m.select(this).remove();var M=(r.mlw+1||s.marker.line.width+1||(r.trace?r.trace.marker.line.width:0)+1)-1,A=m.round(M/2%1,2);if(!t._context.staticPlot){var T=k.opacity(r.mc||s.marker.color),L=T<1||M>.01?f:d;p=L(p,h),h=L(h,p),g=L(g,v),v=L(v,g)}var C=m.select(this);C.append("path").style("vector-effect","non-scaling-stroke").attr("d","M"+p+","+g+"V"+v+"H"+h+"V"+g+"Z"),n(t,C,e,l,p,h,g,v)})}),l.call(A.plot,e)}},{"../../components/color":41,"../../components/drawing":65,"../../components/errorbars":71,"../../lib":156,"../../lib/svg_text_utils":176,"./attributes":250,d3:14,"fast-isnumeric":17,tinycolor2:23}],258:[function(t,e,r){"use strict";var n=t("../../constants/interactions").DESELECTDIM;e.exports=function(t,e){var r,a=t.cd,i=[],o=a[0].trace,l=a[0].node3;if(!0!==o.visible)return[];if(!1===e)for(r=0;rc+l||!m(s))&&(f=!0,d(u,t))}for(var a=r.traces,i=y(e),o="fraction"===t._fullLayout.barnorm?1:100,l=o/1e9,s=e.l2c(e.c2l(0)),c="stack"===t._fullLayout.barmode?o:s,u=[s,c],f=!1,p=0;p1||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,o=r.line,l=i.tryColorscale(r,""),s=i.tryColorscale(r,"line");n.select(this).selectAll("path").each(function(t){var e,i,c=(t.mlw+1||o.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&&(i="mlc"in t?t.mlcc=s(t.mlc):Array.isArray(o.color)?a.defaultLine:o.color,u.call(a.stroke,i))})}),e.call(o.style)}},{"../../components/color":41,"../../components/drawing":65,"../../components/errorbars":71,d3:14}],262:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,l){r("marker.color",o),a(t,"marker")&&i(t,e,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(t,"marker.line")&&i(t,e,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width")}},{"../../components/color":41,"../../components/colorscale/defaults":50,"../../components/colorscale/has_colorscale":54}],263:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../../components/color/attributes"),i=t("../../lib/extend").extendFlat,o=n.marker,l=o.line;e.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},name:{valType:"string",editType:"calc+clearAxisTypes"},whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calcIfAutorange"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers",editType:"calcIfAutorange"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1,editType:"calcIfAutorange"},jitter:{valType:"number",min:0,max:1,editType:"calcIfAutorange"},pointpos:{valType:"number",min:-2,max:2,editType:"calcIfAutorange"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:i({},o.symbol,{arrayOk:!1,editType:"plot"}),opacity:i({},o.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:i({},o.size,{arrayOk:!1,editType:"calcIfAutorange"}),color:i({},o.color,{arrayOk:!1,editType:"style"}),line:{color:i({},l.color,{arrayOk:!1,dflt:a.defaultLine,editType:"style"}),width:i({},l.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor}},{"../../components/color/attributes":40,"../../lib/extend":150,"../scatter/attributes":333}],264:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../plots/cartesian/axes");e.exports=function(t,e){var r,o,l,s,c,u,f,d,p,h=i.getFromId(t,e.xaxis||"x"),g=i.getFromId(t,e.yaxis||"y"),v=e.orientation,y=[];"h"===v?(r=h,o="x",c=g,u="y"):(r=g,o="y",c=h,u="x"),l=r.makeCalcdata(e,o),i.expand(r,l,{padded:!0}),f=function(t,e,r,i,o){var l;return r in e?f=i.makeCalcdata(e,r):(l=r+"0"in e?e[r+"0"]:"name"in e&&("category"===i.type||n(e.name)&&-1!==["linear","log"].indexOf(i.type)||a.isDateTime(e.name)&&"date"===i.type)?e.name:t.numboxes,l=i.d2c(l,0,e[r+"calendar"]),f=o.map(function(){return l})),f}(t,e,u,c,l);var m=a.distinctVals(f);return d=m.vals,p=m.minDiff/2,s=function(t,e,r,i,o){var l,s,c,u,f=i.length,d=e.length,p=[],h=[];for(l=0;l=0&&c1,g=r.dPos*(1-u.boxgap)*(1-u.boxgroupgap)/(h?t.numboxes:1),v=h?2*r.dPos*((r.boxnum+.5)/t.numboxes-.5)*(1-u.boxgap):0,y=g*p.whiskerwidth;if(!0!==p.visible||r.emptybox)return void i.select(this).remove();"h"===p.orientation?(s=d,c=f):(s=f,c=d),r.bPos=v,r.bdPos=g,n(),i.select(this).selectAll("path.box").data(o.identity).enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","box").each(function(t){var e=s.c2p(t.pos+v,!0),r=s.c2p(t.pos+v-g,!0),n=s.c2p(t.pos+v+g,!0),a=s.c2p(t.pos+v-y,!0),l=s.c2p(t.pos+v+y,!0),u=c.c2p(t.q1,!0),f=c.c2p(t.q3,!0),d=o.constrain(c.c2p(t.med,!0),Math.min(u,f)+1,Math.max(u,f)-1),h=c.c2p(!1===p.boxpoints?t.min:t.lf,!0),m=c.c2p(!1===p.boxpoints?t.max:t.uf,!0);"h"===p.orientation?i.select(this).attr("d","M"+d+","+r+"V"+n+"M"+u+","+r+"V"+n+"H"+f+"V"+r+"ZM"+u+","+e+"H"+h+"M"+f+","+e+"H"+m+(0===p.whiskerwidth?"":"M"+h+","+a+"V"+l+"M"+m+","+a+"V"+l)):i.select(this).attr("d","M"+r+","+d+"H"+n+"M"+r+","+u+"H"+n+"V"+f+"H"+r+"ZM"+e+","+u+"V"+h+"M"+e+","+f+"V"+m+(0===p.whiskerwidth?"":"M"+a+","+h+"H"+l+"M"+a+","+m+"H"+l))}),p.boxpoints&&i.select(this).selectAll("g.points").data(function(t){return t.forEach(function(t){t.t=r,t.trace=p}),t}).enter().append("g").attr("class","points").selectAll("path").data(function(t){var e,r,n,i,l,s,c,u="all"===p.boxpoints?t.val:t.val.filter(function(e){return et.uf}),f=Math.max((t.max-t.min)/10,t.q3-t.q1),d=1e-9*f,h=.01*f,y=[],m=0;if(p.jitter){if(0===f)for(m=1,y=new Array(u.length),e=0;et.lo&&(n.so=!0),n})}).enter().append("path").classed("point",!0).call(l.translatePoints,f,d),p.boxmean&&i.select(this).selectAll("path.mean").data(o.identity).enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}).each(function(t){var e=s.c2p(t.pos+v,!0),r=s.c2p(t.pos+v-g,!0),n=s.c2p(t.pos+v+g,!0),a=c.c2p(t.mean,!0),o=c.c2p(t.mean-t.sd,!0),l=c.c2p(t.mean+t.sd,!0);"h"===p.orientation?i.select(this).attr("d","M"+a+","+r+"V"+n+("sd"!==p.boxmean?"":"m0,0L"+o+","+e+"L"+a+","+r+"L"+l+","+e+"Z")):i.select(this).attr("d","M"+r+","+a+"H"+n+("sd"!==p.boxmean?"":"m0,0L"+e+","+o+"L"+r+","+a+"L"+e+","+l+"Z"))})})}},{"../../components/drawing":65,"../../lib":156,d3:14}],271:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/cartesian/axes"),i=t("../../lib");e.exports=function(t,e){var r,o,l,s,c=t._fullLayout,u=e.xaxis,f=e.yaxis,d=["v","h"];for(o=0;ol.end&&(l.start=l.end=(l.start+l.end)/2),e._input.contours||(e._input.contours={}),i(e._input.contours,{start:l.start,end:l.end,size:l.size}),e._input.autocontour=!0}else{var c=l.start,u=l.end,f=e._input.contours;if(c>u&&(l.start=f.start=u,u=l.end=f.end=c,c=l.start),!(l.size>0)){var d;d=c===u?1:n(c,u,e.ncontours).dtick,f.size=l.size=d}}return r}},{"../../lib":156,"../../plots/cartesian/axes":196,"../heatmap/calc":289}],275:[function(t,e,r){"use strict";var n=t("../../plots/plots"),a=t("../../components/colorbar/draw"),i=t("./make_color_map"),o=t("./end_plus");e.exports=function(t,e){var r=e[0].trace,l="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+l).remove(),!r.showscale)return void n.autoMargin(t,l);var s=a(t,l);e[0].t.cb=s;var c=r.contours,u=r.line,f=c.size||1,d=c.coloring,p=i(r,{isColorbar:!0});"heatmap"===d&&s.filllevels({start:r.zmin,end:r.zmax,size:(r.zmax-r.zmin)/254}),s.fillcolor("fill"===d||"heatmap"===d?p:"").line({color:"lines"===d?p:u.color,width:!1!==c.showlines?u.width:0,dash:u.dash}).levels({start:c.start,end:o(c),size:f}).options(r.colorbar)()}},{"../../components/colorbar/draw":44,"../../plots/plots":225,"./end_plus":279,"./make_color_map":283}],276:[function(t,e,r){"use strict";e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},{}],277:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes");e.exports=function(t,e,r){var i,o=n.coerce2(t,e,a,"contours.start"),l=n.coerce2(t,e,a,"contours.end"),s=!1===o||!1===l,c=r("contours.size");!(i=s?e.autocontour=!0:r("autocontour",!1))&&c||r("ncontours")}},{"../../lib":156,"./attributes":273}],278:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../heatmap/has_columns"),i=t("../heatmap/xyz_defaults"),o=t("./contours_defaults"),l=t("./style_defaults"),s=t("./attributes");e.exports=function(t,e,r,c){function u(r,a){return n.coerce(t,e,s,r,a)}if(!i(t,e,u,c))return void(e.visible=!1);u("text"),u("connectgaps",a(e)),o(t,e,u),l(t,e,u,c)}},{"../../lib":156,"../heatmap/has_columns":295,"../heatmap/xyz_defaults":303,"./attributes":273,"./contours_defaults":277,"./style_defaults":287}],279:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],280:[function(t,e,r){"use strict";function n(t,e,r,n){return Math.abs(t[0]-e[0])20?(g=c.CHOOSESADDLE[g][(v[0]||v[1])<0?0:1],t.crossings[h]=c.SADDLEREMAINDER[g]):delete t.crossings[h],!(v=c.NEWDELTA[g])){s.log("Found bad marching index:",g,e,t.level);break}y.push(l(t,e,v)),e[0]+=v[0],e[1]+=v[1],n(y[y.length-1],y[y.length-2],i,u)&&y.pop(),h=e.join(",");var _=v[0]&&(e[0]<0||e[0]>b-2)||v[1]&&(e[1]<0||e[1]>x-2);if(h===p&&v.join(",")===m||r&&_)break;g=t.crossings[h]}1e4===d&&s.log("Infinite loop in contour?");var w,k,M,A,T,L,C,z=n(y[0],y[y.length-1],i,u),S=0,O=.2*t.smoothing,D=[],E=0;for(d=1;d=E;d--)if((w=D[d])=E&&w+D[k]20&&e?208===t||1114===t?n=0===r[0]?1:-1:a=0===r[1]?1:-1:-1!==c.BOTTOMSTART.indexOf(t)?a=1:-1!==c.LEFTSTART.indexOf(t)?n=1:-1!==c.TOPSTART.indexOf(t)?a=-1:n=-1,[n,a]}function l(t,e,r){var n=e[0]+Math.max(r[0],0),a=e[1]+Math.max(r[1],0),i=t.z[a][n],o=t.xaxis,l=t.yaxis;if(r[1]){var s=(t.level-i)/(t.z[a][n+1]-i);return[o.c2p((1-s)*t.x[n]+s*t.x[n+1],!0),l.c2p(t.y[a],!0),n+s,a]}var c=(t.level-i)/(t.z[a+1][n]-i);return[o.c2p(t.x[n],!0),l.c2p((1-c)*t.y[a]+c*t.y[a+1],!0),n,a+c]}var s=t("../../lib"),c=t("./constants");e.exports=function(t,e,r){var n,a,o,l,c;for(e=e||.01,r=r||.01,o=0;ot?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){return t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208}return 15===r?0:r}var a=t("./constants");e.exports=function(t){var e,r,i,o,l,s,c,u,f,d=t[0].z,p=d.length,h=d[0].length,g=2===p||2===h;for(r=0;r1e3){p.warn("Too many contours, clipping at 1000",t);break}return a}function i(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 o(t,e,r,n){var a=t.selectAll("g.contourfill").data([0]);a.enter().append("g").classed("contourfill",!0);var i=a.selectAll("path").data("fill"===n.coloring?e:[]);i.enter().append("path"),i.exit().remove(),i.each(function(t){var e=l(t,r);e?d.select(this).attr("d",e).style("stroke","none"):d.select(this).remove()})}function l(t,e){function r(t){return Math.abs(t[0]-e[2][0])<.01}for(var n,a,i,o,l,s,c=Math.min(t.z[0][0],t.z[0][1]),u=t.edgepaths.length||c<=t.level?"":"M"+e.join("L")+"Z",f=0,d=t.edgepaths.map(function(t,e){return e}),g=!0;d.length;){for(s=h.smoothopen(t.edgepaths[f],t.smoothing),u+=g?s:s.replace(/^M/,"L"),d.splice(d.indexOf(f),1),n=t.edgepaths[f][t.edgepaths[f].length-1],o=-1,i=0;i<4;i++){if(!n){p.log("Missing end?",f,t);break}for(!function(t){return Math.abs(t[1]-e[0][1])<.01}(n)||r(n)?!function(t){return Math.abs(t[0]-e[0][0])<.01}(n)?!function(t){return Math.abs(t[1]-e[2][1])<.01}(n)?r(n)&&(a=e[2]):a=e[3]:a=e[0]:a=e[1],l=0;l=0&&(a=v,o=l):Math.abs(n[1]-a[1])<.01?Math.abs(n[1]-v[1])<.01&&(v[0]-n[0])*(a[0]-v[0])>=0&&(a=v,o=l):p.log("endpt to newendpt is not vert. or horz.",n,a,v)}if(n=a,o>=0)break;u+="L"+a}if(o===t.edgepaths.length){p.log("unclosed perimeter path");break}f=o,g=-1===d.indexOf(f),g&&(f=d[0],u+="Z")}for(f=0;f_*x?(i=x,a=i*_):(a=m,i=a/_),o=v*a/m,l=y*i/x,r=e.l+e.w*h-a/2,n=e.t+e.h*(1-g)-i/2,s.x0=r,s.y0=n,s.w=a,s.h=i,s.sum=b,s.xaxis={type:"linear",range:[w+2*M-b,b-w-2*k],domain:[h-o/2,h+o/2],_id:"x"},f(s.xaxis,s.graphDiv._fullLayout),s.xaxis.setScale(),s.xaxis.isPtWithinRange=function(t){return t.a>=s.aaxis.range[0]&&t.a<=s.aaxis.range[1]&&t.b>=s.baxis.range[1]&&t.b<=s.baxis.range[0]&&t.c>=s.caxis.range[1]&&t.c<=s.caxis.range[0]},s.yaxis={type:"linear",range:[w,b-k-M],domain:[g-l/2,g+l/2],_id:"y"},f(s.yaxis,s.graphDiv._fullLayout),s.yaxis.setScale(),s.yaxis.isPtWithinRange=function(){return!0};var A=s.yaxis.domain[0],T=s.aaxis=d({},t.aaxis,{visible:!0,range:[w,b-k-M],side:"left",_counterangle:30,tickangle:(+t.aaxis.tickangle||0)-30,domain:[A,A+l*_],_axislayer:s.layers.aaxis,_gridlayer:s.layers.agrid,_pos:0,_id:"y",_length:a,_gridpath:"M0,0l"+i+",-"+a/2});f(T,s.graphDiv._fullLayout),T.setScale();var L=s.baxis=d({},t.baxis,{visible:!0,range:[b-w-M,k],side:"bottom",_counterangle:30,domain:s.xaxis.domain,_axislayer:s.layers.baxis,_gridlayer:s.layers.bgrid,_counteraxis:s.aaxis,_pos:0,_id:"x",_length:a,_gridpath:"M0,0l-"+a/2+",-"+i});f(L,s.graphDiv._fullLayout),L.setScale(),T._counteraxis=L;var C=s.caxis=d({},t.caxis,{visible:!0,range:[b-w-k,M],side:"right",_counterangle:30,tickangle:(+t.caxis.tickangle||0)+30,domain:[A,A+l*_],_axislayer:s.layers.caxis,_gridlayer:s.layers.cgrid,_counteraxis:s.baxis,_pos:0,_id:"y",_length:a,_gridpath:"M0,0l-"+i+","+a/2});f(C,s.graphDiv._fullLayout),C.setScale();var z="M"+r+","+(n+i)+"h"+a+"l-"+a/2+",-"+i+"Z";s.clipDef.select("path").attr("d",z),s.layers.plotbg.select("path").attr("d",z);var S="M0,"+i+"h"+a+"l-"+a/2+",-"+i+"Z";s.clipDefRelative.select("path").attr("d",S);var O="translate("+r+","+n+")";s.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",O),s.clipDefRelative.select("path").attr("transform",null);var D="translate("+r+","+(n+i)+")";s.layers.baxis.attr("transform",D),s.layers.bgrid.attr("transform",D);var E="translate("+(r+a/2)+","+n+")rotate(30)";s.layers.aaxis.attr("transform",E),s.layers.agrid.attr("transform",E);var P="translate("+(r+a/2)+","+n+")rotate(-30)";s.layers.caxis.attr("transform",P),s.layers.cgrid.attr("transform",P),s.drawAxes(!0),s.plotContainer.selectAll(".crisp").classed("crisp",!1),s.layers.aline.select("path").attr("d",T.showline?"M"+r+","+(n+i)+"l"+a/2+",-"+i:"M0,0").call(c.stroke,T.linecolor||"#000").style("stroke-width",(T.linewidth||0)+"px"),s.layers.bline.select("path").attr("d",L.showline?"M"+r+","+(n+i)+"h"+a:"M0,0").call(c.stroke,L.linecolor||"#000").style("stroke-width",(L.linewidth||0)+"px"),s.layers.cline.select("path").attr("d",C.showline?"M"+(r+a/2)+","+n+"l"+a/2+","+i:"M0,0").call(c.stroke,C.linecolor||"#000").style("stroke-width",(C.linewidth||0)+"px"),s.graphDiv._context.staticPlot||s.initInteractions(),u.setClipUrl(s.layers.frontplot,s._hasClipOnAxisFalse?null:s.clipId)},b.drawAxes=function(t){var e=this,r=e.graphDiv,n=e.id.substr(7)+"title",a=e.aaxis,i=e.baxis,o=e.caxis;if(h.doTicks(r,a,!0),h.doTicks(r,i,!0),h.doTicks(r,o,!0),t){var l=Math.max(a.showticklabels?a.tickfont.size/2:0,(o.showticklabels?.75*o.tickfont.size:0)+("outside"===o.ticks?.87*o.ticklen:0));y.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=(i.showticklabels?i.tickfont.size:0)+("outside"===i.ticks?i.ticklen:0)+3;y.draw(r,"b"+n,{propContainer:i,propName:e.id+".baxis.title",dfltName:"Component B",attributes:{x:e.x0-s,y:e.y0+e.h+.83*i.titlefont.size+s,"text-anchor":"middle"}}),y.draw(r,"c"+n,{propContainer:o,propName:e.id+".caxis.title",dfltName:"Component C",attributes:{x:e.x0+e.w+s,y:e.y0+e.h+.83*o.titlefont.size+s,"text-anchor":"middle"}})}};var w=x.MINZOOM/2+.87,k="m-0.87,.5h"+w+"v3h-"+(w+5.2)+"l"+(w/2+2.6)+",-"+(.87*w+4.5)+"l2.6,1.5l-"+w/2+","+.87*w+"Z",M="m0.87,.5h-"+w+"v3h"+(w+5.2)+"l-"+(w/2+2.6)+",-"+(.87*w+4.5)+"l-2.6,1.5l"+w/2+","+.87*w+"Z",A="m0,1l"+w/2+","+.87*w+"l2.6,-1.5l-"+(w/2+2.6)+",-"+(.87*w+4.5)+"l-"+(w/2+2.6)+","+(.87*w+4.5)+"l2.6,1.5l"+w/2+",-"+.87*w+"Z",T=!0;b.initInteractions=function(){function t(t,e,r){var n=R.getBoundingClientRect();w=e-n.left,L=r-n.top,C={a:N.aaxis.range[0],b:N.baxis.range[1],c:N.caxis.range[1]},S=C,z=N.aaxis.range[1]-C.a,O=o(N.graphDiv._fullLayout[N.id].bgcolor).getLuminance(),D="M0,"+N.h+"L"+N.w/2+", 0L"+N.w+","+N.h+"Z",E=!1,P=j.append("path").attr("class","zoombox").attr("transform","translate("+N.x0+", "+N.y0+")").style({fill:O>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",D),I=j.append("path").attr("class","zoombox-corners").attr("transform","translate("+N.x0+", "+N.y0+")").style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),y()}function e(t,e){return 1-e/N.h}function r(t,e){return 1-(t+(N.h-e)/Math.sqrt(3))/N.w}function n(t,e){return(t-(N.h-e)/Math.sqrt(3))/N.w}function i(t,a){var i=w+t,o=L+a,l=Math.max(0,Math.min(1,e(w,L),e(i,o))),s=Math.max(0,Math.min(1,r(w,L),r(i,o))),c=Math.max(0,Math.min(1,n(w,L),n(i,o))),u=(l/2+c)*N.w,f=(1-l/2-s)*N.w,d=(u+f)/2,p=f-u,h=(1-l)*N.h,g=h-p/_;p.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),I.transition().style("opacity",1).duration(200),E=!0)}function f(t,e){if(S===C)return 2===e&&b(),a(F);a(F);var r={};r[N.id+".aaxis.min"]=S.a,r[N.id+".baxis.min"]=S.b,r[N.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 d(){C={a:N.aaxis.range[0],b:N.baxis.range[1],c:N.caxis.range[1]},S=C}function p(t,e){var r=t/N.xaxis._m,n=e/N.yaxis._m;S={a:C.a-n,b:C.b+(r+n)/2,c:C.c-(r-n)/2};var a=[S.a,S.b,S.c].sort(),i={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[i.a],b:a[i.b],c:a[i.c]},e=(C.a-S.a)*N.yaxis._m,t=(C.c-S.c-C.b+S.b)*N.xaxis._m);var o="translate("+(N.x0+t)+","+(N.y0+e)+")";N.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",o);var l="translate("+-t+","+-e+")";if(N.clipDefRelative.select("path").attr("transform",l),N.aaxis.range=[S.a,N.sum-S.b-S.c],N.baxis.range=[N.sum-S.a-S.c,S.b],N.caxis.range=[N.sum-S.a-S.b,S.c],N.drawAxes(!1),N.plotContainer.selectAll(".crisp").classed("crisp",!1),N._hasClipOnAxisFalse){var s=N.plotContainer.select(".scatterlayer").selectAll(".points");s.selectAll(".point").call(u.hideOutsideRangePoints,N),s.selectAll(".textpoint").call(u.hideOutsideRangePoints,N)}}function h(t,e){if(t){var r={};r[N.id+".aaxis.min"]=S.a,r[N.id+".baxis.min"]=S.b,r[N.id+".caxis.min"]=S.c,l.relayout(F,r)}else 2===e&&b()}function y(){j.selectAll(".select-outline").remove()}function b(){var t={};t[N.id+".aaxis.min"]=0,t[N.id+".baxis.min"]=0,t[N.id+".caxis.min"]=0,F.emit("plotly_doubleclick",null),l.relayout(F,t)}var w,L,C,z,S,O,D,E,P,I,N=this,R=N.layers.plotbg.select("path").node(),F=N.graphDiv,j=F._fullLayout._zoomlayer,B={element:R,gd:F,plotinfo:{xaxis:N.xaxis,yaxis:N.yaxis},doubleclick:b,subplot:N.id,prepFn:function(e,r,n){B.xaxes=[N.xaxis],B.yaxes=[N.yaxis];var a=F._fullLayout.dragmode;e.shiftKey&&(a="pan"===a?"zoom":"pan"),B.minDrag="lasso"===a?1:void 0,"zoom"===a?(B.moveFn=i,B.doneFn=f,t(e,r,n)):"pan"===a?(B.moveFn=p,B.doneFn=h,d(),y()):"select"!==a&&"lasso"!==a||m(e,r,n,B,a)}};R.onmousemove=function(t){v.hover(F,t,N.id),F._fullLayout._lasthover=R,F._fullLayout._hoversubplot=N.id},R.onmouseout=function(t){F._dragging||g.unhover(F,t)},R.onclick=function(t){v.click(F,t,N.id)},g.init(B)}},{"../../components/color":41,"../../components/dragelement":62,"../../components/drawing":65,"../../components/fx":82,"../../components/titles":131,"../../lib":156,"../../lib/extend":150,"../../plotly":191,"../cartesian/axes":196,"../cartesian/constants":201,"../cartesian/select":212,"../cartesian/set_convert":213,"../plots":225,d3:14,tinycolor2:23}],240:[function(t,e,r){"use strict";function n(t){if(t.layoutAttributes){var e=t.layoutAttributes._arrayAttrRegexps;if(e)for(var n=0;n-1}var i=t("../lib"),o=t("../plots/plots"),l=i.extendFlat,s=i.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,i=t.data,c=t.layout,u=s([],i),f=s({},c,n(e.tileClass)),d=t._context||{};if(e.width&&(f.width=e.width),e.height&&(f.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){f.annotations=[];var p=Object.keys(f);for(r=0;r")?"":e.html(t).text()});return e.remove(),r}function a(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}var i=t("d3"),o=t("../lib"),l=t("../components/drawing"),s=t("../components/color"),c=t("../constants/xmlns_namespaces"),u=/"/g,f=new RegExp('("TOBESTRIPPED)|(TOBESTRIPPED")',"g");e.exports=function(t,e,r){var d,p=t._fullLayout,h=p._paper,g=p._toppaper,v=p.width,y=p.height;h.insert("rect",":first-child").call(l.setRect,0,0,v,y).call(s.fill,p.paper_bgcolor);var m=p._basePlotModules||[];for(d=0;d0&&A>0,j=k<=N&&A<=R,B=k<=R&&A<=N,q="h"===y?N>=k*(R/A):R>=A*(N/k);F&&(j||B||q)?x="inside":(x="outside",b.remove(),b=null)}else x="inside";if(!b&&(b=g(e,m,"outside"===x?C:L),_=M.bBox(b.node()),k=_.width,A=_.height,k<=0||A<=0))return void b.remove();var H,V;"outside"===x?(V="both"===v.constraintext||"outside"===v.constraintext,H=i(o,d,p,h,_,y,V)):(V="both"===v.constraintext||"inside"===v.constraintext,H=a(o,d,p,h,_,y,V)),b.attr("transform",H)}}}function a(t,e,r,n,a,i,l){var s,c,u,f,d,p=a.width,h=a.height,g=(a.left+a.right)/2,v=(a.top+a.bottom)/2,y=Math.abs(e-t),m=Math.abs(n-r);y>2*D&&m>2*D?(d=D,y-=2*d,m-=2*d):d=0;var x,b;return p<=y&&h<=m?(x=!1,b=1):p<=m&&h<=y?(x=!0,b=1):pr?(u=(t+e)/2,f=n-d-c/2):(u=(t+e)/2,f=n+d+c/2),o(g,v,u,f,b,x)}function i(t,e,r,n,a,i,l){var s,c="h"===i?Math.abs(n-r):Math.abs(e-t);c>2*D&&(s=D);var u=1;l&&(u="h"===i?Math.min(1,c/a.height):Math.min(1,c/a.width));var f,d,p,h,g=(a.left+a.right)/2,v=(a.top+a.bottom)/2;return f=u*a.width,d=u*a.height,"h"===i?er?(p=(t+e)/2,h=n+s+d/2):(p=(t+e)/2,h=n-s-d/2),o(g,v,p,h,u,!1)}function o(t,e,r,n,a,i){var o,l;return a<1?o="scale("+a+") ":(a=1,o=""),l=i?"rotate("+i+" "+t+" "+e+") ":"","translate("+(r-a*t)+" "+(n-a*e)+")"+o+l}function l(t,e){var r=p(t.text,e);return h(L,r)}function s(t,e){var r=p(t.textposition,e);return g(C,r)}function c(t,e,r){return d(z,t.textfont,e,r)}function u(t,e,r){return d(S,t.insidetextfont,e,r)}function f(t,e,r){return d(O,t.outsidetextfont,e,r)}function d(t,e,r,n){e=e||{};var a=p(e.family,r),i=p(e.size,r),o=p(e.color,r);return{family:h(t.family,a,n.family),size:v(t.size,i,n.size),color:y(t.color,o,n.color)}}function p(t,e){var r;return Array.isArray(t)?ea))return e}return void 0!==r?r:t.dflt}function y(t,e,r){return b(e).isValid()?e:void 0!==r?r:t.dflt}var m=t("d3"),x=t("fast-isnumeric"),b=t("tinycolor2"),_=t("../../lib"),w=t("../../lib/svg_text_utils"),k=t("../../components/color"),M=t("../../components/drawing"),A=t("../../components/errorbars"),T=t("./attributes"),L=T.text,C=T.textposition,z=T.textfont,S=T.insidetextfont,O=T.outsidetextfont,D=3;e.exports=function(t,e,r){var a=e.xaxis,i=e.yaxis,o=t._fullLayout,l=e.plot.select(".barlayer").selectAll("g.trace.bars").data(r);l.enter().append("g").attr("class","trace bars"),l.append("g").attr("class","points").each(function(e){var r=e[0].node3=m.select(this),l=e[0].t,s=e[0].trace,c=l.poffset,u=Array.isArray(c);r.selectAll("g.point").data(_.identity).enter().append("g").classed("point",!0).each(function(r,l){function f(t){return 0===o.bargap&&0===o.bargroupgap?m.round(Math.round(t)-A,2):t}function d(t,e){return Math.abs(t-e)>=2?f(t):t>e?Math.ceil(t):Math.floor(t)}var p,h,g,v,y=r.p+(u?c[l]:c),b=y+r.w,_=r.b,w=_+r.s;if("h"===s.orientation?(g=i.c2p(y,!0),v=i.c2p(b,!0),p=a.c2p(_,!0),h=a.c2p(w,!0),r.ct=[h,(g+v)/2]):(p=a.c2p(y,!0),h=a.c2p(b,!0),g=i.c2p(_,!0),v=i.c2p(w,!0),r.ct=[(p+h)/2,v]),!(x(p)&&x(h)&&x(g)&&x(v)&&p!==h&&g!==v))return void m.select(this).remove();var M=(r.mlw+1||s.marker.line.width+1||(r.trace?r.trace.marker.line.width:0)+1)-1,A=m.round(M/2%1,2);if(!t._context.staticPlot){var T=k.opacity(r.mc||s.marker.color),L=T<1||M>.01?f:d;p=L(p,h),h=L(h,p),g=L(g,v),v=L(v,g)}var C=m.select(this);C.append("path").style("vector-effect","non-scaling-stroke").attr("d","M"+p+","+g+"V"+v+"H"+h+"V"+g+"Z"),n(t,C,e,l,p,h,g,v)})}),l.call(A.plot,e)}},{"../../components/color":41,"../../components/drawing":65,"../../components/errorbars":71,"../../lib":156,"../../lib/svg_text_utils":176,"./attributes":250,d3:14,"fast-isnumeric":17,tinycolor2:23}],258:[function(t,e,r){"use strict";var n=t("../../constants/interactions").DESELECTDIM;e.exports=function(t,e){var r,a=t.cd,i=[],o=a[0].node3;if(!1===e)for(r=0;rc+l||!m(s))&&(f=!0,d(u,t))}for(var a=r.traces,i=y(e),o="fraction"===t._fullLayout.barnorm?1:100,l=o/1e9,s=e.l2c(e.c2l(0)),c="stack"===t._fullLayout.barmode?o:s,u=[s,c],f=!1,p=0;p1||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,o=r.line,l=i.tryColorscale(r,""),s=i.tryColorscale(r,"line");n.select(this).selectAll("path").each(function(t){var e,i,c=(t.mlw+1||o.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&&(i="mlc"in t?t.mlcc=s(t.mlc):Array.isArray(o.color)?a.defaultLine:o.color,u.call(a.stroke,i))})}),e.call(o.style)}},{"../../components/color":41,"../../components/drawing":65,"../../components/errorbars":71,d3:14}],262:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,l){r("marker.color",o),a(t,"marker")&&i(t,e,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(t,"marker.line")&&i(t,e,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width")}},{"../../components/color":41,"../../components/colorscale/defaults":50,"../../components/colorscale/has_colorscale":54}],263:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../../components/color/attributes"),i=t("../../lib/extend").extendFlat,o=n.marker,l=o.line;e.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},name:{valType:"string",editType:"calc+clearAxisTypes"},whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calcIfAutorange"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers",editType:"calcIfAutorange"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1,editType:"calcIfAutorange"},jitter:{valType:"number",min:0,max:1,editType:"calcIfAutorange"},pointpos:{valType:"number",min:-2,max:2,editType:"calcIfAutorange"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:i({},o.symbol,{arrayOk:!1,editType:"plot"}),opacity:i({},o.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:i({},o.size,{arrayOk:!1,editType:"calcIfAutorange"}),color:i({},o.color,{arrayOk:!1,editType:"style"}),line:{color:i({},l.color,{arrayOk:!1,dflt:a.defaultLine,editType:"style"}),width:i({},l.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor}},{"../../components/color/attributes":40,"../../lib/extend":150,"../scatter/attributes":333}],264:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../plots/cartesian/axes");e.exports=function(t,e){var r,o,l,s,c,u,f,d,p,h=i.getFromId(t,e.xaxis||"x"),g=i.getFromId(t,e.yaxis||"y"),v=e.orientation,y=[];"h"===v?(r=h,o="x",c=g,u="y"):(r=g,o="y",c=h,u="x"),l=r.makeCalcdata(e,o),i.expand(r,l,{padded:!0}),f=function(t,e,r,i,o){var l;return r in e?f=i.makeCalcdata(e,r):(l=r+"0"in e?e[r+"0"]:"name"in e&&("category"===i.type||n(e.name)&&-1!==["linear","log"].indexOf(i.type)||a.isDateTime(e.name)&&"date"===i.type)?e.name:t.numboxes,l=i.d2c(l,0,e[r+"calendar"]),f=o.map(function(){return l})),f}(t,e,u,c,l);var m=a.distinctVals(f);return d=m.vals,p=m.minDiff/2,s=function(t,e,r,i,o){var l,s,c,u,f=i.length,d=e.length,p=[],h=[];for(l=0;l=0&&c1,g=r.dPos*(1-u.boxgap)*(1-u.boxgroupgap)/(h?t.numboxes:1),v=h?2*r.dPos*((r.boxnum+.5)/t.numboxes-.5)*(1-u.boxgap):0,y=g*p.whiskerwidth;if(!0!==p.visible||r.emptybox)return void i.select(this).remove();"h"===p.orientation?(s=d,c=f):(s=f,c=d),r.bPos=v,r.bdPos=g,n(),i.select(this).selectAll("path.box").data(o.identity).enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","box").each(function(t){var e=s.c2p(t.pos+v,!0),r=s.c2p(t.pos+v-g,!0),n=s.c2p(t.pos+v+g,!0),a=s.c2p(t.pos+v-y,!0),l=s.c2p(t.pos+v+y,!0),u=c.c2p(t.q1,!0),f=c.c2p(t.q3,!0),d=o.constrain(c.c2p(t.med,!0),Math.min(u,f)+1,Math.max(u,f)-1),h=c.c2p(!1===p.boxpoints?t.min:t.lf,!0),m=c.c2p(!1===p.boxpoints?t.max:t.uf,!0);"h"===p.orientation?i.select(this).attr("d","M"+d+","+r+"V"+n+"M"+u+","+r+"V"+n+"H"+f+"V"+r+"ZM"+u+","+e+"H"+h+"M"+f+","+e+"H"+m+(0===p.whiskerwidth?"":"M"+h+","+a+"V"+l+"M"+m+","+a+"V"+l)):i.select(this).attr("d","M"+r+","+d+"H"+n+"M"+r+","+u+"H"+n+"V"+f+"H"+r+"ZM"+e+","+u+"V"+h+"M"+e+","+f+"V"+m+(0===p.whiskerwidth?"":"M"+a+","+h+"H"+l+"M"+a+","+m+"H"+l))}),p.boxpoints&&i.select(this).selectAll("g.points").data(function(t){return t.forEach(function(t){t.t=r,t.trace=p}),t}).enter().append("g").attr("class","points").selectAll("path").data(function(t){var e,r,n,i,l,s,c,u="all"===p.boxpoints?t.val:t.val.filter(function(e){return et.uf}),f=Math.max((t.max-t.min)/10,t.q3-t.q1),d=1e-9*f,h=.01*f,y=[],m=0;if(p.jitter){if(0===f)for(m=1,y=new Array(u.length),e=0;et.lo&&(n.so=!0),n})}).enter().append("path").classed("point",!0).call(l.translatePoints,f,d),p.boxmean&&i.select(this).selectAll("path.mean").data(o.identity).enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}).each(function(t){var e=s.c2p(t.pos+v,!0),r=s.c2p(t.pos+v-g,!0),n=s.c2p(t.pos+v+g,!0),a=c.c2p(t.mean,!0),o=c.c2p(t.mean-t.sd,!0),l=c.c2p(t.mean+t.sd,!0);"h"===p.orientation?i.select(this).attr("d","M"+a+","+r+"V"+n+("sd"!==p.boxmean?"":"m0,0L"+o+","+e+"L"+a+","+r+"L"+l+","+e+"Z")):i.select(this).attr("d","M"+r+","+a+"H"+n+("sd"!==p.boxmean?"":"m0,0L"+e+","+o+"L"+r+","+a+"L"+e+","+l+"Z"))})})}},{"../../components/drawing":65,"../../lib":156,d3:14}],271:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/cartesian/axes"),i=t("../../lib");e.exports=function(t,e){var r,o,l,s,c=t._fullLayout,u=e.xaxis,f=e.yaxis,d=["v","h"];for(o=0;ol.end&&(l.start=l.end=(l.start+l.end)/2),e._input.contours||(e._input.contours={}),i(e._input.contours,{start:l.start,end:l.end,size:l.size}),e._input.autocontour=!0}else{var c=l.start,u=l.end,f=e._input.contours;if(c>u&&(l.start=f.start=u,u=l.end=f.end=c,c=l.start),!(l.size>0)){var d;d=c===u?1:n(c,u,e.ncontours).dtick,f.size=l.size=d}}return r}},{"../../lib":156,"../../plots/cartesian/axes":196,"../heatmap/calc":289}],275:[function(t,e,r){"use strict";var n=t("../../plots/plots"),a=t("../../components/colorbar/draw"),i=t("./make_color_map"),o=t("./end_plus");e.exports=function(t,e){var r=e[0].trace,l="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+l).remove(),!r.showscale)return void n.autoMargin(t,l);var s=a(t,l);e[0].t.cb=s;var c=r.contours,u=r.line,f=c.size||1,d=c.coloring,p=i(r,{isColorbar:!0});"heatmap"===d&&s.filllevels({start:r.zmin,end:r.zmax,size:(r.zmax-r.zmin)/254}),s.fillcolor("fill"===d||"heatmap"===d?p:"").line({color:"lines"===d?p:u.color,width:!1!==c.showlines?u.width:0,dash:u.dash}).levels({start:c.start,end:o(c),size:f}).options(r.colorbar)()}},{"../../components/colorbar/draw":44,"../../plots/plots":225,"./end_plus":279,"./make_color_map":283}],276:[function(t,e,r){"use strict";e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},{}],277:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes");e.exports=function(t,e,r){var i,o=n.coerce2(t,e,a,"contours.start"),l=n.coerce2(t,e,a,"contours.end"),s=!1===o||!1===l,c=r("contours.size");!(i=s?e.autocontour=!0:r("autocontour",!1))&&c||r("ncontours")}},{"../../lib":156,"./attributes":273}],278:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../heatmap/has_columns"),i=t("../heatmap/xyz_defaults"),o=t("./contours_defaults"),l=t("./style_defaults"),s=t("./attributes");e.exports=function(t,e,r,c){function u(r,a){return n.coerce(t,e,s,r,a)}if(!i(t,e,u,c))return void(e.visible=!1);u("text"),u("connectgaps",a(e)),o(t,e,u),l(t,e,u,c)}},{"../../lib":156,"../heatmap/has_columns":295,"../heatmap/xyz_defaults":303,"./attributes":273,"./contours_defaults":277,"./style_defaults":287}],279:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],280:[function(t,e,r){"use strict";function n(t,e,r,n){return Math.abs(t[0]-e[0])20?(g=c.CHOOSESADDLE[g][(v[0]||v[1])<0?0:1],t.crossings[h]=c.SADDLEREMAINDER[g]):delete t.crossings[h],!(v=c.NEWDELTA[g])){s.log("Found bad marching index:",g,e,t.level);break}y.push(l(t,e,v)),e[0]+=v[0],e[1]+=v[1],n(y[y.length-1],y[y.length-2],i,u)&&y.pop(),h=e.join(",");var _=v[0]&&(e[0]<0||e[0]>b-2)||v[1]&&(e[1]<0||e[1]>x-2);if(h===p&&v.join(",")===m||r&&_)break;g=t.crossings[h]}1e4===d&&s.log("Infinite loop in contour?");var w,k,M,A,T,L,C,z,S,O,D,E=n(y[0],y[y.length-1],i,u),P=0,I=.2*t.smoothing,N=[],R=0;for(d=1;d=R;d--)if((w=N[d])=R&&w+N[k]z&&S--,t.edgepaths[S]=D.concat(y,O));break}B||(t.edgepaths[z]=y.concat(O))}for(z=0;z20&&e?208===t||1114===t?n=0===r[0]?1:-1:a=0===r[1]?1:-1:-1!==c.BOTTOMSTART.indexOf(t)?a=1:-1!==c.LEFTSTART.indexOf(t)?n=1:-1!==c.TOPSTART.indexOf(t)?a=-1:n=-1,[n,a]}function l(t,e,r){var n=e[0]+Math.max(r[0],0),a=e[1]+Math.max(r[1],0),i=t.z[a][n],o=t.xaxis,l=t.yaxis;if(r[1]){var s=(t.level-i)/(t.z[a][n+1]-i);return[o.c2p((1-s)*t.x[n]+s*t.x[n+1],!0),l.c2p(t.y[a],!0),n+s,a]}var c=(t.level-i)/(t.z[a+1][n]-i);return[o.c2p(t.x[n],!0),l.c2p((1-c)*t.y[a]+c*t.y[a+1],!0),n,a+c]}var s=t("../../lib"),c=t("./constants");e.exports=function(t,e,r){var n,a,o,l,c;for(e=e||.01,r=r||.01,o=0;ot?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){return t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208}return 15===r?0:r}var a=t("./constants");e.exports=function(t){var e,r,i,o,l,s,c,u,f,d=t[0].z,p=d.length,h=d[0].length,g=2===p||2===h;for(r=0;r1e3){p.warn("Too many contours, clipping at 1000",t);break}return a}function i(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 o(t,e,r,n){var a=t.selectAll("g.contourfill").data([0]);a.enter().append("g").classed("contourfill",!0);var i=a.selectAll("path").data("fill"===n.coloring?e:[]);i.enter().append("path"),i.exit().remove(),i.each(function(t){var e=l(t,r);e?d.select(this).attr("d",e).style("stroke","none"):d.select(this).remove()})}function l(t,e){function r(t){return Math.abs(t[0]-e[2][0])<.01}for(var n,a,i,o,l,s,c=Math.min(t.z[0][0],t.z[0][1]),u=t.edgepaths.length||c<=t.level?"":"M"+e.join("L")+"Z",f=0,d=t.edgepaths.map(function(t,e){return e}),g=!0;d.length;){for(s=h.smoothopen(t.edgepaths[f],t.smoothing),u+=g?s:s.replace(/^M/,"L"),d.splice(d.indexOf(f),1),n=t.edgepaths[f][t.edgepaths[f].length-1],o=-1,i=0;i<4;i++){if(!n){p.log("Missing end?",f,t);break}for(!function(t){return Math.abs(t[1]-e[0][1])<.01}(n)||r(n)?!function(t){return Math.abs(t[0]-e[0][0])<.01}(n)?!function(t){return Math.abs(t[1]-e[2][1])<.01}(n)?r(n)&&(a=e[2]):a=e[3]:a=e[0]:a=e[1],l=0;l=0&&(a=v,o=l):Math.abs(n[1]-a[1])<.01?Math.abs(n[1]-v[1])<.01&&(v[0]-n[0])*(a[0]-v[0])>=0&&(a=v,o=l):p.log("endpt to newendpt is not vert. or horz.",n,a,v)}if(n=a,o>=0)break;u+="L"+a}if(o===t.edgepaths.length){p.log("unclosed perimeter path");break}f=o,g=-1===d.indexOf(f),g&&(f=d[0],u+="Z")}for(f=0;fn.center?n.right-o:o-n.left)/(c+Math.abs(Math.sin(s)*i)),d=(l>n.middle?n.bottom-l:l-n.top)/(Math.abs(u)+Math.cos(s)*i);if(f<1||d<1)return 1/0;var h=k.EDGECOST*(1/(f-1)+1/(d-1));h+=k.ANGLECOST*s*s;for(var g=o-c,v=l-u,y=o+c,m=l+u,x=0;x2*k.MAXCOST)break;h&&(o/=2),i=s-o/2,l=i+1.5*o}if(d<=k.MAXCOST)return u},r.addLabelData=function(t,e,r,n){var a=e.width/2,i=e.height/2,o=t.x,l=t.y,s=t.theta,c=Math.sin(s),u=Math.cos(s),f=a*u,d=i*c,p=a*c,h=-i*u,g=[[o-f-d,l-p-h],[o+f-d,l+p-h],[o+f+d,l+p+h],[o-f+d,l-p+h]];r.push({text:e.text,x:o,y:l,dy:e.dy,theta:s,level:e.level,width:e.width,height:e.height}),n.push(g)},r.drawLabels=function(t,e,r,n,a){var i=t.selectAll("text").data(e,function(t){return t.text+","+t.x+","+t.y+","+t.theta});if(i.exit().remove(),i.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each(function(t){var e=t.x+Math.sin(t.theta)*t.dy,n=t.y-Math.cos(t.theta)*t.dy;d.select(this).text(t.text).attr({x:e,y:n,transform:"rotate("+180*t.theta/Math.PI+" "+e+" "+n+")"}).call(g.convertToTspans,r)}),a){for(var o="",l=0;lO){r("x scale is not linear");break}}if(m.length&&"fast"===C){var D=(m[m.length-1]-m[0])/(m.length-1),E=Math.abs(D/100);for(w=0;wE){r("y scale is not linear");break}}}var P=u(_),I="scaled"===e.xtype?"":g,N=h(e,I,v,y,P,k),R="scaled"===e.ytype?"":m,F=h(e,R,x,b,_.length,M);L||(i.expand(k,N),i.expand(M,F));var j={x:N,y:F,z:_,text:e.text};if(l(e,_,"","z"),A&&e.contours&&"heatmap"===e.contours.coloring){var B={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};j.xfill=h(B,I,v,y,P,k),j.yfill=h(B,R,x,b,_.length,M)}return[j]}},{"../../components/colorscale/calc":47,"../../lib":156,"../../plots/cartesian/axes":196,"../../registry":240,"../histogram2d/calc":314,"./clean_2d_array":290,"./convert_column_xyz":292,"./find_empties":294,"./has_columns":295,"./interp2d":298,"./make_bound_array":299,"./max_row_length":300}],290:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){var r,a,i,o,l,s;if(e){for(r=0,l=0;l=0;o--)i=d[o],r=i[0],a=i[1],(l=((f[[r-1,a]]||g)[2]+(f[[r+1,a]]||g)[2]+(f[[r,a-1]]||g)[2]+(f[[r,a+1]]||g)[2])/20)&&(s[i]=[r,a,l],d.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(i in s)f[i]=s[i],u.push(s[i])}return u.sort(function(t,e){return e[2]-t[2]})}},{"./max_row_length":300}],295:[function(t,e,r){"use strict";e.exports=function(t){return!Array.isArray(t.z[0])}},{}],296:[function(t,e,r){"use strict";var n=t("../../components/fx"),a=t("../../lib"),i=n.constants.MAXDIST;e.exports=function(t,e,r,o,l){if(!(t.distance=m[0].length||f<0||f>m.length)return}else{if(n.inbox(e-v[0],e-v[v.length-1])>i||n.inbox(r-y[0],r-y[y.length-1])>i)return;if(l){var w;for(b=[2*v[0]-v[1]],w=1;wg&&(y=Math.max(y,Math.abs(t[a][i]-h)/(v-g))))}return y}var i=t("../../lib"),o=[[-1,0],[1,0],[0,-1],[0,1]];e.exports=function(t,e,r){var o,l,s=1;if(Array.isArray(r))for(o=0;o.01;o++)s=a(t,e,n(s));return s>.01&&i.log("interp2d didn't converge quickly",s),t}},{"../../lib":156}],299:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e,r,a,i,o){var l,s,c,u=[],f=n.traceIs(t,"contour"),d=n.traceIs(t,"histogram"),p=n.traceIs(t,"gl2d");if(Array.isArray(e)&&e.length>1&&!d&&"category"!==o.type){var h=e.length;if(!(h<=i))return f?e.slice(0,i):e.slice(0,i+1);if(f||p)u=e.slice(0,i);else if(1===i)u=[e[0]-.5,e[0]+.5];else{for(u=[1.5*e[0]-.5*e[1]],c=1;c0;)x=h.c2p(A[k]),k--;for(x0;)w=g.c2p(T[k]),k--;if(w<_&&(b=_,_=w,w=b,D=!0),L&&(A=r[0].xfill,T=r[0].yfill),"fast"!==C){var E="best"===C?0:.5;m=Math.max(-E*h._length,m),x=Math.min((1+E)*h._length,x),_=Math.max(-E*g._length,_),w=Math.min((1+E)*g._length,w)}var P=Math.round(x-m),I=Math.round(w-_),N=P<=0||I<=0,R=e.plot.select(".imagelayer").selectAll("g.hm."+y).data(N?[]:[0]);if(R.enter().append("g").classed("hm",!0).classed(y,!0),R.exit().remove(),!N){var F,j;"fast"===C?(F=S,j=z):(F=P,j=I);var B=document.createElement("canvas");B.width=F,B.height=j;var q,H,V=B.getContext("2d"),U=l.makeColorScaleFunc(l.extractScale(d.colorscale,d.zmin,d.zmax),{noNumericCheck:!0,returnArray:!0});"fast"===C?(q=O?function(t){return S-1-t}:o.identity,H=D?function(t){return z-1-t}:o.identity):(q=function(t){return o.constrain(Math.round(h.c2p(A[t])-m),0,P)},H=function(t){return o.constrain(Math.round(g.c2p(T[t])-_),0,I)});var G,Z,X,Y,W,Q,$,J=H(0),K=[J,J],tt=O?0:1,et=D?0:1,rt=0,nt=0,at=0,it=0;if(C){var ot,lt=0;try{ot=new Uint8Array(P*I*4)}catch(t){ot=new Array(P*I*4)}if("best"===C){var st,ct,ut,ft=new Array(A.length),dt=new Array(T.length),pt=new Array(P);for(k=0;k0&&i0&&l0&&(n=!0);for(var l=0;li){var o=i-r[t];return r[t]=i,o}}return 0},max:function(t,e,r,a){var i=a[e];if(n(i)){if(i=Number(i),!n(r[t]))return r[t]=i,i;if(r[t]p.size/1.9?p.size:p.size/Math.ceil(p.size/x);var A=p.start+(p.size-x)/2;b=A-x*Math.ceil((A-b)/x)}for(s=0;s=0;i--)a(i);else if("increasing"===e){for(i=1;i=0;i--)t[i]+=t[i+1];"exclude"===r&&(t.push(0),t.shift())}}var c=t("fast-isnumeric"),u=t("../../lib"),f=t("../../plots/cartesian/axes"),d=t("../bar/arrays_to_calcdata"),p=t("./bin_functions"),h=t("./norm_functions"),g=t("./average"),v=t("./clean_bins"),y=t("../../constants/numerical").ONEAVGMONTH;e.exports=function(t,e){if(!0===e.visible){var r,a=[],i=[],o=f.getFromId(t,"h"===e.orientation?e.yaxis||"y":e.xaxis||"x"),l="h"===e.orientation?"y":"x",y={x:"y",y:"x"}[l],m=e[l+"calendar"],x=e.cumulative;v(e,o,l);var b,_,w,k=n(t,e,o,l),M=k[0],A=k[1],T="string"==typeof M.size,L=T?[]:M,C=[],z=[],S=0,O=e.histnorm,D=e.histfunc,E=-1!==O.indexOf("density");x.enabled&&E&&(O=O.replace(/ ?density$/,""),E=!1);var P,I="max"===D||"min"===D,N=I?null:0,R=p.count,F=h[O],j=!1,B=function(t){return o.r2c(t,0,m)};for(Array.isArray(e[y])&&"count"!==D&&(P=e[y],j="avg"===D,R=p[D]),r=B(M.start),_=B(M.end)+(r-f.tickIncrement(r,M.size,!1,m))/1e6;r<_&&a.length<1e6&&(b=f.tickIncrement(r,M.size,!1,m),a.push((r+b)/2),i.push(N),T&&L.push(r),E&&C.push(1/(b-r)),j&&z.push(0),!(b<=r));)r=b;T||"date"!==o.type||(L={start:B(L.start),end:B(L.end),size:L.size});var q=i.length;for(r=0;r=0&&w=U;r--)if(i[r]){G=r;break}for(r=U;r<=G;r++)c(a[r])&&c(i[r])&&V.push({p:a[r],s:i[r],b:0});return 1===V.length&&(V[0].width1=f.tickIncrement(V[0].p,M.size,!1,m)-V[0].p),d(V,e),V}}},{"../../constants/numerical":140,"../../lib":156,"../../plots/cartesian/axes":196,"../bar/arrays_to_calcdata":249,"./average":305,"./bin_functions":307,"./clean_bins":309,"./norm_functions":312,"fast-isnumeric":17}],309:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib").cleanDate,i=t("../../constants/numerical"),o=i.ONEDAY,l=i.BADNUM;e.exports=function(t,e,r){var i=e.type,s=r+"bins",c=t[s];c||(c=t[s]={});var u="date"===i?function(t){return t||0===t?a(t,l,c.calendar):null}:function(t){return n(t)?Number(t):null};c.start=u(c.start),c.end=u(c.end);var f="date"===i?o:1,d=c.size;if(n(d))c.size=d>0?Number(d):f;else if("string"!=typeof d)c.size=f;else{var p=d.charAt(0),h=d.substr(1);h=n(h)?Number(h):0,(h<=0||"date"!==i||"M"!==p||h!==Math.round(h))&&(c.size=f)}var g="autobin"+r;"boolean"!=typeof t[g]&&(t[g]=!((c.start||0===c.start)&&(c.end||0===c.end))),t[g]||delete t["nbins"+r]}},{"../../constants/numerical":140,"../../lib":156,"fast-isnumeric":17}],310:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("../../components/color"),o=t("./bin_defaults"),l=t("../bar/style_defaults"),s=t("../../components/errorbars/defaults"),c=t("./attributes");e.exports=function(t,e,r,u){function f(r,n){return a.coerce(t,e,c,r,n)}var d=f("x"),p=f("y");f("cumulative.enabled")&&(f("cumulative.direction"),f("cumulative.currentbin")),f("text");var h=f("orientation",p&&!d?"h":"v"),g=e["v"===h?"x":"y"];if(!g||!g.length)return void(e.visible=!1);n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],u),e["h"===h?"x":"y"]&&f("histfunc"),o(t,e,f,"h"===h?["y"]:["x"]),l(t,e,f,r,u),s(t,e,i.defaultLine,{axis:"y"}),s(t,e,i.defaultLine,{axis:"x",inherit:"y"})}},{"../../components/color":41,"../../components/errorbars/defaults":70,"../../lib":156,"../../registry":240,"../bar/style_defaults":262,"./attributes":304,"./bin_defaults":306}],311:[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.selectPoints=t("../bar/select"),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":206,"../bar/hover":253,"../bar/layout_attributes":255,"../bar/layout_defaults":256,"../bar/plot":257,"../bar/select":258,"../bar/set_positions":259,"../bar/style":261,"../scatter/colorbar":336,"./attributes":304,"./calc":308,"./defaults":310}],312:[function(t,e,r){"use strict";e.exports={percent:function(t,e){for(var r=t.length,n=100/e,a=0;aM&&g.splice(M,g.length-M),y.length>M&&y.splice(M,y.length-M),!e.autobinx&&e.xbins&&null!==e.xbins.start&&null!==e.xbins.end||(e.xbins=a.autoBin(g,h,e.nbinsx,"2d",m),"histogram2dcontour"===e.type&&(e.xbins.start=w(a.tickIncrement(b(e.xbins.start),e.xbins.size,!0,m)),e.xbins.end=w(a.tickIncrement(b(e.xbins.end),e.xbins.size,!1,m))),e._input.xbins=e.xbins,e._input.autobinx=e.autobinx),!e.autobiny&&e.ybins&&null!==e.ybins.start&&null!==e.ybins.end||(e.ybins=a.autoBin(y,v,e.nbinsy,"2d",x),"histogram2dcontour"===e.type&&(e.ybins.start=k(a.tickIncrement(_(e.ybins.start),e.ybins.size,!0,x)),e.ybins.end=k(a.tickIncrement(_(e.ybins.end),e.ybins.size,!1,x))),e._input.ybins=e.ybins,e._input.autobiny=e.autobiny),d=[];var A,T,L=[],C=[],z="string"==typeof e.xbins.size,S="string"==typeof e.ybins.size,O=z?[]:e.xbins,D=S?[]:e.ybins,E=0,P=[],I=e.histnorm,N=e.histfunc,R=-1!==I.indexOf("density"),F="max"===N||"min"===N,j=F?null:0,B=i.count,q=o[I],H=!1,V=[],U=[],G="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";G&&"count"!==N&&(H="avg"===N,B=i[N]);var Z=e.xbins,X=b(Z.start),Y=b(Z.end)+(X-a.tickIncrement(X,Z.size,!1,m))/1e6;for(p=X;p=0&&A=0&&T<$&&(E+=B(A,p,d[T],G,P[T]));if(H)for(T=0;T<$;T++)E+=l(d[T],P[T]);if(q)for(T=0;T<$;T++)q(d[T],E,V,U[T]);return{x:g,x0:r,dx:c,y:y,y0:u,dy:f,z:d}}},{"../../lib":156,"../../plots/cartesian/axes":196,"../histogram/average":305,"../histogram/bin_functions":307,"../histogram/clean_bins":309,"../histogram/norm_functions":312}],315:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./sample_defaults"),i=t("../../components/colorscale/defaults"),o=t("./attributes");e.exports=function(t,e,r,l){function s(r,a){return n.coerce(t,e,o,r,a)}a(t,e,s,l),!1===s("zsmooth")&&(s("xgap"),s("ygap")),i(t,e,l,s,{prefix:"",cLetter:"z"})}},{"../../components/colorscale/defaults":50,"../../lib":156,"./attributes":313,"./sample_defaults":317}],316:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("../heatmap/calc"),n.plot=t("../heatmap/plot"),n.colorbar=t("../heatmap/colorbar"),n.style=t("../heatmap/style"),n.hoverPoints=t("../heatmap/hover"),n.moduleType="trace",n.name="histogram2d",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","2dMap","histogram"],n.meta={},e.exports=n},{"../../plots/cartesian":206,"../heatmap/calc":289,"../heatmap/colorbar":291,"../heatmap/hover":296,"../heatmap/plot":301,"../heatmap/style":302,"./attributes":313,"./defaults":315}],317:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../histogram/bin_defaults");e.exports=function(t,e,r,i){var o=r("x"),l=r("y");if(!(o&&o.length&&l&&l.length))return void(e.visible=!1);n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],i),(r("z")||r("marker.color"))&&r("histfunc"),a(t,e,r,["x","y"])}},{"../../registry":240,"../histogram/bin_defaults":306}],318:[function(t,e,r){"use strict";var n=t("../histogram2d/attributes"),a=t("../contour/attributes"),i=t("../../components/colorscale/attributes"),o=t("../../components/colorbar/attributes"),l=t("../../lib/extend").extendFlat;e.exports=l({x:n.x,y:n.y,z:n.z,marker:n.marker,histnorm:n.histnorm,histfunc:n.histfunc,autobinx:n.autobinx,nbinsx:n.nbinsx,xbins:n.xbins,autobiny:n.autobiny,nbinsy:n.nbinsy,ybins:n.ybins,autocontour:a.autocontour,ncontours:a.ncontours,contours:a.contours,line:a.line},i,{zmin:l({},i.zmin,{editType:"calc"}),zmax:l({},i.zmax,{editType:"calc"})},{colorbar:o})},{"../../components/colorbar/attributes":42,"../../components/colorscale/attributes":46,"../../lib/extend":150,"../contour/attributes":273,"../histogram2d/attributes":313}],319:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../histogram2d/sample_defaults"),i=t("../contour/contours_defaults"),o=t("../contour/style_defaults"),l=t("./attributes");e.exports=function(t,e,r,s){function c(r,a){return n.coerce(t,e,l,r,a)}a(t,e,c,s),i(t,e,c),o(t,e,c,s)}},{"../../lib":156,"../contour/contours_defaults":277,"../contour/style_defaults":287,"../histogram2d/sample_defaults":317,"./attributes":318}],320:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("../contour/calc"),n.plot=t("../contour/plot").plot,n.style=t("../contour/style"),n.colorbar=t("../contour/colorbar"),n.hoverPoints=t("../contour/hover"),n.moduleType="trace",n.name="histogram2dcontour",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","2dMap","contour","histogram"],n.meta={},e.exports=n},{"../../plots/cartesian":206,"../contour/calc":274,"../contour/colorbar":275,"../contour/hover":281,"../contour/plot":285,"../contour/style":286,"./attributes":318,"./defaults":319}],321:[function(t,e,r){"use strict";var n=t("../../components/color/attributes"),a=t("../../plots/font_attributes"),i=t("../../plots/attributes"),o=t("../../lib/extend").extendFlat,l=a({editType:"calc",colorEditType:"style"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:n.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},editType:"calc"},text:{valType:"data_array",editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:o({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc"},textfont:o({},l,{}),insidetextfont:o({},l,{}),outsidetextfont:o({},l,{}),domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},y:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},editType:"calc"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"number",min:-360,max:360,dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}},{"../../components/color/attributes":40,"../../lib/extend":150,"../../plots/attributes":194,"../../plots/font_attributes":220}],322:[function(t,e,r){"use strict";function n(t,e){for(var r=[],n=0;n")}return g};var s},{"../../components/color":41,"./helpers":325,"fast-isnumeric":17,tinycolor2:23}],324:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes");e.exports=function(t,e,r,i){function o(r,i){return n.coerce(t,e,a,r,i)}var l=n.coerceFont,s=o("values");if(!Array.isArray(s)||!s.length)return void(e.visible=!1);var c=o("labels");Array.isArray(c)||(o("label0"),o("dlabel")),o("marker.line.width")&&o("marker.line.color");var u=o("marker.colors");Array.isArray(u)||(e.marker.colors=[]),o("scalegroup");var f=o("text"),d=o("textinfo",Array.isArray(f)?"text+percent":"percent");if(o("hovertext"),d&&"none"!==d){var p=o("textposition"),h=Array.isArray(p)||"auto"===p,g=h||"inside"===p,v=h||"outside"===p;if(g||v){var y=l(o,"textfont",i.font);g&&l(o,"insidetextfont",y),v&&l(o,"outsidetextfont",y)}}o("domain.x"),o("domain.y"),o("hole"),o("sort"),o("direction"),o("rotation"),o("pull")}},{"../../lib":156,"./attributes":321}],325:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)}},{"../../lib":156}],326:[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":321,"./base_plot":322,"./calc":323,"./defaults":324,"./layout_attributes":327,"./layout_defaults":328,"./plot":329,"./style":330,"./style_one":331}],327:[function(t,e,r){"use strict";e.exports={hiddenlabels:{valType:"data_array",editType:"calc"}}},{}],328:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){!function(r,i){n.coerce(t,e,a,r,i)}("hiddenlabels")}},{"../../lib":156,"./layout_attributes":327}],329:[function(t,e,r){"use strict";function n(t,e,r){var n=Math.sqrt(t.width*t.width+t.height*t.height),i=t.width/t.height,o=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=i+1/(2*Math.tan(o)),f=r.r*Math.min(1/(Math.sqrt(u*u+.5)+u),l/(Math.sqrt(i*i+l/2)+i)),d={scale:2*f/t.height,rCenter:Math.cos(f/r.r)-f*i/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},p=1/i,h=p+1/(2*Math.tan(o)),g=r.r*Math.min(1/(Math.sqrt(h*h+.5)+h),l/(Math.sqrt(p*p+l/2)+p)),v={scale:2*g/t.width,rCenter:Math.cos(g/r.r)-g/i/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},y=v.scale>d.scale?v:d;return c.scale<1&&y.scale>c.scale?y: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 i(t,e){var r=e.pxmid[0],n=e.pxmid[1],a=t.width/2,i=t.height/2;return r<0&&(a*=-1),n<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+r*r/(n*n)),outside:!0}}function o(t,e){function r(t,e){return t.pxmid[1]-e.pxmid[1]}function n(t,e){return e.pxmid[1]-t.pxmid[1]}var a,i,o,l,s,c,u,f,d,p,h,g,v;for(i=0;i<2;i++)for(o=i?r:n,s=i?Math.max:Math.min,u=i?1:-1,a=0;a<2;a++){for(l=a?Math.max:Math.min,c=a?1:-1,f=t[i][a],f.sort(o),d=t[1-i][a],p=d.concat(f),g=[],h=0;h0&&(t.labelExtraY=x),Array.isArray(e.pull))for(a=0;a=e.pull[o.i]||((t.pxmid[1]-o.pxmid[1])*u>0?(f=o.cyFinal+s(o.px0[1],o.px1[1]),(x=f-v-t.labelExtraY)*u>0&&(t.labelExtraY+=x)):(y+t.labelExtraY-m)*u>0&&(n=3*c*Math.abs(a-p.indexOf(t)),d=o.cxFinal+l(o.px0[0],o.px1[0]),(h=d+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*c>0&&(t.labelExtraX+=h)))}(g[h],y)}}}function l(t,e){var r,n,a,i,o,l,s,u,f,d,p=[];for(a=0;au&&(u=l.pull[i]);o.r=Math.min(r/c(l.tilt,Math.sin(s),l.depth),n/c(l.tilt,Math.cos(s),l.depth))/(2+2*u),o.cx=e.l+e.w*(l.domain.x[1]+l.domain.x[0])/2,o.cy=e.t+e.h*(2-l.domain.y[1]-l.domain.y[0])/2,l.scalegroup&&-1===p.indexOf(l.scalegroup)&&p.push(l.scalegroup)}for(i=0;if.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("../../components/fx"),d=t("../../components/color"),p=t("../../components/drawing"),h=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],v=c.trace,y=(v.depth||0)*c.r*Math.sin(0)/2,m=v.tiltaxis||0,x=m*Math.PI/180,b=[y*Math.sin(x),y*Math.cos(x)],_=c.r*Math.cos(0),w=l.selectAll("g.part").data(v.tilt?["top","sides"]:["top"]);w.enter().append("g").attr("class",function(t){return t+" part"}),w.exit().remove(),w.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=[[[],[]],[[],[]]],y=!1;l.each(function(e){function o(n){n.originalEvent=u.event;var i=t._fullLayout,o=t._fullData[v.index],l=f.castHoverinfo(o,i,e.i);if("all"===l&&(l="label+text+value+percent+name"),t._dragging||!1===i.hovermode||"none"===l||"skip"===l||!l)return void f.hover(t,n,"pie");var s=a(e,c),d=w+e.pxmid[0]*(1-s),p=k+e.pxmid[1]*(1-s),h=r.separators,y=[];-1!==l.indexOf("label")&&y.push(e.label),-1!==l.indexOf("text")&&(o.hovertext?y.push(Array.isArray(o.hovertext)?o.hovertext[e.i]:o.hovertext):o.text&&o.text[e.i]&&y.push(o.text[e.i])),-1!==l.indexOf("value")&&y.push(g.formatPieValue(e.v,h)),-1!==l.indexOf("percent")&&y.push(g.formatPiePercent(e.v/c.vTotal,h)),f.loneHover({x0:d-s*c.r,x1:d+s*c.r,y:p,text:y.join("
"),name:-1!==l.indexOf("name")?o.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:f.castHoverOption(v,e.i,"bgcolor")||e.color,borderColor:f.castHoverOption(v,e.i,"bordercolor"),fontFamily:f.castHoverOption(v,e.i,"font.family"),fontSize:f.castHoverOption(v,e.i,"font.size"),fontColor:f.castHoverOption(v,e.i,"font.color")},{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:t}),f.hover(t,n,"pie"),T=!0}function l(e){e.originalEvent=u.event,t.emit("plotly_unhover",{event:u.event,points:[e]}),T&&(f.loneUnhover(r._hoverlayer.node()),T=!1)}function d(){t._hoverdata=[e],t._hoverdata.trace=c.trace,f.click(t,u.event)}function x(t,r,n,a){return"a"+a*c.r+","+a*_+" "+m+" "+e.largeArc+(n?" 1 ":" 0 ")+a*(r[0]-t[0])+","+a*(r[1]-t[1])}if(e.hidden)return void u.select(this).selectAll("path,g").remove();e.pointNumber=e.i,e.curveNumber=v.index,s[e.pxmid[1]<0?0:1][e.pxmid[0]<0?0:1].push(e);var w=c.cx+b[0],k=c.cy+b[1],M=u.select(this),A=M.selectAll("path.surface").data([e]),T=!1;if(A.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),M.select("path.textline").remove(),M.on("mouseover",o).on("mouseout",l).on("click",d),v.pull){var L=+(Array.isArray(v.pull)?v.pull[e.i]:v.pull)||0;L>0&&(w+=L*e.pxmid[0],k+=L*e.pxmid[1])}e.cxFinal=w,e.cyFinal=k;var C=v.hole;if(e.v===c.vTotal){var z="M"+(w+e.px0[0])+","+(k+e.px0[1])+x(e.px0,e.pxmid,!0,1)+x(e.pxmid,e.px0,!0,1)+"Z";C?A.attr("d","M"+(w+C*e.px0[0])+","+(k+C*e.px0[1])+x(e.px0,e.pxmid,!1,C)+x(e.pxmid,e.px0,!1,C)+"Z"+z):A.attr("d",z)}else{var S=x(e.px0,e.px1,!0,1);if(C){var O=1-C;A.attr("d","M"+(w+C*e.px1[0])+","+(k+C*e.px1[1])+x(e.px1,e.px0,!1,C)+"l"+O*e.px0[0]+","+O*e.px0[1]+S+"Z")}else A.attr("d","M"+w+","+k+"l"+e.px0[0]+","+e.px0[1]+S+"Z")}var D=Array.isArray(v.textposition)?v.textposition[e.i]:v.textposition,E=M.selectAll("g.slicetext").data(e.text&&"none"!==D?[0]:[]);E.enter().append("g").classed("slicetext",!0),E.exit().remove(),E.each(function(){var r=u.select(this).selectAll("text").data([0]);r.enter().append("text").attr("data-notex",1),r.exit().remove(),r.text(e.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(p.font,"outside"===D?v.outsidetextfont:v.insidetextfont).call(h.convertToTspans,t);var a,o=p.bBox(r.node());"outside"===D?a=i(o,e):(a=n(o,e,c),"auto"===D&&a.scale<1&&(r.call(p.font,v.outsidetextfont),v.outsidetextfont.family===v.insidetextfont.family&&v.outsidetextfont.size===v.insidetextfont.size||(o=p.bBox(r.node())),a=i(o,e)));var l=w+e.pxmid[0]*a.rCenter+(a.x||0),s=k+e.pxmid[1]*a.rCenter+(a.y||0);a.outside&&(e.yLabelMin=s-o.height/2,e.yLabelMid=s,e.yLabelMax=s+o.height/2,e.labelExtraX=0,e.labelExtraY=0,y=!0),r.attr("transform","translate("+l+","+s+")"+(a.scale<1?"scale("+a.scale+")":"")+(a.rotate?"rotate("+a.rotate+")":"")+"translate("+-(o.left+o.right)/2+","+-(o.top+o.bottom)/2+")")})}),y&&o(s,v),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],i="M"+n+","+a,o=(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]);Math.abs(l)>Math.abs(s)?i+="l"+s*t.pxmid[0]/t.pxmid[1]+","+s+"H"+(n+t.labelExtraX+o):i+="l"+t.labelExtraX+","+l+"v"+(s-l)+"h"+o}else i+="V"+(t.yLabelMid+t.labelExtraY)+"h"+o;e.append("path").classed("textline",!0).call(d.stroke,v.outsidetextfont.color).attr({"stroke-width":Math.min(2,v.outsidetextfont.size/8),d:i,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":41,"../../components/drawing":65,"../../components/fx":82,"../../lib/svg_text_utils":176,"./helpers":325,d3:14}],330:[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,i=n.select(this);i.style({opacity:r.opacity}),i.selectAll(".top path.surface").each(function(t){n.select(this).call(a,t,r)})})}},{"./style_one":331,d3:14}],331:[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 i=r.marker.line.width||0;Array.isArray(i)&&(i=i[e.i]||0),t.style({"stroke-width":i}).call(n.fill,e.color).call(n.stroke,a)}},{"../../components/color":41}],332:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rg&&p.splice(g,p.length-g),h.length>g&&h.splice(g,h.length-g);var v={padded:!0},y={padded:!0};if(o.hasMarkers(e)){if(r=e.marker,c=r.size,Array.isArray(c)){var m={type:"linear"};a.setConvert(m),c=m.makeCalcdata(e.marker,"size"),c.length>g&&c.splice(g,c.length-g)}var x,b=1.6*(e.marker.sizeref||1);x="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/b),3)}:function(t){return Math.max((t||0)/b,3)},v.ppad=y.ppad=Array.isArray(c)?c.map(x):x(c)}l(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||p[0]===p[g-1]&&h[0]===h[g-1]?e.error_y.visible||-1===["tonexty","tozeroy"].indexOf(e.fill)&&(o.hasMarkers(e)||o.hasText(e))||(v.padded=!1,v.ppad=0):v.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||p[0]===p[g-1]&&h[0]===h[g-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(y.padded=!1):y.tozero=!0,a.expand(f,p,v),a.expand(d,h,y);var _=new Array(g);for(u=0;u=0;a--){var i=t[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],336:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../plots/plots"),o=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 i.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 p=e[0].t.cb=l(t,c),h=o.makeColorScaleFunc(o.extractScale(s.colorscale,f,d),{noNumericCheck:!0});p.fillcolor(h).filllevels({start:f,end:d,size:(d-f)/254}).options(s.colorbar)()}},{"../../components/colorbar/draw":44,"../../components/colorscale":55,"../../lib":156,"../../plots/plots":225,"fast-isnumeric":17}],337:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/calc"),i=t("./subtypes");e.exports=function(t){i.hasLines(t)&&n(t,"line")&&a(t,t.line.color,"line","c"),i.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":47,"../../components/colorscale/has_colorscale":54,"./subtypes":354}],338:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20}},{}],339:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("./constants"),o=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"),p=t("../../components/errorbars/defaults");e.exports=function(t,e,r,h){function g(r,i){return n.coerce(t,e,a,r,i)}var v=l(t,e,h,g),y=vV!=I>=V&&(D=S[C-1][0],E=S[C][0],O=D+(E-D)*(V-P)/(I-P),j=Math.min(j,O),B=Math.max(B,O));j=Math.max(j,0),B=Math.min(B,p._length);var U=l.defaultLine;return l.opacity(d.fillcolor)?U=d.fillcolor:l.opacity((d.line||{}).color)&&(U=d.line.color),n.extendFlat(t,{distance:c+10,x0:j,x1:B,y0:V,y1:V,color:U}),delete t.index,d.text&&!Array.isArray(d.text)?t.text=String(d.text):t.text=d.name,[t]}}}},{"../../components/color":41,"../../components/errorbars":71,"../../components/fx":82,"../../lib":156,"./fill_hover_text":340,"./get_trace_color":342}],344:[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","scatter-like"],n.meta={},e.exports=n},{"../../plots/cartesian":206,"./arrays_to_calcdata":332,"./attributes":333,"./calc":334,"./clean_data":335,"./colorbar":336,"./defaults":339,"./hover":343,"./plot":351,"./select":352,"./style":353,"./subtypes":354}],345:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,i,o,l){var s=(t.marker||{}).color;if(o("line.color",r),n(t,"line"))a(t,e,i,o,{prefix:"line.",cLetter:"c"});else{o("line.color",!Array.isArray(s)&&s||r)}o("line.width"),(l||{}).noDash||o("line.dash")}},{"../../components/colorscale/defaults":50,"../../components/colorscale/has_colorscale":54}],346:[function(t,e,r){"use strict";var n=t("../../constants/numerical").BADNUM,a=t("../../lib"),i=a.segmentsIntersect,o=a.constrain,l=t("./constants");e.exports=function(t,e){function r(e){var r=I.c2p(t[e].x),a=N.c2p(t[e].y);return r!==n&&a!==n&&[r,a]}function s(t){var e=t[0]/I._length,r=t[1]/N._length;return(1+l.toleranceGrowth*Math.max(0,-e,e-1,-r,r-1))*j}function c(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function u(t,e){for(var r=[],n=0,a=0;a<4;a++){var o=at[a],l=i(t[0],t[1],e[0],e[1],o[0],o[1],o[2],o[3]);l&&(!n||Math.abs(l.x-r[0][0])>1||Math.abs(l.y-r[0][1])>1)&&(l=[l.x,l.y],n&&c(l,t)et||t[1]nt)return[o(t[0],tt,et),o(t[1],rt,nt)]}function d(t,e){return t[0]===e[0]&&(t[0]===tt||t[0]===et)||(t[1]===e[1]&&(t[1]===rt||t[1]===nt)||void 0)}function p(t,e){var r=[],n=f(t),a=f(e);return n&&a&&d(n,a)?r:(n&&r.push(n),a&&r.push(a),r)}function h(t,e,r){return function(n,i){var o=f(n),l=f(i),s=[];if(o&&l&&d(o,l))return s;o&&s.push(o),l&&s.push(l);var c=2*a.constrain((n[t]+i[t])/2,e,r)-((o||n)[t]+(l||i)[t]);if(c){var u;u=o&&l?c>0==o[t]>l[t]?o:l:o||l,u[t]+=c}return s}}function g(t,e){var r=e[0]-t[0],n=(e[1]-t[1])/r;return(t[1]*e[0]-e[1]*t[0])/r>0?[n>0?tt:et,nt]:[n>0?et:tt,rt]}function v(t){var e=t[0],r=t[1],n=e===U[G-1][0],a=r===U[G-1][1];if(!n||!a)if(G>1){var i=e===U[G-2][0],o=r===U[G-2][1];n&&(e===tt||e===et)&&i?o?G--:U[G-1]=t:a&&(r===rt||r===nt)&&o?i?G--:U[G-1]=t:U[G++]=t}else U[G++]=t}function y(t){U[G-1][0]!==t[0]&&U[G-1][1]!==t[1]&&v([Y,W]),v(t),Q=null,Y=W=0}function m(t){if(Z=t[0]et?et:0,X=t[1]nt?nt:0,Z||X){if(G)if(Q){var e=J(Q,t);e.length>1&&(y(e[0]),U[G++]=e[1])}else $=J(U[G-1],t)[0],U[G++]=$;else U[G++]=[Z||t[0],X||t[1]];var r=U[G-1];Z&&X&&(r[0]!==Z||r[1]!==X)?(Q&&(Y!==Z&&W!==X?v(Y&&W?g(Q,t):[Y||Z,W||X]):Y&&W&&v([Y,W])),v([Z,X])):Y-Z&&W-X&&v([Z||Y,X||W]),Q=t,Y=Z,W=X}else Q&&y(J(Q,t)[0]),U[G++]=t}var x,b,_,w,k,M,A,T,L,C,z,S,O,D,E,P,I=e.xaxis,N=e.yaxis,R=e.simplify,F=e.connectGaps,j=e.baseTolerance,B=e.shape,q="linear"===B,H=[],V=l.minTolerance,U=new Array(t.length),G=0;R||(j=V=-1);var Z,X,Y,W,Q,$,J,K=l.maxScreensAway,tt=-I._length*K,et=I._length*(1+K),rt=-N._length*K,nt=N._length*(1+K),at=[[tt,rt,et,rt],[et,rt,et,nt],[et,nt,tt,nt],[tt,nt,tt,rt]];for("linear"===B||"spline"===B?J=u:"hv"===B||"vh"===B?J=p:"hvh"===B?J=h(0,tt,et):"vhv"===B&&(J=h(1,rt,nt)),x=0;xs(M))break;_=M,O=L[0]*T[0]+L[1]*T[1],O>z?(z=O,w=M,A=!1):O=t.length||!M)break;m(M),b=M}}else m(w)}Q&&v([Y||Q[0],W||Q[1]]),H.push(U.slice(0,G))}return H}},{"../../constants/numerical":140,"../../lib":156,"./constants":338}],347:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],348:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n,a,i=null,o=0;o0?Math.max(e,a):0}}},{"fast-isnumeric":17}],350:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,l,s,c){var u,f=o.isBubble(t),d=(t.line||{}).color;if(c=c||{},d&&(r=d),s("marker.symbol"),s("marker.opacity",f?.7:1),s("marker.size"),s("marker.color",r),a(t,"marker")&&i(t,e,l,s,{prefix:"marker.",cLetter:"c"}),c.noLine||(u=d&&!Array.isArray(d)&&e.marker.color!==d?d:f?n.background:n.defaultLine,s("marker.line.color",u),a(t,"marker.line")&&i(t,e,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",f?1:0)),f&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient){"none"!==s("marker.gradient.type")&&s("marker.gradient.color")}}},{"../../components/color":41,"../../components/colorscale/defaults":50,"../../components/colorscale/has_colorscale":54,"./subtypes":354}],351:[function(t,e,r){"use strict";function n(t,e,r){var n;e.selectAll("g.trace").each(function(t){var e=o.select(this);if(n=t[0].trace,n._nexttrace){if(n._nextFill=e.select(".js-fill.js-tonext"),!n._nextFill.size()){var a=":first-child";e.select(".js-fill.js-tozero").size()&&(a+=" + *"),n._nextFill=e.insert("path",a).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),n._nextFill=null;n.fill&&("tozero"===n.fill.substr(0,6)||"toself"===n.fill||"to"===n.fill.substr(0,2)&&!n._prevtrace)?(n._ownFill=e.select(".js-fill.js-tozero"),n._ownFill.size()||(n._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),n._ownFill=null),e.selectAll(".js-fill").call(s.setClipUrl,r.layerClipId)})}function a(t,e,r,n,a,d,h){function g(t){return k?t.transition():t}function v(t){return t.filter(function(t){return t.vis})}function y(t){return t.id}function m(t){if(t.ids)return y}function x(){return!1}function b(e){var n,a,i,c=e[0].trace,f=o.select(this),d=u.hasMarkers(c),p=u.hasText(c),h=m(c),y=x,b=x;d&&(y=c.marker.maxdisplayed||c._needsCull?v:l.identity),p&&(b=c.marker.maxdisplayed||c._needsCull?v:l.identity),a=f.selectAll("path.point"),n=a.data(y,h);var _=n.enter().append("path").classed("point",!0);k&&_.call(s.pointStyle,c,t).call(s.translatePoints,M,A).style("opacity",0).transition().style("opacity",1);var w=d&&s.tryColorscale(c.marker,""),T=d&&s.tryColorscale(c.marker,"line");n.order(),n.each(function(e){var n=o.select(this),a=g(n);i=s.translatePoint(e,a,M,A),i?(s.singlePointStyle(e,a,c,w,T,t),r.layerClipId&&s.hideOutsideRangePoint(e,a,M,A),c.customdata&&n.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()}),k?n.exit().transition().style("opacity",0).remove():n.exit().remove(),a=f.selectAll("g"),n=a.data(b,h),n.enter().append("g").classed("textpoint",!0).append("text"),n.order(),n.each(function(t){var e=o.select(this),n=g(e.select("text"));i=s.translatePoint(t,n,M,A),i?r.layerClipId&&s.hideOutsideRangePoint(t,e,M,A):e.remove()}),n.selectAll("text").call(s.textPointStyle,c,t).each(function(t){var e=M.c2p(t.x),r=A.c2p(t.y);o.select(this).selectAll("tspan.line").each(function(){g(o.select(this)).attr({x:e,y:r})})}),n.exit().remove()}var _,w;i(t,e,r,n,a);var k=!!h&&h.duration>0,M=r.xaxis,A=r.yaxis,T=n[0].trace,L=T.line,C=o.select(d);if(C.call(c.plot,r,h),!0===T.visible){g(C).style("opacity",T.opacity);var z,S,O=T.fill.charAt(T.fill.length-1);"x"!==O&&"y"!==O&&(O=""),n[0].node3=C;var D="",E=[],P=T._prevtrace;P&&(D=P._prevRevpath||"",S=P._nextFill,E=P._polygons);var I,N,R,F,j,B,q,H,V,U="",G="",Z=[],X=l.noop;if(z=T._ownFill,u.hasLines(T)||"none"!==T.fill){for(S&&S.datum(n),-1!==["hv","vh","hvh","vhv"].indexOf(L.shape)?(R=s.steps(L.shape),F=s.steps(L.shape.split("").reverse().join(""))):R=F="spline"===L.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?s.smoothclosed(t.slice(1),L.smoothing):s.smoothopen(t,L.smoothing)}:function(t){return"M"+t.join("L")},j=function(t){return F(t.reverse())},Z=f(n,{xaxis:M,yaxis:A,connectGaps:T.connectgaps,baseTolerance:Math.max(L.width||1,3)/4,shape:L.shape,simplify:L.simplify}),V=T._polygons=new Array(Z.length),w=0;w1){var r=o.select(this);if(r.datum(n),t)g(r.style("opacity",0).attr("d",I).call(s.lineGroupStyle)).style("opacity",1);else{var a=g(r);a.attr("d",I),s.singleLineStyle(n,a)}}}}}var Y=C.selectAll(".js-line").data(Z);g(Y.exit()).style("opacity",0).remove(),Y.each(X(!1)),Y.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(X(!0)),s.setClipUrl(Y,r.layerClipId),Z.length&&(z?B&&H&&(O?("y"===O?B[1]=H[1]=A.c2p(0,!0):"x"===O&&(B[0]=H[0]=M.c2p(0,!0)),g(z).attr("d","M"+H+"L"+B+"L"+U.substr(1)).call(s.singleFillStyle)):g(z).attr("d",U+"Z").call(s.singleFillStyle)):"tonext"===T.fill.substr(0,6)&&U&&D&&("tonext"===T.fill?g(S).attr("d",U+"Z"+D+"Z").call(s.singleFillStyle):g(S).attr("d",U+"L"+D.substr(1)+"Z").call(s.singleFillStyle),T._polygons=T._polygons.concat(E)),T._prevRevpath=G,T._prevPolygons=V);var W=C.selectAll(".points");_=W.data([n]),W.each(b),_.enter().append("g").classed("points",!0).each(b),_.exit().remove(),_.each(function(t){var e=!1===t[0].trace.cliponaxis;s.setClipUrl(o.select(this),e?null:r.layerClipId)})}}function i(t,e,r,n,a){var i=r.xaxis,s=r.yaxis,c=o.extent(l.simpleMap(i.range,i.r2c)),f=o.extent(l.simpleMap(s.range,s.r2c)),d=n[0].trace;if(u.hasMarkers(d)){var p=d.marker.maxdisplayed;if(0!==p){var h=n.filter(function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=f[0]&&t.y<=f[1]}),g=Math.ceil(h.length/p),v=0;a.forEach(function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;for(u=h.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),d(t,e,r),n(t,h,e),s=0,c={};sc[e[0].trace.uid]?1:-1}),v){l&&(p=l());o.transition().duration(i.duration).ease(i.easing).each("end",function(){p&&p()}).each("interrupt",function(){p&&p()}).each(function(){h.selectAll("g.trace").each(function(n,o){a(t,o,e,n,r,this,i)})})}else h.selectAll("g.trace").each(function(n,o){a(t,o,e,n,r,this,i)});g&&f.exit().remove(),h.selectAll("path:not([d])").remove()}},{"../../components/drawing":65,"../../components/errorbars":71,"../../lib":156,"../../lib/polygon":167,"./line_points":346,"./link_traces":348,"./subtypes":354,d3:14}],352:[function(t,e,r){"use strict";var n=t("./subtypes"),a=t("../../constants/interactions").DESELECTDIM;e.exports=function(t,e){var r,i,o,l,s=t.cd,c=t.xaxis,u=t.yaxis,f=[],d=s[0].trace,p=d.marker,h=!n.hasMarkers(d)&&!n.hasText(d);if(!0!==d.visible||h)return[];var g=Array.isArray(p.opacity)?1:p.opacity;if(!1===e)for(r=0;rM&&L.splice(M,L.length-M)}return o(e),l(A,e),A}},{"../../plots/cartesian/axes":196,"../scatter/arrays_to_calcdata":332,"../scatter/colorscale_calc":337,"../scatter/subtypes":354,"fast-isnumeric":17}],359:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../scatter/constants"),i=t("../scatter/subtypes"),o=t("../scatter/marker_defaults"),l=t("../scatter/line_defaults"),s=t("../scatter/line_shape_defaults"),c=t("../scatter/text_defaults"),u=t("../scatter/fillcolor_defaults"),f=t("./attributes");e.exports=function(t,e,r,d){function p(r,a){return n.coerce(t,e,f,r,a)}var h,g=p("a"),v=p("b"),y=p("c");if(g?(h=g.length,v?(h=Math.min(h,v.length),y&&(h=Math.min(h,y.length))):h=y?Math.min(h,y.length):0):v&&y&&(h=Math.min(v.length,y.length)),!h)return void(e.visible=!1);g&&h"),l}}},{"../../plots/cartesian/axes":196,"../scatter/hover":343}],361:[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","scatter-like"],n.meta={},e.exports=n},{"../../plots/ternary":233,"../scatter/colorbar":336,"./attributes":357,"./calc":358,"./defaults":359,"./hover":360,"./plot":362,"./select":363,"./style":364}],362:[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,layerClipId:t._hasClipOnAxisFalse?t.clipIdRelative:null},i=0;iV!=I>=V&&(D=S[C-1][0],E=S[C][0],O=D+(E-D)*(V-P)/(I-P),j=Math.min(j,O),B=Math.max(B,O));j=Math.max(j,0),B=Math.min(B,p._length);var U=l.defaultLine;return l.opacity(d.fillcolor)?U=d.fillcolor:l.opacity((d.line||{}).color)&&(U=d.line.color),n.extendFlat(t,{distance:c+10,x0:j,x1:B,y0:V,y1:V,color:U}),delete t.index,d.text&&!Array.isArray(d.text)?t.text=String(d.text):t.text=d.name,[t]}}}},{"../../components/color":41,"../../components/errorbars":71,"../../components/fx":82,"../../lib":156,"./fill_hover_text":340,"./get_trace_color":342}],344:[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","scatter-like"],n.meta={},e.exports=n},{"../../plots/cartesian":206,"./arrays_to_calcdata":332,"./attributes":333,"./calc":334,"./clean_data":335,"./colorbar":336,"./defaults":339,"./hover":343,"./plot":351,"./select":352,"./style":353,"./subtypes":354}],345:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,i,o,l){var s=(t.marker||{}).color;if(o("line.color",r),n(t,"line"))a(t,e,i,o,{prefix:"line.",cLetter:"c"});else{o("line.color",!Array.isArray(s)&&s||r)}o("line.width"),(l||{}).noDash||o("line.dash")}},{"../../components/colorscale/defaults":50,"../../components/colorscale/has_colorscale":54}],346:[function(t,e,r){"use strict";var n=t("../../constants/numerical").BADNUM,a=t("../../lib"),i=a.segmentsIntersect,o=a.constrain,l=t("./constants");e.exports=function(t,e){function r(e){var r=I.c2p(t[e].x),a=N.c2p(t[e].y);return r!==n&&a!==n&&[r,a]}function s(t){var e=t[0]/I._length,r=t[1]/N._length;return(1+l.toleranceGrowth*Math.max(0,-e,e-1,-r,r-1))*j}function c(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function u(t,e){for(var r=[],n=0,a=0;a<4;a++){var o=at[a],l=i(t[0],t[1],e[0],e[1],o[0],o[1],o[2],o[3]);l&&(!n||Math.abs(l.x-r[0][0])>1||Math.abs(l.y-r[0][1])>1)&&(l=[l.x,l.y],n&&c(l,t)et||t[1]nt)return[o(t[0],tt,et),o(t[1],rt,nt)]}function d(t,e){return t[0]===e[0]&&(t[0]===tt||t[0]===et)||(t[1]===e[1]&&(t[1]===rt||t[1]===nt)||void 0)}function p(t,e){var r=[],n=f(t),a=f(e);return n&&a&&d(n,a)?r:(n&&r.push(n),a&&r.push(a),r)}function h(t,e,r){return function(n,i){var o=f(n),l=f(i),s=[];if(o&&l&&d(o,l))return s;o&&s.push(o),l&&s.push(l);var c=2*a.constrain((n[t]+i[t])/2,e,r)-((o||n)[t]+(l||i)[t]);if(c){var u;u=o&&l?c>0==o[t]>l[t]?o:l:o||l,u[t]+=c}return s}}function g(t,e){var r=e[0]-t[0],n=(e[1]-t[1])/r;return(t[1]*e[0]-e[1]*t[0])/r>0?[n>0?tt:et,nt]:[n>0?et:tt,rt]}function v(t){var e=t[0],r=t[1],n=e===U[G-1][0],a=r===U[G-1][1];if(!n||!a)if(G>1){var i=e===U[G-2][0],o=r===U[G-2][1];n&&(e===tt||e===et)&&i?o?G--:U[G-1]=t:a&&(r===rt||r===nt)&&o?i?G--:U[G-1]=t:U[G++]=t}else U[G++]=t}function y(t){U[G-1][0]!==t[0]&&U[G-1][1]!==t[1]&&v([Y,W]),v(t),Q=null,Y=W=0}function m(t){if(Z=t[0]et?et:0,X=t[1]nt?nt:0,Z||X){if(G)if(Q){var e=J(Q,t);e.length>1&&(y(e[0]),U[G++]=e[1])}else $=J(U[G-1],t)[0],U[G++]=$;else U[G++]=[Z||t[0],X||t[1]];var r=U[G-1];Z&&X&&(r[0]!==Z||r[1]!==X)?(Q&&(Y!==Z&&W!==X?v(Y&&W?g(Q,t):[Y||Z,W||X]):Y&&W&&v([Y,W])),v([Z,X])):Y-Z&&W-X&&v([Z||Y,X||W]),Q=t,Y=Z,W=X}else Q&&y(J(Q,t)[0]),U[G++]=t}var x,b,_,w,k,M,A,T,L,C,z,S,O,D,E,P,I=e.xaxis,N=e.yaxis,R=e.simplify,F=e.connectGaps,j=e.baseTolerance,B=e.shape,q="linear"===B,H=[],V=l.minTolerance,U=new Array(t.length),G=0;R||(j=V=-1);var Z,X,Y,W,Q,$,J,K=l.maxScreensAway,tt=-I._length*K,et=I._length*(1+K),rt=-N._length*K,nt=N._length*(1+K),at=[[tt,rt,et,rt],[et,rt,et,nt],[et,nt,tt,nt],[tt,nt,tt,rt]];for("linear"===B||"spline"===B?J=u:"hv"===B||"vh"===B?J=p:"hvh"===B?J=h(0,tt,et):"vhv"===B&&(J=h(1,rt,nt)),x=0;xs(M))break;_=M,O=L[0]*T[0]+L[1]*T[1],O>z?(z=O,w=M,A=!1):O=t.length||!M)break;m(M),b=M}}else m(w)}Q&&v([Y||Q[0],W||Q[1]]),H.push(U.slice(0,G))}return H}},{"../../constants/numerical":140,"../../lib":156,"./constants":338}],347:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],348:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n,a,i=null,o=0;o0?Math.max(e,a):0}}},{"fast-isnumeric":17}],350:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,l,s,c){var u,f=o.isBubble(t),d=(t.line||{}).color;if(c=c||{},d&&(r=d),s("marker.symbol"),s("marker.opacity",f?.7:1),s("marker.size"),s("marker.color",r),a(t,"marker")&&i(t,e,l,s,{prefix:"marker.",cLetter:"c"}),c.noLine||(u=d&&!Array.isArray(d)&&e.marker.color!==d?d:f?n.background:n.defaultLine,s("marker.line.color",u),a(t,"marker.line")&&i(t,e,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",f?1:0)),f&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient){"none"!==s("marker.gradient.type")&&s("marker.gradient.color")}}},{"../../components/color":41,"../../components/colorscale/defaults":50,"../../components/colorscale/has_colorscale":54,"./subtypes":354}],351:[function(t,e,r){"use strict";function n(t,e,r){var n;e.selectAll("g.trace").each(function(t){var e=o.select(this);if(n=t[0].trace,n._nexttrace){if(n._nextFill=e.select(".js-fill.js-tonext"),!n._nextFill.size()){var a=":first-child";e.select(".js-fill.js-tozero").size()&&(a+=" + *"),n._nextFill=e.insert("path",a).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),n._nextFill=null;n.fill&&("tozero"===n.fill.substr(0,6)||"toself"===n.fill||"to"===n.fill.substr(0,2)&&!n._prevtrace)?(n._ownFill=e.select(".js-fill.js-tozero"),n._ownFill.size()||(n._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),n._ownFill=null),e.selectAll(".js-fill").call(s.setClipUrl,r.layerClipId)})}function a(t,e,r,n,a,d,h){function g(t){return k?t.transition():t}function v(t){return t.filter(function(t){return t.vis})}function y(t){return t.id}function m(t){if(t.ids)return y}function x(){return!1}function b(e){var n,a,i,c=e[0].trace,f=o.select(this),d=u.hasMarkers(c),p=u.hasText(c),h=m(c),y=x,b=x;d&&(y=c.marker.maxdisplayed||c._needsCull?v:l.identity),p&&(b=c.marker.maxdisplayed||c._needsCull?v:l.identity),a=f.selectAll("path.point"),n=a.data(y,h);var _=n.enter().append("path").classed("point",!0);k&&_.call(s.pointStyle,c,t).call(s.translatePoints,M,A).style("opacity",0).transition().style("opacity",1);var w=d&&s.tryColorscale(c.marker,""),T=d&&s.tryColorscale(c.marker,"line");n.order(),n.each(function(e){var n=o.select(this),a=g(n);i=s.translatePoint(e,a,M,A),i?(s.singlePointStyle(e,a,c,w,T,t),r.layerClipId&&s.hideOutsideRangePoint(e,a,M,A),c.customdata&&n.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()}),k?n.exit().transition().style("opacity",0).remove():n.exit().remove(),a=f.selectAll("g"),n=a.data(b,h),n.enter().append("g").classed("textpoint",!0).append("text"),n.order(),n.each(function(t){var e=o.select(this),n=g(e.select("text"));i=s.translatePoint(t,n,M,A),i?r.layerClipId&&s.hideOutsideRangePoint(t,e,M,A):e.remove()}),n.selectAll("text").call(s.textPointStyle,c,t).each(function(t){var e=M.c2p(t.x),r=A.c2p(t.y);o.select(this).selectAll("tspan.line").each(function(){g(o.select(this)).attr({x:e,y:r})})}),n.exit().remove()}var _,w;i(t,e,r,n,a);var k=!!h&&h.duration>0,M=r.xaxis,A=r.yaxis,T=n[0].trace,L=T.line,C=o.select(d);if(C.call(c.plot,r,h),!0===T.visible){g(C).style("opacity",T.opacity);var z,S,O=T.fill.charAt(T.fill.length-1);"x"!==O&&"y"!==O&&(O=""),n[0].node3=C;var D="",E=[],P=T._prevtrace;P&&(D=P._prevRevpath||"",S=P._nextFill,E=P._polygons);var I,N,R,F,j,B,q,H,V,U="",G="",Z=[],X=l.noop;if(z=T._ownFill,u.hasLines(T)||"none"!==T.fill){for(S&&S.datum(n),-1!==["hv","vh","hvh","vhv"].indexOf(L.shape)?(R=s.steps(L.shape),F=s.steps(L.shape.split("").reverse().join(""))):R=F="spline"===L.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?s.smoothclosed(t.slice(1),L.smoothing):s.smoothopen(t,L.smoothing)}:function(t){return"M"+t.join("L")},j=function(t){return F(t.reverse())},Z=f(n,{xaxis:M,yaxis:A,connectGaps:T.connectgaps,baseTolerance:Math.max(L.width||1,3)/4,shape:L.shape,simplify:L.simplify}),V=T._polygons=new Array(Z.length),w=0;w1){var r=o.select(this);if(r.datum(n),t)g(r.style("opacity",0).attr("d",I).call(s.lineGroupStyle)).style("opacity",1);else{var a=g(r);a.attr("d",I),s.singleLineStyle(n,a)}}}}}var Y=C.selectAll(".js-line").data(Z);g(Y.exit()).style("opacity",0).remove(),Y.each(X(!1)),Y.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(X(!0)),s.setClipUrl(Y,r.layerClipId),Z.length&&(z?B&&H&&(O?("y"===O?B[1]=H[1]=A.c2p(0,!0):"x"===O&&(B[0]=H[0]=M.c2p(0,!0)),g(z).attr("d","M"+H+"L"+B+"L"+U.substr(1)).call(s.singleFillStyle)):g(z).attr("d",U+"Z").call(s.singleFillStyle)):"tonext"===T.fill.substr(0,6)&&U&&D&&("tonext"===T.fill?g(S).attr("d",U+"Z"+D+"Z").call(s.singleFillStyle):g(S).attr("d",U+"L"+D.substr(1)+"Z").call(s.singleFillStyle),T._polygons=T._polygons.concat(E)),T._prevRevpath=G,T._prevPolygons=V);var W=C.selectAll(".points");_=W.data([n]),W.each(b),_.enter().append("g").classed("points",!0).each(b),_.exit().remove(),_.each(function(t){var e=!1===t[0].trace.cliponaxis;s.setClipUrl(o.select(this),e?null:r.layerClipId)})}}function i(t,e,r,n,a){var i=r.xaxis,s=r.yaxis,c=o.extent(l.simpleMap(i.range,i.r2c)),f=o.extent(l.simpleMap(s.range,s.r2c)),d=n[0].trace;if(u.hasMarkers(d)){var p=d.marker.maxdisplayed;if(0!==p){var h=n.filter(function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=f[0]&&t.y<=f[1]}),g=Math.ceil(h.length/p),v=0;a.forEach(function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;for(u=h.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),d(t,e,r),n(t,h,e),s=0,c={};sc[e[0].trace.uid]?1:-1}),v){l&&(p=l());o.transition().duration(i.duration).ease(i.easing).each("end",function(){p&&p()}).each("interrupt",function(){p&&p()}).each(function(){h.selectAll("g.trace").each(function(n,o){a(t,o,e,n,r,this,i)})})}else h.selectAll("g.trace").each(function(n,o){a(t,o,e,n,r,this,i)});g&&f.exit().remove(),h.selectAll("path:not([d])").remove()}},{"../../components/drawing":65,"../../components/errorbars":71,"../../lib":156,"../../lib/polygon":167,"./line_points":346,"./link_traces":348,"./subtypes":354,d3:14}],352:[function(t,e,r){"use strict";var n=t("./subtypes"),a=t("../../constants/interactions").DESELECTDIM;e.exports=function(t,e){var r,i,o,l,s=t.cd,c=t.xaxis,u=t.yaxis,f=[],d=s[0].trace,p=d.marker;if(!n.hasMarkers(d)&&!n.hasText(d))return[];var h=Array.isArray(p.opacity)?1:p.opacity;if(!1===e)for(r=0;rM&&L.splice(M,L.length-M)}return o(e),l(A,e),A}},{"../../plots/cartesian/axes":196,"../scatter/arrays_to_calcdata":332,"../scatter/colorscale_calc":337,"../scatter/subtypes":354,"fast-isnumeric":17}],359:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../scatter/constants"),i=t("../scatter/subtypes"),o=t("../scatter/marker_defaults"),l=t("../scatter/line_defaults"),s=t("../scatter/line_shape_defaults"),c=t("../scatter/text_defaults"),u=t("../scatter/fillcolor_defaults"),f=t("./attributes");e.exports=function(t,e,r,d){function p(r,a){return n.coerce(t,e,f,r,a)}var h,g=p("a"),v=p("b"),y=p("c");if(g?(h=g.length,v?(h=Math.min(h,v.length),y&&(h=Math.min(h,y.length))):h=y?Math.min(h,y.length):0):v&&y&&(h=Math.min(v.length,y.length)),!h)return void(e.visible=!1);g&&h"),l}}},{"../../plots/cartesian/axes":196,"../scatter/hover":343}],361:[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","scatter-like"],n.meta={},e.exports=n},{"../../plots/ternary":233,"../scatter/colorbar":336,"./attributes":357,"./calc":358,"./defaults":359,"./hover":360,"./plot":362,"./select":363,"./style":364}],362:[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,layerClipId:t._hasClipOnAxisFalse?t.clipIdRelative:null},i=0;i0;t.each(function(t){var d,p=t[0].trace,h=p.error_x||{},g=p.error_y||{};p.ids&&(d=function(t){return t.id});var v=l.hasMarkers(p)&&p.marker.maxdisplayed>0;g.visible||h.visible||(t=[]);var y=a.select(this).selectAll("g.errorbar").data(t,d);if(y.exit().remove(),t.length){h.visible||y.selectAll("path.xerror").remove(),g.visible||y.selectAll("path.yerror").remove(),y.style("opacity",1);var m=y.enter().append("g").classed("errorbar",!0);f&&m.style("opacity",0).transition().duration(r.duration).style("opacity",1),o.setClipUrl(y,e.layerClipId),y.each(function(t){var e=a.select(this),o=n(t,c,u);if(!v||t.vis){var l;if(g.visible&&i(o.x)&&i(o.yh)&&i(o.ys)){var d=g.width;l="M"+(o.x-d)+","+o.yh+"h"+2*d+"m-"+d+",0V"+o.ys,o.noYS||(l+="m-"+d+",0h"+2*d);var p=e.select("path.yerror");s=!p.size(),s?p=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):f&&(p=p.transition().duration(r.duration).ease(r.easing)),p.attr("d",l)}if(h.visible&&i(o.y)&&i(o.xh)&&i(o.xs)){var y=(h.copy_ystyle?g:h).width;l="M"+o.xh+","+(o.y-y)+"v"+2*y+"m0,-"+y+"H"+o.xs,o.noXS||(l+="m0,-"+y+"v"+2*y);var m=e.select("path.xerror");s=!m.size(),s?m=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):f&&(m=m.transition().duration(r.duration).ease(r.easing)),m.attr("d",l)}}})}})}},{"../../traces/scatter/subtypes":314,"../drawing":61,d3:10,"fast-isnumeric":13}],69:[function(t,e,r){"use strict";var n=t("d3"),a=t("../color");e.exports=function(t){t.each(function(t){var e=t[0].trace,r=e.error_y||{},i=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)})}},{"../color":37,d3:10}],70:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes");e.exports={hoverlabel:{bgcolor:{valType:"color",arrayOk:!0,editType:"none"},bordercolor:{valType:"color",arrayOk:!0,editType:"none"},font:n({arrayOk:!0,editType:"none"}),namelength:{valType:"integer",min:-1,arrayOk:!0,editType:"none"},editType:"calc"}}},{"../../plots/font_attributes":216}],71:[function(t,e,r){"use strict";function n(t,e,r,n){n=n||a.identity,Array.isArray(t)&&(e[0][r]=n(t))}var a=t("../../lib"),i=t("../../registry");e.exports=function(t){for(var e=t.calcdata,r=t._fullLayout,o=0;o=0&&r.indexJ.width||Q<0||Q>J.height)return x.unhoverRaw(t,e)}if(E="xval"in e?w.flat(d,e.xval):w.p2c(L,W),I="yval"in e?w.flat(d,e.yval):w.p2c(C,Q),!f(E[0])||!f(I[0]))return p.warn("Fx.hover failed",e,t),x.unhoverRaw(t,e)}var K=1/0;for(R=0;RX&&(Y.splice(0,X),K=Y[0].distance)}if(0===Y.length)return x.unhoverRaw(t,e);Y.sort(function(t,e){return t.distance-e.distance});var at=t._hoverdata,it=[];for(N=0;N1,ct=m.combine(g.plot_bgcolor||m.background,g.paper_bgcolor),ut={hovermode:P,rotateLabels:st,bgColor:ct,container:g._hoverlayer,outerContainer:g._paperdiv,commonLabelOpts:g.hoverlabel},ft=a(Y,ut,t);if(i(Y,st?"xa":"ya"),o(ft,st),e.target&&e.target.tagName){var dt=_.getComponentMethod("annotations","hasClickToShow")(t,it);v(u.select(e.target),dt?"pointer":"")}e.target&&!n&&c(t,e,at)&&(at&&t.emit("plotly_unhover",{event:e,points:at}),t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:L,yaxes:C,xvals:E,yvals:I}))}function a(t,e,r){var n,a,i=e.hovermode,o=e.rotateLabels,l=e.bgColor,s=e.container,c=e.outerContainer,f=e.commonLabelOpts||{},d=e.fontFamily||k.HOVERFONT,p=e.fontSize||k.HOVERFONTSIZE,h=t[0],v=h.xa,x=h.ya,b="y"===i?"yLabel":"xLabel",_=h[b],w=(String(_)||"").split(" ")[0],A=c.node().getBoundingClientRect(),T=A.top,L=A.width,C=A.height,O=h.distance<=k.MAXDIST&&("x"===i||"y"===i);for(n=0;n-1&&n.length>h&&(n=h>3?n.substr(0,h-3)+"...":n.substr(0,h))}void 0!==t.extraText&&(a+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(a+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(a+="y: "+t.yLabel+"
"),a+=(a?"z: ":"")+t.zLabel):O&&t[i+"Label"]===_?a=t[("x"===i?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(a=t.yLabel):a=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(a+=(a?"
":"")+t.text),""===a&&(""===n&&e.remove(),a=n);var v=e.select("text.nums").call(y.font,t.fontFamily||d,t.fontSize||p,t.fontColor||f).text(a).attr("data-notex",1).call(g.positionText,0,0).call(g.convertToTspans,r),x=e.select("text.name"),b=0;n&&n!==a?(x.call(y.font,t.fontFamily||d,t.fontSize||p,c).text(n).attr("data-notex",1).call(g.positionText,0,0).call(g.convertToTspans,r),b=x.node().getBoundingClientRect().width+2*z):(x.remove(),e.select("rect").remove()),e.select("path").style({fill:c,stroke:f});var w,k,A=v.node().getBoundingClientRect(),D=t.xa._offset+(t.x0+t.x1)/2,P=t.ya._offset+(t.y0+t.y1)/2,E=Math.abs(t.x1-t.x0),I=Math.abs(t.y1-t.y0),N=A.width+S+z+b;t.ty0=T-A.top,t.bx=A.width+2*z,t.by=A.height+2*z,t.anchor="start",t.txwidth=A.width,t.tx2width=b,t.offset=0,o?(t.pos=D,w=P+I/2+N<=C,k=P-I/2-N>=0,"top"!==t.idealAlign&&w||!k?w?(P+=I/2,t.anchor="start"):t.anchor="middle":(P-=I/2,t.anchor="end")):(t.pos=P,w=D+E/2+N<=L,k=D-E/2-N>=0,"left"!==t.idealAlign&&w||!k?w?(D+=E/2,t.anchor="start"):t.anchor="middle":(D-=E/2,t.anchor="end")),v.attr("text-anchor",t.anchor),b&&x.attr("text-anchor",t.anchor),e.attr("transform","translate("+D+","+P+")"+(o?"rotate("+M+")":""))}),E}function i(t,e){function r(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,i=r.pos+r.dp+r.size-e.pmax,a>.01){for(l=t.length-1;l>=0;l--)t[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=t.length-1;l>=0;l--)t[l].dp-=i;n=!1}if(n){var c=0;for(o=0;oe.pmax&&c++;for(o=t.length-1;o>=0&&!(c<=0);o--)s=t[o],s.pos>e.pmax-1&&(s.del=!0,c--);for(o=0;o=0;l--)t[l].dp-=i;for(o=t.length-1;o>=0&&!(c<=0);o--)s=t[o],s.pos+s.dp+s.size>e.pmax&&(s.del=!0,c--)}}}for(var n,a,i,o,l,s,c,u=0,f=t.map(function(t,r){var n=t[e];return[{i:r,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===n._id.charAt(0)?T:1)/2,pmin:n._offset,pmax:n._offset+n._length}]}).sort(function(t,e){return t[0].posref-e[0].posref});!n&&u<=t.length;){for(u++,n=!0,o=0;o.01&&h.pmin===g.pmin&&h.pmax===g.pmax){for(l=p.length-1;l>=0;l--)p[l].dp+=a;for(d.push.apply(d,p),f.splice(o+1,1),c=0,l=d.length-1;l>=0;l--)c+=d[l].dp;for(i=c/d.length,l=d.length-1;l>=0;l--)d[l].dp-=i;n=!1}else o++}f.forEach(r)}for(o=f.length-1;o>=0;o--){var v=f[o];for(l=v.length-1;l>=0;l--){var y=v[l],m=t[y.i];m.offset=y.dp,m.del=y.del}}}function o(t,e){t.each(function(t){var r=u.select(this);if(t.del)return void r.remove();var n="end"===t.anchor?-1:1,a=r.select("text.nums"),i={start:1,end:-1,middle:0}[t.anchor],o=i*(S+z),l=o+i*(t.txwidth+z),s=0,c=t.offset;"middle"===t.anchor&&(o-=t.tx2width/2,l-=t.tx2width/2),e&&(c*=-C,s=t.offset*L),r.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(n*S+s)+","+(S+c)+"v"+(t.by/2-S)+"h"+n*t.bx+"v-"+t.by+"H"+(n*S+s)+"V"+(c-S)+"Z"),a.call(g.positionText,o+s,c+t.ty0-t.by/2+z),t.tx2width&&(r.select("text.name").call(g.positionText,l+i*z+s,c+t.ty0-t.by/2+z),r.select("rect").call(y.setRect,l+(i-1)*t.tx2width/2+s,c-t.by/2-1,t.tx2width,t.by+2))})}function l(t,e){function r(e,r,n){var a=l(r,n);a&&(t[e]=a)}var n=t.index,a=t.trace||{},i=t.cd[0],o=t.cd[n]||{},l=Array.isArray(n)?function(t,e){return p.castOption(i,n,t)||p.extractOption({},a,"",e)}:function(t,e){return p.extractOption(o,a,t,e)};r("hoverinfo","hi","hoverinfo"),r("color","hbg","hoverlabel.bgcolor"),r("borderColor","hbc","hoverlabel.bordercolor"),r("fontFamily","htf","hoverlabel.font.family"),r("fontSize","hts","hoverlabel.font.size"),r("fontColor","htc","hoverlabel.font.color"),r("nameLength","hnl","hoverlabel.namelength"),t.posref="y"===e?(t.x0+t.x1)/2:(t.y0+t.y1)/2,t.x0=p.constrain(t.x0,0,t.xa._length),t.x1=p.constrain(t.x1,0,t.xa._length),t.y0=p.constrain(t.y0,0,t.ya._length),t.y1=p.constrain(t.y1,0,t.ya._length);var s;if(void 0!==t.xLabelVal){s="log"===t.xa.type&&t.xLabelVal<=0;var c=b.tickText(t.xa,t.xa.c2l(s?-t.xLabelVal:t.xLabelVal),"hover");s?0===t.xLabelVal?t.xLabel="0":t.xLabel="-"+c.text:t.xLabel=c.text,t.xVal=t.xa.c2d(t.xLabelVal)}if(void 0!==t.yLabelVal){s="log"===t.ya.type&&t.yLabelVal<=0;var u=b.tickText(t.ya,t.ya.c2l(s?-t.yLabelVal:t.yLabelVal),"hover");s?0===t.yLabelVal?t.yLabel="0":t.yLabel="-"+u.text:t.yLabel=u.text,t.yVal=t.ya.c2d(t.yLabelVal)}if(void 0!==t.zLabelVal&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var f=b.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+f+" / -"+b.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+f,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var d=b.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+d+" / -"+b.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+d,"y"===e&&(t.distance+=1)}var h=t.hoverinfo||t.trace.hoverinfo;return"all"!==h&&(h=h.split("+"),-1===h.indexOf("x")&&(t.xLabel=void 0),-1===h.indexOf("y")&&(t.yLabel=void 0),-1===h.indexOf("z")&&(t.zLabel=void 0),-1===h.indexOf("text")&&(t.text=void 0),-1===h.indexOf("name")&&(t.name=void 0)),t}function s(t,e){var r=e.hovermode,n=e.container,a=t[0],i=a.xa,o=a.ya,l=i.showspikes,s=o.showspikes;if(n.selectAll(".spikeline").remove(),"closest"===r&&(l||s)){var c=e.fullLayout,u=i._offset+(a.x0+a.x1)/2,f=o._offset+(a.y0+a.y1)/2,p=m.combine(c.plot_bgcolor,c.paper_bgcolor),h=d.readability(a.color,p)<1.5?m.contrast(p):a.color;if(s){var g=o.spikemode,v=o.spikethickness,x=o.spikecolor||h,b=o._boundingBox,_=(b.left+b.right)/2=0;n--){var a=r[n],i=t._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber))return!0}return!1}var u=t("d3"),f=t("fast-isnumeric"),d=t("tinycolor2"),p=t("../../lib"),h=t("../../lib/events"),g=t("../../lib/svg_text_utils"),v=t("../../lib/override_cursor"),y=t("../drawing"),m=t("../color"),x=t("../dragelement"),b=t("../../plots/cartesian/axes"),_=t("../../registry"),w=t("./helpers"),k=t("./constants"),M=k.YANGLE,A=Math.PI*M/180,T=1/Math.sin(A),L=Math.cos(A),C=Math.sin(A),S=k.HOVERARROWSIZE,z=k.HOVERTEXTPAD;r.hover=function(t,e,r,a){t=p.getGraphDiv(t),p.throttle(t._fullLayout._uid+k.HOVERID,k.HOVERMINTIME,function(){n(t,e,r,a)})},r.loneHover=function(t,e){var r={color:t.color||m.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,trace:{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0},n=u.select(e.container),i=e.outerContainer?u.select(e.outerContainer):n,l={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||m.background,container:n,outerContainer:i},s=a([r],l,e.gd);return o(s,l.rotateLabels),s.node()}},{"../../lib":152,"../../lib/events":145,"../../lib/override_cursor":162,"../../lib/svg_text_utils":172,"../../plots/cartesian/axes":192,"../../registry":228,"../color":37,"../dragelement":58,"../drawing":61,"./constants":73,"./helpers":75,d3:10,"fast-isnumeric":13,tinycolor2:19}],77:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,a){a=a||{},r("hoverlabel.bgcolor",a.bgcolor),r("hoverlabel.bordercolor",a.bordercolor),r("hoverlabel.namelength",a.namelength),n.coerceFont(r,"hoverlabel.font",a.font)}},{"../../lib":152}],78:[function(t,e,r){"use strict";function n(t){var e=l.isD3Selection(t)?t:o.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()}function a(t,e,r){return l.castOption(t,e,"hoverlabel."+r)}function i(t,e,r){function n(r){return l.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}return l.castOption(t,r,"hoverinfo",n)}var o=t("d3"),l=t("../../lib"),s=t("../dragelement"),c=t("./helpers"),u=t("./layout_attributes");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:u},attributes:t("./attributes"),layoutAttributes:u,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:c.getDistanceFunction,getClosest:c.getClosest,inbox:c.inbox,appendArrayPointValue:c.appendArrayPointValue,castHoverOption:a,castHoverinfo:i,hover:t("./hover").hover,unhover:s.unhover,loneHover:t("./hover").loneHover,loneUnhover:n,click:t("./click")}},{"../../lib":152,"../dragelement":58,"./attributes":70,"./calc":71,"./click":72,"./constants":73,"./defaults":74,"./helpers":75,"./hover":76,"./layout_attributes":79,"./layout_defaults":80,"./layout_global_defaults":81,d3:10}],79:[function(t,e,r){"use strict";var n=t("./constants"),a=t("../../plots/font_attributes")({editType:"none"});a.family.dflt=n.HOVERFONT,a.size.dflt=n.HOVERFONTSIZE,e.exports={dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1],editType:"modebar"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"}}},{"../../plots/font_attributes":216,"./constants":73}],80:[function(t,e,r){"use strict";function n(t){for(var e=!0,r=0;r=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}},{}],88:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes");e.exports={bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:a.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:n({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},x:{valType:"number",min:-2,max:3,dflt:1.02,editType:"legend"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",min:-2,max:3,dflt:1,editType:"legend"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"legend"},editType:"legend"}},{"../../plots/font_attributes":216,"../color/attributes":36}],89:[function(t,e,r){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],90:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("./attributes"),o=t("../../plots/layout_attributes"),l=t("./helpers");e.exports=function(t,e,r){function s(t,e){return a.coerce(p,h,i,t,e)}for(var c,u,f,d,p=t.legend||{},h=e.legend={},g=0,v="normal",y=0;y1)){if(s("bgcolor",e.paper_bgcolor),s("bordercolor"),s("borderwidth"),a.coerceFont(s,"font",e.font),s("orientation"),"h"===h.orientation){var x=t.xaxis;x&&x.rangeslider&&x.rangeslider.visible?(c=0,f="left",u=1.1,d="bottom"):(c=0,f="left",u=-.1,d="top")}s("traceorder",v),l.isGrouped(e.legend)&&s("tracegroupgap"),s("x",c),s("xanchor",f),s("y",u),s("yanchor",d),a.noneOrAll(p,h,["x","y"])}}},{"../../lib":152,"../../plots/layout_attributes":219,"../../registry":228,"./attributes":88,"./helpers":94}],91:[function(t,e,r){"use strict";function n(t,e){function r(r){y.convertToTspans(r,e,function(){i(t,e)})}var n=t.data()[0][0],a=e._fullLayout,o=n.trace,l=p.traceIs(o,"pie"),s=o.index,c=l?n.label:o.name,d=t.selectAll("text.legendtext").data([0]);d.enter().append("text").classed("legendtext",!0),d.attr("text-anchor","start").classed("user-select-none",!0).call(g.font,a.legend.font).text(c),e._context.edits.legendText&&!l?d.call(y.makeEditable,{gd:e}).call(r).on("edit",function(t){this.text(t).call(r);var a=t;this.text()||(t=" ");var i,o,l=n.trace._fullInput||{},c={};if(-1!==["ohlc","candlestick"].indexOf(l.type))i=n.trace.transforms,o=i[i.length-1].direction,c[o+".name"]=t;else if(p.hasTransform(l,"groupby")){var d=p.getTransformIndices(l,"groupby"),h=d[d.length-1],g=f.keyedContainer(l,"transforms["+h+"].styles","target","value.name");""===a?g.remove(n.trace._group):g.set(n.trace._group,t),c=g.constructUpdate()}else c.name=t;return u.restyle(e,c,s)}):d.call(r)}function a(t,e){var r,n=1,a=t.selectAll("rect").data([0]);a.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(v.fill,"rgba(0,0,0,0)"),a.on("mousedown",function(){r=(new Date).getTime(),r-e._legendMouseDownTimeT&&(n=Math.max(n-1,1)),1===n?r._clickTimeout=setTimeout(function(){m(t,e,n)},T):2===n&&(r._clickTimeout&&clearTimeout(r._clickTimeout),e._legendMouseDownTime=0,m(t,e,n))}})}function i(t,e){var r=t.data()[0][0];if(!r.trace.showlegend)return void t.remove();var n,a,i=t.select("g[class*=math-group]"),o=i.node(),l=e._fullLayout.legend,s=l.font.size*_;if(o){var c=g.bBox(o);n=c.height,a=c.width,g.setTranslate(i,0,n/4)}else{var u=t.select(".legendtext"),f=y.lineCount(u),d=u.node();n=s*f,a=d?g.bBox(d).width:0;var p=s*(.3+(1-f)/2);y.positionText(u,40,p)}n=Math.max(n,16)+3,r.height=n,r.width=a}function o(t,e,r){var n=t._fullLayout,a=n.legend,i=a.borderwidth,o=M.isGrouped(a),l=0;if(a.width=0,a.height=0,M.isVertical(a))o&&e.each(function(t,e){g.setTranslate(this,0,e*a.tracegroupgap)}),r.each(function(t){var e=t[0],r=e.height,n=e.width;g.setTranslate(this,i,5+i+a.height+r/2),a.height+=r,a.width=Math.max(a.width,n)}),a.width+=45+2*i,a.height+=10+2*i,o&&(a.height+=(a._lgroupsLength-1)*a.tracegroupgap),l=40;else if(o){for(var s=[a.width],u=e.data(),f=0,d=u.length;fn.width-(n.margin.r+n.margin.l)&&(x=0,v+=y,a.height=a.height+y,y=0),g.setTranslate(this,i+x,5+i+e.height/2+v),a.width+=o+r,a.height=Math.max(a.height,e.height),x+=o+r,y=Math.max(e.height,y)}),a.width+=2*i,a.height+=10+2*i}a.width=Math.ceil(a.width),a.height=Math.ceil(a.height),r.each(function(e){var r=e[0];c.select(this).select(".legendtoggle").call(g.setRect,0,-r.height/2,(t._context.edits.legendText?0:a.width)+l,r.height)})}function l(t){var e=t._fullLayout,r=e.legend,n="left";A.isRightAnchor(r)?n="right":A.isCenterAnchor(r)&&(n="center");var a="top";A.isBottomAnchor(r)?a="bottom":A.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";A.isRightAnchor(r)?n="right":A.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"),p=t("../../registry"),h=t("../dragelement"),g=t("../drawing"),v=t("../color"),y=t("../../lib/svg_text_utils"),m=t("./handle_click"),x=t("./constants"),b=t("../../constants/interactions"),_=t("../../constants/alignment").LINE_SPACING,w=t("./get_legend_data"),k=t("./style"),M=t("./helpers"),A=t("./anchor_utils"),T=b.DBLCLICKDELAY;e.exports=function(t){function e(t,e){S.attr("data-scroll",e).call(g.setTranslate,0,e),z.call(g.setRect,j,t,x.scrollBarWidth,x.scrollBarHeight),L.select("rect").attr({y:y.borderwidth-e})}var r=t._fullLayout,i="legend"+r._uid;if(r._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var y=r.legend,b=r.showlegend&&w(t.calcdata,y),_=r.hiddenlabels||[];if(!r.showlegend||!b.length)return r._infolayer.selectAll(".legend").remove(),r._topdefs.select("#"+i).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 L=r._topdefs.selectAll("#"+i).data([0]);L.enter().append("clipPath").attr("id",i).append("rect");var C=M.selectAll("rect.bg").data([0]);C.enter().append("rect").attr({class:"bg","shape-rendering":"crispEdges"}),C.call(v.stroke,y.bordercolor),C.call(v.fill,y.bgcolor),C.style("stroke-width",y.borderwidth+"px");var S=M.selectAll("g.scrollbox").data([0]);S.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(v.fill,"#808BA4");var O=S.selectAll("g.groups").data(b);O.enter().append("g").attr("class","groups"),O.exit().remove();var D=O.selectAll("g.traces").data(f.identity);D.enter().append("g").attr("class","traces"),D.exit().remove(),D.call(k,t).style("opacity",function(t){var e=t[0].trace;return p.traceIs(e,"pie")?-1!==_.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){c.select(this).call(n,t).call(a,t)});var P=0!==M.enter().size();P&&(o(t,O,D),l(t));var E=r.width,I=r.height;o(t,O,D),y.height>I?s(t):l(t);var N=r._size,R=N.l+N.w*y.x,F=N.t+N.h*(1-y.y);A.isRightAnchor(y)?R-=y.width:A.isCenterAnchor(y)&&(R-=y.width/2),A.isBottomAnchor(y)?F-=y.height:A.isMiddleAnchor(y)&&(F-=y.height/2);var j=y.width,B=N.w;j>B?(R=N.l,j=B):(R+j>E&&(R=E-j),R<0&&(R=0),j=Math.min(E-R,y.width));var q=y.height,H=N.h;q>H?(F=N.t,q=H):(F+q>I&&(F=I-q),F<0&&(F=0),q=Math.min(I-F,y.height)),g.setTranslate(M,R,F);var V,U,G=q-x.scrollBarHeight-2*x.scrollBarMargin,X=y.height-q;if(y.height<=q||t._context.staticPlot)C.attr({width:j-y.borderwidth,height:q-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),g.setTranslate(S,0,0),L.select("rect").attr({width:j-2*y.borderwidth,height:q-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth}),S.call(g.setClipUrl,i);else{V=x.scrollBarMargin,U=S.attr("data-scroll")||0,C.attr({width:j-2*y.borderwidth+x.scrollBarWidth+x.scrollBarMargin,height:q-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),L.select("rect").attr({width:j-2*y.borderwidth+x.scrollBarWidth+x.scrollBarMargin,height:q-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth-U}),S.call(g.setClipUrl,i),P&&e(V,U),M.on("wheel",null),M.on("wheel",function(){U=f.constrain(S.attr("data-scroll")-c.event.deltaY/G*X,-X,0),V=x.scrollBarMargin-U/X*G,e(V,U),0!==U&&U!==-X&&c.event.preventDefault()}),z.on(".drag",null),S.on(".drag",null);var Y=c.behavior.drag().on("drag",function(){V=f.constrain(c.event.y-x.scrollBarHeight/2,x.scrollBarMargin,x.scrollBarMargin+G),U=-(V-x.scrollBarMargin)/G*X,e(V,U)});z.call(Y),S.call(Y)}if(t._context.edits.legendPosition){var Z,W,Q,$;M.classed("cursor-move",!0),h.init({element:M.node(),gd:t,prepFn:function(){var t=g.getTranslate(M);Q=t.x,$=t.y},moveFn:function(t,e){var r=Q+t,n=$+e;g.setTranslate(M,r,n),Z=h.align(r,0,N.l,N.l+N.w,y.xanchor),W=h.align(n,0,N.t+N.h,N.t,y.yanchor)},doneFn:function(e,n,a){if(e&&void 0!==Z&&void 0!==W)u.relayout(t,{"legend.x":Z,"legend.y":W});else{var i=r._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return a.clientX>=t.left&&a.clientX<=t.right&&a.clientY>=t.top&&a.clientY<=t.bottom});i.size()>0&&(1===n?M._clickTimeout=setTimeout(function(){m(i,t,n)},T):2===n&&(M._clickTimeout&&clearTimeout(M._clickTimeout),m(i,t,n)))}}})}}}},{"../../constants/alignment":134,"../../constants/interactions":135,"../../lib":152,"../../lib/svg_text_utils":172,"../../plotly":187,"../../plots/plots":221,"../../registry":228,"../color":37,"../dragelement":58,"../drawing":61,"./anchor_utils":87,"./constants":89,"./get_legend_data":92,"./handle_click":93,"./helpers":94,"./style":96,d3:10}],92:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./helpers");e.exports=function(t,e){function r(t,r){if(""!==t&&a.isGrouped(e))-1===s.indexOf(t)?(s.push(t),c=!0,l[t]=[[r]]):l[t].push([r]);else{var n="~~i"+f;s.push(n),l[n]=[[r]],f++}}var i,o,l={},s=[],c=!1,u={},f=0;for(i=0;ir[1])return r[1]}return a}function a(t){return t[0]}var l,c,u=t[0],f=u.trace,d=s.hasMarkers(f),p=s.hasText(f),h=s.hasLines(f);if(d||p||h){var g={},v={};d&&(g.mc=r("marker.color",a),g.mo=r("marker.opacity",i.mean,[.2,1]),g.ms=r("marker.size",i.mean,[2,16]),g.mlc=r("marker.line.color",a),g.mlw=r("marker.line.width",i.mean,[0,5]),v.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),h&&(v.line={width:r("line.width",a,[0,10])}),p&&(g.tx="Aa",g.tp=r("textposition",a),g.ts=10,g.tc=r("textfont.color",a),g.tf=r("textfont.family",a)),l=[i.minExtend(u,g)],c=i.minExtend(f,v)}var y=n.select(this).select("g.legendpoints"),m=y.selectAll("path.scatterpts").data(d?l:[]);m.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),m.exit().remove(),m.call(o.pointStyle,c,e),d&&(l[0].mrc=3);var x=y.selectAll("g.pointtext").data(p?l:[]);x.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),x.exit().remove(),x.selectAll("text").call(o.textPointStyle,c,e)}function f(t){var e=t[0].trace,r=e.marker||{},i=r.line||{},o=n.select(this).select("g.legendpoints").selectAll("path.legendbar").data(a.traceIs(e,"bar")?[t]:[]);o.enter().append("path").classed("legendbar",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),o.exit().remove(),o.each(function(t){var e=n.select(this),a=t[0],o=(a.mlw+1||i.width+1)-1;e.style("stroke-width",o+"px").call(l.fill,a.mc||r.color),o&&e.call(l.stroke,a.mlc||i.color)})}function d(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(a.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(){var t=e.line.width,r=n.select(this);r.style("stroke-width",t+"px").call(l.fill,e.fillcolor),t&&r.call(l.stroke,e.line.color)})}function p(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendpie").data(a.traceIs(e,"pie")&&e.visible?[t]:[]);r.enter().append("path").classed("legendpie",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.size()&&r.call(c,t[0],e)}t.each(function(t){var e=n.select(this),r=e.selectAll("g.layers").data([0]);r.enter().append("g").classed("layers",!0),r.style("opacity",t[0].trace.opacity),r.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),r.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var a=r.selectAll("g.legendsymbols").data([t]);a.enter().append("g").classed("legendsymbols",!0),a.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(f).each(d).each(p).each(r).each(u)}},{"../../lib":152,"../../registry":228,"../../traces/pie/style_one":291,"../../traces/scatter/subtypes":314,"../color":37,"../drawing":61,d3:10}],97:[function(t,e,r){"use strict";function n(t,e){var r,n,a=e.currentTarget,i=a.getAttribute("data-attr"),o=a.getAttribute("data-val")||!0,l=t._fullLayout,s={},c=p.list(t,null,!0),u="on";if("zoom"===i){var d,h="in"===o?.5:2,g=(1+h)/2,v=(1-h)/2;for(n=0;n1)return n(["resetViews","toggleHover"]),o(y,r);u&&(n(["zoom3d","pan3d","orbitRotation","tableRotation"]),n(["resetCameraDefault3d","resetCameraLastSave3d"]),n(["hoverClosest3d"]));var m=a(l),x=[];return((c||h)&&!m||g)&&(x=["zoom2d","pan2d"]),(v||f)&&(x=["pan2d"]),i(s)&&(x.push("select2d"),x.push("lasso2d")),x.length&&n(x),!c&&!h||m||g||n(["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"]),c&&p?n(["toggleHover"]):h?n(["hoverClosestGl2d"]):c?n(["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]):p?n(["hoverClosestPie"]):v?n(["resetViewMapbox","toggleHover"]):f&&(n(["zoomInGeo","zoomOutGeo","resetGeo"]),n(["hoverClosestGeo"])),o(y,r)}function a(t){for(var e=s.list({_fullLayout:t},null,!0),r=!0,n=0;n0)){var h=a(e,r,s);f("x",h[0]),f("y",h[1]),i.noneOrAll(t,e,["x","y"]),f("xanchor"),f("yanchor"),i.coerceFont(f,"font",r.font);var g=f("bgcolor");f("activecolor",o.contrast(g,c.lightAmount,c.darkAmount)),f("bordercolor"),f("borderwidth")}}},{"../../lib":152,"../color":37,"./attributes":101,"./button_attributes":102,"./constants":103}],105:[function(t,e,r){"use strict";function n(t){for(var e=y.list(t,"x",!0),r=[],n=0;nh&&(h=d)));return h>=p?[p,h]:void 0}}var a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=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;lX&&n>Y&&!t.shiftKey?h.getCursor(a/r,1-i/n):"move";g(e,o),G=o.split("-")[0]}function i(e){j=f.getFromId(t,r.xref),B=f.getFromId(t,r.yref),q=y.getDataToPixel(t,j),H=y.getDataToPixel(t,B,!0),V=y.getPixelToData(t,j),U=y.getPixelToData(t,B,!0);var i="shapes["+n+"]";"path"===r.type?(R=r.path,F=i+".path"):(v=q(r.x0),m=H(r.y0),x=q(r.x1),b=H(r.y1),_=i+".x0",w=i+".y0",k=i+".x1",M=i+".y1"),vY&&(p[S]=r[P]=U(c),p[z]=r[E]=U(u)),d-f>X&&(p[O]=r[I]=V(f),p[D]=r[N]=V(d))}e.attr("d",o(t,r))}var p,v,m,x,b,_,w,k,M,A,T,L,C,S,z,O,D,P,E,I,N,R,F,j,B,q,H,V,U,G,X=10,Y=10,Z={element:e.node(),gd:t,prepFn:i,doneFn:l},W=Z.element.getBoundingClientRect();h.init(Z),e.node().onmousemove=a}function o(t,e){var r,n,a,i,o=e.type,s=f.getFromId(t,e.xref),c=f.getFromId(t,e.yref),u=t._fullLayout._size;if(s?(r=y.shapePositionToRange(s),n=function(t){return s._offset+s.r2p(r(t,!0))}):n=function(t){return u.l+u.w*t},c?(a=y.shapePositionToRange(c),i=function(t){return c._offset+c.r2p(a(t,!0))}):i=function(t){return u.t+u.h*(1-t)},"path"===o)return s&&"date"===s.type&&(n=y.decodeDate(n)),c&&"date"===c.type&&(i=y.decodeDate(i)),l(e.path,n,i);var d=n(e.x0),p=n(e.x1),h=i(e.y0),g=i(e.y1);if("line"===o)return"M"+d+","+h+"L"+p+","+g;if("rect"===o)return"M"+d+","+h+"H"+p+"V"+g+"H"+d+"Z";var v=(d+p)/2,m=(h+g)/2,x=Math.abs(v-d),b=Math.abs(m-h),_="A"+x+","+b,w=v+x+","+m;return"M"+w+_+" 0 1,1 "+v+","+(m-b)+_+" 0 0,1 "+w+"Z"}function l(t,e,r){return t.replace(v.segmentRE,function(t){var n=0,a=t.charAt(0),i=v.paramIsX[a],o=v.paramIsY[a],l=v.numParams[a],s=t.substr(1).replace(v.paramRE,function(t){return i[n]?t=e(t):o[n]&&(t=r(t)),n++,n>l&&(t="X"),t});return n>l&&(s=s.replace(/[\s,]*X.*/,""),u.log("Ignoring extra params in segment "+t)),a+s})}function s(t,e,r){return t.replace(v.segmentRE,function(t){var n=0,a=t.charAt(0),i=v.paramIsX[a],o=v.paramIsY[a],l=v.numParams[a];return a+t.substr(1).replace(v.paramRE,function(t){return n>=l?t:(i[n]?t=e(t):o[n]&&(t=r(t)),n++,t)})})}var c=t("../../plotly"),u=t("../../lib"),f=t("../../plots/cartesian/axes"),d=t("../color"),p=t("../drawing"),h=t("../dragelement"),g=t("../../lib/setcursor"),v=t("./constants"),y=t("./helpers");e.exports={draw:n,drawOne:a}},{"../../lib":152,"../../lib/setcursor":170,"../../plotly":187,"../../plots/cartesian/axes":192,"../color":37,"../dragelement":58,"../drawing":61,"./constants":116,"./helpers":119}],119:[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,i=t._fullLayout._size;if(e){var o=r.shapePositionToRange(e);a=function(t){return e._offset+e.r2p(o(t,!0))},"date"===e.type&&(a=r.decodeDate(a))}else a=n?function(t){return i.t+i.h*(1-t)}:function(t){return i.l+i.w*t};return a},r.getPixelToData=function(t,e,n){var a,i=t._fullLayout._size;if(e){var o=r.rangeToShapePosition(e);a=function(t){return o(e.p2r(t-e._offset))}}else a=n?function(t){return 1-(t-i.t)/i.h}:function(t){return(t-i.l)/i.w};return a}},{}],120:[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":114,"./calc_autorange":115,"./defaults":117,"./draw":118}],121:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("./attributes"),o=t("./helpers");e.exports=function(t,e,r,l,s){function c(r,a){return n.coerce(t,e,i,r,a)}if(l=l||{},s=s||{},!c("visible",!s.itemIsNotPlainObject))return e;c("layer"),c("opacity"),c("fillcolor"),c("line.color"),c("line.width"),c("line.dash");for(var u=t.path?"path":"rect",f=c("type",u),d=["x","y"],p=0;p<2;p++){var h=d[p],g={_fullLayout:r},v=a.coerceRef(t,e,g,h,"","paper");if("path"!==f){var y,m,x;"paper"!==v?(y=a.getFromId(g,v),x=o.rangeToShapePosition(y),m=o.shapePositionToRange(y)):m=x=n.identity;var b=h+"0",_=h+"1",w=t[b],k=t[_];t[b]=m(t[b],!0),t[_]=m(t[_],!0),a.coercePosition(e,g,c,v,b,.25),a.coercePosition(e,g,c,v,_,.75),e[b]=x(e[b]),e[_]=x(e[_]),t[b]=w,t[_]=k}}return"path"===f?c("path"):n.noneOrAll(t,e,["x0","x1","y0","y1"]),e}},{"../../lib":152,"../../plots/cartesian/axes":192,"./attributes":114,"./helpers":119}],122:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../../plots/pad_attributes"),i=t("../../lib/extend").extendDeepAll,o=t("../../plot_api/edit_types").overrideAll,l=t("../../plots/animation_attributes"),s=t("./constants"),c={_isLinkedToArray:"step",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}};e.exports=o({_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:n({})},font: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}},"arraydraw","from-root")},{"../../lib/extend":146,"../../plot_api/edit_types":176,"../../plots/animation_attributes":188,"../../plots/font_attributes":216,"../../plots/pad_attributes":220,"./constants":123}],123:[function(t,e,r){"use strict";e.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5, -menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],124:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return i.coerce(t,e,l,r,n)}n("visible",a(t,e).length>0)&&(n("active"),n("x"),n("y"),i.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"),i.coerceFont(n,"font",r.font),n("currentvalue.visible")&&(n("currentvalue.xanchor"),n("currentvalue.prefix"),n("currentvalue.suffix"),n("currentvalue.offset"),i.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 i.coerce(n,a,u,t,e)}for(var n,a,o=t.steps||[],l=e.steps=[],s=0;s=r.steps.length&&(r.active=0),e.call(l,r).call(b,r).call(u,r).call(h,r).call(x,t,r).call(s,t,r),A.setTranslate(e,r.lx+r.pad.l,r.ly+r.pad.t),e.call(v,r,r.active/(r.steps.length-1),!1),e.call(l,r)}function l(t,e,r){if(e.currentvalue.visible){var n,a,i=t.selectAll("text").data([0]);switch(e.currentvalue.xanchor){case"right":n=e.inputAreaLength-C.currentValueInset-e.currentValueMaxWidth,a="left";break;case"center":n=.5*e.inputAreaLength,a="middle";break;default:n=C.currentValueInset,a="left"}i.enter().append("text").classed(C.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":a,"data-notex":1});var o=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)o+=r;else{o+=e.steps[e.active].label}e.currentvalue.suffix&&(o+=e.currentvalue.suffix),i.call(A.font,e.currentvalue.font).text(o).call(T.convertToTspans,e.gd);var l=T.lineCount(i),s=(e.currentValueMaxLines+1-l)*e.currentvalue.font.size*S;return T.positionText(i,n,s),i}}function s(t,e,r){var n=t.selectAll("rect."+C.gripRectClass).data([0]);n.enter().append("rect").classed(C.gripRectClass,!0).call(p,e,t,r).style("pointer-events","all"),n.attr({width:C.gripWidth,height:C.gripHeight,rx:C.gripRadius,ry:C.gripRadius}).call(M.stroke,r.bordercolor).call(M.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function c(t,e,r){var n=t.selectAll("text").data([0]);return n.enter().append("text").classed(C.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1}),n.call(A.font,r.font).text(e.step.label).call(T.convertToTspans,r.gd),n}function u(t,e){var r=t.selectAll("g."+C.labelsClass).data([0]);r.enter().append("g").classed(C.labelsClass,!0);var n=r.selectAll("g."+C.labelGroupClass).data(e.labelSteps);n.enter().append("g").classed(C.labelGroupClass,!0),n.exit().remove(),n.each(function(t){var r=w.select(this);r.call(c,t,e),A.setTranslate(r,y(e,t.fraction),C.tickOffset+e.ticklen+e.font.size*S+C.labelOffset+e.currentValueTotalHeight)})}function f(t,e,r,n,a){var i=Math.round(n*(r.steps.length-1));i!==r.active&&d(t,e,r,i,!0,a)}function d(t,e,r,n,a,i){var o=r.active;r._input.active=r.active=n;var s=r.steps[r.active];e.call(v,r,r.active/(r.steps.length-1),i),e.call(l,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:a,previousActive:o}),s&&s.method&&a&&(e._nextMethod?(e._nextMethod.step=s,e._nextMethod.doCallback=a,e._nextMethod.doTransition=i):(e._nextMethod={step:s,doCallback:a,doTransition:i},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(r.execute&&k.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function p(t,e,r){function n(){return r.data()[0]}var a=r.node(),i=w.select(e);t.on("mousedown",function(){var t=n();e.emit("plotly_sliderstart",{slider:t});var o=r.select("."+C.gripRectClass);w.event.stopPropagation(),w.event.preventDefault(),o.call(M.fill,t.activebgcolor);var l=m(t,w.mouse(a)[0]);f(e,r,t,l,!0),t._dragging=!0,i.on("mousemove",function(){var t=n(),i=m(t,w.mouse(a)[0]);f(e,r,t,i,!1)}),i.on("mouseup",function(){var t=n();t._dragging=!1,o.call(M.fill,t.bgcolor),i.on("mouseup",null),i.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function h(t,e){var r=t.selectAll("rect."+C.tickRectClass).data(e.steps);r.enter().append("rect").classed(C.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each(function(t,r){var n=r%e.labelStride==0,a=w.select(this);a.attr({height:n?e.ticklen:e.minorticklen}).call(M.fill,e.tickcolor),A.setTranslate(a,y(e,r/(e.steps.length-1))-.5*e.tickwidth,(n?C.tickOffset:C.minorTickOffset)+e.currentValueTotalHeight)})}function g(t){t.labelSteps=[];for(var e=t.steps.length,r=0;r0&&(o=o.transition().duration(e.transition.duration).ease(e.transition.easing)),o.attr("transform","translate("+(i-.5*C.gripWidth)+","+e.currentValueTotalHeight+")")}}function y(t,e){return t.inputAreaStart+C.stepInset+(t.inputAreaLength-2*C.stepInset)*Math.min(1,Math.max(0,e))}function m(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(p,e,t,r).style("pointer-events","all"),n.attr({width:r.inputAreaLength,height:Math.max(r.inputAreaWidth,C.tickOffset+r.ticklen+r.labelHeight)}).call(M.fill,r.bgcolor).attr("opacity",0),A.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(M.stroke,e.bordercolor).call(M.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),A.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 g={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[_.side];e.attr("transform","translate("+g+")")}}}var v,y=r.propContainer,m=r.propName,x=r.traceIndex,b=r.dfltName,_=r.avoid||{},w=r.attributes,k=r.transform,M=r.containerGroup,A=t._fullLayout,T=y.titlefont.family,L=y.titlefont.size,C=y.titlefont.color,S=1,z=!1,O=y.title.trim();"title"===m?v="titleText":-1!==m.indexOf("axis")?v="axisTitleText":m.indexOf(!0)&&(v="colorbarTitleText");var D=t._context.edits[v];""===O&&(S=0),O.match(d)&&(S=.2,z=!0,D||(O=""));var P=O||D;M||(M=A._infolayer.selectAll(".g-"+e).data([0]),M.enter().append("g").classed("g-"+e,!0));var E=M.selectAll("text").data(P?[0]:[]);if(E.enter().append("text"),E.text(O).attr("class",e),E.exit().remove(),P){E.call(p);var I="Click to enter "+b+" title";D&&(O?E.on(".opacity",null):function(){S=0,z=!0,O=I,E.text(O).on("mouseover.opacity",function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)})}(),E.call(u.makeEditable,{gd:t}).on("edit",function(e){void 0!==x?i.restyle(t,m,e,x):i.relayout(t,m,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(p)}).on("input",function(t){this.text(t||" ").call(u.positionText,w.x,w.y)})),E.classed("js-placeholder",z)}}},{"../../constants/interactions":135,"../../lib":152,"../../lib/svg_text_utils":172,"../../plotly":187,"../../plots/plots":221,"../color":37,"../drawing":61,d3:10,"fast-isnumeric":13}],128:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,l=t("../../plots/pad_attributes"),s={_isLinkedToArray:"button",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}};e.exports=o({_isLinkedToArray:"updatemenu",_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:s,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i({},l,{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}},"arraydraw","from-root")},{"../../lib/extend":146,"../../plot_api/edit_types":176,"../../plots/font_attributes":216,"../../plots/pad_attributes":220,"../color/attributes":36}],129:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],130:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return i.coerce(t,e,l,r,n)}n("visible",a(t,e).length>0)&&(n("active"),n("direction"),n("type"),n("showactive"),n("x"),n("y"),i.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),i.coerceFont(n,"font",r.font),n("bgcolor",r.paper_bgcolor),n("bordercolor"),n("borderwidth"))}function a(t,e){function r(t,e){return i.coerce(n,a,u,t,e)}for(var n,a,o=t.buttons||[],l=e.buttons=[],s=0;s0?[0]:[]);if(i.enter().append("g").classed(S.containerClassName,!0).style("cursor","pointer"),i.exit().remove(),i.exit().size()&&_(t),0!==r.length){var u=i.selectAll("g."+S.headerGroupClassName).data(r,a);u.enter().append("g").classed(S.headerGroupClassName,!0);var f=i.selectAll("g."+S.dropdownButtonGroupClassName).data([0]);f.enter().append("g").classed(S.dropdownButtonGroupClassName,!0).style("pointer-events","all");for(var d=0;dk,T=n.barLength+2*n.barPad,L=n.barWidth+2*n.barPad,C=h,S=v+y;S+L>c&&(S=c-L);var z=this.container.selectAll("rect.scrollbar-horizontal").data(A?[0]:[]);z.exit().on(".drag",null).remove(),z.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,n.barColor),A?(this.hbar=z.attr({rx:n.barRadius,ry:n.barRadius,x:C,y:S,width:T,height:L}),this._hbarXMin=C+T/2,this._hbarTranslateMax=k-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var O=y>M,D=n.barWidth+2*n.barPad,P=n.barLength+2*n.barPad,E=h+g,I=v;E+D>s&&(E=s-D);var N=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);N.exit().on(".drag",null).remove(),N.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,n.barColor),O?(this.vbar=N.attr({rx:n.barRadius,ry:n.barRadius,x:E,y:I,width:D,height:P}),this._vbarYMin=I+P/2,this._vbarTranslateMax=M-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,j=O?f+D+.5:f+.5,B=d-.5,q=A?p+L+.5:p+.5,H=l._topdefs.selectAll("#"+R).data(A||O?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",R).append("rect"),A||O?(this._clipRect=H.select("rect").attr({x:Math.floor(F),y:Math.floor(B),width:Math.ceil(j)-Math.floor(F),height:Math.ceil(q)-Math.floor(B)}),this.container.call(o.setClipUrl,R),this.bg.attr({x:h,y:v,width:g,height:y})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),A||O){var V=a.behavior.drag().on("dragstart",function(){a.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var U=a.behavior.drag().on("dragstart",function(){a.event.sourceEvent.preventDefault(),a.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));A&&this.hbar.on(".drag",null).call(U),O&&this.vbar.on(".drag",null).call(U)}this.setTranslate(e,r)},n.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},n.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=a.event.dx),this.vbar&&(e-=a.event.dy),this.setTranslate(t,e)},n.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=a.event.deltaY),this.vbar&&(e+=a.event.deltaY),this.setTranslate(t,e)},n.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,n=r+this._hbarTranslateMax;t=(l.constrain(a.event.x,r,n)-r)/(n-r)*(this.position.w-this._box.w)}if(this.vbar){var i=e+this._vbarYMin,o=i+this._vbarTranslateMax;e=(l.constrain(a.event.y,i,o)-i)/(o-i)*(this.position.h-this._box.h)}this.setTranslate(t,e)},n.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=l.constrain(t||0,0,r),e=l.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(o.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var a=t/r;this.hbar.call(o.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var i=e/n;this.vbar.call(o.setTranslate,t,e+i*this._vbarTranslateMax)}}},{"../../lib":152,"../color":37,"../drawing":61,d3:10}],134:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},LINE_SPACING:1.3,MID_SHIFT:.35}},{}],135:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300,DESELECTDIM:.2}},{}],136:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,MINUS_SIGN:"\u2212"}},{}],137:[function(t,e,r){"use strict";e.exports={entityToUnicode:{mu:"\u03bc","#956":"\u03bc",amp:"&","#28":"&",lt:"<","#60":"<",gt:">","#62":">",nbsp:"\xa0","#160":"\xa0",times:"\xd7","#215":"\xd7",plusmn:"\xb1","#177":"\xb1",deg:"\xb0","#176":"\xb0"}}},{}],138:[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}},{}],139:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.31.1",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/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"), +menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],124:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return i.coerce(t,e,l,r,n)}n("visible",a(t,e).length>0)&&(n("active"),n("x"),n("y"),i.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"),i.coerceFont(n,"font",r.font),n("currentvalue.visible")&&(n("currentvalue.xanchor"),n("currentvalue.prefix"),n("currentvalue.suffix"),n("currentvalue.offset"),i.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 i.coerce(n,a,u,t,e)}for(var n,a,o=t.steps||[],l=e.steps=[],s=0;s=r.steps.length&&(r.active=0),e.call(l,r).call(b,r).call(u,r).call(h,r).call(x,t,r).call(s,t,r),A.setTranslate(e,r.lx+r.pad.l,r.ly+r.pad.t),e.call(v,r,r.active/(r.steps.length-1),!1),e.call(l,r)}function l(t,e,r){if(e.currentvalue.visible){var n,a,i=t.selectAll("text").data([0]);switch(e.currentvalue.xanchor){case"right":n=e.inputAreaLength-C.currentValueInset-e.currentValueMaxWidth,a="left";break;case"center":n=.5*e.inputAreaLength,a="middle";break;default:n=C.currentValueInset,a="left"}i.enter().append("text").classed(C.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":a,"data-notex":1});var o=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)o+=r;else{o+=e.steps[e.active].label}e.currentvalue.suffix&&(o+=e.currentvalue.suffix),i.call(A.font,e.currentvalue.font).text(o).call(T.convertToTspans,e.gd);var l=T.lineCount(i),s=(e.currentValueMaxLines+1-l)*e.currentvalue.font.size*S;return T.positionText(i,n,s),i}}function s(t,e,r){var n=t.selectAll("rect."+C.gripRectClass).data([0]);n.enter().append("rect").classed(C.gripRectClass,!0).call(p,e,t,r).style("pointer-events","all"),n.attr({width:C.gripWidth,height:C.gripHeight,rx:C.gripRadius,ry:C.gripRadius}).call(M.stroke,r.bordercolor).call(M.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function c(t,e,r){var n=t.selectAll("text").data([0]);return n.enter().append("text").classed(C.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1}),n.call(A.font,r.font).text(e.step.label).call(T.convertToTspans,r.gd),n}function u(t,e){var r=t.selectAll("g."+C.labelsClass).data([0]);r.enter().append("g").classed(C.labelsClass,!0);var n=r.selectAll("g."+C.labelGroupClass).data(e.labelSteps);n.enter().append("g").classed(C.labelGroupClass,!0),n.exit().remove(),n.each(function(t){var r=w.select(this);r.call(c,t,e),A.setTranslate(r,y(e,t.fraction),C.tickOffset+e.ticklen+e.font.size*S+C.labelOffset+e.currentValueTotalHeight)})}function f(t,e,r,n,a){var i=Math.round(n*(r.steps.length-1));i!==r.active&&d(t,e,r,i,!0,a)}function d(t,e,r,n,a,i){var o=r.active;r._input.active=r.active=n;var s=r.steps[r.active];e.call(v,r,r.active/(r.steps.length-1),i),e.call(l,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:a,previousActive:o}),s&&s.method&&a&&(e._nextMethod?(e._nextMethod.step=s,e._nextMethod.doCallback=a,e._nextMethod.doTransition=i):(e._nextMethod={step:s,doCallback:a,doTransition:i},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(r.execute&&k.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function p(t,e,r){function n(){return r.data()[0]}var a=r.node(),i=w.select(e);t.on("mousedown",function(){var t=n();e.emit("plotly_sliderstart",{slider:t});var o=r.select("."+C.gripRectClass);w.event.stopPropagation(),w.event.preventDefault(),o.call(M.fill,t.activebgcolor);var l=m(t,w.mouse(a)[0]);f(e,r,t,l,!0),t._dragging=!0,i.on("mousemove",function(){var t=n(),i=m(t,w.mouse(a)[0]);f(e,r,t,i,!1)}),i.on("mouseup",function(){var t=n();t._dragging=!1,o.call(M.fill,t.bgcolor),i.on("mouseup",null),i.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function h(t,e){var r=t.selectAll("rect."+C.tickRectClass).data(e.steps);r.enter().append("rect").classed(C.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each(function(t,r){var n=r%e.labelStride==0,a=w.select(this);a.attr({height:n?e.ticklen:e.minorticklen}).call(M.fill,e.tickcolor),A.setTranslate(a,y(e,r/(e.steps.length-1))-.5*e.tickwidth,(n?C.tickOffset:C.minorTickOffset)+e.currentValueTotalHeight)})}function g(t){t.labelSteps=[];for(var e=t.steps.length,r=0;r0&&(o=o.transition().duration(e.transition.duration).ease(e.transition.easing)),o.attr("transform","translate("+(i-.5*C.gripWidth)+","+e.currentValueTotalHeight+")")}}function y(t,e){return t.inputAreaStart+C.stepInset+(t.inputAreaLength-2*C.stepInset)*Math.min(1,Math.max(0,e))}function m(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(p,e,t,r).style("pointer-events","all"),n.attr({width:r.inputAreaLength,height:Math.max(r.inputAreaWidth,C.tickOffset+r.ticklen+r.labelHeight)}).call(M.fill,r.bgcolor).attr("opacity",0),A.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(M.stroke,e.bordercolor).call(M.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),A.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 g={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[_.side];e.attr("transform","translate("+g+")")}}}var v,y=r.propContainer,m=r.propName,x=r.traceIndex,b=r.dfltName,_=r.avoid||{},w=r.attributes,k=r.transform,M=r.containerGroup,A=t._fullLayout,T=y.titlefont.family,L=y.titlefont.size,C=y.titlefont.color,S=1,z=!1,O=y.title.trim();"title"===m?v="titleText":-1!==m.indexOf("axis")?v="axisTitleText":m.indexOf(!0)&&(v="colorbarTitleText");var D=t._context.edits[v];""===O&&(S=0),O.match(d)&&(S=.2,z=!0,D||(O=""));var P=O||D;M||(M=A._infolayer.selectAll(".g-"+e).data([0]),M.enter().append("g").classed("g-"+e,!0));var E=M.selectAll("text").data(P?[0]:[]);if(E.enter().append("text"),E.text(O).attr("class",e),E.exit().remove(),P){E.call(p);var I="Click to enter "+b+" title";D&&(O?E.on(".opacity",null):function(){S=0,z=!0,O=I,E.text(O).on("mouseover.opacity",function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)})}(),E.call(u.makeEditable,{gd:t}).on("edit",function(e){void 0!==x?i.restyle(t,m,e,x):i.relayout(t,m,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(p)}).on("input",function(t){this.text(t||" ").call(u.positionText,w.x,w.y)})),E.classed("js-placeholder",z)}}},{"../../constants/interactions":135,"../../lib":152,"../../lib/svg_text_utils":172,"../../plotly":187,"../../plots/plots":221,"../color":37,"../drawing":61,d3:10,"fast-isnumeric":13}],128:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,l=t("../../plots/pad_attributes"),s={_isLinkedToArray:"button",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}};e.exports=o({_isLinkedToArray:"updatemenu",_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:s,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i({},l,{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}},"arraydraw","from-root")},{"../../lib/extend":146,"../../plot_api/edit_types":176,"../../plots/font_attributes":216,"../../plots/pad_attributes":220,"../color/attributes":36}],129:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],130:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return i.coerce(t,e,l,r,n)}n("visible",a(t,e).length>0)&&(n("active"),n("direction"),n("type"),n("showactive"),n("x"),n("y"),i.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),i.coerceFont(n,"font",r.font),n("bgcolor",r.paper_bgcolor),n("bordercolor"),n("borderwidth"))}function a(t,e){function r(t,e){return i.coerce(n,a,u,t,e)}for(var n,a,o=t.buttons||[],l=e.buttons=[],s=0;s0?[0]:[]);if(i.enter().append("g").classed(S.containerClassName,!0).style("cursor","pointer"),i.exit().remove(),i.exit().size()&&_(t),0!==r.length){var u=i.selectAll("g."+S.headerGroupClassName).data(r,a);u.enter().append("g").classed(S.headerGroupClassName,!0);var f=i.selectAll("g."+S.dropdownButtonGroupClassName).data([0]);f.enter().append("g").classed(S.dropdownButtonGroupClassName,!0).style("pointer-events","all");for(var d=0;dk,T=n.barLength+2*n.barPad,L=n.barWidth+2*n.barPad,C=h,S=v+y;S+L>c&&(S=c-L);var z=this.container.selectAll("rect.scrollbar-horizontal").data(A?[0]:[]);z.exit().on(".drag",null).remove(),z.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,n.barColor),A?(this.hbar=z.attr({rx:n.barRadius,ry:n.barRadius,x:C,y:S,width:T,height:L}),this._hbarXMin=C+T/2,this._hbarTranslateMax=k-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var O=y>M,D=n.barWidth+2*n.barPad,P=n.barLength+2*n.barPad,E=h+g,I=v;E+D>s&&(E=s-D);var N=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);N.exit().on(".drag",null).remove(),N.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,n.barColor),O?(this.vbar=N.attr({rx:n.barRadius,ry:n.barRadius,x:E,y:I,width:D,height:P}),this._vbarYMin=I+P/2,this._vbarTranslateMax=M-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,j=O?f+D+.5:f+.5,B=d-.5,q=A?p+L+.5:p+.5,H=l._topdefs.selectAll("#"+R).data(A||O?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",R).append("rect"),A||O?(this._clipRect=H.select("rect").attr({x:Math.floor(F),y:Math.floor(B),width:Math.ceil(j)-Math.floor(F),height:Math.ceil(q)-Math.floor(B)}),this.container.call(o.setClipUrl,R),this.bg.attr({x:h,y:v,width:g,height:y})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),A||O){var V=a.behavior.drag().on("dragstart",function(){a.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var U=a.behavior.drag().on("dragstart",function(){a.event.sourceEvent.preventDefault(),a.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));A&&this.hbar.on(".drag",null).call(U),O&&this.vbar.on(".drag",null).call(U)}this.setTranslate(e,r)},n.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},n.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=a.event.dx),this.vbar&&(e-=a.event.dy),this.setTranslate(t,e)},n.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=a.event.deltaY),this.vbar&&(e+=a.event.deltaY),this.setTranslate(t,e)},n.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,n=r+this._hbarTranslateMax;t=(l.constrain(a.event.x,r,n)-r)/(n-r)*(this.position.w-this._box.w)}if(this.vbar){var i=e+this._vbarYMin,o=i+this._vbarTranslateMax;e=(l.constrain(a.event.y,i,o)-i)/(o-i)*(this.position.h-this._box.h)}this.setTranslate(t,e)},n.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=l.constrain(t||0,0,r),e=l.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(o.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var a=t/r;this.hbar.call(o.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var i=e/n;this.vbar.call(o.setTranslate,t,e+i*this._vbarTranslateMax)}}},{"../../lib":152,"../color":37,"../drawing":61,d3:10}],134:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},LINE_SPACING:1.3,MID_SHIFT:.35}},{}],135:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300,DESELECTDIM:.2}},{}],136:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,MINUS_SIGN:"\u2212"}},{}],137:[function(t,e,r){"use strict";e.exports={entityToUnicode:{mu:"\u03bc","#956":"\u03bc",amp:"&","#28":"&",lt:"<","#60":"<",gt:">","#62":">",nbsp:"\xa0","#160":"\xa0",times:"\xd7","#215":"\xd7",plusmn:"\xb1","#177":"\xb1",deg:"\xb0","#176":"\xb0"}}},{}],138:[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}},{}],139:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.31.2",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/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"), r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":30,"./components/annotations3d":35,"./components/fx":78,"./components/images":86,"./components/legend":95,"./components/rangeselector":107,"./components/rangeslider":113,"./components/shapes":120,"./components/sliders":126,"./components/updatemenus":132,"./fonts/mathjax_config":140,"./lib/queue":165,"./plot_api/plot_schema":181,"./plot_api/register":182,"./plot_api/set_plot_config":183,"./plot_api/to_image":185,"./plot_api/validate":186,"./plotly":187,"./snapshot":233,"./snapshot/download":230,"./traces/scatter":304,d3:10,"es6-promise":11}],140:[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},{}],141:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../constants/numerical").BADNUM,i=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(i,"")),n(t)?Number(t):a}},{"../constants/numerical":136,"fast-isnumeric":13}],142:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("tinycolor2"),i=t("../plots/attributes"),o=t("../components/colorscale/get_scale"),l=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),s=t("./regex").counter;r.valObjectMeta={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),-1===n.values.indexOf(t)?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;na.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,a){t%1||!n(t)||void 0!==a.min&&ta.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var a="number"==typeof t;!0!==n.strict&&a?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){a(t).isValid()?e.set(t):e.set(r)}},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){if("string"==typeof t&&s(r).test(t))return void e.set(t);e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!s(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"!=typeof t)return void e.set(r);if(-1!==(n.extras||[]).indexOf(t))return void e.set(t);for(var a=t.split("+"),i=0;i0&&(o=o.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+o}return n}function s(t){return t.formatDate("yyyy")}function c(t){return t.formatDate("M yyyy")}function u(t){return t.formatDate("M d")}function f(t){return t.formatDate("M d, yyyy")}var d=t("d3"),p=t("fast-isnumeric"),h=t("./loggers").error,g=t("./mod"),v=t("../constants/numerical"),y=v.BADNUM,m=v.ONEDAY,x=v.ONEHOUR,b=v.ONEMIN,_=v.ONESEC,w=v.EPOCHJD,k=t("../registry"),M=d.time.format.utc,A=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,T=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,L=(new Date).getFullYear()-70;r.dateTick0=function(t,e){return n(t)?e?k.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:k.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},r.dfltRange=function(t){return n(t)?k.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},r.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime};var C,S;r.dateTime2ms=function(t,e){if(r.isJSDate(t))return t=Number(t)-t.getTimezoneOffset()*b,t>=C&&t<=S?t:y;if("string"!=typeof t&&"number"!=typeof t)return y;t=String(t);var a=n(e),i=t.charAt(0);!a||"G"!==i&&"g"!==i||(t=t.substr(1),e="");var o=a&&"chinese"===e.substr(0,7),l=t.match(o?T:A);if(!l)return y;var s=l[1],c=l[3]||"1",u=Number(l[5]||1),f=Number(l[7]||0),d=Number(l[9]||0),p=Number(l[11]||0);if(a){if(2===s.length)return y;s=Number(s);var h;try{var g=k.getComponentMethod("calendars","getCal")(e);if(o){var v="i"===c.charAt(c.length-1);c=parseInt(c,10),h=g.newDate(s,g.toMonthIndex(s,c,v),u)}else h=g.newDate(s,Number(c),u)}catch(t){return y}return h?(h.toJD()-w)*m+f*x+d*b+p*_:y}s=2===s.length?(Number(s)+2e3-L)%100+L:Number(s),c-=1;var M=new Date(Date.UTC(2e3,c,u,f,d));return M.setUTCFullYear(s),M.getUTCMonth()!==c?y:M.getUTCDate()!==u?y:M.getTime()+p*_},C=r.MIN_MS=r.dateTime2ms("-9999"),S=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==y};var z=90*m,O=3*x,D=5*b;r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=C&&t<=S))return y;e||(e=0);var a,o,l,s,c,u,f=Math.floor(10*g(t+.05,1)),d=Math.round(t-f/10);if(n(r)){var p=Math.floor(d/m)+w,h=Math.floor(g(t,m));try{a=k.getComponentMethod("calendars","getCal")(r).fromJD(p).formatDate("yyyy-mm-dd")}catch(t){a=M("G%Y-%m-%d")(new Date(d))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;o=e=C+m&&t<=S-m))return y;var e=Math.floor(10*g(t+.05,1)),r=new Date(Math.round(t-e/10));return i(d.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,a){if(r.isJSDate(t)||"number"==typeof t){if(n(a))return h("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,a))return h("unrecognized date",t),e;return t};var P=/%\d?f/g,E=[59,59.9,59.99,59.999,59.9999],I=M("%Y"),N=M("%b %Y"),R=M("%b %-d"),F=M("%b %-d, %Y");r.formatDate=function(t,e,r,a){var i,d;if(a=n(a)&&a,e)return o(e,t,a);if(a)try{var p=Math.floor((t+.05)/m)+w,h=k.getComponentMethod("calendars","getCal")(a).fromJD(p);"y"===r?d=s(h):"m"===r?d=c(h):"d"===r?(i=s(h),d=u(h)):(i=f(h),d=l(t,r))}catch(t){return"Invalid"}else{var g=new Date(Math.floor(t+.05));"y"===r?d=I(g):"m"===r?d=N(g):"d"===r?(i=I(g),d=R(g)):(i=F(g),d=l(t,r))}return d+(i?"\n"+i:"")};var j=3*m;r.incrementMonth=function(t,e,r){r=n(r)&&r;var a=g(t,m);if(t=Math.round(t-a),r)try{var i=Math.round(t/m)+w,o=k.getComponentMethod("calendars","getCal")(r),l=o.fromJD(i);return e%12?o.add(l,e,"m"):o.add(l,e/12,"y"),(l.toJD()-w)*m+a}catch(e){h("invalid ms "+t+" in calendar "+r)}var s=new Date(t+j);return s.setUTCMonth(s.getUTCMonth()+e)+a-j},r.findExactDates=function(t,e){for(var r,a,i=0,o=0,l=0,s=0,c=n(e)&&k.getComponentMethod("calendars","getCal")(e),u=0;u1||g<0||g>1?null:{x:t+s*g,y:e+f*g}}function a(t,e,r,n,a){var i=n*t+a*e;if(i<0)return n*n+a*a;if(i>r){var o=n-t,l=a-e;return o*o+l*l}var s=n*e-a*t;return s*s/r}var i=t("./mod");r.segmentsIntersect=n,r.segmentDistance=function(t,e,r,i,o,l,s,c){if(n(t,e,r,i,o,l,s,c))return 0;var u=r-t,f=i-e,d=s-o,p=c-l,h=u*u+f*f,g=d*d+p*p,v=Math.min(a(u,f,h,o-t,l-e),a(u,f,h,s-t,c-e),a(d,p,g,t-o,e-l),a(d,p,g,r-o,i-l));return Math.sqrt(v)};var o,l,s;r.getTextLocation=function(t,e,r,n){if(t===l&&n===s||(o={},l=t,s=n),o[r])return o[r];var a=t.getPointAtLength(i(r-n/2,e)),c=t.getPointAtLength(i(r+n/2,e)),u=Math.atan((c.y-a.y)/(c.x-a.x)),f=t.getPointAtLength(i(r,e)),d=(4*f.x+a.x+c.x)/6,p=(4*f.y+a.y+c.y)/6,h={x:d,y:p,theta:u};return o[r]=h,h},r.clearLocationCache=function(){l=null},r.getVisibleSegment=function(t,e,r){function n(e){var r=t.getPointAtLength(e);0===e?a=r:e===f&&(i=r);var n=r.xl?r.x-l:0,u=r.yc?r.y-c:0;return Math.sqrt(n*n+u*u)}for(var a,i,o=e.left,l=e.right,s=e.top,c=e.bottom,u=0,f=t.getTotalLength(),d=f,p=n(u);p;){if((u+=p+r)>d)return;p=n(u)}for(p=n(d);p;){if(d-=p+r,u>d)return;p=n(d)}return{min:u,max:d,len:d-u,total:f,isClosed:0===u&&d===f&&Math.abs(a.x-i.x)<.1&&Math.abs(a.y-i.y)<.1}}},{"./mod":158}],150:[function(t,e,r){"use strict";e.exports=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t}},{}],151:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],152:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../constants/numerical"),o=i.FP_SAFE,l=i.BADNUM,s=e.exports={};s.nestedProperty=t("./nested_property"),s.keyedContainer=t("./keyed_container"),s.relativeAttr=t("./relative_attr"),s.isPlainObject=t("./is_plain_object"),s.isArray=t("./is_array"),s.mod=t("./mod"),s.toLogRange=t("./to_log_range"),s.relinkPrivateKeys=t("./relink_private"),s.ensureArray=t("./ensure_array");var c=t("./coerce");s.valObjectMeta=c.valObjectMeta,s.coerce=c.coerce,s.coerce2=c.coerce2,s.coerceFont=c.coerceFont,s.coerceHoverinfo=c.coerceHoverinfo,s.validate=c.validate;var u=t("./dates");s.dateTime2ms=u.dateTime2ms,s.isDateTime=u.isDateTime,s.ms2DateTime=u.ms2DateTime,s.ms2DateTimeLocal=u.ms2DateTimeLocal,s.cleanDate=u.cleanDate,s.isJSDate=u.isJSDate,s.formatDate=u.formatDate,s.incrementMonth=u.incrementMonth,s.dateTick0=u.dateTick0,s.dfltRange=u.dfltRange,s.findExactDates=u.findExactDates,s.MIN_MS=u.MIN_MS,s.MAX_MS=u.MAX_MS;var f=t("./search");s.findBin=f.findBin,s.sorterAsc=f.sorterAsc,s.sorterDes=f.sorterDes,s.distinctVals=f.distinctVals,s.roundUp=f.roundUp;var d=t("./stats");s.aggNums=d.aggNums,s.len=d.len,s.mean=d.mean,s.variance=d.variance,s.stdev=d.stdev,s.interp=d.interp;var p=t("./matrix");s.init2dArray=p.init2dArray,s.transposeRagged=p.transposeRagged,s.dot=p.dot,s.translationMatrix=p.translationMatrix,s.rotationMatrix=p.rotationMatrix,s.rotationXYMatrix=p.rotationXYMatrix,s.apply2DTransform=p.apply2DTransform,s.apply2DTransform2=p.apply2DTransform2;var h=t("./geometry2d");s.segmentsIntersect=h.segmentsIntersect,s.segmentDistance=h.segmentDistance,s.getTextLocation=h.getTextLocation,s.clearLocationCache=h.clearLocationCache,s.getVisibleSegment=h.getVisibleSegment;var g=t("./extend");s.extendFlat=g.extendFlat,s.extendDeep=g.extendDeep,s.extendDeepAll=g.extendDeepAll,s.extendDeepNoArrays=g.extendDeepNoArrays;var v=t("./loggers");s.log=v.log,s.warn=v.warn,s.error=v.error;var y=t("./regex");s.counterRegex=y.counter;var m=t("./throttle");s.throttle=m.throttle,s.throttleDone=m.done,s.clearThrottle=m.clear,s.getGraphDiv=t("./get_graph_div"),s.notifier=t("./notifier"),s.filterUnique=t("./filter_unique"),s.filterVisible=t("./filter_visible"),s.pushUnique=t("./push_unique"),s.cleanNumber=t("./clean_number"),s.ensureNumber=function(t){return a(t)?(t=Number(t),t<-o||t>o?l:a(t)?Number(t):l):l},s.noop=t("./noop"),s.identity=t("./identity"),s.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var a=0;ar?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},s.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},s.simpleMap=function(t,e,r,n){for(var a=t.length,i=new Array(a),o=0;o-1||u!==1/0&&u>=Math.pow(2,r)?t(e,r,n):s},s.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},s.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,a,i,o=t.length,l=2*o,s=2*e-1,c=new Array(s),u=new Array(o);for(r=0;r=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=t[a]*c[n];u[r]=i}return u},s.syncOrAsync=function(t,e,r){function n(){return s.syncOrAsync(t,e,r)}for(var a,i;t.length;)if(i=t.splice(0,1)[0],(a=i(e))&&a.then)return a.then(n).then(void 0,s.promiseError);return r&&r(e)},s.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},s.noneOrAll=function(t,e,r){if(t){var n,a,i=!1,o=!0;for(n=0;n1?a+o[1]:"";if(i&&(o.length>1||l.length>4||r))for(;n.test(l);)l=l.replace(n,"$1"+i+"$2");return l+s};var _=/%{([^\s%{}]*)}/g,w=/^\w*$/;s.templateString=function(t,e){var r={};return t.replace(_,function(t,n){return w.test(n)?e[n]||"":(r[n]=r[n]||s.nestedProperty(e,n).get,r[n]()||"")})}},{"../constants/numerical":136,"./clean_number":141,"./coerce":142,"./dates":143,"./ensure_array":144,"./extend":146,"./filter_unique":147,"./filter_visible":148,"./geometry2d":149,"./get_graph_div":150,"./identity":151,"./is_array":153,"./is_plain_object":154,"./keyed_container":155,"./loggers":156,"./matrix":157,"./mod":158,"./nested_property":159,"./noop":160,"./notifier":161,"./push_unique":164,"./regex":166,"./relative_attr":167,"./relink_private":168,"./search":169,"./stats":171,"./throttle":173,"./to_log_range":174,d3:10,"fast-isnumeric":13}],153:[function(t,e,r){"use strict";var n="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}};e.exports=function(t){return Array.isArray(t)||n.isView(t)}},{}],154:[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}},{}],155:[function(t,e,r){"use strict";var n=t("./nested_property"),a=/^\w*$/;e.exports=function(t,e,r,i){r=r||"name",i=i||"value";var o,l,s={};l=e&&e.length?n(t,e).get():t,e=e||"",l=l||[];var c={};for(o=0;o2)return s[e]=2|s[e],f.set(t,null);if(u){for(o=e;o1){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][0],i=t[e][1],s=!1,p(n))for(r=n.length-1;r>=0;r--)a(n[r],o(i,r))?s?n[r]=void 0:n.pop():s=!0;else if("object"==typeof n&&null!==n)for(l=Object.keys(n),s=!1,r=l.length-1;r>=0;r--)a(n[l[r]],o(i,l[r]))?delete n[l[r]]:s=!0;if(s)return}}function u(t){return void 0===t||null===t||"object"==typeof t&&(p(t)?!t.length:!Object.keys(t).length)}function f(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}var d=t("fast-isnumeric"),p=t("./is_array"),h=t("./is_plain_object"),g=t("../plot_api/container_array_match");e.exports=function(t,e){if(d(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,a,o,l=0,s=e.split(".");l/g),l=0;lo||n===a||ns)&&(!e||!u(t))}function r(t,e){var r=t[0],c=t[1];if(r===a||ro||c===a||cs)return!1;var u,f,d,p,h,g=n.length,v=n[0][0],y=n[0][1],m=0;for(u=1;uMath.max(f,v)||c>Math.max(d,y)))if(cu||Math.abs(n(o,d))>a)return!0;return!1};i.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){r(t.pop())}return{addPt:r,raw:t,filtered:n}}},{"../constants/numerical":136,"./matrix":157}],164:[function(t,e,r){"use strict";e.exports=function(t,e){ if(e instanceof RegExp){var r,n=e.toString();for(r=0;ri.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--)},o.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},o.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},o.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 o(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,p=0;for(u=e[e.length-1]>=e[0]?r?n:a:r?o:i;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,i=a/(n||1)/1e4,o=[e[0]],l=0;le[l]+i&&(a=Math.min(a,e[l+1]-e[l]),o.push(e[l+1]));return{vals:o,minDiff:a}},r.roundUp=function(t,e,r){for(var n,a=0,i=e.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;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":13}],172:[function(t,e,r){"use strict";function n(t,e){return t.node().getBoundingClientRect()[e]}function a(t){return t.replace(y,"\\lt ").replace(m,"\\gt ")}function i(t,e,r){var n="math-output-"+d.randstr([],64),i=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,i.node()],function(){var e=f.select("body").select("#MathJax_SVG_glyphs");if(i.select(".MathJax_SVG").empty()||!i.select("svg").node())d.log("There was an error in the tex syntax.",t),r();else{var n=i.select("svg").node().getBoundingClientRect();r(i.select(".MathJax_SVG"),e,n)}i.remove()})}function o(t,e){if(!t)return null;var r=t.match(e);return r&&(r[3]||r[4])}function l(t,e){if(!t)return"";for(var r=0;r1)for(var a=1;a.",e);var r=c.pop();t!==r.type&&d.log("Start tag <"+r.type+"> doesnt match end tag <"+t+">. Pretending it did match.",e),i=c[c.length-1].node}(M);else{var I=m[4],N={type:M},R=o(I,z);if(R?(R=R.replace(E,"$1 fill:"),A&&(R+=";"+A)):A&&(R=A),R&&(N.style=R),"a"===M){l=!0;var F=o(I,O);if(F){var j=document.createElement("a");j.href=F,-1!==k.indexOf(j.protocol)&&(N.href=encodeURI(F),N.target=o(I,D)||"_blank",N.popup=o(I,P))}}n(N)}}return l}function u(t,e,r){var n,a,i,o=r.horizontalAlign,l=r.verticalAlign||"top",s=t.node().getBoundingClientRect(),c=e.node().getBoundingClientRect();return a="bottom"===l?function(){return s.bottom-n.height}:"middle"===l?function(){return s.top+(s.height-n.height)/2}:function(){return s.top},i="right"===o?function(){return s.right-n.width}:"center"===o?function(){return s.left+(s.width-n.width)/2}:function(){return s.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:a()-c.top+"px",left:i()-c.left+"px","z-index":1e3}),this}}var f=t("d3"),d=t("../lib"),p=t("../constants/xmlns_namespaces"),h=t("../constants/string_mappings"),g=t("../constants/alignment").LINE_SPACING,v=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,a){function o(){u.empty()||(d=t.attr("class")+"-math",u.select("svg."+d).remove()),t.text("").style("white-space","pre"),c(t.node(),l)&&t.style("pointer-events","all"),r.positionText(t),a&&a.call(t)}var l=t.text(),s=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&l.match(v),u=f.select(t.node().parentNode);if(!u.empty()){var d=t.attr("class")?t.attr("class").split(" ")[0]:"text";return d+="-math",u.selectAll("svg."+d).remove(),u.selectAll("g."+d+"-group").remove(),t.style("display",null).attr({"data-unformatted":l,"data-math":"N"}),s?(e&&e._promises||[]).push(new Promise(function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10);i(s[2],{fontSize:r},function(i,s,c){u.selectAll("svg."+d).remove(),u.selectAll("g."+d+"-group").remove();var f=i&&i.select("svg");if(!f||!f.node())return o(),void e();var p=u.append("g").classed(d+"-group",!0).attr({"pointer-events":"none","data-unformatted":l,"data-math":"Y"});p.node().appendChild(f.node()),s&&s.node()&&f.node().insertBefore(s.node().cloneNode(!0),f.node().firstChild),f.attr({class:d,height:c.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var h=t.node().style.fill||"black";f.select("g").attr({fill:h,stroke:h});var g=n(f,"width"),v=n(f,"height"),y=+t.attr("x")-g*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],m=r||n(t,"height"),x=-m/4;"y"===d[0]?(p.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-g/2,x-v/2]+")"}),f.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===d[0]?f.attr({x:t.attr("x"),y:x-v/2}):"a"===d[0]?f.attr({x:0,y:x}):f.attr({x:y,y:+t.attr("y")+x-v/2}),a&&a.call(t,p),e(p)})})):o(),t}};var y=/(<|<|<)/g,m=/(>|>|>)/g,x={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},b={sub:"0.3em",sup:"-0.6em"},_={sub:"-0.21em",sup:"0.42em"},w="\u200b",k=["http:","https:","mailto:","",void 0,":"],M=new RegExp("]*)?/?>","g"),A=Object.keys(h.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:h.entityToUnicode[t]}}),T=/(\r\n?|\n)/g,L=/(<[^<>]*>)/,C=/<(\/?)([^ >]*)(\s+(.*))?>/i,S=//i,z=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,O=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,D=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,P=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i,E=/(^|;)\s*color:/;r.plainText=function(t){return(t||"").replace(M," ")},r.lineCount=function(t){return t.selectAll("tspan.line").size()||1},r.positionText=function(t,e,r){return t.each(function(){function t(t,e){return void 0===e?null===(e=n.attr(t))&&(n.attr(t,0),e=0):n.attr(t,e),e}var n=f.select(this),a=t("x",e),i=t("y",r);"text"===this.nodeName&&n.selectAll("tspan.line").attr({x:a,y:i})})},r.makeEditable=function(t,e){function r(){a(),t.style({opacity:0});var e,r=s.attr("class");(e=r?"."+r.split(" ")[0]+"-math-group":"[class*=-math-group]")&&f.select(t.node().parentNode).select(e).style({opacity:0})}function n(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}function a(){var r=f.select(i),a=r.select(".svg-container"),o=a.append("div"),s=t.node().style,c=parseFloat(s.fontSize||12);o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":s.fontFamily||"Arial","font-size":c,color:e.fill||s.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-c/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(e.text||t.attr("data-unformatted")).call(u(t,a,e)).on("blur",function(){i._editing=!1,t.text(this.textContent).style({opacity:1});var e,r=f.select(this).attr("class");(e=r?"."+r.split(" ")[0]+"-math-group":"[class*=-math-group]")&&f.select(t.node().parentNode).select(e).style({opacity:0});var n=this.textContent;f.select(this).transition().duration(0).remove(),f.select(document).on("mouseup",null),l.edit.call(t,n)}).on("focus",function(){var t=this;i._editing=!0,f.select(document).on("mouseup",function(){if(f.event.target===t)return!1;document.activeElement===o.node()&&o.node().blur()})}).on("keyup",function(){27===f.event.which?(i._editing=!1,t.style({opacity:1}),f.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),l.cancel.call(t,this.textContent)):(l.input.call(t,this.textContent),f.select(this).call(u(t,a,e)))}).on("keydown",function(){13===f.event.which&&this.blur()}).call(n)}var i=e.gd,o=e.delegate,l=f.dispatch("edit","input","cancel"),s=o||t;if(t.style({"pointer-events":o?"none":"all"}),1!==t.size())throw new Error("boo");return e.immediate?r():s.on("click",r),f.rebind(t,l,"on")}},{"../constants/alignment":134,"../constants/string_mappings":137,"../constants/xmlns_namespaces":138,"../lib":152,d3:10}],173:[function(t,e,r){"use strict";function n(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}var a={};r.throttle=function(t,e,r){function i(){r(),o.ts=Date.now(),o.onDone&&(o.onDone(),o.onDone=null)}var o=a[t],l=Date.now();if(!o){for(var s in a)a[s].tso.ts+e)return void i();o.timer=setTimeout(function(){i(),o.timer=null},e)},r.done=function(t){var e=a[t];return e&&e.timer?new Promise(function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}}):Promise.resolve()},r.clear=function(t){if(t)n(a[t]),delete a[t];else for(var e in a)r.clear(e)}},{}],174:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},{"fast-isnumeric":13}],175:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=t.split("[")[0],l=0;l0)return t.substr(0,e)}var l=t("fast-isnumeric"),s=t("gl-mat4/fromQuat"),c=t("../registry"),u=t("../lib"),f=t("../plots/plots"),d=t("../plots/cartesian/axes"),p=t("../components/color");r.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&u.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=d.list({_fullLayout:t});for(e=0;e3?(v.x=1.02,v.xanchor="left"):v.x<-2&&(v.x=-.02,v.xanchor="right"),v.y>3?(v.y=1.02,v.yanchor="bottom"):v.y<-2&&(v.y=-.02,v.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var y=f.getSubplotIds(t,"gl3d");for(e=0;e1&&o.warn("Full array edits are incompatible with other edits",f);var m=r[""][""];if(u(m))e.set(null);else{if(!Array.isArray(m))return o.warn("Unrecognized full array edit value",f,m),!0;e.set(m)}return!g&&(d(v,y),p(t),!0)}var x,b,_,w,k,M,A,T=Object.keys(r).map(Number).sort(l),L=e.get(),C=L||[],S=n(y,f).get(),z=[],O=-1,D=C.length;for(x=0;xC.length-(A?0:1))o.warn("index out of range",f,_);else if(void 0!==M)k.length>1&&o.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(M)?z.push(_):A?("add"===M&&(M={}),C.splice(_,0,M),S&&S.splice(_,0,{})):o.warn("Unrecognized full object edit value",f,_,M),-1===O&&(O=_);else for(b=0;b=0;x--)C.splice(z[x],1),S&&S.splice(z[x],1);if(C.length?L||e.set(C):e.set(null),g)return!1;if(d(v,y),h!==i){var P;if(-1===O)P=T;else{for(D=Math.max(C.length,D),P=[],x=0;x=O);x++)P.push(_);for(x=O;x=t.data.length||a<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(a,n+1)>-1||a>=0&&e.indexOf(-t.data.length+a)>-1||a<0&&e.indexOf(t.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function c(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),s(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&s(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function u(t,e,r){var n,a;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&sX.range[0]?[1,2]:[2,1]);else{var W=X.range[0],Q=X.range[1];Y?(W<=0&&Q<=0&&r(E+".autorange",!0),W<=0?W=Q/1e6:Q<=0&&(Q=W/1e6),r(E+".range[0]",Math.log(W)/Math.LN10),r(E+".range[1]",Math.log(Q)/Math.LN10)):(r(E+".range[0]",Math.pow(10,W)),r(E+".range[1]",Math.pow(10,Q)))}else r(E+".autorange",!0);A.getComponentMethod("annotations","convertCoords")(t,B,S,r),A.getComponentMethod("images","convertCoords")(t,B,S,r)}else r(E+".autorange",!0),r(E+".range",null);w.nestedProperty(c,E+"._inputRange").set(null)}else if(D.match(j.AX_NAME_PATTERN)){var $=w.nestedProperty(c,M).get(),J=(S||{}).type;J&&"-"!==J||(J="linear"),A.getComponentMethod("annotations","convertCoords")(t,$,J,r),A.getComponentMethod("images","convertCoords")(t,$,J,r)}var K=I.containerArrayMatch(M);if(K){i=K.array,o=K.index;var tt=K.property,et=w.nestedProperty(s,i),rt=(et||[])[o]||{},nt=rt,at=H||{editType:"calc"},it=-1!==at.editType.indexOf("calcIfAutorange");""===o?(it?m.calc=!0:F.update(m,at),it=!1):""===tt&&(nt=S,I.isAddVal(S)?b[M]=null:I.isRemoveVal(S)?(b[M]=rt,nt=rt):w.warn("unrecognized full object value",e)),it&&(n(nt,"x")||n(nt,"y"))?m.calc=!0:F.update(m,at),d[i]||(d[i]={});var ot=d[i][o];ot||(ot=d[i][o]={}),ot[tt]=S,delete e[M]}else"reverse"===D?(R.range?R.range.reverse():(r(E+".autorange",!0),R.range=[1,0]),B.autorange?m.calc=!0:m.plot=!0):((!c._has("gl2d")||"dragmode"!==M||"lasso"!==S&&"select"!==S||"lasso"===q||"select"===q)&&H?F.update(m,H):m.calc=!0,C.set(S))}}for(i in d){I.applyContainerArrayChanges(t,w.nestedProperty(s,i),d[i],m)||(m.plot=!0)}var lt=c._axisConstraintGroups;for(y in k)for(o=0;o=l.length?l[0]:l[t]:l}function a(t){return Array.isArray(s)?t>=s.length?s[0]:s[t]:s}function i(t,e){var r=0;return function(){if(t&&++r===e)return t()}}if(t=w.getGraphDiv(t),!w.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 o=t._transitionData;o._frameQueue||(o._frameQueue=[]),r=L.supplyAnimationDefaults(r);var l=r.transition,s=r.frame;return void 0===o._frameWaitingCnt&&(o._frameWaitingCnt=0),new Promise(function(s,c){function u(){t.emit("plotly_animated"),window.cancelAnimationFrame(o._animationRaf),o._animationRaf=null}function f(){o._currentFrame&&o._currentFrame.onComplete&&o._currentFrame.onComplete();var e=o._currentFrame=o._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,o._lastFrameAt=Date.now(),o._timeToNext=e.frameOpts.duration,L.transition(t,e.frame.data,e.frame.layout,N.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then(function(){e.onComplete&&e.onComplete()}),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else u()}function d(){t.emit("plotly_animating"),o._lastFrameAt=-1/0,o._timeToNext=0,o._runningTransitions=0,o._currentFrame=null;var e=function(){o._animationRaf=window.requestAnimationFrame(e),Date.now()-o._lastFrameAt>o._timeToNext&&f()};e()}function p(t){return Array.isArray(l)?v>=l.length?t.transitionOpts=l[v]:t.transitionOpts=l[0]:t.transitionOpts=l,v++,t}var h,g,v=0,y=[],m=void 0===e||null===e,x=Array.isArray(e);if(m||x||!w.isPlainObject(e)){if(m||-1!==["string","number"].indexOf(typeof e))for(h=0;h0&&kk)&&M.push(g);y=M}}y.length>0?function(e){if(0!==e.length){for(var l=0;l=0;a--)if(w.isPlainObject(e[a])){var d=(c[e[a].name]||{}).name,p=e[a].name;d&&p&&"number"==typeof p&&c[d]&&(n++,w.warn('addFrames: overwriting frame "'+c[d].name+'" with a frame whose name of type "number" also equates to "'+d+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),n>5&&w.warn("addFrames: This API call has yielded too many warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),f.push({frame:L.supplyFrameDefaults(e[a]),index:r&&void 0!==r[a]&&null!==r[a]?r[a]:u+a})}f.sort(function(t,e){return t.index>e.index?-1:t.index=0;a--){if(i=f[a].frame,"number"==typeof i.name&&w.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!i.name)for(;c[i.name="frame "+t._transitionData._counter++];);if(c[i.name]){for(o=0;o=0;r--)n=e[r],i.push({type:"delete",index:n}),o.unshift({type:"insert",index:n,value:a[n]});var l=L.modifyFrames,s=L.modifyFrames,c=[t,o],u=[t,i];return M&&M.add(t,l,c,s,u),L.modifyFrames(t,i)},_.purge=function(t){t=w.getGraphDiv(t);var e=t._fullLayout||{},r=t._fullData||[];return L.cleanPlot([],{},r,e),L.purge(t),k.purge(t),e._container&&e._container.remove(),delete t._context,t}},{"../components/color":37,"../components/drawing":61,"../components/errorbars":67,"../constants/xmlns_namespaces":138,"../lib":152,"../lib/events":145,"../lib/queue":165,"../lib/svg_text_utils":172,"../plotly":187,"../plots/cartesian/axis_ids":195,"../plots/cartesian/constants":197,"../plots/cartesian/constraints":199,"../plots/cartesian/graph_interact":201,"../plots/plots":221,"../plots/polar":224,"../registry":228,"./edit_types":176,"./helpers":177,"./manage_arrays":178,"./plot_schema":181,"./subroutines":184,d3:10,"fast-isnumeric":13,"has-hover":15}],180:[function(t,e,r){"use strict";e.exports={staticPlot:!1,editable:!1,edits:{annotationPosition:!1,annotationTail:!1,annotationText:!1,axisTitleText:!1,colorbarPosition:!1,colorbarTitleText:!1,legendPosition:!1,legendText:!1,shapePosition:!1,titleText:!1},autosizable:!1,queueLength:0,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showAxisDragHandles:!0,showAxisRangeEntryBoxes:!0,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:"transparent",topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:!1,globalTransforms:[]}},{}],181:[function(t,e,r){"use strict";function n(t,e){var r,n,a,i,o=t._basePlotModules;if(o){var l;for(r=0;r=t.items.length)return!1;t=t.items[a]}}return t}function i(t){return t===Math.round(t)&&t>=0}function o(t){var e,r;"area"===t?(e={attributes:w},r={}):(e=v.modules[t]._module,r=e.basePlotModule);var n={};n.type=null,T(n,m),T(n,e.attributes),r.attributes&&T(n,r.attributes),n.type=t;var a={meta:e.meta||{},attributes:u(n)};if(e.layoutAttributes){var i={};T(i,e.layoutAttributes),a.layoutAttributes=u(i)}return a}function l(){var t,e,r={};T(r,x);for(t in v.subplotsRegistry)if(e=v.subplotsRegistry[t],e.layoutAttributes)if("cartesian"===e.name)h(r,e,"xaxis"),h(r,e,"yaxis");else{var n="subplot"===e.attr?e.name:e.attr;h(r,e,n)}r=p(r);for(t in v.componentsRegistry){e=v.componentsRegistry[t];var a=e.schema;if(a&&(a.subplots||a.layout)){var i=a.subplots;if(i&&i.xaxis&&!i.yaxis)for(var o in i.xaxis)delete r.yaxis[o]}else e.layoutAttributes&&g(r,e.layoutAttributes,e.name)}return{layoutAttributes:u(r)}}function s(t){var e=v.transformsRegistry[t],r=T({},e.attributes);return Object.keys(v.componentsRegistry).forEach(function(e){var n=v.componentsRegistry[e];n.schema&&n.schema.transforms&&n.schema.transforms[t]&&Object.keys(n.schema.transforms[t]).forEach(function(e){g(r,n.schema.transforms[t][e],e)})}),{attributes:u(r)}}function c(){var t={frames:y.extendDeepAll({},b)};return u(t),t.frames}function u(t){return f(t),d(t),t}function f(t){function e(t){return{valType:"string",editType:"none"}}function n(t,n,a){r.isValObject(t)?"data_array"===t.valType?(t.role="data",a[n+"src"]=e(n)):!0===t.arrayOk&&(a[n+"src"]=e(n)):y.isPlainObject(t)&&(t.role="object")}r.crawl(t,n)}function d(t){function e(t,e,r){if(t){var n=t[C];n&&(delete t[C],r[e]={items:{}},r[e].items[n]=t,r[e].role="object")}}r.crawl(t,e)}function p(t){return A(t,{radialaxis:k.radialaxis,angularaxis:k.angularaxis}),A(t,k.layout),t}function h(t,e,r){var n=y.nestedProperty(t,r),a=T({},e.layoutAttributes);a[L]=!0,n.set(a)}function g(t,e,r){var n=y.nestedProperty(t,r);n.set(T(n.get()||{},e))}var v=t("../registry"),y=t("../lib"),m=t("../plots/attributes"),x=t("../plots/layout_attributes"),b=t("../plots/frame_attributes"),_=t("../plots/animation_attributes"),w=t("../plots/polar/area_attributes"),k=t("../plots/polar/axis_attributes"),M=t("./edit_types"),A=y.extendFlat,T=y.extendDeepAll,L="_isSubplotObj",C="_isLinkedToArray",S=[L,C,"_arrayAttrRegexps","_deprecated"];r.IS_SUBPLOT_OBJ=L,r.IS_LINKED_TO_ARRAY=C,r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=S,r.get=function(){var t={};v.allTypes.concat("area").forEach(function(e){t[e]=o(e)});var e={};return Object.keys(v.transformsRegistry).forEach(function(t){e[t]=s(t)}),{defs:{valObjects:y.valObjectMeta,metaKeys:S.concat(["description","role","editType","impliedEdits"]),editType:{traces:M.traces,layout:M.layout},impliedEdits:{}},traces:t,layout:l(),transforms:e,frames:c(),animation:u(_)}},r.crawl=function(t,e,n,a){var i=n||0;a=a||"",Object.keys(t).forEach(function(n){var o=t[n];if(-1===S.indexOf(n)){var l=(a?a+".":"")+n;e(o,n,t,i,l),r.isValObject(o)||y.isPlainObject(o)&&"impliedEdits"!==n&&r.crawl(o,e,i+1,l)}})},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){function e(e,r,o,l){if(i=i.slice(0,l).concat([r]),e&&("data_array"===e.valType||!0===e.arrayOk)&&!("colorbar"===i[l-1]&&("ticktext"===r||"tickvals"===r))){var s=n(i),c=y.nestedProperty(t,s).get();Array.isArray(c)&&a.push(s)}}function n(t){return t.join(".")}var a=[],i=[];if(r.crawl(m,e),t._module&&t._module.attributes&&r.crawl(t._module.attributes,e),t.transforms)for(var o=t.transforms,l=0;l=t.transforms.length)return!1;r=(v.transformsRegistry[t.transforms[s].type]||{}).attributes,n=r&&r[e[2]],l=3}else if("area"===t.type)n=w[o];else{var c=t._module;if(c||(c=(v.modules[t.type||m.type.dflt]||{})._module),!c)return!1;if(r=c.attributes,!(n=r&&r[o])){var u=c.basePlotModule;u&&u.attributes&&(n=u.attributes[o])}n||(n=m[o])}return a(n,e,l)},r.getLayoutValObject=function(t,e){return a(n(t,e[0]),e,1)}},{"../lib":152,"../plots/animation_attributes":188,"../plots/attributes":190,"../plots/frame_attributes":217,"../plots/layout_attributes":219,"../plots/polar/area_attributes":222,"../plots/polar/axis_attributes":223,"../registry":228,"./edit_types":176}],182:[function(t,e,r){"use strict";function n(t){o.register(t,t.name,t.categories,t.meta),o.subplotsRegistry[t.basePlotModule.name]||o.registerSubplot(t.basePlotModule)}function a(t){if("string"!=typeof t.name)throw new Error("Transform module *name* must be a string.");var e="Transform module "+t.name,r="function"==typeof t.transform,n="function"==typeof t.calcTransform;if(!r&&!n)throw new Error(e+" is missing a *transform* or *calcTransform* method.");r&&n&&l.log([e+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),l.isPlainObject(t.attributes)||l.log(e+" registered without an *attributes* object."),"function"!=typeof t.supplyDefaults&&l.log(e+" registered without a *supplyDefaults* method."),o.registerTransform(t)}function i(t){if("string"!=typeof t.name)throw new Error("Component module *name* must be a string.");o.registerComponent(t)}var o=t("../registry"),l=t("../lib");e.exports=function(t){if(!t)throw new Error("No argument passed to Plotly.register.");t&&!Array.isArray(t)&&(t=[t]);for(var e=0;e=t[1]||a[1]<=t[0])&&(i[0]e[0]))return!0}return!1}function a(t,e,r){return t._anchorAxis===e&&(t.mirror||t.side===r)||"all"===t.mirror||"allticks"===t.mirror||t.mirrors&&t.mirrors[e._id+r]}function i(t,e,r){var n=[],a=e._anchorAxis;if(a){var i=a._mainAxis;if(-1===n.indexOf(i)){n.push(i);for(var o=0;o1&&s.push(o("object","layout"))),d.supplyDefaults(c);for(var u=c._fullData,v=r.length,y=0;y.3*f||i(n)||i(a))){var d=r.dtick/2;t+=t+d.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?t=B.tickIncrement(t,"M6","reverse")+1.5*E:i.exactMonths>.8?t=B.tickIncrement(t,"M1","reverse")+15.5*E:t-=E/2;var l=B.tickIncrement(t,r);if(l<=n)return l}return t}function l(t){var e,r,n=t.tickvals,a=t.ticktext,i=new Array(n.length),o=A.simpleMap(t.range,t.r2l),l=1.0001*o[0]-1e-4*o[1],s=1.0001*o[1]-1e-4*o[0],c=Math.min(l,s),f=Math.max(l,s),d=0;Array.isArray(a)||(a=[]);var p="category"===t.type?t.d2l_noadd:t.d2l;for("log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1)),r=0;rc&&e10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=E&&a<=10||e>=15*E)t._tickround="d";else if(e>=N&&a<=16||e>=I)t._tickround="M";else if(e>=R&&a<=19||e>=N)t._tickround="S";else{var i=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,i)-20}}else if(k(e)||"L"===e.charAt(0)){var o=t.range.map(t.r2d||Number);k(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(o[0]),Math.abs(o[1])),s=Math.floor(Math.log(l)/Math.LN10+.01);Math.abs(s)>3&&(g(t.exponentformat)&&!v(s)?t._tickexponent=3*Math.round((s-1)/3):t._tickexponent=s)}else t._tickround=null}function u(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}function f(t,e,r,n){var a=t._tickround,i=r&&t.hoverformat||t.tickformat;n&&(a=k(a)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[a]);var o,l=A.formatDate(e.x,i,a,t.calendar),s=l.indexOf("\n");-1!==s&&(o=l.substr(s+1),l=l.substr(0,s)),n&&("00:00:00"===l||"00:00"===l?(l=o,o=""):8===l.length&&(l=l.replace(/:00$/,""))),o&&(r?"d"===a?l+=", "+o:l=o+(l?", "+l:""):t._inCalcTicks&&o===t._prevDateHead||(l+="
"+o,t._prevDateHead=o)),e.text=l}function d(t,e,r,n,a){var i=t.dtick,o=e.x;if("never"===a&&(a=""),!n||"string"==typeof i&&"L"===i.charAt(0)||(i="L3"),t.tickformat||"string"==typeof i&&"L"===i.charAt(0))e.text=y(Math.pow(10,o),t,a,n);else if(k(i)||"D"===i.charAt(0)&&A.mod(o+.01,1)<.1){var l=Math.round(o);-1!==["e","E","power"].indexOf(t.exponentformat)||g(t.exponentformat)&&v(l)?(e.text=0===l?1:1===l?"10":l>1?"10"+l+"":"10"+F+-l+"",e.fontSize*=1.25):(e.text=y(Math.pow(10,o),t,"","fakehover"),"D1"===i&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==i.charAt(0))throw"unrecognized dtick "+String(i);e.text=String(Math.round(Math.pow(10,A.mod(o,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*(o<0?.5:.25)))}}function p(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}function h(t,e,r,n,a){"never"===a?a="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide"),e.text=y(e.x,t,a,n)}function g(t){return"SI"===t||"B"===t}function v(t){return t>14||t<-15}function y(t,e,r,n){var a=t<0,i=e._tickround,o=r||e.exponentformat||"B",l=e._tickexponent,s=e.tickformat,u=e.separatethousands;if(n){var f={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:k(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};c(f),i=(Number(f._tickround)||0)+4,l=f._tickexponent,e.hoverformat&&(s=e.hoverformat)}if(s)return w.format(s)(t).replace(/-/g,F);var d=Math.pow(10,-i)/2;if("none"===o&&(l=0),(t=Math.abs(t))"+y+"":"B"===o&&9===l?t+="B":g(o)&&(t+=Q[l/3+5])}return a?F+t:t}function m(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},B.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=o,c=l,d=f/u);if(n===a){var g=n-1,v=n+1;r="tozero"===t.rangemode?n<0?[g,0]:[0,v]:"nonnegative"===t.rangemode?[Math.max(0,g),Math.max(0,v)]:[g,v]}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])))),p&&r.reverse(),A.simpleMap(r,t.l2r||Number)},B.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=B.getAutoRange(t),t._r=t.range.slice(),t._rl=A.simpleMap(t._r,t.r2l);var r=t._input;r.range=t.range.slice(),r.autorange=t.autorange}},B.saveRangeInitial=function(t,e){for(var r=B.list(t,"",!0),n=!1,a=0;a=d?p=!1:l.val>=c&&l.pad<=d&&(t._min.splice(o,1),o--);p&&t._min.push({val:c,pad:m&&0===c?0:d})}if(n(u)){for(p=!0,o=0;o=u&&l.pad>=f?p=!1:l.val<=u&&l.pad<=f&&(t._max.splice(o,1),o--);p&&t._max.push({val:u,pad:m&&0===u?0:f})}}}if((t.autorange||!!A.nestedProperty(t,"rangeslider.autorange").get())&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var i,o,l,s,c,u,f,d,p,h,g,v=e.length,y=r.padded?.05*t._length:0,m=r.tozero&&("linear"===t.type||"-"===t.type);y&&"domain"===t.constrain&&t._inputDomain&&(y*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0]));var x=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),b=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),_=n(r.vpadplus||r.vpad),w=n(r.vpadminus||r.vpad);for(i=0;i<6;i++)a(i);for(i=v-1;i>5;i--)a(i)}},B.autoBin=function(t,e,r,n,a){var l=A.aggNums(Math.min,null,t),s=A.aggNums(Math.max,null,t);if(a||(a=e.calendar),"category"===e.type)return{start:l-.5,end:s+.5,size:1,_count:s-l+1};var c;if(r)c=(s-l)/r;else{var u=A.distinctVals(t),f=Math.pow(10,Math.floor(Math.log(u.minDiff)/Math.LN10)),d=f*A.roundUp(u.minDiff/f,[.9,1.9,4.9,9.9],!0);c=Math.max(d,2*A.stdev(t)/Math.pow(t.length,n?.25:.4)),k(c)||(c=1)}var p;p="log"===e.type?{type:"linear",range:[l,s]}:{type:e.type,range:A.simpleMap([l,s],e.c2r,0,a),calendar:a},B.setConvert(p),B.autoTicks(p,c);var h,g,v=B.tickIncrement(B.tickFirst(p),p.dtick,"reverse",a);if("number"==typeof p.dtick)v=i(v,t,p,l,s),g=1+Math.floor((s-v)/p.dtick),h=v+g*p.dtick;else for("M"===p.dtick.charAt(0)&&(v=o(v,t,p.dtick,l,a)),h=v,g=0;h<=s;)h=B.tickIncrement(h,p.dtick,!1,a),g++;return{start:e.c2r(v,0,a),end:e.c2r(h,0,a),size:p.dtick,_count:g}},B.calcTicks=function(t){var e=A.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var r,n=t.nticks;n||("category"===t.type?(r=t.tickfont?1.2*(t.tickfont.size||12):15,n=t._length/r):(r="y"===t._id.charAt(0)?40:80,n=A.constrain(t._length/r,4,9)+1)),"array"===t.tickmode&&(n*=100),B.autoTicks(t,Math.abs(e[1]-e[0])/n),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}if(t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),c(t),"array"===t.tickmode)return l(t);t._tmin=B.tickFirst(t);var a=e[1]=o:f<=o)&&!(i.length>u||f===s);f=B.tickIncrement(f,t.dtick,a,t.calendar))s=f,i.push(f);t._tmax=i[i.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var d=new Array(i.length),p=0;pD?(e/=D,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*s(e,r,U)):n>P?(e/=P,t.dtick="M"+s(e,1,G)):n>E?(t.dtick=s(e,E,Y),t.tick0=A.dateTick0(t.calendar,!0)):n>I?t.dtick=s(e,I,G):n>N?t.dtick=s(e,N,X):n>R?t.dtick=s(e,R,X):(r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=s(e,r,U))}else if("log"===t.type){t.tick0=0;var a=A.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(a[1]-a[0])<1){var i=1.5*Math.abs((a[1]-a[0])/e);e=Math.abs(Math.pow(10,a[1])-Math.pow(10,a[0]))/i,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+s(e,r,U)}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=s(e,r,U));if(0===t.dtick&&(t.dtick=1),!k(t.dtick)&&"string"!=typeof t.dtick){var o=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(o)}},B.tickIncrement=function(t,e,r,n){var a=r?-1:1;if(k(e))return t+a*e;var i=e.charAt(0),o=a*Number(e.substr(1));if("M"===i)return A.incrementMonth(t,o,n);if("L"===i)return Math.log(Math.pow(10,t)+o)/Math.LN10;if("D"===i){var l="D2"===e?W:Z,s=t+.01*a,c=A.roundUp(A.mod(s,1),l,r);return Math.floor(s)+Math.log(w.round(Math.pow(10,c),1))/Math.LN10}throw"unrecognized dtick "+String(e)},B.tickFirst=function(t){var e=t.r2l||Number,r=A.simpleMap(t.range,e),n=r[1]1&&e2*a}function i(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,a=0,i=0;i2*n}var o=t("fast-isnumeric"),l=t("../../lib"),s=t("../../constants/numerical").BADNUM;e.exports=function(t,e){return a(t,e)?"date":i(t)?"category":n(t)?"linear":"-"}},{"../../constants/numerical":136,"../../lib":152,"fast-isnumeric":13}],194:[function(t,e,r){"use strict";var n=t("tinycolor2").mix,a=t("../../registry"),i=t("../../lib"),o=t("../../components/color/attributes").lightFraction,l=t("./layout_attributes"),s=t("./tick_value_defaults"),c=t("./tick_mark_defaults"),u=t("./tick_label_defaults"),f=t("./category_order_defaults"),d=t("./set_convert"),p=t("./ordered_categories");e.exports=function(t,e,r,h,g){function v(r,n){return i.coerce2(t,e,l,r,n)}var y=h.letter,m=h.font||{},x="Click to enter "+(h.title||y.toUpperCase()+" axis")+" title",b=r("visible",!h.cheateronly),_=e.type;if("date"===_){a.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",h.calendar)}if(d(e,g),r("autorange",!e.isValidRange(t.range))&&r("rangemode"),r("range"),e.cleanRange(),f(t,e,r),e._initialCategories="category"===_?p(y,e.categoryorder,e.categoryarray,h.data):[],!b)return e;var w=r("color"),k=w===t.color?w:m.color;r("title",x),i.coerceFont(r,"titlefont",{family:m.family,size:Math.round(1.2*m.size),color:k}),s(t,e,r,_),u(t,e,r,_,h),c(t,e,r,h);var M=v("linecolor",w),A=v("linewidth"),T=r("showline",!!M||!!A);T||(delete e.linecolor,delete e.linewidth),(T||e.ticks)&&r("mirror");var L=v("gridcolor",n(w,h.bgColor,o).toRgbString()),C=v("gridwidth");r("showgrid",h.showGrid||!!L||!!C)||(delete e.gridcolor,delete e.gridwidth);var S=v("zerolinecolor",w),z=v("zerolinewidth");return r("zeroline",h.showGrid||!!S||!!z)||(delete e.zerolinecolor,delete e.zerolinewidth),e}},{"../../components/color/attributes":36,"../../lib":152,"../../registry":228,"./category_order_defaults":196,"./layout_attributes":203,"./ordered_categories":205,"./set_convert":209,"./tick_label_defaults":210,"./tick_mark_defaults":211,"./tick_value_defaults":212,tinycolor2:19}],195:[function(t,e,r){"use strict";function n(t,e,r){function n(t,r){for(var n=Object.keys(t),a=/^[xyz]axis[0-9]*/,i=[],o=0;o0;i&&(n="array");var o=r("categoryorder",n);"array"===o&&r("categoryarray"),i||"array"!==o||(e.categoryorder="trace")}}},{}],197:[function(t,e,r){"use strict";var n=t("../../lib").counterRegex;e.exports={idRegex:{x:n("x"),y:n("y")},attrRegex:n("[xy]axis"),xAxisMatch:n("xaxis"),yAxisMatch:n("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,SELECTDELAY:100,SELECTID:"-select",DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","maplayer","barlayer","carpetlayer","boxlayer","scatterlayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},{"../../lib":152}],198:[function(t,e,r){"use strict";function n(t,e,r,n){var a,i,l,s,c=n[o(e)].type,u=[];for(i=0;io*y)||_)for(r=0;rO&&PS&&(S=P);var N=(S-C)/(2*z);f/=N,C=s.l2r(C),S=s.l2r(S),s.range=s._input.range=A=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function c(t,e){return t?"nsew"===t?"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}function u(t,e,r,n,a){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",a+"Z")}function f(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:T.background,stroke:T.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function d(t){t.selectAll(".select-outline").remove()}function p(t,e,r,n,a,i){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),a||(t.transition().style("fill",i>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function h(t){b.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function g(t){return-1!==["lasso","select"].indexOf(t)}function v(t,e){return"M"+(t.l-.5)+","+(e-F-.5)+"h-3v"+(2*F+1)+"h3ZM"+(t.r+.5)+","+(e-F-.5)+"h3v"+(2*F+1)+"h-3Z"}function y(t,e){return"M"+(e-F-.5)+","+(t.t-.5)+"v-3h"+(2*F+1)+"v3ZM"+(e-F-.5)+","+(t.b+.5)+"v3h"+(2*F+1)+"v-3Z"}function m(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,F)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function x(t,e,r){var n,a,i,o,l,s,c=!1,u={},f={};for(n=0;nF||l>F?(Mt="xy",o/it>l/ot?(l=o*ot/it,xt>i?bt.t=xt-l:bt.b=xt+l):(o=l*it/ot,mt>a?bt.l=mt-o:bt.r=mt+o),Tt.attr("d",m(bt))):n():!st||lzoom back out","long"),j=!1)}function Y(e,r){var n=1===(q+H).length;if(e)J();else if(2!==r||n){if(1===r&&n){var a=q?rt[0]:et[0],o="s"===q||"w"===H?0:1,l=a._name+".range["+o+"]",s=i(a,o),c="left",u="middle";if(a.fixedrange)return;q?(u="n"===q?"top":"bottom","right"===a.side&&(c="right")):"e"===H&&(c="right"),t._context.showAxisRangeEntryBoxes&&b.select(vt).call(A.makeEditable,{gd:t,immediate:!0,background:pt.paper_bgcolor,text:String(s),fill:a.tickfont?a.tickfont.color:"#444",horizontalAlign:c,verticalAlign:u}).on("edit",function(e){var r=a.d2r(e);void 0!==r&&w.relayout(t,l,r)})}}else $()}function Z(e){function r(t,e,r){function n(e){return t.l2r(i+(e-i)*r)}if(!t.fixedrange){var a=M.simpleMap(t.range,t.r2l),i=a[0]+(a[1]-a[0])*e;t.range=a.map(n)}}if(t._context.scrollZoom||pt._enablescrollzoom){if(t._transitioningWithDuration)return M.pauseEvent(e);var n=t.querySelector(".plotly");if(V(),!(n.scrollHeight-n.clientHeight>10||n.scrollWidth-n.clientWidth>10)){clearTimeout(St);var a=-e.deltaY;if(isFinite(a)||(a=e.wheelDelta/10),!isFinite(a))return void M.log("Did not find wheel motion attributes: ",e);var i,o=Math.exp(-Math.min(Math.max(a,-20),20)/200),l=Ot.draglayer.select(".nsewdrag").node().getBoundingClientRect(),s=(e.clientX-l.left)/l.width,c=(l.bottom-e.clientY)/l.height;if(H||ut){for(H||(s=.5),i=0;i rect").call(L.setTranslate,l,s).call(L.setScale,i,o);var w=g.plot.selectAll(".scatterlayer .points, .boxlayer .points");g.plot.call(L.setTranslate,b,_).call(L.setScale,1/i,1/o),w.selectAll(".point").call(L.setPointGroupScale,i,o).call(L.hideOutsideRangePoints,g),w.selectAll(".textpoint").call(L.setTextPointsScale,i,o).call(L.hideOutsideRangePoints,g)}}}var tt,et,rt,nt,at,it,ot,lt,st,ct,ut,ft,dt,pt=t._fullLayout,ht=t._fullLayout._zoomlayer,gt=q+H==="nsew";V();var vt=n(e,q+H+"drag",ct,r,T,C,B);if(!st&&!lt&&!g(pt.dragmode))return vt.onmousedown=null,vt.style.pointerEvents=gt?"all":"none",vt;var yt={element:vt,gd:t,plotinfo:e,prepFn:function(e,r,n){var a=t._fullLayout.dragmode;gt?e.shiftKey&&(a="pan"===a?"zoom":"pan"):a="pan",yt.minDrag="lasso"===a?1:void 0,"zoom"===a?(yt.moveFn=G,yt.doneFn=X,yt.minDrag=1,U(e,r,n)):"pan"===a?(yt.moveFn=W,yt.doneFn=Y,d(ht)):g(a)&&(yt.xaxes=et,yt.yaxes=rt,E(e,r,n,yt,a))}};S.init(yt);var mt,xt,bt,_t,wt,kt,Mt,At,Tt,Lt={},Ct=[0,0,it,ot],St=null,zt=N.REDRAWDELAY,Ot=e.mainplot?pt._plots[e.mainplot]:e;return q.length*H.length!=1&&(void 0!==vt.onwheel?vt.onwheel=Z:void 0!==vt.onmousewheel&&(vt.onmousewheel=Z)),vt}},{"../../components/color":37,"../../components/dragelement":58,"../../components/drawing":61,"../../constants/alignment":134,"../../lib":152,"../../lib/setcursor":170,"../../lib/svg_text_utils":172,"../../plotly":187,"../../registry":228,"../plots":221,"./axes":192,"./axis_ids":195,"./constants":197,"./scale_zoom":207,"./select":208,d3:10,tinycolor2:19}],201:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../components/fx"),i=t("../../components/dragelement"),o=t("./constants"),l=t("./dragbox");e.exports=function(t){var e=t._fullLayout;if((e._has("cartesian")||e._has("gl2d"))&&!t._context.staticPlot){Object.keys(e._plots||{}).sort(function(t,r){if((e._plots[t].mainplot&&!0)===(e._plots[r].mainplot&&!0)){var n=t.split("y"),a=r.split("y");return n[0]===a[0]?Number(n[1]||1)-Number(a[1]||1):Number(n[0]||1)-Number(a[0]||1)}return e._plots[t].mainplot?1:-1}).forEach(function(r){var s=e._plots[r],c=s.xaxis,u=s.yaxis,f=(c._linepositions[r]||[])[3],d=(u._linepositions[r]||[])[3],p=o.DRAGGERSIZE;if(n(f)&&"top"===c.side&&(f-=p),n(d)&&"right"!==u.side&&(d-=p),!s.mainplot){var h=l(t,s,0,0,c._length,u._length,"ns","ew");h.onmousemove=function(e){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===r&&a.hover(t,e,r)},a.hover(t,e,r),t._fullLayout._lasthover=h,t._fullLayout._hoversubplot=r},h.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,i.unhover(t,e))},h.onclick=function(e){a.click(t,e,r)},t._context.showAxisDragHandles&&(l(t,s,-p,-p,p,p,"n","w"),l(t,s,c._length,-p,p,p,"n","e"),l(t,s,-p,u._length,p,p,"s","w"),l(t,s,c._length,u._length,p,p,"s","e"))}t._context.showAxisDragHandles&&(n(f)&&("free"===c.anchor&&(f-=e._size.h*(1-u.domain[1])),l(t,s,.1*c._length,f,.8*c._length,p,"","ew"),l(t,s,0,f,.1*c._length,p,"","w"),l(t,s,.9*c._length,f,.1*c._length,p,"","e")),n(d)&&("free"===u.anchor&&(d-=e._size.w*c.domain[0]),l(t,s,d,.1*u._length,p,.8*u._length,"ns",""),l(t,s,d,.9*u._length,p,.1*u._length,"s",""),l(t,s,d,0,p,.1*u._length,"n","")))});var r=e._hoverlayer.node();r.onmousemove=function(r){r.target=e._lasthover,a.hover(t,r,e._hoversubplot)},r.onclick=function(r){r.target=e._lasthover,a.click(t,r)},r.onmousedown=function(t){e._lasthover.onmousedown(t)}}}},{"../../components/dragelement":58,"../../components/fx":78,"./constants":197,"./dragbox":200,"fast-isnumeric":13}],202:[function(t,e,r){"use strict";function n(t,e,r,n,a){var i=t._fullLayout,o=i._modules;e.plot&&e.plot.selectAll("g:not(.scatterlayer)").selectAll("g.trace").remove();for(var l=0;lu[1]-.01&&(e.domain=[0,1]),a.noneOrAll(t.domain,e.domain,[0,1])}return r("layer"),e}},{"../../lib":152,"fast-isnumeric":13}],207:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var a=[t.r2l(t.range[0]),t.r2l(t.range[1])],i=a[0]+(a[1]-a[0])*r;t.range=t._input.range=[t.l2r(i+(a[0]-i)*e),t.l2r(i+(a[1]-i)*e)]}},{"../../constants/alignment":134}],208:[function(t,e,r){"use strict";function n(t){return t._id}function a(t,e){if(Array.isArray(t))for(var r=e.cd[0].trace,n=0;n0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],a=t.range[1];return.5*(n+a-3*k*Math.abs(n-a))}return p}function f(e,r,n){var a=c(e,n||t.calendar);if(a===p){if(!i(e))return p;a=c(new Date(+e))}return a}function v(e,r,n){return s(e,r,n||t.calendar)}function y(e){return t._categories[Math.round(e)]}function m(e){if(null!==e&&void 0!==e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return p}function x(e){if(t._categoriesMap){var r=t._categoriesMap[e];if(void 0!==r)return r}if(i(e))return+e}function b(e){return i(e)?a.round(t._b+t._m*e,2):p}function _(e){return(e-t._b)/t._m}e=e||{};var w=(t._id||"x").charAt(0),k=10;t.c2l="log"===t.type?r:u,t.l2c="log"===t.type?n:u,t.l2p=b,t.p2l=_,t.c2p="log"===t.type?function(t,e){return b(r(t,e))}:b,t.p2c="log"===t.type?function(t){return n(_(t))}:_,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=l,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=_,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return r(l(t),e)},t.r2d=t.r2c=function(t){return n(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=u,t.c2r=r,t.l2d=n,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return n(_(t))},t.r2p=function(e){return t.l2p(l(e))},t.p2r=_,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=o.identity,t.d2c=t.r2c=t.d2l=t.r2l=f,t.c2d=t.c2r=t.l2d=t.l2r=v,t.d2p=t.r2p=function(e,r,n){return t.l2p(f(e,0,n))},t.p2d=t.p2r=function(t,e,r){return v(_(t),e,r)},t.cleanPos=function(e){return o.cleanDate(e,p,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=m,t.r2d=t.c2d=t.l2d=y,t.d2r=t.d2l_noadd=x,t.r2c=function(e){var r=x(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=x,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return y(_(t))},t.r2p=t.d2p,t.p2r=_,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e){e||(e="range");var r,n,a=o.nestedProperty(t,e).get();if(n="date"===t.type?o.dfltRange(t.calendar):"y"===w?h.DFLTRANGEY:h.DFLTRANGEX,n=n.slice(),!a||2!==a.length)return void o.nestedProperty(t,e).set(n);for("date"===t.type&&(a[0]=o.cleanDate(a[0],p,t.calendar),a[1]=o.cleanDate(a[1],p,t.calendar)),r=0;r<2;r++)if("date"===t.type){if(!o.isDateTime(a[r],t.calendar)){t[e]=n;break}if(t.r2l(a[0])===t.r2l(a[1])){var l=o.constrain(t.r2l(a[0]),o.MIN_MS+1e3,o.MAX_MS-1e3);a[0]=t.l2r(l-1e3),a[1]=t.l2r(l+1e3);break}}else{if(!i(a[r])){if(!i(a[1-r])){t[e]=n;break}a[r]=a[1-r]*(r?10:.1)}if(a[r]<-d?a[r]=-d:a[r]>d&&(a[r]=d),a[0]===a[1]){var s=Math.max(1,Math.abs(1e-6*a[0]));a[0]-=s,a[1]+=s}}},t.setScale=function(r){var n=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var a=g.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var i=r&&t._r?"_r":"range",l=t.calendar;t.cleanRange(i);var s=t.r2l(t[i][0],l),c=t.r2l(t[i][1],l);if("y"===w?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(s-c),t._b=-t._m*c):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-s),t._b=-t._m*s),!isFinite(t._m)||!isFinite(t._b))throw o.notifier("Something went wrong with axis scaling","long"),e._replotting=!1,new Error("axis scaling")},t.makeCalcdata=function(e,r){var n,a,i,o="date"===t.type&&e[r+"calendar"];if(r in e)for(n=e[r],a=new Array(n.length),i=0;i=t.range[0]&&r<=t.range[1]}:function(e){var r=e.y;return r>=t.range[0]&&r<=t.range[1]},t._min=[],t._max=[],t._separators=e.separators,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":136,"../../lib":152,"./axis_ids":195,"./constants":197,d3:10,"fast-isnumeric":13}],210:[function(t,e,r){"use strict";function n(t){var e=["showexponent","showtickprefix","showticksuffix"],r=e.filter(function(e){return void 0!==t[e]}),n=function(e){return t[e]===t[r[0]]};if(r.every(n)||1===r.length)return t[r[0]]}var a=t("../../lib");e.exports=function(t,e,r,i,o){var l=n(t);if(r("tickprefix")&&r("showtickprefix",l),r("ticksuffix")&&r("showticksuffix",l),r("showticklabels")){var s=o.font||{},c=e.color===t.color?e.color:s.color;a.coerceFont(r,"tickfont",{family:s.family,size:s.size,color:c}),r("tickangle"),"category"!==i&&(r("tickformat")||"date"===i||(r("showexponent",l),r("exponentformat"),r("separatethousands")))}"category"===i||o.noHover||r("hoverformat")}},{"../../lib":152}],211:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r,i){var o=n.coerce2(t,e,a,"ticklen"),l=n.coerce2(t,e,a,"tickwidth"),s=n.coerce2(t,e,a,"tickcolor",e.color);r("ticks",i.outerTicks||o||l||s?"outside":"")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":152,"./layout_attributes":203}],212:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").ONEDAY;e.exports=function(t,e,r,o){var l="auto";"array"!==t.tickmode||"log"!==o&&"date"!==o||(t.tickmode="auto"),Array.isArray(t.tickvals)?l="array":t.dtick&&(l="linear");var s=r("tickmode",l);if("auto"===s)r("nticks");else if("linear"===s){var c="date"===o?i:1,u=r("dtick",c);if(n(u))e.dtick=u>0?Number(u):c;else if("string"!=typeof u)e.dtick=c;else{var f=u.charAt(0),d=u.substr(1);d=n(d)?Number(d):0,(d<=0||!("date"===o&&"M"===f&&d===Math.round(d)||"log"===o&&"L"===f||"log"===o&&"D"===f&&(1===d||2===d)))&&(e.dtick=c)}var p="date"===o?a.dateTick0(e.calendar):0,h=r("tick0",p);"date"===o?e.tick0=a.cleanDate(h,p):n(h)&&"D1"!==u&&"D2"!==u?e.tick0=Number(h):e.tick0=p}else{var g=r("tickvals");void 0===g?e.tickmode="auto":r("ticktext")}}},{"../../constants/numerical":136,"../../lib":152,"fast-isnumeric":13}],213:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plotly"),i=t("../../registry"),o=t("../../components/drawing"),l=t("./axes"),s=t("./constants").attrRegex;e.exports=function(t,e,r,c){function u(e,r){function n(e,r,n){for(a=0;a rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.select(".scatterlayer").selectAll(".points");n.selectAll(".point").call(o.setPointGroupScale,1,1).call(o.hideOutsideRangePoints,t),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1).call(o.hideOutsideRangePoints,t)}function d(e,r){var n,a,i,l=m[e.xaxis._id],s=m[e.yaxis._id],c=[];if(l){n=t._fullLayout[l.axisName],a=n._r,i=l.to,c[0]=(a[0]*(1-r)+r*i[0]-a[0])/(a[1]-a[0])*e.xaxis._length;var f=a[1]-a[0],d=i[1]-i[0];n.range[0]=a[0]*(1-r)+r*i[0],n.range[1]=a[1]*(1-r)+r*i[1],c[2]=e.xaxis._length*(1-r+r*d/f)}else c[0]=0,c[2]=e.xaxis._length;if(s){n=t._fullLayout[s.axisName],a=n._r,i=s.to,c[1]=(a[1]*(1-r)+r*i[1]-a[1])/(a[0]-a[1])*e.yaxis._length;var p=a[1]-a[0],h=i[1]-i[0];n.range[0]=a[0]*(1-r)+r*i[0],n.range[1]=a[1]*(1-r)+r*i[1],c[3]=e.yaxis._length*(1-r+r*h/p)}else c[1]=0,c[3]=e.yaxis._length;u(e.xaxis,e.yaxis);var g=e.xaxis,y=e.yaxis,x=!!l,b=!!s,_=x?g._length/c[2]:1,w=b?y._length/c[3]:1,k=x?c[0]:0,M=b?c[1]:0,A=x?c[0]/c[2]*g._length:0,T=b?c[1]/c[3]*y._length:0,L=g._offset-A,C=y._offset-T;v._defs.select("#"+e.clipId+"> rect").call(o.setTranslate,k,M).call(o.setScale,1/_,1/w),e.plot.call(o.setTranslate,L,C).call(o.setScale,_,w).selectAll(".points").selectAll(".point").call(o.setPointGroupScale,1/_,1/w),e.plot.selectAll(".points").selectAll(".textpoint").call(o.setTextPointsScale,1/_,1/w)}function p(){for(var e={},r=0;rr.duration?(p(),M=window.cancelAnimationFrame(g)):M=window.requestAnimationFrame(g)}var v=t._fullLayout,y=[],m=function(t){var e,r,n,a,i={};for(e in t)if(r=e.split("."),r[0].match(s)){var o=e.charAt(0),l=r[0];if(n=v[l],a={},Array.isArray(t[e])?a.to=t[e].slice(0):Array.isArray(t[e].range)&&(a.to=t[e].range.slice(0)),!a.to)continue;a.axisName=l,a.length=n._length,y.push(o),i[o]=a}return i}(e),x=Object.keys(m),b=function(t,e,r){var n,a,i,o=t._plots,l=[];for(n in o){var s=o[n];if(-1===l.indexOf(s)){var c=s.xaxis._id,u=s.yaxis._id,f=s.xaxis.range,d=s.yaxis.range;s.xaxis._r=s.xaxis.range.slice(),s.yaxis._r=s.yaxis.range.slice(),a=r[c]?r[c].to:f,i=r[u]?r[u].to:d,f[0]===a[0]&&f[1]===a[1]&&d[0]===i[0]&&d[1]===i[1]||-1===e.indexOf(c)&&-1===e.indexOf(u)||l.push(s)}}return l}(v,x,m);if(!b.length)return function(){function e(e,r,n){for(var a=0;a0?".":"")+a;c.isPlainObject(i)?l(i,e,o,n+1):e(o,a,i)}})}var s=t("../plotly"),c=t("../lib");r.manageCommandObserver=function(t,e,a,i){var o={},l=!0;e&&e._commandObserver&&(o=e._commandObserver),o.cache||(o.cache={}),o.lookupTable={};var s=r.hasSimpleAPICommandBindings(t,a,o.lookupTable);if(e&&e._commandObserver){if(s)return o;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,o}if(s){n(t,s,o.cache),o.check=function(){if(l){var e=n(t,s,o.cache);return e.changed&&i&&void 0!==o.lookupTable[e.value]&&(o.disable(),Promise.resolve(i({value:e.value,type:s.type,prop:s.prop,traces:s.traces,index:o.lookupTable[e.value]})).then(o.enable,o.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f=e.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=e._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),c=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&n(t,o),l.text(o.text()&&c.text()?" - ":"")}},v.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=s.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return n.append("input").attr({type:"text",name:"data"}).node().value=v.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},v.supplyDefaults=function(t){var e,r=t._fullLayout||{},n=t._fullLayout={},i=t.layout||{},o=t._fullData||[],l=t._fullData=[],s=t.data||[];if(t._transitionData||v.createTransitionData(t),r._initialAutoSizeIsDone){var c=r.width,f=r.height;v.supplyLayoutGlobalDefaults(i,n),i.width||(n.width=c),i.height||(n.height=f)}else{v.supplyLayoutGlobalDefaults(i,n);var d=!i.width||!i.height,p=n.autosize,h=t._context&&t._context.autosizable;d&&(p||h)?v.plotAutoSize(t,i,n):d&&v.sanitizeMargins(t),!p&&d&&(i.width=n.width,i.height=n.height)}n._initialAutoSizeIsDone=!0,n._dataLength=s.length,n._globalTransforms=(t._context||{}).globalTransforms,v.supplyDataDefaults(s,l,i,n),n._has=v._hasPlotType.bind(n);var g=n._modules;for(e=0;e0){var u=o(t._boundingBoxMargins),f=u.left+u.right,d=u.bottom+u.top,h=1-2*l,g=r._container&&r._container.node?r._container.node().getBoundingClientRect():{width:r.width,height:r.height};n=Math.round(h*(g.width-f)),a=Math.round(h*(g.height-d))}else{var y=s?window.getComputedStyle(t):{};n=parseFloat(y.width)||r.width,a=parseFloat(y.height)||r.height}var m=v.layoutAttributes.width.min,x=v.layoutAttributes.height.min;n1,_=!e.height&&Math.abs(r.height-a)>1;(_||b)&&(b&&(r.width=n),_&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),v.sanitizeMargins(r)},v.supplyLayoutModuleDefaults=function(t,e,r,n){var a,i;u.Axes.supplyLayoutDefaults(t,e,r);var o=e._basePlotModules;for(a=0;a.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+a},r:{val:r.x,size:r.r+a},b:{val:r.y,size:r.b+a},t:{val:r.y,size:r.t+a}}}else delete n._pushmargin[e];n._replotting||v.doAutoMargin(t)}},v.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),a=Math.max(e.margin.l||0,0),i=Math.max(e.margin.r||0,0),o=Math.max(e.margin.t||0,0),l=Math.max(e.margin.b||0,0),s=e._pushmargin;if(!1!==e.margin.autoexpand){s.base={l:{val:0,size:a},r:{val:1,size:i},t:{val:1,size:o},b:{val:0,size:l}};for(var f=Object.keys(s),d=0;dv){var M=(y*w+(k-e.width)*v)/(w-v),A=(k*(1-v)+(y-e.width)*(1-w))/(w-v);M>=0&&A>=0&&M+A>a+i&&(a=M,i=A)}}if(c(x)&&s[_].t){var T=s[_].t.val,L=s[_].t.size;if(T>m){var C=(x*T+(L-e.height)*m)/(T-m),S=(L*(1-m)+(x-e.height)*(1-T))/(T-m);C>=0&&S>=0&&C+S>l+o&&(l=C,o=S)}}}}if(r.l=Math.round(a),r.r=Math.round(i),r.t=Math.round(o),r.b=Math.round(l),r.p=Math.round(e.margin.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,!e._replotting&&"{}"!==n&&n!==JSON.stringify(e._size))return u.plot(t)},v.graphJson=function(t,e,r,n,a){function i(t){if("function"==typeof t)return null;if(p.isPlainObject(t)){var e,n,a={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0&&!p.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;a[e]=i(t[e])}return a}return Array.isArray(t)?t.map(i):p.isJSDate(t)?p.ms2DateTimeLocal(+t):t}(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&v.supplyDefaults(t);var o=a?t._fullData:t.data,l=a?t._fullLayout:t.layout,s=(t._transitionData||{})._frames,c={data:(o||[]).map(function(t){var r=i(t);return e&&delete r.fit,r})};return e||(c.layout=i(l)),t.framework&&t.framework.isPolar&&(c=t.framework.getConfig()),s&&(c.frames=i(s)),"object"===n?c:JSON.stringify(c)},v.modifyFrames=function(t,e){var r,n,a,i=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){b=!0}),a.redraw&&t._transitionData._interruptCallbacks.push(function(){return u.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var o,l,s=0,c=0,d=t._fullLayout._basePlotModules,h=!1;if(r)for(l=0;l=0,S=C?d.angularAxis.domain:n.extent(M),z=Math.abs(M[1]-M[0]);T&&!A&&(z=0);var O=S.slice();L&&A&&(O[1]+=z);var D=d.angularAxis.ticksCount||4;D>8&&(D=D/(D/8)+D%8),d.angularAxis.ticksStep&&(D=(O[1]-O[0])/D);var P=d.angularAxis.ticksStep||(O[1]-O[0])/(D*(d.minorTicks+1));k&&(P=Math.max(Math.round(P),1)),O[2]||(O[2]=P);var E=n.range.apply(this,O);if(E=E.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=n.scale.linear().domain(O.slice(0,2)).range("clockwise"===d.direction?[0,360]:[360,0]),f.layout.angularAxis.domain=s.domain(),f.layout.angularAxis.endPadding=L?z:0,void 0===(e=n.select(this).select("svg.chart-root"))||e.empty()){var I=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),N=this.appendChild(this.ownerDocument.importNode(I.documentElement,!0));e=n.select(N)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var R,F=e.select(".chart-group"),j={fill:"none",stroke:d.tickColor},B={"font-size":d.font.size,"font-family":d.font.family,fill:d.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+d.font.outlineColor}).join(",")};if(d.showLegend){R=e.select(".legend-group").attr({transform:"translate("+[b,d.margin.top]+")"}).style({display:"block"});var q=h.map(function(t,e){var r=l.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});l.Legend().config({data:h.map(function(t,e){return t.name||"Element"+e}),legendConfig:i({},l.Legend.defaultConfig().legendConfig,{container:R,elements:q,reverseOrder:d.legend.reverseOrder})})();var H=R.node().getBBox();b=Math.min(d.width-H.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2,b=Math.max(10,b),w=[d.margin.left+b,d.margin.top+b],a.range([0,b]),f.layout.radialAxis.domain=a.domain(),R.attr("transform","translate("+[w[0]+b,w[1]-b]+")")}else R=e.select(".legend-group").style({display:"none"});e.attr({width:d.width,height:d.height}).style({opacity:d.opacity}),F.attr("transform","translate("+w+")").style({cursor:"crosshair"});var V=[(d.width-(d.margin.left+d.margin.right+2*b+(H?H.width:0)))/2,(d.height-(d.margin.top+d.margin.bottom+2*b))/2];if(V[0]=Math.max(0,V[0]),V[1]=Math.max(0,V[1]),e.select(".outer-group").attr("transform","translate("+V+")"),d.title){var U=e.select("g.title-group text").style(B).text(d.title),G=U.node().getBBox();U.attr({x:w[0]-G.width/2,y:w[1]-b-20})}var X=e.select(".radial.axis-group");if(d.radialAxis.gridLinesVisible){var Y=X.selectAll("circle.grid-circle").data(a.ticks(5)) +;n.remove(),e._draggers.selectAll("g."+t).remove(),e._defs.select("#"+a).remove(),r[t]=!0});for(var n=e._plots,a=Object.keys(n),i=0;iu[1]-.01&&(e.domain=[0,1]),a.noneOrAll(t.domain,e.domain,[0,1])}return r("layer"),e}},{"../../lib":152,"fast-isnumeric":13}],207:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var a=[t.r2l(t.range[0]),t.r2l(t.range[1])],i=a[0]+(a[1]-a[0])*r;t.range=t._input.range=[t.l2r(i+(a[0]-i)*e),t.l2r(i+(a[1]-i)*e)]}},{"../../constants/alignment":134}],208:[function(t,e,r){"use strict";function n(t){return t._id}function a(t,e){if(Array.isArray(t))for(var r=e.cd[0].trace,n=0;n0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],a=t.range[1];return.5*(n+a-3*k*Math.abs(n-a))}return p}function f(e,r,n){var a=c(e,n||t.calendar);if(a===p){if(!i(e))return p;a=c(new Date(+e))}return a}function v(e,r,n){return s(e,r,n||t.calendar)}function y(e){return t._categories[Math.round(e)]}function m(e){if(null!==e&&void 0!==e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return p}function x(e){if(t._categoriesMap){var r=t._categoriesMap[e];if(void 0!==r)return r}if(i(e))return+e}function b(e){return i(e)?a.round(t._b+t._m*e,2):p}function _(e){return(e-t._b)/t._m}e=e||{};var w=(t._id||"x").charAt(0),k=10;t.c2l="log"===t.type?r:u,t.l2c="log"===t.type?n:u,t.l2p=b,t.p2l=_,t.c2p="log"===t.type?function(t,e){return b(r(t,e))}:b,t.p2c="log"===t.type?function(t){return n(_(t))}:_,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=l,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=_,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return r(l(t),e)},t.r2d=t.r2c=function(t){return n(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=u,t.c2r=r,t.l2d=n,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return n(_(t))},t.r2p=function(e){return t.l2p(l(e))},t.p2r=_,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=o.identity,t.d2c=t.r2c=t.d2l=t.r2l=f,t.c2d=t.c2r=t.l2d=t.l2r=v,t.d2p=t.r2p=function(e,r,n){return t.l2p(f(e,0,n))},t.p2d=t.p2r=function(t,e,r){return v(_(t),e,r)},t.cleanPos=function(e){return o.cleanDate(e,p,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=m,t.r2d=t.c2d=t.l2d=y,t.d2r=t.d2l_noadd=x,t.r2c=function(e){var r=x(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=x,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return y(_(t))},t.r2p=t.d2p,t.p2r=_,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e){e||(e="range");var r,n,a=o.nestedProperty(t,e).get();if(n="date"===t.type?o.dfltRange(t.calendar):"y"===w?h.DFLTRANGEY:h.DFLTRANGEX,n=n.slice(),!a||2!==a.length)return void o.nestedProperty(t,e).set(n);for("date"===t.type&&(a[0]=o.cleanDate(a[0],p,t.calendar),a[1]=o.cleanDate(a[1],p,t.calendar)),r=0;r<2;r++)if("date"===t.type){if(!o.isDateTime(a[r],t.calendar)){t[e]=n;break}if(t.r2l(a[0])===t.r2l(a[1])){var l=o.constrain(t.r2l(a[0]),o.MIN_MS+1e3,o.MAX_MS-1e3);a[0]=t.l2r(l-1e3),a[1]=t.l2r(l+1e3);break}}else{if(!i(a[r])){if(!i(a[1-r])){t[e]=n;break}a[r]=a[1-r]*(r?10:.1)}if(a[r]<-d?a[r]=-d:a[r]>d&&(a[r]=d),a[0]===a[1]){var s=Math.max(1,Math.abs(1e-6*a[0]));a[0]-=s,a[1]+=s}}},t.setScale=function(r){var n=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var a=g.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var i=r&&t._r?"_r":"range",l=t.calendar;t.cleanRange(i);var s=t.r2l(t[i][0],l),c=t.r2l(t[i][1],l);if("y"===w?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(s-c),t._b=-t._m*c):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-s),t._b=-t._m*s),!isFinite(t._m)||!isFinite(t._b))throw o.notifier("Something went wrong with axis scaling","long"),e._replotting=!1,new Error("axis scaling")},t.makeCalcdata=function(e,r){var n,a,i,o="date"===t.type&&e[r+"calendar"];if(r in e)for(n=e[r],a=new Array(n.length),i=0;i=t.range[0]&&r<=t.range[1]}:function(e){var r=e.y;return r>=t.range[0]&&r<=t.range[1]},t._min=[],t._max=[],t._separators=e.separators,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":136,"../../lib":152,"./axis_ids":195,"./constants":197,d3:10,"fast-isnumeric":13}],210:[function(t,e,r){"use strict";function n(t){var e=["showexponent","showtickprefix","showticksuffix"],r=e.filter(function(e){return void 0!==t[e]}),n=function(e){return t[e]===t[r[0]]};if(r.every(n)||1===r.length)return t[r[0]]}var a=t("../../lib");e.exports=function(t,e,r,i,o){var l=n(t);if(r("tickprefix")&&r("showtickprefix",l),r("ticksuffix")&&r("showticksuffix",l),r("showticklabels")){var s=o.font||{},c=e.color===t.color?e.color:s.color;a.coerceFont(r,"tickfont",{family:s.family,size:s.size,color:c}),r("tickangle"),"category"!==i&&(r("tickformat")||"date"===i||(r("showexponent",l),r("exponentformat"),r("separatethousands")))}"category"===i||o.noHover||r("hoverformat")}},{"../../lib":152}],211:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r,i){var o=n.coerce2(t,e,a,"ticklen"),l=n.coerce2(t,e,a,"tickwidth"),s=n.coerce2(t,e,a,"tickcolor",e.color);r("ticks",i.outerTicks||o||l||s?"outside":"")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":152,"./layout_attributes":203}],212:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").ONEDAY;e.exports=function(t,e,r,o){var l="auto";"array"!==t.tickmode||"log"!==o&&"date"!==o||(t.tickmode="auto"),Array.isArray(t.tickvals)?l="array":t.dtick&&(l="linear");var s=r("tickmode",l);if("auto"===s)r("nticks");else if("linear"===s){var c="date"===o?i:1,u=r("dtick",c);if(n(u))e.dtick=u>0?Number(u):c;else if("string"!=typeof u)e.dtick=c;else{var f=u.charAt(0),d=u.substr(1);d=n(d)?Number(d):0,(d<=0||!("date"===o&&"M"===f&&d===Math.round(d)||"log"===o&&"L"===f||"log"===o&&"D"===f&&(1===d||2===d)))&&(e.dtick=c)}var p="date"===o?a.dateTick0(e.calendar):0,h=r("tick0",p);"date"===o?e.tick0=a.cleanDate(h,p):n(h)&&"D1"!==u&&"D2"!==u?e.tick0=Number(h):e.tick0=p}else{var g=r("tickvals");void 0===g?e.tickmode="auto":r("ticktext")}}},{"../../constants/numerical":136,"../../lib":152,"fast-isnumeric":13}],213:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plotly"),i=t("../../registry"),o=t("../../components/drawing"),l=t("./axes"),s=t("./constants").attrRegex;e.exports=function(t,e,r,c){function u(e,r){function n(e,r,n){for(a=0;a rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.select(".scatterlayer").selectAll(".points");n.selectAll(".point").call(o.setPointGroupScale,1,1).call(o.hideOutsideRangePoints,t),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1).call(o.hideOutsideRangePoints,t)}function d(e,r){var n,a,i,l=m[e.xaxis._id],s=m[e.yaxis._id],c=[];if(l){n=t._fullLayout[l.axisName],a=n._r,i=l.to,c[0]=(a[0]*(1-r)+r*i[0]-a[0])/(a[1]-a[0])*e.xaxis._length;var f=a[1]-a[0],d=i[1]-i[0];n.range[0]=a[0]*(1-r)+r*i[0],n.range[1]=a[1]*(1-r)+r*i[1],c[2]=e.xaxis._length*(1-r+r*d/f)}else c[0]=0,c[2]=e.xaxis._length;if(s){n=t._fullLayout[s.axisName],a=n._r,i=s.to,c[1]=(a[1]*(1-r)+r*i[1]-a[1])/(a[0]-a[1])*e.yaxis._length;var p=a[1]-a[0],h=i[1]-i[0];n.range[0]=a[0]*(1-r)+r*i[0],n.range[1]=a[1]*(1-r)+r*i[1],c[3]=e.yaxis._length*(1-r+r*h/p)}else c[1]=0,c[3]=e.yaxis._length;u(e.xaxis,e.yaxis);var g=e.xaxis,y=e.yaxis,x=!!l,b=!!s,_=x?g._length/c[2]:1,w=b?y._length/c[3]:1,k=x?c[0]:0,M=b?c[1]:0,A=x?c[0]/c[2]*g._length:0,T=b?c[1]/c[3]*y._length:0,L=g._offset-A,C=y._offset-T;v._defs.select("#"+e.clipId+"> rect").call(o.setTranslate,k,M).call(o.setScale,1/_,1/w),e.plot.call(o.setTranslate,L,C).call(o.setScale,_,w).selectAll(".points").selectAll(".point").call(o.setPointGroupScale,1/_,1/w),e.plot.selectAll(".points").selectAll(".textpoint").call(o.setTextPointsScale,1/_,1/w)}function p(){for(var e={},r=0;rr.duration?(p(),M=window.cancelAnimationFrame(g)):M=window.requestAnimationFrame(g)}var v=t._fullLayout,y=[],m=function(t){var e,r,n,a,i={};for(e in t)if(r=e.split("."),r[0].match(s)){var o=e.charAt(0),l=r[0];if(n=v[l],a={},Array.isArray(t[e])?a.to=t[e].slice(0):Array.isArray(t[e].range)&&(a.to=t[e].range.slice(0)),!a.to)continue;a.axisName=l,a.length=n._length,y.push(o),i[o]=a}return i}(e),x=Object.keys(m),b=function(t,e,r){var n,a,i,o=t._plots,l=[];for(n in o){var s=o[n];if(-1===l.indexOf(s)){var c=s.xaxis._id,u=s.yaxis._id,f=s.xaxis.range,d=s.yaxis.range;s.xaxis._r=s.xaxis.range.slice(),s.yaxis._r=s.yaxis.range.slice(),a=r[c]?r[c].to:f,i=r[u]?r[u].to:d,f[0]===a[0]&&f[1]===a[1]&&d[0]===i[0]&&d[1]===i[1]||-1===e.indexOf(c)&&-1===e.indexOf(u)||l.push(s)}}return l}(v,x,m);if(!b.length)return function(){function e(e,r,n){for(var a=0;a0?".":"")+a;c.isPlainObject(i)?l(i,e,o,n+1):e(o,a,i)}})}var s=t("../plotly"),c=t("../lib");r.manageCommandObserver=function(t,e,a,i){var o={},l=!0;e&&e._commandObserver&&(o=e._commandObserver),o.cache||(o.cache={}),o.lookupTable={};var s=r.hasSimpleAPICommandBindings(t,a,o.lookupTable);if(e&&e._commandObserver){if(s)return o;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,o}if(s){n(t,s,o.cache),o.check=function(){if(l){var e=n(t,s,o.cache);return e.changed&&i&&void 0!==o.lookupTable[e.value]&&(o.disable(),Promise.resolve(i({value:e.value,type:s.type,prop:s.prop,traces:s.traces,index:o.lookupTable[e.value]})).then(o.enable,o.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f=e.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=e._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),c=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&n(t,o),l.text(o.text()&&c.text()?" - ":"")}},v.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=s.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return n.append("input").attr({type:"text",name:"data"}).node().value=v.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},v.supplyDefaults=function(t){var e,r=t._fullLayout||{},n=t._fullLayout={},i=t.layout||{},o=t._fullData||[],l=t._fullData=[],s=t.data||[];if(t._transitionData||v.createTransitionData(t),r._initialAutoSizeIsDone){var c=r.width,f=r.height;v.supplyLayoutGlobalDefaults(i,n),i.width||(n.width=c),i.height||(n.height=f)}else{v.supplyLayoutGlobalDefaults(i,n);var d=!i.width||!i.height,p=n.autosize,h=t._context&&t._context.autosizable;d&&(p||h)?v.plotAutoSize(t,i,n):d&&v.sanitizeMargins(t),!p&&d&&(i.width=n.width,i.height=n.height)}n._initialAutoSizeIsDone=!0,n._dataLength=s.length,n._globalTransforms=(t._context||{}).globalTransforms,v.supplyDataDefaults(s,l,i,n),n._has=v._hasPlotType.bind(n);var g=n._modules;for(e=0;e0){var u=o(t._boundingBoxMargins),f=u.left+u.right,d=u.bottom+u.top,h=1-2*l,g=r._container&&r._container.node?r._container.node().getBoundingClientRect():{width:r.width,height:r.height};n=Math.round(h*(g.width-f)),a=Math.round(h*(g.height-d))}else{var y=s?window.getComputedStyle(t):{};n=parseFloat(y.width)||r.width,a=parseFloat(y.height)||r.height}var m=v.layoutAttributes.width.min,x=v.layoutAttributes.height.min;n1,_=!e.height&&Math.abs(r.height-a)>1;(_||b)&&(b&&(r.width=n),_&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),v.sanitizeMargins(r)},v.supplyLayoutModuleDefaults=function(t,e,r,n){var a,i;u.Axes.supplyLayoutDefaults(t,e,r);var o=e._basePlotModules;for(a=0;a.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+a},r:{val:r.x,size:r.r+a},b:{val:r.y,size:r.b+a},t:{val:r.y,size:r.t+a}}}else delete n._pushmargin[e];n._replotting||v.doAutoMargin(t)}},v.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),a=Math.max(e.margin.l||0,0),i=Math.max(e.margin.r||0,0),o=Math.max(e.margin.t||0,0),l=Math.max(e.margin.b||0,0),s=e._pushmargin;if(!1!==e.margin.autoexpand){s.base={l:{val:0,size:a},r:{val:1,size:i},t:{val:1,size:o},b:{val:0,size:l}};for(var f=Object.keys(s),d=0;dv){var M=(y*w+(k-e.width)*v)/(w-v),A=(k*(1-v)+(y-e.width)*(1-w))/(w-v);M>=0&&A>=0&&M+A>a+i&&(a=M,i=A)}}if(c(x)&&s[_].t){var T=s[_].t.val,L=s[_].t.size;if(T>m){var C=(x*T+(L-e.height)*m)/(T-m),S=(L*(1-m)+(x-e.height)*(1-T))/(T-m);C>=0&&S>=0&&C+S>l+o&&(l=C,o=S)}}}}if(r.l=Math.round(a),r.r=Math.round(i),r.t=Math.round(o),r.b=Math.round(l),r.p=Math.round(e.margin.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,!e._replotting&&"{}"!==n&&n!==JSON.stringify(e._size))return u.plot(t)},v.graphJson=function(t,e,r,n,a){function i(t){if("function"==typeof t)return null;if(p.isPlainObject(t)){var e,n,a={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0&&!p.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;a[e]=i(t[e])}return a}return Array.isArray(t)?t.map(i):p.isJSDate(t)?p.ms2DateTimeLocal(+t):t}(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&v.supplyDefaults(t);var o=a?t._fullData:t.data,l=a?t._fullLayout:t.layout,s=(t._transitionData||{})._frames,c={data:(o||[]).map(function(t){var r=i(t);return e&&delete r.fit,r})};return e||(c.layout=i(l)),t.framework&&t.framework.isPolar&&(c=t.framework.getConfig()),s&&(c.frames=i(s)),"object"===n?c:JSON.stringify(c)},v.modifyFrames=function(t,e){var r,n,a,i=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){b=!0}),a.redraw&&t._transitionData._interruptCallbacks.push(function(){return u.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var o,l,s=0,c=0,d=t._fullLayout._basePlotModules,h=!1;if(r)for(l=0;l=0,S=C?d.angularAxis.domain:n.extent(M),z=Math.abs(M[1]-M[0]);T&&!A&&(z=0);var O=S.slice();L&&A&&(O[1]+=z);var D=d.angularAxis.ticksCount||4;D>8&&(D=D/(D/8)+D%8),d.angularAxis.ticksStep&&(D=(O[1]-O[0])/D);var P=d.angularAxis.ticksStep||(O[1]-O[0])/(D*(d.minorTicks+1));k&&(P=Math.max(Math.round(P),1)),O[2]||(O[2]=P);var E=n.range.apply(this,O);if(E=E.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=n.scale.linear().domain(O.slice(0,2)).range("clockwise"===d.direction?[0,360]:[360,0]),f.layout.angularAxis.domain=s.domain(),f.layout.angularAxis.endPadding=L?z:0,void 0===(e=n.select(this).select("svg.chart-root"))||e.empty()){var I=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),N=this.appendChild(this.ownerDocument.importNode(I.documentElement,!0));e=n.select(N)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var R,F=e.select(".chart-group"),j={fill:"none",stroke:d.tickColor},B={"font-size":d.font.size,"font-family":d.font.family,fill:d.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+d.font.outlineColor}).join(",")};if(d.showLegend){R=e.select(".legend-group").attr({transform:"translate("+[b,d.margin.top]+")"}).style({display:"block"});var q=h.map(function(t,e){var r=l.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});l.Legend().config({data:h.map(function(t,e){return t.name||"Element"+e}),legendConfig:i({},l.Legend.defaultConfig().legendConfig,{container:R,elements:q,reverseOrder:d.legend.reverseOrder})})();var H=R.node().getBBox();b=Math.min(d.width-H.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2,b=Math.max(10,b),w=[d.margin.left+b,d.margin.top+b],a.range([0,b]),f.layout.radialAxis.domain=a.domain(),R.attr("transform","translate("+[w[0]+b,w[1]-b]+")")}else R=e.select(".legend-group").style({display:"none"});e.attr({width:d.width,height:d.height}).style({opacity:d.opacity}),F.attr("transform","translate("+w+")").style({cursor:"crosshair"});var V=[(d.width-(d.margin.left+d.margin.right+2*b+(H?H.width:0)))/2,(d.height-(d.margin.top+d.margin.bottom+2*b))/2];if(V[0]=Math.max(0,V[0]),V[1]=Math.max(0,V[1]),e.select(".outer-group").attr("transform","translate("+V+")"),d.title){var U=e.select("g.title-group text").style(B).text(d.title),G=U.node().getBBox();U.attr({x:w[0]-G.width/2,y:w[1]-b-20})}var X=e.select(".radial.axis-group");if(d.radialAxis.gridLinesVisible){var Y=X.selectAll("circle.grid-circle").data(a.ticks(5)) ;Y.enter().append("circle").attr({class:"grid-circle"}).style(j),Y.attr("r",a),Y.exit().remove()}X.select("circle.outside-circle").attr({r:b}).style(j);var Z=e.select("circle.background-circle").attr({r:b}).style({fill:d.backgroundColor,stroke:d.stroke});if(d.radialAxis.visible){var W=n.svg.axis().scale(a).ticks(5).tickSize(5);X.call(W).attr({transform:"rotate("+d.radialAxis.orientation+")"}),X.selectAll(".domain").style(j),X.selectAll("g>text").text(function(t,e){return this.textContent+d.radialAxis.ticksSuffix}).style(B).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===d.radialAxis.tickOrientation?"rotate("+-d.radialAxis.orientation+") translate("+[0,B["font-size"]]+")":"translate("+[0,B["font-size"]]+")"}}),X.selectAll("g>line").style({stroke:"black"})}var Q=e.select(".angular.axis-group").selectAll("g.angular-tick").data(E),$=Q.enter().append("g").classed("angular-tick",!0);Q.attr({transform:function(t,e){return"rotate("+c(t,e)+")"}}).style({display:d.angularAxis.visible?"block":"none"}),Q.exit().remove(),$.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(d.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(d.minorTicks+1)==0)}).style(j),$.selectAll(".minor").style({stroke:d.minorTickColor}),Q.select("line.grid-line").attr({x1:d.tickLength?b-d.tickLength:0,x2:b}).style({display:d.angularAxis.gridLinesVisible?"block":"none"}),$.append("text").classed("axis-text",!0).style(B);var J=Q.select("text.axis-text").attr({x:b+d.labelOffset,dy:o+"em",transform:function(t,e){var r=c(t,e),n=b+d.labelOffset,a=d.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-r+" "+n+" 0)":"radial"==a?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:d.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(d.minorTicks+1)!=0?"":k?k[t]+d.angularAxis.ticksSuffix:t+d.angularAxis.ticksSuffix}).style(B);d.angularAxis.rewriteTicks&&J.text(function(t,e){return e%(d.minorTicks+1)!=0?"":d.angularAxis.rewriteTicks(this.textContent,e)});var K=n.max(F.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));R.attr({transform:"translate("+[b+K,d.margin.top]+")"});var tt=e.select("g.geometry-group").selectAll("g").size()>0,et=e.select("g.geometry-group").selectAll("g.geometry").data(h);if(et.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),et.exit().remove(),h[0]||tt){var rt=[];h.forEach(function(t,e){var r={};r.radialScale=a,r.angularScale=s,r.container=et.filter(function(t,r){return r==e}),r.geometry=t.geometry,r.orientation=d.orientation,r.direction=d.direction,r.index=e,rt.push({data:t,geometryConfig:r})});var nt=n.nest().key(function(t,e){return void 0!==t.data.groupId||"unstacked"}).entries(rt),at=[];nt.forEach(function(t,e){"unstacked"===t.key?at=at.concat(t.values.map(function(t,e){return[t]})):at.push(t.values)}),at.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return i(l[r].defaultConfig(),t)});l[r]().config(n)()})}var it,ot,lt=e.select(".guides-group"),st=e.select(".tooltips-group"),ct=l.tooltipPanel().config({container:st,fontSize:8})(),ut=l.tooltipPanel().config({container:st,fontSize:8})(),ft=l.tooltipPanel().config({container:st,hasTick:!0})();if(!A){var dt=lt.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});F.on("mousemove.angular-guide",function(t,e){var r=l.util.getMousePos(Z).angle;dt.attr({x2:-b,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-d.orientation)%360;it=s.invert(n);var a=l.util.convertToCartesian(b+12,r+180);ct.text(l.util.round(it)).move([a[0]+w[0],a[1]+w[1]])}).on("mouseout.angular-guide",function(t,e){lt.select("line").style({opacity:0})})}var pt=lt.select("circle").style({stroke:"grey",fill:"none"});F.on("mousemove.radial-guide",function(t,e){var r=l.util.getMousePos(Z).radius;pt.attr({r:r}).style({opacity:.5}),ot=a.invert(l.util.getMousePos(Z).radius);var n=l.util.convertToCartesian(r,d.radialAxis.orientation);ut.text(l.util.round(ot)).move([n[0]+w[0],n[1]+w[1]])}).on("mouseout.radial-guide",function(t,e){pt.style({opacity:0}),ft.hide(),ct.hide(),ut.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,r){var a=n.select(this),i=this.style.fill,o="black",s=this.style.opacity||1;if(a.attr({"data-opacity":s}),i&&"none"!==i){a.attr({"data-fill":i}),o=n.hsl(i).darker().toString(),a.style({fill:o,opacity:1});var c={t:l.util.round(t[0]),r:l.util.round(t[1])};A&&(c.t=k[t[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),d=e.node().getBoundingClientRect(),p=[f.left+f.width/2-V[0]-d.left,f.top+f.height/2-V[1]-d.top];ft.config({color:o}).text(u),ft.move(p)}else i=this.style.stroke||"black",a.attr({"data-stroke":i}),o=n.hsl(i).darker().toString(),a.style({stroke:o,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ft.show()}).on("mouseout.tooltip",function(t,e){ft.hide();var r=n.select(this),a=r.attr("data-fill");a?r.style({fill:a,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})}),p}var e,r,a,s,c={data:[],layout:{}},u={},f={},d=n.dispatch("hover"),p={};return p.render=function(e){return t(e),this},p.config=function(t){if(!arguments.length)return c;var e=l.util.cloneJson(t);return e.data.forEach(function(t,e){c.data[e]||(c.data[e]={}),i(c.data[e],l.Axis.defaultConfig().data[0]),i(c.data[e],t)}),i(c.layout,l.Axis.defaultConfig().layout),i(c.layout,e.layout),this},p.getLiveConfig=function(){return f},p.getinputConfig=function(){return u},p.radialScale=function(t){return a},p.angularScale=function(t){return s},p.svg=function(){return e},n.rebind(p,d,"on"),p},l.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},l.util={},l.DATAEXTENT="dataExtent",l.AREA="AreaChart",l.LINE="LinePlot",l.DOT="DotPlot",l.BAR="BarChart",l.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},l.util._extend=function(t,e){for(var r in t)e[r]=t[r]},l.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},l.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180;return[e,t(n)]})},l.util.dataFromEquation=function(t,e,r){var a=e||6,i=[],o=[];n.range(0,360+a,a).forEach(function(e,r){var n=e*Math.PI/180,a=t(n);i.push(e),o.push(a)});var l={t:i,r:o};return r&&(l.name=r),l},l.util.ensureArray=function(t,e){if(void 0===t)return null;var r=[].concat(t);return n.range(e).map(function(t,e){return r[e]||r[0]})},l.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=l.util.ensureArray(t[e],r)}),t},l.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},l.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},l.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},l.util.arrayLast=function(t){return t[t.length-1]},l.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},l.util.flattenArray=function(t){for(var e=[];!l.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},l.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},l.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},l.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},l.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],a=e[1],i={};return i.x=r,i.y=a,i.pos=e,i.angle=180*(Math.atan2(a,r)+Math.PI)/Math.PI,i.radius=Math.sqrt(r*r+a*a),i},l.util.duplicatesCount=function(t){for(var e,r={},n={},a=0,i=t.length;a0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:d(o),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return v.fill(r,a,i)},"fill-opacity":0,stroke:function(t,e){return v.stroke(r,a,i)},"stroke-width":function(t,e){return v["stroke-width"](r,a,i)},"stroke-dasharray":function(t,e){return v["stroke-dasharray"](r,a,i)},opacity:function(t,e){return v.opacity(r,a,i)},display:function(t,e){return v.display(r,a,i)}})}};var p=t.angularScale.range(),h=Math.abs(p[1]-p[0])/s[0].length*Math.PI/180,g=n.svg.arc().startAngle(function(t){return-h/2}).endAngle(function(t){return h/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 v={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 a[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return void 0===e[n].data.visible||e[n].data.visible?"block":"none"}},y=n.select(this).selectAll("g.layer").data(s);y.enter().append("g").attr({class:"layer"});var m=y.selectAll("path.mark").data(function(t,e){return t});m.enter().append("path").attr({class:"mark"}),m.style(v).each(f[t.geometryType]),m.exit().remove(),y.exit().remove()})}var e=[l.PolyChart.defaultConfig()],r=n.dispatch("hover"),a={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,r){e[r]||(e[r]={}),i(e[r],l.PolyChart.defaultConfig()),i(e[r],t)}),this):e},t.getColorScale=function(){},n.rebind(t,r,"on"),t},l.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},l.BarChart=function(){return l.PolyChart()},l.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},l.AreaChart=function(){return l.PolyChart()},l.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},l.DotPlot=function(){return l.PolyChart()},l.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},l.LinePlot=function(){return l.PolyChart()},l.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},l.Legend=function(){function t(){var r=e.legendConfig,a=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var a=i({},r.elements[e]);return a.name=t,a.color=[].concat(r.elements[e].color)[n],a})}),o=n.merge(a);o=o.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||void 0===r.elements[e].visibleInLegend)}),r.reverseOrder&&(o=o.reverse());var l=r.container;("string"==typeof l||l.nodeName)&&(l=n.select(l));var s=o.map(function(t,e){return t.color}),c=r.fontSize,u=null==r.isContinuous?"number"==typeof o[0]:r.isContinuous,f=u?r.height:c*o.length,d=l.classed("legend-group",!0),p=d.selectAll("svg").data([0]),h=p.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"});h.append("g").classed("legend-axis",!0),h.append("g").classed("legend-marks",!0);var g=n.range(o.length),v=n.scale[u?"linear":"ordinal"]().domain(g).range(s),y=n.scale[u?"linear":"ordinal"]().domain(g)[u?"range":"rangePoints"]([0,f]),m=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":-1!=n.svg.symbolTypes.indexOf(t)?n.svg.symbol().type(t).size(r)():n.svg.symbol().type("square").size(r)()};if(u){var x=p.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}}),p.append("rect").classed("legend-mark",!0).attr({height:r.height,width:r.colorBandWidth,fill:"url(#grad1)"})}else{var b=p.select(".legend-marks").selectAll("path.legend-mark").data(o);b.enter().append("path").classed("legend-mark",!0),b.attr({transform:function(t,e){return"translate("+[c/2,y(e)+c/2]+")"},d:function(t,e){var r=t.symbol;return m(r,c)},fill:function(t,e){return v(e)}}),b.exit().remove()}var _=n.svg.axis().scale(y).orient("right"),w=p.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 o[e].name}),t}var e=l.Legend.defaultConfig(),r=n.dispatch("hover");return t.config=function(t){return arguments.length?(i(e,t),this):e},n.rebind(t,r,"on"),t},l.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},l.tooltipPanel=function(){var t,e,r,a={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},o="tooltip-"+l.tooltipPanel.uid++,s=function(){t=a.container.selectAll("g."+o).data([0]);var n=t.enter().append("g").classed(o,!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+10,dy:.3*+a.fontSize}),s};return s.text=function(i){var o=n.hsl(a.color).l,l=o>=.5?"#aaa":"white",c=o>=.5?"black":"white",u=i||"";e.style({fill:c,"font-size":a.fontSize+"px"}).text(u);var f=a.padding,d=e.node().getBBox(),p={fill:a.color,stroke:l,"stroke-width":"2px"},h=d.width+2*f+10,g=d.height+2*f;return r.attr({d:"M"+[[10,-g/2],[10,-g/4],[a.hasTick?0:10,0],[10,g/4],[10,g/2],[h,g/2],[h,-g/2]].join("L")+"Z"}).style(p),t.attr({transform:"translate("+[10,-g/2+2*f]+")"}),t.style({display:"block"}),s},s.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),s},s.hide=function(){if(t)return t.style({display:"none"}),s},s.show=function(){if(t)return t.style({display:"block"}),s},s.config=function(t){return i(a,t),s},s},l.tooltipPanel.uid=1,l.adapter={},l.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=i({},t);return[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]].forEach(function(t,r){l.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var a=l.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=a.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)})}if(t.layout){var o=i({},t.layout);if([[o,["plot_bgcolor"],["backgroundColor"]],[o,["showlegend"],["showLegend"]],[o,["radialaxis"],["radialAxis"]],[o,["angularaxis"],["angularAxis"]],[o.angularaxis,["showline"],["gridLinesVisible"]],[o.angularaxis,["showticklabels"],["labelsVisible"]],[o.angularaxis,["nticks"],["ticksCount"]],[o.angularaxis,["tickorientation"],["tickOrientation"]],[o.angularaxis,["ticksuffix"],["ticksSuffix"]],[o.angularaxis,["range"],["domain"]],[o.angularaxis,["endpadding"],["endPadding"]],[o.radialaxis,["showline"],["gridLinesVisible"]],[o.radialaxis,["tickorientation"],["tickOrientation"]],[o.radialaxis,["ticksuffix"],["ticksSuffix"]],[o.radialaxis,["range"],["domain"]],[o.angularAxis,["showline"],["gridLinesVisible"]],[o.angularAxis,["showticklabels"],["labelsVisible"]],[o.angularAxis,["nticks"],["ticksCount"]],[o.angularAxis,["tickorientation"],["tickOrientation"]],[o.angularAxis,["ticksuffix"],["ticksSuffix"]],[o.angularAxis,["range"],["domain"]],[o.angularAxis,["endpadding"],["endPadding"]],[o.radialAxis,["showline"],["gridLinesVisible"]],[o.radialAxis,["tickorientation"],["tickOrientation"]],[o.radialAxis,["ticksuffix"],["ticksSuffix"]],[o.radialAxis,["range"],["domain"]],[o.font,["outlinecolor"],["outlineColor"]],[o.legend,["traceorder"],["reverseOrder"]],[o,["labeloffset"],["labelOffset"]],[o,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(t,r){l.util.translator.apply(null,t.concat(e))}),e?(void 0!==o.tickLength&&(o.angularaxis.ticklen=o.tickLength,delete o.tickLength),o.tickColor&&(o.angularaxis.tickcolor=o.tickColor,delete o.tickColor)):(o.angularAxis&&void 0!==o.angularAxis.ticklen&&(o.tickLength=o.angularAxis.ticklen),o.angularAxis&&void 0!==o.angularAxis.tickcolor&&(o.tickColor=o.angularAxis.tickcolor)),o.legend&&"boolean"!=typeof o.legend.reverseOrder&&(o.legend.reverseOrder="normal"!=o.legend.reverseOrder),o.legend&&"boolean"==typeof o.legend.traceorder&&(o.legend.traceorder=o.legend.traceorder?"reversed":"normal",delete o.legend.reverseOrder),o.margin&&void 0!==o.margin.t){var s=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(o.margin).forEach(function(t,e){u[c[s.indexOf(t.key)]]=t.value}),o.margin=u}e&&(delete o.needsEndSpacing,delete o.minorTickColor,delete o.minorTicks,delete o.angularaxis.ticksCount,delete o.angularaxis.ticksCount,delete o.angularaxis.ticksStep,delete o.angularaxis.rewriteTicks,delete o.angularaxis.nticks,delete o.radialaxis.ticksCount,delete o.radialaxis.ticksCount,delete o.radialaxis.ticksStep,delete o.radialaxis.rewriteTicks,delete o.radialaxis.nticks),r.layout=o}return r},t}},{"../../constants/alignment":134,"../../lib":152,d3:10}],226:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../components/color"),o=t("./micropolar"),l=t("./undo_manager"),s=a.extendDeepAll,c=e.exports={};c.framework=function(t){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,i||(i=o.Axis()),u=o.adapter.plotly().convert(r),i.config(u).render(f),t.data=r.data,t.layout=r.layout,c.fillLayout(t),r}var r,a,i,u,f,d=new l;return e.isPolar=!0,e.svg=function(){return i.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return o.adapter.plotly().convert(i.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:i.angularScale(),r:i.radialScale()}},e.setUndoPoint=function(){var t=this,e=o.util.cloneJson(r);!function(e,r){d.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,a),a=o.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(),o={width:800,height:600,paper_bgcolor:i.background,_container:e,_paperdiv:r,_paper:a};t._fullLayout=s(o,t.layout)}},{"../../components/color":37,"../../lib":152,"./micropolar":225,"./undo_manager":227,d3:10}],227:[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-1!==n},hasRedo:function(){return n-1}var i=t("../lib"),o=t("../plots/plots"),l=i.extendFlat,s=i.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,i=t.data,c=t.layout,u=s([],i),f=s({},c,n(e.tileClass)),d=t._context||{};if(e.width&&(f.width=e.width),e.height&&(f.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){f.annotations=[];var p=Object.keys(f);for(r=0;r")?"":e.html(t).text()});return e.remove(),r}function a(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}var i=t("d3"),o=t("../lib"),l=t("../components/drawing"),s=t("../components/color"),c=t("../constants/xmlns_namespaces"),u=/"/g,f=new RegExp('("TOBESTRIPPED)|(TOBESTRIPPED")',"g");e.exports=function(t,e,r){var d,p=t._fullLayout,h=p._paper,g=p._toppaper,v=p.width,y=p.height;h.insert("rect",":first-child").call(l.setRect,0,0,v,y).call(s.fill,p.paper_bgcolor);var m=p._basePlotModules||[];for(d=0;d0&&A>0,j=k<=N&&A<=R,B=k<=R&&A<=N,q="h"===y?N>=k*(R/A):R>=A*(N/k);F&&(j||B||q)?x="inside":(x="outside",b.remove(),b=null)}else x="inside";if(!b&&(b=g(e,m,"outside"===x?C:L),_=M.bBox(b.node()),k=_.width,A=_.height,k<=0||A<=0))return void b.remove();var H,V;"outside"===x?(V="both"===v.constraintext||"outside"===v.constraintext,H=i(o,d,p,h,_,y,V)):(V="both"===v.constraintext||"inside"===v.constraintext,H=a(o,d,p,h,_,y,V)),b.attr("transform",H)}}}function a(t,e,r,n,a,i,l){var s,c,u,f,d,p=a.width,h=a.height,g=(a.left+a.right)/2,v=(a.top+a.bottom)/2,y=Math.abs(e-t),m=Math.abs(n-r);y>2*D&&m>2*D?(d=D,y-=2*d,m-=2*d):d=0;var x,b;return p<=y&&h<=m?(x=!1,b=1):p<=m&&h<=y?(x=!0,b=1):pr?(u=(t+e)/2,f=n-d-c/2):(u=(t+e)/2,f=n+d+c/2),o(g,v,u,f,b,x)}function i(t,e,r,n,a,i,l){var s,c="h"===i?Math.abs(n-r):Math.abs(e-t);c>2*D&&(s=D);var u=1;l&&(u="h"===i?Math.min(1,c/a.height):Math.min(1,c/a.width));var f,d,p,h,g=(a.left+a.right)/2,v=(a.top+a.bottom)/2;return f=u*a.width,d=u*a.height,"h"===i?er?(p=(t+e)/2,h=n+s+d/2):(p=(t+e)/2,h=n-s-d/2),o(g,v,p,h,u,!1)}function o(t,e,r,n,a,i){var o,l;return a<1?o="scale("+a+") ":(a=1,o=""),l=i?"rotate("+i+" "+t+" "+e+") ":"","translate("+(r-a*t)+" "+(n-a*e)+")"+o+l}function l(t,e){var r=p(t.text,e);return h(L,r)}function s(t,e){var r=p(t.textposition,e);return g(C,r)}function c(t,e,r){return d(S,t.textfont,e,r)}function u(t,e,r){return d(z,t.insidetextfont,e,r)}function f(t,e,r){return d(O,t.outsidetextfont,e,r)}function d(t,e,r,n){e=e||{};var a=p(e.family,r),i=p(e.size,r),o=p(e.color,r);return{family:h(t.family,a,n.family),size:v(t.size,i,n.size),color:y(t.color,o,n.color)}}function p(t,e){var r;return Array.isArray(t)?ea))return e}return void 0!==r?r:t.dflt}function y(t,e,r){return b(e).isValid()?e:void 0!==r?r:t.dflt}var m=t("d3"),x=t("fast-isnumeric"),b=t("tinycolor2"),_=t("../../lib"),w=t("../../lib/svg_text_utils"),k=t("../../components/color"),M=t("../../components/drawing"),A=t("../../components/errorbars"),T=t("./attributes"),L=T.text,C=T.textposition,S=T.textfont,z=T.insidetextfont,O=T.outsidetextfont,D=3;e.exports=function(t,e,r){var a=e.xaxis,i=e.yaxis,o=t._fullLayout,l=e.plot.select(".barlayer").selectAll("g.trace.bars").data(r);l.enter().append("g").attr("class","trace bars"),l.append("g").attr("class","points").each(function(e){var r=e[0].node3=m.select(this),l=e[0].t,s=e[0].trace,c=l.poffset,u=Array.isArray(c);r.selectAll("g.point").data(_.identity).enter().append("g").classed("point",!0).each(function(r,l){function f(t){return 0===o.bargap&&0===o.bargroupgap?m.round(Math.round(t)-A,2):t}function d(t,e){return Math.abs(t-e)>=2?f(t):t>e?Math.ceil(t):Math.floor(t)}var p,h,g,v,y=r.p+(u?c[l]:c),b=y+r.w,_=r.b,w=_+r.s;if("h"===s.orientation?(g=i.c2p(y,!0),v=i.c2p(b,!0),p=a.c2p(_,!0),h=a.c2p(w,!0),r.ct=[h,(g+v)/2]):(p=a.c2p(y,!0),h=a.c2p(b,!0),g=i.c2p(_,!0),v=i.c2p(w,!0),r.ct=[(p+h)/2,v]),!(x(p)&&x(h)&&x(g)&&x(v)&&p!==h&&g!==v))return void m.select(this).remove();var M=(r.mlw+1||s.marker.line.width+1||(r.trace?r.trace.marker.line.width:0)+1)-1,A=m.round(M/2%1,2);if(!t._context.staticPlot){var T=k.opacity(r.mc||s.marker.color),L=T<1||M>.01?f:d;p=L(p,h),h=L(h,p),g=L(g,v),v=L(v,g)}var C=m.select(this);C.append("path").style("vector-effect","non-scaling-stroke").attr("d","M"+p+","+g+"V"+v+"H"+h+"V"+g+"Z"),n(t,C,e,l,p,h,g,v)})}),l.call(A.plot,e)}},{"../../components/color":37,"../../components/drawing":61,"../../components/errorbars":67,"../../lib":152,"../../lib/svg_text_utils":172,"./attributes":238,d3:10,"fast-isnumeric":13,tinycolor2:19}],246:[function(t,e,r){"use strict";var n=t("../../constants/interactions").DESELECTDIM;e.exports=function(t,e){var r,a=t.cd,i=[],o=a[0].trace,l=a[0].node3;if(!0!==o.visible)return[];if(!1===e)for(r=0;rc+l||!m(s))&&(f=!0,d(u,t))}for(var a=r.traces,i=y(e),o="fraction"===t._fullLayout.barnorm?1:100,l=o/1e9,s=e.l2c(e.c2l(0)),c="stack"===t._fullLayout.barmode?o:s,u=[s,c],f=!1,p=0;p1||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,o=r.line,l=i.tryColorscale(r,""),s=i.tryColorscale(r,"line");n.select(this).selectAll("path").each(function(t){var e,i,c=(t.mlw+1||o.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&&(i="mlc"in t?t.mlcc=s(t.mlc):Array.isArray(o.color)?a.defaultLine:o.color,u.call(a.stroke,i))})}),e.call(o.style)}},{"../../components/color":37,"../../components/drawing":61,"../../components/errorbars":67,d3:10}],250:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,l){r("marker.color",o),a(t,"marker")&&i(t,e,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(t,"marker.line")&&i(t,e,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width")}},{"../../components/color":37,"../../components/colorscale/defaults":46,"../../components/colorscale/has_colorscale":50}],251:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../../components/color/attributes"),i=t("../../lib/extend").extendFlat,o=n.marker,l=o.line;e.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},name:{valType:"string",editType:"calc+clearAxisTypes"},whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calcIfAutorange"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers",editType:"calcIfAutorange"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1,editType:"calcIfAutorange"},jitter:{valType:"number",min:0,max:1,editType:"calcIfAutorange"},pointpos:{valType:"number",min:-2,max:2,editType:"calcIfAutorange"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:i({},o.symbol,{arrayOk:!1,editType:"plot"}),opacity:i({},o.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:i({},o.size,{arrayOk:!1,editType:"calcIfAutorange"}),color:i({},o.color,{arrayOk:!1,editType:"style"}),line:{color:i({},l.color,{arrayOk:!1,dflt:a.defaultLine,editType:"style"}),width:i({},l.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor}},{"../../components/color/attributes":36,"../../lib/extend":146,"../scatter/attributes":293}],252:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../plots/cartesian/axes");e.exports=function(t,e){var r,o,l,s,c,u,f,d,p,h=i.getFromId(t,e.xaxis||"x"),g=i.getFromId(t,e.yaxis||"y"),v=e.orientation,y=[];"h"===v?(r=h,o="x",c=g,u="y"):(r=g,o="y",c=h,u="x"),l=r.makeCalcdata(e,o),i.expand(r,l,{padded:!0}),f=function(t,e,r,i,o){var l;return r in e?f=i.makeCalcdata(e,r):(l=r+"0"in e?e[r+"0"]:"name"in e&&("category"===i.type||n(e.name)&&-1!==["linear","log"].indexOf(i.type)||a.isDateTime(e.name)&&"date"===i.type)?e.name:t.numboxes,l=i.d2c(l,0,e[r+"calendar"]),f=o.map(function(){return l})),f}(t,e,u,c,l);var m=a.distinctVals(f);return d=m.vals,p=m.minDiff/2,s=function(t,e,r,i,o){var l,s,c,u,f=i.length,d=e.length,p=[],h=[];for(l=0;l=0&&c1,g=r.dPos*(1-u.boxgap)*(1-u.boxgroupgap)/(h?t.numboxes:1),v=h?2*r.dPos*((r.boxnum+.5)/t.numboxes-.5)*(1-u.boxgap):0,y=g*p.whiskerwidth;if(!0!==p.visible||r.emptybox)return void i.select(this).remove();"h"===p.orientation?(s=d,c=f):(s=f,c=d),r.bPos=v,r.bdPos=g,n(),i.select(this).selectAll("path.box").data(o.identity).enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","box").each(function(t){var e=s.c2p(t.pos+v,!0),r=s.c2p(t.pos+v-g,!0),n=s.c2p(t.pos+v+g,!0),a=s.c2p(t.pos+v-y,!0),l=s.c2p(t.pos+v+y,!0),u=c.c2p(t.q1,!0),f=c.c2p(t.q3,!0),d=o.constrain(c.c2p(t.med,!0),Math.min(u,f)+1,Math.max(u,f)-1),h=c.c2p(!1===p.boxpoints?t.min:t.lf,!0),m=c.c2p(!1===p.boxpoints?t.max:t.uf,!0);"h"===p.orientation?i.select(this).attr("d","M"+d+","+r+"V"+n+"M"+u+","+r+"V"+n+"H"+f+"V"+r+"ZM"+u+","+e+"H"+h+"M"+f+","+e+"H"+m+(0===p.whiskerwidth?"":"M"+h+","+a+"V"+l+"M"+m+","+a+"V"+l)):i.select(this).attr("d","M"+r+","+d+"H"+n+"M"+r+","+u+"H"+n+"V"+f+"H"+r+"ZM"+e+","+u+"V"+h+"M"+e+","+f+"V"+m+(0===p.whiskerwidth?"":"M"+a+","+h+"H"+l+"M"+a+","+m+"H"+l))}),p.boxpoints&&i.select(this).selectAll("g.points").data(function(t){return t.forEach(function(t){t.t=r,t.trace=p}),t}).enter().append("g").attr("class","points").selectAll("path").data(function(t){var e,r,n,i,l,s,c,u="all"===p.boxpoints?t.val:t.val.filter(function(e){return et.uf}),f=Math.max((t.max-t.min)/10,t.q3-t.q1),d=1e-9*f,h=.01*f,y=[],m=0;if(p.jitter){if(0===f)for(m=1,y=new Array(u.length),e=0;et.lo&&(n.so=!0),n})}).enter().append("path").classed("point",!0).call(l.translatePoints,f,d),p.boxmean&&i.select(this).selectAll("path.mean").data(o.identity).enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}).each(function(t){var e=s.c2p(t.pos+v,!0),r=s.c2p(t.pos+v-g,!0),n=s.c2p(t.pos+v+g,!0),a=c.c2p(t.mean,!0),o=c.c2p(t.mean-t.sd,!0),l=c.c2p(t.mean+t.sd,!0);"h"===p.orientation?i.select(this).attr("d","M"+a+","+r+"V"+n+("sd"!==p.boxmean?"":"m0,0L"+o+","+e+"L"+a+","+r+"L"+l+","+e+"Z")):i.select(this).attr("d","M"+r+","+a+"H"+n+("sd"!==p.boxmean?"":"m0,0L"+e+","+o+"L"+r+","+a+"L"+e+","+l+"Z"))})})}},{"../../components/drawing":61, -"../../lib":152,d3:10}],259:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/cartesian/axes"),i=t("../../lib");e.exports=function(t,e){var r,o,l,s,c=t._fullLayout,u=e.xaxis,f=e.yaxis,d=["v","h"];for(o=0;oi){var o=i-r[t];return r[t]=i,o}}return 0},max:function(t,e,r,a){var i=a[e];if(n(i)){if(i=Number(i),!n(r[t]))return r[t]=i,i;if(r[t]p.size/1.9?p.size:p.size/Math.ceil(p.size/x);var A=p.start+(p.size-x)/2;b=A-x*Math.ceil((A-b)/x)}for(s=0;s=0;i--)a(i);else if("increasing"===e){for(i=1;i=0;i--)t[i]+=t[i+1];"exclude"===r&&(t.push(0),t.shift())}}var c=t("fast-isnumeric"),u=t("../../lib"),f=t("../../plots/cartesian/axes"),d=t("../bar/arrays_to_calcdata"),p=t("./bin_functions"),h=t("./norm_functions"),g=t("./average"),v=t("./clean_bins"),y=t("../../constants/numerical").ONEAVGMONTH;e.exports=function(t,e){if(!0===e.visible){var r,a=[],i=[],o=f.getFromId(t,"h"===e.orientation?e.yaxis||"y":e.xaxis||"x"),l="h"===e.orientation?"y":"x",y={x:"y",y:"x"}[l],m=e[l+"calendar"],x=e.cumulative;v(e,o,l);var b,_,w,k=n(t,e,o,l),M=k[0],A=k[1],T="string"==typeof M.size,L=T?[]:M,C=[],S=[],z=0,O=e.histnorm,D=e.histfunc,P=-1!==O.indexOf("density");x.enabled&&P&&(O=O.replace(/ ?density$/,""),P=!1);var E,I="max"===D||"min"===D,N=I?null:0,R=p.count,F=h[O],j=!1,B=function(t){return o.r2c(t,0,m)};for(Array.isArray(e[y])&&"count"!==D&&(E=e[y],j="avg"===D,R=p[D]),r=B(M.start),_=B(M.end)+(r-f.tickIncrement(r,M.size,!1,m))/1e6;r<_&&a.length<1e6&&(b=f.tickIncrement(r,M.size,!1,m),a.push((r+b)/2),i.push(N),T&&L.push(r),P&&C.push(1/(b-r)),j&&S.push(0),!(b<=r));)r=b;T||"date"!==o.type||(L={start:B(L.start),end:B(L.end),size:L.size});var q=i.length;for(r=0;r=0&&w=U;r--)if(i[r]){G=r;break}for(r=U;r<=G;r++)c(a[r])&&c(i[r])&&V.push({p:a[r],s:i[r],b:0});return 1===V.length&&(V[0].width1=f.tickIncrement(V[0].p,M.size,!1,m)-V[0].p),d(V,e),V}}},{"../../constants/numerical":136,"../../lib":152,"../../plots/cartesian/axes":192,"../bar/arrays_to_calcdata":237,"./average":266,"./bin_functions":268,"./clean_bins":270,"./norm_functions":273,"fast-isnumeric":13}],270:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib").cleanDate,i=t("../../constants/numerical"),o=i.ONEDAY,l=i.BADNUM;e.exports=function(t,e,r){var i=e.type,s=r+"bins",c=t[s];c||(c=t[s]={});var u="date"===i?function(t){return t||0===t?a(t,l,c.calendar):null}:function(t){return n(t)?Number(t):null};c.start=u(c.start),c.end=u(c.end);var f="date"===i?o:1,d=c.size;if(n(d))c.size=d>0?Number(d):f;else if("string"!=typeof d)c.size=f;else{var p=d.charAt(0),h=d.substr(1);h=n(h)?Number(h):0,(h<=0||"date"!==i||"M"!==p||h!==Math.round(h))&&(c.size=f)}var g="autobin"+r;"boolean"!=typeof t[g]&&(t[g]=!((c.start||0===c.start)&&(c.end||0===c.end))),t[g]||delete t["nbins"+r]}},{"../../constants/numerical":136,"../../lib":152,"fast-isnumeric":13}],271:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("../../components/color"),o=t("./bin_defaults"),l=t("../bar/style_defaults"),s=t("../../components/errorbars/defaults"),c=t("./attributes");e.exports=function(t,e,r,u){function f(r,n){return a.coerce(t,e,c,r,n)}var d=f("x"),p=f("y");f("cumulative.enabled")&&(f("cumulative.direction"),f("cumulative.currentbin")),f("text");var h=f("orientation",p&&!d?"h":"v"),g=e["v"===h?"x":"y"];if(!g||!g.length)return void(e.visible=!1);n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],u),e["h"===h?"x":"y"]&&f("histfunc"),o(t,e,f,"h"===h?["y"]:["x"]),l(t,e,f,r,u),s(t,e,i.defaultLine,{axis:"y"}),s(t,e,i.defaultLine,{axis:"x",inherit:"y"})}},{"../../components/color":37,"../../components/errorbars/defaults":66,"../../lib":152,"../../registry":228,"../bar/style_defaults":250,"./attributes":265,"./bin_defaults":267}],272:[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.selectPoints=t("../bar/select"),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":202,"../bar/hover":241,"../bar/layout_attributes":243,"../bar/layout_defaults":244,"../bar/plot":245,"../bar/select":246,"../bar/set_positions":247,"../bar/style":249,"../scatter/colorbar":296,"./attributes":265,"./calc":269,"./defaults":271}],273:[function(t,e,r){"use strict";e.exports={percent:function(t,e){for(var r=t.length,n=100/e,a=0;ao?i=!0:e1)){var f=l.simpleMap(u.x,e.d2c,0,r.xcalendar),d=l.distinctVals(f).minDiff;i=Math.min(i,d)}}for(i===1/0&&(i=1),c=0;c");w.push(o,o,o,o,o,o,null)}(z,h[z],g[z],v[z],y[z]));e.x=b,e.y=_,e.text=w}},{"../../lib":152,"../../plots/cartesian/axes":192,"../../plots/cartesian/axis_ids":195,"./helpers":277,"fast-isnumeric":13}],281:[function(t,e,r){"use strict";var n=t("../../components/color/attributes"),a=t("../../plots/font_attributes"),i=t("../../plots/attributes"),o=t("../../lib/extend").extendFlat,l=a({editType:"calc",colorEditType:"style"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:n.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},editType:"calc"},text:{valType:"data_array",editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:o({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc"},textfont:o({},l,{}),insidetextfont:o({},l,{}),outsidetextfont:o({},l,{}),domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},y:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},editType:"calc"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"number",min:-360,max:360,dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}},{"../../components/color/attributes":36,"../../lib/extend":146,"../../plots/attributes":190,"../../plots/font_attributes":216}],282:[function(t,e,r){"use strict";function n(t,e){for(var r=[],n=0;n")}return g};var s},{"../../components/color":37,"./helpers":285,"fast-isnumeric":13,tinycolor2:19}],284:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes");e.exports=function(t,e,r,i){function o(r,i){return n.coerce(t,e,a,r,i)}var l=n.coerceFont,s=o("values");if(!Array.isArray(s)||!s.length)return void(e.visible=!1);var c=o("labels");Array.isArray(c)||(o("label0"),o("dlabel")),o("marker.line.width")&&o("marker.line.color");var u=o("marker.colors");Array.isArray(u)||(e.marker.colors=[]),o("scalegroup");var f=o("text"),d=o("textinfo",Array.isArray(f)?"text+percent":"percent");if(o("hovertext"),d&&"none"!==d){var p=o("textposition"),h=Array.isArray(p)||"auto"===p,g=h||"inside"===p,v=h||"outside"===p;if(g||v){var y=l(o,"textfont",i.font);g&&l(o,"insidetextfont",y),v&&l(o,"outsidetextfont",y)}}o("domain.x"),o("domain.y"),o("hole"),o("sort"),o("direction"),o("rotation"),o("pull")}},{"../../lib":152,"./attributes":281}],285:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)}},{"../../lib":152}],286:[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":281,"./base_plot":282,"./calc":283,"./defaults":284,"./layout_attributes":287,"./layout_defaults":288,"./plot":289,"./style":290,"./style_one":291}],287:[function(t,e,r){"use strict";e.exports={hiddenlabels:{valType:"data_array",editType:"calc"}}},{}],288:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){!function(r,i){n.coerce(t,e,a,r,i)}("hiddenlabels")}},{"../../lib":152,"./layout_attributes":287}],289:[function(t,e,r){"use strict";function n(t,e,r){var n=Math.sqrt(t.width*t.width+t.height*t.height),i=t.width/t.height,o=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=i+1/(2*Math.tan(o)),f=r.r*Math.min(1/(Math.sqrt(u*u+.5)+u),l/(Math.sqrt(i*i+l/2)+i)),d={scale:2*f/t.height,rCenter:Math.cos(f/r.r)-f*i/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},p=1/i,h=p+1/(2*Math.tan(o)),g=r.r*Math.min(1/(Math.sqrt(h*h+.5)+h),l/(Math.sqrt(p*p+l/2)+p)),v={scale:2*g/t.width,rCenter:Math.cos(g/r.r)-g/i/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},y=v.scale>d.scale?v:d;return c.scale<1&&y.scale>c.scale?y: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 i(t,e){var r=e.pxmid[0],n=e.pxmid[1],a=t.width/2,i=t.height/2;return r<0&&(a*=-1),n<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+r*r/(n*n)),outside:!0}}function o(t,e){function r(t,e){return t.pxmid[1]-e.pxmid[1]}function n(t,e){return e.pxmid[1]-t.pxmid[1]}var a,i,o,l,s,c,u,f,d,p,h,g,v;for(i=0;i<2;i++)for(o=i?r:n,s=i?Math.max:Math.min,u=i?1:-1,a=0;a<2;a++){for(l=a?Math.max:Math.min,c=a?1:-1,f=t[i][a],f.sort(o),d=t[1-i][a],p=d.concat(f),g=[],h=0;h0&&(t.labelExtraY=x),Array.isArray(e.pull))for(a=0;a=e.pull[o.i]||((t.pxmid[1]-o.pxmid[1])*u>0?(f=o.cyFinal+s(o.px0[1],o.px1[1]),(x=f-v-t.labelExtraY)*u>0&&(t.labelExtraY+=x)):(y+t.labelExtraY-m)*u>0&&(n=3*c*Math.abs(a-p.indexOf(t)),d=o.cxFinal+l(o.px0[0],o.px1[0]),(h=d+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*c>0&&(t.labelExtraX+=h)))}(g[h],y)}}}function l(t,e){var r,n,a,i,o,l,s,u,f,d,p=[];for(a=0;au&&(u=l.pull[i]);o.r=Math.min(r/c(l.tilt,Math.sin(s),l.depth),n/c(l.tilt,Math.cos(s),l.depth))/(2+2*u),o.cx=e.l+e.w*(l.domain.x[1]+l.domain.x[0])/2,o.cy=e.t+e.h*(2-l.domain.y[1]-l.domain.y[0])/2,l.scalegroup&&-1===p.indexOf(l.scalegroup)&&p.push(l.scalegroup)}for(i=0;if.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("../../components/fx"),d=t("../../components/color"),p=t("../../components/drawing"),h=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],v=c.trace,y=(v.depth||0)*c.r*Math.sin(0)/2,m=v.tiltaxis||0,x=m*Math.PI/180,b=[y*Math.sin(x),y*Math.cos(x)],_=c.r*Math.cos(0),w=l.selectAll("g.part").data(v.tilt?["top","sides"]:["top"]);w.enter().append("g").attr("class",function(t){return t+" part"}),w.exit().remove(),w.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=[[[],[]],[[],[]]],y=!1;l.each(function(e){function o(n){n.originalEvent=u.event;var i=t._fullLayout,o=t._fullData[v.index],l=f.castHoverinfo(o,i,e.i);if("all"===l&&(l="label+text+value+percent+name"),t._dragging||!1===i.hovermode||"none"===l||"skip"===l||!l)return void f.hover(t,n,"pie");var s=a(e,c),d=w+e.pxmid[0]*(1-s),p=k+e.pxmid[1]*(1-s),h=r.separators,y=[];-1!==l.indexOf("label")&&y.push(e.label),-1!==l.indexOf("text")&&(o.hovertext?y.push(Array.isArray(o.hovertext)?o.hovertext[e.i]:o.hovertext):o.text&&o.text[e.i]&&y.push(o.text[e.i])),-1!==l.indexOf("value")&&y.push(g.formatPieValue(e.v,h)),-1!==l.indexOf("percent")&&y.push(g.formatPiePercent(e.v/c.vTotal,h)),f.loneHover({x0:d-s*c.r,x1:d+s*c.r,y:p,text:y.join("
"),name:-1!==l.indexOf("name")?o.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:f.castHoverOption(v,e.i,"bgcolor")||e.color,borderColor:f.castHoverOption(v,e.i,"bordercolor"),fontFamily:f.castHoverOption(v,e.i,"font.family"),fontSize:f.castHoverOption(v,e.i,"font.size"),fontColor:f.castHoverOption(v,e.i,"font.color")},{ -container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:t}),f.hover(t,n,"pie"),T=!0}function l(e){e.originalEvent=u.event,t.emit("plotly_unhover",{event:u.event,points:[e]}),T&&(f.loneUnhover(r._hoverlayer.node()),T=!1)}function d(){t._hoverdata=[e],t._hoverdata.trace=c.trace,f.click(t,u.event)}function x(t,r,n,a){return"a"+a*c.r+","+a*_+" "+m+" "+e.largeArc+(n?" 1 ":" 0 ")+a*(r[0]-t[0])+","+a*(r[1]-t[1])}if(e.hidden)return void u.select(this).selectAll("path,g").remove();e.pointNumber=e.i,e.curveNumber=v.index,s[e.pxmid[1]<0?0:1][e.pxmid[0]<0?0:1].push(e);var w=c.cx+b[0],k=c.cy+b[1],M=u.select(this),A=M.selectAll("path.surface").data([e]),T=!1;if(A.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),M.select("path.textline").remove(),M.on("mouseover",o).on("mouseout",l).on("click",d),v.pull){var L=+(Array.isArray(v.pull)?v.pull[e.i]:v.pull)||0;L>0&&(w+=L*e.pxmid[0],k+=L*e.pxmid[1])}e.cxFinal=w,e.cyFinal=k;var C=v.hole;if(e.v===c.vTotal){var S="M"+(w+e.px0[0])+","+(k+e.px0[1])+x(e.px0,e.pxmid,!0,1)+x(e.pxmid,e.px0,!0,1)+"Z";C?A.attr("d","M"+(w+C*e.px0[0])+","+(k+C*e.px0[1])+x(e.px0,e.pxmid,!1,C)+x(e.pxmid,e.px0,!1,C)+"Z"+S):A.attr("d",S)}else{var z=x(e.px0,e.px1,!0,1);if(C){var O=1-C;A.attr("d","M"+(w+C*e.px1[0])+","+(k+C*e.px1[1])+x(e.px1,e.px0,!1,C)+"l"+O*e.px0[0]+","+O*e.px0[1]+z+"Z")}else A.attr("d","M"+w+","+k+"l"+e.px0[0]+","+e.px0[1]+z+"Z")}var D=Array.isArray(v.textposition)?v.textposition[e.i]:v.textposition,P=M.selectAll("g.slicetext").data(e.text&&"none"!==D?[0]:[]);P.enter().append("g").classed("slicetext",!0),P.exit().remove(),P.each(function(){var r=u.select(this).selectAll("text").data([0]);r.enter().append("text").attr("data-notex",1),r.exit().remove(),r.text(e.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(p.font,"outside"===D?v.outsidetextfont:v.insidetextfont).call(h.convertToTspans,t);var a,o=p.bBox(r.node());"outside"===D?a=i(o,e):(a=n(o,e,c),"auto"===D&&a.scale<1&&(r.call(p.font,v.outsidetextfont),v.outsidetextfont.family===v.insidetextfont.family&&v.outsidetextfont.size===v.insidetextfont.size||(o=p.bBox(r.node())),a=i(o,e)));var l=w+e.pxmid[0]*a.rCenter+(a.x||0),s=k+e.pxmid[1]*a.rCenter+(a.y||0);a.outside&&(e.yLabelMin=s-o.height/2,e.yLabelMid=s,e.yLabelMax=s+o.height/2,e.labelExtraX=0,e.labelExtraY=0,y=!0),r.attr("transform","translate("+l+","+s+")"+(a.scale<1?"scale("+a.scale+")":"")+(a.rotate?"rotate("+a.rotate+")":"")+"translate("+-(o.left+o.right)/2+","+-(o.top+o.bottom)/2+")")})}),y&&o(s,v),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],i="M"+n+","+a,o=(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]);Math.abs(l)>Math.abs(s)?i+="l"+s*t.pxmid[0]/t.pxmid[1]+","+s+"H"+(n+t.labelExtraX+o):i+="l"+t.labelExtraX+","+l+"v"+(s-l)+"h"+o}else i+="V"+(t.yLabelMid+t.labelExtraY)+"h"+o;e.append("path").classed("textline",!0).call(d.stroke,v.outsidetextfont.color).attr({"stroke-width":Math.min(2,v.outsidetextfont.size/8),d:i,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":37,"../../components/drawing":61,"../../components/fx":78,"../../lib/svg_text_utils":172,"./helpers":285,d3:10}],290:[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,i=n.select(this);i.style({opacity:r.opacity}),i.selectAll(".top path.surface").each(function(t){n.select(this).call(a,t,r)})})}},{"./style_one":291,d3:10}],291:[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 i=r.marker.line.width||0;Array.isArray(i)&&(i=i[e.i]||0),t.style({"stroke-width":i}).call(n.fill,e.color).call(n.stroke,a)}},{"../../components/color":37}],292:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rg&&p.splice(g,p.length-g),h.length>g&&h.splice(g,h.length-g);var v={padded:!0},y={padded:!0};if(o.hasMarkers(e)){if(r=e.marker,c=r.size,Array.isArray(c)){var m={type:"linear"};a.setConvert(m),c=m.makeCalcdata(e.marker,"size"),c.length>g&&c.splice(g,c.length-g)}var x,b=1.6*(e.marker.sizeref||1);x="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/b),3)}:function(t){return Math.max((t||0)/b,3)},v.ppad=y.ppad=Array.isArray(c)?c.map(x):x(c)}l(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||p[0]===p[g-1]&&h[0]===h[g-1]?e.error_y.visible||-1===["tonexty","tozeroy"].indexOf(e.fill)&&(o.hasMarkers(e)||o.hasText(e))||(v.padded=!1,v.ppad=0):v.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||p[0]===p[g-1]&&h[0]===h[g-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(y.padded=!1):y.tozero=!0,a.expand(f,p,v),a.expand(d,h,y);var _=new Array(g);for(u=0;u=0;a--){var i=t[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],296:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../plots/plots"),o=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 i.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 p=e[0].t.cb=l(t,c),h=o.makeColorScaleFunc(o.extractScale(s.colorscale,f,d),{noNumericCheck:!0});p.fillcolor(h).filllevels({start:f,end:d,size:(d-f)/254}).options(s.colorbar)()}},{"../../components/colorbar/draw":40,"../../components/colorscale":51,"../../lib":152,"../../plots/plots":221,"fast-isnumeric":13}],297:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/calc"),i=t("./subtypes");e.exports=function(t){i.hasLines(t)&&n(t,"line")&&a(t,t.line.color,"line","c"),i.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":43,"../../components/colorscale/has_colorscale":50,"./subtypes":314}],298:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20}},{}],299:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("./constants"),o=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"),p=t("../../components/errorbars/defaults");e.exports=function(t,e,r,h){function g(r,i){return n.coerce(t,e,a,r,i)}var v=l(t,e,h,g),y=vV!=I>=V&&(D=z[C-1][0],P=z[C][0],O=D+(P-D)*(V-E)/(I-E),j=Math.min(j,O),B=Math.max(B,O));j=Math.max(j,0),B=Math.min(B,p._length);var U=l.defaultLine;return l.opacity(d.fillcolor)?U=d.fillcolor:l.opacity((d.line||{}).color)&&(U=d.line.color),n.extendFlat(t,{distance:c+10,x0:j,x1:B,y0:V,y1:V,color:U}),delete t.index,d.text&&!Array.isArray(d.text)?t.text=String(d.text):t.text=d.name,[t]}}}},{"../../components/color":37,"../../components/errorbars":67,"../../components/fx":78,"../../lib":152,"./fill_hover_text":300,"./get_trace_color":302}],304:[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","scatter-like"],n.meta={},e.exports=n},{"../../plots/cartesian":202,"./arrays_to_calcdata":292,"./attributes":293,"./calc":294,"./clean_data":295,"./colorbar":296,"./defaults":299,"./hover":303,"./plot":311,"./select":312,"./style":313,"./subtypes":314}],305:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,i,o,l){var s=(t.marker||{}).color;if(o("line.color",r),n(t,"line"))a(t,e,i,o,{prefix:"line.",cLetter:"c"});else{o("line.color",!Array.isArray(s)&&s||r)}o("line.width"),(l||{}).noDash||o("line.dash")}},{"../../components/colorscale/defaults":46,"../../components/colorscale/has_colorscale":50}],306:[function(t,e,r){"use strict";var n=t("../../constants/numerical").BADNUM,a=t("../../lib"),i=a.segmentsIntersect,o=a.constrain,l=t("./constants");e.exports=function(t,e){function r(e){var r=I.c2p(t[e].x),a=N.c2p(t[e].y);return r!==n&&a!==n&&[r,a]}function s(t){var e=t[0]/I._length,r=t[1]/N._length;return(1+l.toleranceGrowth*Math.max(0,-e,e-1,-r,r-1))*j}function c(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function u(t,e){for(var r=[],n=0,a=0;a<4;a++){var o=at[a],l=i(t[0],t[1],e[0],e[1],o[0],o[1],o[2],o[3]);l&&(!n||Math.abs(l.x-r[0][0])>1||Math.abs(l.y-r[0][1])>1)&&(l=[l.x,l.y],n&&c(l,t)et||t[1]nt)return[o(t[0],tt,et),o(t[1],rt,nt)]}function d(t,e){return t[0]===e[0]&&(t[0]===tt||t[0]===et)||(t[1]===e[1]&&(t[1]===rt||t[1]===nt)||void 0)}function p(t,e){var r=[],n=f(t),a=f(e);return n&&a&&d(n,a)?r:(n&&r.push(n),a&&r.push(a),r)}function h(t,e,r){return function(n,i){var o=f(n),l=f(i),s=[];if(o&&l&&d(o,l))return s;o&&s.push(o),l&&s.push(l);var c=2*a.constrain((n[t]+i[t])/2,e,r)-((o||n)[t]+(l||i)[t]);if(c){var u;u=o&&l?c>0==o[t]>l[t]?o:l:o||l,u[t]+=c}return s}}function g(t,e){var r=e[0]-t[0],n=(e[1]-t[1])/r;return(t[1]*e[0]-e[1]*t[0])/r>0?[n>0?tt:et,nt]:[n>0?et:tt,rt]}function v(t){var e=t[0],r=t[1],n=e===U[G-1][0],a=r===U[G-1][1];if(!n||!a)if(G>1){var i=e===U[G-2][0],o=r===U[G-2][1];n&&(e===tt||e===et)&&i?o?G--:U[G-1]=t:a&&(r===rt||r===nt)&&o?i?G--:U[G-1]=t:U[G++]=t}else U[G++]=t}function y(t){U[G-1][0]!==t[0]&&U[G-1][1]!==t[1]&&v([Z,W]),v(t),Q=null,Z=W=0}function m(t){if(X=t[0]et?et:0,Y=t[1]nt?nt:0,X||Y){if(G)if(Q){var e=J(Q,t);e.length>1&&(y(e[0]),U[G++]=e[1])}else $=J(U[G-1],t)[0],U[G++]=$;else U[G++]=[X||t[0],Y||t[1]];var r=U[G-1];X&&Y&&(r[0]!==X||r[1]!==Y)?(Q&&(Z!==X&&W!==Y?v(Z&&W?g(Q,t):[Z||X,W||Y]):Z&&W&&v([Z,W])),v([X,Y])):Z-X&&W-Y&&v([X||Z,Y||W]),Q=t,Z=X,W=Y}else Q&&y(J(Q,t)[0]),U[G++]=t}var x,b,_,w,k,M,A,T,L,C,S,z,O,D,P,E,I=e.xaxis,N=e.yaxis,R=e.simplify,F=e.connectGaps,j=e.baseTolerance,B=e.shape,q="linear"===B,H=[],V=l.minTolerance,U=new Array(t.length),G=0;R||(j=V=-1);var X,Y,Z,W,Q,$,J,K=l.maxScreensAway,tt=-I._length*K,et=I._length*(1+K),rt=-N._length*K,nt=N._length*(1+K),at=[[tt,rt,et,rt],[et,rt,et,nt],[et,nt,tt,nt],[tt,nt,tt,rt]];for("linear"===B||"spline"===B?J=u:"hv"===B||"vh"===B?J=p:"hvh"===B?J=h(0,tt,et):"vhv"===B&&(J=h(1,rt,nt)),x=0;xs(M))break;_=M,O=L[0]*T[0]+L[1]*T[1],O>S?(S=O,w=M,A=!1):O=t.length||!M)break;m(M),b=M}}else m(w)}Q&&v([Z||Q[0],W||Q[1]]),H.push(U.slice(0,G))}return H}},{"../../constants/numerical":136,"../../lib":152,"./constants":298}],307:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],308:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n,a,i=null,o=0;o0?Math.max(e,a):0}}},{"fast-isnumeric":13}],310:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,l,s,c){var u,f=o.isBubble(t),d=(t.line||{}).color;if(c=c||{},d&&(r=d),s("marker.symbol"),s("marker.opacity",f?.7:1),s("marker.size"),s("marker.color",r),a(t,"marker")&&i(t,e,l,s,{prefix:"marker.",cLetter:"c"}),c.noLine||(u=d&&!Array.isArray(d)&&e.marker.color!==d?d:f?n.background:n.defaultLine,s("marker.line.color",u),a(t,"marker.line")&&i(t,e,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",f?1:0)),f&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient){"none"!==s("marker.gradient.type")&&s("marker.gradient.color")}}},{"../../components/color":37,"../../components/colorscale/defaults":46,"../../components/colorscale/has_colorscale":50,"./subtypes":314}],311:[function(t,e,r){"use strict";function n(t,e,r){var n;e.selectAll("g.trace").each(function(t){var e=o.select(this);if(n=t[0].trace,n._nexttrace){if(n._nextFill=e.select(".js-fill.js-tonext"),!n._nextFill.size()){var a=":first-child";e.select(".js-fill.js-tozero").size()&&(a+=" + *"),n._nextFill=e.insert("path",a).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),n._nextFill=null;n.fill&&("tozero"===n.fill.substr(0,6)||"toself"===n.fill||"to"===n.fill.substr(0,2)&&!n._prevtrace)?(n._ownFill=e.select(".js-fill.js-tozero"),n._ownFill.size()||(n._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),n._ownFill=null),e.selectAll(".js-fill").call(s.setClipUrl,r.layerClipId)})}function a(t,e,r,n,a,d,h){function g(t){return k?t.transition():t}function v(t){return t.filter(function(t){return t.vis})}function y(t){return t.id}function m(t){if(t.ids)return y}function x(){return!1}function b(e){var n,a,i,c=e[0].trace,f=o.select(this),d=u.hasMarkers(c),p=u.hasText(c),h=m(c),y=x,b=x;d&&(y=c.marker.maxdisplayed||c._needsCull?v:l.identity),p&&(b=c.marker.maxdisplayed||c._needsCull?v:l.identity),a=f.selectAll("path.point"),n=a.data(y,h);var _=n.enter().append("path").classed("point",!0);k&&_.call(s.pointStyle,c,t).call(s.translatePoints,M,A).style("opacity",0).transition().style("opacity",1);var w=d&&s.tryColorscale(c.marker,""),T=d&&s.tryColorscale(c.marker,"line");n.order(),n.each(function(e){var n=o.select(this),a=g(n);i=s.translatePoint(e,a,M,A),i?(s.singlePointStyle(e,a,c,w,T,t),r.layerClipId&&s.hideOutsideRangePoint(e,a,M,A),c.customdata&&n.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()}),k?n.exit().transition().style("opacity",0).remove():n.exit().remove(),a=f.selectAll("g"),n=a.data(b,h),n.enter().append("g").classed("textpoint",!0).append("text"),n.order(),n.each(function(t){var e=o.select(this),n=g(e.select("text"));i=s.translatePoint(t,n,M,A),i?r.layerClipId&&s.hideOutsideRangePoint(t,e,M,A):e.remove()}),n.selectAll("text").call(s.textPointStyle,c,t).each(function(t){var e=M.c2p(t.x),r=A.c2p(t.y);o.select(this).selectAll("tspan.line").each(function(){g(o.select(this)).attr({x:e,y:r})})}),n.exit().remove()}var _,w;i(t,e,r,n,a);var k=!!h&&h.duration>0,M=r.xaxis,A=r.yaxis,T=n[0].trace,L=T.line,C=o.select(d);if(C.call(c.plot,r,h),!0===T.visible){g(C).style("opacity",T.opacity);var S,z,O=T.fill.charAt(T.fill.length-1);"x"!==O&&"y"!==O&&(O=""),n[0].node3=C;var D="",P=[],E=T._prevtrace;E&&(D=E._prevRevpath||"",z=E._nextFill,P=E._polygons);var I,N,R,F,j,B,q,H,V,U="",G="",X=[],Y=l.noop;if(S=T._ownFill,u.hasLines(T)||"none"!==T.fill){for(z&&z.datum(n),-1!==["hv","vh","hvh","vhv"].indexOf(L.shape)?(R=s.steps(L.shape),F=s.steps(L.shape.split("").reverse().join(""))):R=F="spline"===L.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?s.smoothclosed(t.slice(1),L.smoothing):s.smoothopen(t,L.smoothing)}:function(t){return"M"+t.join("L")},j=function(t){return F(t.reverse())},X=f(n,{xaxis:M,yaxis:A,connectGaps:T.connectgaps,baseTolerance:Math.max(L.width||1,3)/4,shape:L.shape,simplify:L.simplify}),V=T._polygons=new Array(X.length),w=0;w1){var r=o.select(this);if(r.datum(n),t)g(r.style("opacity",0).attr("d",I).call(s.lineGroupStyle)).style("opacity",1);else{var a=g(r);a.attr("d",I),s.singleLineStyle(n,a)}}}}}var Z=C.selectAll(".js-line").data(X);g(Z.exit()).style("opacity",0).remove(),Z.each(Y(!1)),Z.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(Y(!0)),s.setClipUrl(Z,r.layerClipId),X.length&&(S?B&&H&&(O?("y"===O?B[1]=H[1]=A.c2p(0,!0):"x"===O&&(B[0]=H[0]=M.c2p(0,!0)),g(S).attr("d","M"+H+"L"+B+"L"+U.substr(1)).call(s.singleFillStyle)):g(S).attr("d",U+"Z").call(s.singleFillStyle)):"tonext"===T.fill.substr(0,6)&&U&&D&&("tonext"===T.fill?g(z).attr("d",U+"Z"+D+"Z").call(s.singleFillStyle):g(z).attr("d",U+"L"+D.substr(1)+"Z").call(s.singleFillStyle),T._polygons=T._polygons.concat(P)),T._prevRevpath=G,T._prevPolygons=V);var W=C.selectAll(".points");_=W.data([n]),W.each(b),_.enter().append("g").classed("points",!0).each(b),_.exit().remove(),_.each(function(t){var e=!1===t[0].trace.cliponaxis;s.setClipUrl(o.select(this),e?null:r.layerClipId)})}}function i(t,e,r,n,a){var i=r.xaxis,s=r.yaxis,c=o.extent(l.simpleMap(i.range,i.r2c)),f=o.extent(l.simpleMap(s.range,s.r2c)),d=n[0].trace;if(u.hasMarkers(d)){var p=d.marker.maxdisplayed;if(0!==p){var h=n.filter(function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=f[0]&&t.y<=f[1]}),g=Math.ceil(h.length/p),v=0;a.forEach(function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;for(u=h.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),d(t,e,r),n(t,h,e),s=0,c={};sc[e[0].trace.uid]?1:-1}),v){l&&(p=l());o.transition().duration(i.duration).ease(i.easing).each("end",function(){p&&p()}).each("interrupt",function(){p&&p()}).each(function(){h.selectAll("g.trace").each(function(n,o){a(t,o,e,n,r,this,i)})})}else h.selectAll("g.trace").each(function(n,o){a(t,o,e,n,r,this,i)});g&&f.exit().remove(),h.selectAll("path:not([d])").remove()}},{"../../components/drawing":61,"../../components/errorbars":67,"../../lib":152,"../../lib/polygon":163,"./line_points":306,"./link_traces":308,"./subtypes":314,d3:10}],312:[function(t,e,r){"use strict";var n=t("./subtypes"),a=t("../../constants/interactions").DESELECTDIM;e.exports=function(t,e){var r,i,o,l,s=t.cd,c=t.xaxis,u=t.yaxis,f=[],d=s[0].trace,p=d.marker,h=!n.hasMarkers(d)&&!n.hasText(d);if(!0!==d.visible||h)return[];var g=Array.isArray(p.opacity)?1:p.opacity;if(!1===e)for(r=0;r")?"":e.html(t).text()});return e.remove(),r}function a(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}var i=t("d3"),o=t("../lib"),l=t("../components/drawing"),s=t("../components/color"),c=t("../constants/xmlns_namespaces"),u=/"/g,f=new RegExp('("TOBESTRIPPED)|(TOBESTRIPPED")',"g");e.exports=function(t,e,r){var d,p=t._fullLayout,h=p._paper,g=p._toppaper,v=p.width,y=p.height;h.insert("rect",":first-child").call(l.setRect,0,0,v,y).call(s.fill,p.paper_bgcolor);var m=p._basePlotModules||[];for(d=0;d0&&A>0,j=k<=N&&A<=R,B=k<=R&&A<=N,q="h"===y?N>=k*(R/A):R>=A*(N/k);F&&(j||B||q)?x="inside":(x="outside",b.remove(),b=null)}else x="inside";if(!b&&(b=g(e,m,"outside"===x?C:L),_=M.bBox(b.node()),k=_.width,A=_.height,k<=0||A<=0))return void b.remove();var H,V;"outside"===x?(V="both"===v.constraintext||"outside"===v.constraintext,H=i(o,d,p,h,_,y,V)):(V="both"===v.constraintext||"inside"===v.constraintext,H=a(o,d,p,h,_,y,V)),b.attr("transform",H)}}}function a(t,e,r,n,a,i,l){var s,c,u,f,d,p=a.width,h=a.height,g=(a.left+a.right)/2,v=(a.top+a.bottom)/2,y=Math.abs(e-t),m=Math.abs(n-r);y>2*D&&m>2*D?(d=D,y-=2*d,m-=2*d):d=0;var x,b;return p<=y&&h<=m?(x=!1,b=1):p<=m&&h<=y?(x=!0,b=1):pr?(u=(t+e)/2,f=n-d-c/2):(u=(t+e)/2,f=n+d+c/2),o(g,v,u,f,b,x)}function i(t,e,r,n,a,i,l){var s,c="h"===i?Math.abs(n-r):Math.abs(e-t);c>2*D&&(s=D);var u=1;l&&(u="h"===i?Math.min(1,c/a.height):Math.min(1,c/a.width));var f,d,p,h,g=(a.left+a.right)/2,v=(a.top+a.bottom)/2;return f=u*a.width,d=u*a.height,"h"===i?er?(p=(t+e)/2,h=n+s+d/2):(p=(t+e)/2,h=n-s-d/2),o(g,v,p,h,u,!1)}function o(t,e,r,n,a,i){var o,l;return a<1?o="scale("+a+") ":(a=1,o=""),l=i?"rotate("+i+" "+t+" "+e+") ":"","translate("+(r-a*t)+" "+(n-a*e)+")"+o+l}function l(t,e){var r=p(t.text,e);return h(L,r)}function s(t,e){var r=p(t.textposition,e);return g(C,r)}function c(t,e,r){return d(S,t.textfont,e,r)}function u(t,e,r){return d(z,t.insidetextfont,e,r)}function f(t,e,r){return d(O,t.outsidetextfont,e,r)}function d(t,e,r,n){e=e||{};var a=p(e.family,r),i=p(e.size,r),o=p(e.color,r);return{family:h(t.family,a,n.family),size:v(t.size,i,n.size),color:y(t.color,o,n.color)}}function p(t,e){var r;return Array.isArray(t)?ea))return e}return void 0!==r?r:t.dflt}function y(t,e,r){return b(e).isValid()?e:void 0!==r?r:t.dflt}var m=t("d3"),x=t("fast-isnumeric"),b=t("tinycolor2"),_=t("../../lib"),w=t("../../lib/svg_text_utils"),k=t("../../components/color"),M=t("../../components/drawing"),A=t("../../components/errorbars"),T=t("./attributes"),L=T.text,C=T.textposition,S=T.textfont,z=T.insidetextfont,O=T.outsidetextfont,D=3;e.exports=function(t,e,r){var a=e.xaxis,i=e.yaxis,o=t._fullLayout,l=e.plot.select(".barlayer").selectAll("g.trace.bars").data(r);l.enter().append("g").attr("class","trace bars"),l.append("g").attr("class","points").each(function(e){var r=e[0].node3=m.select(this),l=e[0].t,s=e[0].trace,c=l.poffset,u=Array.isArray(c);r.selectAll("g.point").data(_.identity).enter().append("g").classed("point",!0).each(function(r,l){function f(t){return 0===o.bargap&&0===o.bargroupgap?m.round(Math.round(t)-A,2):t}function d(t,e){return Math.abs(t-e)>=2?f(t):t>e?Math.ceil(t):Math.floor(t)}var p,h,g,v,y=r.p+(u?c[l]:c),b=y+r.w,_=r.b,w=_+r.s;if("h"===s.orientation?(g=i.c2p(y,!0),v=i.c2p(b,!0),p=a.c2p(_,!0),h=a.c2p(w,!0),r.ct=[h,(g+v)/2]):(p=a.c2p(y,!0),h=a.c2p(b,!0),g=i.c2p(_,!0),v=i.c2p(w,!0),r.ct=[(p+h)/2,v]),!(x(p)&&x(h)&&x(g)&&x(v)&&p!==h&&g!==v))return void m.select(this).remove();var M=(r.mlw+1||s.marker.line.width+1||(r.trace?r.trace.marker.line.width:0)+1)-1,A=m.round(M/2%1,2);if(!t._context.staticPlot){var T=k.opacity(r.mc||s.marker.color),L=T<1||M>.01?f:d;p=L(p,h),h=L(h,p),g=L(g,v),v=L(v,g)}var C=m.select(this);C.append("path").style("vector-effect","non-scaling-stroke").attr("d","M"+p+","+g+"V"+v+"H"+h+"V"+g+"Z"),n(t,C,e,l,p,h,g,v)})}),l.call(A.plot,e)}},{"../../components/color":37,"../../components/drawing":61,"../../components/errorbars":67,"../../lib":152,"../../lib/svg_text_utils":172,"./attributes":238,d3:10,"fast-isnumeric":13,tinycolor2:19}],246:[function(t,e,r){"use strict";var n=t("../../constants/interactions").DESELECTDIM;e.exports=function(t,e){var r,a=t.cd,i=[],o=a[0].node3;if(!1===e)for(r=0;rc+l||!m(s))&&(f=!0,d(u,t))}for(var a=r.traces,i=y(e),o="fraction"===t._fullLayout.barnorm?1:100,l=o/1e9,s=e.l2c(e.c2l(0)),c="stack"===t._fullLayout.barmode?o:s,u=[s,c],f=!1,p=0;p1||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,o=r.line,l=i.tryColorscale(r,""),s=i.tryColorscale(r,"line");n.select(this).selectAll("path").each(function(t){var e,i,c=(t.mlw+1||o.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&&(i="mlc"in t?t.mlcc=s(t.mlc):Array.isArray(o.color)?a.defaultLine:o.color,u.call(a.stroke,i))})}),e.call(o.style)}},{"../../components/color":37,"../../components/drawing":61,"../../components/errorbars":67,d3:10}],250:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,l){r("marker.color",o),a(t,"marker")&&i(t,e,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(t,"marker.line")&&i(t,e,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width")}},{"../../components/color":37,"../../components/colorscale/defaults":46,"../../components/colorscale/has_colorscale":50}],251:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../../components/color/attributes"),i=t("../../lib/extend").extendFlat,o=n.marker,l=o.line;e.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},name:{valType:"string",editType:"calc+clearAxisTypes"},whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calcIfAutorange"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers",editType:"calcIfAutorange"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1,editType:"calcIfAutorange"},jitter:{valType:"number",min:0,max:1,editType:"calcIfAutorange"},pointpos:{valType:"number",min:-2,max:2,editType:"calcIfAutorange"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:i({},o.symbol,{arrayOk:!1,editType:"plot"}),opacity:i({},o.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:i({},o.size,{arrayOk:!1,editType:"calcIfAutorange"}),color:i({},o.color,{arrayOk:!1,editType:"style"}),line:{color:i({},l.color,{arrayOk:!1,dflt:a.defaultLine,editType:"style"}),width:i({},l.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor}},{"../../components/color/attributes":36,"../../lib/extend":146,"../scatter/attributes":293}],252:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../plots/cartesian/axes");e.exports=function(t,e){var r,o,l,s,c,u,f,d,p,h=i.getFromId(t,e.xaxis||"x"),g=i.getFromId(t,e.yaxis||"y"),v=e.orientation,y=[];"h"===v?(r=h,o="x",c=g,u="y"):(r=g,o="y",c=h,u="x"),l=r.makeCalcdata(e,o),i.expand(r,l,{padded:!0}),f=function(t,e,r,i,o){var l;return r in e?f=i.makeCalcdata(e,r):(l=r+"0"in e?e[r+"0"]:"name"in e&&("category"===i.type||n(e.name)&&-1!==["linear","log"].indexOf(i.type)||a.isDateTime(e.name)&&"date"===i.type)?e.name:t.numboxes,l=i.d2c(l,0,e[r+"calendar"]),f=o.map(function(){return l})),f}(t,e,u,c,l);var m=a.distinctVals(f);return d=m.vals,p=m.minDiff/2,s=function(t,e,r,i,o){var l,s,c,u,f=i.length,d=e.length,p=[],h=[];for(l=0;l=0&&c1,g=r.dPos*(1-u.boxgap)*(1-u.boxgroupgap)/(h?t.numboxes:1),v=h?2*r.dPos*((r.boxnum+.5)/t.numboxes-.5)*(1-u.boxgap):0,y=g*p.whiskerwidth;if(!0!==p.visible||r.emptybox)return void i.select(this).remove();"h"===p.orientation?(s=d,c=f):(s=f,c=d),r.bPos=v,r.bdPos=g,n(),i.select(this).selectAll("path.box").data(o.identity).enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","box").each(function(t){var e=s.c2p(t.pos+v,!0),r=s.c2p(t.pos+v-g,!0),n=s.c2p(t.pos+v+g,!0),a=s.c2p(t.pos+v-y,!0),l=s.c2p(t.pos+v+y,!0),u=c.c2p(t.q1,!0),f=c.c2p(t.q3,!0),d=o.constrain(c.c2p(t.med,!0),Math.min(u,f)+1,Math.max(u,f)-1),h=c.c2p(!1===p.boxpoints?t.min:t.lf,!0),m=c.c2p(!1===p.boxpoints?t.max:t.uf,!0);"h"===p.orientation?i.select(this).attr("d","M"+d+","+r+"V"+n+"M"+u+","+r+"V"+n+"H"+f+"V"+r+"ZM"+u+","+e+"H"+h+"M"+f+","+e+"H"+m+(0===p.whiskerwidth?"":"M"+h+","+a+"V"+l+"M"+m+","+a+"V"+l)):i.select(this).attr("d","M"+r+","+d+"H"+n+"M"+r+","+u+"H"+n+"V"+f+"H"+r+"ZM"+e+","+u+"V"+h+"M"+e+","+f+"V"+m+(0===p.whiskerwidth?"":"M"+a+","+h+"H"+l+"M"+a+","+m+"H"+l))}),p.boxpoints&&i.select(this).selectAll("g.points").data(function(t){return t.forEach(function(t){t.t=r,t.trace=p}),t}).enter().append("g").attr("class","points").selectAll("path").data(function(t){var e,r,n,i,l,s,c,u="all"===p.boxpoints?t.val:t.val.filter(function(e){return et.uf}),f=Math.max((t.max-t.min)/10,t.q3-t.q1),d=1e-9*f,h=.01*f,y=[],m=0;if(p.jitter){if(0===f)for(m=1,y=new Array(u.length),e=0;et.lo&&(n.so=!0),n})}).enter().append("path").classed("point",!0).call(l.translatePoints,f,d),p.boxmean&&i.select(this).selectAll("path.mean").data(o.identity).enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}).each(function(t){var e=s.c2p(t.pos+v,!0),r=s.c2p(t.pos+v-g,!0),n=s.c2p(t.pos+v+g,!0),a=c.c2p(t.mean,!0),o=c.c2p(t.mean-t.sd,!0),l=c.c2p(t.mean+t.sd,!0);"h"===p.orientation?i.select(this).attr("d","M"+a+","+r+"V"+n+("sd"!==p.boxmean?"":"m0,0L"+o+","+e+"L"+a+","+r+"L"+l+","+e+"Z")):i.select(this).attr("d","M"+r+","+a+"H"+n+("sd"!==p.boxmean?"":"m0,0L"+e+","+o+"L"+r+","+a+"L"+e+","+l+"Z"))})})}},{"../../components/drawing":61,"../../lib":152,d3:10}],259:[function(t,e,r){ +"use strict";var n=t("../../registry"),a=t("../../plots/cartesian/axes"),i=t("../../lib");e.exports=function(t,e){var r,o,l,s,c=t._fullLayout,u=e.xaxis,f=e.yaxis,d=["v","h"];for(o=0;oi){var o=i-r[t];return r[t]=i,o}}return 0},max:function(t,e,r,a){var i=a[e];if(n(i)){if(i=Number(i),!n(r[t]))return r[t]=i,i;if(r[t]p.size/1.9?p.size:p.size/Math.ceil(p.size/x);var A=p.start+(p.size-x)/2;b=A-x*Math.ceil((A-b)/x)}for(s=0;s=0;i--)a(i);else if("increasing"===e){for(i=1;i=0;i--)t[i]+=t[i+1];"exclude"===r&&(t.push(0),t.shift())}}var c=t("fast-isnumeric"),u=t("../../lib"),f=t("../../plots/cartesian/axes"),d=t("../bar/arrays_to_calcdata"),p=t("./bin_functions"),h=t("./norm_functions"),g=t("./average"),v=t("./clean_bins"),y=t("../../constants/numerical").ONEAVGMONTH;e.exports=function(t,e){if(!0===e.visible){var r,a=[],i=[],o=f.getFromId(t,"h"===e.orientation?e.yaxis||"y":e.xaxis||"x"),l="h"===e.orientation?"y":"x",y={x:"y",y:"x"}[l],m=e[l+"calendar"],x=e.cumulative;v(e,o,l);var b,_,w,k=n(t,e,o,l),M=k[0],A=k[1],T="string"==typeof M.size,L=T?[]:M,C=[],S=[],z=0,O=e.histnorm,D=e.histfunc,P=-1!==O.indexOf("density");x.enabled&&P&&(O=O.replace(/ ?density$/,""),P=!1);var E,I="max"===D||"min"===D,N=I?null:0,R=p.count,F=h[O],j=!1,B=function(t){return o.r2c(t,0,m)};for(Array.isArray(e[y])&&"count"!==D&&(E=e[y],j="avg"===D,R=p[D]),r=B(M.start),_=B(M.end)+(r-f.tickIncrement(r,M.size,!1,m))/1e6;r<_&&a.length<1e6&&(b=f.tickIncrement(r,M.size,!1,m),a.push((r+b)/2),i.push(N),T&&L.push(r),P&&C.push(1/(b-r)),j&&S.push(0),!(b<=r));)r=b;T||"date"!==o.type||(L={start:B(L.start),end:B(L.end),size:L.size});var q=i.length;for(r=0;r=0&&w=U;r--)if(i[r]){G=r;break}for(r=U;r<=G;r++)c(a[r])&&c(i[r])&&V.push({p:a[r],s:i[r],b:0});return 1===V.length&&(V[0].width1=f.tickIncrement(V[0].p,M.size,!1,m)-V[0].p),d(V,e),V}}},{"../../constants/numerical":136,"../../lib":152,"../../plots/cartesian/axes":192,"../bar/arrays_to_calcdata":237,"./average":266,"./bin_functions":268,"./clean_bins":270,"./norm_functions":273,"fast-isnumeric":13}],270:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib").cleanDate,i=t("../../constants/numerical"),o=i.ONEDAY,l=i.BADNUM;e.exports=function(t,e,r){var i=e.type,s=r+"bins",c=t[s];c||(c=t[s]={});var u="date"===i?function(t){return t||0===t?a(t,l,c.calendar):null}:function(t){return n(t)?Number(t):null};c.start=u(c.start),c.end=u(c.end);var f="date"===i?o:1,d=c.size;if(n(d))c.size=d>0?Number(d):f;else if("string"!=typeof d)c.size=f;else{var p=d.charAt(0),h=d.substr(1);h=n(h)?Number(h):0,(h<=0||"date"!==i||"M"!==p||h!==Math.round(h))&&(c.size=f)}var g="autobin"+r;"boolean"!=typeof t[g]&&(t[g]=!((c.start||0===c.start)&&(c.end||0===c.end))),t[g]||delete t["nbins"+r]}},{"../../constants/numerical":136,"../../lib":152,"fast-isnumeric":13}],271:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("../../components/color"),o=t("./bin_defaults"),l=t("../bar/style_defaults"),s=t("../../components/errorbars/defaults"),c=t("./attributes");e.exports=function(t,e,r,u){function f(r,n){return a.coerce(t,e,c,r,n)}var d=f("x"),p=f("y");f("cumulative.enabled")&&(f("cumulative.direction"),f("cumulative.currentbin")),f("text");var h=f("orientation",p&&!d?"h":"v"),g=e["v"===h?"x":"y"];if(!g||!g.length)return void(e.visible=!1);n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],u),e["h"===h?"x":"y"]&&f("histfunc"),o(t,e,f,"h"===h?["y"]:["x"]),l(t,e,f,r,u),s(t,e,i.defaultLine,{axis:"y"}),s(t,e,i.defaultLine,{axis:"x",inherit:"y"})}},{"../../components/color":37,"../../components/errorbars/defaults":66,"../../lib":152,"../../registry":228,"../bar/style_defaults":250,"./attributes":265,"./bin_defaults":267}],272:[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.selectPoints=t("../bar/select"),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":202,"../bar/hover":241,"../bar/layout_attributes":243,"../bar/layout_defaults":244,"../bar/plot":245,"../bar/select":246,"../bar/set_positions":247,"../bar/style":249,"../scatter/colorbar":296,"./attributes":265,"./calc":269,"./defaults":271}],273:[function(t,e,r){"use strict";e.exports={percent:function(t,e){for(var r=t.length,n=100/e,a=0;ao?i=!0:e1)){var f=l.simpleMap(u.x,e.d2c,0,r.xcalendar),d=l.distinctVals(f).minDiff;i=Math.min(i,d)}}for(i===1/0&&(i=1),c=0;c");w.push(o,o,o,o,o,o,null)}(z,h[z],g[z],v[z],y[z]));e.x=b,e.y=_,e.text=w}},{"../../lib":152,"../../plots/cartesian/axes":192,"../../plots/cartesian/axis_ids":195,"./helpers":277,"fast-isnumeric":13}],281:[function(t,e,r){"use strict";var n=t("../../components/color/attributes"),a=t("../../plots/font_attributes"),i=t("../../plots/attributes"),o=t("../../lib/extend").extendFlat,l=a({editType:"calc",colorEditType:"style"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:n.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},editType:"calc"},text:{valType:"data_array",editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:o({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc"},textfont:o({},l,{}),insidetextfont:o({},l,{}),outsidetextfont:o({},l,{}),domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},y:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},editType:"calc"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"number",min:-360,max:360,dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}},{"../../components/color/attributes":36,"../../lib/extend":146,"../../plots/attributes":190,"../../plots/font_attributes":216}],282:[function(t,e,r){"use strict";function n(t,e){for(var r=[],n=0;n")}return g};var s},{"../../components/color":37,"./helpers":285,"fast-isnumeric":13,tinycolor2:19}],284:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes");e.exports=function(t,e,r,i){function o(r,i){return n.coerce(t,e,a,r,i)}var l=n.coerceFont,s=o("values");if(!Array.isArray(s)||!s.length)return void(e.visible=!1);var c=o("labels");Array.isArray(c)||(o("label0"),o("dlabel")),o("marker.line.width")&&o("marker.line.color");var u=o("marker.colors");Array.isArray(u)||(e.marker.colors=[]),o("scalegroup");var f=o("text"),d=o("textinfo",Array.isArray(f)?"text+percent":"percent");if(o("hovertext"),d&&"none"!==d){var p=o("textposition"),h=Array.isArray(p)||"auto"===p,g=h||"inside"===p,v=h||"outside"===p;if(g||v){var y=l(o,"textfont",i.font);g&&l(o,"insidetextfont",y),v&&l(o,"outsidetextfont",y)}}o("domain.x"),o("domain.y"),o("hole"),o("sort"),o("direction"),o("rotation"),o("pull")}},{"../../lib":152,"./attributes":281}],285:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)}},{"../../lib":152}],286:[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":281,"./base_plot":282,"./calc":283,"./defaults":284,"./layout_attributes":287,"./layout_defaults":288,"./plot":289,"./style":290,"./style_one":291}],287:[function(t,e,r){"use strict";e.exports={hiddenlabels:{valType:"data_array",editType:"calc"}}},{}],288:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){!function(r,i){n.coerce(t,e,a,r,i)}("hiddenlabels")}},{"../../lib":152,"./layout_attributes":287}],289:[function(t,e,r){"use strict";function n(t,e,r){var n=Math.sqrt(t.width*t.width+t.height*t.height),i=t.width/t.height,o=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=i+1/(2*Math.tan(o)),f=r.r*Math.min(1/(Math.sqrt(u*u+.5)+u),l/(Math.sqrt(i*i+l/2)+i)),d={scale:2*f/t.height,rCenter:Math.cos(f/r.r)-f*i/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},p=1/i,h=p+1/(2*Math.tan(o)),g=r.r*Math.min(1/(Math.sqrt(h*h+.5)+h),l/(Math.sqrt(p*p+l/2)+p)),v={scale:2*g/t.width,rCenter:Math.cos(g/r.r)-g/i/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},y=v.scale>d.scale?v:d;return c.scale<1&&y.scale>c.scale?y: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 i(t,e){var r=e.pxmid[0],n=e.pxmid[1],a=t.width/2,i=t.height/2;return r<0&&(a*=-1),n<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+r*r/(n*n)),outside:!0}}function o(t,e){function r(t,e){return t.pxmid[1]-e.pxmid[1]}function n(t,e){return e.pxmid[1]-t.pxmid[1]}var a,i,o,l,s,c,u,f,d,p,h,g,v;for(i=0;i<2;i++)for(o=i?r:n,s=i?Math.max:Math.min,u=i?1:-1,a=0;a<2;a++){for(l=a?Math.max:Math.min,c=a?1:-1,f=t[i][a],f.sort(o),d=t[1-i][a],p=d.concat(f),g=[],h=0;h0&&(t.labelExtraY=x),Array.isArray(e.pull))for(a=0;a=e.pull[o.i]||((t.pxmid[1]-o.pxmid[1])*u>0?(f=o.cyFinal+s(o.px0[1],o.px1[1]),(x=f-v-t.labelExtraY)*u>0&&(t.labelExtraY+=x)):(y+t.labelExtraY-m)*u>0&&(n=3*c*Math.abs(a-p.indexOf(t)),d=o.cxFinal+l(o.px0[0],o.px1[0]),(h=d+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*c>0&&(t.labelExtraX+=h)))}(g[h],y)}}}function l(t,e){var r,n,a,i,o,l,s,u,f,d,p=[];for(a=0;au&&(u=l.pull[i]);o.r=Math.min(r/c(l.tilt,Math.sin(s),l.depth),n/c(l.tilt,Math.cos(s),l.depth))/(2+2*u),o.cx=e.l+e.w*(l.domain.x[1]+l.domain.x[0])/2,o.cy=e.t+e.h*(2-l.domain.y[1]-l.domain.y[0])/2,l.scalegroup&&-1===p.indexOf(l.scalegroup)&&p.push(l.scalegroup)}for(i=0;if.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("../../components/fx"),d=t("../../components/color"),p=t("../../components/drawing"),h=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],v=c.trace,y=(v.depth||0)*c.r*Math.sin(0)/2,m=v.tiltaxis||0,x=m*Math.PI/180,b=[y*Math.sin(x),y*Math.cos(x)],_=c.r*Math.cos(0),w=l.selectAll("g.part").data(v.tilt?["top","sides"]:["top"]);w.enter().append("g").attr("class",function(t){return t+" part"}),w.exit().remove(),w.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=[[[],[]],[[],[]]],y=!1;l.each(function(e){function o(n){n.originalEvent=u.event;var i=t._fullLayout,o=t._fullData[v.index],l=f.castHoverinfo(o,i,e.i);if("all"===l&&(l="label+text+value+percent+name"),t._dragging||!1===i.hovermode||"none"===l||"skip"===l||!l)return void f.hover(t,n,"pie");var s=a(e,c),d=w+e.pxmid[0]*(1-s),p=k+e.pxmid[1]*(1-s),h=r.separators,y=[];-1!==l.indexOf("label")&&y.push(e.label),-1!==l.indexOf("text")&&(o.hovertext?y.push(Array.isArray(o.hovertext)?o.hovertext[e.i]:o.hovertext):o.text&&o.text[e.i]&&y.push(o.text[e.i])),-1!==l.indexOf("value")&&y.push(g.formatPieValue(e.v,h)),-1!==l.indexOf("percent")&&y.push(g.formatPiePercent(e.v/c.vTotal,h)),f.loneHover({x0:d-s*c.r,x1:d+s*c.r,y:p,text:y.join("
"),name:-1!==l.indexOf("name")?o.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:f.castHoverOption(v,e.i,"bgcolor")||e.color,borderColor:f.castHoverOption(v,e.i,"bordercolor"),fontFamily:f.castHoverOption(v,e.i,"font.family"),fontSize:f.castHoverOption(v,e.i,"font.size"),fontColor:f.castHoverOption(v,e.i,"font.color")},{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:t}), +f.hover(t,n,"pie"),T=!0}function l(e){e.originalEvent=u.event,t.emit("plotly_unhover",{event:u.event,points:[e]}),T&&(f.loneUnhover(r._hoverlayer.node()),T=!1)}function d(){t._hoverdata=[e],t._hoverdata.trace=c.trace,f.click(t,u.event)}function x(t,r,n,a){return"a"+a*c.r+","+a*_+" "+m+" "+e.largeArc+(n?" 1 ":" 0 ")+a*(r[0]-t[0])+","+a*(r[1]-t[1])}if(e.hidden)return void u.select(this).selectAll("path,g").remove();e.pointNumber=e.i,e.curveNumber=v.index,s[e.pxmid[1]<0?0:1][e.pxmid[0]<0?0:1].push(e);var w=c.cx+b[0],k=c.cy+b[1],M=u.select(this),A=M.selectAll("path.surface").data([e]),T=!1;if(A.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),M.select("path.textline").remove(),M.on("mouseover",o).on("mouseout",l).on("click",d),v.pull){var L=+(Array.isArray(v.pull)?v.pull[e.i]:v.pull)||0;L>0&&(w+=L*e.pxmid[0],k+=L*e.pxmid[1])}e.cxFinal=w,e.cyFinal=k;var C=v.hole;if(e.v===c.vTotal){var S="M"+(w+e.px0[0])+","+(k+e.px0[1])+x(e.px0,e.pxmid,!0,1)+x(e.pxmid,e.px0,!0,1)+"Z";C?A.attr("d","M"+(w+C*e.px0[0])+","+(k+C*e.px0[1])+x(e.px0,e.pxmid,!1,C)+x(e.pxmid,e.px0,!1,C)+"Z"+S):A.attr("d",S)}else{var z=x(e.px0,e.px1,!0,1);if(C){var O=1-C;A.attr("d","M"+(w+C*e.px1[0])+","+(k+C*e.px1[1])+x(e.px1,e.px0,!1,C)+"l"+O*e.px0[0]+","+O*e.px0[1]+z+"Z")}else A.attr("d","M"+w+","+k+"l"+e.px0[0]+","+e.px0[1]+z+"Z")}var D=Array.isArray(v.textposition)?v.textposition[e.i]:v.textposition,P=M.selectAll("g.slicetext").data(e.text&&"none"!==D?[0]:[]);P.enter().append("g").classed("slicetext",!0),P.exit().remove(),P.each(function(){var r=u.select(this).selectAll("text").data([0]);r.enter().append("text").attr("data-notex",1),r.exit().remove(),r.text(e.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(p.font,"outside"===D?v.outsidetextfont:v.insidetextfont).call(h.convertToTspans,t);var a,o=p.bBox(r.node());"outside"===D?a=i(o,e):(a=n(o,e,c),"auto"===D&&a.scale<1&&(r.call(p.font,v.outsidetextfont),v.outsidetextfont.family===v.insidetextfont.family&&v.outsidetextfont.size===v.insidetextfont.size||(o=p.bBox(r.node())),a=i(o,e)));var l=w+e.pxmid[0]*a.rCenter+(a.x||0),s=k+e.pxmid[1]*a.rCenter+(a.y||0);a.outside&&(e.yLabelMin=s-o.height/2,e.yLabelMid=s,e.yLabelMax=s+o.height/2,e.labelExtraX=0,e.labelExtraY=0,y=!0),r.attr("transform","translate("+l+","+s+")"+(a.scale<1?"scale("+a.scale+")":"")+(a.rotate?"rotate("+a.rotate+")":"")+"translate("+-(o.left+o.right)/2+","+-(o.top+o.bottom)/2+")")})}),y&&o(s,v),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],i="M"+n+","+a,o=(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]);Math.abs(l)>Math.abs(s)?i+="l"+s*t.pxmid[0]/t.pxmid[1]+","+s+"H"+(n+t.labelExtraX+o):i+="l"+t.labelExtraX+","+l+"v"+(s-l)+"h"+o}else i+="V"+(t.yLabelMid+t.labelExtraY)+"h"+o;e.append("path").classed("textline",!0).call(d.stroke,v.outsidetextfont.color).attr({"stroke-width":Math.min(2,v.outsidetextfont.size/8),d:i,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":37,"../../components/drawing":61,"../../components/fx":78,"../../lib/svg_text_utils":172,"./helpers":285,d3:10}],290:[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,i=n.select(this);i.style({opacity:r.opacity}),i.selectAll(".top path.surface").each(function(t){n.select(this).call(a,t,r)})})}},{"./style_one":291,d3:10}],291:[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 i=r.marker.line.width||0;Array.isArray(i)&&(i=i[e.i]||0),t.style({"stroke-width":i}).call(n.fill,e.color).call(n.stroke,a)}},{"../../components/color":37}],292:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rg&&p.splice(g,p.length-g),h.length>g&&h.splice(g,h.length-g);var v={padded:!0},y={padded:!0};if(o.hasMarkers(e)){if(r=e.marker,c=r.size,Array.isArray(c)){var m={type:"linear"};a.setConvert(m),c=m.makeCalcdata(e.marker,"size"),c.length>g&&c.splice(g,c.length-g)}var x,b=1.6*(e.marker.sizeref||1);x="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/b),3)}:function(t){return Math.max((t||0)/b,3)},v.ppad=y.ppad=Array.isArray(c)?c.map(x):x(c)}l(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||p[0]===p[g-1]&&h[0]===h[g-1]?e.error_y.visible||-1===["tonexty","tozeroy"].indexOf(e.fill)&&(o.hasMarkers(e)||o.hasText(e))||(v.padded=!1,v.ppad=0):v.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||p[0]===p[g-1]&&h[0]===h[g-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(y.padded=!1):y.tozero=!0,a.expand(f,p,v),a.expand(d,h,y);var _=new Array(g);for(u=0;u=0;a--){var i=t[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],296:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../plots/plots"),o=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 i.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 p=e[0].t.cb=l(t,c),h=o.makeColorScaleFunc(o.extractScale(s.colorscale,f,d),{noNumericCheck:!0});p.fillcolor(h).filllevels({start:f,end:d,size:(d-f)/254}).options(s.colorbar)()}},{"../../components/colorbar/draw":40,"../../components/colorscale":51,"../../lib":152,"../../plots/plots":221,"fast-isnumeric":13}],297:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/calc"),i=t("./subtypes");e.exports=function(t){i.hasLines(t)&&n(t,"line")&&a(t,t.line.color,"line","c"),i.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":43,"../../components/colorscale/has_colorscale":50,"./subtypes":314}],298:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20}},{}],299:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("./constants"),o=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"),p=t("../../components/errorbars/defaults");e.exports=function(t,e,r,h){function g(r,i){return n.coerce(t,e,a,r,i)}var v=l(t,e,h,g),y=vV!=I>=V&&(D=z[C-1][0],P=z[C][0],O=D+(P-D)*(V-E)/(I-E),j=Math.min(j,O),B=Math.max(B,O));j=Math.max(j,0),B=Math.min(B,p._length);var U=l.defaultLine;return l.opacity(d.fillcolor)?U=d.fillcolor:l.opacity((d.line||{}).color)&&(U=d.line.color),n.extendFlat(t,{distance:c+10,x0:j,x1:B,y0:V,y1:V,color:U}),delete t.index,d.text&&!Array.isArray(d.text)?t.text=String(d.text):t.text=d.name,[t]}}}},{"../../components/color":37,"../../components/errorbars":67,"../../components/fx":78,"../../lib":152,"./fill_hover_text":300,"./get_trace_color":302}],304:[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","scatter-like"],n.meta={},e.exports=n},{"../../plots/cartesian":202,"./arrays_to_calcdata":292,"./attributes":293,"./calc":294,"./clean_data":295,"./colorbar":296,"./defaults":299,"./hover":303,"./plot":311,"./select":312,"./style":313,"./subtypes":314}],305:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,i,o,l){var s=(t.marker||{}).color;if(o("line.color",r),n(t,"line"))a(t,e,i,o,{prefix:"line.",cLetter:"c"});else{o("line.color",!Array.isArray(s)&&s||r)}o("line.width"),(l||{}).noDash||o("line.dash")}},{"../../components/colorscale/defaults":46,"../../components/colorscale/has_colorscale":50}],306:[function(t,e,r){"use strict";var n=t("../../constants/numerical").BADNUM,a=t("../../lib"),i=a.segmentsIntersect,o=a.constrain,l=t("./constants");e.exports=function(t,e){function r(e){var r=I.c2p(t[e].x),a=N.c2p(t[e].y);return r!==n&&a!==n&&[r,a]}function s(t){var e=t[0]/I._length,r=t[1]/N._length;return(1+l.toleranceGrowth*Math.max(0,-e,e-1,-r,r-1))*j}function c(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function u(t,e){for(var r=[],n=0,a=0;a<4;a++){var o=at[a],l=i(t[0],t[1],e[0],e[1],o[0],o[1],o[2],o[3]);l&&(!n||Math.abs(l.x-r[0][0])>1||Math.abs(l.y-r[0][1])>1)&&(l=[l.x,l.y],n&&c(l,t)et||t[1]nt)return[o(t[0],tt,et),o(t[1],rt,nt)]}function d(t,e){return t[0]===e[0]&&(t[0]===tt||t[0]===et)||(t[1]===e[1]&&(t[1]===rt||t[1]===nt)||void 0)}function p(t,e){var r=[],n=f(t),a=f(e);return n&&a&&d(n,a)?r:(n&&r.push(n),a&&r.push(a),r)}function h(t,e,r){return function(n,i){var o=f(n),l=f(i),s=[];if(o&&l&&d(o,l))return s;o&&s.push(o),l&&s.push(l);var c=2*a.constrain((n[t]+i[t])/2,e,r)-((o||n)[t]+(l||i)[t]);if(c){var u;u=o&&l?c>0==o[t]>l[t]?o:l:o||l,u[t]+=c}return s}}function g(t,e){var r=e[0]-t[0],n=(e[1]-t[1])/r;return(t[1]*e[0]-e[1]*t[0])/r>0?[n>0?tt:et,nt]:[n>0?et:tt,rt]}function v(t){var e=t[0],r=t[1],n=e===U[G-1][0],a=r===U[G-1][1];if(!n||!a)if(G>1){var i=e===U[G-2][0],o=r===U[G-2][1];n&&(e===tt||e===et)&&i?o?G--:U[G-1]=t:a&&(r===rt||r===nt)&&o?i?G--:U[G-1]=t:U[G++]=t}else U[G++]=t}function y(t){U[G-1][0]!==t[0]&&U[G-1][1]!==t[1]&&v([Z,W]),v(t),Q=null,Z=W=0}function m(t){if(X=t[0]et?et:0,Y=t[1]nt?nt:0,X||Y){if(G)if(Q){var e=J(Q,t);e.length>1&&(y(e[0]),U[G++]=e[1])}else $=J(U[G-1],t)[0],U[G++]=$;else U[G++]=[X||t[0],Y||t[1]];var r=U[G-1];X&&Y&&(r[0]!==X||r[1]!==Y)?(Q&&(Z!==X&&W!==Y?v(Z&&W?g(Q,t):[Z||X,W||Y]):Z&&W&&v([Z,W])),v([X,Y])):Z-X&&W-Y&&v([X||Z,Y||W]),Q=t,Z=X,W=Y}else Q&&y(J(Q,t)[0]),U[G++]=t}var x,b,_,w,k,M,A,T,L,C,S,z,O,D,P,E,I=e.xaxis,N=e.yaxis,R=e.simplify,F=e.connectGaps,j=e.baseTolerance,B=e.shape,q="linear"===B,H=[],V=l.minTolerance,U=new Array(t.length),G=0;R||(j=V=-1);var X,Y,Z,W,Q,$,J,K=l.maxScreensAway,tt=-I._length*K,et=I._length*(1+K),rt=-N._length*K,nt=N._length*(1+K),at=[[tt,rt,et,rt],[et,rt,et,nt],[et,nt,tt,nt],[tt,nt,tt,rt]];for("linear"===B||"spline"===B?J=u:"hv"===B||"vh"===B?J=p:"hvh"===B?J=h(0,tt,et):"vhv"===B&&(J=h(1,rt,nt)),x=0;xs(M))break;_=M,O=L[0]*T[0]+L[1]*T[1],O>S?(S=O,w=M,A=!1):O=t.length||!M)break;m(M),b=M}}else m(w)}Q&&v([Z||Q[0],W||Q[1]]),H.push(U.slice(0,G))}return H}},{"../../constants/numerical":136,"../../lib":152,"./constants":298}],307:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],308:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n,a,i=null,o=0;o0?Math.max(e,a):0}}},{"fast-isnumeric":13}],310:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,l,s,c){var u,f=o.isBubble(t),d=(t.line||{}).color;if(c=c||{},d&&(r=d),s("marker.symbol"),s("marker.opacity",f?.7:1),s("marker.size"),s("marker.color",r),a(t,"marker")&&i(t,e,l,s,{prefix:"marker.",cLetter:"c"}),c.noLine||(u=d&&!Array.isArray(d)&&e.marker.color!==d?d:f?n.background:n.defaultLine,s("marker.line.color",u),a(t,"marker.line")&&i(t,e,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",f?1:0)),f&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient){"none"!==s("marker.gradient.type")&&s("marker.gradient.color")}}},{"../../components/color":37,"../../components/colorscale/defaults":46,"../../components/colorscale/has_colorscale":50,"./subtypes":314}],311:[function(t,e,r){"use strict";function n(t,e,r){var n;e.selectAll("g.trace").each(function(t){var e=o.select(this);if(n=t[0].trace,n._nexttrace){if(n._nextFill=e.select(".js-fill.js-tonext"),!n._nextFill.size()){var a=":first-child";e.select(".js-fill.js-tozero").size()&&(a+=" + *"),n._nextFill=e.insert("path",a).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),n._nextFill=null;n.fill&&("tozero"===n.fill.substr(0,6)||"toself"===n.fill||"to"===n.fill.substr(0,2)&&!n._prevtrace)?(n._ownFill=e.select(".js-fill.js-tozero"),n._ownFill.size()||(n._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),n._ownFill=null),e.selectAll(".js-fill").call(s.setClipUrl,r.layerClipId)})}function a(t,e,r,n,a,d,h){function g(t){return k?t.transition():t}function v(t){return t.filter(function(t){return t.vis})}function y(t){return t.id}function m(t){if(t.ids)return y}function x(){return!1}function b(e){var n,a,i,c=e[0].trace,f=o.select(this),d=u.hasMarkers(c),p=u.hasText(c),h=m(c),y=x,b=x;d&&(y=c.marker.maxdisplayed||c._needsCull?v:l.identity),p&&(b=c.marker.maxdisplayed||c._needsCull?v:l.identity),a=f.selectAll("path.point"),n=a.data(y,h);var _=n.enter().append("path").classed("point",!0);k&&_.call(s.pointStyle,c,t).call(s.translatePoints,M,A).style("opacity",0).transition().style("opacity",1);var w=d&&s.tryColorscale(c.marker,""),T=d&&s.tryColorscale(c.marker,"line");n.order(),n.each(function(e){var n=o.select(this),a=g(n);i=s.translatePoint(e,a,M,A),i?(s.singlePointStyle(e,a,c,w,T,t),r.layerClipId&&s.hideOutsideRangePoint(e,a,M,A),c.customdata&&n.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()}),k?n.exit().transition().style("opacity",0).remove():n.exit().remove(),a=f.selectAll("g"),n=a.data(b,h),n.enter().append("g").classed("textpoint",!0).append("text"),n.order(),n.each(function(t){var e=o.select(this),n=g(e.select("text"));i=s.translatePoint(t,n,M,A),i?r.layerClipId&&s.hideOutsideRangePoint(t,e,M,A):e.remove()}),n.selectAll("text").call(s.textPointStyle,c,t).each(function(t){var e=M.c2p(t.x),r=A.c2p(t.y);o.select(this).selectAll("tspan.line").each(function(){g(o.select(this)).attr({x:e,y:r})})}),n.exit().remove()}var _,w;i(t,e,r,n,a);var k=!!h&&h.duration>0,M=r.xaxis,A=r.yaxis,T=n[0].trace,L=T.line,C=o.select(d);if(C.call(c.plot,r,h),!0===T.visible){g(C).style("opacity",T.opacity);var S,z,O=T.fill.charAt(T.fill.length-1);"x"!==O&&"y"!==O&&(O=""),n[0].node3=C;var D="",P=[],E=T._prevtrace;E&&(D=E._prevRevpath||"",z=E._nextFill,P=E._polygons);var I,N,R,F,j,B,q,H,V,U="",G="",X=[],Y=l.noop;if(S=T._ownFill,u.hasLines(T)||"none"!==T.fill){for(z&&z.datum(n),-1!==["hv","vh","hvh","vhv"].indexOf(L.shape)?(R=s.steps(L.shape),F=s.steps(L.shape.split("").reverse().join(""))):R=F="spline"===L.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?s.smoothclosed(t.slice(1),L.smoothing):s.smoothopen(t,L.smoothing)}:function(t){return"M"+t.join("L")},j=function(t){return F(t.reverse())},X=f(n,{xaxis:M,yaxis:A,connectGaps:T.connectgaps,baseTolerance:Math.max(L.width||1,3)/4,shape:L.shape,simplify:L.simplify}),V=T._polygons=new Array(X.length),w=0;w1){var r=o.select(this);if(r.datum(n),t)g(r.style("opacity",0).attr("d",I).call(s.lineGroupStyle)).style("opacity",1);else{var a=g(r);a.attr("d",I),s.singleLineStyle(n,a)}}}}}var Z=C.selectAll(".js-line").data(X);g(Z.exit()).style("opacity",0).remove(),Z.each(Y(!1)),Z.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(Y(!0)),s.setClipUrl(Z,r.layerClipId),X.length&&(S?B&&H&&(O?("y"===O?B[1]=H[1]=A.c2p(0,!0):"x"===O&&(B[0]=H[0]=M.c2p(0,!0)),g(S).attr("d","M"+H+"L"+B+"L"+U.substr(1)).call(s.singleFillStyle)):g(S).attr("d",U+"Z").call(s.singleFillStyle)):"tonext"===T.fill.substr(0,6)&&U&&D&&("tonext"===T.fill?g(z).attr("d",U+"Z"+D+"Z").call(s.singleFillStyle):g(z).attr("d",U+"L"+D.substr(1)+"Z").call(s.singleFillStyle),T._polygons=T._polygons.concat(P)),T._prevRevpath=G,T._prevPolygons=V);var W=C.selectAll(".points");_=W.data([n]),W.each(b),_.enter().append("g").classed("points",!0).each(b),_.exit().remove(),_.each(function(t){var e=!1===t[0].trace.cliponaxis;s.setClipUrl(o.select(this),e?null:r.layerClipId)})}}function i(t,e,r,n,a){var i=r.xaxis,s=r.yaxis,c=o.extent(l.simpleMap(i.range,i.r2c)),f=o.extent(l.simpleMap(s.range,s.r2c)),d=n[0].trace;if(u.hasMarkers(d)){var p=d.marker.maxdisplayed;if(0!==p){var h=n.filter(function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=f[0]&&t.y<=f[1]}),g=Math.ceil(h.length/p),v=0;a.forEach(function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;for(u=h.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),d(t,e,r),n(t,h,e),s=0,c={};sc[e[0].trace.uid]?1:-1}),v){l&&(p=l());o.transition().duration(i.duration).ease(i.easing).each("end",function(){p&&p()}).each("interrupt",function(){p&&p()}).each(function(){h.selectAll("g.trace").each(function(n,o){a(t,o,e,n,r,this,i)})})}else h.selectAll("g.trace").each(function(n,o){a(t,o,e,n,r,this,i)});g&&f.exit().remove(),h.selectAll("path:not([d])").remove()}},{"../../components/drawing":61,"../../components/errorbars":67,"../../lib":152,"../../lib/polygon":163,"./line_points":306,"./link_traces":308,"./subtypes":314,d3:10}],312:[function(t,e,r){"use strict";var n=t("./subtypes"),a=t("../../constants/interactions").DESELECTDIM;e.exports=function(t,e){var r,i,o,l,s=t.cd,c=t.xaxis,u=t.yaxis,f=[],d=s[0].trace,p=d.marker;if(!n.hasMarkers(d)&&!n.hasText(d))return[];var h=Array.isArray(p.opacity)?1:p.opacity;if(!1===e)for(r=0;r.01){for(l=t.length-1;l>=0;l--)t[l].dp+=a;r=!1}if(!(o<.01)){if(a<-.01){for(l=t.length-1;l>=0;l--)t[l].dp-=o;r=!1}if(r){var c=0;for(i=0;ie.pmax&&c++;for(i=t.length-1;i>=0&&!(c<=0);i--)s=t[i],s.pos>e.pmax-1&&(s.del=!0,c--);for(i=0;i=0;l--)t[l].dp-=o;for(i=t.length-1;i>=0&&!(c<=0);i--)s=t[i],s.pos+s.dp+s.size>e.pmax&&(s.del=!0,c--)}}}for(var r,a,o,i,l,s,c,u=0,f=t.map(function(t,n){var r=t[e];return[{i:n,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===r._id.charAt(0)?T:1)/2,pmin:r._offset,pmax:r._offset+r._length}]}).sort(function(t,e){return t[0].posref-e[0].posref});!r&&u<=t.length;){for(u++,r=!0,i=0;i.01&&p.pmin===g.pmin&&p.pmax===g.pmax){for(l=h.length-1;l>=0;l--)h[l].dp+=a;for(d.push.apply(d,h),f.splice(i+1,1),c=0,l=d.length-1;l>=0;l--)c+=d[l].dp;for(o=c/d.length,l=d.length-1;l>=0;l--)d[l].dp-=o;r=!1}else i++}f.forEach(n)}for(i=f.length-1;i>=0;i--){var v=f[i];for(l=v.length-1;l>=0;l--){var m=v[l],y=t[m.i];y.offset=m.dp,y.del=m.del}}}function i(t,e){t.each(function(t){var n=u.select(this);if(t.del)return void n.remove();var r="end"===t.anchor?-1:1,a=n.select("text.nums"),o={start:1,end:-1,middle:0}[t.anchor],i=o*(S+z),l=i+o*(t.txwidth+z),s=0,c=t.offset;"middle"===t.anchor&&(i-=t.tx2width/2,l-=t.tx2width/2),e&&(c*=-C,s=t.offset*L),n.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(r*S+s)+","+(S+c)+"v"+(t.by/2-S)+"h"+r*t.bx+"v-"+t.by+"H"+(r*S+s)+"V"+(c-S)+"Z"),a.call(g.positionText,i+s,c+t.ty0-t.by/2+z),t.tx2width&&(n.select("text.name").call(g.positionText,l+o*z+s,c+t.ty0-t.by/2+z),n.select("rect").call(m.setRect,l+(o-1)*t.tx2width/2+s,c-t.by/2-1,t.tx2width,t.by+2))})}function l(t,e){function n(e,n,r){var a=l(n,r);a&&(t[e]=a)}var r=t.index,a=t.trace||{},o=t.cd[0],i=t.cd[r]||{},l=Array.isArray(r)?function(t,e){return h.castOption(o,r,t)||h.extractOption({},a,"",e)}:function(t,e){return h.extractOption(i,a,t,e)};n("hoverinfo","hi","hoverinfo"),n("color","hbg","hoverlabel.bgcolor"),n("borderColor","hbc","hoverlabel.bordercolor"),n("fontFamily","htf","hoverlabel.font.family"),n("fontSize","hts","hoverlabel.font.size"),n("fontColor","htc","hoverlabel.font.color"),n("nameLength","hnl","hoverlabel.namelength"),t.posref="y"===e?(t.x0+t.x1)/2:(t.y0+t.y1)/2,t.x0=h.constrain(t.x0,0,t.xa._length),t.x1=h.constrain(t.x1,0,t.xa._length),t.y0=h.constrain(t.y0,0,t.ya._length),t.y1=h.constrain(t.y1,0,t.ya._length);var s;if(void 0!==t.xLabelVal){s="log"===t.xa.type&&t.xLabelVal<=0;var c=b.tickText(t.xa,t.xa.c2l(s?-t.xLabelVal:t.xLabelVal),"hover");s?0===t.xLabelVal?t.xLabel="0":t.xLabel="-"+c.text:t.xLabel=c.text,t.xVal=t.xa.c2d(t.xLabelVal)}if(void 0!==t.yLabelVal){s="log"===t.ya.type&&t.yLabelVal<=0;var u=b.tickText(t.ya,t.ya.c2l(s?-t.yLabelVal:t.yLabelVal),"hover");s?0===t.yLabelVal?t.yLabel="0":t.yLabel="-"+u.text:t.yLabel=u.text,t.yVal=t.ya.c2d(t.yLabelVal)}if(void 0!==t.zLabelVal&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var f=b.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+f+" / -"+b.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+f,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var d=b.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+d+" / -"+b.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+d,"y"===e&&(t.distance+=1)}var p=t.hoverinfo||t.trace.hoverinfo;return"all"!==p&&(p=p.split("+"),-1===p.indexOf("x")&&(t.xLabel=void 0),-1===p.indexOf("y")&&(t.yLabel=void 0),-1===p.indexOf("z")&&(t.zLabel=void 0),-1===p.indexOf("text")&&(t.text=void 0),-1===p.indexOf("name")&&(t.name=void 0)),t}function s(t,e){var n=e.hovermode,r=e.container,a=t[0],o=a.xa,i=a.ya,l=o.showspikes,s=i.showspikes;if(r.selectAll(".spikeline").remove(),"closest"===n&&(l||s)){var c=e.fullLayout,u=o._offset+(a.x0+a.x1)/2,f=i._offset+(a.y0+a.y1)/2,h=y.combine(c.plot_bgcolor,c.paper_bgcolor),p=d.readability(a.color,h)<1.5?y.contrast(h):a.color;if(s){var g=i.spikemode,v=i.spikethickness,x=i.spikecolor||p,b=i._boundingBox,_=(b.left+b.right)/2=0;r--){var a=n[r],o=t._hoverdata[r];if(a.curveNumber!==o.curveNumber||String(a.pointNumber)!==String(o.pointNumber))return!0}return!1}var u=t("d3"),f=t("fast-isnumeric"),d=t("tinycolor2"),h=t("../../lib"),p=t("../../lib/events"),g=t("../../lib/svg_text_utils"),v=t("../../lib/override_cursor"),m=t("../drawing"),y=t("../color"),x=t("../dragelement"),b=t("../../plots/cartesian/axes"),_=t("../../registry"),w=t("./helpers"),M=t("./constants"),k=M.YANGLE,A=Math.PI*k/180,T=1/Math.sin(A),L=Math.cos(A),C=Math.sin(A),S=M.HOVERARROWSIZE,z=M.HOVERTEXTPAD;n.hover=function(t,e,n,a){t=h.getGraphDiv(t),h.throttle(t._fullLayout._uid+M.HOVERID,M.HOVERMINTIME,function(){r(t,e,n,a)})},n.loneHover=function(t,e){var n={color:t.color||y.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,trace:{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0},r=u.select(e.container),o=e.outerContainer?u.select(e.outerContainer):r,l={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||y.background,container:r,outerContainer:o},s=a([n],l,e.gd);return i(s,l.rotateLabels),s.node()}},{"../../lib":153,"../../lib/events":144,"../../lib/override_cursor":163,"../../lib/svg_text_utils":173,"../../plots/cartesian/axes":194,"../../registry":239,"../color":36,"../dragelement":57,"../drawing":60,"./constants":72,"./helpers":74,d3:8,"fast-isnumeric":11,tinycolor2:17}],76:[function(t,e,n){"use strict";var r=t("../../lib");e.exports=function(t,e,n,a){a=a||{},n("hoverlabel.bgcolor",a.bgcolor),n("hoverlabel.bordercolor",a.bordercolor),n("hoverlabel.namelength",a.namelength),r.coerceFont(n,"hoverlabel.font",a.font)}},{"../../lib":153}],77:[function(t,e,n){"use strict";function r(t){var e=l.isD3Selection(t)?t:i.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()}function a(t,e,n){return l.castOption(t,e,"hoverlabel."+n)}function o(t,e,n){function r(n){return l.coerceHoverinfo({hoverinfo:n},{_module:t._module},e)}return l.castOption(t,n,"hoverinfo",r)}var i=t("d3"),l=t("../../lib"),s=t("../dragelement"),c=t("./helpers"),u=t("./layout_attributes");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:u},attributes:t("./attributes"),layoutAttributes:u,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:c.getDistanceFunction,getClosest:c.getClosest,inbox:c.inbox,appendArrayPointValue:c.appendArrayPointValue,castHoverOption:a,castHoverinfo:o,hover:t("./hover").hover,unhover:s.unhover,loneHover:t("./hover").loneHover,loneUnhover:r,click:t("./click")}},{"../../lib":153,"../dragelement":57,"./attributes":69,"./calc":70,"./click":71,"./constants":72,"./defaults":73,"./helpers":74,"./hover":75,"./layout_attributes":78,"./layout_defaults":79,"./layout_global_defaults":80,d3:8}],78:[function(t,e,n){"use strict";var r=t("./constants"),a=t("../../plots/font_attributes")({editType:"none"});a.family.dflt=r.HOVERFONT,a.size.dflt=r.HOVERFONTSIZE,e.exports={dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1],editType:"modebar"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"}}},{"../../plots/font_attributes":218,"./constants":72}],79:[function(t,e,n){"use strict";function r(t){for(var e=!0,n=0;n=2/3},n.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},n.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3},n.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3}},{}],87:[function(t,e,n){"use strict";var r=t("../../plots/font_attributes"),a=t("../color/attributes");e.exports={bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:a.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:r({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},x:{valType:"number",min:-2,max:3,dflt:1.02,editType:"legend"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",min:-2,max:3,dflt:1,editType:"legend"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"legend"},editType:"legend"}},{"../../plots/font_attributes":218,"../color/attributes":35}],88:[function(t,e,n){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],89:[function(t,e,n){"use strict";var r=t("../../registry"),a=t("../../lib"),o=t("./attributes"),i=t("../../plots/layout_attributes"),l=t("./helpers");e.exports=function(t,e,n){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,v="normal",m=0;m1)){if(s("bgcolor",e.paper_bgcolor),s("bordercolor"),s("borderwidth"),a.coerceFont(s,"font",e.font),s("orientation"),"h"===p.orientation){var x=t.xaxis;x&&x.rangeslider&&x.rangeslider.visible?(c=0,f="left",u=1.1,d="bottom"):(c=0,f="left",u=-.1,d="top")}s("traceorder",v),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":153,"../../plots/layout_attributes":229,"../../registry":239,"./attributes":87,"./helpers":93}],90:[function(t,e,n){"use strict";function r(t,e){function n(n){m.convertToTspans(n,e,function(){o(t,e)})}var r=t.data()[0][0],a=e._fullLayout,i=r.trace,l=h.traceIs(i,"pie"),s=i.index,c=l?r.label:i.name,d=t.selectAll("text.legendtext").data([0]);d.enter().append("text").classed("legendtext",!0),d.attr("text-anchor","start").classed("user-select-none",!0).call(g.font,a.legend.font).text(c),e._context.edits.legendText&&!l?d.call(m.makeEditable,{gd:e}).call(n).on("edit",function(t){this.text(t).call(n);var a=t;this.text()||(t=" ");var o,i,l=r.trace._fullInput||{},c={};if(-1!==["ohlc","candlestick"].indexOf(l.type))o=r.trace.transforms,i=o[o.length-1].direction,c[i+".name"]=t;else if(h.hasTransform(l,"groupby")){var d=h.getTransformIndices(l,"groupby"),p=d[d.length-1],g=f.keyedContainer(l,"transforms["+p+"].styles","target","value.name");""===a?g.remove(r.trace._group):g.set(r.trace._group,t),c=g.constructUpdate()}else c.name=t;return u.restyle(e,c,s)}):d.call(n)}function a(t,e){var n,r=1,a=t.selectAll("rect").data([0]);a.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(v.fill,"rgba(0,0,0,0)"),a.on("mousedown",function(){n=(new Date).getTime(),n-e._legendMouseDownTimeT&&(r=Math.max(r-1,1)),1===r?n._clickTimeout=setTimeout(function(){y(t,e,r)},T):2===r&&(n._clickTimeout&&clearTimeout(n._clickTimeout),e._legendMouseDownTime=0,y(t,e,r))}})}function o(t,e){var n=t.data()[0][0];if(!n.trace.showlegend)return void t.remove();var r,a,o=t.select("g[class*=math-group]"),i=o.node(),l=e._fullLayout.legend,s=l.font.size*_;if(i){var c=g.bBox(i);r=c.height,a=c.width,g.setTranslate(o,0,r/4)}else{var u=t.select(".legendtext"),f=m.lineCount(u),d=u.node();r=s*f,a=d?g.bBox(d).width:0;var h=s*(.3+(1-f)/2);m.positionText(u,40,h)}r=Math.max(r,16)+3,n.height=r,n.width=a}function i(t,e,n){var r=t._fullLayout,a=r.legend,o=a.borderwidth,i=k.isGrouped(a),l=0;if(a.width=0,a.height=0,k.isVertical(a))i&&e.each(function(t,e){g.setTranslate(this,0,e*a.tracegroupgap)}),n.each(function(t){var e=t[0],n=e.height,r=e.width;g.setTranslate(this,o,5+o+a.height+n/2),a.height+=n,a.width=Math.max(a.width,r)}),a.width+=45+2*o,a.height+=10+2*o,i&&(a.height+=(a._lgroupsLength-1)*a.tracegroupgap),l=40;else if(i){for(var s=[a.width],u=e.data(),f=0,d=u.length;fr.width-(r.margin.r+r.margin.l)&&(x=0,v+=m,a.height=a.height+m,m=0),g.setTranslate(this,o+x,5+o+e.height/2+v),a.width+=i+n,a.height=Math.max(a.height,e.height),x+=i+n,m=Math.max(e.height,m)}),a.width+=2*o,a.height+=10+2*o}a.width=Math.ceil(a.width),a.height=Math.ceil(a.height),n.each(function(e){var n=e[0];c.select(this).select(".legendtoggle").call(g.setRect,0,-n.height/2,(t._context.edits.legendText?0:a.width)+l,n.height)})}function l(t){var e=t._fullLayout,n=e.legend,r="left";A.isRightAnchor(n)?r="right":A.isCenterAnchor(n)&&(r="center");var a="top";A.isBottomAnchor(n)?a="bottom":A.isMiddleAnchor(n)&&(a="middle"),d.autoMargin(t,"legend",{x:n.x,y:n.y,l:n.width*({right:1,center:.5}[r]||0),r:n.width*({left:1,center:.5}[r]||0),b:n.height*({top:1,middle:.5}[a]||0),t:n.height*({bottom:1,middle:.5}[a]||0)})}function s(t){var e=t._fullLayout,n=e.legend,r="left";A.isRightAnchor(n)?r="right":A.isCenterAnchor(n)&&(r="center"),d.autoMargin(t,"legend",{x:n.x,y:.5,l:n.width*({right:1,center:.5}[r]||0),r:n.width*({left:1,center:.5}[r]||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"),v=t("../color"),m=t("../../lib/svg_text_utils"),y=t("./handle_click"),x=t("./constants"),b=t("../../constants/interactions"),_=t("../../constants/alignment").LINE_SPACING,w=t("./get_legend_data"),M=t("./style"),k=t("./helpers"),A=t("./anchor_utils"),T=b.DBLCLICKDELAY;e.exports=function(t){function e(t,e){S.attr("data-scroll",e).call(g.setTranslate,0,e),z.call(g.setRect,F,t,x.scrollBarWidth,x.scrollBarHeight),L.select("rect").attr({y:m.borderwidth-e})}var n=t._fullLayout,o="legend"+n._uid;if(n._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var m=n.legend,b=n.showlegend&&w(t.calcdata,m),_=n.hiddenlabels||[];if(!n.showlegend||!b.length)return n._infolayer.selectAll(".legend").remove(),n._topdefs.select("#"+o).remove(),void d.autoMargin(t,"legend");var k=n._infolayer.selectAll("g.legend").data([0]);k.enter().append("g").attr({class:"legend","pointer-events":"all"});var L=n._topdefs.selectAll("#"+o).data([0]);L.enter().append("clipPath").attr("id",o).append("rect");var C=k.selectAll("rect.bg").data([0]);C.enter().append("rect").attr({class:"bg","shape-rendering":"crispEdges"}),C.call(v.stroke,m.bordercolor),C.call(v.fill,m.bgcolor),C.style("stroke-width",m.borderwidth+"px");var S=k.selectAll("g.scrollbox").data([0]);S.enter().append("g").attr("class","scrollbox");var z=k.selectAll("rect.scrollbar").data([0]);z.enter().append("rect").attr({class:"scrollbar",rx:20,ry:2,width:0,height:0}).call(v.fill,"#808BA4");var P=S.selectAll("g.groups").data(b);P.enter().append("g").attr("class","groups"),P.exit().remove();var O=P.selectAll("g.traces").data(f.identity);O.enter().append("g").attr("class","traces"),O.exit().remove(),O.call(M,t).style("opacity",function(t){var e=t[0].trace;return h.traceIs(e,"pie")?-1!==_.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){c.select(this).call(r,t).call(a,t)});var D=0!==k.enter().size();D&&(i(t,P,O),l(t));var E=n.width,N=n.height;i(t,P,O),m.height>N?s(t):l(t);var R=n._size,I=R.l+R.w*m.x,j=R.t+R.h*(1-m.y);A.isRightAnchor(m)?I-=m.width:A.isCenterAnchor(m)&&(I-=m.width/2),A.isBottomAnchor(m)?j-=m.height:A.isMiddleAnchor(m)&&(j-=m.height/2);var F=m.width,B=R.w;F>B?(I=R.l,F=B):(I+F>E&&(I=E-F),I<0&&(I=0),F=Math.min(E-I,m.width));var q=m.height,H=R.h;q>H?(j=R.t,q=H):(j+q>N&&(j=N-q),j<0&&(j=0),q=Math.min(N-j,m.height)),g.setTranslate(k,I,j);var V,U,G=q-x.scrollBarHeight-2*x.scrollBarMargin,Y=m.height-q;if(m.height<=q||t._context.staticPlot)C.attr({width:F-m.borderwidth,height:q-m.borderwidth,x:m.borderwidth/2,y:m.borderwidth/2}),g.setTranslate(S,0,0),L.select("rect").attr({width:F-2*m.borderwidth,height:q-2*m.borderwidth,x:m.borderwidth,y:m.borderwidth}),S.call(g.setClipUrl,o);else{V=x.scrollBarMargin,U=S.attr("data-scroll")||0,C.attr({width:F-2*m.borderwidth+x.scrollBarWidth+x.scrollBarMargin,height:q-m.borderwidth,x:m.borderwidth/2,y:m.borderwidth/2}),L.select("rect").attr({width:F-2*m.borderwidth+x.scrollBarWidth+x.scrollBarMargin,height:q-2*m.borderwidth,x:m.borderwidth,y:m.borderwidth-U}),S.call(g.setClipUrl,o),D&&e(V,U),k.on("wheel",null),k.on("wheel",function(){U=f.constrain(S.attr("data-scroll")-c.event.deltaY/G*Y,-Y,0),V=x.scrollBarMargin-U/Y*G,e(V,U),0!==U&&U!==-Y&&c.event.preventDefault()}),z.on(".drag",null),S.on(".drag",null);var X=c.behavior.drag().on("drag",function(){V=f.constrain(c.event.y-x.scrollBarHeight/2,x.scrollBarMargin,x.scrollBarMargin+G),U=-(V-x.scrollBarMargin)/G*Y,e(V,U)});z.call(X),S.call(X)}if(t._context.edits.legendPosition){var Z,W,Q,$;k.classed("cursor-move",!0),p.init({element:k.node(),gd:t,prepFn:function(){var t=g.getTranslate(k);Q=t.x,$=t.y},moveFn:function(t,e){var n=Q+t,r=$+e;g.setTranslate(k,n,r),Z=p.align(n,0,R.l,R.l+R.w,m.xanchor),W=p.align(r,0,R.t+R.h,R.t,m.yanchor)},doneFn:function(e,r,a){if(e&&void 0!==Z&&void 0!==W)u.relayout(t,{"legend.x":Z,"legend.y":W});else{var o=n._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return a.clientX>=t.left&&a.clientX<=t.right&&a.clientY>=t.top&&a.clientY<=t.bottom});o.size()>0&&(1===r?k._clickTimeout=setTimeout(function(){y(o,t,r)},T):2===r&&(k._clickTimeout&&clearTimeout(k._clickTimeout),y(o,t,r)))}}})}}}},{"../../constants/alignment":133,"../../constants/interactions":134,"../../lib":153,"../../lib/svg_text_utils":173,"../../plotly":189,"../../plots/plots":231,"../../registry":239,"../color":36,"../dragelement":57,"../drawing":60,"./anchor_utils":86,"./constants":88,"./get_legend_data":91,"./handle_click":92,"./helpers":93,"./style":95,d3:8}],91:[function(t,e,n){"use strict";var r=t("../../registry"),a=t("./helpers");e.exports=function(t,e){function n(t,n){if(""!==t&&a.isGrouped(e))-1===s.indexOf(t)?(s.push(t),c=!0,l[t]=[[n]]):l[t].push([n]);else{var r="~~i"+f;s.push(r),l[r]=[[n]],f++}}var o,i,l={},s=[],c=!1,u={},f=0;for(o=0;on[1])return n[1]}return a}function a(t){return t[0]}var l,c,u=t[0],f=u.trace,d=s.hasMarkers(f),h=s.hasText(f),p=s.hasLines(f);if(d||h||p){var g={},v={};d&&(g.mc=n("marker.color",a),g.mo=n("marker.opacity",o.mean,[.2,1]),g.ms=n("marker.size",o.mean,[2,16]),g.mlc=n("marker.line.color",a),g.mlw=n("marker.line.width",o.mean,[0,5]),v.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),p&&(v.line={width:n("line.width",a,[0,10])}),h&&(g.tx="Aa",g.tp=n("textposition",a),g.ts=10,g.tc=n("textfont.color",a),g.tf=n("textfont.family",a)),l=[o.minExtend(u,g)],c=o.minExtend(f,v)} var m=r.select(this).select("g.legendpoints"),y=m.selectAll("path.scatterpts").data(d?l:[]);y.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),y.exit().remove(),y.call(i.pointStyle,c,e),d&&(l[0].mrc=3);var x=m.selectAll("g.pointtext").data(h?l:[]);x.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),x.exit().remove(),x.selectAll("text").call(i.textPointStyle,c,e)}function f(t){var e=t[0].trace,n=e.marker||{},o=n.line||{},i=r.select(this).select("g.legendpoints").selectAll("path.legendbar").data(a.traceIs(e,"bar")?[t]:[]);i.enter().append("path").classed("legendbar",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),i.exit().remove(),i.each(function(t){var e=r.select(this),a=t[0],i=(a.mlw+1||o.width+1)-1;e.style("stroke-width",i+"px").call(l.fill,a.mc||n.color),i&&e.call(l.stroke,a.mlc||o.color)})}function d(t){var e=t[0].trace,n=r.select(this).select("g.legendpoints").selectAll("path.legendbox").data(a.traceIs(e,"box")&&e.visible?[t]:[]);n.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),n.exit().remove(),n.each(function(){var t=e.line.width,n=r.select(this);n.style("stroke-width",t+"px").call(l.fill,e.fillcolor),t&&n.call(l.stroke,e.line.color)})}function h(t){var e=t[0].trace,n=r.select(this).select("g.legendpoints").selectAll("path.legendpie").data(a.traceIs(e,"pie")&&e.visible?[t]:[]);n.enter().append("path").classed("legendpie",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),n.exit().remove(),n.size()&&n.call(c,t[0],e)}t.each(function(t){var e=r.select(this),n=e.selectAll("g.layers").data([0]);n.enter().append("g").classed("layers",!0),n.style("opacity",t[0].trace.opacity),n.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),n.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var a=n.selectAll("g.legendsymbols").data([t]);a.enter().append("g").classed("legendsymbols",!0),a.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(f).each(d).each(h).each(n).each(u)}},{"../../lib":153,"../../registry":239,"../../traces/pie/style_one":257,"../../traces/scatter/subtypes":280,"../color":36,"../drawing":60,d3:8}],96:[function(t,e,n){"use strict";function r(t,e){var n,r,a=e.currentTarget,o=a.getAttribute("data-attr"),i=a.getAttribute("data-val")||!0,l=t._fullLayout,s={},c=h.list(t,null,!0),u="on";if("zoom"===o){var d,p="in"===i?.5:2,g=(1+p)/2,v=(1-p)/2;for(r=0;r1)return r(["resetViews","toggleHover"]),i(m,n);u&&(r(["zoom3d","pan3d","orbitRotation","tableRotation"]),r(["resetCameraDefault3d","resetCameraLastSave3d"]),r(["hoverClosest3d"]));var y=a(l),x=[];return((c||p)&&!y||g)&&(x=["zoom2d","pan2d"]),(v||f)&&(x=["pan2d"]),o(s)&&(x.push("select2d"),x.push("lasso2d")),x.length&&r(x),!c&&!p||y||g||r(["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"]),c&&h?r(["toggleHover"]):p?r(["hoverClosestGl2d"]):c?r(["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]):h?r(["hoverClosestPie"]):v?r(["resetViewMapbox","toggleHover"]):f&&(r(["zoomInGeo","zoomOutGeo","resetGeo"]),r(["hoverClosestGeo"])),i(m,n)}function a(t){for(var e=s.list({_fullLayout:t},null,!0),n=!0,r=0;r0)){var p=a(e,n,s);f("x",p[0]),f("y",p[1]),o.noneOrAll(t,e,["x","y"]),f("xanchor"),f("yanchor"),o.coerceFont(f,"font",n.font);var g=f("bgcolor");f("activecolor",i.contrast(g,c.lightAmount,c.darkAmount)),f("bordercolor"),f("borderwidth")}}},{"../../lib":153,"../color":36,"./attributes":100,"./button_attributes":101,"./constants":102}],104:[function(t,e,n){"use strict";function r(t){for(var e=m.list(t,"x",!0),n=[],r=0;rp&&(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,n=a.filterVisible(e.shapes);if(n.length&&t._fullData.length)for(var l=0;lY&&r>X&&!t.shiftKey?p.getCursor(a/n,1-o/r):"move";g(e,i),G=i.split("-")[0]}function o(e){F=f.getFromId(t,n.xref),B=f.getFromId(t,n.yref),q=m.getDataToPixel(t,F),H=m.getDataToPixel(t,B,!0),V=m.getPixelToData(t,F),U=m.getPixelToData(t,B,!0);var o="shapes["+r+"]";"path"===n.type?(I=n.path,j=o+".path"):(v=q(n.x0),y=H(n.y0),x=q(n.x1),b=H(n.y1),_=o+".x0",w=o+".y0",M=o+".x1",k=o+".y1"),vX&&(h[S]=n[D]=U(c),h[z]=n[E]=U(u)),d-f>Y&&(h[P]=n[N]=V(f),h[O]=n[R]=V(d))}e.attr("d",i(t,n))}var h,v,y,x,b,_,w,M,k,A,T,L,C,S,z,P,O,D,E,N,R,I,j,F,B,q,H,V,U,G,Y=10,X=10,Z={element:e.node(),gd:t,prepFn:o,doneFn:l},W=Z.element.getBoundingClientRect();p.init(Z),e.node().onmousemove=a}function i(t,e){var n,r,a,o,i=e.type,s=f.getFromId(t,e.xref),c=f.getFromId(t,e.yref),u=t._fullLayout._size;if(s?(n=m.shapePositionToRange(s),r=function(t){return s._offset+s.r2p(n(t,!0))}):r=function(t){return u.l+u.w*t},c?(a=m.shapePositionToRange(c),o=function(t){return c._offset+c.r2p(a(t,!0))}):o=function(t){return u.t+u.h*(1-t)},"path"===i)return s&&"date"===s.type&&(r=m.decodeDate(r)),c&&"date"===c.type&&(o=m.decodeDate(o)),l(e.path,r,o);var d=r(e.x0),h=r(e.x1),p=o(e.y0),g=o(e.y1);if("line"===i)return"M"+d+","+p+"L"+h+","+g;if("rect"===i)return"M"+d+","+p+"H"+h+"V"+g+"H"+d+"Z";var v=(d+h)/2,y=(p+g)/2,x=Math.abs(v-d),b=Math.abs(y-p),_="A"+x+","+b,w=v+x+","+y;return"M"+w+_+" 0 1,1 "+v+","+(y-b)+_+" 0 0,1 "+w+"Z"}function l(t,e,n){return t.replace(v.segmentRE,function(t){var r=0,a=t.charAt(0),o=v.paramIsX[a],i=v.paramIsY[a],l=v.numParams[a],s=t.substr(1).replace(v.paramRE,function(t){return o[r]?t=e(t):i[r]&&(t=n(t)),r++,r>l&&(t="X"),t});return r>l&&(s=s.replace(/[\s,]*X.*/,""),u.log("Ignoring extra params in segment "+t)),a+s})}function s(t,e,n){return t.replace(v.segmentRE,function(t){var r=0,a=t.charAt(0),o=v.paramIsX[a],i=v.paramIsY[a],l=v.numParams[a];return a+t.substr(1).replace(v.paramRE,function(t){return r>=l?t:(o[r]?t=e(t):i[r]&&(t=n(t)),r++,t)})})}var c=t("../../plotly"),u=t("../../lib"),f=t("../../plots/cartesian/axes"),d=t("../color"),h=t("../drawing"),p=t("../dragelement"),g=t("../../lib/setcursor"),v=t("./constants"),m=t("./helpers");e.exports={draw:r,drawOne:a}},{"../../lib":153,"../../lib/setcursor":171,"../../plotly":189,"../../plots/cartesian/axes":194,"../color":36,"../dragelement":57,"../drawing":60,"./constants":115,"./helpers":118}],118:[function(t,e,n){"use strict";n.rangeToShapePosition=function(t){return"log"===t.type?t.r2d:function(t){return t}},n.shapePositionToRange=function(t){return"log"===t.type?t.d2r:function(t){return t}},n.decodeDate=function(t){return function(e){return e.replace&&(e=e.replace("_"," ")),t(e)}},n.encodeDate=function(t){return function(e){return t(e).replace(" ","_")}},n.getDataToPixel=function(t,e,r){var a,o=t._fullLayout._size;if(e){var i=n.shapePositionToRange(e);a=function(t){return e._offset+e.r2p(i(t,!0))},"date"===e.type&&(a=n.decodeDate(a))}else a=r?function(t){return o.t+o.h*(1-t)}:function(t){return o.l+o.w*t};return a},n.getPixelToData=function(t,e,r){var a,o=t._fullLayout._size;if(e){var i=n.rangeToShapePosition(e);a=function(t){return i(e.p2r(t-e._offset))}}else a=r?function(t){return 1-(t-o.t)/o.h}:function(t){return(t-o.l)/o.w};return a}},{}],119:[function(t,e,n){"use strict";var r=t("./draw");e.exports={moduleType:"component",name:"shapes",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:r.draw,drawOne:r.drawOne}},{"./attributes":113,"./calc_autorange":114,"./defaults":116,"./draw":117}],120:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./attributes"),i=t("./helpers");e.exports=function(t,e,n,l,s){function c(n,a){return r.coerce(t,e,o,n,a)}if(l=l||{},s=s||{},!c("visible",!s.itemIsNotPlainObject))return e;c("layer"),c("opacity"),c("fillcolor"),c("line.color"),c("line.width"),c("line.dash");for(var u=t.path?"path":"rect",f=c("type",u),d=["x","y"],h=0;h<2;h++){var p=d[h],g={_fullLayout:n},v=a.coerceRef(t,e,g,p,"","paper");if("path"!==f){var m,y,x;"paper"!==v?(m=a.getFromId(g,v),x=i.rangeToShapePosition(m),y=i.shapePositionToRange(m)):y=x=r.identity;var b=p+"0",_=p+"1",w=t[b],M=t[_];t[b]=y(t[b],!0),t[_]=y(t[_],!0),a.coercePosition(e,g,c,v,b,.25),a.coercePosition(e,g,c,v,_,.75),e[b]=x(e[b]),e[_]=x(e[_]),t[b]=w,t[_]=M}}return"path"===f?c("path"):r.noneOrAll(t,e,["x0","x1","y0","y1"]),e}},{"../../lib":153,"../../plots/cartesian/axes":194,"./attributes":113,"./helpers":118}],121:[function(t,e,n){"use strict";var r=t("../../plots/font_attributes"),a=t("../../plots/pad_attributes"),o=t("../../lib/extend").extendDeepAll,i=t("../../plot_api/edit_types").overrideAll,l=t("../../plots/animation_attributes"),s=t("./constants"),c={_isLinkedToArray:"step",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}};e.exports=i({_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:o({},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:r({})},font:r({}),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}},"arraydraw","from-root")},{"../../lib/extend":145,"../../plot_api/edit_types":178,"../../plots/animation_attributes":190,"../../plots/font_attributes":218,"../../plots/pad_attributes":230,"./constants":122}],122:[function(t,e,n){"use strict";e.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],123:[function(t,e,n){"use strict";function r(t,e,n){function r(n,r){return o.coerce(t,e,l,n,r)}r("visible",a(t,e).length>0)&&(r("active"),r("x"),r("y"),o.noneOrAll(t,e,["x","y"]),r("xanchor"),r("yanchor"),r("len"),r("lenmode"),r("pad.t"),r("pad.r"),r("pad.b"),r("pad.l"),o.coerceFont(r,"font",n.font),r("currentvalue.visible")&&(r("currentvalue.xanchor"),r("currentvalue.prefix"),r("currentvalue.suffix"),r("currentvalue.offset"),o.coerceFont(r,"currentvalue.font",e.font)),r("transition.duration"),r("transition.easing"),r("bgcolor"),r("activebgcolor"),r("bordercolor"),r("borderwidth"),r("ticklen"),r("tickwidth"),r("tickcolor"),r("minorticklen"))}function a(t,e){function n(t,e){return o.coerce(r,a,u,t,e)}for(var r,a,i=t.steps||[],l=e.steps=[],s=0;s=n.steps.length&&(n.active=0),e.call(l,n).call(b,n).call(u,n).call(p,n).call(x,t,n).call(s,t,n),A.setTranslate(e,n.lx+n.pad.l,n.ly+n.pad.t),e.call(v,n,n.active/(n.steps.length-1),!1),e.call(l,n)}function l(t,e,n){if(e.currentvalue.visible){var r,a,o=t.selectAll("text").data([0]);switch(e.currentvalue.xanchor){case"right":r=e.inputAreaLength-C.currentValueInset-e.currentValueMaxWidth,a="left";break;case"center":r=.5*e.inputAreaLength,a="middle";break;default:r=C.currentValueInset,a="left"}o.enter().append("text").classed(C.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":a,"data-notex":1});var i=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof n)i+=n;else{i+=e.steps[e.active].label}e.currentvalue.suffix&&(i+=e.currentvalue.suffix),o.call(A.font,e.currentvalue.font).text(i).call(T.convertToTspans,e.gd);var l=T.lineCount(o),s=(e.currentValueMaxLines+1-l)*e.currentvalue.font.size*S;return T.positionText(o,r,s),o}}function s(t,e,n){var r=t.selectAll("rect."+C.gripRectClass).data([0]);r.enter().append("rect").classed(C.gripRectClass,!0).call(h,e,t,n).style("pointer-events","all"),r.attr({width:C.gripWidth,height:C.gripHeight,rx:C.gripRadius,ry:C.gripRadius}).call(k.stroke,n.bordercolor).call(k.fill,n.bgcolor).style("stroke-width",n.borderwidth+"px")}function c(t,e,n){var r=t.selectAll("text").data([0]);return r.enter().append("text").classed(C.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1}),r.call(A.font,n.font).text(e.step.label).call(T.convertToTspans,n.gd),r}function u(t,e){var n=t.selectAll("g."+C.labelsClass).data([0]);n.enter().append("g").classed(C.labelsClass,!0);var r=n.selectAll("g."+C.labelGroupClass).data(e.labelSteps);r.enter().append("g").classed(C.labelGroupClass,!0),r.exit().remove(),r.each(function(t){var n=w.select(this);n.call(c,t,e),A.setTranslate(n,m(e,t.fraction),C.tickOffset+e.ticklen+e.font.size*S+C.labelOffset+e.currentValueTotalHeight)})}function f(t,e,n,r,a){var o=Math.round(r*(n.steps.length-1));o!==n.active&&d(t,e,n,o,!0,a)}function d(t,e,n,r,a,o){var i=n.active;n._input.active=n.active=r;var s=n.steps[n.active];e.call(v,n,n.active/(n.steps.length-1),o),e.call(l,n),t.emit("plotly_sliderchange",{slider:n,step:n.steps[n.active],interaction:a,previousActive:i}),s&&s.method&&a&&(e._nextMethod?(e._nextMethod.step=s,e._nextMethod.doCallback=a,e._nextMethod.doTransition=o):(e._nextMethod={step:s,doCallback:a,doTransition:o},e._nextMethodRaf=window.requestAnimationFrame(function(){var n=e._nextMethod.step;n.method&&(n.execute&&M.executeAPICommand(t,n.method,n.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function h(t,e,n){function r(){return n.data()[0]}var a=n.node(),o=w.select(e);t.on("mousedown",function(){var t=r();e.emit("plotly_sliderstart",{slider:t});var i=n.select("."+C.gripRectClass);w.event.stopPropagation(),w.event.preventDefault(),i.call(k.fill,t.activebgcolor);var l=y(t,w.mouse(a)[0]);f(e,n,t,l,!0),t._dragging=!0,o.on("mousemove",function(){var t=r(),o=y(t,w.mouse(a)[0]);f(e,n,t,o,!1)}),o.on("mouseup",function(){var t=r();t._dragging=!1,i.call(k.fill,t.bgcolor),o.on("mouseup",null),o.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function p(t,e){var n=t.selectAll("rect."+C.tickRectClass).data(e.steps);n.enter().append("rect").classed(C.tickRectClass,!0),n.exit().remove(),n.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),n.each(function(t,n){var r=n%e.labelStride==0,a=w.select(this);a.attr({height:r?e.ticklen:e.minorticklen}).call(k.fill,e.tickcolor),A.setTranslate(a,m(e,n/(e.steps.length-1))-.5*e.tickwidth,(r?C.tickOffset:C.minorTickOffset)+e.currentValueTotalHeight)})}function g(t){t.labelSteps=[];for(var e=t.steps.length,n=0;n0&&(i=i.transition().duration(e.transition.duration).ease(e.transition.easing)),i.attr("transform","translate("+(o-.5*C.gripWidth)+","+e.currentValueTotalHeight+")")}}function m(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,n){var r=t.selectAll("rect."+C.railTouchRectClass).data([0]);r.enter().append("rect").classed(C.railTouchRectClass,!0).call(h,e,t,n).style("pointer-events","all"),r.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,C.tickOffset+n.ticklen+n.labelHeight)}).call(k.fill,n.bgcolor).attr("opacity",0),A.setTranslate(r,0,n.currentValueTotalHeight)}function b(t,e){var n=t.selectAll("rect."+C.railRectClass).data([0]);n.enter().append("rect").classed(C.railRectClass,!0);var r=e.inputAreaLength-2*C.railInset;n.attr({width:r,height:C.railWidth,rx:C.railRadius,ry:C.railRadius,"shape-rendering":"crispEdges"}).call(k.stroke,e.bordercolor).call(k.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),A.setTranslate(n,C.railInset,.5*(e.inputAreaWidth-C.railWidth)+e.currentValueTotalHeight)}function _(t){for(var e=t._fullLayout._pushmargin||{},n=Object.keys(e),r=0;r0?[0]:[]);if(l.enter().append("g").classed(C.containerClassName,!0).style("cursor","ew-resize"),l.exit().remove(),l.exit().size()&&_(t),0!==n.length){var s=l.selectAll("g."+C.groupClassName).data(n,a);s.enter().append("g").classed(C.groupClassName,!0),s.exit().each(function(e){w.select(this).remove(),e._commandObserver.remove(),delete e._commandObserver,M.autoMargin(t,C.autoMarginIdRoot+e._index)});for(var c=0;c0||d<0){var g={left:[-n,0],right:[n,0],top:[0,-n],bottom:[0,n]}[_.side];e.attr("transform","translate("+g+")")}}}var v,m=n.propContainer,y=n.propName,x=n.traceIndex,b=n.dfltName,_=n.avoid||{},w=n.attributes,M=n.transform,k=n.containerGroup,A=t._fullLayout,T=m.titlefont.family,L=m.titlefont.size,C=m.titlefont.color,S=1,z=!1,P=m.title.trim();"title"===y?v="titleText":-1!==y.indexOf("axis")?v="axisTitleText":y.indexOf(!0)&&(v="colorbarTitleText");var O=t._context.edits[v];""===P&&(S=0),P.match(d)&&(S=.2,z=!0,O||(P=""));var D=P||O;k||(k=A._infolayer.selectAll(".g-"+e).data([0]),k.enter().append("g").classed("g-"+e,!0));var E=k.selectAll("text").data(D?[0]:[]);if(E.enter().append("text"),E.text(P).attr("class",e),E.exit().remove(),D){E.call(h);var N="Click to enter "+b+" title";O&&(P?E.on(".opacity",null):function(){S=0,z=!0,P=N,E.text(P).on("mouseover.opacity",function(){r.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){r.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)})}(),E.call(u.makeEditable,{gd:t}).on("edit",function(e){void 0!==x?o.restyle(t,y,e,x):o.relayout(t,y,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(h)}).on("input",function(t){this.text(t||" ").call(u.positionText,w.x,w.y)})),E.classed("js-placeholder",z)}}},{"../../constants/interactions":134,"../../lib":153,"../../lib/svg_text_utils":173,"../../plotly":189,"../../plots/plots":231,"../color":36,"../drawing":60,d3:8,"fast-isnumeric":11}],127:[function(t,e,n){"use strict";var r=t("../../plots/font_attributes"),a=t("../color/attributes"),o=t("../../lib/extend").extendFlat,i=t("../../plot_api/edit_types").overrideAll,l=t("../../plots/pad_attributes"),s={_isLinkedToArray:"button",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}};e.exports=i({_isLinkedToArray:"updatemenu",_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:s,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({},l,{}),font:r({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}},"arraydraw","from-root")},{"../../lib/extend":145,"../../plot_api/edit_types":178,"../../plots/font_attributes":218,"../../plots/pad_attributes":230,"../color/attributes":35}],128:[function(t,e,n){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],129:[function(t,e,n){"use strict";function r(t,e,n){function r(n,r){return o.coerce(t,e,l,n,r)}r("visible",a(t,e).length>0)&&(r("active"),r("direction"),r("type"),r("showactive"),r("x"),r("y"),o.noneOrAll(t,e,["x","y"]),r("xanchor"),r("yanchor"),r("pad.t"),r("pad.r"),r("pad.b"),r("pad.l"),o.coerceFont(r,"font",n.font),r("bgcolor",n.paper_bgcolor),r("bordercolor"),r("borderwidth"))}function a(t,e){function n(t,e){return o.coerce(r,a,u,t,e)}for(var r,a,i=t.buttons||[],l=e.buttons=[],s=0;s0?[0]:[]);if(o.enter().append("g").classed(S.containerClassName,!0).style("cursor","pointer"),o.exit().remove(),o.exit().size()&&_(t),0!==n.length){var u=o.selectAll("g."+S.headerGroupClassName).data(n,a);u.enter().append("g").classed(S.headerGroupClassName,!0);var f=o.selectAll("g."+S.dropdownButtonGroupClassName).data([0]);f.enter().append("g").classed(S.dropdownButtonGroupClassName,!0).style("pointer-events","all");for(var d=0;dM,T=r.barLength+2*r.barPad,L=r.barWidth+2*r.barPad,C=p,S=v+m;S+L>c&&(S=c-L);var z=this.container.selectAll("rect.scrollbar-horizontal").data(A?[0]:[]);z.exit().on(".drag",null).remove(),z.enter().append("rect").classed("scrollbar-horizontal",!0).call(o.fill,r.barColor),A?(this.hbar=z.attr({rx:r.barRadius,ry:r.barRadius,x:C,y:S,width:T,height:L}),this._hbarXMin=C+T/2,this._hbarTranslateMax=M-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var P=m>k,O=r.barWidth+2*r.barPad,D=r.barLength+2*r.barPad,E=p+g,N=v;E+O>s&&(E=s-O);var R=this.container.selectAll("rect.scrollbar-vertical").data(P?[0]:[]);R.exit().on(".drag",null).remove(),R.enter().append("rect").classed("scrollbar-vertical",!0).call(o.fill,r.barColor),P?(this.vbar=R.attr({rx:r.barRadius,ry:r.barRadius,x:E,y:N,width:O,height:D}),this._vbarYMin=N+D/2,this._vbarTranslateMax=k-D):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var I=this.id,j=u-.5,F=P?f+O+.5:f+.5,B=d-.5,q=A?h+L+.5:h+.5,H=l._topdefs.selectAll("#"+I).data(A||P?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",I).append("rect"),A||P?(this._clipRect=H.select("rect").attr({x:Math.floor(j),y:Math.floor(B),width:Math.ceil(F)-Math.floor(j),height:Math.ceil(q)-Math.floor(B)}),this.container.call(i.setClipUrl,I),this.bg.attr({x:p,y:v,width:g,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),A||P){var V=a.behavior.drag().on("dragstart",function(){a.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var U=a.behavior.drag().on("dragstart",function(){a.event.sourceEvent.preventDefault(),a.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));A&&this.hbar.on(".drag",null).call(U),P&&this.vbar.on(".drag",null).call(U)}this.setTranslate(e,n)},r.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},r.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=a.event.dx),this.vbar&&(e-=a.event.dy),this.setTranslate(t,e)},r.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=a.event.deltaY),this.vbar&&(e+=a.event.deltaY),this.setTranslate(t,e)},r.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var n=t+this._hbarXMin,r=n+this._hbarTranslateMax;t=(l.constrain(a.event.x,n,r)-n)/(r-n)*(this.position.w-this._box.w)}if(this.vbar){var o=e+this._vbarYMin,i=o+this._vbarTranslateMax;e=(l.constrain(a.event.y,o,i)-o)/(i-o)*(this.position.h-this._box.h)}this.setTranslate(t,e)},r.prototype.setTranslate=function(t,e){var n=this.position.w-this._box.w,r=this.position.h-this._box.h;if(t=l.constrain(t||0,0,n),e=l.constrain(e||0,0,r),this.translateX=t,this.translateY=e,this.container.call(i.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var a=t/n;this.hbar.call(i.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var o=e/r;this.vbar.call(i.setTranslate,t,e+o*this._vbarTranslateMax)}}},{"../../lib":153,"../color":36,"../drawing":60,d3:8}],133:[function(t,e,n){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},LINE_SPACING:1.3,MID_SHIFT:.35}},{}],134:[function(t,e,n){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300,DESELECTDIM:.2}},{}],135:[function(t,e,n){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,MINUS_SIGN:"\u2212"}},{}],136:[function(t,e,n){"use strict";e.exports={entityToUnicode:{mu:"\u03bc","#956":"\u03bc",amp:"&","#28":"&",lt:"<","#60":"<",gt:">","#62":">",nbsp:"\xa0","#160":"\xa0",times:"\xd7","#215":"\xd7",plusmn:"\xb1","#177":"\xb1",deg:"\xb0","#176":"\xb0"}}},{}],137:[function(t,e,n){"use strict";n.xmlns="http://www.w3.org/2000/xmlns/",n.svg="http://www.w3.org/2000/svg",n.xlink="http://www.w3.org/1999/xlink",n.svgAttrs={xmlns:n.svg,"xmlns:xlink":n.xlink}},{}],138:[function(t,e,n){"use strict";var r=t("./plotly");n.version="1.31.1",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config"),n.plot=r.plot,n.newPlot=r.newPlot,n.restyle=r.restyle,n.relayout=r.relayout,n.redraw=r.redraw,n.update=r.update,n.extendTraces=r.extendTraces,n.prependTraces=r.prependTraces,n.addTraces=r.addTraces,n.deleteTraces=r.deleteTraces,n.moveTraces=r.moveTraces,n.purge=r.purge,n.setPlotConfig=t("./plot_api/set_plot_config"),n.register=t("./plot_api/register"),n.toImage=t("./plot_api/to_image"),n.downloadImage=t("./snapshot/download"),n.validate=t("./plot_api/validate"),n.addFrames=r.addFrames,n.deleteFrames=r.deleteFrames,n.animate=r.animate,n.register(t("./traces/scatter")),n.register([t("./components/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),n.Icons=t("../build/ploticon"),n.Plots=r.Plots,n.Fx=t("./components/fx"),n.Snapshot=t("./snapshot"),n.PlotSchema=t("./plot_api/plot_schema"),n.Queue=t("./lib/queue"),n.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":29,"./components/annotations3d":34,"./components/fx":77,"./components/images":85,"./components/legend":94,"./components/rangeselector":106,"./components/rangeslider":112,"./components/shapes":119,"./components/sliders":125,"./components/updatemenus":131,"./fonts/mathjax_config":139,"./lib/queue":166,"./plot_api/plot_schema":183,"./plot_api/register":184,"./plot_api/set_plot_config":185,"./plot_api/to_image":187,"./plot_api/validate":188,"./plotly":189,"./snapshot":244,"./snapshot/download":241,"./traces/scatter":270,d3:8,"es6-promise":9}],139:[function(t,e,n){"use strict";"undefined"!=typeof MathJax?(n.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):n.MathJax=!1},{}],140:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("../constants/numerical").BADNUM,o=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(o,"")),r(t)?Number(t):a}},{"../constants/numerical":135,"fast-isnumeric":11}],141:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("tinycolor2"),o=t("../plots/attributes"),i=t("../components/colorscale/get_scale"),l=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),s=t("./regex").counter;n.valObjectMeta={data_array:{coerceFunction:function(t,e,n){Array.isArray(t)?e.set(t):void 0!==n&&e.set(n)}},enumerated:{coerceFunction:function(t,e,n,r){r.coerceNumber&&(t=+t),-1===r.values.indexOf(t)?e.set(n):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var n=e.values,r=0;ra.max?e.set(n):e.set(+t)}},integer:{coerceFunction:function(t,e,n,a){t%1||!r(t)||void 0!==a.min&&ta.max?e.set(n):e.set(+t)}},string:{coerceFunction:function(t,e,n,r){if("string"!=typeof t){var a="number"==typeof t;!0!==r.strict&&a?e.set(String(t)):e.set(n)}else r.noBlank&&!t?e.set(n):e.set(t)}},color:{coerceFunction:function(t,e,n){a(t).isValid()?e.set(t):e.set(n)}},colorscale:{coerceFunction:function(t,e,n){e.set(i(t,n))}},angle:{coerceFunction:function(t,e,n){"auto"===t?e.set("auto"):r(t)?(Math.abs(t)>180&&(t-=360*Math.round(t/360)),e.set(+t)):e.set(n)}},subplotid:{coerceFunction:function(t,e,n){if("string"==typeof t&&s(n).test(t))return void e.set(t);e.set(n)},validateFunction:function(t,e){var n=e.dflt;return t===n||"string"==typeof t&&!!s(n).test(t)}},flaglist:{coerceFunction:function(t,e,n,r){if("string"!=typeof t)return void e.set(n);if(-1!==(r.extras||[]).indexOf(t))return void e.set(t);for(var a=t.split("+"),o=0;o0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),r+=":"+i}return r}function s(t){return t.formatDate("yyyy")}function c(t){return t.formatDate("M yyyy")}function u(t){return t.formatDate("M d")}function f(t){return t.formatDate("M d, yyyy")}var d=t("d3"),h=t("fast-isnumeric"),p=t("./loggers").error,g=t("./mod"),v=t("../constants/numerical"),m=v.BADNUM,y=v.ONEDAY,x=v.ONEHOUR,b=v.ONEMIN,_=v.ONESEC,w=v.EPOCHJD,M=t("../registry"),k=d.time.format.utc,A=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,T=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,L=(new Date).getFullYear()-70;n.dateTick0=function(t,e){return r(t)?e?M.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:M.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},n.dfltRange=function(t){return r(t)?M.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},n.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime};var C,S;n.dateTime2ms=function(t,e){if(n.isJSDate(t))return t=Number(t)-t.getTimezoneOffset()*b,t>=C&&t<=S?t:m;if("string"!=typeof t&&"number"!=typeof t)return m;t=String(t);var a=r(e),o=t.charAt(0);!a||"G"!==o&&"g"!==o||(t=t.substr(1),e="");var i=a&&"chinese"===e.substr(0,7),l=t.match(i?T:A);if(!l)return m;var s=l[1],c=l[3]||"1",u=Number(l[5]||1),f=Number(l[7]||0),d=Number(l[9]||0),h=Number(l[11]||0);if(a){if(2===s.length)return m;s=Number(s);var p;try{var g=M.getComponentMethod("calendars","getCal")(e);if(i){var v="i"===c.charAt(c.length-1);c=parseInt(c,10),p=g.newDate(s,g.toMonthIndex(s,c,v),u)}else p=g.newDate(s,Number(c),u)}catch(t){return m}return p?(p.toJD()-w)*y+f*x+d*b+h*_:m}s=2===s.length?(Number(s)+2e3-L)%100+L:Number(s),c-=1;var k=new Date(Date.UTC(2e3,c,u,f,d));return k.setUTCFullYear(s),k.getUTCMonth()!==c?m:k.getUTCDate()!==u?m:k.getTime()+h*_},C=n.MIN_MS=n.dateTime2ms("-9999"),S=n.MAX_MS=n.dateTime2ms("9999-12-31 23:59:59.9999"),n.isDateTime=function(t,e){return n.dateTime2ms(t,e)!==m};var z=90*y,P=3*x,O=5*b;n.ms2DateTime=function(t,e,n){if("number"!=typeof t||!(t>=C&&t<=S))return m;e||(e=0);var a,i,l,s,c,u,f=Math.floor(10*g(t+.05,1)),d=Math.round(t-f/10);if(r(n)){var h=Math.floor(d/y)+w,p=Math.floor(g(t,y));try{a=M.getComponentMethod("calendars","getCal")(n).fromJD(h).formatDate("yyyy-mm-dd")}catch(t){a=k("G%Y-%m-%d")(new Date(d))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;i=e=C+y&&t<=S-y))return m;var e=Math.floor(10*g(t+.05,1)),n=new Date(Math.round(t-e/10));return o(d.time.format("%Y-%m-%d")(n),n.getHours(),n.getMinutes(),n.getSeconds(),10*n.getUTCMilliseconds()+e)},n.cleanDate=function(t,e,a){if(n.isJSDate(t)||"number"==typeof t){if(r(a))return p("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=n.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!n.isDateTime(t,a))return p("unrecognized date",t),e;return t};var D=/%\d?f/g,E=[59,59.9,59.99,59.999,59.9999],N=k("%Y"),R=k("%b %Y"),I=k("%b %-d"),j=k("%b %-d, %Y");n.formatDate=function(t,e,n,a){var o,d;if(a=r(a)&&a,e)return i(e,t,a);if(a)try{var h=Math.floor((t+.05)/y)+w,p=M.getComponentMethod("calendars","getCal")(a).fromJD(h);"y"===n?d=s(p):"m"===n?d=c(p):"d"===n?(o=s(p),d=u(p)):(o=f(p),d=l(t,n))}catch(t){return"Invalid"}else{var g=new Date(Math.floor(t+.05));"y"===n?d=N(g):"m"===n?d=R(g):"d"===n?(o=N(g),d=I(g)):(o=j(g),d=l(t,n))}return d+(o?"\n"+o:"")};var F=3*y;n.incrementMonth=function(t,e,n){n=r(n)&&n;var a=g(t,y);if(t=Math.round(t-a),n)try{var o=Math.round(t/y)+w,i=M.getComponentMethod("calendars","getCal")(n),l=i.fromJD(o);return e%12?i.add(l,e,"m"):i.add(l,e/12,"y"),(l.toJD()-w)*y+a}catch(e){p("invalid ms "+t+" in calendar "+n)}var s=new Date(t+F);return s.setUTCMonth(s.getUTCMonth()+e)+a-F},n.findExactDates=function(t,e){for(var n,a,o=0,i=0,l=0,s=0,c=r(e)&&M.getComponentMethod("calendars","getCal")(e),u=0;u0&&(a.push(o),o=[])}return o.length>0&&a.push(o),a},n.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},n.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),n=0;n1||g<0||g>1?null:{x:t+s*g,y:e+f*g}}function a(t,e,n,r,a){var o=r*t+a*e;if(o<0)return r*r+a*a;if(o>n){var i=r-t,l=a-e;return i*i+l*l}var s=r*e-a*t;return s*s/n}var o=t("./mod");n.segmentsIntersect=r,n.segmentDistance=function(t,e,n,o,i,l,s,c){if(r(t,e,n,o,i,l,s,c))return 0;var u=n-t,f=o-e,d=s-i,h=c-l,p=u*u+f*f,g=d*d+h*h,v=Math.min(a(u,f,p,i-t,l-e),a(u,f,p,s-t,c-e),a(d,h,g,t-i,e-l),a(d,h,g,n-i,o-l));return Math.sqrt(v)};var i,l,s;n.getTextLocation=function(t,e,n,r){if(t===l&&r===s||(i={},l=t,s=r),i[n])return i[n];var a=t.getPointAtLength(o(n-r/2,e)),c=t.getPointAtLength(o(n+r/2,e)),u=Math.atan((c.y-a.y)/(c.x-a.x)),f=t.getPointAtLength(o(n,e)),d=(4*f.x+a.x+c.x)/6,h=(4*f.y+a.y+c.y)/6,p={x:d,y:h,theta:u};return i[n]=p,p},n.clearLocationCache=function(){l=null},n.getVisibleSegment=function(t,e,n){function r(e){var n=t.getPointAtLength(e);0===e?a=n:e===f&&(o=n);var r=n.xl?n.x-l:0,u=n.yc?n.y-c:0;return Math.sqrt(r*r+u*u)}for(var a,o,i=e.left,l=e.right,s=e.top,c=e.bottom,u=0,f=t.getTotalLength(),d=f,h=r(u);h;){if((u+=h+n)>d)return;h=r(u)}for(h=r(d);h;){if(d-=h+n,u>d)return;h=r(d)}return{min:u,max:d,len:d-u,total:f,isClosed:0===u&&d===f&&Math.abs(a.x-o.x)<.1&&Math.abs(a.y-o.y)<.1}}},{"./mod":159}],151:[function(t,e,n){"use strict";e.exports=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t}},{}],152:[function(t,e,n){"use strict";e.exports=function(t){return t}},{}],153:[function(t,e,n){"use strict";var r=t("d3"),a=t("fast-isnumeric"),o=t("../constants/numerical"),i=o.FP_SAFE,l=o.BADNUM,s=e.exports={};s.nestedProperty=t("./nested_property"),s.keyedContainer=t("./keyed_container"),s.relativeAttr=t("./relative_attr"),s.isPlainObject=t("./is_plain_object"),s.isArray=t("./is_array"),s.mod=t("./mod"),s.toLogRange=t("./to_log_range"),s.relinkPrivateKeys=t("./relink_private"),s.ensureArray=t("./ensure_array");var c=t("./coerce");s.valObjectMeta=c.valObjectMeta,s.coerce=c.coerce,s.coerce2=c.coerce2,s.coerceFont=c.coerceFont,s.coerceHoverinfo=c.coerceHoverinfo,s.validate=c.validate;var u=t("./dates");s.dateTime2ms=u.dateTime2ms,s.isDateTime=u.isDateTime,s.ms2DateTime=u.ms2DateTime,s.ms2DateTimeLocal=u.ms2DateTimeLocal,s.cleanDate=u.cleanDate,s.isJSDate=u.isJSDate,s.formatDate=u.formatDate,s.incrementMonth=u.incrementMonth,s.dateTick0=u.dateTick0,s.dfltRange=u.dfltRange,s.findExactDates=u.findExactDates,s.MIN_MS=u.MIN_MS,s.MAX_MS=u.MAX_MS;var f=t("./search");s.findBin=f.findBin,s.sorterAsc=f.sorterAsc,s.sorterDes=f.sorterDes,s.distinctVals=f.distinctVals,s.roundUp=f.roundUp;var d=t("./stats");s.aggNums=d.aggNums,s.len=d.len,s.mean=d.mean,s.variance=d.variance,s.stdev=d.stdev,s.interp=d.interp;var h=t("./matrix");s.init2dArray=h.init2dArray,s.transposeRagged=h.transposeRagged,s.dot=h.dot,s.translationMatrix=h.translationMatrix,s.rotationMatrix=h.rotationMatrix,s.rotationXYMatrix=h.rotationXYMatrix,s.apply2DTransform=h.apply2DTransform,s.apply2DTransform2=h.apply2DTransform2;var p=t("./geometry2d");s.segmentsIntersect=p.segmentsIntersect,s.segmentDistance=p.segmentDistance,s.getTextLocation=p.getTextLocation,s.clearLocationCache=p.clearLocationCache,s.getVisibleSegment=p.getVisibleSegment;var g=t("./extend");s.extendFlat=g.extendFlat,s.extendDeep=g.extendDeep,s.extendDeepAll=g.extendDeepAll,s.extendDeepNoArrays=g.extendDeepNoArrays;var v=t("./loggers");s.log=v.log,s.warn=v.warn,s.error=v.error;var m=t("./regex");s.counterRegex=m.counter;var y=t("./throttle");s.throttle=y.throttle,s.throttleDone=y.done,s.clearThrottle=y.clear,s.getGraphDiv=t("./get_graph_div"),s.notifier=t("./notifier"),s.filterUnique=t("./filter_unique"),s.filterVisible=t("./filter_visible"),s.pushUnique=t("./push_unique"),s.cleanNumber=t("./clean_number"),s.ensureNumber=function(t){return a(t)?(t=Number(t),t<-i||t>i?l:a(t)?Number(t):l):l},s.noop=t("./noop"),s.identity=t("./identity"),s.swapAttrs=function(t,e,n,r){n||(n="x"),r||(r="y");for(var a=0;an?Math.max(n,Math.min(e,t)):Math.max(e,Math.min(n,t))},s.bBoxIntersect=function(t,e,n){return n=n||0,t.left<=e.right+n&&e.left<=t.right+n&&t.top<=e.bottom+n&&e.top<=t.bottom+n},s.simpleMap=function(t,e,n,r){for(var a=t.length,o=new Array(a),i=0;i-1||u!==1/0&&u>=Math.pow(2,n)?t(e,n,r):s}, +A.h=k.y-A.t):(A.w=k.x-A.l,A.h=Math.max(a.openHeight,a.headerHeight)),A.direction=a.direction,r&&(c.size()?u(t,e,n,r,a,A):f(r))}function u(t,e,n,r,a,o){var i,l,s,c=a.direction,u="up"===c||"down"===c,f=a.active;if(u)for(l=0,s=0;s0?[0]:[]);if(o.enter().append("g").classed(S.containerClassName,!0).style("cursor","pointer"),o.exit().remove(),o.exit().size()&&_(t),0!==n.length){var u=o.selectAll("g."+S.headerGroupClassName).data(n,a);u.enter().append("g").classed(S.headerGroupClassName,!0);var f=o.selectAll("g."+S.dropdownButtonGroupClassName).data([0]);f.enter().append("g").classed(S.dropdownButtonGroupClassName,!0).style("pointer-events","all");for(var d=0;dM,T=r.barLength+2*r.barPad,L=r.barWidth+2*r.barPad,C=p,S=v+m;S+L>c&&(S=c-L);var z=this.container.selectAll("rect.scrollbar-horizontal").data(A?[0]:[]);z.exit().on(".drag",null).remove(),z.enter().append("rect").classed("scrollbar-horizontal",!0).call(o.fill,r.barColor),A?(this.hbar=z.attr({rx:r.barRadius,ry:r.barRadius,x:C,y:S,width:T,height:L}),this._hbarXMin=C+T/2,this._hbarTranslateMax=M-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var P=m>k,O=r.barWidth+2*r.barPad,D=r.barLength+2*r.barPad,E=p+g,N=v;E+O>s&&(E=s-O);var R=this.container.selectAll("rect.scrollbar-vertical").data(P?[0]:[]);R.exit().on(".drag",null).remove(),R.enter().append("rect").classed("scrollbar-vertical",!0).call(o.fill,r.barColor),P?(this.vbar=R.attr({rx:r.barRadius,ry:r.barRadius,x:E,y:N,width:O,height:D}),this._vbarYMin=N+D/2,this._vbarTranslateMax=k-D):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var I=this.id,j=u-.5,F=P?f+O+.5:f+.5,B=d-.5,q=A?h+L+.5:h+.5,H=l._topdefs.selectAll("#"+I).data(A||P?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",I).append("rect"),A||P?(this._clipRect=H.select("rect").attr({x:Math.floor(j),y:Math.floor(B),width:Math.ceil(F)-Math.floor(j),height:Math.ceil(q)-Math.floor(B)}),this.container.call(i.setClipUrl,I),this.bg.attr({x:p,y:v,width:g,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),A||P){var V=a.behavior.drag().on("dragstart",function(){a.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var U=a.behavior.drag().on("dragstart",function(){a.event.sourceEvent.preventDefault(),a.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));A&&this.hbar.on(".drag",null).call(U),P&&this.vbar.on(".drag",null).call(U)}this.setTranslate(e,n)},r.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},r.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=a.event.dx),this.vbar&&(e-=a.event.dy),this.setTranslate(t,e)},r.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=a.event.deltaY),this.vbar&&(e+=a.event.deltaY),this.setTranslate(t,e)},r.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var n=t+this._hbarXMin,r=n+this._hbarTranslateMax;t=(l.constrain(a.event.x,n,r)-n)/(r-n)*(this.position.w-this._box.w)}if(this.vbar){var o=e+this._vbarYMin,i=o+this._vbarTranslateMax;e=(l.constrain(a.event.y,o,i)-o)/(i-o)*(this.position.h-this._box.h)}this.setTranslate(t,e)},r.prototype.setTranslate=function(t,e){var n=this.position.w-this._box.w,r=this.position.h-this._box.h;if(t=l.constrain(t||0,0,n),e=l.constrain(e||0,0,r),this.translateX=t,this.translateY=e,this.container.call(i.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var a=t/n;this.hbar.call(i.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var o=e/r;this.vbar.call(i.setTranslate,t,e+o*this._vbarTranslateMax)}}},{"../../lib":153,"../color":36,"../drawing":60,d3:8}],133:[function(t,e,n){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},LINE_SPACING:1.3,MID_SHIFT:.35}},{}],134:[function(t,e,n){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300,DESELECTDIM:.2}},{}],135:[function(t,e,n){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,MINUS_SIGN:"\u2212"}},{}],136:[function(t,e,n){"use strict";e.exports={entityToUnicode:{mu:"\u03bc","#956":"\u03bc",amp:"&","#28":"&",lt:"<","#60":"<",gt:">","#62":">",nbsp:"\xa0","#160":"\xa0",times:"\xd7","#215":"\xd7",plusmn:"\xb1","#177":"\xb1",deg:"\xb0","#176":"\xb0"}}},{}],137:[function(t,e,n){"use strict";n.xmlns="http://www.w3.org/2000/xmlns/",n.svg="http://www.w3.org/2000/svg",n.xlink="http://www.w3.org/1999/xlink",n.svgAttrs={xmlns:n.svg,"xmlns:xlink":n.xlink}},{}],138:[function(t,e,n){"use strict";var r=t("./plotly");n.version="1.31.2",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config"),n.plot=r.plot,n.newPlot=r.newPlot,n.restyle=r.restyle,n.relayout=r.relayout,n.redraw=r.redraw,n.update=r.update,n.extendTraces=r.extendTraces,n.prependTraces=r.prependTraces,n.addTraces=r.addTraces,n.deleteTraces=r.deleteTraces,n.moveTraces=r.moveTraces,n.purge=r.purge,n.setPlotConfig=t("./plot_api/set_plot_config"),n.register=t("./plot_api/register"),n.toImage=t("./plot_api/to_image"),n.downloadImage=t("./snapshot/download"),n.validate=t("./plot_api/validate"),n.addFrames=r.addFrames,n.deleteFrames=r.deleteFrames,n.animate=r.animate,n.register(t("./traces/scatter")),n.register([t("./components/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),n.Icons=t("../build/ploticon"),n.Plots=r.Plots,n.Fx=t("./components/fx"),n.Snapshot=t("./snapshot"),n.PlotSchema=t("./plot_api/plot_schema"),n.Queue=t("./lib/queue"),n.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":29,"./components/annotations3d":34,"./components/fx":77,"./components/images":85,"./components/legend":94,"./components/rangeselector":106,"./components/rangeslider":112,"./components/shapes":119,"./components/sliders":125,"./components/updatemenus":131,"./fonts/mathjax_config":139,"./lib/queue":166,"./plot_api/plot_schema":183,"./plot_api/register":184,"./plot_api/set_plot_config":185,"./plot_api/to_image":187,"./plot_api/validate":188,"./plotly":189,"./snapshot":244,"./snapshot/download":241,"./traces/scatter":270,d3:8,"es6-promise":9}],139:[function(t,e,n){"use strict";"undefined"!=typeof MathJax?(n.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):n.MathJax=!1},{}],140:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("../constants/numerical").BADNUM,o=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(o,"")),r(t)?Number(t):a}},{"../constants/numerical":135,"fast-isnumeric":11}],141:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("tinycolor2"),o=t("../plots/attributes"),i=t("../components/colorscale/get_scale"),l=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),s=t("./regex").counter;n.valObjectMeta={data_array:{coerceFunction:function(t,e,n){Array.isArray(t)?e.set(t):void 0!==n&&e.set(n)}},enumerated:{coerceFunction:function(t,e,n,r){r.coerceNumber&&(t=+t),-1===r.values.indexOf(t)?e.set(n):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var n=e.values,r=0;ra.max?e.set(n):e.set(+t)}},integer:{coerceFunction:function(t,e,n,a){t%1||!r(t)||void 0!==a.min&&ta.max?e.set(n):e.set(+t)}},string:{coerceFunction:function(t,e,n,r){if("string"!=typeof t){var a="number"==typeof t;!0!==r.strict&&a?e.set(String(t)):e.set(n)}else r.noBlank&&!t?e.set(n):e.set(t)}},color:{coerceFunction:function(t,e,n){a(t).isValid()?e.set(t):e.set(n)}},colorscale:{coerceFunction:function(t,e,n){e.set(i(t,n))}},angle:{coerceFunction:function(t,e,n){"auto"===t?e.set("auto"):r(t)?(Math.abs(t)>180&&(t-=360*Math.round(t/360)),e.set(+t)):e.set(n)}},subplotid:{coerceFunction:function(t,e,n){if("string"==typeof t&&s(n).test(t))return void e.set(t);e.set(n)},validateFunction:function(t,e){var n=e.dflt;return t===n||"string"==typeof t&&!!s(n).test(t)}},flaglist:{coerceFunction:function(t,e,n,r){if("string"!=typeof t)return void e.set(n);if(-1!==(r.extras||[]).indexOf(t))return void e.set(t);for(var a=t.split("+"),o=0;o0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),r+=":"+i}return r}function s(t){return t.formatDate("yyyy")}function c(t){return t.formatDate("M yyyy")}function u(t){return t.formatDate("M d")}function f(t){return t.formatDate("M d, yyyy")}var d=t("d3"),h=t("fast-isnumeric"),p=t("./loggers").error,g=t("./mod"),v=t("../constants/numerical"),m=v.BADNUM,y=v.ONEDAY,x=v.ONEHOUR,b=v.ONEMIN,_=v.ONESEC,w=v.EPOCHJD,M=t("../registry"),k=d.time.format.utc,A=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,T=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,L=(new Date).getFullYear()-70;n.dateTick0=function(t,e){return r(t)?e?M.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:M.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},n.dfltRange=function(t){return r(t)?M.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},n.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime};var C,S;n.dateTime2ms=function(t,e){if(n.isJSDate(t))return t=Number(t)-t.getTimezoneOffset()*b,t>=C&&t<=S?t:m;if("string"!=typeof t&&"number"!=typeof t)return m;t=String(t);var a=r(e),o=t.charAt(0);!a||"G"!==o&&"g"!==o||(t=t.substr(1),e="");var i=a&&"chinese"===e.substr(0,7),l=t.match(i?T:A);if(!l)return m;var s=l[1],c=l[3]||"1",u=Number(l[5]||1),f=Number(l[7]||0),d=Number(l[9]||0),h=Number(l[11]||0);if(a){if(2===s.length)return m;s=Number(s);var p;try{var g=M.getComponentMethod("calendars","getCal")(e);if(i){var v="i"===c.charAt(c.length-1);c=parseInt(c,10),p=g.newDate(s,g.toMonthIndex(s,c,v),u)}else p=g.newDate(s,Number(c),u)}catch(t){return m}return p?(p.toJD()-w)*y+f*x+d*b+h*_:m}s=2===s.length?(Number(s)+2e3-L)%100+L:Number(s),c-=1;var k=new Date(Date.UTC(2e3,c,u,f,d));return k.setUTCFullYear(s),k.getUTCMonth()!==c?m:k.getUTCDate()!==u?m:k.getTime()+h*_},C=n.MIN_MS=n.dateTime2ms("-9999"),S=n.MAX_MS=n.dateTime2ms("9999-12-31 23:59:59.9999"),n.isDateTime=function(t,e){return n.dateTime2ms(t,e)!==m};var z=90*y,P=3*x,O=5*b;n.ms2DateTime=function(t,e,n){if("number"!=typeof t||!(t>=C&&t<=S))return m;e||(e=0);var a,i,l,s,c,u,f=Math.floor(10*g(t+.05,1)),d=Math.round(t-f/10);if(r(n)){var h=Math.floor(d/y)+w,p=Math.floor(g(t,y));try{a=M.getComponentMethod("calendars","getCal")(n).fromJD(h).formatDate("yyyy-mm-dd")}catch(t){a=k("G%Y-%m-%d")(new Date(d))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;i=e=C+y&&t<=S-y))return m;var e=Math.floor(10*g(t+.05,1)),n=new Date(Math.round(t-e/10));return o(d.time.format("%Y-%m-%d")(n),n.getHours(),n.getMinutes(),n.getSeconds(),10*n.getUTCMilliseconds()+e)},n.cleanDate=function(t,e,a){if(n.isJSDate(t)||"number"==typeof t){if(r(a))return p("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=n.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!n.isDateTime(t,a))return p("unrecognized date",t),e;return t};var D=/%\d?f/g,E=[59,59.9,59.99,59.999,59.9999],N=k("%Y"),R=k("%b %Y"),I=k("%b %-d"),j=k("%b %-d, %Y");n.formatDate=function(t,e,n,a){var o,d;if(a=r(a)&&a,e)return i(e,t,a);if(a)try{var h=Math.floor((t+.05)/y)+w,p=M.getComponentMethod("calendars","getCal")(a).fromJD(h);"y"===n?d=s(p):"m"===n?d=c(p):"d"===n?(o=s(p),d=u(p)):(o=f(p),d=l(t,n))}catch(t){return"Invalid"}else{var g=new Date(Math.floor(t+.05));"y"===n?d=N(g):"m"===n?d=R(g):"d"===n?(o=N(g),d=I(g)):(o=j(g),d=l(t,n))}return d+(o?"\n"+o:"")};var F=3*y;n.incrementMonth=function(t,e,n){n=r(n)&&n;var a=g(t,y);if(t=Math.round(t-a),n)try{var o=Math.round(t/y)+w,i=M.getComponentMethod("calendars","getCal")(n),l=i.fromJD(o);return e%12?i.add(l,e,"m"):i.add(l,e/12,"y"),(l.toJD()-w)*y+a}catch(e){p("invalid ms "+t+" in calendar "+n)}var s=new Date(t+F);return s.setUTCMonth(s.getUTCMonth()+e)+a-F},n.findExactDates=function(t,e){for(var n,a,o=0,i=0,l=0,s=0,c=r(e)&&M.getComponentMethod("calendars","getCal")(e),u=0;u0&&(a.push(o),o=[])}return o.length>0&&a.push(o),a},n.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},n.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),n=0;n1||g<0||g>1?null:{x:t+s*g,y:e+f*g}}function a(t,e,n,r,a){var o=r*t+a*e;if(o<0)return r*r+a*a;if(o>n){var i=r-t,l=a-e;return i*i+l*l}var s=r*e-a*t;return s*s/n}var o=t("./mod");n.segmentsIntersect=r,n.segmentDistance=function(t,e,n,o,i,l,s,c){if(r(t,e,n,o,i,l,s,c))return 0;var u=n-t,f=o-e,d=s-i,h=c-l,p=u*u+f*f,g=d*d+h*h,v=Math.min(a(u,f,p,i-t,l-e),a(u,f,p,s-t,c-e),a(d,h,g,t-i,e-l),a(d,h,g,n-i,o-l));return Math.sqrt(v)};var i,l,s;n.getTextLocation=function(t,e,n,r){if(t===l&&r===s||(i={},l=t,s=r),i[n])return i[n];var a=t.getPointAtLength(o(n-r/2,e)),c=t.getPointAtLength(o(n+r/2,e)),u=Math.atan((c.y-a.y)/(c.x-a.x)),f=t.getPointAtLength(o(n,e)),d=(4*f.x+a.x+c.x)/6,h=(4*f.y+a.y+c.y)/6,p={x:d,y:h,theta:u};return i[n]=p,p},n.clearLocationCache=function(){l=null},n.getVisibleSegment=function(t,e,n){function r(e){var n=t.getPointAtLength(e);0===e?a=n:e===f&&(o=n);var r=n.xl?n.x-l:0,u=n.yc?n.y-c:0;return Math.sqrt(r*r+u*u)}for(var a,o,i=e.left,l=e.right,s=e.top,c=e.bottom,u=0,f=t.getTotalLength(),d=f,h=r(u);h;){if((u+=h+n)>d)return;h=r(u)}for(h=r(d);h;){if(d-=h+n,u>d)return;h=r(d)}return{min:u,max:d,len:d-u,total:f,isClosed:0===u&&d===f&&Math.abs(a.x-o.x)<.1&&Math.abs(a.y-o.y)<.1}}},{"./mod":159}],151:[function(t,e,n){"use strict";e.exports=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t}},{}],152:[function(t,e,n){"use strict";e.exports=function(t){return t}},{}],153:[function(t,e,n){"use strict";var r=t("d3"),a=t("fast-isnumeric"),o=t("../constants/numerical"),i=o.FP_SAFE,l=o.BADNUM,s=e.exports={};s.nestedProperty=t("./nested_property"),s.keyedContainer=t("./keyed_container"),s.relativeAttr=t("./relative_attr"),s.isPlainObject=t("./is_plain_object"),s.isArray=t("./is_array"),s.mod=t("./mod"),s.toLogRange=t("./to_log_range"),s.relinkPrivateKeys=t("./relink_private"),s.ensureArray=t("./ensure_array");var c=t("./coerce");s.valObjectMeta=c.valObjectMeta,s.coerce=c.coerce,s.coerce2=c.coerce2,s.coerceFont=c.coerceFont,s.coerceHoverinfo=c.coerceHoverinfo,s.validate=c.validate;var u=t("./dates");s.dateTime2ms=u.dateTime2ms,s.isDateTime=u.isDateTime,s.ms2DateTime=u.ms2DateTime,s.ms2DateTimeLocal=u.ms2DateTimeLocal,s.cleanDate=u.cleanDate,s.isJSDate=u.isJSDate,s.formatDate=u.formatDate,s.incrementMonth=u.incrementMonth,s.dateTick0=u.dateTick0,s.dfltRange=u.dfltRange,s.findExactDates=u.findExactDates,s.MIN_MS=u.MIN_MS,s.MAX_MS=u.MAX_MS;var f=t("./search");s.findBin=f.findBin,s.sorterAsc=f.sorterAsc,s.sorterDes=f.sorterDes,s.distinctVals=f.distinctVals,s.roundUp=f.roundUp;var d=t("./stats");s.aggNums=d.aggNums,s.len=d.len,s.mean=d.mean,s.variance=d.variance,s.stdev=d.stdev,s.interp=d.interp;var h=t("./matrix");s.init2dArray=h.init2dArray,s.transposeRagged=h.transposeRagged,s.dot=h.dot,s.translationMatrix=h.translationMatrix,s.rotationMatrix=h.rotationMatrix,s.rotationXYMatrix=h.rotationXYMatrix,s.apply2DTransform=h.apply2DTransform,s.apply2DTransform2=h.apply2DTransform2;var p=t("./geometry2d");s.segmentsIntersect=p.segmentsIntersect,s.segmentDistance=p.segmentDistance,s.getTextLocation=p.getTextLocation,s.clearLocationCache=p.clearLocationCache,s.getVisibleSegment=p.getVisibleSegment;var g=t("./extend");s.extendFlat=g.extendFlat,s.extendDeep=g.extendDeep,s.extendDeepAll=g.extendDeepAll,s.extendDeepNoArrays=g.extendDeepNoArrays;var v=t("./loggers");s.log=v.log,s.warn=v.warn,s.error=v.error;var m=t("./regex");s.counterRegex=m.counter;var y=t("./throttle");s.throttle=y.throttle,s.throttleDone=y.done,s.clearThrottle=y.clear,s.getGraphDiv=t("./get_graph_div"),s.notifier=t("./notifier"),s.filterUnique=t("./filter_unique"),s.filterVisible=t("./filter_visible"),s.pushUnique=t("./push_unique"),s.cleanNumber=t("./clean_number"),s.ensureNumber=function(t){return a(t)?(t=Number(t),t<-i||t>i?l:a(t)?Number(t):l):l},s.noop=t("./noop"),s.identity=t("./identity"),s.swapAttrs=function(t,e,n,r){n||(n="x"),r||(r="y");for(var a=0;an?Math.max(n,Math.min(e,t)):Math.max(e,Math.min(n,t))},s.bBoxIntersect=function(t,e,n){return n=n||0,t.left<=e.right+n&&e.left<=t.right+n&&t.top<=e.bottom+n&&e.top<=t.bottom+n},s.simpleMap=function(t,e,n,r){for(var a=t.length,o=new Array(a),i=0;i-1||u!==1/0&&u>=Math.pow(2,n)?t(e,n,r):s}, s.OptionControl=function(t,e){t||(t={}),e||(e="opt");var n={};return n.optionList=[],n._newoption=function(r){r[e]=t,n[r.name]=r,n.optionList.push(r)},n["_"+e]=t,n},s.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var n,r,a,o,i=t.length,l=2*i,s=2*e-1,c=new Array(s),u=new Array(i);for(n=0;n=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=i&&(a=l-1-a),o+=t[a]*c[r];u[n]=o}return u},s.syncOrAsync=function(t,e,n){function r(){return s.syncOrAsync(t,e,n)}for(var a,o;t.length;)if(o=t.splice(0,1)[0],(a=o(e))&&a.then)return a.then(r).then(void 0,s.promiseError);return n&&n(e)},s.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},s.noneOrAll=function(t,e,n){if(t){var r,a,o=!1,i=!0;for(r=0;r1?a+i[1]:"";if(o&&(i.length>1||l.length>4||n))for(;r.test(l);)l=l.replace(r,"$1"+o+"$2");return l+s};var _=/%{([^\s%{}]*)}/g,w=/^\w*$/;s.templateString=function(t,e){var n={};return t.replace(_,function(t,r){return w.test(r)?e[r]||"":(n[r]=n[r]||s.nestedProperty(e,r).get,n[r]()||"")})}},{"../constants/numerical":135,"./clean_number":140,"./coerce":141,"./dates":142,"./ensure_array":143,"./extend":145,"./filter_unique":146,"./filter_visible":147,"./geometry2d":150,"./get_graph_div":151,"./identity":152,"./is_array":154,"./is_plain_object":155,"./keyed_container":156,"./loggers":157,"./matrix":158,"./mod":159,"./nested_property":160,"./noop":161,"./notifier":162,"./push_unique":165,"./regex":167,"./relative_attr":168,"./relink_private":169,"./search":170,"./stats":172,"./throttle":174,"./to_log_range":175,d3:8,"fast-isnumeric":11}],154:[function(t,e,n){"use strict";var r="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}};e.exports=function(t){return Array.isArray(t)||r.isView(t)}},{}],155:[function(t,e,n){"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}},{}],156:[function(t,e,n){"use strict";var r=t("./nested_property"),a=/^\w*$/;e.exports=function(t,e,n,o){n=n||"name",o=o||"value";var i,l,s={};l=e&&e.length?r(t,e).get():t,e=e||"",l=l||[];var c={};for(i=0;i2)return s[e]=2|s[e],f.set(t,null);if(u){for(i=e;i1){for(var t=["LOG:"],e=0;e0){for(var t=["WARN:"],e=0;e0){for(var t=["ERROR:"],e=0;e=0;e--){if(r=t[e][0],o=t[e][1],s=!1,h(r))for(n=r.length-1;n>=0;n--)a(r[n],i(o,n))?s?r[n]=void 0:r.pop():s=!0;else if("object"==typeof r&&null!==r)for(l=Object.keys(r),s=!1,n=l.length-1;n>=0;n--)a(r[l[n]],i(o,l[n]))?delete r[l[n]]:s=!0;if(s)return}}function u(t){return void 0===t||null===t||"object"==typeof t&&(h(t)?!t.length:!Object.keys(t).length)}function f(t,e,n){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:n,obj:t}}var d=t("fast-isnumeric"),h=t("./is_array"),p=t("./is_plain_object"),g=t("../plot_api/container_array_match");e.exports=function(t,e){if(d(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var n,a,i,l=0,s=e.split(".");l/g),l=0;li||r===a||rs)&&(!e||!u(t))}function n(t,e){var n=t[0],c=t[1];if(n===a||ni||c===a||cs)return!1;var u,f,d,h,p,g=r.length,v=r[0][0],m=r[0][1],y=0;for(u=1;uMath.max(f,v)||c>Math.max(d,m)))if(cu||Math.abs(r(i,d))>a)return!0;return!1};o.filter=function(t,e){function n(n){t.push(n);var l=r.length,s=a;r.splice(o+1);for(var c=s+1;c1){n(t.pop())}return{addPt:n,raw:t,filtered:r}}},{"../constants/numerical":135,"./matrix":158}],165:[function(t,e,n){"use strict";e.exports=function(t,e){if(e instanceof RegExp){var n,r=e.toString();for(n=0;no.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,n;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,n=0;n=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,n=0;ne}function i(t,e){return t>=e}var l=t("fast-isnumeric"),s=t("./loggers");n.findBin=function(t,e,n){if(l(e.start))return n?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]?n?r:a:n?i:o;f90&&s.log("Long binary search..."),f-1},n.sorterAsc=function(t,e){return t-e},n.sorterDes=function(t,e){return e-t},n.distinctVals=function(t){var e=t.slice();e.sort(n.sorterAsc);for(var r=e.length-1,a=e[r]-e[0]||1,o=a/(r||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}},n.roundUp=function(t,e,n){for(var r,a=0,o=e.length-1,i=0,l=n?0:1,s=n?1:0,c=n?Math.ceil:Math.floor;at.length-1)return t[t.length-1];var n=e%1;return n*t[Math.ceil(e)]+(1-n)*t[Math.floor(e)]}},{"fast-isnumeric":11}],173:[function(t,e,n){"use strict";function r(t,e){return t.node().getBoundingClientRect()[e]}function a(t){return t.replace(m,"\\lt ").replace(y,"\\gt ")}function o(t,e,n){var r="math-output-"+d.randstr([],64),o=f.select("body").append("div").attr({id:r}).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),n();else{var r=o.select("svg").node().getBoundingClientRect();n(o.select(".MathJax_SVG"),e,r)}o.remove()})}function i(t,e){if(!t)return null;var n=t.match(e);return n&&(n[3]||n[4])}function l(t,e){if(!t)return"";for(var n=0;n1)for(var a=1;a.",e);var n=c.pop();t!==n.type&&d.log("Start tag <"+n.type+"> doesnt match end tag <"+t+">. Pretending it did match.",e),o=c[c.length-1].node}(k);else{var N=y[4],R={type:k},I=i(N,z);if(I?(I=I.replace(E,"$1 fill:"),A&&(I+=";"+A)):A&&(I=A),I&&(R.style=I),"a"===k){l=!0;var j=i(N,P);if(j){var F=document.createElement("a");F.href=j,-1!==M.indexOf(F.protocol)&&(R.href=encodeURI(j),R.target=i(N,O)||"_blank",R.popup=i(N,D))}}r(R)}}return l}function u(t,e,n){var r,a,o,i=n.horizontalAlign,l=n.verticalAlign||"top",s=t.node().getBoundingClientRect(),c=e.node().getBoundingClientRect();return a="bottom"===l?function(){return s.bottom-r.height}:"middle"===l?function(){return s.top+(s.height-r.height)/2}:function(){return s.top},o="right"===i?function(){return s.right-r.width}:"center"===i?function(){return s.left+(s.width-r.width)/2}:function(){return s.left},function(){return r=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"),g=t("../constants/alignment").LINE_SPACING,v=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;n.convertToTspans=function(t,e,a){function i(){u.empty()||(d=t.attr("class")+"-math",u.select("svg."+d).remove()),t.text("").style("white-space","pre"),c(t.node(),l)&&t.style("pointer-events","all"),n.positionText(t),a&&a.call(t)}var l=t.text(),s=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&l.match(v),u=f.select(t.node().parentNode);if(!u.empty()){var d=t.attr("class")?t.attr("class").split(" ")[0]:"text";return d+="-math",u.selectAll("svg."+d).remove(),u.selectAll("g."+d+"-group").remove(),t.style("display",null).attr({"data-unformatted":l,"data-math":"N"}),s?(e&&e._promises||[]).push(new Promise(function(e){t.style("display","none");var n=parseInt(t.node().style.fontSize,10);o(s[2],{fontSize:n},function(o,s,c){u.selectAll("svg."+d).remove(),u.selectAll("g."+d+"-group").remove();var f=o&&o.select("svg");if(!f||!f.node())return i(),void e();var h=u.append("g").classed(d+"-group",!0).attr({"pointer-events":"none","data-unformatted":l,"data-math":"Y"});h.node().appendChild(f.node()),s&&s.node()&&f.node().insertBefore(s.node().cloneNode(!0),f.node().firstChild),f.attr({class:d,height:c.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var p=t.node().style.fill||"black";f.select("g").attr({fill:p,stroke:p});var g=r(f,"width"),v=r(f,"height"),m=+t.attr("x")-g*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],y=n||r(t,"height"),x=-y/4;"y"===d[0]?(h.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-g/2,x-v/2]+")"}),f.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===d[0]?f.attr({x:t.attr("x"),y:x-v/2}):"a"===d[0]?f.attr({x:0,y:x}):f.attr({x:m,y:+t.attr("y")+x-v/2}),a&&a.call(t,h),e(h)})})):i(),t}};var m=/(<|<|<)/g,y=/(>|>|>)/g,x={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},b={sub:"0.3em",sup:"-0.6em"},_={sub:"-0.21em",sup:"0.42em"},w="\u200b",M=["http:","https:","mailto:","",void 0,":"],k=new RegExp("]*)?/?>","g"),A=Object.keys(p.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:p.entityToUnicode[t]}}),T=/(\r\n?|\n)/g,L=/(<[^<>]*>)/,C=/<(\/?)([^ >]*)(\s+(.*))?>/i,S=//i,z=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,P=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,O=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,D=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i,E=/(^|;)\s*color:/;n.plainText=function(t){return(t||"").replace(k," ")},n.lineCount=function(t){return t.selectAll("tspan.line").size()||1},n.positionText=function(t,e,n){return t.each(function(){function t(t,e){return void 0===e?null===(e=r.attr(t))&&(r.attr(t,0),e=0):r.attr(t,e),e}var r=f.select(this),a=t("x",e),o=t("y",n);"text"===this.nodeName&&r.selectAll("tspan.line").attr({x:a,y:o})})},n.makeEditable=function(t,e){function n(){a(),t.style({opacity:0});var e,n=s.attr("class");(e=n?"."+n.split(" ")[0]+"-math-group":"[class*=-math-group]")&&f.select(t.node().parentNode).select(e).style({opacity:0})}function r(t){var e=t.node(),n=document.createRange();n.selectNodeContents(e);var r=window.getSelection();r.removeAllRanges(),r.addRange(n),e.focus()}function a(){var n=f.select(o),a=n.select(".svg-container"),i=a.append("div"),s=t.node().style,c=parseFloat(s.fontSize||12);i.classed("plugin-editable editable",!0).style({position:"absolute","font-family":s.fontFamily||"Arial","font-size":c,color:e.fill||s.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-c/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(e.text||t.attr("data-unformatted")).call(u(t,a,e)).on("blur",function(){o._editing=!1,t.text(this.textContent).style({opacity:1});var e,n=f.select(this).attr("class");(e=n?"."+n.split(" ")[0]+"-math-group":"[class*=-math-group]")&&f.select(t.node().parentNode).select(e).style({opacity:0});var r=this.textContent;f.select(this).transition().duration(0).remove(),f.select(document).on("mouseup",null),l.edit.call(t,r)}).on("focus",function(){var t=this;o._editing=!0,f.select(document).on("mouseup",function(){if(f.event.target===t)return!1;document.activeElement===i.node()&&i.node().blur()})}).on("keyup",function(){27===f.event.which?(o._editing=!1,t.style({opacity:1}),f.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),l.cancel.call(t,this.textContent)):(l.input.call(t,this.textContent),f.select(this).call(u(t,a,e)))}).on("keydown",function(){13===f.event.which&&this.blur()}).call(r)}var o=e.gd,i=e.delegate,l=f.dispatch("edit","input","cancel"),s=i||t;if(t.style({"pointer-events":i?"none":"all"}),1!==t.size())throw new Error("boo");return e.immediate?n():s.on("click",n),f.rebind(t,l,"on")}},{"../constants/alignment":133,"../constants/string_mappings":136,"../constants/xmlns_namespaces":137,"../lib":153,d3:8}],174:[function(t,e,n){"use strict";function r(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}var a={};n.throttle=function(t,e,n){function o(){n(),i.ts=Date.now(),i.onDone&&(i.onDone(),i.onDone=null)}var i=a[t],l=Date.now();if(!i){for(var s in a)a[s].tsi.ts+e)return void o();i.timer=setTimeout(function(){o(),i.timer=null},e)},n.done=function(t){var e=a[t];return e&&e.timer?new Promise(function(t){var n=e.onDone;e.onDone=function(){n&&n(),t(),e.onDone=null}}):Promise.resolve()},n.clear=function(t){if(t)r(a[t]),delete a[t];else for(var e in a)n.clear(e)}},{}],175:[function(t,e,n){"use strict";var r=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var n=Math.log(Math.min(e[0],e[1]))/Math.LN10;return r(n)||(n=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),n}},{"fast-isnumeric":11}],176:[function(t,e,n){"use strict";var r=e.exports={},a=t("../plots/geo/constants").locationmodeToLayer,o=t("topojson-client").feature;r.getTopojsonName=function(t){return[t.scope.replace(/ /g,"-"),"_",t.resolution.toString(),"m"].join("")},r.getTopojsonPath=function(t,e){return t+e+".json"},r.getTopojsonFeatures=function(t,e){var n=a[t.locationmode],r=e.objects[n];return o(e,r).features}},{"../plots/geo/constants":220,"topojson-client":18}],177:[function(t,e,n){"use strict";var r=t("../registry");e.exports=function(t){for(var e,n,a=r.layoutArrayContainers,o=r.layoutArrayRegexes,i=t.split("[")[0],l=0;l0)return t.substr(0,e)}var l=t("fast-isnumeric"),s=t("gl-mat4/fromQuat"),c=t("../registry"),u=t("../lib"),f=t("../plots/plots"),d=t("../plots/cartesian/axes"),h=t("../components/color");n.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&u.log("Clearing previous rejected promises from queue."),t._promises=[]},n.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1);var a=d.list({_fullLayout:t});for(e=0;e3?(v.x=1.02,v.xanchor="left"):v.x<-2&&(v.x=-.02,v.xanchor="right"),v.y>3?(v.y=1.02,v.yanchor="bottom"):v.y<-2&&(v.y=-.02,v.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var m=f.getSubplotIds(t,"gl3d");for(e=0;e1&&i.warn("Full array edits are incompatible with other edits",f);var y=n[""][""];if(u(y))e.set(null);else{if(!Array.isArray(y))return i.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!g&&(d(v,m),h(t),!0)}var x,b,_,w,M,k,A,T=Object.keys(n).map(Number).sort(l),L=e.get(),C=L||[],S=r(m,f).get(),z=[],P=-1,O=C.length;for(x=0;xC.length-(A?0:1))i.warn("index out of range",f,_);else if(void 0!==k)M.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(k)?z.push(_):A?("add"===k&&(k={}),C.splice(_,0,k),S&&S.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,k),-1===P&&(P=_);else for(b=0;b=0;x--)C.splice(z[x],1),S&&S.splice(z[x],1);if(C.length?L||e.set(C):e.set(null),g)return!1;if(d(v,m),p!==o){var D;if(-1===P)D=T;else{for(O=Math.max(C.length,O),D=[],x=0;x=P);x++)D.push(_);for(x=P;x=t.data.length||a<-t.data.length)throw new Error(n+" must be valid indices for gd.data.");if(e.indexOf(a,r+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 "+n+" must be unique.")}}function c(t,e,n){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),s(t,e,"currentIndices"),void 0===n||Array.isArray(n)||(n=[n]),void 0!==n&&s(t,n,"newIndices"),void 0!==n&&e.length!==n.length)throw new Error("current and new indices must be of equal length.")}function u(t,e,n){var r,a;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),r=0;r=0&&sY.range[0]?[1,2]:[2,1]);else{var W=Y.range[0],Q=Y.range[1];X?(W<=0&&Q<=0&&n(E+".autorange",!0),W<=0?W=Q/1e6:Q<=0&&(Q=W/1e6),n(E+".range[0]",Math.log(W)/Math.LN10),n(E+".range[1]",Math.log(Q)/Math.LN10)):(n(E+".range[0]",Math.pow(10,W)),n(E+".range[1]",Math.pow(10,Q)))}else n(E+".autorange",!0);A.getComponentMethod("annotations","convertCoords")(t,B,S,n),A.getComponentMethod("images","convertCoords")(t,B,S,n)}else n(E+".autorange",!0),n(E+".range",null);w.nestedProperty(c,E+"._inputRange").set(null)}else if(O.match(F.AX_NAME_PATTERN)){var $=w.nestedProperty(c,k).get(),J=(S||{}).type;J&&"-"!==J||(J="linear"),A.getComponentMethod("annotations","convertCoords")(t,$,J,n),A.getComponentMethod("images","convertCoords")(t,$,J,n)}var K=N.containerArrayMatch(k);if(K){o=K.array,i=K.index;var tt=K.property,et=w.nestedProperty(s,o),nt=(et||[])[i]||{},rt=nt,at=H||{editType:"calc"},ot=-1!==at.editType.indexOf("calcIfAutorange");""===i?(ot?y.calc=!0:j.update(y,at),ot=!1):""===tt&&(rt=S,N.isAddVal(S)?b[k]=null:N.isRemoveVal(S)?(b[k]=nt,rt=nt):w.warn("unrecognized full object value",e)),ot&&(r(rt,"x")||r(rt,"y"))?y.calc=!0:j.update(y,at),d[o]||(d[o]={});var it=d[o][i];it||(it=d[o][i]={}),it[tt]=S,delete e[k]}else"reverse"===O?(I.range?I.range.reverse():(n(E+".autorange",!0),I.range=[1,0]),B.autorange?y.calc=!0:y.plot=!0):((!c._has("gl2d")||"dragmode"!==k||"lasso"!==S&&"select"!==S||"lasso"===q||"select"===q)&&H?j.update(y,H):y.calc=!0,C.set(S))}}for(o in d){N.applyContainerArrayChanges(t,w.nestedProperty(s,o),d[o],y)||(y.plot=!0)}var lt=c._axisConstraintGroups;for(m in M)for(i=0;i=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 n=0;return function(){if(t&&++n===e)return t()}}if(t=w.getGraphDiv(t),!w.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=[]),n=L.supplyAnimationDefaults(n);var l=n.transition,s=n.frame;return void 0===i._frameWaitingCnt&&(i._frameWaitingCnt=0),new Promise(function(s,c){function u(){t.emit("plotly_animated"),window.cancelAnimationFrame(i._animationRaf),i._animationRaf=null}function f(){i._currentFrame&&i._currentFrame.onComplete&&i._currentFrame.onComplete();var e=i._currentFrame=i._frameQueue.shift();if(e){var n=e.name?e.name.toString():null;t._fullLayout._currentFrame=n,i._lastFrameAt=Date.now(),i._timeToNext=e.frameOpts.duration,L.transition(t,e.frame.data,e.frame.layout,R.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then(function(){e.onComplete&&e.onComplete()}),t.emit("plotly_animatingframe",{name:n,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else u()}function d(){ t.emit("plotly_animating"),i._lastFrameAt=-1/0,i._timeToNext=0,i._runningTransitions=0,i._currentFrame=null;var e=function(){i._animationRaf=window.requestAnimationFrame(e),Date.now()-i._lastFrameAt>i._timeToNext&&f()};e()}function h(t){return Array.isArray(l)?v>=l.length?t.transitionOpts=l[v]:t.transitionOpts=l[0]:t.transitionOpts=l,v++,t}var p,g,v=0,m=[],y=void 0===e||null===e,x=Array.isArray(e);if(y||x||!w.isPlainObject(e)){if(y||-1!==["string","number"].indexOf(typeof e))for(p=0;p0&&MM)&&k.push(g);m=k}}m.length>0?function(e){if(0!==e.length){for(var l=0;l=0;a--)if(w.isPlainObject(e[a])){var d=(c[e[a].name]||{}).name,h=e[a].name;d&&h&&"number"==typeof h&&c[d]&&(r++,w.warn('addFrames: overwriting frame "'+c[d].name+'" with a frame whose name of type "number" also equates to "'+d+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),r>5&&w.warn("addFrames: This API call has yielded too many warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),f.push({frame:L.supplyFrameDefaults(e[a]),index:n&&void 0!==n[a]&&null!==n[a]?n[a]:u+a})}f.sort(function(t,e){return t.index>e.index?-1:t.index=0;a--){if(o=f[a].frame,"number"==typeof o.name&&w.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!o.name)for(;c[o.name="frame "+t._transitionData._counter++];);if(c[o.name]){for(i=0;i=0;n--)r=e[n],o.push({type:"delete",index:r}),i.unshift({type:"insert",index:r,value:a[r]});var l=L.modifyFrames,s=L.modifyFrames,c=[t,i],u=[t,o];return k&&k.add(t,l,c,s,u),L.modifyFrames(t,o)},_.purge=function(t){t=w.getGraphDiv(t);var e=t._fullLayout||{},n=t._fullData||[];return L.cleanPlot([],{},n,e),L.purge(t),M.purge(t),e._container&&e._container.remove(),delete t._context,t}},{"../components/color":36,"../components/drawing":60,"../components/errorbars":66,"../constants/xmlns_namespaces":137,"../lib":153,"../lib/events":144,"../lib/queue":166,"../lib/svg_text_utils":173,"../plotly":189,"../plots/cartesian/axis_ids":197,"../plots/cartesian/constants":199,"../plots/cartesian/constraints":201,"../plots/cartesian/graph_interact":203,"../plots/plots":231,"../plots/polar":234,"../registry":239,"./edit_types":178,"./helpers":179,"./manage_arrays":180,"./plot_schema":183,"./subroutines":186,d3:8,"fast-isnumeric":11,"has-hover":13}],182:[function(t,e,n){"use strict";e.exports={staticPlot:!1,editable:!1,edits:{annotationPosition:!1,annotationTail:!1,annotationText:!1,axisTitleText:!1,colorbarPosition:!1,colorbarTitleText:!1,legendPosition:!1,legendText:!1,shapePosition:!1,titleText:!1},autosizable:!1,queueLength:0,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showAxisDragHandles:!0,showAxisRangeEntryBoxes:!0,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:"transparent",topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:!1,globalTransforms:[]}},{}],183:[function(t,e,n){"use strict";function r(t,e){var n,r,a,o,i=t._basePlotModules;if(i){var l;for(n=0;n=t.items.length)return!1;t=t.items[a]}}return t}function o(t){return t===Math.round(t)&&t>=0}function i(t){var e,n;"area"===t?(e={attributes:w},n={}):(e=v.modules[t]._module,n=e.basePlotModule);var r={};r.type=null,T(r,y),T(r,e.attributes),n.attributes&&T(r,n.attributes),r.type=t;var a={meta:e.meta||{},attributes:u(r)};if(e.layoutAttributes){var o={};T(o,e.layoutAttributes),a.layoutAttributes=u(o)}return a}function l(){var t,e,n={};T(n,x);for(t in v.subplotsRegistry)if(e=v.subplotsRegistry[t],e.layoutAttributes)if("cartesian"===e.name)p(n,e,"xaxis"),p(n,e,"yaxis");else{var r="subplot"===e.attr?e.name:e.attr;p(n,e,r)}n=h(n);for(t in v.componentsRegistry){e=v.componentsRegistry[t];var a=e.schema;if(a&&(a.subplots||a.layout)){var o=a.subplots;if(o&&o.xaxis&&!o.yaxis)for(var i in o.xaxis)delete n.yaxis[i]}else e.layoutAttributes&&g(n,e.layoutAttributes,e.name)}return{layoutAttributes:u(n)}}function s(t){var e=v.transformsRegistry[t],n=T({},e.attributes);return Object.keys(v.componentsRegistry).forEach(function(e){var r=v.componentsRegistry[e];r.schema&&r.schema.transforms&&r.schema.transforms[t]&&Object.keys(r.schema.transforms[t]).forEach(function(e){g(n,r.schema.transforms[t][e],e)})}),{attributes:u(n)}}function c(){var t={frames:m.extendDeepAll({},b)};return u(t),t.frames}function u(t){return f(t),d(t),t}function f(t){function e(t){return{valType:"string",editType:"none"}}function r(t,r,a){n.isValObject(t)?"data_array"===t.valType?(t.role="data",a[r+"src"]=e(r)):!0===t.arrayOk&&(a[r+"src"]=e(r)):m.isPlainObject(t)&&(t.role="object")}n.crawl(t,r)}function d(t){function e(t,e,n){if(t){var r=t[C];r&&(delete t[C],n[e]={items:{}},n[e].items[r]=t,n[e].role="object")}}n.crawl(t,e)}function h(t){return A(t,{radialaxis:M.radialaxis,angularaxis:M.angularaxis}),A(t,M.layout),t}function p(t,e,n){var r=m.nestedProperty(t,n),a=T({},e.layoutAttributes);a[L]=!0,r.set(a)}function g(t,e,n){var r=m.nestedProperty(t,n);r.set(T(r.get()||{},e))}var v=t("../registry"),m=t("../lib"),y=t("../plots/attributes"),x=t("../plots/layout_attributes"),b=t("../plots/frame_attributes"),_=t("../plots/animation_attributes"),w=t("../plots/polar/area_attributes"),M=t("../plots/polar/axis_attributes"),k=t("./edit_types"),A=m.extendFlat,T=m.extendDeepAll,L="_isSubplotObj",C="_isLinkedToArray",S=[L,C,"_arrayAttrRegexps","_deprecated"];n.IS_SUBPLOT_OBJ=L,n.IS_LINKED_TO_ARRAY=C,n.DEPRECATED="_deprecated",n.UNDERSCORE_ATTRS=S,n.get=function(){var t={};v.allTypes.concat("area").forEach(function(e){t[e]=i(e)});var e={};return Object.keys(v.transformsRegistry).forEach(function(t){e[t]=s(t)}),{defs:{valObjects:m.valObjectMeta,metaKeys:S.concat(["description","role","editType","impliedEdits"]),editType:{traces:k.traces,layout:k.layout},impliedEdits:{}},traces:t,layout:l(),transforms:e,frames:c(),animation:u(_)}},n.crawl=function(t,e,r,a){var o=r||0;a=a||"",Object.keys(t).forEach(function(r){var i=t[r];if(-1===S.indexOf(r)){var l=(a?a+".":"")+r;e(i,r,t,o,l),n.isValObject(i)||m.isPlainObject(i)&&"impliedEdits"!==r&&n.crawl(i,e,o+1,l)}})},n.isValObject=function(t){return t&&void 0!==t.valType},n.findArrayAttributes=function(t){function e(e,n,i,l){if(o=o.slice(0,l).concat([n]),e&&("data_array"===e.valType||!0===e.arrayOk)&&!("colorbar"===o[l-1]&&("ticktext"===n||"tickvals"===n))){var s=r(o),c=m.nestedProperty(t,s).get();Array.isArray(c)&&a.push(s)}}function r(t){return t.join(".")}var a=[],o=[];if(n.crawl(y,e),t._module&&t._module.attributes&&n.crawl(t._module.attributes,e),t.transforms)for(var i=t.transforms,l=0;l=t.transforms.length)return!1;n=(v.transformsRegistry[t.transforms[s].type]||{}).attributes,r=n&&n[e[2]],l=3}else if("area"===t.type)r=w[i];else{var c=t._module;if(c||(c=(v.modules[t.type||y.type.dflt]||{})._module),!c)return!1;if(n=c.attributes,!(r=n&&n[i])){var u=c.basePlotModule;u&&u.attributes&&(r=u.attributes[i])}r||(r=y[i])}return a(r,e,l)},n.getLayoutValObject=function(t,e){return a(r(t,e[0]),e,1)}},{"../lib":153,"../plots/animation_attributes":190,"../plots/attributes":192,"../plots/frame_attributes":219,"../plots/layout_attributes":229,"../plots/polar/area_attributes":232,"../plots/polar/axis_attributes":233,"../registry":239,"./edit_types":178}],184:[function(t,e,n){"use strict";function r(t){i.register(t,t.name,t.categories,t.meta),i.subplotsRegistry[t.basePlotModule.name]||i.registerSubplot(t.basePlotModule)}function a(t){if("string"!=typeof t.name)throw new Error("Transform module *name* must be a string.");var e="Transform module "+t.name,n="function"==typeof t.transform,r="function"==typeof t.calcTransform;if(!n&&!r)throw new Error(e+" is missing a *transform* or *calcTransform* method.");n&&r&&l.log([e+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),l.isPlainObject(t.attributes)||l.log(e+" registered without an *attributes* object."),"function"!=typeof t.supplyDefaults&&l.log(e+" registered without a *supplyDefaults* method."),i.registerTransform(t)}function o(t){if("string"!=typeof t.name)throw new Error("Component module *name* must be a string.");i.registerComponent(t)}var i=t("../registry"),l=t("../lib");e.exports=function(t){if(!t)throw new Error("No argument passed to Plotly.register.");t&&!Array.isArray(t)&&(t=[t]);for(var e=0;e=t[1]||a[1]<=t[0])&&(o[0]e[0]))return!0}return!1}function a(t,e,n){return t._anchorAxis===e&&(t.mirror||t.side===n)||"all"===t.mirror||"allticks"===t.mirror||t.mirrors&&t.mirrors[e._id+n]}function o(t,e,n){var r=[],a=e._anchorAxis;if(a){var o=a._mainAxis;if(-1===r.indexOf(o)){r.push(o);for(var i=0;i1&&s.push(i("object","layout"))),d.supplyDefaults(c);for(var u=c._fullData,v=n.length,m=0;m.3*f||o(r)||o(a))){var d=n.dtick/2;t+=t+d.8){var i=Number(n.substr(1));o.exactYears>.8&&i%12==0?t=B.tickIncrement(t,"M6","reverse")+1.5*E:o.exactMonths>.8?t=B.tickIncrement(t,"M1","reverse")+15.5*E:t-=E/2;var l=B.tickIncrement(t,n);if(l<=r)return l}return t}function l(t){var e,n,r=t.tickvals,a=t.ticktext,o=new Array(r.length),i=A.simpleMap(t.range,t.r2l),l=1.0001*i[0]-1e-4*i[1],s=1.0001*i[1]-1e-4*i[0],c=Math.min(l,s),f=Math.max(l,s),d=0;Array.isArray(a)||(a=[]);var h="category"===t.type?t.d2l_noadd:t.d2l;for("log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1)),n=0;nc&&e10||"01-01"!==r.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=E&&a<=10||e>=15*E)t._tickround="d";else if(e>=R&&a<=16||e>=N)t._tickround="M";else if(e>=I&&a<=19||e>=R)t._tickround="S";else{var o=t.l2r(n+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20}}else if(M(e)||"L"===e.charAt(0)){var i=t.range.map(t.r2d||Number);M(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&&(g(t.exponentformat)&&!v(s)?t._tickexponent=3*Math.round((s-1)/3):t._tickexponent=s)}else t._tickround=null}function u(t,e,n){var r=t.tickfont||{};return{x:e,dx:0,dy:0,text:n||"",fontSize:r.size,font:r.family,fontColor:r.color}}function f(t,e,n,r){var a=t._tickround,o=n&&t.hoverformat||t.tickformat;r&&(a=M(a)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[a]);var i,l=A.formatDate(e.x,o,a,t.calendar),s=l.indexOf("\n");-1!==s&&(i=l.substr(s+1),l=l.substr(0,s)),r&&("00:00:00"===l||"00:00"===l?(l=i,i=""):8===l.length&&(l=l.replace(/:00$/,""))),i&&(n?"d"===a?l+=", "+i:l=i+(l?", "+l:""):t._inCalcTicks&&i===t._prevDateHead||(l+="
"+i,t._prevDateHead=i)),e.text=l}function d(t,e,n,r,a){var o=t.dtick,i=e.x;if("never"===a&&(a=""),!r||"string"==typeof o&&"L"===o.charAt(0)||(o="L3"),t.tickformat||"string"==typeof o&&"L"===o.charAt(0))e.text=m(Math.pow(10,i),t,a,r);else if(M(o)||"D"===o.charAt(0)&&A.mod(i+.01,1)<.1){var l=Math.round(i);-1!==["e","E","power"].indexOf(t.exponentformat)||g(t.exponentformat)&&v(l)?(e.text=0===l?1:1===l?"10":l>1?"10"+l+"":"10"+j+-l+"",e.fontSize*=1.25):(e.text=m(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,A.mod(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 h(t,e){var n=t._categories[Math.round(e.x)];void 0===n&&(n=""),e.text=String(n)}function p(t,e,n,r,a){"never"===a?a="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide"),e.text=m(e.x,t,a,r)}function g(t){return"SI"===t||"B"===t}function v(t){return t>14||t<-15}function m(t,e,n,r){var a=t<0,o=e._tickround,i=n||e.exponentformat||"B",l=e._tickexponent,s=e.tickformat,u=e.separatethousands;if(r){var f={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:M(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};c(f),o=(Number(f._tickround)||0)+4,l=f._tickexponent,e.hoverformat&&(s=e.hoverformat)}if(s)return w.format(s)(t).replace(/-/g,j);var d=Math.pow(10,-o)/2;if("none"===i&&(l=0),(t=Math.abs(t))"+m+"":"B"===i&&9===l?t+="B":g(i)&&(t+=Q[l/3+5])}return a?j+t:t}function y(t,e){var n,r,a=[];for(n=0;n1)for(r=1;r2e-6||((n-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},B.getAutoRange=function(t){var e,n=[],r=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(r===a){var g=r-1,v=r+1;n="tozero"===t.rangemode?r<0?[g,0]:[0,v]:"nonnegative"===t.rangemode?[Math.max(0,g),Math.max(0,v)]:[g,v]}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)),n=[s.val-d*s.pad,c.val+d*c.pad]);return n[0]===n[1]&&("tozero"===t.rangemode?n=n[0]<0?[n[0],0]:n[0]>0?[0,n[0]]:[0,1]:(n=[n[0]-1,n[0]+1],"nonnegative"===t.rangemode&&(n[0]=Math.max(0,n[0])))),h&&n.reverse(),A.simpleMap(n,t.l2r||Number)},B.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=B.getAutoRange(t),t._r=t.range.slice(),t._rl=A.simpleMap(t._r,t.r2l);var n=t._input;n.range=t.range.slice(),n.autorange=t.autorange}},B.saveRangeInitial=function(t,e){for(var n=B.list(t,"",!0),r=!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(r(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||!!A.nestedProperty(t,"rangeslider.autorange").get())&&e){t._min||(t._min=[]),t._max||(t._max=[]),n||(n={}),t._m||t.setScale();var o,i,l,s,c,u,f,d,h,p,g,v=e.length,m=n.padded?.05*t._length:0,y=n.tozero&&("linear"===t.type||"-"===t.type);m&&"domain"===t.constrain&&t._inputDomain&&(m*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0]));var x=r((t._m>0?n.ppadplus:n.ppadminus)||n.ppad||0),b=r((t._m>0?n.ppadminus:n.ppadplus)||n.ppad||0),_=r(n.vpadplus||n.vpad),w=r(n.vpadminus||n.vpad);for(o=0;o<6;o++)a(o);for(o=v-1;o>5;o--)a(o)}},B.autoBin=function(t,e,n,r,a){var l=A.aggNums(Math.min,null,t),s=A.aggNums(Math.max,null,t);if(a||(a=e.calendar),"category"===e.type)return{start:l-.5,end:s+.5,size:1,_count:s-l+1};var c;if(n)c=(s-l)/n;else{var u=A.distinctVals(t),f=Math.pow(10,Math.floor(Math.log(u.minDiff)/Math.LN10)),d=f*A.roundUp(u.minDiff/f,[.9,1.9,4.9,9.9],!0);c=Math.max(d,2*A.stdev(t)/Math.pow(t.length,r?.25:.4)),M(c)||(c=1)}var h;h="log"===e.type?{type:"linear",range:[l,s]}:{type:e.type,range:A.simpleMap([l,s],e.c2r,0,a),calendar:a},B.setConvert(h),B.autoTicks(h,c);var p,g,v=B.tickIncrement(B.tickFirst(h),h.dtick,"reverse",a);if("number"==typeof h.dtick)v=o(v,t,h,l,s),g=1+Math.floor((s-v)/h.dtick),p=v+g*h.dtick;else for("M"===h.dtick.charAt(0)&&(v=i(v,t,h.dtick,l,a)),p=v,g=0;p<=s;)p=B.tickIncrement(p,h.dtick,!1,a),g++;return{start:e.c2r(v,0,a),end:e.c2r(p,0,a),size:h.dtick,_count:g}},B.calcTicks=function(t){var e=A.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var n,r=t.nticks;r||("category"===t.type?(n=t.tickfont?1.2*(t.tickfont.size||12):15,r=t._length/n):(n="y"===t._id.charAt(0)?40:80,r=A.constrain(t._length/n,4,9)+1)),"array"===t.tickmode&&(r*=100),B.autoTicks(t,Math.abs(e[1]-e[0])/r),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}if(t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),c(t),"array"===t.tickmode)return l(t);t._tmin=B.tickFirst(t);var a=e[1]=i:f<=i)&&!(o.length>u||f===s);f=B.tickIncrement(f,t.dtick,a,t.calendar))s=f,o.push(f);t._tmax=o[o.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var d=new Array(o.length),h=0;hO?(e/=O,n=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*s(e,n,U)):r>D?(e/=D,t.dtick="M"+s(e,1,G)):r>E?(t.dtick=s(e,E,X),t.tick0=A.dateTick0(t.calendar,!0)):r>N?t.dtick=s(e,N,G):r>R?t.dtick=s(e,R,Y):r>I?t.dtick=s(e,I,Y):(n=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=s(e,n,U))}else if("log"===t.type){t.tick0=0;var a=A.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(a[1]-a[0])<1){var o=1.5*Math.abs((a[1]-a[0])/e);e=Math.abs(Math.pow(10,a[1])-Math.pow(10,a[0]))/o,n=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+s(e,n,U)}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,n=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=s(e,n,U));if(0===t.dtick&&(t.dtick=1),!M(t.dtick)&&"string"!=typeof t.dtick){var i=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(i)}},B.tickIncrement=function(t,e,n,r){var a=n?-1:1;if(M(e))return t+a*e;var o=e.charAt(0),i=a*Number(e.substr(1));if("M"===o)return A.incrementMonth(t,i,r);if("L"===o)return Math.log(Math.pow(10,t)+i)/Math.LN10;if("D"===o){var l="D2"===e?W:Z,s=t+.01*a,c=A.roundUp(A.mod(s,1),l,n);return Math.floor(s)+Math.log(w.round(Math.pow(10,c),1))/Math.LN10}throw"unrecognized dtick "+String(e)},B.tickFirst=function(t){var e=t.r2l||Number,n=A.simpleMap(t.range,e),r=n[1]1&&e2*a}function o(t){for(var e,n=Math.max(1,(t.length-1)/1e3),r=0,a=0,o=0;o2*r}var i=t("fast-isnumeric"),l=t("../../lib"),s=t("../../constants/numerical").BADNUM;e.exports=function(t,e){return a(t,e)?"date":o(t)?"category":r(t)?"linear":"-"}},{"../../constants/numerical":135,"../../lib":153,"fast-isnumeric":11}],196:[function(t,e,n){"use strict";var r=t("tinycolor2").mix,a=t("../../registry"),o=t("../../lib"),i=t("../../components/color/attributes").lightFraction,l=t("./layout_attributes"),s=t("./tick_value_defaults"),c=t("./tick_mark_defaults"),u=t("./tick_label_defaults"),f=t("./category_order_defaults"),d=t("./set_convert"),h=t("./ordered_categories");e.exports=function(t,e,n,p,g){function v(n,r){return o.coerce2(t,e,l,n,r)}var m=p.letter,y=p.font||{},x="Click to enter "+(p.title||m.toUpperCase()+" axis")+" title",b=n("visible",!p.cheateronly),_=e.type;if("date"===_){a.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",p.calendar)}if(d(e,g),n("autorange",!e.isValidRange(t.range))&&n("rangemode"),n("range"),e.cleanRange(),f(t,e,n),e._initialCategories="category"===_?h(m,e.categoryorder,e.categoryarray,p.data):[],!b)return e;var w=n("color"),M=w===t.color?w:y.color;n("title",x),o.coerceFont(n,"titlefont",{family:y.family,size:Math.round(1.2*y.size),color:M}),s(t,e,n,_),u(t,e,n,_,p),c(t,e,n,p);var k=v("linecolor",w),A=v("linewidth"),T=n("showline",!!k||!!A);T||(delete e.linecolor,delete e.linewidth),(T||e.ticks)&&n("mirror");var L=v("gridcolor",r(w,p.bgColor,i).toRgbString()),C=v("gridwidth");n("showgrid",p.showGrid||!!L||!!C)||(delete e.gridcolor,delete e.gridwidth);var S=v("zerolinecolor",w),z=v("zerolinewidth");return n("zeroline",p.showGrid||!!S||!!z)||(delete e.zerolinecolor,delete e.zerolinewidth),e}},{"../../components/color/attributes":35,"../../lib":153,"../../registry":239,"./category_order_defaults":198,"./layout_attributes":205,"./ordered_categories":207,"./set_convert":211,"./tick_label_defaults":212,"./tick_mark_defaults":213,"./tick_value_defaults":214,tinycolor2:17}],197:[function(t,e,n){"use strict";function r(t,e,n){function r(t,n){for(var r=Object.keys(t),a=/^[xyz]axis[0-9]*/,o=[],i=0;i0;o&&(r="array");var i=n("categoryorder",r);"array"===i&&n("categoryarray"),o||"array"!==i||(e.categoryorder="trace")}}},{}],199:[function(t,e,n){"use strict";var r=t("../../lib").counterRegex;e.exports={idRegex:{x:r("x"),y:r("y")},attrRegex:r("[xy]axis"),xAxisMatch:r("xaxis"),yAxisMatch:r("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,SELECTDELAY:100,SELECTID:"-select",DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","maplayer","barlayer","carpetlayer","boxlayer","scatterlayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},{"../../lib":153}],200:[function(t,e,n){"use strict";function r(t,e,n,r){var a,o,l,s,c=r[i(e)].type,u=[];for(o=0;oi*m)||_)for(n=0;nP&&DS&&(S=D);var R=(S-C)/(2*z);f/=R,C=s.l2r(C),S=s.l2r(S),s.range=s._input.range=A=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function c(t,e){return t?"nsew"===t?"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}function u(t,e,n,r,a){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)", -"stroke-width":0}).attr("transform","translate("+n+", "+r+")").attr("d",a+"Z")}function f(t,e,n){return t.append("path").attr("class","zoombox-corners").style({fill:T.background,stroke:T.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+n+")").attr("d","M0,0Z")}function d(t){t.selectAll(".select-outline").remove()}function h(t,e,n,r,a,o){t.attr("d",r+"M"+n.l+","+n.t+"v"+n.h+"h"+n.w+"v-"+n.h+"h-"+n.w+"Z"),a||(t.transition().style("fill",o>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function p(t){b.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function g(t){return-1!==["lasso","select"].indexOf(t)}function v(t,e){return"M"+(t.l-.5)+","+(e-j-.5)+"h-3v"+(2*j+1)+"h3ZM"+(t.r+.5)+","+(e-j-.5)+"h3v"+(2*j+1)+"h-3Z"}function m(t,e){return"M"+(e-j-.5)+","+(t.t-.5)+"v-3h"+(2*j+1)+"v3ZM"+(e-j-.5)+","+(t.b+.5)+"v3h"+(2*j+1)+"v-3Z"}function y(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,j)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function x(t,e,n){var r,a,o,i,l,s,c=!1,u={},f={};for(r=0;rj||l>j?(kt="xy",i/ot>l/it?(l=i*it/ot,xt>o?bt.t=xt-l:bt.b=xt+l):(i=l*ot/it,yt>a?bt.l=yt-i:bt.r=yt+i),Tt.attr("d",y(bt))):r():!st||lzoom back out","long"),F=!1)}function X(e,n){var r=1===(q+H).length;if(e)J();else if(2!==n||r){if(1===n&&r){var a=q?nt[0]:et[0],i="s"===q||"w"===H?0:1,l=a._name+".range["+i+"]",s=o(a,i),c="left",u="middle";if(a.fixedrange)return;q?(u="n"===q?"top":"bottom","right"===a.side&&(c="right")):"e"===H&&(c="right"),t._context.showAxisRangeEntryBoxes&&b.select(vt).call(A.makeEditable,{gd:t,immediate:!0,background:ht.paper_bgcolor,text:String(s),fill:a.tickfont?a.tickfont.color:"#444",horizontalAlign:c,verticalAlign:u}).on("edit",function(e){var n=a.d2r(e);void 0!==n&&w.relayout(t,l,n)})}}else $()}function Z(e){function n(t,e,n){function r(e){return t.l2r(o+(e-o)*n)}if(!t.fixedrange){var a=k.simpleMap(t.range,t.r2l),o=a[0]+(a[1]-a[0])*e;t.range=a.map(r)}}if(t._context.scrollZoom||ht._enablescrollzoom){if(t._transitioningWithDuration)return k.pauseEvent(e);var r=t.querySelector(".plotly");if(V(),!(r.scrollHeight-r.clientHeight>10||r.scrollWidth-r.clientWidth>10)){clearTimeout(St);var a=-e.deltaY;if(isFinite(a)||(a=e.wheelDelta/10),!isFinite(a))return void k.log("Did not find wheel motion attributes: ",e);var o,i=Math.exp(-Math.min(Math.max(a,-20),20)/200),l=Pt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),s=(e.clientX-l.left)/l.width,c=(l.bottom-e.clientY)/l.height;if(H||ut){for(H||(s=.5),o=0;o rect").call(L.setTranslate,l,s).call(L.setScale,o,i);var w=g.plot.selectAll(".scatterlayer .points, .boxlayer .points");g.plot.call(L.setTranslate,b,_).call(L.setScale,1/o,1/i),w.selectAll(".point").call(L.setPointGroupScale,o,i).call(L.hideOutsideRangePoints,g),w.selectAll(".textpoint").call(L.setTextPointsScale,o,i).call(L.hideOutsideRangePoints,g)}}}var tt,et,nt,rt,at,ot,it,lt,st,ct,ut,ft,dt,ht=t._fullLayout,pt=t._fullLayout._zoomlayer,gt=q+H==="nsew";V();var vt=r(e,q+H+"drag",ct,n,T,C,B);if(!st&&!lt&&!g(ht.dragmode))return vt.onmousedown=null,vt.style.pointerEvents=gt?"all":"none",vt;var mt={element:vt,gd:t,plotinfo:e,prepFn:function(e,n,r){var a=t._fullLayout.dragmode;gt?e.shiftKey&&(a="pan"===a?"zoom":"pan"):a="pan",mt.minDrag="lasso"===a?1:void 0,"zoom"===a?(mt.moveFn=G,mt.doneFn=Y,mt.minDrag=1,U(e,n,r)):"pan"===a?(mt.moveFn=W,mt.doneFn=X,d(pt)):g(a)&&(mt.xaxes=et,mt.yaxes=nt,E(e,n,r,mt,a))}};S.init(mt);var yt,xt,bt,_t,wt,Mt,kt,At,Tt,Lt={},Ct=[0,0,ot,it],St=null,zt=R.REDRAWDELAY,Pt=e.mainplot?ht._plots[e.mainplot]:e;return q.length*H.length!=1&&(void 0!==vt.onwheel?vt.onwheel=Z:void 0!==vt.onmousewheel&&(vt.onmousewheel=Z)),vt}},{"../../components/color":36,"../../components/dragelement":57,"../../components/drawing":60,"../../constants/alignment":133,"../../lib":153,"../../lib/setcursor":171,"../../lib/svg_text_utils":173,"../../plotly":189,"../../registry":239,"../plots":231,"./axes":194,"./axis_ids":197,"./constants":199,"./scale_zoom":209,"./select":210,d3:8,tinycolor2:17}],203:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("../../components/fx"),o=t("../../components/dragelement"),i=t("./constants"),l=t("./dragbox");e.exports=function(t){var e=t._fullLayout;if((e._has("cartesian")||e._has("gl2d"))&&!t._context.staticPlot){Object.keys(e._plots||{}).sort(function(t,n){if((e._plots[t].mainplot&&!0)===(e._plots[n].mainplot&&!0)){var r=t.split("y"),a=n.split("y");return r[0]===a[0]?Number(r[1]||1)-Number(a[1]||1):Number(r[0]||1)-Number(a[0]||1)}return e._plots[t].mainplot?1:-1}).forEach(function(n){var s=e._plots[n],c=s.xaxis,u=s.yaxis,f=(c._linepositions[n]||[])[3],d=(u._linepositions[n]||[])[3],h=i.DRAGGERSIZE;if(r(f)&&"top"===c.side&&(f-=h),r(d)&&"right"!==u.side&&(d-=h),!s.mainplot){var p=l(t,s,0,0,c._length,u._length,"ns","ew");p.onmousemove=function(e){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===n&&a.hover(t,e,n)},a.hover(t,e,n),t._fullLayout._lasthover=p,t._fullLayout._hoversubplot=n},p.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,o.unhover(t,e))},p.onclick=function(e){a.click(t,e,n)},t._context.showAxisDragHandles&&(l(t,s,-h,-h,h,h,"n","w"),l(t,s,c._length,-h,h,h,"n","e"),l(t,s,-h,u._length,h,h,"s","w"),l(t,s,c._length,u._length,h,h,"s","e"))}t._context.showAxisDragHandles&&(r(f)&&("free"===c.anchor&&(f-=e._size.h*(1-u.domain[1])),l(t,s,.1*c._length,f,.8*c._length,h,"","ew"),l(t,s,0,f,.1*c._length,h,"","w"),l(t,s,.9*c._length,f,.1*c._length,h,"","e")),r(d)&&("free"===u.anchor&&(d-=e._size.w*c.domain[0]),l(t,s,d,.1*u._length,h,.8*u._length,"ns",""),l(t,s,d,.9*u._length,h,.1*u._length,"s",""),l(t,s,d,0,h,.1*u._length,"n","")))});var n=e._hoverlayer.node();n.onmousemove=function(n){n.target=e._lasthover,a.hover(t,n,e._hoversubplot)},n.onclick=function(n){n.target=e._lasthover,a.click(t,n)},n.onmousedown=function(t){e._lasthover.onmousedown(t)}}}},{"../../components/dragelement":57,"../../components/fx":77,"./constants":199,"./dragbox":202,"fast-isnumeric":11}],204:[function(t,e,n){"use strict";function r(t,e,n,r,a){var o=t._fullLayout,i=o._modules;e.plot&&e.plot.selectAll("g:not(.scatterlayer)").selectAll("g.trace").remove();for(var l=0;lu[1]-.01&&(e.domain=[0,1]),a.noneOrAll(t.domain,e.domain,[0,1])}return n("layer"),e}},{"../../lib":153,"fast-isnumeric":11}],209:[function(t,e,n){"use strict";var r=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,n){void 0===n&&(n=r[t.constraintoward||"center"]);var a=[t.r2l(t.range[0]),t.r2l(t.range[1])],o=a[0]+(a[1]-a[0])*n;t.range=t._input.range=[t.l2r(o+(a[0]-o)*e),t.l2r(o+(a[1]-o)*e)]}},{"../../constants/alignment":133}],210:[function(t,e,n){"use strict";function r(t){return t._id}function a(t,e){if(Array.isArray(t))for(var n=e.cd[0].trace,r=0;r0)return Math.log(e)/Math.LN10;if(e<=0&&n&&t.range&&2===t.range.length){var r=t.range[0],a=t.range[1];return.5*(r+a-3*M*Math.abs(r-a))}return h}function f(e,n,r){var a=c(e,r||t.calendar);if(a===h){if(!o(e))return h;a=c(new Date(+e))}return a}function v(e,n,r){return s(e,n,r||t.calendar)}function m(e){return t._categories[Math.round(e)]}function y(e){if(null!==e&&void 0!==e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var n=t._categories.length-1;return t._categoriesMap[e]=n,n}return h}function x(e){if(t._categoriesMap){var n=t._categoriesMap[e];if(void 0!==n)return n}if(o(e))return+e}function b(e){return o(e)?a.round(t._b+t._m*e,2):h}function _(e){return(e-t._b)/t._m}e=e||{};var w=(t._id||"x").charAt(0),M=10;t.c2l="log"===t.type?n:u,t.l2c="log"===t.type?r:u,t.l2p=b,t.p2l=_,t.c2p="log"===t.type?function(t,e){return b(n(t,e))}:b,t.p2c="log"===t.type?function(t){return r(_(t))}:_,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=l,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=_,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return n(l(t),e)},t.r2d=t.r2c=function(t){return r(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=u,t.c2r=n,t.l2d=r,t.d2p=function(e,n){return t.l2p(t.d2r(e,n))},t.p2d=function(t){return r(_(t))},t.r2p=function(e){return t.l2p(l(e))},t.p2r=_,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=i.identity,t.d2c=t.r2c=t.d2l=t.r2l=f,t.c2d=t.c2r=t.l2d=t.l2r=v,t.d2p=t.r2p=function(e,n,r){return t.l2p(f(e,0,r))},t.p2d=t.p2r=function(t,e,n){return v(_(t),e,n)},t.cleanPos=function(e){return i.cleanDate(e,h,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=y,t.r2d=t.c2d=t.l2d=m,t.d2r=t.d2l_noadd=x,t.r2c=function(e){var n=x(e);return void 0!==n?n:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=x,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return m(_(t))},t.r2p=t.d2p,t.p2r=_,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}),t.fraction2r=function(e){var n=t.r2l(t.range[0]),r=t.r2l(t.range[1]);return t.l2r(n+e*(r-n))},t.r2fraction=function(e){var n=t.r2l(t.range[0]),r=t.r2l(t.range[1]);return(t.r2l(e)-n)/(r-n)},t.cleanRange=function(e){e||(e="range");var n,r,a=i.nestedProperty(t,e).get();if(r="date"===t.type?i.dfltRange(t.calendar):"y"===w?p.DFLTRANGEY:p.DFLTRANGEX, -r=r.slice(),!a||2!==a.length)return void i.nestedProperty(t,e).set(r);for("date"===t.type&&(a[0]=i.cleanDate(a[0],h,t.calendar),a[1]=i.cleanDate(a[1],h,t.calendar)),n=0;n<2;n++)if("date"===t.type){if(!i.isDateTime(a[n],t.calendar)){t[e]=r;break}if(t.r2l(a[0])===t.r2l(a[1])){var l=i.constrain(t.r2l(a[0]),i.MIN_MS+1e3,i.MAX_MS-1e3);a[0]=t.l2r(l-1e3),a[1]=t.l2r(l+1e3);break}}else{if(!o(a[n])){if(!o(a[1-n])){t[e]=r;break}a[n]=a[1-n]*(n?10:.1)}if(a[n]<-d?a[n]=-d:a[n]>d&&(a[n]=d),a[0]===a[1]){var s=Math.max(1,Math.abs(1e-6*a[0]));a[0]-=s,a[1]+=s}}},t.setScale=function(n){var r=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var a=g.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var o=n&&t._r?"_r":"range",l=t.calendar;t.cleanRange(o);var s=t.r2l(t[o][0],l),c=t.r2l(t[o][1],l);if("y"===w?(t._offset=r.t+(1-t.domain[1])*r.h,t._length=r.h*(t.domain[1]-t.domain[0]),t._m=t._length/(s-c),t._b=-t._m*c):(t._offset=r.l+t.domain[0]*r.w,t._length=r.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-s),t._b=-t._m*s),!isFinite(t._m)||!isFinite(t._b))throw i.notifier("Something went wrong with axis scaling","long"),e._replotting=!1,new Error("axis scaling")},t.makeCalcdata=function(e,n){var r,a,o,i="date"===t.type&&e[n+"calendar"];if(n in e)for(r=e[n],a=new Array(r.length),o=0;o=t.range[0]&&n<=t.range[1]}:function(e){var n=e.y;return n>=t.range[0]&&n<=t.range[1]},t._min=[],t._max=[],t._separators=e.separators,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":135,"../../lib":153,"./axis_ids":197,"./constants":199,d3:8,"fast-isnumeric":11}],212:[function(t,e,n){"use strict";function r(t){var e=["showexponent","showtickprefix","showticksuffix"],n=e.filter(function(e){return void 0!==t[e]}),r=function(e){return t[e]===t[n[0]]};if(n.every(r)||1===n.length)return t[n[0]]}var a=t("../../lib");e.exports=function(t,e,n,o,i){var l=r(t);if(n("tickprefix")&&n("showtickprefix",l),n("ticksuffix")&&n("showticksuffix",l),n("showticklabels")){var s=i.font||{},c=e.color===t.color?e.color:s.color;a.coerceFont(n,"tickfont",{family:s.family,size:s.size,color:c}),n("tickangle"),"category"!==o&&(n("tickformat")||"date"===o||(n("showexponent",l),n("exponentformat"),n("separatethousands")))}"category"===o||i.noHover||n("hoverformat")}},{"../../lib":153}],213:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,n,o){var i=r.coerce2(t,e,a,"ticklen"),l=r.coerce2(t,e,a,"tickwidth"),s=r.coerce2(t,e,a,"tickcolor",e.color);n("ticks",o.outerTicks||i||l||s?"outside":"")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":153,"./layout_attributes":205}],214:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("../../lib"),o=t("../../constants/numerical").ONEDAY;e.exports=function(t,e,n,i){var l="auto";"array"!==t.tickmode||"log"!==i&&"date"!==i||(t.tickmode="auto"),Array.isArray(t.tickvals)?l="array":t.dtick&&(l="linear");var s=n("tickmode",l);if("auto"===s)n("nticks");else if("linear"===s){var c="date"===i?o:1,u=n("dtick",c);if(r(u))e.dtick=u>0?Number(u):c;else if("string"!=typeof u)e.dtick=c;else{var f=u.charAt(0),d=u.substr(1);d=r(d)?Number(d):0,(d<=0||!("date"===i&&"M"===f&&d===Math.round(d)||"log"===i&&"L"===f||"log"===i&&"D"===f&&(1===d||2===d)))&&(e.dtick=c)}var h="date"===i?a.dateTick0(e.calendar):0,p=n("tick0",h);"date"===i?e.tick0=a.cleanDate(p,h):r(p)&&"D1"!==u&&"D2"!==u?e.tick0=Number(p):e.tick0=h}else{var g=n("tickvals");void 0===g?e.tickmode="auto":n("ticktext")}}},{"../../constants/numerical":135,"../../lib":153,"fast-isnumeric":11}],215:[function(t,e,n){"use strict";var r=t("d3"),a=t("../../plotly"),o=t("../../registry"),i=t("../../components/drawing"),l=t("./axes"),s=t("./constants").attrRegex;e.exports=function(t,e,n,c){function u(e,n){function r(e,n,r){for(a=0;a rect").call(i.setTranslate,0,0).call(i.setScale,1,1),t.plot.call(i.setTranslate,e._offset,n._offset).call(i.setScale,1,1);var r=t.plot.select(".scatterlayer").selectAll(".points");r.selectAll(".point").call(i.setPointGroupScale,1,1).call(i.hideOutsideRangePoints,t),r.selectAll(".textpoint").call(i.setTextPointsScale,1,1).call(i.hideOutsideRangePoints,t)}function d(e,n){var r,a,o,l=y[e.xaxis._id],s=y[e.yaxis._id],c=[];if(l){r=t._fullLayout[l.axisName],a=r._r,o=l.to,c[0]=(a[0]*(1-n)+n*o[0]-a[0])/(a[1]-a[0])*e.xaxis._length;var f=a[1]-a[0],d=o[1]-o[0];r.range[0]=a[0]*(1-n)+n*o[0],r.range[1]=a[1]*(1-n)+n*o[1],c[2]=e.xaxis._length*(1-n+n*d/f)}else c[0]=0,c[2]=e.xaxis._length;if(s){r=t._fullLayout[s.axisName],a=r._r,o=s.to,c[1]=(a[1]*(1-n)+n*o[1]-a[1])/(a[0]-a[1])*e.yaxis._length;var h=a[1]-a[0],p=o[1]-o[0];r.range[0]=a[0]*(1-n)+n*o[0],r.range[1]=a[1]*(1-n)+n*o[1],c[3]=e.yaxis._length*(1-n+n*p/h)}else c[1]=0,c[3]=e.yaxis._length;u(e.xaxis,e.yaxis);var g=e.xaxis,m=e.yaxis,x=!!l,b=!!s,_=x?g._length/c[2]:1,w=b?m._length/c[3]:1,M=x?c[0]:0,k=b?c[1]:0,A=x?c[0]/c[2]*g._length:0,T=b?c[1]/c[3]*m._length:0,L=g._offset-A,C=m._offset-T;v._defs.select("#"+e.clipId+"> rect").call(i.setTranslate,M,k).call(i.setScale,1/_,1/w),e.plot.call(i.setTranslate,L,C).call(i.setScale,_,w).selectAll(".points").selectAll(".point").call(i.setPointGroupScale,1/_,1/w),e.plot.selectAll(".points").selectAll(".textpoint").call(i.setTextPointsScale,1/_,1/w)}function h(){for(var e={},n=0;nn.duration?(h(),k=window.cancelAnimationFrame(g)):k=window.requestAnimationFrame(g)}var v=t._fullLayout,m=[],y=function(t){var e,n,r,a,o={};for(e in t)if(n=e.split("."),n[0].match(s)){var i=e.charAt(0),l=n[0];if(r=v[l],a={},Array.isArray(t[e])?a.to=t[e].slice(0):Array.isArray(t[e].range)&&(a.to=t[e].range.slice(0)),!a.to)continue;a.axisName=l,a.length=r._length,m.push(i),o[i]=a}return o}(e),x=Object.keys(y),b=function(t,e,n){var r,a,o,i=t._plots,l=[];for(r in i){var s=i[r];if(-1===l.indexOf(s)){var c=s.xaxis._id,u=s.yaxis._id,f=s.xaxis.range,d=s.yaxis.range;s.xaxis._r=s.xaxis.range.slice(),s.yaxis._r=s.yaxis.range.slice(),a=n[c]?n[c].to:f,o=n[u]?n[u].to:d,f[0]===a[0]&&f[1]===a[1]&&d[0]===o[0]&&d[1]===o[1]||-1===e.indexOf(c)&&-1===e.indexOf(u)||l.push(s)}}return l}(v,x,y);if(!b.length)return function(){function e(e,n,r){for(var a=0;a0?".":"")+a;c.isPlainObject(o)?l(o,e,i,r+1):e(i,a,o)}})}var s=t("../plotly"),c=t("../lib");n.manageCommandObserver=function(t,e,a,o){var i={},l=!0;e&&e._commandObserver&&(i=e._commandObserver),i.cache||(i.cache={}),i.lookupTable={};var s=n.hasSimpleAPICommandBindings(t,a,i.lookupTable);if(e&&e._commandObserver){if(s)return i;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,i}if(s){r(t,s,i.cache),i.check=function(){if(l){var e=r(t,s,i.cache);return e.changed&&o&&void 0!==i.lookupTable[e.value]&&(i.disable(),Promise.resolve(o({value:e.value,type:s.type,prop:s.prop,traces:s.traces,index:i.lookupTable[e.value]})).then(i.enable,i.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;fa*Math.PI/180}return!1},r.getPath=function(){return l.geo.path().projection(r)},r.getBounds=function(t){return r.getPath().bounds(t)},r.fitExtent=function(t,e){var n=t[1][0]-t[0][0],a=t[1][1]-t[0][1],o=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),o&&r.clipExtent(null);var i=r.getBounds(e),l=Math.min(n/(i[1][0]-i[0][0]),a/(i[1][1]-i[0][1])),s=+t[0][0]+(n-l*(i[1][0]+i[0][0]))/2,c=+t[0][1]+(a-l*(i[1][1]+i[0][1]))/2;return o&&r.clipExtent(o),r.scale(150*l).translate([s,c])},r.precision(y.precision),a&&r.clipAngle(a-y.clipPad),r}function o(t,e){var n=e[t],r=n.dtick,a=y.scopeDefaults[e.scope],o=a.lonaxisRange,i=a.lataxisRange,s="lonaxis"===t?[r]:[0,r];return l.geo.graticule().extent([[o[0],i[0]],[o[1],i[1]]]).step(s)}function i(t,e){var n=y.clipPad,r=t[0]+n,a=t[1]-n,o=e[0]+n,i=e[1]-n;r>0&&a<0&&(a+=360);var l=(a-r)/4;return{type:"Polygon",coordinates:[[[r,o],[r,i],[r+l,i],[r+2*l,i],[r+3*l,i],[a,i],[a,o],[a-l,o],[a-2*l,o],[a-3*l,o],[r,o]]]}}var l=t("d3"),s=t("../../plotly"),c=t("../../lib"),u=t("../../components/color"),f=t("../../components/drawing"),d=t("../../components/fx"),h=t("../plots"),p=t("../cartesian/axes"),g=t("../../components/dragelement"),v=t("../cartesian/select"),m=t("./zoom"),y=t("./constants"),x=t("../../lib/topojson_utils"),b=t("topojson-client").feature;t("./projections")(l);var _=r.prototype;e.exports=function(t){return new r(t)},_.plot=function(t,e,n){var r=this,a=e[this.id],o=x.getTopojsonName(a);null===r.topojson||o!==r.topojsonName?(r.topojsonName=o,void 0===PlotlyGeoAssets.topojson[r.topojsonName]?n.push(r.fetchTopojson().then(function(n){PlotlyGeoAssets.topojson[r.topojsonName]=n,r.topojson=n,r.update(t,e)})):(r.topojson=PlotlyGeoAssets.topojson[r.topojsonName],r.update(t,e))):r.update(t,e)},_.fetchTopojson=function(){var t=x.getTopojsonPath(this.topojsonURL,this.topojsonName);return new Promise(function(e,n){l.json(t,function(r,a){if(r)return n(404===r.status?new Error(["plotly.js could not find topojson file at",t,".","Make sure the *topojsonURL* plot config option","is set properly."].join(" ")):new Error(["unexpected error while fetching topojson file at",t].join(" ")));e(a)})})},_.update=function(t,e){var n=e[this.id];if(!this.updateProjection(e,n)){this.hasChoropleth=!1;for(var r=0;r0&&M<0&&(M+=360);var k,A=(w+M)/2;if(!u){var T=f?s.projRotate:[A,0,0];k=n("projection.rotation.lon",T[0]),n("projection.rotation.lat",T[1]),n("projection.rotation.roll",T[2]),r=n("showcoastlines",!f),r&&(n("coastlinecolor"),n("coastlinewidth")),r=n("showocean"),r&&n("oceancolor")}var L,C;if(u?(L=-96.6,C=38.7):(L=f?A:k,C=(_[0]+_[1])/2),n("center.lon",L),n("center.lat",C),d){n("projection.parallels",s.projParallels||[0,60])}n("projection.scale"),r=n("showland"),r&&n("landcolor"),r=n("showlakes"),r&&n("lakecolor"),r=n("showrivers"),r&&(n("rivercolor"),n("riverwidth")),r=n("showcountries",f&&"usa"!==i),r&&(n("countrycolor"),n("countrywidth")),("usa"===i||"north america"===i&&50===a)&&(n("showsubunits",!0),n("subunitcolor"),n("subunitwidth")),f||(r=n("showframe",!0))&&(n("framecolor"),n("framewidth")),n("bgcolor")}var a=t("../../subplot_defaults"),o=t("../constants"),i=t("./layout_attributes"),l=o.axesNames;e.exports=function(t,e,n){a(t,e,n,{type:"geo",attributes:i,handleDefaults:r,partition:"y"})}},{"../../subplot_defaults":238,"../constants":220,"./layout_attributes":225}],225:[function(t,e,n){"use strict";var r=t("../../../components/color/attributes"),a=t("../constants"),o=t("../../../plot_api/edit_types").overrideAll,i={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number"},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:r.lightLine},gridwidth:{valType:"number",min:0,dflt:1}};e.exports=o({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]}},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:Object.keys(a.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:Object.keys(a.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:r.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:a.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:a.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:a.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:a.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:r.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:r.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:r.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:r.background},lonaxis:i,lataxis:i},"plot","from-root")},{"../../../components/color/attributes":35,"../../../plot_api/edit_types":178,"../constants":220}],226:[function(t,e,n){"use strict";function r(t){function e(t,e){return{type:"Feature",id:t.id,properties:t.properties,geometry:n(t.geometry,e)}}function n(e,r){if(!e)return null;if("GeometryCollection"===e.type)return{type:"GeometryCollection",geometries:object.geometries.map(function(t){return n(t,r)})};if(!L.hasOwnProperty(e.type))return null;var a=L[e.type];return t.geo.stream(e,r(a)),a.result()}function r(){}function a(t){if((e=t.length)<4)return!1;for(var e,n=0,r=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++nr^h>r&&n<(d-c)*(r-u)/(h-u)+c&&(a=!a)}return a}function i(t){return t?t/Math.sin(t):1}function l(t){return t>1?P:t<-1?-P:Math.asin(t)}function s(t){return t>1?0:t<-1?z:Math.acos(t)}function c(t,e){var n=(2+P)*Math.sin(e);e/=2;for(var r=0,a=1/0;r<10&&Math.abs(a)>C;r++){var o=Math.cos(e);e-=a=(e+Math.sin(e)*(o+2)-n)/(2*o*(1+o))}return[2/Math.sqrt(z*(4+z))*t*(1+Math.cos(e)),2*Math.sqrt(z/(4+z))*Math.sin(e)]}function u(t,e){function n(n,r){var a=R(n/e,r);return a[0]*=t,a}return arguments.length<2&&(e=t),1===e?R:e===1/0?d:(n.invert=function(n,r){var a=R.invert(n/t,r);return a[0]*=e,a},n)}function f(){var t=2,e=N(u),n=e(t);return n.coefficient=function(n){return arguments.length?e(t=+n):t},n}function d(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function h(t,e){return[3*t/(2*z)*Math.sqrt(z*z/3-e*e),e]}function p(t,e){return[t,1.25*Math.log(Math.tan(z/4+.4*e))]}function g(t){return function(e){var n,r=t*Math.sin(e),a=30;do{e-=n=(e+Math.sin(e)-r)/(1+Math.cos(e))}while(Math.abs(n)>C&&--a>0);return e/2}}function v(t,e){var n=e*e,r=n*n -;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}function m(t,e){var n,r=Math.min(18,36*Math.abs(e)/z),a=Math.floor(r),o=r-a,i=(n=j[a])[0],l=n[1],s=(n=j[++a])[0],c=n[1],u=(n=j[Math.min(19,++a)])[0],f=n[1];return[t*(s+o*(u-i)/2+o*o*(u-2*s+i)/2),(e>0?P:-P)*(c+o*(f-l)/2+o*o*(f-2*c+l)/2)]}function y(t,e){return[t*Math.cos(e),e]}function x(t,e){var n=Math.cos(e),r=i(s(n*Math.cos(t/=2)));return[2*n*Math.sin(t)*r,Math.sin(e)*r]}function b(t,e){var n=x(t,e);return[(n[0]+t/P)/2,(n[1]+e)/2]}t.geo.project=function(t,e){var r=e.stream;if(!r)throw new Error("not yet supported");return(t&&_.hasOwnProperty(t.type)?_[t.type]:n)(t,r)};var _={Feature:e,FeatureCollection:function(t,n){return{type:"FeatureCollection",features:t.features.map(function(t){return e(t,n)})}}},w=[],M=[],k={point:function(t,e){w.push([t,e])},result:function(){var t=w.length?w.length<2?{type:"Point",coordinates:w[0]}:{type:"MultiPoint",coordinates:w}:null;return w=[],t}},A={lineStart:r,point:function(t,e){w.push([t,e])},lineEnd:function(){w.length&&(M.push(w),w=[])},result:function(){var t=M.length?M.length<2?{type:"LineString",coordinates:M[0]}:{type:"MultiLineString",coordinates:M}:null;return M=[],t}},T={polygonStart:r,lineStart:r,point:function(t,e){w.push([t,e])},lineEnd:function(){var t=w.length;if(t){do{w.push(w[0].slice())}while(++t<4);M.push(w),w=[]}},polygonEnd:r,result:function(){if(!M.length)return null;var t=[],e=[];return M.forEach(function(n){a(n)?t.push([n]):e.push(n)}),e.forEach(function(e){var n=e[0];t.some(function(t){if(o(t[0],n))return t.push(e),!0})||t.push([e])}),M=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},L={Point:k,MultiPoint:k,LineString:A,MultiLineString:A,Polygon:T,MultiPolygon:T,Sphere:T},C=1e-6,S=C*C,z=Math.PI,P=z/2,O=(Math.sqrt(z),z/180),D=180/z,E=t.geo.projection,N=t.geo.projectionMutator;t.geo.interrupt=function(e){function n(t,n){for(var r=n<0?-1:1,a=s[+(n<0)],o=0,i=a.length-1;oa[o][2][0];++o);var l=e(t-a[o][1][0],n);return l[0]+=e(a[o][1][0],r*n>r*a[o][0][1]?a[o][0][1]:n)[0],l}function r(){l=s.map(function(t){return t.map(function(t){var n,r=e(t[0][0],t[0][1])[0],a=e(t[2][0],t[2][1])[0],o=e(t[1][0],t[0][1])[1],i=e(t[1][0],t[1][1])[1];return o>i&&(n=o,o=i,i=n),[[r,o],[a,i]]})})}function a(){for(var e=1e-6,n=[],r=0,a=s[0].length;r=0;--r){var i=s[1][r],l=180*i[0][0]/z,c=180*i[0][1]/z,u=180*i[1][1]/z,f=180*i[2][0]/z,d=180*i[2][1]/z;n.push(o([[f-e,d-e],[f-e,u+e],[l+e,u+e],[l+e,c-e]],30))}return{type:"Polygon",coordinates:[t.merge(n)]}}function o(t,e){for(var n,r,a,o=-1,i=t.length,l=t[0],s=[];++oC&&--a>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},(t.geo.naturalEarth=function(){return E(v)}).raw=v;var j=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];j.forEach(function(t){t[1]*=1.0144}),m.invert=function(t,e){var n=e/P,r=90*n,a=Math.min(18,Math.abs(r/5)),o=Math.max(0,Math.floor(a));do{var i=j[o][1],l=j[o+1][1],s=j[Math.min(19,o+2)][1],c=s-i,u=s-2*l+i,f=2*(Math.abs(n)-l)/c,d=u/c,h=f*(1-d*f*(1-2*d*f));if(h>=0||1===o){r=(e>=0?5:-5)*(h+a);var p,g=50;do{a=Math.min(18,Math.abs(r)/5),o=Math.floor(a),h=a-o,i=j[o][1],l=j[o+1][1],s=j[Math.min(19,o+2)][1],r-=(p=(e>=0?P:-P)*(l+h*(s-i)/2+h*h*(s-2*l+i)/2)-e)*D}while(Math.abs(p)>S&&--g>0);break}}while(--o>=0);var v=j[o][0],m=j[o+1][0],y=j[Math.min(19,o+2)][0];return[t/(m+h*(y-v)/2+h*h*(y-2*m+v)/2),r*O]},(t.geo.robinson=function(){return E(m)}).raw=m,y.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return E(y)}).raw=y,x.invert=function(t,e){if(!(t*t+4*e*e>z*z+C)){var n=t,r=e,a=25;do{var o,i=Math.sin(n),l=Math.sin(n/2),c=Math.cos(n/2),u=Math.sin(r),f=Math.cos(r),d=Math.sin(2*r),h=u*u,p=f*f,g=l*l,v=1-p*c*c,m=v?s(f*c)*Math.sqrt(o=1/v):o=0,y=2*m*f*l-t,x=m*u-e,b=o*(p*g+m*f*c*h),_=o*(.5*i*d-2*m*u*l),w=.25*o*(d*l-m*u*p*i),M=o*(h*c+m*g*f),k=_*w-M*b;if(!k)break;var A=(x*_-y*M)/k,T=(y*w-x*b)/k;n-=A,r-=T}while((Math.abs(A)>C||Math.abs(T)>C)&&--a>0);return[n,r]}},(t.geo.aitoff=function(){return E(x)}).raw=x,b.invert=function(t,e){var n=t,r=e,a=25;do{var o,i=Math.cos(r),l=Math.sin(r),c=Math.sin(2*r),u=l*l,f=i*i,d=Math.sin(n),h=Math.cos(n/2),p=Math.sin(n/2),g=p*p,v=1-f*h*h,m=v?s(i*h)*Math.sqrt(o=1/v):o=0,y=.5*(2*m*i*p+n/P)-t,x=.5*(m*l+r)-e,b=.5*o*(f*g+m*i*h*u)+.5/P,_=o*(d*c/4-m*l*p),w=.125*o*(c*p-m*l*f*d),M=.5*o*(u*h+m*g*i)+.5,k=_*w-M*b,A=(x*_-y*M)/k,T=(y*w-x*b)/k;n-=A,r-=T}while((Math.abs(A)>C||Math.abs(T)>C)&&--a>0);return[n,r]},(t.geo.winkel3=function(){return E(b)}).raw=b}e.exports=r},{}],227:[function(t,e,n){"use strict";function r(t,e){var n=t.projection;return(e._isScoped?i:e._isClipped?s:l)(t,n)}function a(t,e){return w.behavior.zoom().translate(e.translate()).scale(e.scale())}function o(t,e,n){function r(t,e){var n=M.nestedProperty(l,t);n.get()!==e&&(n.set(e),M.nestedProperty(i,t).set(e),s[a+"."+t]=e)}var a=t.id,o=t.graphDiv,i=o.layout[a],l=o._fullLayout[a],s={};n(r),r("projection.scale",e.scale()/t.fitScale),o.emit("plotly_relayout",s)}function i(t,e){function n(){w.select(this).style(T)}function r(){e.scale(w.event.scale).translate(w.event.translate),t.render()}function i(n){var r=e.invert(t.midPt);n("center.lon",r[0]),n("center.lat",r[1])}function l(){w.select(this).style(L),o(t,e,i)}var s=a(t,e);return s.on("zoomstart",n).on("zoom",r).on("zoomend",l),s}function l(t,e){function n(t){return e.invert(t)}function r(t){var r=e(n(t));return Math.abs(r[0]-t[0])>x||Math.abs(r[1]-t[1])>x}function i(){w.select(this).style(T),u=w.mouse(this),f=e.rotate(),d=e.translate(),h=f,p=n(u)}function l(){if(g=w.mouse(this),r(u))return y.scale(e.scale()),void y.translate(e.translate());e.scale(w.event.scale),e.translate([d[0],w.event.translate[1]]),p?n(g)&&(m=n(g),v=[h[0]+(m[0]-p[0]),f[1],f[2]],e.rotate(v),h=v):(u=g,p=n(u)),t.render()}function s(){w.select(this).style(L),o(t,e,c)}function c(n){var r=e.rotate(),a=e.invert(t.midPt);n("projection.rotation.lon",-r[0]),n("center.lon",a[0]),n("center.lat",a[1])}var u,f,d,h,p,g,v,m,y=a(t,e),x=2;return y.on("zoomstart",i).on("zoom",l).on("zoomend",s),y}function s(t,e){function n(t){y++||t({type:"zoomstart"})}function r(t){t({type:"zoom"})}function i(t){--y||t({type:"zoomend"})}function l(t){var n=e.rotate();t("projection.rotation.lon",-n[0]),t("projection.rotation.lat",-n[1])}var s,p={r:e.rotate(),k:e.scale()},g=a(t,e),v=_(g,"zoomstart","zoom","zoomend"),y=0,x=g.on;return g.on("zoomstart",function(){w.select(this).style(T);var t=w.mouse(this),a=e.rotate(),o=a,i=e.translate(),l=u(a);s=c(e,t),x.call(g,"zoom",function(){var n=w.mouse(this);if(e.scale(p.k=w.event.scale),s){if(c(e,n)){e.rotate(a).translate(i);var u=c(e,n),g=d(s,u),y=m(f(l,g)),x=p.r=h(y,s,o);isFinite(x[0])&&isFinite(x[1])&&isFinite(x[2])||(x=o),e.rotate(x),o=x}}else t=n,s=c(e,t);r(v.of(this,arguments))}),n(v.of(this,arguments))}).on("zoomend",function(){w.select(this).style(L),x.call(g,"zoom",null),i(v.of(this,arguments)),o(t,e,l)}).on("zoom.redraw",function(){t.render()}),w.rebind(g,v,"on")}function c(t,e){var n=t.invert(e);return n&&isFinite(n[0])&&isFinite(n[1])&&y(n)}function u(t){var e=.5*t[0]*k,n=.5*t[1]*k,r=.5*t[2]*k,a=Math.sin(e),o=Math.cos(e),i=Math.sin(n),l=Math.cos(n),s=Math.sin(r),c=Math.cos(r);return[o*l*c+a*i*s,a*l*c-o*i*s,o*i*c+a*l*s,o*l*s-a*i*c]}function f(t,e){var n=t[0],r=t[1],a=t[2],o=t[3],i=e[0],l=e[1],s=e[2],c=e[3];return[n*i-r*l-a*s-o*c,n*l+r*i+a*c-o*s,n*s-r*c+a*i+o*l,n*c+r*s-a*l+o*i]}function d(t,e){if(t&&e){var n=b(t,e),r=Math.sqrt(x(n,n)),a=.5*Math.acos(Math.max(-1,Math.min(1,x(t,e)))),o=Math.sin(a)/r;return r&&[Math.cos(a),n[2]*o,-n[1]*o,n[0]*o]}}function h(t,e,n){var r=v(e,2,t[0]);r=v(r,1,t[1]),r=v(r,0,t[2]-n[2]);var a,o,i=e[0],l=e[1],s=e[2],c=r[0],u=r[1],f=r[2],d=Math.atan2(l,i)*A,h=Math.sqrt(i*i+l*l);Math.abs(u)>h?(o=(u>0?90:-90)-d,a=0):(o=Math.asin(u/h)*A-d,a=Math.sqrt(h*h-u*u));var g=180-o-2*d,m=(Math.atan2(f,c)-Math.atan2(s,a))*A,y=(Math.atan2(f,c)-Math.atan2(s,-a))*A;return p(n[0],n[1],o,m)<=p(n[0],n[1],g,y)?[o,m,n[2]]:[g,y,n[2]]}function p(t,e,n,r){var a=g(n-t),o=g(r-e);return Math.sqrt(a*a+o*o)}function g(t){return(t%360+540)%360-180}function v(t,e,n){var r=n*k,a=t.slice(),o=0===e?1:0,i=2===e?1:2,l=Math.cos(r),s=Math.sin(r);return a[o]=t[o]*l-t[i]*s,a[i]=t[i]*l+t[o]*s,a}function m(t){return[Math.atan2(2*(t[0]*t[1]+t[2]*t[3]),1-2*(t[1]*t[1]+t[2]*t[2]))*A,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*A,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*A]}function y(t){var e=t[0]*k,n=t[1]*k,r=Math.cos(n);return[r*Math.cos(e),r*Math.sin(e),Math.sin(n)]}function x(t,e){for(var n=0,r=0,a=t.length;r=e.width-20?(o["text-anchor"]="start",o.x=5):(o["text-anchor"]="end",o.x=e._paper.attr("width")-7),n.attr(o);var i=n.select(".js-link-to-tool"),l=n.select(".js-link-spacer"),c=n.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&r(t,i),l.text(i.text()&&c.text()?" - ":"")}},v.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",n=s.select(t).append("div").attr("id","hiddenform").style("display","none"),r=n.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return r.append("input").attr({type:"text",name:"data"}).node().value=v.graphJson(t,!1,"keepdata"),r.node().submit(),n.remove(),t.emit("plotly_afterexport"),!1},v.supplyDefaults=function(t){var e,n=t._fullLayout||{},r=t._fullLayout={},o=t.layout||{},i=t._fullData||[],l=t._fullData=[],s=t.data||[];if(t._transitionData||v.createTransitionData(t),n._initialAutoSizeIsDone){var c=n.width,f=n.height;v.supplyLayoutGlobalDefaults(o,r),o.width||(r.width=c),o.height||(r.height=f)}else{v.supplyLayoutGlobalDefaults(o,r);var d=!o.width||!o.height,h=r.autosize,p=t._context&&t._context.autosizable;d&&(h||p)?v.plotAutoSize(t,o,r):d&&v.sanitizeMargins(t),!h&&d&&(o.width=r.width,o.height=r.height)}r._initialAutoSizeIsDone=!0,r._dataLength=s.length,r._globalTransforms=(t._context||{}).globalTransforms,v.supplyDataDefaults(s,l,o,r),r._has=v._hasPlotType.bind(r);var g=r._modules;for(e=0;e0){var u=i(t._boundingBoxMargins),f=u.left+u.right,d=u.bottom+u.top,p=1-2*l,g=n._container&&n._container.node?n._container.node().getBoundingClientRect():{width:n.width,height:n.height};r=Math.round(p*(g.width-f)),a=Math.round(p*(g.height-d))}else{var m=s?window.getComputedStyle(t):{};r=parseFloat(m.width)||n.width,a=parseFloat(m.height)||n.height}var y=v.layoutAttributes.width.min,x=v.layoutAttributes.height.min;r1,_=!e.height&&Math.abs(n.height-a)>1;(_||b)&&(b&&(n.width=r),_&&(n.height=a)),t._initialAutoSize||(t._initialAutoSize={width:r,height:a}),v.sanitizeMargins(n)},v.supplyLayoutModuleDefaults=function(t,e,n,r){var a,o;u.Axes.supplyLayoutDefaults(t,e,n);var i=e._basePlotModules;for(a=0;a.5*r.width&&(n.l=n.r=0),n.b+n.t>.5*r.height&&(n.b=n.t=0),r._pushmargin[e]={l:{val:n.x,size:n.l+a},r:{val:n.x,size:n.r+a},b:{val:n.y,size:n.b+a},t:{val:n.y,size:n.t+a}}}else delete r._pushmargin[e];r._replotting||v.doAutoMargin(t)}},v.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var n=e._size,r=JSON.stringify(n),a=Math.max(e.margin.l||0,0),o=Math.max(e.margin.r||0,0),i=Math.max(e.margin.t||0,0),l=Math.max(e.margin.b||0,0),s=e._pushmargin;if(!1!==e.margin.autoexpand){s.base={l:{val:0,size:a},r:{val:1,size:o},t:{val:1,size:i},b:{val:0,size:l}};for(var f=Object.keys(s),d=0;dv){var k=(m*w+(M-e.width)*v)/(w-v),A=(M*(1-v)+(m-e.width)*(1-w))/(w-v);k>=0&&A>=0&&k+A>a+o&&(a=k,o=A)}}if(c(x)&&s[_].t){var T=s[_].t.val,L=s[_].t.size;if(T>y){var C=(x*T+(L-e.height)*y)/(T-y),S=(L*(1-y)+(x-e.height)*(1-T))/(T-y);C>=0&&S>=0&&C+S>l+i&&(l=C,i=S)}}}}if(n.l=Math.round(a),n.r=Math.round(o),n.t=Math.round(i),n.b=Math.round(l),n.p=Math.round(e.margin.pad),n.w=Math.round(e.width)-n.l-n.r,n.h=Math.round(e.height)-n.t-n.b,!e._replotting&&"{}"!==r&&r!==JSON.stringify(e._size))return u.plot(t)},v.graphJson=function(t,e,n,r,a){function o(t){if("function"==typeof t)return null;if(h.isPlainObject(t)){var e,r,a={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===n){if("src"===e.substr(e.length-3))continue}else if("keepstream"===n){if("string"==typeof(r=t[e+"src"])&&r.indexOf(":")>0&&!h.isPlainObject(t.stream))continue}else if("keepall"!==n&&"string"==typeof(r=t[e+"src"])&&r.indexOf(":")>0)continue;a[e]=o(t[e])}return a}return Array.isArray(t)?t.map(o):h.isJSDate(t)?h.ms2DateTimeLocal(+t):t}(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&v.supplyDefaults(t);var i=a?t._fullData:t.data,l=a?t._fullLayout:t.layout,s=(t._transitionData||{})._frames,c={data:(i||[]).map(function(t){var n=o(t);return e&&delete n.fit,n})};return e||(c.layout=o(l)),t.framework&&t.framework.isPolar&&(c=t.framework.getConfig()),s&&(c.frames=o(s)),"object"===r?c:JSON.stringify(c)},v.modifyFrames=function(t,e){var n,r,a,o=t._transitionData._frames,i=t._transitionData._frameHash;for(n=0;n0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){b=!0}),a.redraw&&t._transitionData._interruptCallbacks.push(function(){return u.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var i,l,s=0,c=0,d=t._fullLayout._basePlotModules,p=!1;if(n)for(l=0;l=0,S=C?d.angularAxis.domain:r.extent(k),z=Math.abs(k[1]-k[0]);T&&!A&&(z=0);var P=S.slice();L&&A&&(P[1]+=z);var O=d.angularAxis.ticksCount||4;O>8&&(O=O/(O/8)+O%8),d.angularAxis.ticksStep&&(O=(P[1]-P[0])/O);var D=d.angularAxis.ticksStep||(P[1]-P[0])/(O*(d.minorTicks+1));M&&(D=Math.max(Math.round(D),1)),P[2]||(P[2]=D);var E=r.range.apply(this,P);if(E=E.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=r.scale.linear().domain(P.slice(0,2)).range("clockwise"===d.direction?[0,360]:[360,0]),f.layout.angularAxis.domain=s.domain(),f.layout.angularAxis.endPadding=L?z:0,void 0===(e=r.select(this).select("svg.chart-root"))||e.empty()){var N=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),R=this.appendChild(this.ownerDocument.importNode(N.documentElement,!0));e=r.select(R)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var I,j=e.select(".chart-group"),F={fill:"none",stroke:d.tickColor},B={"font-size":d.font.size,"font-family":d.font.family,fill:d.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+d.font.outlineColor}).join(",")};if(d.showLegend){I=e.select(".legend-group").attr({transform:"translate("+[b,d.margin.top]+")"}).style({display:"block"});var q=p.map(function(t,e){var n=l.util.cloneJson(t);return n.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",n.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,n.color="LinePlot"===t.geometry?t.strokeColor:t.color,n});l.Legend().config({data:p.map(function(t,e){return t.name||"Element"+e}),legendConfig:o({},l.Legend.defaultConfig().legendConfig,{container:I,elements:q,reverseOrder:d.legend.reverseOrder})})();var H=I.node().getBBox();b=Math.min(d.width-H.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2,b=Math.max(10,b),w=[d.margin.left+b,d.margin.top+b],a.range([0,b]),f.layout.radialAxis.domain=a.domain(),I.attr("transform","translate("+[w[0]+b,w[1]-b]+")")}else I=e.select(".legend-group").style({display:"none"});e.attr({width:d.width,height:d.height}).style({opacity:d.opacity}),j.attr("transform","translate("+w+")").style({cursor:"crosshair"});var V=[(d.width-(d.margin.left+d.margin.right+2*b+(H?H.width:0)))/2,(d.height-(d.margin.top+d.margin.bottom+2*b))/2];if(V[0]=Math.max(0,V[0]),V[1]=Math.max(0,V[1]),e.select(".outer-group").attr("transform","translate("+V+")"),d.title){var U=e.select("g.title-group text").style(B).text(d.title),G=U.node().getBBox();U.attr({x:w[0]-G.width/2,y:w[1]-b-20})}var Y=e.select(".radial.axis-group");if(d.radialAxis.gridLinesVisible){var X=Y.selectAll("circle.grid-circle").data(a.ticks(5));X.enter().append("circle").attr({class:"grid-circle"}).style(F),X.attr("r",a),X.exit().remove()}Y.select("circle.outside-circle").attr({r:b}).style(F);var Z=e.select("circle.background-circle").attr({r:b}).style({fill:d.backgroundColor,stroke:d.stroke});if(d.radialAxis.visible){var W=r.svg.axis().scale(a).ticks(5).tickSize(5);Y.call(W).attr({transform:"rotate("+d.radialAxis.orientation+")"}),Y.selectAll(".domain").style(F),Y.selectAll("g>text").text(function(t,e){return this.textContent+d.radialAxis.ticksSuffix}).style(B).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===d.radialAxis.tickOrientation?"rotate("+-d.radialAxis.orientation+") translate("+[0,B["font-size"]]+")":"translate("+[0,B["font-size"]]+")"}}),Y.selectAll("g>line").style({stroke:"black"})}var Q=e.select(".angular.axis-group").selectAll("g.angular-tick").data(E),$=Q.enter().append("g").classed("angular-tick",!0);Q.attr({transform:function(t,e){return"rotate("+c(t,e)+")"}}).style({display:d.angularAxis.visible?"block":"none"}),Q.exit().remove(),$.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(d.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(d.minorTicks+1)==0)}).style(F),$.selectAll(".minor").style({stroke:d.minorTickColor}),Q.select("line.grid-line").attr({x1:d.tickLength?b-d.tickLength:0,x2:b}).style({display:d.angularAxis.gridLinesVisible?"block":"none"}),$.append("text").classed("axis-text",!0).style(B);var J=Q.select("text.axis-text").attr({x:b+d.labelOffset,dy:i+"em",transform:function(t,e){var n=c(t,e),r=b+d.labelOffset,a=d.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-n+" "+r+" 0)":"radial"==a?n<270&&n>90?"rotate(180 "+r+" 0)":null:"rotate("+(n<=180&&n>0?-90:90)+" "+r+" 0)"}}).style({"text-anchor":"middle",display:d.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(d.minorTicks+1)!=0?"":M?M[t]+d.angularAxis.ticksSuffix:t+d.angularAxis.ticksSuffix}).style(B);d.angularAxis.rewriteTicks&&J.text(function(t,e){return e%(d.minorTicks+1)!=0?"":d.angularAxis.rewriteTicks(this.textContent,e)});var K=r.max(j.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));I.attr({transform:"translate("+[b+K,d.margin.top]+")"});var tt=e.select("g.geometry-group").selectAll("g").size()>0,et=e.select("g.geometry-group").selectAll("g.geometry").data(p);if(et.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),et.exit().remove(),p[0]||tt){var nt=[];p.forEach(function(t,e){var n={};n.radialScale=a,n.angularScale=s,n.container=et.filter(function(t,n){return n==e}),n.geometry=t.geometry,n.orientation=d.orientation,n.direction=d.direction,n.index=e,nt.push({data:t,geometryConfig:n})});var rt=r.nest().key(function(t,e){return void 0!==t.data.groupId||"unstacked"}).entries(nt),at=[];rt.forEach(function(t,e){"unstacked"===t.key?at=at.concat(t.values.map(function(t,e){return[t]})):at.push(t.values)}),at.forEach(function(t,e){var n;n=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var r=t.map(function(t,e){return o(l[n].defaultConfig(),t)});l[n]().config(r)()})}var ot,it,lt=e.select(".guides-group"),st=e.select(".tooltips-group"),ct=l.tooltipPanel().config({container:st,fontSize:8})(),ut=l.tooltipPanel().config({container:st,fontSize:8})(),ft=l.tooltipPanel().config({container:st,hasTick:!0})();if(!A){var dt=lt.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});j.on("mousemove.angular-guide",function(t,e){var n=l.util.getMousePos(Z).angle;dt.attr({x2:-b,transform:"rotate("+n+")"}).style({opacity:.5});var r=(n+180+360-d.orientation)%360;ot=s.invert(r);var a=l.util.convertToCartesian(b+12,n+180);ct.text(l.util.round(ot)).move([a[0]+w[0],a[1]+w[1]])}).on("mouseout.angular-guide",function(t,e){lt.select("line").style({opacity:0})})}var ht=lt.select("circle").style({stroke:"grey",fill:"none"});j.on("mousemove.radial-guide",function(t,e){var n=l.util.getMousePos(Z).radius;ht.attr({r:n}).style({opacity:.5}),it=a.invert(l.util.getMousePos(Z).radius);var r=l.util.convertToCartesian(n,d.radialAxis.orientation);ut.text(l.util.round(it)).move([r[0]+w[0],r[1]+w[1]])}).on("mouseout.radial-guide",function(t,e){ht.style({opacity:0}),ft.hide(),ct.hide(),ut.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,n){var a=r.select(this),o=this.style.fill,i="black",s=this.style.opacity||1;if(a.attr({"data-opacity":s}),o&&"none"!==o){a.attr({"data-fill":o}),i=r.hsl(o).darker().toString(),a.style({fill:i,opacity:1});var c={t:l.util.round(t[0]),r:l.util.round(t[1])};A&&(c.t=M[t[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),d=e.node().getBoundingClientRect(),h=[f.left+f.width/2-V[0]-d.left,f.top+f.height/2-V[1]-d.top];ft.config({color:i}).text(u),ft.move(h)}else o=this.style.stroke||"black",a.attr({"data-stroke":o}),i=r.hsl(o).darker().toString(),a.style({stroke:i,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=r.event.which)return!1;r.select(this).attr("data-fill")&&ft.show()}).on("mouseout.tooltip",function(t,e){ft.hide();var n=r.select(this),a=n.attr("data-fill");a?n.style({fill:a,opacity:n.attr("data-opacity")}):n.style({stroke:n.attr("data-stroke"),opacity:n.attr("data-opacity")})})}),h}var e,n,a,s,c={data:[],layout:{}},u={},f={},d=r.dispatch("hover"),h={};return h.render=function(e){return t(e),this},h.config=function(t){if(!arguments.length)return c;var e=l.util.cloneJson(t);return e.data.forEach(function(t,e){c.data[e]||(c.data[e]={}),o(c.data[e],l.Axis.defaultConfig().data[0]),o(c.data[e],t)}),o(c.layout,l.Axis.defaultConfig().layout),o(c.layout,e.layout),this},h.getLiveConfig=function(){return f},h.getinputConfig=function(){return u},h.radialScale=function(t){return a},h.angularScale=function(t){return s},h.svg=function(){return e},r.rebind(h,d,"on"),h},l.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:r.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},l.util={},l.DATAEXTENT="dataExtent",l.AREA="AreaChart",l.LINE="LinePlot",l.DOT="DotPlot",l.BAR="BarChart",l.util._override=function(t,e){for(var n in t)n in e&&(e[n]=t[n])},l.util._extend=function(t,e){for(var n in t)e[n]=t[n]},l.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},l.util.dataFromEquation2=function(t,e){var n=e||6;return r.range(0,360+n,n).map(function(e,n){var r=e*Math.PI/180;return[e,t(r)]})},l.util.dataFromEquation=function(t,e,n){var a=e||6,o=[],i=[];r.range(0,360+a,a).forEach(function(e,n){var r=e*Math.PI/180,a=t(r);o.push(e),i.push(a)});var l={t:o,r:i};return n&&(l.name=n),l},l.util.ensureArray=function(t,e){if(void 0===t)return null;var n=[].concat(t);return r.range(e).map(function(t,e){return n[e]||n[0]})},l.util.fillArrays=function(t,e,n){return e.forEach(function(e,r){t[e]=l.util.ensureArray(t[e],n)}),t},l.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},l.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var n=e.shift();return t[n]&&(!e.length||objHasKeys(t[n],e))},l.util.sumArrays=function(t,e){return r.zip(t,e).map(function(t,e){return r.sum(t)})},l.util.arrayLast=function(t){return t[t.length-1]},l.util.arrayEqual=function(t,e){for(var n=Math.max(t.length,e.length,1);n-- >=0&&t[n]===e[n];);return-2===n},l.util.flattenArray=function(t){for(var e=[];!l.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},l.util.deduplicate=function(t){return t.filter(function(t,e,n){return n.indexOf(t)==e})},l.util.convertToCartesian=function(t,e){var n=e*Math.PI/180;return[t*Math.cos(n),t*Math.sin(n)]},l.util.round=function(t,e){var n=e||2,r=Math.pow(10,n);return Math.round(t*r)/r},l.util.getMousePos=function(t){var e=r.mouse(t.node()),n=e[0],a=e[1],o={};return o.x=n,o.y=a,o.pos=e,o.angle=180*(Math.atan2(a,n)+Math.PI)/Math.PI,o.radius=Math.sqrt(n*n+a*a),o},l.util.duplicatesCount=function(t){for(var e,n={},r={},a=0,o=t.length;a0)){var l=r.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:d(i),transform:function(e,n){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return v.fill(n,a,o)},"fill-opacity":0,stroke:function(t,e){return v.stroke(n,a,o)},"stroke-width":function(t,e){return v["stroke-width"](n,a,o)},"stroke-dasharray":function(t,e){return v["stroke-dasharray"](n,a,o)},opacity:function(t,e){return v.opacity(n,a,o)},display:function(t,e){return v.display(n,a,o)}})}};var h=t.angularScale.range(),p=Math.abs(h[1]-h[0])/s[0].length*Math.PI/180,g=r.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,n,a){r.select(this).attr({class:"mark arc",d:g,transform:function(e,n){return"rotate("+(t.orientation+c(e[0])+90)+")"}})};var v={fill:function(t,n,r){return e[r].data.color},stroke:function(t,n,r){return e[r].data.strokeColor},"stroke-width":function(t,n,r){return e[r].data.strokeSize+"px"},"stroke-dasharray":function(t,n,r){return a[e[r].data.strokeDash]},opacity:function(t,n,r){return e[r].data.opacity},display:function(t,n,r){return void 0===e[r].data.visible||e[r].data.visible?"block":"none"}},m=r.select(this).selectAll("g.layer").data(s);m.enter().append("g").attr({class:"layer"});var y=m.selectAll("path.mark").data(function(t,e){return t});y.enter().append("path").attr({class:"mark"}),y.style(v).each(f[t.geometryType]),y.exit().remove(),m.exit().remove()})}var e=[l.PolyChart.defaultConfig()],n=r.dispatch("hover"),a={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,n){e[n]||(e[n]={}),o(e[n],l.PolyChart.defaultConfig()),o(e[n],t)}),this):e},t.getColorScale=function(){},r.rebind(t,n,"on"),t},l.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:r.scale.category20()}}},l.BarChart=function(){return l.PolyChart()},l.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},l.AreaChart=function(){return l.PolyChart()},l.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},l.DotPlot=function(){return l.PolyChart()},l.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},l.LinePlot=function(){return l.PolyChart()},l.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},l.Legend=function(){function t(){var n=e.legendConfig,a=e.data.map(function(t,e){return[].concat(t).map(function(t,r){var a=o({},n.elements[e]);return a.name=t,a.color=[].concat(n.elements[e].color)[r],a})}),i=r.merge(a);i=i.filter(function(t,e){return n.elements[e]&&(n.elements[e].visibleInLegend||void 0===n.elements[e].visibleInLegend)}),n.reverseOrder&&(i=i.reverse());var l=n.container;("string"==typeof l||l.nodeName)&&(l=r.select(l));var s=i.map(function(t,e){return t.color}),c=n.fontSize,u=null==n.isContinuous?"number"==typeof i[0]:n.isContinuous,f=u?n.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=r.range(i.length),v=r.scale[u?"linear":"ordinal"]().domain(g).range(s),m=r.scale[u?"linear":"ordinal"]().domain(g)[u?"range":"rangePoints"]([0,f]),y=function(t,e){var n=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":-1!=r.svg.symbolTypes.indexOf(t)?r.svg.symbol().type(t).size(n)():r.svg.symbol().type("square").size(n)()};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:n.height,width:n.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,m(e)+c/2]+")"},d:function(t,e){var n=t.symbol;return y(n,c)},fill:function(t,e){return v(e)}}),b.exit().remove()}var _=r.svg.axis().scale(m).orient("right"),w=h.select("g.legend-axis").attr({transform:"translate("+[u?n.colorBandWidth:c,c/2]+")"}).call(_);return w.selectAll(".domain").style({fill:"none",stroke:"none"}),w.selectAll("line").style({fill:"none",stroke:u?n.textColor:"none"}),w.selectAll("text").style({fill:n.textColor,"font-size":n.fontSize}).text(function(t,e){return i[e].name}),t}var e=l.Legend.defaultConfig(),n=r.dispatch("hover");return t.config=function(t){return arguments.length?(o(e,t),this):e},r.rebind(t,n,"on"),t},l.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},l.tooltipPanel=function(){var t,e,n,a={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},i="tooltip-"+l.tooltipPanel.uid++,s=function(){t=a.container.selectAll("g."+i).data([0]);var r=t.enter().append("g").classed(i,!0).style({"pointer-events":"none",display:"none"});return n=r.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=r.append("text").attr({dx:a.padding+10,dy:.3*+a.fontSize}),s};return s.text=function(o){var i=r.hsl(a.color).l,l=i>=.5?"#aaa":"white",c=i>=.5?"black":"white",u=o||"";e.style({fill:c,"font-size":a.fontSize+"px"}).text(u);var f=a.padding,d=e.node().getBBox(),h={fill:a.color,stroke:l,"stroke-width":"2px"},p=d.width+2*f+10,g=d.height+2*f;return n.attr({d:"M"+[[10,-g/2],[10,-g/4],[a.hasTick?0:10,0],[10,g/4],[10,g/2],[p,g/2],[p,-g/2]].join("L")+"Z"}).style(h),t.attr({transform:"translate("+[10,-g/2+2*f]+")"}),t.style({display:"block"}),s},s.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),s},s.hide=function(){if(t)return t.style({display:"none"}),s},s.show=function(){if(t)return t.style({display:"block"}),s},s.config=function(t){return o(a,t),s},s},l.tooltipPanel.uid=1,l.adapter={},l.adapter.plotly=function(){var t={};return t.convert=function(t,e){var n={};if(t.data&&(n.data=t.data.map(function(t,n){var r=o({},t);return[[r,["marker","color"],["color"]],[r,["marker","opacity"],["opacity"]],[r,["marker","line","color"],["strokeColor"]],[r,["marker","line","dash"],["strokeDash"]],[r,["marker","line","width"],["strokeSize"]],[r,["marker","symbol"],["dotType"]],[r,["marker","size"],["dotSize"]],[r,["marker","barWidth"],["barWidth"]],[r,["line","interpolation"],["lineInterpolation"]],[r,["showlegend"],["visibleInLegend"]]].forEach(function(t,n){l.util.translator.apply(null,t.concat(e))}),e||delete r.marker,e&&delete r.groupId,e?("LinePlot"===r.geometry?(r.type="scatter",!0===r.dotVisible?(delete r.dotVisible,r.mode="lines+markers"):r.mode="lines"):"DotPlot"===r.geometry?(r.type="scatter",r.mode="markers"):"AreaChart"===r.geometry?r.type="area":"BarChart"===r.geometry&&(r.type="bar"),delete r.geometry):("scatter"===r.type?"lines"===r.mode?r.geometry="LinePlot":"markers"===r.mode?r.geometry="DotPlot":"lines+markers"===r.mode&&(r.geometry="LinePlot",r.dotVisible=!0):"area"===r.type?r.geometry="AreaChart":"bar"===r.type&&(r.geometry="BarChart"),delete r.mode,delete r.type),r}),!e&&t.layout&&"stack"===t.layout.barmode)){var a=l.util.duplicates(n.data.map(function(t,e){return t.geometry}));n.data.forEach(function(t,e){var r=a.indexOf(t.geometry);-1!=r&&(n.data[e].groupId=r)})}if(t.layout){var i=o({},t.layout) +"stroke-width":0}).attr("transform","translate("+n+", "+r+")").attr("d",a+"Z")}function f(t,e,n){return t.append("path").attr("class","zoombox-corners").style({fill:T.background,stroke:T.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+n+")").attr("d","M0,0Z")}function d(t){t.selectAll(".select-outline").remove()}function h(t,e,n,r,a,o){t.attr("d",r+"M"+n.l+","+n.t+"v"+n.h+"h"+n.w+"v-"+n.h+"h-"+n.w+"Z"),a||(t.transition().style("fill",o>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function p(t){b.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function g(t){return-1!==["lasso","select"].indexOf(t)}function v(t,e){return"M"+(t.l-.5)+","+(e-j-.5)+"h-3v"+(2*j+1)+"h3ZM"+(t.r+.5)+","+(e-j-.5)+"h3v"+(2*j+1)+"h-3Z"}function m(t,e){return"M"+(e-j-.5)+","+(t.t-.5)+"v-3h"+(2*j+1)+"v3ZM"+(e-j-.5)+","+(t.b+.5)+"v3h"+(2*j+1)+"v-3Z"}function y(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,j)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function x(t,e,n){var r,a,o,i,l,s,c=!1,u={},f={};for(r=0;rj||l>j?(kt="xy",i/ot>l/it?(l=i*it/ot,xt>o?bt.t=xt-l:bt.b=xt+l):(i=l*ot/it,yt>a?bt.l=yt-i:bt.r=yt+i),Tt.attr("d",y(bt))):r():!st||lzoom back out","long"),F=!1)}function X(e,n){var r=1===(q+H).length;if(e)J();else if(2!==n||r){if(1===n&&r){var a=q?nt[0]:et[0],i="s"===q||"w"===H?0:1,l=a._name+".range["+i+"]",s=o(a,i),c="left",u="middle";if(a.fixedrange)return;q?(u="n"===q?"top":"bottom","right"===a.side&&(c="right")):"e"===H&&(c="right"),t._context.showAxisRangeEntryBoxes&&b.select(vt).call(A.makeEditable,{gd:t,immediate:!0,background:ht.paper_bgcolor,text:String(s),fill:a.tickfont?a.tickfont.color:"#444",horizontalAlign:c,verticalAlign:u}).on("edit",function(e){var n=a.d2r(e);void 0!==n&&w.relayout(t,l,n)})}}else $()}function Z(e){function n(t,e,n){function r(e){return t.l2r(o+(e-o)*n)}if(!t.fixedrange){var a=k.simpleMap(t.range,t.r2l),o=a[0]+(a[1]-a[0])*e;t.range=a.map(r)}}if(t._context.scrollZoom||ht._enablescrollzoom){if(t._transitioningWithDuration)return k.pauseEvent(e);var r=t.querySelector(".plotly");if(V(),!(r.scrollHeight-r.clientHeight>10||r.scrollWidth-r.clientWidth>10)){clearTimeout(St);var a=-e.deltaY;if(isFinite(a)||(a=e.wheelDelta/10),!isFinite(a))return void k.log("Did not find wheel motion attributes: ",e);var o,i=Math.exp(-Math.min(Math.max(a,-20),20)/200),l=Pt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),s=(e.clientX-l.left)/l.width,c=(l.bottom-e.clientY)/l.height;if(H||ut){for(H||(s=.5),o=0;o rect").call(L.setTranslate,l,s).call(L.setScale,o,i);var w=g.plot.selectAll(".scatterlayer .points, .boxlayer .points");g.plot.call(L.setTranslate,b,_).call(L.setScale,1/o,1/i),w.selectAll(".point").call(L.setPointGroupScale,o,i).call(L.hideOutsideRangePoints,g),w.selectAll(".textpoint").call(L.setTextPointsScale,o,i).call(L.hideOutsideRangePoints,g)}}}var tt,et,nt,rt,at,ot,it,lt,st,ct,ut,ft,dt,ht=t._fullLayout,pt=t._fullLayout._zoomlayer,gt=q+H==="nsew";V();var vt=r(e,q+H+"drag",ct,n,T,C,B);if(!st&&!lt&&!g(ht.dragmode))return vt.onmousedown=null,vt.style.pointerEvents=gt?"all":"none",vt;var mt={element:vt,gd:t,plotinfo:e,prepFn:function(e,n,r){var a=t._fullLayout.dragmode;gt?e.shiftKey&&(a="pan"===a?"zoom":"pan"):a="pan",mt.minDrag="lasso"===a?1:void 0,"zoom"===a?(mt.moveFn=G,mt.doneFn=Y,mt.minDrag=1,U(e,n,r)):"pan"===a?(mt.moveFn=W,mt.doneFn=X,d(pt)):g(a)&&(mt.xaxes=et,mt.yaxes=nt,E(e,n,r,mt,a))}};S.init(mt);var yt,xt,bt,_t,wt,Mt,kt,At,Tt,Lt={},Ct=[0,0,ot,it],St=null,zt=R.REDRAWDELAY,Pt=e.mainplot?ht._plots[e.mainplot]:e;return q.length*H.length!=1&&(void 0!==vt.onwheel?vt.onwheel=Z:void 0!==vt.onmousewheel&&(vt.onmousewheel=Z)),vt}},{"../../components/color":36,"../../components/dragelement":57,"../../components/drawing":60,"../../constants/alignment":133,"../../lib":153,"../../lib/setcursor":171,"../../lib/svg_text_utils":173,"../../plotly":189,"../../registry":239,"../plots":231,"./axes":194,"./axis_ids":197,"./constants":199,"./scale_zoom":209,"./select":210,d3:8,tinycolor2:17}],203:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("../../components/fx"),o=t("../../components/dragelement"),i=t("./constants"),l=t("./dragbox");e.exports=function(t){var e=t._fullLayout;if((e._has("cartesian")||e._has("gl2d"))&&!t._context.staticPlot){Object.keys(e._plots||{}).sort(function(t,n){if((e._plots[t].mainplot&&!0)===(e._plots[n].mainplot&&!0)){var r=t.split("y"),a=n.split("y");return r[0]===a[0]?Number(r[1]||1)-Number(a[1]||1):Number(r[0]||1)-Number(a[0]||1)}return e._plots[t].mainplot?1:-1}).forEach(function(n){var s=e._plots[n],c=s.xaxis,u=s.yaxis,f=(c._linepositions[n]||[])[3],d=(u._linepositions[n]||[])[3],h=i.DRAGGERSIZE;if(r(f)&&"top"===c.side&&(f-=h),r(d)&&"right"!==u.side&&(d-=h),!s.mainplot){var p=l(t,s,0,0,c._length,u._length,"ns","ew");p.onmousemove=function(e){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===n&&a.hover(t,e,n)},a.hover(t,e,n),t._fullLayout._lasthover=p,t._fullLayout._hoversubplot=n},p.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,o.unhover(t,e))},p.onclick=function(e){a.click(t,e,n)},t._context.showAxisDragHandles&&(l(t,s,-h,-h,h,h,"n","w"),l(t,s,c._length,-h,h,h,"n","e"),l(t,s,-h,u._length,h,h,"s","w"),l(t,s,c._length,u._length,h,h,"s","e"))}t._context.showAxisDragHandles&&(r(f)&&("free"===c.anchor&&(f-=e._size.h*(1-u.domain[1])),l(t,s,.1*c._length,f,.8*c._length,h,"","ew"),l(t,s,0,f,.1*c._length,h,"","w"),l(t,s,.9*c._length,f,.1*c._length,h,"","e")),r(d)&&("free"===u.anchor&&(d-=e._size.w*c.domain[0]),l(t,s,d,.1*u._length,h,.8*u._length,"ns",""),l(t,s,d,.9*u._length,h,.1*u._length,"s",""),l(t,s,d,0,h,.1*u._length,"n","")))});var n=e._hoverlayer.node();n.onmousemove=function(n){n.target=e._lasthover,a.hover(t,n,e._hoversubplot)},n.onclick=function(n){n.target=e._lasthover,a.click(t,n)},n.onmousedown=function(t){e._lasthover.onmousedown(t)}}}},{"../../components/dragelement":57,"../../components/fx":77,"./constants":199,"./dragbox":202,"fast-isnumeric":11}],204:[function(t,e,n){"use strict";function r(t,e,n,r,a){var o=t._fullLayout,i=o._modules;e.plot&&e.plot.selectAll("g:not(.scatterlayer)").selectAll("g.trace").remove();for(var l=0;lu[1]-.01&&(e.domain=[0,1]),a.noneOrAll(t.domain,e.domain,[0,1])}return n("layer"),e}},{"../../lib":153,"fast-isnumeric":11}],209:[function(t,e,n){"use strict";var r=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,n){void 0===n&&(n=r[t.constraintoward||"center"]);var a=[t.r2l(t.range[0]),t.r2l(t.range[1])],o=a[0]+(a[1]-a[0])*n;t.range=t._input.range=[t.l2r(o+(a[0]-o)*e),t.l2r(o+(a[1]-o)*e)]}},{"../../constants/alignment":133}],210:[function(t,e,n){"use strict";function r(t){return t._id}function a(t,e){if(Array.isArray(t))for(var n=e.cd[0].trace,r=0;r0)return Math.log(e)/Math.LN10;if(e<=0&&n&&t.range&&2===t.range.length){var r=t.range[0],a=t.range[1];return.5*(r+a-3*M*Math.abs(r-a))}return h}function f(e,n,r){var a=c(e,r||t.calendar);if(a===h){if(!o(e))return h;a=c(new Date(+e))}return a}function v(e,n,r){return s(e,n,r||t.calendar)}function m(e){return t._categories[Math.round(e)]}function y(e){if(null!==e&&void 0!==e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var n=t._categories.length-1;return t._categoriesMap[e]=n,n}return h}function x(e){if(t._categoriesMap){var n=t._categoriesMap[e];if(void 0!==n)return n}if(o(e))return+e}function b(e){return o(e)?a.round(t._b+t._m*e,2):h}function _(e){return(e-t._b)/t._m}e=e||{};var w=(t._id||"x").charAt(0),M=10;t.c2l="log"===t.type?n:u,t.l2c="log"===t.type?r:u,t.l2p=b,t.p2l=_,t.c2p="log"===t.type?function(t,e){return b(n(t,e))}:b,t.p2c="log"===t.type?function(t){return r(_(t))}:_,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=l,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=_,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return n(l(t),e)},t.r2d=t.r2c=function(t){return r(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=u,t.c2r=n,t.l2d=r,t.d2p=function(e,n){return t.l2p(t.d2r(e,n))},t.p2d=function(t){return r(_(t))},t.r2p=function(e){return t.l2p(l(e))},t.p2r=_,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=i.identity,t.d2c=t.r2c=t.d2l=t.r2l=f,t.c2d=t.c2r=t.l2d=t.l2r=v,t.d2p=t.r2p=function(e,n,r){return t.l2p(f(e,0,r))},t.p2d=t.p2r=function(t,e,n){return v(_(t),e,n)},t.cleanPos=function(e){return i.cleanDate(e,h,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=y,t.r2d=t.c2d=t.l2d=m,t.d2r=t.d2l_noadd=x,t.r2c=function(e){var n=x(e);return void 0!==n?n:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=x,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return m(_(t))},t.r2p=t.d2p,t.p2r=_,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}),t.fraction2r=function(e){var n=t.r2l(t.range[0]),r=t.r2l(t.range[1]);return t.l2r(n+e*(r-n))},t.r2fraction=function(e){var n=t.r2l(t.range[0]),r=t.r2l(t.range[1]);return(t.r2l(e)-n)/(r-n)},t.cleanRange=function(e){e||(e="range");var n,r,a=i.nestedProperty(t,e).get() +;if(r="date"===t.type?i.dfltRange(t.calendar):"y"===w?p.DFLTRANGEY:p.DFLTRANGEX,r=r.slice(),!a||2!==a.length)return void i.nestedProperty(t,e).set(r);for("date"===t.type&&(a[0]=i.cleanDate(a[0],h,t.calendar),a[1]=i.cleanDate(a[1],h,t.calendar)),n=0;n<2;n++)if("date"===t.type){if(!i.isDateTime(a[n],t.calendar)){t[e]=r;break}if(t.r2l(a[0])===t.r2l(a[1])){var l=i.constrain(t.r2l(a[0]),i.MIN_MS+1e3,i.MAX_MS-1e3);a[0]=t.l2r(l-1e3),a[1]=t.l2r(l+1e3);break}}else{if(!o(a[n])){if(!o(a[1-n])){t[e]=r;break}a[n]=a[1-n]*(n?10:.1)}if(a[n]<-d?a[n]=-d:a[n]>d&&(a[n]=d),a[0]===a[1]){var s=Math.max(1,Math.abs(1e-6*a[0]));a[0]-=s,a[1]+=s}}},t.setScale=function(n){var r=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var a=g.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var o=n&&t._r?"_r":"range",l=t.calendar;t.cleanRange(o);var s=t.r2l(t[o][0],l),c=t.r2l(t[o][1],l);if("y"===w?(t._offset=r.t+(1-t.domain[1])*r.h,t._length=r.h*(t.domain[1]-t.domain[0]),t._m=t._length/(s-c),t._b=-t._m*c):(t._offset=r.l+t.domain[0]*r.w,t._length=r.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-s),t._b=-t._m*s),!isFinite(t._m)||!isFinite(t._b))throw i.notifier("Something went wrong with axis scaling","long"),e._replotting=!1,new Error("axis scaling")},t.makeCalcdata=function(e,n){var r,a,o,i="date"===t.type&&e[n+"calendar"];if(n in e)for(r=e[n],a=new Array(r.length),o=0;o=t.range[0]&&n<=t.range[1]}:function(e){var n=e.y;return n>=t.range[0]&&n<=t.range[1]},t._min=[],t._max=[],t._separators=e.separators,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":135,"../../lib":153,"./axis_ids":197,"./constants":199,d3:8,"fast-isnumeric":11}],212:[function(t,e,n){"use strict";function r(t){var e=["showexponent","showtickprefix","showticksuffix"],n=e.filter(function(e){return void 0!==t[e]}),r=function(e){return t[e]===t[n[0]]};if(n.every(r)||1===n.length)return t[n[0]]}var a=t("../../lib");e.exports=function(t,e,n,o,i){var l=r(t);if(n("tickprefix")&&n("showtickprefix",l),n("ticksuffix")&&n("showticksuffix",l),n("showticklabels")){var s=i.font||{},c=e.color===t.color?e.color:s.color;a.coerceFont(n,"tickfont",{family:s.family,size:s.size,color:c}),n("tickangle"),"category"!==o&&(n("tickformat")||"date"===o||(n("showexponent",l),n("exponentformat"),n("separatethousands")))}"category"===o||i.noHover||n("hoverformat")}},{"../../lib":153}],213:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,n,o){var i=r.coerce2(t,e,a,"ticklen"),l=r.coerce2(t,e,a,"tickwidth"),s=r.coerce2(t,e,a,"tickcolor",e.color);n("ticks",o.outerTicks||i||l||s?"outside":"")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":153,"./layout_attributes":205}],214:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("../../lib"),o=t("../../constants/numerical").ONEDAY;e.exports=function(t,e,n,i){var l="auto";"array"!==t.tickmode||"log"!==i&&"date"!==i||(t.tickmode="auto"),Array.isArray(t.tickvals)?l="array":t.dtick&&(l="linear");var s=n("tickmode",l);if("auto"===s)n("nticks");else if("linear"===s){var c="date"===i?o:1,u=n("dtick",c);if(r(u))e.dtick=u>0?Number(u):c;else if("string"!=typeof u)e.dtick=c;else{var f=u.charAt(0),d=u.substr(1);d=r(d)?Number(d):0,(d<=0||!("date"===i&&"M"===f&&d===Math.round(d)||"log"===i&&"L"===f||"log"===i&&"D"===f&&(1===d||2===d)))&&(e.dtick=c)}var h="date"===i?a.dateTick0(e.calendar):0,p=n("tick0",h);"date"===i?e.tick0=a.cleanDate(p,h):r(p)&&"D1"!==u&&"D2"!==u?e.tick0=Number(p):e.tick0=h}else{var g=n("tickvals");void 0===g?e.tickmode="auto":n("ticktext")}}},{"../../constants/numerical":135,"../../lib":153,"fast-isnumeric":11}],215:[function(t,e,n){"use strict";var r=t("d3"),a=t("../../plotly"),o=t("../../registry"),i=t("../../components/drawing"),l=t("./axes"),s=t("./constants").attrRegex;e.exports=function(t,e,n,c){function u(e,n){function r(e,n,r){for(a=0;a rect").call(i.setTranslate,0,0).call(i.setScale,1,1),t.plot.call(i.setTranslate,e._offset,n._offset).call(i.setScale,1,1);var r=t.plot.select(".scatterlayer").selectAll(".points");r.selectAll(".point").call(i.setPointGroupScale,1,1).call(i.hideOutsideRangePoints,t),r.selectAll(".textpoint").call(i.setTextPointsScale,1,1).call(i.hideOutsideRangePoints,t)}function d(e,n){var r,a,o,l=y[e.xaxis._id],s=y[e.yaxis._id],c=[];if(l){r=t._fullLayout[l.axisName],a=r._r,o=l.to,c[0]=(a[0]*(1-n)+n*o[0]-a[0])/(a[1]-a[0])*e.xaxis._length;var f=a[1]-a[0],d=o[1]-o[0];r.range[0]=a[0]*(1-n)+n*o[0],r.range[1]=a[1]*(1-n)+n*o[1],c[2]=e.xaxis._length*(1-n+n*d/f)}else c[0]=0,c[2]=e.xaxis._length;if(s){r=t._fullLayout[s.axisName],a=r._r,o=s.to,c[1]=(a[1]*(1-n)+n*o[1]-a[1])/(a[0]-a[1])*e.yaxis._length;var h=a[1]-a[0],p=o[1]-o[0];r.range[0]=a[0]*(1-n)+n*o[0],r.range[1]=a[1]*(1-n)+n*o[1],c[3]=e.yaxis._length*(1-n+n*p/h)}else c[1]=0,c[3]=e.yaxis._length;u(e.xaxis,e.yaxis);var g=e.xaxis,m=e.yaxis,x=!!l,b=!!s,_=x?g._length/c[2]:1,w=b?m._length/c[3]:1,M=x?c[0]:0,k=b?c[1]:0,A=x?c[0]/c[2]*g._length:0,T=b?c[1]/c[3]*m._length:0,L=g._offset-A,C=m._offset-T;v._defs.select("#"+e.clipId+"> rect").call(i.setTranslate,M,k).call(i.setScale,1/_,1/w),e.plot.call(i.setTranslate,L,C).call(i.setScale,_,w).selectAll(".points").selectAll(".point").call(i.setPointGroupScale,1/_,1/w),e.plot.selectAll(".points").selectAll(".textpoint").call(i.setTextPointsScale,1/_,1/w)}function h(){for(var e={},n=0;nn.duration?(h(),k=window.cancelAnimationFrame(g)):k=window.requestAnimationFrame(g)}var v=t._fullLayout,m=[],y=function(t){var e,n,r,a,o={};for(e in t)if(n=e.split("."),n[0].match(s)){var i=e.charAt(0),l=n[0];if(r=v[l],a={},Array.isArray(t[e])?a.to=t[e].slice(0):Array.isArray(t[e].range)&&(a.to=t[e].range.slice(0)),!a.to)continue;a.axisName=l,a.length=r._length,m.push(i),o[i]=a}return o}(e),x=Object.keys(y),b=function(t,e,n){var r,a,o,i=t._plots,l=[];for(r in i){var s=i[r];if(-1===l.indexOf(s)){var c=s.xaxis._id,u=s.yaxis._id,f=s.xaxis.range,d=s.yaxis.range;s.xaxis._r=s.xaxis.range.slice(),s.yaxis._r=s.yaxis.range.slice(),a=n[c]?n[c].to:f,o=n[u]?n[u].to:d,f[0]===a[0]&&f[1]===a[1]&&d[0]===o[0]&&d[1]===o[1]||-1===e.indexOf(c)&&-1===e.indexOf(u)||l.push(s)}}return l}(v,x,y);if(!b.length)return function(){function e(e,n,r){for(var a=0;a0?".":"")+a;c.isPlainObject(o)?l(o,e,i,r+1):e(i,a,o)}})}var s=t("../plotly"),c=t("../lib");n.manageCommandObserver=function(t,e,a,o){var i={},l=!0;e&&e._commandObserver&&(i=e._commandObserver),i.cache||(i.cache={}),i.lookupTable={};var s=n.hasSimpleAPICommandBindings(t,a,i.lookupTable);if(e&&e._commandObserver){if(s)return i;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,i}if(s){r(t,s,i.cache),i.check=function(){if(l){var e=r(t,s,i.cache);return e.changed&&o&&void 0!==i.lookupTable[e.value]&&(i.disable(),Promise.resolve(o({value:e.value,type:s.type,prop:s.prop,traces:s.traces,index:i.lookupTable[e.value]})).then(i.enable,i.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;fa*Math.PI/180}return!1},r.getPath=function(){return l.geo.path().projection(r)},r.getBounds=function(t){return r.getPath().bounds(t)},r.fitExtent=function(t,e){var n=t[1][0]-t[0][0],a=t[1][1]-t[0][1],o=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),o&&r.clipExtent(null);var i=r.getBounds(e),l=Math.min(n/(i[1][0]-i[0][0]),a/(i[1][1]-i[0][1])),s=+t[0][0]+(n-l*(i[1][0]+i[0][0]))/2,c=+t[0][1]+(a-l*(i[1][1]+i[0][1]))/2;return o&&r.clipExtent(o),r.scale(150*l).translate([s,c])},r.precision(y.precision),a&&r.clipAngle(a-y.clipPad),r}function o(t,e){var n=e[t],r=n.dtick,a=y.scopeDefaults[e.scope],o=a.lonaxisRange,i=a.lataxisRange,s="lonaxis"===t?[r]:[0,r];return l.geo.graticule().extent([[o[0],i[0]],[o[1],i[1]]]).step(s)}function i(t,e){var n=y.clipPad,r=t[0]+n,a=t[1]-n,o=e[0]+n,i=e[1]-n;r>0&&a<0&&(a+=360);var l=(a-r)/4;return{type:"Polygon",coordinates:[[[r,o],[r,i],[r+l,i],[r+2*l,i],[r+3*l,i],[a,i],[a,o],[a-l,o],[a-2*l,o],[a-3*l,o],[r,o]]]}}var l=t("d3"),s=t("../../plotly"),c=t("../../lib"),u=t("../../components/color"),f=t("../../components/drawing"),d=t("../../components/fx"),h=t("../plots"),p=t("../cartesian/axes"),g=t("../../components/dragelement"),v=t("../cartesian/select"),m=t("./zoom"),y=t("./constants"),x=t("../../lib/topojson_utils"),b=t("topojson-client").feature;t("./projections")(l);var _=r.prototype;e.exports=function(t){return new r(t)},_.plot=function(t,e,n){var r=this,a=e[this.id],o=x.getTopojsonName(a);null===r.topojson||o!==r.topojsonName?(r.topojsonName=o,void 0===PlotlyGeoAssets.topojson[r.topojsonName]?n.push(r.fetchTopojson().then(function(n){PlotlyGeoAssets.topojson[r.topojsonName]=n,r.topojson=n,r.update(t,e)})):(r.topojson=PlotlyGeoAssets.topojson[r.topojsonName],r.update(t,e))):r.update(t,e)},_.fetchTopojson=function(){var t=x.getTopojsonPath(this.topojsonURL,this.topojsonName);return new Promise(function(e,n){l.json(t,function(r,a){if(r)return n(404===r.status?new Error(["plotly.js could not find topojson file at",t,".","Make sure the *topojsonURL* plot config option","is set properly."].join(" ")):new Error(["unexpected error while fetching topojson file at",t].join(" ")));e(a)})})},_.update=function(t,e){var n=e[this.id];if(!this.updateProjection(e,n)){this.hasChoropleth=!1;for(var r=0;r0&&M<0&&(M+=360);var k,A=(w+M)/2;if(!u){var T=f?s.projRotate:[A,0,0];k=n("projection.rotation.lon",T[0]),n("projection.rotation.lat",T[1]),n("projection.rotation.roll",T[2]),r=n("showcoastlines",!f),r&&(n("coastlinecolor"),n("coastlinewidth")),r=n("showocean"),r&&n("oceancolor")}var L,C;if(u?(L=-96.6,C=38.7):(L=f?A:k,C=(_[0]+_[1])/2),n("center.lon",L),n("center.lat",C),d){n("projection.parallels",s.projParallels||[0,60])}n("projection.scale"),r=n("showland"),r&&n("landcolor"),r=n("showlakes"),r&&n("lakecolor"),r=n("showrivers"),r&&(n("rivercolor"),n("riverwidth")),r=n("showcountries",f&&"usa"!==i),r&&(n("countrycolor"),n("countrywidth")),("usa"===i||"north america"===i&&50===a)&&(n("showsubunits",!0),n("subunitcolor"),n("subunitwidth")),f||(r=n("showframe",!0))&&(n("framecolor"),n("framewidth")),n("bgcolor")}var a=t("../../subplot_defaults"),o=t("../constants"),i=t("./layout_attributes"),l=o.axesNames;e.exports=function(t,e,n){a(t,e,n,{type:"geo",attributes:i,handleDefaults:r,partition:"y"})}},{"../../subplot_defaults":238,"../constants":220,"./layout_attributes":225}],225:[function(t,e,n){"use strict";var r=t("../../../components/color/attributes"),a=t("../constants"),o=t("../../../plot_api/edit_types").overrideAll,i={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number"},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:r.lightLine},gridwidth:{valType:"number",min:0,dflt:1}};e.exports=o({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]}},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:Object.keys(a.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:Object.keys(a.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:r.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:a.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:a.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:a.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:a.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:r.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:r.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:r.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:r.background},lonaxis:i,lataxis:i},"plot","from-root")},{"../../../components/color/attributes":35,"../../../plot_api/edit_types":178,"../constants":220}],226:[function(t,e,n){"use strict";function r(t){function e(t,e){return{type:"Feature",id:t.id,properties:t.properties,geometry:n(t.geometry,e)}}function n(e,r){if(!e)return null;if("GeometryCollection"===e.type)return{type:"GeometryCollection",geometries:object.geometries.map(function(t){return n(t,r)})};if(!L.hasOwnProperty(e.type))return null;var a=L[e.type];return t.geo.stream(e,r(a)),a.result()}function r(){}function a(t){if((e=t.length)<4)return!1;for(var e,n=0,r=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++nr^h>r&&n<(d-c)*(r-u)/(h-u)+c&&(a=!a)}return a}function i(t){return t?t/Math.sin(t):1}function l(t){return t>1?P:t<-1?-P:Math.asin(t)}function s(t){return t>1?0:t<-1?z:Math.acos(t)}function c(t,e){var n=(2+P)*Math.sin(e);e/=2;for(var r=0,a=1/0;r<10&&Math.abs(a)>C;r++){var o=Math.cos(e);e-=a=(e+Math.sin(e)*(o+2)-n)/(2*o*(1+o))}return[2/Math.sqrt(z*(4+z))*t*(1+Math.cos(e)),2*Math.sqrt(z/(4+z))*Math.sin(e)]}function u(t,e){function n(n,r){var a=R(n/e,r);return a[0]*=t,a}return arguments.length<2&&(e=t),1===e?R:e===1/0?d:(n.invert=function(n,r){var a=R.invert(n/t,r);return a[0]*=e,a},n)}function f(){var t=2,e=N(u),n=e(t);return n.coefficient=function(n){return arguments.length?e(t=+n):t},n}function d(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function h(t,e){return[3*t/(2*z)*Math.sqrt(z*z/3-e*e),e]}function p(t,e){return[t,1.25*Math.log(Math.tan(z/4+.4*e))]}function g(t){return function(e){var n,r=t*Math.sin(e),a=30;do{ +e-=n=(e+Math.sin(e)-r)/(1+Math.cos(e))}while(Math.abs(n)>C&&--a>0);return e/2}}function v(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}function m(t,e){var n,r=Math.min(18,36*Math.abs(e)/z),a=Math.floor(r),o=r-a,i=(n=j[a])[0],l=n[1],s=(n=j[++a])[0],c=n[1],u=(n=j[Math.min(19,++a)])[0],f=n[1];return[t*(s+o*(u-i)/2+o*o*(u-2*s+i)/2),(e>0?P:-P)*(c+o*(f-l)/2+o*o*(f-2*c+l)/2)]}function y(t,e){return[t*Math.cos(e),e]}function x(t,e){var n=Math.cos(e),r=i(s(n*Math.cos(t/=2)));return[2*n*Math.sin(t)*r,Math.sin(e)*r]}function b(t,e){var n=x(t,e);return[(n[0]+t/P)/2,(n[1]+e)/2]}t.geo.project=function(t,e){var r=e.stream;if(!r)throw new Error("not yet supported");return(t&&_.hasOwnProperty(t.type)?_[t.type]:n)(t,r)};var _={Feature:e,FeatureCollection:function(t,n){return{type:"FeatureCollection",features:t.features.map(function(t){return e(t,n)})}}},w=[],M=[],k={point:function(t,e){w.push([t,e])},result:function(){var t=w.length?w.length<2?{type:"Point",coordinates:w[0]}:{type:"MultiPoint",coordinates:w}:null;return w=[],t}},A={lineStart:r,point:function(t,e){w.push([t,e])},lineEnd:function(){w.length&&(M.push(w),w=[])},result:function(){var t=M.length?M.length<2?{type:"LineString",coordinates:M[0]}:{type:"MultiLineString",coordinates:M}:null;return M=[],t}},T={polygonStart:r,lineStart:r,point:function(t,e){w.push([t,e])},lineEnd:function(){var t=w.length;if(t){do{w.push(w[0].slice())}while(++t<4);M.push(w),w=[]}},polygonEnd:r,result:function(){if(!M.length)return null;var t=[],e=[];return M.forEach(function(n){a(n)?t.push([n]):e.push(n)}),e.forEach(function(e){var n=e[0];t.some(function(t){if(o(t[0],n))return t.push(e),!0})||t.push([e])}),M=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},L={Point:k,MultiPoint:k,LineString:A,MultiLineString:A,Polygon:T,MultiPolygon:T,Sphere:T},C=1e-6,S=C*C,z=Math.PI,P=z/2,O=(Math.sqrt(z),z/180),D=180/z,E=t.geo.projection,N=t.geo.projectionMutator;t.geo.interrupt=function(e){function n(t,n){for(var r=n<0?-1:1,a=s[+(n<0)],o=0,i=a.length-1;oa[o][2][0];++o);var l=e(t-a[o][1][0],n);return l[0]+=e(a[o][1][0],r*n>r*a[o][0][1]?a[o][0][1]:n)[0],l}function r(){l=s.map(function(t){return t.map(function(t){var n,r=e(t[0][0],t[0][1])[0],a=e(t[2][0],t[2][1])[0],o=e(t[1][0],t[0][1])[1],i=e(t[1][0],t[1][1])[1];return o>i&&(n=o,o=i,i=n),[[r,o],[a,i]]})})}function a(){for(var e=1e-6,n=[],r=0,a=s[0].length;r=0;--r){var i=s[1][r],l=180*i[0][0]/z,c=180*i[0][1]/z,u=180*i[1][1]/z,f=180*i[2][0]/z,d=180*i[2][1]/z;n.push(o([[f-e,d-e],[f-e,u+e],[l+e,u+e],[l+e,c-e]],30))}return{type:"Polygon",coordinates:[t.merge(n)]}}function o(t,e){for(var n,r,a,o=-1,i=t.length,l=t[0],s=[];++oC&&--a>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},(t.geo.naturalEarth=function(){return E(v)}).raw=v;var j=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];j.forEach(function(t){t[1]*=1.0144}),m.invert=function(t,e){var n=e/P,r=90*n,a=Math.min(18,Math.abs(r/5)),o=Math.max(0,Math.floor(a));do{var i=j[o][1],l=j[o+1][1],s=j[Math.min(19,o+2)][1],c=s-i,u=s-2*l+i,f=2*(Math.abs(n)-l)/c,d=u/c,h=f*(1-d*f*(1-2*d*f));if(h>=0||1===o){r=(e>=0?5:-5)*(h+a);var p,g=50;do{a=Math.min(18,Math.abs(r)/5),o=Math.floor(a),h=a-o,i=j[o][1],l=j[o+1][1],s=j[Math.min(19,o+2)][1],r-=(p=(e>=0?P:-P)*(l+h*(s-i)/2+h*h*(s-2*l+i)/2)-e)*D}while(Math.abs(p)>S&&--g>0);break}}while(--o>=0);var v=j[o][0],m=j[o+1][0],y=j[Math.min(19,o+2)][0];return[t/(m+h*(y-v)/2+h*h*(y-2*m+v)/2),r*O]},(t.geo.robinson=function(){return E(m)}).raw=m,y.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return E(y)}).raw=y,x.invert=function(t,e){if(!(t*t+4*e*e>z*z+C)){var n=t,r=e,a=25;do{var o,i=Math.sin(n),l=Math.sin(n/2),c=Math.cos(n/2),u=Math.sin(r),f=Math.cos(r),d=Math.sin(2*r),h=u*u,p=f*f,g=l*l,v=1-p*c*c,m=v?s(f*c)*Math.sqrt(o=1/v):o=0,y=2*m*f*l-t,x=m*u-e,b=o*(p*g+m*f*c*h),_=o*(.5*i*d-2*m*u*l),w=.25*o*(d*l-m*u*p*i),M=o*(h*c+m*g*f),k=_*w-M*b;if(!k)break;var A=(x*_-y*M)/k,T=(y*w-x*b)/k;n-=A,r-=T}while((Math.abs(A)>C||Math.abs(T)>C)&&--a>0);return[n,r]}},(t.geo.aitoff=function(){return E(x)}).raw=x,b.invert=function(t,e){var n=t,r=e,a=25;do{var o,i=Math.cos(r),l=Math.sin(r),c=Math.sin(2*r),u=l*l,f=i*i,d=Math.sin(n),h=Math.cos(n/2),p=Math.sin(n/2),g=p*p,v=1-f*h*h,m=v?s(i*h)*Math.sqrt(o=1/v):o=0,y=.5*(2*m*i*p+n/P)-t,x=.5*(m*l+r)-e,b=.5*o*(f*g+m*i*h*u)+.5/P,_=o*(d*c/4-m*l*p),w=.125*o*(c*p-m*l*f*d),M=.5*o*(u*h+m*g*i)+.5,k=_*w-M*b,A=(x*_-y*M)/k,T=(y*w-x*b)/k;n-=A,r-=T}while((Math.abs(A)>C||Math.abs(T)>C)&&--a>0);return[n,r]},(t.geo.winkel3=function(){return E(b)}).raw=b}e.exports=r},{}],227:[function(t,e,n){"use strict";function r(t,e){var n=t.projection;return(e._isScoped?i:e._isClipped?s:l)(t,n)}function a(t,e){return w.behavior.zoom().translate(e.translate()).scale(e.scale())}function o(t,e,n){function r(t,e){var n=M.nestedProperty(l,t);n.get()!==e&&(n.set(e),M.nestedProperty(i,t).set(e),s[a+"."+t]=e)}var a=t.id,o=t.graphDiv,i=o.layout[a],l=o._fullLayout[a],s={};n(r),r("projection.scale",e.scale()/t.fitScale),o.emit("plotly_relayout",s)}function i(t,e){function n(){w.select(this).style(T)}function r(){e.scale(w.event.scale).translate(w.event.translate),t.render()}function i(n){var r=e.invert(t.midPt);n("center.lon",r[0]),n("center.lat",r[1])}function l(){w.select(this).style(L),o(t,e,i)}var s=a(t,e);return s.on("zoomstart",n).on("zoom",r).on("zoomend",l),s}function l(t,e){function n(t){return e.invert(t)}function r(t){var r=e(n(t));return Math.abs(r[0]-t[0])>x||Math.abs(r[1]-t[1])>x}function i(){w.select(this).style(T),u=w.mouse(this),f=e.rotate(),d=e.translate(),h=f,p=n(u)}function l(){if(g=w.mouse(this),r(u))return y.scale(e.scale()),void y.translate(e.translate());e.scale(w.event.scale),e.translate([d[0],w.event.translate[1]]),p?n(g)&&(m=n(g),v=[h[0]+(m[0]-p[0]),f[1],f[2]],e.rotate(v),h=v):(u=g,p=n(u)),t.render()}function s(){w.select(this).style(L),o(t,e,c)}function c(n){var r=e.rotate(),a=e.invert(t.midPt);n("projection.rotation.lon",-r[0]),n("center.lon",a[0]),n("center.lat",a[1])}var u,f,d,h,p,g,v,m,y=a(t,e),x=2;return y.on("zoomstart",i).on("zoom",l).on("zoomend",s),y}function s(t,e){function n(t){y++||t({type:"zoomstart"})}function r(t){t({type:"zoom"})}function i(t){--y||t({type:"zoomend"})}function l(t){var n=e.rotate();t("projection.rotation.lon",-n[0]),t("projection.rotation.lat",-n[1])}var s,p={r:e.rotate(),k:e.scale()},g=a(t,e),v=_(g,"zoomstart","zoom","zoomend"),y=0,x=g.on;return g.on("zoomstart",function(){w.select(this).style(T);var t=w.mouse(this),a=e.rotate(),o=a,i=e.translate(),l=u(a);s=c(e,t),x.call(g,"zoom",function(){var n=w.mouse(this);if(e.scale(p.k=w.event.scale),s){if(c(e,n)){e.rotate(a).translate(i);var u=c(e,n),g=d(s,u),y=m(f(l,g)),x=p.r=h(y,s,o);isFinite(x[0])&&isFinite(x[1])&&isFinite(x[2])||(x=o),e.rotate(x),o=x}}else t=n,s=c(e,t);r(v.of(this,arguments))}),n(v.of(this,arguments))}).on("zoomend",function(){w.select(this).style(L),x.call(g,"zoom",null),i(v.of(this,arguments)),o(t,e,l)}).on("zoom.redraw",function(){t.render()}),w.rebind(g,v,"on")}function c(t,e){var n=t.invert(e);return n&&isFinite(n[0])&&isFinite(n[1])&&y(n)}function u(t){var e=.5*t[0]*k,n=.5*t[1]*k,r=.5*t[2]*k,a=Math.sin(e),o=Math.cos(e),i=Math.sin(n),l=Math.cos(n),s=Math.sin(r),c=Math.cos(r);return[o*l*c+a*i*s,a*l*c-o*i*s,o*i*c+a*l*s,o*l*s-a*i*c]}function f(t,e){var n=t[0],r=t[1],a=t[2],o=t[3],i=e[0],l=e[1],s=e[2],c=e[3];return[n*i-r*l-a*s-o*c,n*l+r*i+a*c-o*s,n*s-r*c+a*i+o*l,n*c+r*s-a*l+o*i]}function d(t,e){if(t&&e){var n=b(t,e),r=Math.sqrt(x(n,n)),a=.5*Math.acos(Math.max(-1,Math.min(1,x(t,e)))),o=Math.sin(a)/r;return r&&[Math.cos(a),n[2]*o,-n[1]*o,n[0]*o]}}function h(t,e,n){var r=v(e,2,t[0]);r=v(r,1,t[1]),r=v(r,0,t[2]-n[2]);var a,o,i=e[0],l=e[1],s=e[2],c=r[0],u=r[1],f=r[2],d=Math.atan2(l,i)*A,h=Math.sqrt(i*i+l*l);Math.abs(u)>h?(o=(u>0?90:-90)-d,a=0):(o=Math.asin(u/h)*A-d,a=Math.sqrt(h*h-u*u));var g=180-o-2*d,m=(Math.atan2(f,c)-Math.atan2(s,a))*A,y=(Math.atan2(f,c)-Math.atan2(s,-a))*A;return p(n[0],n[1],o,m)<=p(n[0],n[1],g,y)?[o,m,n[2]]:[g,y,n[2]]}function p(t,e,n,r){var a=g(n-t),o=g(r-e);return Math.sqrt(a*a+o*o)}function g(t){return(t%360+540)%360-180}function v(t,e,n){var r=n*k,a=t.slice(),o=0===e?1:0,i=2===e?1:2,l=Math.cos(r),s=Math.sin(r);return a[o]=t[o]*l-t[i]*s,a[i]=t[i]*l+t[o]*s,a}function m(t){return[Math.atan2(2*(t[0]*t[1]+t[2]*t[3]),1-2*(t[1]*t[1]+t[2]*t[2]))*A,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*A,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*A]}function y(t){var e=t[0]*k,n=t[1]*k,r=Math.cos(n);return[r*Math.cos(e),r*Math.sin(e),Math.sin(n)]}function x(t,e){for(var n=0,r=0,a=t.length;r=e.width-20?(o["text-anchor"]="start",o.x=5):(o["text-anchor"]="end",o.x=e._paper.attr("width")-7),n.attr(o);var i=n.select(".js-link-to-tool"),l=n.select(".js-link-spacer"),c=n.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&r(t,i),l.text(i.text()&&c.text()?" - ":"")}},v.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",n=s.select(t).append("div").attr("id","hiddenform").style("display","none"),r=n.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return r.append("input").attr({type:"text",name:"data"}).node().value=v.graphJson(t,!1,"keepdata"),r.node().submit(),n.remove(),t.emit("plotly_afterexport"),!1},v.supplyDefaults=function(t){var e,n=t._fullLayout||{},r=t._fullLayout={},o=t.layout||{},i=t._fullData||[],l=t._fullData=[],s=t.data||[];if(t._transitionData||v.createTransitionData(t),n._initialAutoSizeIsDone){var c=n.width,f=n.height;v.supplyLayoutGlobalDefaults(o,r),o.width||(r.width=c),o.height||(r.height=f)}else{v.supplyLayoutGlobalDefaults(o,r);var d=!o.width||!o.height,h=r.autosize,p=t._context&&t._context.autosizable;d&&(h||p)?v.plotAutoSize(t,o,r):d&&v.sanitizeMargins(t),!h&&d&&(o.width=r.width,o.height=r.height)}r._initialAutoSizeIsDone=!0,r._dataLength=s.length,r._globalTransforms=(t._context||{}).globalTransforms,v.supplyDataDefaults(s,l,o,r),r._has=v._hasPlotType.bind(r);var g=r._modules;for(e=0;e0){var u=i(t._boundingBoxMargins),f=u.left+u.right,d=u.bottom+u.top,p=1-2*l,g=n._container&&n._container.node?n._container.node().getBoundingClientRect():{width:n.width,height:n.height};r=Math.round(p*(g.width-f)),a=Math.round(p*(g.height-d))}else{var m=s?window.getComputedStyle(t):{};r=parseFloat(m.width)||n.width,a=parseFloat(m.height)||n.height}var y=v.layoutAttributes.width.min,x=v.layoutAttributes.height.min;r1,_=!e.height&&Math.abs(n.height-a)>1;(_||b)&&(b&&(n.width=r),_&&(n.height=a)),t._initialAutoSize||(t._initialAutoSize={width:r,height:a}),v.sanitizeMargins(n)},v.supplyLayoutModuleDefaults=function(t,e,n,r){var a,o;u.Axes.supplyLayoutDefaults(t,e,n);var i=e._basePlotModules;for(a=0;a.5*r.width&&(n.l=n.r=0),n.b+n.t>.5*r.height&&(n.b=n.t=0),r._pushmargin[e]={l:{val:n.x,size:n.l+a},r:{val:n.x,size:n.r+a},b:{val:n.y,size:n.b+a},t:{val:n.y,size:n.t+a}}}else delete r._pushmargin[e];r._replotting||v.doAutoMargin(t)}},v.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var n=e._size,r=JSON.stringify(n),a=Math.max(e.margin.l||0,0),o=Math.max(e.margin.r||0,0),i=Math.max(e.margin.t||0,0),l=Math.max(e.margin.b||0,0),s=e._pushmargin;if(!1!==e.margin.autoexpand){s.base={l:{val:0,size:a},r:{val:1,size:o},t:{val:1,size:i},b:{val:0,size:l}};for(var f=Object.keys(s),d=0;dv){var k=(m*w+(M-e.width)*v)/(w-v),A=(M*(1-v)+(m-e.width)*(1-w))/(w-v);k>=0&&A>=0&&k+A>a+o&&(a=k,o=A)}}if(c(x)&&s[_].t){var T=s[_].t.val,L=s[_].t.size;if(T>y){var C=(x*T+(L-e.height)*y)/(T-y),S=(L*(1-y)+(x-e.height)*(1-T))/(T-y);C>=0&&S>=0&&C+S>l+i&&(l=C,i=S)}}}}if(n.l=Math.round(a),n.r=Math.round(o),n.t=Math.round(i),n.b=Math.round(l),n.p=Math.round(e.margin.pad),n.w=Math.round(e.width)-n.l-n.r,n.h=Math.round(e.height)-n.t-n.b,!e._replotting&&"{}"!==r&&r!==JSON.stringify(e._size))return u.plot(t)},v.graphJson=function(t,e,n,r,a){function o(t){if("function"==typeof t)return null;if(h.isPlainObject(t)){var e,r,a={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===n){if("src"===e.substr(e.length-3))continue}else if("keepstream"===n){if("string"==typeof(r=t[e+"src"])&&r.indexOf(":")>0&&!h.isPlainObject(t.stream))continue}else if("keepall"!==n&&"string"==typeof(r=t[e+"src"])&&r.indexOf(":")>0)continue;a[e]=o(t[e])}return a}return Array.isArray(t)?t.map(o):h.isJSDate(t)?h.ms2DateTimeLocal(+t):t}(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&v.supplyDefaults(t);var i=a?t._fullData:t.data,l=a?t._fullLayout:t.layout,s=(t._transitionData||{})._frames,c={data:(i||[]).map(function(t){var n=o(t);return e&&delete n.fit,n})};return e||(c.layout=o(l)),t.framework&&t.framework.isPolar&&(c=t.framework.getConfig()),s&&(c.frames=o(s)),"object"===r?c:JSON.stringify(c)},v.modifyFrames=function(t,e){var n,r,a,o=t._transitionData._frames,i=t._transitionData._frameHash;for(n=0;n0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){b=!0}),a.redraw&&t._transitionData._interruptCallbacks.push(function(){return u.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var i,l,s=0,c=0,d=t._fullLayout._basePlotModules,p=!1;if(n)for(l=0;l=0,S=C?d.angularAxis.domain:r.extent(k),z=Math.abs(k[1]-k[0]);T&&!A&&(z=0);var P=S.slice();L&&A&&(P[1]+=z);var O=d.angularAxis.ticksCount||4;O>8&&(O=O/(O/8)+O%8),d.angularAxis.ticksStep&&(O=(P[1]-P[0])/O);var D=d.angularAxis.ticksStep||(P[1]-P[0])/(O*(d.minorTicks+1));M&&(D=Math.max(Math.round(D),1)),P[2]||(P[2]=D);var E=r.range.apply(this,P);if(E=E.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=r.scale.linear().domain(P.slice(0,2)).range("clockwise"===d.direction?[0,360]:[360,0]),f.layout.angularAxis.domain=s.domain(),f.layout.angularAxis.endPadding=L?z:0,void 0===(e=r.select(this).select("svg.chart-root"))||e.empty()){var N=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),R=this.appendChild(this.ownerDocument.importNode(N.documentElement,!0));e=r.select(R)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var I,j=e.select(".chart-group"),F={fill:"none",stroke:d.tickColor},B={"font-size":d.font.size,"font-family":d.font.family,fill:d.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+d.font.outlineColor}).join(",")};if(d.showLegend){I=e.select(".legend-group").attr({transform:"translate("+[b,d.margin.top]+")"}).style({display:"block"});var q=p.map(function(t,e){var n=l.util.cloneJson(t);return n.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",n.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,n.color="LinePlot"===t.geometry?t.strokeColor:t.color,n});l.Legend().config({data:p.map(function(t,e){return t.name||"Element"+e}),legendConfig:o({},l.Legend.defaultConfig().legendConfig,{container:I,elements:q,reverseOrder:d.legend.reverseOrder})})();var H=I.node().getBBox();b=Math.min(d.width-H.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2,b=Math.max(10,b),w=[d.margin.left+b,d.margin.top+b],a.range([0,b]),f.layout.radialAxis.domain=a.domain(),I.attr("transform","translate("+[w[0]+b,w[1]-b]+")")}else I=e.select(".legend-group").style({display:"none"});e.attr({width:d.width,height:d.height}).style({opacity:d.opacity}),j.attr("transform","translate("+w+")").style({cursor:"crosshair"});var V=[(d.width-(d.margin.left+d.margin.right+2*b+(H?H.width:0)))/2,(d.height-(d.margin.top+d.margin.bottom+2*b))/2];if(V[0]=Math.max(0,V[0]),V[1]=Math.max(0,V[1]),e.select(".outer-group").attr("transform","translate("+V+")"),d.title){var U=e.select("g.title-group text").style(B).text(d.title),G=U.node().getBBox();U.attr({x:w[0]-G.width/2,y:w[1]-b-20})}var Y=e.select(".radial.axis-group");if(d.radialAxis.gridLinesVisible){var X=Y.selectAll("circle.grid-circle").data(a.ticks(5));X.enter().append("circle").attr({class:"grid-circle"}).style(F),X.attr("r",a),X.exit().remove()}Y.select("circle.outside-circle").attr({r:b}).style(F);var Z=e.select("circle.background-circle").attr({r:b}).style({fill:d.backgroundColor,stroke:d.stroke});if(d.radialAxis.visible){var W=r.svg.axis().scale(a).ticks(5).tickSize(5);Y.call(W).attr({transform:"rotate("+d.radialAxis.orientation+")"}),Y.selectAll(".domain").style(F),Y.selectAll("g>text").text(function(t,e){return this.textContent+d.radialAxis.ticksSuffix}).style(B).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===d.radialAxis.tickOrientation?"rotate("+-d.radialAxis.orientation+") translate("+[0,B["font-size"]]+")":"translate("+[0,B["font-size"]]+")"}}),Y.selectAll("g>line").style({stroke:"black"})}var Q=e.select(".angular.axis-group").selectAll("g.angular-tick").data(E),$=Q.enter().append("g").classed("angular-tick",!0);Q.attr({transform:function(t,e){return"rotate("+c(t,e)+")"}}).style({display:d.angularAxis.visible?"block":"none"}),Q.exit().remove(),$.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(d.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(d.minorTicks+1)==0)}).style(F),$.selectAll(".minor").style({stroke:d.minorTickColor}),Q.select("line.grid-line").attr({x1:d.tickLength?b-d.tickLength:0,x2:b}).style({display:d.angularAxis.gridLinesVisible?"block":"none"}),$.append("text").classed("axis-text",!0).style(B);var J=Q.select("text.axis-text").attr({x:b+d.labelOffset,dy:i+"em",transform:function(t,e){var n=c(t,e),r=b+d.labelOffset,a=d.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-n+" "+r+" 0)":"radial"==a?n<270&&n>90?"rotate(180 "+r+" 0)":null:"rotate("+(n<=180&&n>0?-90:90)+" "+r+" 0)"}}).style({"text-anchor":"middle",display:d.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(d.minorTicks+1)!=0?"":M?M[t]+d.angularAxis.ticksSuffix:t+d.angularAxis.ticksSuffix}).style(B);d.angularAxis.rewriteTicks&&J.text(function(t,e){return e%(d.minorTicks+1)!=0?"":d.angularAxis.rewriteTicks(this.textContent,e)});var K=r.max(j.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));I.attr({transform:"translate("+[b+K,d.margin.top]+")"});var tt=e.select("g.geometry-group").selectAll("g").size()>0,et=e.select("g.geometry-group").selectAll("g.geometry").data(p);if(et.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),et.exit().remove(),p[0]||tt){var nt=[];p.forEach(function(t,e){var n={};n.radialScale=a,n.angularScale=s,n.container=et.filter(function(t,n){return n==e}),n.geometry=t.geometry,n.orientation=d.orientation,n.direction=d.direction,n.index=e,nt.push({data:t,geometryConfig:n})});var rt=r.nest().key(function(t,e){return void 0!==t.data.groupId||"unstacked"}).entries(nt),at=[];rt.forEach(function(t,e){"unstacked"===t.key?at=at.concat(t.values.map(function(t,e){return[t]})):at.push(t.values)}),at.forEach(function(t,e){var n;n=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var r=t.map(function(t,e){return o(l[n].defaultConfig(),t)});l[n]().config(r)()})}var ot,it,lt=e.select(".guides-group"),st=e.select(".tooltips-group"),ct=l.tooltipPanel().config({container:st,fontSize:8})(),ut=l.tooltipPanel().config({container:st,fontSize:8})(),ft=l.tooltipPanel().config({container:st,hasTick:!0})();if(!A){var dt=lt.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});j.on("mousemove.angular-guide",function(t,e){var n=l.util.getMousePos(Z).angle;dt.attr({x2:-b,transform:"rotate("+n+")"}).style({opacity:.5});var r=(n+180+360-d.orientation)%360;ot=s.invert(r);var a=l.util.convertToCartesian(b+12,n+180);ct.text(l.util.round(ot)).move([a[0]+w[0],a[1]+w[1]])}).on("mouseout.angular-guide",function(t,e){lt.select("line").style({opacity:0})})}var ht=lt.select("circle").style({stroke:"grey",fill:"none"});j.on("mousemove.radial-guide",function(t,e){var n=l.util.getMousePos(Z).radius;ht.attr({r:n}).style({opacity:.5}),it=a.invert(l.util.getMousePos(Z).radius);var r=l.util.convertToCartesian(n,d.radialAxis.orientation);ut.text(l.util.round(it)).move([r[0]+w[0],r[1]+w[1]])}).on("mouseout.radial-guide",function(t,e){ht.style({opacity:0}),ft.hide(),ct.hide(),ut.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,n){var a=r.select(this),o=this.style.fill,i="black",s=this.style.opacity||1;if(a.attr({"data-opacity":s}),o&&"none"!==o){a.attr({"data-fill":o}),i=r.hsl(o).darker().toString(),a.style({fill:i,opacity:1});var c={t:l.util.round(t[0]),r:l.util.round(t[1])};A&&(c.t=M[t[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),d=e.node().getBoundingClientRect(),h=[f.left+f.width/2-V[0]-d.left,f.top+f.height/2-V[1]-d.top];ft.config({color:i}).text(u),ft.move(h)}else o=this.style.stroke||"black",a.attr({"data-stroke":o}),i=r.hsl(o).darker().toString(),a.style({stroke:i,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=r.event.which)return!1;r.select(this).attr("data-fill")&&ft.show()}).on("mouseout.tooltip",function(t,e){ft.hide();var n=r.select(this),a=n.attr("data-fill");a?n.style({fill:a,opacity:n.attr("data-opacity")}):n.style({stroke:n.attr("data-stroke"),opacity:n.attr("data-opacity")})})}),h}var e,n,a,s,c={data:[],layout:{}},u={},f={},d=r.dispatch("hover"),h={};return h.render=function(e){return t(e),this},h.config=function(t){if(!arguments.length)return c;var e=l.util.cloneJson(t);return e.data.forEach(function(t,e){c.data[e]||(c.data[e]={}),o(c.data[e],l.Axis.defaultConfig().data[0]),o(c.data[e],t)}),o(c.layout,l.Axis.defaultConfig().layout),o(c.layout,e.layout),this},h.getLiveConfig=function(){return f},h.getinputConfig=function(){return u},h.radialScale=function(t){return a},h.angularScale=function(t){return s},h.svg=function(){return e},r.rebind(h,d,"on"),h},l.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:r.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},l.util={},l.DATAEXTENT="dataExtent",l.AREA="AreaChart",l.LINE="LinePlot",l.DOT="DotPlot",l.BAR="BarChart",l.util._override=function(t,e){for(var n in t)n in e&&(e[n]=t[n])},l.util._extend=function(t,e){for(var n in t)e[n]=t[n]},l.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},l.util.dataFromEquation2=function(t,e){var n=e||6;return r.range(0,360+n,n).map(function(e,n){var r=e*Math.PI/180;return[e,t(r)]})},l.util.dataFromEquation=function(t,e,n){var a=e||6,o=[],i=[];r.range(0,360+a,a).forEach(function(e,n){var r=e*Math.PI/180,a=t(r);o.push(e),i.push(a)});var l={t:o,r:i};return n&&(l.name=n),l},l.util.ensureArray=function(t,e){if(void 0===t)return null;var n=[].concat(t);return r.range(e).map(function(t,e){return n[e]||n[0]})},l.util.fillArrays=function(t,e,n){return e.forEach(function(e,r){t[e]=l.util.ensureArray(t[e],n)}),t},l.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},l.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var n=e.shift();return t[n]&&(!e.length||objHasKeys(t[n],e))},l.util.sumArrays=function(t,e){return r.zip(t,e).map(function(t,e){return r.sum(t)})},l.util.arrayLast=function(t){return t[t.length-1]},l.util.arrayEqual=function(t,e){for(var n=Math.max(t.length,e.length,1);n-- >=0&&t[n]===e[n];);return-2===n},l.util.flattenArray=function(t){for(var e=[];!l.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},l.util.deduplicate=function(t){return t.filter(function(t,e,n){return n.indexOf(t)==e})},l.util.convertToCartesian=function(t,e){var n=e*Math.PI/180;return[t*Math.cos(n),t*Math.sin(n)]},l.util.round=function(t,e){var n=e||2,r=Math.pow(10,n);return Math.round(t*r)/r},l.util.getMousePos=function(t){var e=r.mouse(t.node()),n=e[0],a=e[1],o={};return o.x=n,o.y=a,o.pos=e,o.angle=180*(Math.atan2(a,n)+Math.PI)/Math.PI,o.radius=Math.sqrt(n*n+a*a),o},l.util.duplicatesCount=function(t){for(var e,n={},r={},a=0,o=t.length;a0)){var l=r.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:d(i),transform:function(e,n){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return v.fill(n,a,o)},"fill-opacity":0,stroke:function(t,e){return v.stroke(n,a,o)},"stroke-width":function(t,e){return v["stroke-width"](n,a,o)},"stroke-dasharray":function(t,e){return v["stroke-dasharray"](n,a,o)},opacity:function(t,e){return v.opacity(n,a,o)},display:function(t,e){return v.display(n,a,o)}})}};var h=t.angularScale.range(),p=Math.abs(h[1]-h[0])/s[0].length*Math.PI/180,g=r.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,n,a){r.select(this).attr({class:"mark arc",d:g,transform:function(e,n){return"rotate("+(t.orientation+c(e[0])+90)+")"}})};var v={fill:function(t,n,r){return e[r].data.color},stroke:function(t,n,r){return e[r].data.strokeColor},"stroke-width":function(t,n,r){return e[r].data.strokeSize+"px"},"stroke-dasharray":function(t,n,r){return a[e[r].data.strokeDash]},opacity:function(t,n,r){return e[r].data.opacity},display:function(t,n,r){return void 0===e[r].data.visible||e[r].data.visible?"block":"none"}},m=r.select(this).selectAll("g.layer").data(s);m.enter().append("g").attr({class:"layer"});var y=m.selectAll("path.mark").data(function(t,e){return t});y.enter().append("path").attr({class:"mark"}),y.style(v).each(f[t.geometryType]),y.exit().remove(),m.exit().remove()})}var e=[l.PolyChart.defaultConfig()],n=r.dispatch("hover"),a={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,n){e[n]||(e[n]={}),o(e[n],l.PolyChart.defaultConfig()),o(e[n],t)}),this):e},t.getColorScale=function(){},r.rebind(t,n,"on"),t},l.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:r.scale.category20()}}},l.BarChart=function(){return l.PolyChart()},l.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},l.AreaChart=function(){return l.PolyChart()},l.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},l.DotPlot=function(){return l.PolyChart()},l.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},l.LinePlot=function(){return l.PolyChart()},l.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},l.Legend=function(){function t(){var n=e.legendConfig,a=e.data.map(function(t,e){return[].concat(t).map(function(t,r){var a=o({},n.elements[e]);return a.name=t,a.color=[].concat(n.elements[e].color)[r],a})}),i=r.merge(a);i=i.filter(function(t,e){return n.elements[e]&&(n.elements[e].visibleInLegend||void 0===n.elements[e].visibleInLegend)}),n.reverseOrder&&(i=i.reverse());var l=n.container;("string"==typeof l||l.nodeName)&&(l=r.select(l));var s=i.map(function(t,e){return t.color}),c=n.fontSize,u=null==n.isContinuous?"number"==typeof i[0]:n.isContinuous,f=u?n.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=r.range(i.length),v=r.scale[u?"linear":"ordinal"]().domain(g).range(s),m=r.scale[u?"linear":"ordinal"]().domain(g)[u?"range":"rangePoints"]([0,f]),y=function(t,e){var n=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":-1!=r.svg.symbolTypes.indexOf(t)?r.svg.symbol().type(t).size(n)():r.svg.symbol().type("square").size(n)()};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:n.height,width:n.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,m(e)+c/2]+")"},d:function(t,e){var n=t.symbol;return y(n,c)},fill:function(t,e){return v(e)}}),b.exit().remove()}var _=r.svg.axis().scale(m).orient("right"),w=h.select("g.legend-axis").attr({transform:"translate("+[u?n.colorBandWidth:c,c/2]+")"}).call(_);return w.selectAll(".domain").style({fill:"none",stroke:"none"}),w.selectAll("line").style({fill:"none",stroke:u?n.textColor:"none"}),w.selectAll("text").style({fill:n.textColor,"font-size":n.fontSize}).text(function(t,e){return i[e].name}),t}var e=l.Legend.defaultConfig(),n=r.dispatch("hover");return t.config=function(t){return arguments.length?(o(e,t),this):e},r.rebind(t,n,"on"),t},l.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},l.tooltipPanel=function(){var t,e,n,a={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},i="tooltip-"+l.tooltipPanel.uid++,s=function(){t=a.container.selectAll("g."+i).data([0]);var r=t.enter().append("g").classed(i,!0).style({"pointer-events":"none",display:"none"});return n=r.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=r.append("text").attr({dx:a.padding+10,dy:.3*+a.fontSize}),s};return s.text=function(o){var i=r.hsl(a.color).l,l=i>=.5?"#aaa":"white",c=i>=.5?"black":"white",u=o||"";e.style({fill:c,"font-size":a.fontSize+"px"}).text(u);var f=a.padding,d=e.node().getBBox(),h={fill:a.color,stroke:l,"stroke-width":"2px"},p=d.width+2*f+10,g=d.height+2*f;return n.attr({d:"M"+[[10,-g/2],[10,-g/4],[a.hasTick?0:10,0],[10,g/4],[10,g/2],[p,g/2],[p,-g/2]].join("L")+"Z"}).style(h),t.attr({transform:"translate("+[10,-g/2+2*f]+")"}),t.style({display:"block"}),s},s.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),s},s.hide=function(){if(t)return t.style({display:"none"}),s},s.show=function(){if(t)return t.style({display:"block"}),s},s.config=function(t){return o(a,t),s},s},l.tooltipPanel.uid=1,l.adapter={},l.adapter.plotly=function(){var t={};return t.convert=function(t,e){var n={};if(t.data&&(n.data=t.data.map(function(t,n){var r=o({},t);return[[r,["marker","color"],["color"]],[r,["marker","opacity"],["opacity"]],[r,["marker","line","color"],["strokeColor"]],[r,["marker","line","dash"],["strokeDash"]],[r,["marker","line","width"],["strokeSize"]],[r,["marker","symbol"],["dotType"]],[r,["marker","size"],["dotSize"]],[r,["marker","barWidth"],["barWidth"]],[r,["line","interpolation"],["lineInterpolation"]],[r,["showlegend"],["visibleInLegend"]]].forEach(function(t,n){l.util.translator.apply(null,t.concat(e))}),e||delete r.marker,e&&delete r.groupId,e?("LinePlot"===r.geometry?(r.type="scatter",!0===r.dotVisible?(delete r.dotVisible,r.mode="lines+markers"):r.mode="lines"):"DotPlot"===r.geometry?(r.type="scatter",r.mode="markers"):"AreaChart"===r.geometry?r.type="area":"BarChart"===r.geometry&&(r.type="bar"),delete r.geometry):("scatter"===r.type?"lines"===r.mode?r.geometry="LinePlot":"markers"===r.mode?r.geometry="DotPlot":"lines+markers"===r.mode&&(r.geometry="LinePlot",r.dotVisible=!0):"area"===r.type?r.geometry="AreaChart":"bar"===r.type&&(r.geometry="BarChart"),delete r.mode,delete r.type),r}),!e&&t.layout&&"stack"===t.layout.barmode)){var a=l.util.duplicates(n.data.map(function(t,e){return t.geometry}));n.data.forEach(function(t,e){var r=a.indexOf(t.geometry);-1!=r&&(n.data[e].groupId=r)})}if(t.layout){var i=o({},t.layout) ;if([[i,["plot_bgcolor"],["backgroundColor"]],[i,["showlegend"],["showLegend"]],[i,["radialaxis"],["radialAxis"]],[i,["angularaxis"],["angularAxis"]],[i.angularaxis,["showline"],["gridLinesVisible"]],[i.angularaxis,["showticklabels"],["labelsVisible"]],[i.angularaxis,["nticks"],["ticksCount"]],[i.angularaxis,["tickorientation"],["tickOrientation"]],[i.angularaxis,["ticksuffix"],["ticksSuffix"]],[i.angularaxis,["range"],["domain"]],[i.angularaxis,["endpadding"],["endPadding"]],[i.radialaxis,["showline"],["gridLinesVisible"]],[i.radialaxis,["tickorientation"],["tickOrientation"]],[i.radialaxis,["ticksuffix"],["ticksSuffix"]],[i.radialaxis,["range"],["domain"]],[i.angularAxis,["showline"],["gridLinesVisible"]],[i.angularAxis,["showticklabels"],["labelsVisible"]],[i.angularAxis,["nticks"],["ticksCount"]],[i.angularAxis,["tickorientation"],["tickOrientation"]],[i.angularAxis,["ticksuffix"],["ticksSuffix"]],[i.angularAxis,["range"],["domain"]],[i.angularAxis,["endpadding"],["endPadding"]],[i.radialAxis,["showline"],["gridLinesVisible"]],[i.radialAxis,["tickorientation"],["tickOrientation"]],[i.radialAxis,["ticksuffix"],["ticksSuffix"]],[i.radialAxis,["range"],["domain"]],[i.font,["outlinecolor"],["outlineColor"]],[i.legend,["traceorder"],["reverseOrder"]],[i,["labeloffset"],["labelOffset"]],[i,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(t,n){l.util.translator.apply(null,t.concat(e))}),e?(void 0!==i.tickLength&&(i.angularaxis.ticklen=i.tickLength,delete i.tickLength),i.tickColor&&(i.angularaxis.tickcolor=i.tickColor,delete i.tickColor)):(i.angularAxis&&void 0!==i.angularAxis.ticklen&&(i.tickLength=i.angularAxis.ticklen),i.angularAxis&&void 0!==i.angularAxis.tickcolor&&(i.tickColor=i.angularAxis.tickcolor)),i.legend&&"boolean"!=typeof i.legend.reverseOrder&&(i.legend.reverseOrder="normal"!=i.legend.reverseOrder),i.legend&&"boolean"==typeof i.legend.traceorder&&(i.legend.traceorder=i.legend.traceorder?"reversed":"normal",delete i.legend.reverseOrder),i.margin&&void 0!==i.margin.t){var s=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};r.entries(i.margin).forEach(function(t,e){u[c[s.indexOf(t.key)]]=t.value}),i.margin=u}e&&(delete i.needsEndSpacing,delete i.minorTickColor,delete i.minorTicks,delete i.angularaxis.ticksCount,delete i.angularaxis.ticksCount,delete i.angularaxis.ticksStep,delete i.angularaxis.rewriteTicks,delete i.angularaxis.nticks,delete i.radialaxis.ticksCount,delete i.radialaxis.ticksCount,delete i.radialaxis.ticksStep,delete i.radialaxis.rewriteTicks,delete i.radialaxis.nticks),n.layout=i}return n},t}},{"../../constants/alignment":133,"../../lib":153,d3:8}],236:[function(t,e,n){"use strict";var r=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),r.select(r.select(f).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),n=n?s(n,e):e,o||(o=i.Axis()),u=i.adapter.plotly().convert(n),o.config(u).render(f),t.data=n.data,t.layout=n.layout,c.fillLayout(t),n}var n,a,o,u,f,d=new l;return e.isPolar=!0,e.svg=function(){return o.svg()},e.getConfig=function(){return n},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(n);!function(e,n){d.add({undo:function(){n&&t(n)},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=r.select(t).selectAll(".plot-container"),n=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:n,_paper:a};t._fullLayout=s(i,t.layout)}},{"../../components/color":36,"../../lib":153,"./micropolar":235,"./undo_manager":237,d3:8}],237:[function(t,e,n){"use strict";e.exports=function(){function t(t,e){return t?(a=!0,t[e](),a=!1,this):this}var e,n=[],r=-1,a=!1;return{add:function(t){return a?this:(n.splice(r+1,n.length-r),n.push(t),r=n.length-1,this)},setCallback:function(t){e=t},undo:function(){var a=n[r];return a?(t(a,"undo"),r-=1,e&&e(a.undo),this):this},redo:function(){var a=n[r+1];return a?(t(a,"redo"),r+=1,e&&e(a.redo),this):this},clear:function(){n=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r-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 n,o=t.data,c=t.layout,u=s([],o),f=s({},c,r(e.tileClass)),d=t._context||{};if(e.width&&(f.width=e.width),e.height&&(f.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){f.annotations=[];var h=Object.keys(f);for(n=0;n")?"":e.html(t).text()});return e.remove(),n}function a(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}var o=t("d3"),i=t("../lib"),l=t("../components/drawing"),s=t("../components/color"),c=t("../constants/xmlns_namespaces"),u=/"/g,f=new RegExp('("TOBESTRIPPED)|(TOBESTRIPPED")',"g");e.exports=function(t,e,n){var d,h=t._fullLayout,p=h._paper,g=h._toppaper,v=h.width,m=h.height;p.insert("rect",":first-child").call(l.setRect,0,0,v,m).call(s.fill,h.paper_bgcolor);var y=h._basePlotModules||[];for(d=0;ds&&(e.z=u.slice(0,s)),l("locationmode"),l("text"),l("marker.line.color"),l("marker.line.width"),a(t,e,i,l,{prefix:"",cLetter:"z"})}},{"../../components/colorscale/defaults":45,"../../lib":153,"./attributes":248}],251:[function(t,e,n){"use strict";e.exports=function(t,e){return t.location=e.location,t.z=e.z,t}},{}],252:[function(t,e,n){"use strict";function r(t,e,n,r){var l=n.hi||e.hoverinfo,s="all"===l?o.hoverinfo.flags:l.split("+"),c=-1!==s.indexOf("name"),u=-1!==s.indexOf("location"),f=-1!==s.indexOf("z"),d=-1!==s.indexOf("text"),h=!c&&u,p=[];h?t.nameOverride=n.loc:(c&&(t.nameOverride=e.name),u&&p.push(n.loc)),f&&p.push(function(t){return a.tickText(r,r.c2l(t),"hover").text}(n.z)),d&&i(n,e,p),t.extraText=p.join("
")}var a=t("../../plots/cartesian/axes"),o=t("./attributes"),i=t("../scatter/fill_hover_text");e.exports=function(t,e,n){var a,o,i,l,s=t.cd,c=s[0].trace,u=t.subplot;for(o=0;o0&&t[e+1][0]<0)return e;return null}var n,r,a,o,i=t.geometry,l=i.coordinates,s=t.id,c=[];switch(n="RUS"===s||"FJI"===s?function(t){var n;if(null===e(t))n=t;else for(n=new Array(t.length),o=0;on?r[a++]=[t[o][0]+360,t[o][1]]:o===n?(r[a++]=t[o],r[a++]=[t[o][0],-90]):r[a++]=t[o];var i=f.tester(r);i.pts.pop(),c.push(i)}:function(t){c.push(f.tester(t))},i.type){case"MultiPolygon":for(r=0;rg&&h.splice(g,h.length-g),p.length>g&&p.splice(g,p.length-g);var v={padded:!0},m={padded:!0};if(i.hasMarkers(e)){if(n=e.marker,c=n.size,Array.isArray(c)){var y={type:"linear"};a.setConvert(y),c=y.makeCalcdata(e.marker,"size"),c.length>g&&c.splice(g,c.length-g)}var x,b=1.6*(e.marker.sizeref||1);x="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/b),3)}:function(t){return Math.max((t||0)/b,3)},v.ppad=m.ppad=Array.isArray(c)?c.map(x):x(c)}l(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||h[0]===h[g-1]&&p[0]===p[g-1]?e.error_y.visible||-1===["tonexty","tozeroy"].indexOf(e.fill)&&(i.hasMarkers(e)||i.hasText(e))||(v.padded=!1,v.ppad=0):v.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||h[0]===h[g-1]&&p[0]===p[g-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(m.padded=!1):m.tozero=!0,a.expand(f,h,v),a.expand(d,p,m);var _=new Array(g);for(u=0;u=0;a--){var o=t[a];if("scatter"===o.type&&o.xaxis===n.xaxis&&o.yaxis===n.yaxis){o.opacity=void 0;break}}}}}},{}],262:[function(t,e,n){"use strict";var r=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 n=e[0].trace,s=n.marker,c="cb"+n.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;r(f)||(f=a.aggNums(Math.min,null,u)),r(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":39,"../../components/colorscale":50,"../../lib":153,"../../plots/plots":231,"fast-isnumeric":11}],263:[function(t,e,n){"use strict";var r=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/calc"),o=t("./subtypes");e.exports=function(t){o.hasLines(t)&&r(t,"line")&&a(t,t.line.color,"line","c"),o.hasMarkers(t)&&(r(t,"marker")&&a(t,t.marker.color,"marker","c"),r(t,"marker.line")&&a(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":42,"../../components/colorscale/has_colorscale":49,"./subtypes":280}],264:[function(t,e,n){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20}},{}],265:[function(t,e,n){"use strict";var r=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,n,p){function g(n,o){return r.coerce(t,e,a,n,o)}var v=l(t,e,p,g),m=vV!=N>=V&&(O=z[C-1][0],D=z[C][0],P=O+(D-O)*(V-E)/(N-E),F=Math.min(F,P),B=Math.max(B,P));F=Math.max(F,0),B=Math.min(B,h._length);var U=l.defaultLine;return l.opacity(d.fillcolor)?U=d.fillcolor:l.opacity((d.line||{}).color)&&(U=d.line.color),r.extendFlat(t,{distance:c+10,x0:F,x1:B,y0:V,y1:V,color:U}),delete t.index,d.text&&!Array.isArray(d.text)?t.text=String(d.text):t.text=d.name,[t]}}}},{"../../components/color":36,"../../components/errorbars":66,"../../components/fx":77,"../../lib":153,"./fill_hover_text":266,"./get_trace_color":268}],270:[function(t,e,n){"use strict";var r={},a=t("./subtypes");r.hasLines=a.hasLines,r.hasMarkers=a.hasMarkers,r.hasText=a.hasText,r.isBubble=a.isBubble,r.attributes=t("./attributes"),r.supplyDefaults=t("./defaults"),r.cleanData=t("./clean_data"),r.calc=t("./calc"),r.arraysToCalcdata=t("./arrays_to_calcdata"),r.plot=t("./plot"),r.colorbar=t("./colorbar"),r.style=t("./style"),r.hoverPoints=t("./hover"),r.selectPoints=t("./select"),r.animatable=!0,r.moduleType="trace",r.name="scatter",r.basePlotModule=t("../../plots/cartesian"),r.categories=["cartesian","symbols","markerColorscale","errorBarsOK","showLegend","scatter-like"],r.meta={},e.exports=r},{"../../plots/cartesian":204,"./arrays_to_calcdata":258,"./attributes":259,"./calc":260,"./clean_data":261,"./colorbar":262,"./defaults":265,"./hover":269,"./plot":277,"./select":278,"./style":279,"./subtypes":280}],271:[function(t,e,n){"use strict";var r=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,n,o,i,l){var s=(t.marker||{}).color;if(i("line.color",n),r(t,"line"))a(t,e,o,i,{prefix:"line.",cLetter:"c"});else{i("line.color",!Array.isArray(s)&&s||n)}i("line.width"),(l||{}).noDash||i("line.dash")}},{"../../components/colorscale/defaults":45,"../../components/colorscale/has_colorscale":49}],272:[function(t,e,n){"use strict";var r=t("../../constants/numerical").BADNUM,a=t("../../lib"),o=a.segmentsIntersect,i=a.constrain,l=t("./constants");e.exports=function(t,e){function n(e){var n=N.c2p(t[e].x),a=R.c2p(t[e].y);return n!==r&&a!==r&&[n,a]}function s(t){var e=t[0]/N._length,n=t[1]/R._length;return(1+l.toleranceGrowth*Math.max(0,-e,e-1,-n,n-1))*F}function c(t,e){var n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}function u(t,e){for(var n=[],r=0,a=0;a<4;a++){var i=at[a],l=o(t[0],t[1],e[0],e[1],i[0],i[1],i[2],i[3]);l&&(!r||Math.abs(l.x-n[0][0])>1||Math.abs(l.y-n[0][1])>1)&&(l=[l.x,l.y],r&&c(l,t)et||t[1]rt)return[i(t[0],tt,et),i(t[1],nt,rt)]}function d(t,e){return t[0]===e[0]&&(t[0]===tt||t[0]===et)||(t[1]===e[1]&&(t[1]===nt||t[1]===rt)||void 0)}function h(t,e){var n=[],r=f(t),a=f(e);return r&&a&&d(r,a)?n:(r&&n.push(r),a&&n.push(a),n)}function p(t,e,n){return function(r,o){var i=f(r),l=f(o),s=[];if(i&&l&&d(i,l))return s;i&&s.push(i),l&&s.push(l);var c=2*a.constrain((r[t]+o[t])/2,e,n)-((i||r)[t]+(l||o)[t]);if(c){var u;u=i&&l?c>0==i[t]>l[t]?i:l:i||l,u[t]+=c}return s}}function g(t,e){var n=e[0]-t[0],r=(e[1]-t[1])/n;return(t[1]*e[0]-e[1]*t[0])/n>0?[r>0?tt:et,rt]:[r>0?et:tt,nt]}function v(t){var e=t[0],n=t[1],r=e===U[G-1][0],a=n===U[G-1][1];if(!r||!a)if(G>1){var o=e===U[G-2][0],i=n===U[G-2][1];r&&(e===tt||e===et)&&o?i?G--:U[G-1]=t:a&&(n===nt||n===rt)&&i?o?G--:U[G-1]=t:U[G++]=t}else U[G++]=t}function m(t){U[G-1][0]!==t[0]&&U[G-1][1]!==t[1]&&v([Z,W]),v(t),Q=null,Z=W=0}function y(t){if(Y=t[0]et?et:0,X=t[1]rt?rt:0,Y||X){if(G)if(Q){var e=J(Q,t);e.length>1&&(m(e[0]),U[G++]=e[1])}else $=J(U[G-1],t)[0],U[G++]=$;else U[G++]=[Y||t[0],X||t[1]];var n=U[G-1];Y&&X&&(n[0]!==Y||n[1]!==X)?(Q&&(Z!==Y&&W!==X?v(Z&&W?g(Q,t):[Z||Y,W||X]):Z&&W&&v([Z,W])),v([Y,X])):Z-Y&&W-X&&v([Y||Z,X||W]),Q=t,Z=Y,W=X}else Q&&m(J(Q,t)[0]),U[G++]=t}var x,b,_,w,M,k,A,T,L,C,S,z,P,O,D,E,N=e.xaxis,R=e.yaxis,I=e.simplify,j=e.connectGaps,F=e.baseTolerance,B=e.shape,q="linear"===B,H=[],V=l.minTolerance,U=new Array(t.length),G=0;I||(F=V=-1);var Y,X,Z,W,Q,$,J,K=l.maxScreensAway,tt=-N._length*K,et=N._length*(1+K),nt=-R._length*K,rt=R._length*(1+K),at=[[tt,nt,et,nt],[et,nt,et,rt],[et,rt,tt,rt],[tt,rt,tt,nt]];for("linear"===B||"spline"===B?J=u:"hv"===B||"vh"===B?J=h:"hvh"===B?J=p(0,tt,et):"vhv"===B&&(J=p(1,nt,rt)),x=0;xs(k))break;_=k,P=L[0]*T[0]+L[1]*T[1],P>S?(S=P,w=k,A=!1):P=t.length||!k)break;y(k),b=k}}else y(w)}Q&&v([Z||Q[0],W||Q[1]]),H.push(U.slice(0,G))}return H}},{"../../constants/numerical":135,"../../lib":153,"./constants":264}],273:[function(t,e,n){"use strict";e.exports=function(t,e,n){"spline"===n("line.shape")&&n("line.smoothing")}},{}],274:[function(t,e,n){"use strict";e.exports=function(t,e,n){for(var r,a,o=null,i=0;i0?Math.max(e,a):0}}},{"fast-isnumeric":11}],276:[function(t,e,n){"use strict";var r=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),o=t("../../components/colorscale/defaults"),i=t("./subtypes");e.exports=function(t,e,n,l,s,c){var u,f=i.isBubble(t),d=(t.line||{}).color;if(c=c||{},d&&(n=d),s("marker.symbol"),s("marker.opacity",f?.7:1),s("marker.size"),s("marker.color",n),a(t,"marker")&&o(t,e,l,s,{prefix:"marker.",cLetter:"c"}),c.noLine||(u=d&&!Array.isArray(d)&&e.marker.color!==d?d:f?r.background:r.defaultLine,s("marker.line.color",u),a(t,"marker.line")&&o(t,e,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",f?1:0)),f&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient){"none"!==s("marker.gradient.type")&&s("marker.gradient.color")}}},{"../../components/color":36,"../../components/colorscale/defaults":45,"../../components/colorscale/has_colorscale":49,"./subtypes":280}],277:[function(t,e,n){"use strict";function r(t,e,n){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 a=":first-child";e.select(".js-fill.js-tozero").size()&&(a+=" + *"),r._nextFill=e.insert("path",a).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),e.selectAll(".js-fill").call(s.setClipUrl,n.layerClipId)})}function a(t,e,n,r,a,d,p){function g(t){return M?t.transition():t}function v(t){return t.filter(function(t){return t.vis})}function m(t){return t.id}function y(t){if(t.ids)return m}function x(){return!1}function b(e){var r,a,o,c=e[0].trace,f=i.select(this),d=u.hasMarkers(c),h=u.hasText(c),p=y(c),m=x,b=x;d&&(m=c.marker.maxdisplayed||c._needsCull?v:l.identity),h&&(b=c.marker.maxdisplayed||c._needsCull?v:l.identity),a=f.selectAll("path.point"),r=a.data(m,p);var _=r.enter().append("path").classed("point",!0);M&&_.call(s.pointStyle,c,t).call(s.translatePoints,k,A).style("opacity",0).transition().style("opacity",1);var w=d&&s.tryColorscale(c.marker,""),T=d&&s.tryColorscale(c.marker,"line");r.order(),r.each(function(e){var r=i.select(this),a=g(r);o=s.translatePoint(e,a,k,A),o?(s.singlePointStyle(e,a,c,w,T,t),n.layerClipId&&s.hideOutsideRangePoint(e,a,k,A),c.customdata&&r.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()}),M?r.exit().transition().style("opacity",0).remove():r.exit().remove(),a=f.selectAll("g"),r=a.data(b,p),r.enter().append("g").classed("textpoint",!0).append("text"),r.order(),r.each(function(t){var e=i.select(this),r=g(e.select("text"));o=s.translatePoint(t,r,k,A),o?n.layerClipId&&s.hideOutsideRangePoint(t,e,k,A):e.remove()}),r.selectAll("text").call(s.textPointStyle,c,t).each(function(t){var e=k.c2p(t.x),n=A.c2p(t.y);i.select(this).selectAll("tspan.line").each(function(){g(i.select(this)).attr({x:e,y:n})})}),r.exit().remove()}var _,w;o(t,e,n,r,a);var M=!!p&&p.duration>0,k=n.xaxis,A=n.yaxis,T=r[0].trace,L=T.line,C=i.select(d);if(C.call(c.plot,n,p),!0===T.visible){g(C).style("opacity",T.opacity);var S,z,P=T.fill.charAt(T.fill.length-1);"x"!==P&&"y"!==P&&(P=""),r[0].node3=C;var O="",D=[],E=T._prevtrace;E&&(O=E._prevRevpath||"",z=E._nextFill,D=E._polygons);var N,R,I,j,F,B,q,H,V,U="",G="",Y=[],X=l.noop;if(S=T._ownFill,u.hasLines(T)||"none"!==T.fill){for(z&&z.datum(r),-1!==["hv","vh","hvh","vhv"].indexOf(L.shape)?(I=s.steps(L.shape),j=s.steps(L.shape.split("").reverse().join(""))):I=j="spline"===L.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?s.smoothclosed(t.slice(1),L.smoothing):s.smoothopen(t,L.smoothing)}:function(t){return"M"+t.join("L")},F=function(t){return j(t.reverse())},Y=f(r,{xaxis:k,yaxis:A,connectGaps:T.connectgaps,baseTolerance:Math.max(L.width||1,3)/4,shape:L.shape,simplify:L.simplify}),V=T._polygons=new Array(Y.length),w=0;w1){var n=i.select(this);if(n.datum(r),t)g(n.style("opacity",0).attr("d",N).call(s.lineGroupStyle)).style("opacity",1);else{var a=g(n);a.attr("d",N),s.singleLineStyle(r,a)}}}}}var Z=C.selectAll(".js-line").data(Y);g(Z.exit()).style("opacity",0).remove(),Z.each(X(!1)),Z.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(X(!0)),s.setClipUrl(Z,n.layerClipId),Y.length&&(S?B&&H&&(P?("y"===P?B[1]=H[1]=A.c2p(0,!0):"x"===P&&(B[0]=H[0]=k.c2p(0,!0)),g(S).attr("d","M"+H+"L"+B+"L"+U.substr(1)).call(s.singleFillStyle)):g(S).attr("d",U+"Z").call(s.singleFillStyle)):"tonext"===T.fill.substr(0,6)&&U&&O&&("tonext"===T.fill?g(z).attr("d",U+"Z"+O+"Z").call(s.singleFillStyle):g(z).attr("d",U+"L"+O.substr(1)+"Z").call(s.singleFillStyle),T._polygons=T._polygons.concat(D)),T._prevRevpath=G,T._prevPolygons=V);var W=C.selectAll(".points");_=W.data([r]),W.each(b),_.enter().append("g").classed("points",!0).each(b),_.exit().remove(),_.each(function(t){var e=!1===t[0].trace.cliponaxis;s.setClipUrl(i.select(this),e?null:n.layerClipId)})}}function o(t,e,n,r,a){var o=n.xaxis,s=n.yaxis,c=i.extent(l.simpleMap(o.range,o.r2c)),f=i.extent(l.simpleMap(s.range,s.r2c)),d=r[0].trace;if(u.hasMarkers(d)){var h=d.marker.maxdisplayed;if(0!==h){var p=r.filter(function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=f[0]&&t.y<=f[1]}),g=Math.ceil(p.length/h),v=0;a.forEach(function(t,n){var r=t[0].trace;u.hasMarkers(r)&&r.marker.maxdisplayed>0&&n0;for(u=p.selectAll("g.trace"),f=u.data(n,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),d(t,e,n),r(t,p,e),s=0,c={};sc[e[0].trace.uid]?1:-1}),v){l&&(h=l());i.transition().duration(o.duration).ease(o.easing).each("end",function(){h&&h()}).each("interrupt",function(){h&&h()}).each(function(){p.selectAll("g.trace").each(function(r,i){a(t,i,e,r,n,this,o)})})}else p.selectAll("g.trace").each(function(r,i){a(t,i,e,r,n,this,o)});g&&f.exit().remove(),p.selectAll("path:not([d])").remove()}},{"../../components/drawing":60,"../../components/errorbars":66,"../../lib":153,"../../lib/polygon":164,"./line_points":272,"./link_traces":274,"./subtypes":280,d3:8}],278:[function(t,e,n){"use strict";var r=t("./subtypes"),a=t("../../constants/interactions").DESELECTDIM;e.exports=function(t,e){var n,o,i,l,s=t.cd,c=t.xaxis,u=t.yaxis,f=[],d=s[0].trace,h=d.marker,p=!r.hasMarkers(d)&&!r.hasText(d);if(!0!==d.visible||p)return[];var g=Array.isArray(h.opacity)?1:h.opacity;if(!1===e)for(n=0;n")}var a=t("../../components/fx"),o=t("../../plots/cartesian/axes"),i=t("../../constants/numerical").BADNUM,l=t("../scatter/get_trace_color"),s=t("../scatter/fill_hover_text"),c=t("./attributes");e.exports=function(t,e,n){function o(t){var r=t.lonlat;if(r[0]===i)return 1/0;if(h(r))return 1/0;var a=p(r),o=p([e,n]),l=Math.abs(a[0]-o[0]),s=Math.abs(a[1]-o[1]),c=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+s*s)-c,1-3/c)}var s=t.cd,c=s[0].trace,u=t.xa,f=t.ya,d=t.subplot,h=d.projection.isLonLatOverEdges,p=d.project;if(a.getClosest(s,o,t),!1!==t.index){var g=s[t.index],v=g.lonlat,m=[u.c2p(v),f.c2p(v)],y=g.mrc||1;return t.x0=m[0]-y,t.x1=m[0]+y,t.y0=m[1]-y,t.y1=m[1]+y,t.loc=g.loc,t.lon=v[0],t.lat=v[1],t.color=l(c,g),t.extraText=r(c,g,d.mockAxis),[t]}}},{"../../components/fx":77,"../../constants/numerical":135,"../../plots/cartesian/axes":194,"../scatter/fill_hover_text":266,"../scatter/get_trace_color":268,"./attributes":283}],288:[function(t,e,n){"use strict";var r={};r.attributes=t("./attributes"),r.supplyDefaults=t("./defaults"),r.colorbar=t("../scatter/colorbar"),r.calc=t("./calc"),r.plot=t("./plot"),r.hoverPoints=t("./hover"),r.eventData=t("./event_data"),r.selectPoints=t("./select"),r.moduleType="trace",r.name="scattergeo",r.basePlotModule=t("../../plots/geo"),r.categories=["geo","symbols","markerColorscale","showLegend","scatter-like"],r.meta={},e.exports=r},{"../../plots/geo":222,"../scatter/colorbar":262,"./attributes":283,"./calc":284,"./defaults":285,"./event_data":286,"./hover":287,"./plot":289,"./select":290}],289:[function(t,e,n){"use strict";function r(t,e){var n=t[0].trace;if(Array.isArray(n.locations))for(var r=u(n,e),a=n.locationmode,o=0;oV!=N>=V&&(O=z[C-1][0],D=z[C][0],P=O+(D-O)*(V-E)/(N-E),F=Math.min(F,P),B=Math.max(B,P));F=Math.max(F,0),B=Math.min(B,h._length);var U=l.defaultLine;return l.opacity(d.fillcolor)?U=d.fillcolor:l.opacity((d.line||{}).color)&&(U=d.line.color),r.extendFlat(t,{distance:c+10,x0:F,x1:B,y0:V,y1:V,color:U}),delete t.index,d.text&&!Array.isArray(d.text)?t.text=String(d.text):t.text=d.name,[t]}}}},{"../../components/color":36,"../../components/errorbars":66,"../../components/fx":77,"../../lib":153,"./fill_hover_text":266,"./get_trace_color":268}],270:[function(t,e,n){"use strict";var r={},a=t("./subtypes");r.hasLines=a.hasLines,r.hasMarkers=a.hasMarkers,r.hasText=a.hasText,r.isBubble=a.isBubble,r.attributes=t("./attributes"),r.supplyDefaults=t("./defaults"),r.cleanData=t("./clean_data"),r.calc=t("./calc"),r.arraysToCalcdata=t("./arrays_to_calcdata"),r.plot=t("./plot"),r.colorbar=t("./colorbar"),r.style=t("./style"),r.hoverPoints=t("./hover"),r.selectPoints=t("./select"),r.animatable=!0,r.moduleType="trace",r.name="scatter",r.basePlotModule=t("../../plots/cartesian"),r.categories=["cartesian","symbols","markerColorscale","errorBarsOK","showLegend","scatter-like"],r.meta={},e.exports=r},{"../../plots/cartesian":204,"./arrays_to_calcdata":258,"./attributes":259,"./calc":260,"./clean_data":261,"./colorbar":262,"./defaults":265,"./hover":269,"./plot":277,"./select":278,"./style":279,"./subtypes":280}],271:[function(t,e,n){"use strict";var r=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,n,o,i,l){var s=(t.marker||{}).color;if(i("line.color",n),r(t,"line"))a(t,e,o,i,{prefix:"line.",cLetter:"c"});else{i("line.color",!Array.isArray(s)&&s||n)}i("line.width"),(l||{}).noDash||i("line.dash")}},{"../../components/colorscale/defaults":45,"../../components/colorscale/has_colorscale":49}],272:[function(t,e,n){"use strict";var r=t("../../constants/numerical").BADNUM,a=t("../../lib"),o=a.segmentsIntersect,i=a.constrain,l=t("./constants");e.exports=function(t,e){function n(e){var n=N.c2p(t[e].x),a=R.c2p(t[e].y);return n!==r&&a!==r&&[n,a]}function s(t){var e=t[0]/N._length,n=t[1]/R._length;return(1+l.toleranceGrowth*Math.max(0,-e,e-1,-n,n-1))*F}function c(t,e){var n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}function u(t,e){for(var n=[],r=0,a=0;a<4;a++){var i=at[a],l=o(t[0],t[1],e[0],e[1],i[0],i[1],i[2],i[3]);l&&(!r||Math.abs(l.x-n[0][0])>1||Math.abs(l.y-n[0][1])>1)&&(l=[l.x,l.y],r&&c(l,t)et||t[1]rt)return[i(t[0],tt,et),i(t[1],nt,rt)]}function d(t,e){return t[0]===e[0]&&(t[0]===tt||t[0]===et)||(t[1]===e[1]&&(t[1]===nt||t[1]===rt)||void 0)}function h(t,e){var n=[],r=f(t),a=f(e);return r&&a&&d(r,a)?n:(r&&n.push(r),a&&n.push(a),n)}function p(t,e,n){return function(r,o){var i=f(r),l=f(o),s=[];if(i&&l&&d(i,l))return s;i&&s.push(i),l&&s.push(l);var c=2*a.constrain((r[t]+o[t])/2,e,n)-((i||r)[t]+(l||o)[t]);if(c){var u;u=i&&l?c>0==i[t]>l[t]?i:l:i||l,u[t]+=c}return s}}function g(t,e){var n=e[0]-t[0],r=(e[1]-t[1])/n;return(t[1]*e[0]-e[1]*t[0])/n>0?[r>0?tt:et,rt]:[r>0?et:tt,nt]}function v(t){var e=t[0],n=t[1],r=e===U[G-1][0],a=n===U[G-1][1];if(!r||!a)if(G>1){var o=e===U[G-2][0],i=n===U[G-2][1];r&&(e===tt||e===et)&&o?i?G--:U[G-1]=t:a&&(n===nt||n===rt)&&i?o?G--:U[G-1]=t:U[G++]=t}else U[G++]=t}function m(t){U[G-1][0]!==t[0]&&U[G-1][1]!==t[1]&&v([Z,W]),v(t),Q=null,Z=W=0}function y(t){if(Y=t[0]et?et:0,X=t[1]rt?rt:0,Y||X){if(G)if(Q){var e=J(Q,t);e.length>1&&(m(e[0]),U[G++]=e[1])}else $=J(U[G-1],t)[0],U[G++]=$;else U[G++]=[Y||t[0],X||t[1]];var n=U[G-1];Y&&X&&(n[0]!==Y||n[1]!==X)?(Q&&(Z!==Y&&W!==X?v(Z&&W?g(Q,t):[Z||Y,W||X]):Z&&W&&v([Z,W])),v([Y,X])):Z-Y&&W-X&&v([Y||Z,X||W]),Q=t,Z=Y,W=X}else Q&&m(J(Q,t)[0]),U[G++]=t}var x,b,_,w,M,k,A,T,L,C,S,z,P,O,D,E,N=e.xaxis,R=e.yaxis,I=e.simplify,j=e.connectGaps,F=e.baseTolerance,B=e.shape,q="linear"===B,H=[],V=l.minTolerance,U=new Array(t.length),G=0;I||(F=V=-1);var Y,X,Z,W,Q,$,J,K=l.maxScreensAway,tt=-N._length*K,et=N._length*(1+K),nt=-R._length*K,rt=R._length*(1+K),at=[[tt,nt,et,nt],[et,nt,et,rt],[et,rt,tt,rt],[tt,rt,tt,nt]];for("linear"===B||"spline"===B?J=u:"hv"===B||"vh"===B?J=h:"hvh"===B?J=p(0,tt,et):"vhv"===B&&(J=p(1,nt,rt)),x=0;xs(k))break;_=k,P=L[0]*T[0]+L[1]*T[1],P>S?(S=P,w=k,A=!1):P=t.length||!k)break;y(k),b=k}}else y(w)}Q&&v([Z||Q[0],W||Q[1]]),H.push(U.slice(0,G))}return H}},{"../../constants/numerical":135,"../../lib":153,"./constants":264}],273:[function(t,e,n){"use strict";e.exports=function(t,e,n){"spline"===n("line.shape")&&n("line.smoothing")}},{}],274:[function(t,e,n){"use strict";e.exports=function(t,e,n){for(var r,a,o=null,i=0;i0?Math.max(e,a):0}}},{"fast-isnumeric":11}],276:[function(t,e,n){"use strict";var r=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),o=t("../../components/colorscale/defaults"),i=t("./subtypes");e.exports=function(t,e,n,l,s,c){var u,f=i.isBubble(t),d=(t.line||{}).color;if(c=c||{},d&&(n=d),s("marker.symbol"),s("marker.opacity",f?.7:1),s("marker.size"),s("marker.color",n),a(t,"marker")&&o(t,e,l,s,{prefix:"marker.",cLetter:"c"}),c.noLine||(u=d&&!Array.isArray(d)&&e.marker.color!==d?d:f?r.background:r.defaultLine,s("marker.line.color",u),a(t,"marker.line")&&o(t,e,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",f?1:0)),f&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient){"none"!==s("marker.gradient.type")&&s("marker.gradient.color")}}},{"../../components/color":36,"../../components/colorscale/defaults":45,"../../components/colorscale/has_colorscale":49,"./subtypes":280}],277:[function(t,e,n){"use strict";function r(t,e,n){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 a=":first-child";e.select(".js-fill.js-tozero").size()&&(a+=" + *"),r._nextFill=e.insert("path",a).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),e.selectAll(".js-fill").call(s.setClipUrl,n.layerClipId)})}function a(t,e,n,r,a,d,p){function g(t){return M?t.transition():t}function v(t){return t.filter(function(t){return t.vis})}function m(t){return t.id}function y(t){if(t.ids)return m}function x(){return!1}function b(e){var r,a,o,c=e[0].trace,f=i.select(this),d=u.hasMarkers(c),h=u.hasText(c),p=y(c),m=x,b=x;d&&(m=c.marker.maxdisplayed||c._needsCull?v:l.identity),h&&(b=c.marker.maxdisplayed||c._needsCull?v:l.identity),a=f.selectAll("path.point"),r=a.data(m,p);var _=r.enter().append("path").classed("point",!0);M&&_.call(s.pointStyle,c,t).call(s.translatePoints,k,A).style("opacity",0).transition().style("opacity",1);var w=d&&s.tryColorscale(c.marker,""),T=d&&s.tryColorscale(c.marker,"line");r.order(),r.each(function(e){var r=i.select(this),a=g(r);o=s.translatePoint(e,a,k,A),o?(s.singlePointStyle(e,a,c,w,T,t),n.layerClipId&&s.hideOutsideRangePoint(e,a,k,A),c.customdata&&r.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()}),M?r.exit().transition().style("opacity",0).remove():r.exit().remove(),a=f.selectAll("g"),r=a.data(b,p),r.enter().append("g").classed("textpoint",!0).append("text"),r.order(),r.each(function(t){var e=i.select(this),r=g(e.select("text"));o=s.translatePoint(t,r,k,A),o?n.layerClipId&&s.hideOutsideRangePoint(t,e,k,A):e.remove()}),r.selectAll("text").call(s.textPointStyle,c,t).each(function(t){var e=k.c2p(t.x),n=A.c2p(t.y);i.select(this).selectAll("tspan.line").each(function(){g(i.select(this)).attr({x:e,y:n})})}),r.exit().remove()}var _,w;o(t,e,n,r,a);var M=!!p&&p.duration>0,k=n.xaxis,A=n.yaxis,T=r[0].trace,L=T.line,C=i.select(d);if(C.call(c.plot,n,p),!0===T.visible){g(C).style("opacity",T.opacity);var S,z,P=T.fill.charAt(T.fill.length-1);"x"!==P&&"y"!==P&&(P=""),r[0].node3=C;var O="",D=[],E=T._prevtrace;E&&(O=E._prevRevpath||"",z=E._nextFill,D=E._polygons);var N,R,I,j,F,B,q,H,V,U="",G="",Y=[],X=l.noop;if(S=T._ownFill,u.hasLines(T)||"none"!==T.fill){for(z&&z.datum(r),-1!==["hv","vh","hvh","vhv"].indexOf(L.shape)?(I=s.steps(L.shape),j=s.steps(L.shape.split("").reverse().join(""))):I=j="spline"===L.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?s.smoothclosed(t.slice(1),L.smoothing):s.smoothopen(t,L.smoothing)}:function(t){return"M"+t.join("L")},F=function(t){return j(t.reverse())},Y=f(r,{xaxis:k,yaxis:A,connectGaps:T.connectgaps,baseTolerance:Math.max(L.width||1,3)/4,shape:L.shape,simplify:L.simplify}),V=T._polygons=new Array(Y.length),w=0;w1){var n=i.select(this);if(n.datum(r),t)g(n.style("opacity",0).attr("d",N).call(s.lineGroupStyle)).style("opacity",1);else{var a=g(n);a.attr("d",N),s.singleLineStyle(r,a)}}}}}var Z=C.selectAll(".js-line").data(Y);g(Z.exit()).style("opacity",0).remove(),Z.each(X(!1)),Z.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(X(!0)),s.setClipUrl(Z,n.layerClipId),Y.length&&(S?B&&H&&(P?("y"===P?B[1]=H[1]=A.c2p(0,!0):"x"===P&&(B[0]=H[0]=k.c2p(0,!0)),g(S).attr("d","M"+H+"L"+B+"L"+U.substr(1)).call(s.singleFillStyle)):g(S).attr("d",U+"Z").call(s.singleFillStyle)):"tonext"===T.fill.substr(0,6)&&U&&O&&("tonext"===T.fill?g(z).attr("d",U+"Z"+O+"Z").call(s.singleFillStyle):g(z).attr("d",U+"L"+O.substr(1)+"Z").call(s.singleFillStyle),T._polygons=T._polygons.concat(D)),T._prevRevpath=G,T._prevPolygons=V);var W=C.selectAll(".points");_=W.data([r]),W.each(b),_.enter().append("g").classed("points",!0).each(b),_.exit().remove(),_.each(function(t){var e=!1===t[0].trace.cliponaxis;s.setClipUrl(i.select(this),e?null:n.layerClipId)})}}function o(t,e,n,r,a){var o=n.xaxis,s=n.yaxis,c=i.extent(l.simpleMap(o.range,o.r2c)),f=i.extent(l.simpleMap(s.range,s.r2c)),d=r[0].trace;if(u.hasMarkers(d)){var h=d.marker.maxdisplayed;if(0!==h){var p=r.filter(function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=f[0]&&t.y<=f[1]}),g=Math.ceil(p.length/h),v=0;a.forEach(function(t,n){var r=t[0].trace;u.hasMarkers(r)&&r.marker.maxdisplayed>0&&n0;for(u=p.selectAll("g.trace"),f=u.data(n,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),d(t,e,n),r(t,p,e),s=0,c={};sc[e[0].trace.uid]?1:-1}),v){l&&(h=l());i.transition().duration(o.duration).ease(o.easing).each("end",function(){h&&h()}).each("interrupt",function(){h&&h()}).each(function(){p.selectAll("g.trace").each(function(r,i){a(t,i,e,r,n,this,o)})})}else p.selectAll("g.trace").each(function(r,i){a(t,i,e,r,n,this,o)});g&&f.exit().remove(),p.selectAll("path:not([d])").remove()}},{"../../components/drawing":60,"../../components/errorbars":66,"../../lib":153,"../../lib/polygon":164,"./line_points":272,"./link_traces":274,"./subtypes":280,d3:8}],278:[function(t,e,n){"use strict";var r=t("./subtypes"),a=t("../../constants/interactions").DESELECTDIM;e.exports=function(t,e){var n,o,i,l,s=t.cd,c=t.xaxis,u=t.yaxis,f=[],d=s[0].trace,h=d.marker;if(!r.hasMarkers(d)&&!r.hasText(d))return[];var p=Array.isArray(h.opacity)?1:h.opacity;if(!1===e)for(n=0;n")}var a=t("../../components/fx"),o=t("../../plots/cartesian/axes"),i=t("../../constants/numerical").BADNUM,l=t("../scatter/get_trace_color"),s=t("../scatter/fill_hover_text"),c=t("./attributes");e.exports=function(t,e,n){function o(t){var r=t.lonlat;if(r[0]===i)return 1/0;if(h(r))return 1/0;var a=p(r),o=p([e,n]),l=Math.abs(a[0]-o[0]),s=Math.abs(a[1]-o[1]),c=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+s*s)-c,1-3/c)}var s=t.cd,c=s[0].trace,u=t.xa,f=t.ya,d=t.subplot,h=d.projection.isLonLatOverEdges,p=d.project;if(a.getClosest(s,o,t),!1!==t.index){var g=s[t.index],v=g.lonlat,m=[u.c2p(v),f.c2p(v)],y=g.mrc||1;return t.x0=m[0]-y,t.x1=m[0]+y,t.y0=m[1]-y,t.y1=m[1]+y,t.loc=g.loc,t.lon=v[0],t.lat=v[1],t.color=l(c,g),t.extraText=r(c,g,d.mockAxis),[t]}}},{"../../components/fx":77,"../../constants/numerical":135,"../../plots/cartesian/axes":194,"../scatter/fill_hover_text":266,"../scatter/get_trace_color":268,"./attributes":283}],288:[function(t,e,n){"use strict";var r={};r.attributes=t("./attributes"),r.supplyDefaults=t("./defaults"),r.colorbar=t("../scatter/colorbar"),r.calc=t("./calc"),r.plot=t("./plot"),r.hoverPoints=t("./hover"),r.eventData=t("./event_data"),r.selectPoints=t("./select"),r.moduleType="trace",r.name="scattergeo",r.basePlotModule=t("../../plots/geo"),r.categories=["geo","symbols","markerColorscale","showLegend","scatter-like"],r.meta={},e.exports=r},{"../../plots/geo":222,"../scatter/colorbar":262,"./attributes":283,"./calc":284,"./defaults":285,"./event_data":286,"./hover":287,"./plot":289,"./select":290}],289:[function(t,e,n){"use strict";function r(t,e){var n=t[0].trace;if(Array.isArray(n.locations))for(var r=u(n,e),a=n.locationmode,o=0;o0;)if(r[s]===e||r[s].listener&&r[s].listener===e){n=s;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],a(r))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){return this._events&&this._events[t]?a(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(a(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],68:[function(t,e,r){"use strict";function n(t){for(var e,r=t.length,n=0;n13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}e.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0===(t=+t)&&n(r))return!1}else if("number"!==e)return!1;return t-t<1}},{}],69:[function(t,e,r){"use strict";function n(t){t=t||{};var e,r,n=t.canvas||document.createElement("canvas"),o=t.family||"sans-serif",s=t.shape||[512,512],l=t.step||[32,32],u=parseFloat(t.size)||16,c=t.chars||[32,126],f=Math.floor((l[0]-u)/2),h=t.radius||1.5*f,d=new i(u,f,h,0,o),p=null==t.align?"optical":t.align,g=null==t.fit||1==t.fit?.5:t.fit;if(Array.isArray(c)){if(2===c.length&&"number"==typeof c[0]&&"number"==typeof c[1]){var m=[];for(e=c[0],r=0;e<=c[1];e++)m[r++]=String.fromCharCode(e);c=m}}else c=String(c).split("");s=s.slice(),n.width=s[0],n.height=s[1];var v=n.getContext("2d");v.fillStyle="#000",v.fillRect(0,0,n.width,n.height),v.textBaseline="middle";var y=l[0],b=l[1],x=0,_=0,w=u/b,A=Math.min(c.length,Math.floor(s[0]/y)*Math.ceil(s[1]/b)),k=d.ctx.textAlign,M=d.buffer,T=d.middle;for(d.ctx.textAlign="center",d.buffer=d.size/2,e=0;es[0]-l[0]&&(x=0,_+=l[1])}return d.ctx.textAlign=k,d.buffer=M,d.middle=T,n}function a(t,e,r){if(s[e]&&s[e][t])return s[e][t];var n=200*r,a=o(t,{size:200,fontSize:n,fontFamily:e});s[e]||(s[e]={});var i={center:[a.center[0]/200,a.center[1]/200],bounds:a.bounds.map(function(t){return t/200}),radius:a.radius/200};return s[e][t]=i,i}var i=t("tiny-sdf"),o=t("optical-properties");e.exports=n;var s={}},{"optical-properties":165,"tiny-sdf":199}],70:[function(t,e,r){"use strict";function n(t,e,r,n,a,i){this._color=t,this.key=e,this.value=r,this.left=n,this.right=a,this._count=i}function a(t){return new n(t._color,t.key,t.value,t.left,t.right,t._count)}function i(t,e){return new n(t,e.key,e.value,e.left,e.right,e._count)}function o(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function s(t,e){this._compare=t,this.root=e}function l(t,e){if(e.left){var r=l(t,e.left);if(r)return r}var r=t(e.key,e.value);return r||(e.right?l(t,e.right):void 0)}function u(t,e,r,n){if(e(t,n.key)<=0){if(n.left){var a=u(t,e,r,n.left);if(a)return a}var a=r(n.key,n.value);if(a)return a}if(n.right)return u(t,e,r,n.right)}function c(t,e,r,n,a){var i,o=r(t,a.key),s=r(e,a.key);if(o<=0){if(a.left&&(i=c(t,e,r,n,a.left)))return i;if(s>0&&(i=n(a.key,a.value)))return i}if(s>0&&a.right)return c(t,e,r,n,a.right)}function f(t,e){this.tree=t,this._stack=e}function h(t,e){t.key=e.key,t.value=e.value,t.left=e.left,t.right=e.right,t._color=e._color,t._count=e._count}function d(t){for(var e,r,n,s,l=t.length-1;l>=0;--l){if(e=t[l],0===l)return void(e._color=v);if(r=t[l-1],r.left===e){if(n=r.right,n.right&&n.right._color===m){if(n=r.right=a(n),s=n.right=a(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,e._color=v,r._color=v,s._color=v,o(r),o(n),l>1){var u=t[l-2];u.left===r?u.left=n:u.right=n}return void(t[l-1]=n)}if(n.left&&n.left._color===m){if(n=r.right=a(n),s=n.left=a(n.left),r.right=s.left,n.left=s.right,s.left=r,s.right=n,s._color=r._color,r._color=v,n._color=v,e._color=v,o(r),o(n),o(s),l>1){var u=t[l-2];u.left===r?u.left=s:u.right=s}return void(t[l-1]=s)}if(n._color===v){if(r._color===m)return r._color=v,void(r.right=i(m,n));r.right=i(m,n);continue}if(n=a(n),r.right=n.left,n.left=r,n._color=r._color,r._color=m,o(r),o(n),l>1){var u=t[l-2];u.left===r?u.left=n:u.right=n}t[l-1]=n,t[l]=r,l+11){var u=t[l-2];u.right===r?u.right=n:u.left=n}return void(t[l-1]=n)}if(n.right&&n.right._color===m){if(n=r.left=a(n),s=n.right=a(n.right),r.left=s.right,n.right=s.left,s.right=r,s.left=n,s._color=r._color,r._color=v,n._color=v,e._color=v,o(r),o(n),o(s),l>1){var u=t[l-2];u.right===r?u.right=s:u.left=s}return void(t[l-1]=s)}if(n._color===v){if(r._color===m)return r._color=v,void(r.left=i(m,n));r.left=i(m,n);continue}if(n=a(n),r.left=n.right,n.right=r,n._color=r._color,r._color=m,o(r),o(n),l>1){var u=t[l-2];u.right===r?u.right=n:u.left=n}t[l-1]=n,t[l]=r,l+1e?1:0}function g(t){return new s(t||p,null)}e.exports=g;var m=0,v=1,y=s.prototype;Object.defineProperty(y,"keys",{get:function(){var t=[];return this.forEach(function(e,r){t.push(e)}),t}}),Object.defineProperty(y,"values",{get:function(){var t=[];return this.forEach(function(e,r){t.push(r)}),t}}),Object.defineProperty(y,"length",{get:function(){return this.root?this.root._count:0}}),y.insert=function(t,e){for(var r=this._compare,a=this.root,l=[],u=[];a;){var c=r(t,a.key);l.push(a),u.push(c),a=c<=0?a.left:a.right}l.push(new n(m,t,e,null,null,1));for(var f=l.length-2;f>=0;--f){var a=l[f];u[f]<=0?l[f]=new n(a._color,a.key,a.value,l[f+1],a.right,a._count+1):l[f]=new n(a._color,a.key,a.value,a.left,l[f+1],a._count+1)}for(var f=l.length-1;f>1;--f){var h=l[f-1],a=l[f];if(h._color===v||a._color===v)break;var d=l[f-2];if(d.left===h)if(h.left===a){var p=d.right;if(!p||p._color!==m){if(d._color=m,d.left=h.right,h._color=v,h.right=d,l[f-2]=h,l[f-1]=a,o(d),o(h),f>=3){var g=l[f-3];g.left===d?g.left=h:g.right=h}break}h._color=v,d.right=i(v,p),d._color=m,f-=1}else{var p=d.right;if(!p||p._color!==m){if(h.right=a.left,d._color=m,d.left=a.right,a._color=v,a.left=h,a.right=d,l[f-2]=a,l[f-1]=h,o(d),o(h),o(a),f>=3){var g=l[f-3];g.left===d?g.left=a:g.right=a}break}h._color=v,d.right=i(v,p),d._color=m,f-=1}else if(h.right===a){var p=d.left;if(!p||p._color!==m){if(d._color=m,d.right=h.left,h._color=v,h.left=d,l[f-2]=h,l[f-1]=a,o(d),o(h),f>=3){var g=l[f-3];g.right===d?g.right=h:g.left=h}break}h._color=v,d.left=i(v,p),d._color=m,f-=1}else{var p=d.left;if(!p||p._color!==m){if(h.left=a.right,d._color=m,d.right=a.left,a._color=v,a.right=h,a.left=d,l[f-2]=a,l[f-1]=h,o(d),o(h),o(a),f>=3){var g=l[f-3];g.right===d?g.right=a:g.left=a}break}h._color=v,d.left=i(v,p),d._color=m,f-=1}}return l[0]._color=v,new s(r,l[0])},y.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return l(t,this.root);case 2:return u(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return c(e,r,this._compare,t,this.root)}},Object.defineProperty(y,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new f(this,t)}}),Object.defineProperty(y,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new f(this,t)}}),y.at=function(t){if(t<0)return new f(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t=e.right._count)break;e=e.right}return new f(this,[])},y.ge=function(t){for(var e=this._compare,r=this.root,n=[],a=0;r;){var i=e(t,r.key);n.push(r),i<=0&&(a=n.length),r=i<=0?r.left:r.right}return n.length=a,new f(this,n)},y.gt=function(t){for(var e=this._compare,r=this.root,n=[],a=0;r;){var i=e(t,r.key);n.push(r),i<0&&(a=n.length),r=i<0?r.left:r.right}return n.length=a,new f(this,n)},y.lt=function(t){for(var e=this._compare,r=this.root,n=[],a=0;r;){var i=e(t,r.key);n.push(r),i>0&&(a=n.length),r=i<=0?r.left:r.right}return n.length=a,new f(this,n)},y.le=function(t){for(var e=this._compare,r=this.root,n=[],a=0;r;){var i=e(t,r.key);n.push(r),i>=0&&(a=n.length),r=i<0?r.left:r.right}return n.length=a,new f(this,n)},y.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var a=e(t,r.key);if(n.push(r),0===a)return new f(this,n);r=a<=0?r.left:r.right}return new f(this,[])},y.remove=function(t){var e=this.find(t);return e?e.remove():this},y.get=function(t){for(var e=this._compare,r=this.root;r;){var n=e(t,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var b=f.prototype;Object.defineProperty(b,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(b,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),b.clone=function(){return new f(this.tree,this._stack.slice())},b.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var e=new Array(t.length),r=t[t.length-1];e[e.length-1]=new n(r._color,r.key,r.value,r.left,r.right,r._count);for(var a=t.length-2;a>=0;--a){var r=t[a];r.left===t[a+1]?e[a]=new n(r._color,r.key,r.value,e[a+1],r.right,r._count):e[a]=new n(r._color,r.key,r.value,r.left,e[a+1],r._count)}if(r=e[e.length-1],r.left&&r.right){var i=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var o=e[i-1];e.push(new n(r._color,o.key,o.value,r.left,r.right,r._count)),e[i-1].key=r.key,e[i-1].value=r.value;for(var a=e.length-2;a>=i;--a)r=e[a],e[a]=new n(r._color,r.key,r.value,r.left,e[a+1],r._count);e[i-1].left=e[i]}if(r=e[e.length-1],r._color===m){var l=e[e.length-2];l.left===r?l.left=null:l.right===r&&(l.right=null),e.pop();for(var a=0;a0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(b,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(b,"index",{get:function(){var t=0,e=this._stack;if(0===e.length){var r=this.tree.root;return r?r._count:0}e[e.length-1].left&&(t=e[e.length-1].left._count);for(var n=e.length-2;n>=0;--n)e[n+1]===e[n].right&&(++t,e[n].left&&(t+=e[n].left._count));return t},enumerable:!0}),b.next=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.right)for(e=e.right;e;)t.push(e),e=e.left;else for(t.pop();t.length>0&&t[t.length-1].right===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(b,"hasNext",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].right)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].left===t[e])return!0;return!1}}),b.update=function(t){var e=this._stack;if(0===e.length)throw new Error("Can't update empty node!");var r=new Array(e.length),a=e[e.length-1];r[r.length-1]=new n(a._color,a.key,t,a.left,a.right,a._count);for(var i=e.length-2;i>=0;--i)a=e[i],a.left===e[i+1]?r[i]=new n(a._color,a.key,a.value,r[i+1],a.right,a._count):r[i]=new n(a._color,a.key,a.value,a.left,r[i+1],a._count);return new s(this.tree._compare,r[0])},b.prev=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.left)for(e=e.left;e;)t.push(e),e=e.right;else for(t.pop();t.length>0&&t[t.length-1].left===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(b,"hasPrev",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].left)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].right===t[e])return!0;return!1}})},{}],71:[function(t,e,r){function n(t){if(t<0)return Number("0/0");for(var e=o[0],r=o.length-1;r>0;--r)e+=o[r]/(t+r);var n=t+i+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}var a=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],i=607/128,o=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];e.exports=function t(e){if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*t(1-e));if(e>100)return Math.exp(n(e));e-=1;for(var r=a[0],i=1;i<9;i++)r+=a[i]/(e+i);var o=e+7+.5;return Math.sqrt(2*Math.PI)*Math.pow(o,e+.5)*Math.exp(-o)*r},e.exports.log=n},{}],72:[function(t,e,r){function n(t,e){if("string"!=typeof t)throw new TypeError("must specify type string");if(e=e||{},"undefined"==typeof document&&!e.canvas)return null;var r=e.canvas||document.createElement("canvas");"number"==typeof e.width&&(r.width=e.width),"number"==typeof e.height&&(r.height=e.height);var n,a=e;try{var i=[t];0===t.indexOf("webgl")&&i.push("experimental-"+t);for(var o=0;or)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,i,a),r}function i(t,e){for(var r=l.malloc(t.length,e),n=t.length,a=0;a=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}function s(t,e,r,a){if(r=r||t.ARRAY_BUFFER,a=a||t.DYNAMIC_DRAW,r!==t.ARRAY_BUFFER&&r!==t.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(a!==t.DYNAMIC_DRAW&&a!==t.STATIC_DRAW&&a!==t.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var i=t.createBuffer(),o=new n(t,r,i,0,a);return o.update(e),o}var l=t("typedarray-pool"),u=t("ndarray-ops"),c=t("ndarray"),f=["uint8","uint8_clamped","uint16","uint32","int8","int16","int32","float32"],h=n.prototype;h.bind=function(){this.gl.bindBuffer(this.type,this.handle)},h.unbind=function(){this.gl.bindBuffer(this.type,null)},h.dispose=function(){this.gl.deleteBuffer(this.handle)},h.update=function(t,e){if("number"!=typeof e&&(e=-1),this.bind(),"object"==typeof t&&void 0!==t.shape){var r=t.dtype;if(f.indexOf(r)<0&&(r="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER){r=gl.getExtension("OES_element_index_uint")&&"uint16"!==r?"uint32":"uint16"}if(r===t.dtype&&o(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=a(this.gl,this.type,this.length,this.usage,t.data,e):this.length=a(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var n=l.malloc(t.size,r),s=c(n,t.shape);u.assign(s,t),this.length=e<0?a(this.gl,this.type,this.length,this.usage,n,e):a(this.gl,this.type,this.length,this.usage,n.subarray(0,t.size),e),l.free(n)}}else if(Array.isArray(t)){var h;h=this.type===this.gl.ELEMENT_ARRAY_BUFFER?i(t,"uint16"):i(t,"float32"),this.length=e<0?a(this.gl,this.type,this.length,this.usage,h,e):a(this.gl,this.type,this.length,this.usage,h.subarray(0,t.length),e),l.free(h)}else if("object"==typeof t&&"number"==typeof t.length)this.length=a(this.gl,this.type,this.length,this.usage,t,e);else{if("number"!=typeof t&&void 0!==t)throw new Error("gl-buffer: Invalid data type");if(e>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");t|=0,t<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=s},{ndarray:163,"ndarray-ops":162,"typedarray-pool":205}],74:[function(t,e,r){e.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},{}],75:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":74}],76:[function(t,e,r){"use strict";function n(t,e,r,n,a,i,o,s){this.plot=t,this.shader=e,this.fillShader=r,this.positionBuffer=n,this.colorBuffer=a,this.idBuffer=i,this.fillPositionBuffer=o,this.fillColorBuffer=s,this.fillVerts=0,this.shape=[0,0],this.bounds=[1/0,1/0,-1/0,-1/0],this.numVertices=0,this.lineWidth=1}function a(t,e){var r=Math.floor(e);if(r<0)return t[0];if(r>=t.length-1)return t[t.length-1];var n=e-r;return(1-n)*t[r]+n*t[r+1]}function i(t,e){var r=t.gl,a=s(r,p.vertex,p.fragment),i=s(r,p.fillVertex,p.fragment),o=l(r),u=l(r),c=l(r),f=l(r),h=l(r),d=new n(t,a,i,o,u,c,f,h);return d.update(e),t.addObject(d),d}e.exports=i;var o=t("iota-array"),s=t("gl-shader"),l=t("gl-buffer"),u=t("ndarray"),c=t("surface-nets"),f=t("cdt2d"),h=t("clean-pslg"),d=t("binary-search-bounds"),p=t("./lib/shaders"),g=n.prototype,m=[1,0,0,0,0,1,1,0,1,1,0,1];g.draw=function(){var t=[1,0,0,0,1,0,0,0,1],e=[0,0];return function(){var r,n,a=this.plot,i=this.shader,o=this.fillShader,s=this.bounds,l=this.numVertices,u=this.fillVerts,c=a.gl,f=a.viewBox,h=a.dataBox,d=s[2]-s[0],p=s[3]-s[1],g=h[2]-h[0],m=h[3]-h[1];if(t[0]=2*d/g,t[4]=2*p/m,t[6]=2*(s[0]-h[0])/g-1,t[7]=2*(s[1]-h[1])/m-1,e[0]=f[2]-f[0],e[1]=f[3]-f[1],u>0&&(o.bind(),r=o.uniforms,r.viewTransform=t,r.screenShape=e,n=i.attributes,this.fillPositionBuffer.bind(),n.position.pointer(),this.fillColorBuffer.bind(),n.color.pointer(c.UNSIGNED_BYTE,!0),c.drawArrays(c.TRIANGLES,0,u)),l>0){i.bind();var v=this.lineWidth*a.pixelRatio;r=i.uniforms,r.viewTransform=t,r.screenShape=e,r.lineWidth=v,r.pointSize=1e3,n=i.attributes,this.positionBuffer.bind(),n.position.pointer(c.FLOAT,!1,16,0),n.tangent.pointer(c.FLOAT,!1,16,8),this.colorBuffer.bind(),n.color.pointer(c.UNSIGNED_BYTE,!0),c.drawArrays(c.TRIANGLES,0,l),r.lineWidth=0,r.pointSize=v,this.positionBuffer.bind(),n.position.pointer(c.FLOAT,!1,48,0),n.tangent.pointer(c.FLOAT,!1,48,8),this.colorBuffer.bind(),n.color.pointer(c.UNSIGNED_BYTE,!0,12,0),c.drawArrays(c.POINTS,0,l/3)}}}(),g.drawPick=function(){return function(t){return t}}(),g.pick=function(t,e,r){return null},g.update=function(t){function e(t,e,r,n){var a=n-r;return Math.abs(a)<1e-6?e:Math.floor(e)+Math.max(.001,Math.min(.999,(t-r)/a))}t=t||{};var r=t.shape||[0,0],n=t.x||o(r[0]),i=t.y||o(r[1]),s=t.z||new Float32Array(r[0]*r[1]),l=t.levels||[],p=t.levelColors||[],g=this.bounds,v=g[0]=n[0],y=g[1]=i[0],b=g[2]=n[n.length-1],x=g[3]=i[i.length-1];v===b&&(g[2]+=1,b+=1),y===x&&(g[3]+=1,x+=1);var _=1/(b-v),w=1/(x-y);this.lineWidth=t.lineWidth||1;for(var A=u(s,r),k=[],M=[],T=[],E=[],L=[[0,0],[r[0]-1,0],[0,r[1]-1],[r[0]-1,r[1]-1]],S=0;S0&&C===l[S-1])){for(var I=c(A,C),O=255*p[4*S]|0,R=255*p[4*S+1]|0,D=255*p[4*S+2]|0,P=255*p[4*S+3]|0,z=I.cells,N=I.positions,F=Array(N.length),B=0;B1)){var V,G=H[0],q=H[1],X=A.get(Math.floor(G),Math.floor(q)),Y=A.get(Math.floor(G),Math.ceil(q)),W=A.get(Math.ceil(G),Math.floor(q)),Z=A.get(Math.ceil(G),Math.ceil(q));0===Math.floor(H[0])&&X<=C!=Y>1;for(e=0;e0&&(T*=_),E<0?E*=w:E>0&&(E*=A),m[b++]=h*(r-p+T),m[b++]=d*(n-g+E),m[b++]=o*M[2]+(l+o)*M[4],m[b++]=o*M[3]+(l+o)*M[5]}}for(e=0;e1&&h.drawBuffersWEBGL(y[f]);var v=r.getExtension("WEBGL_depth_texture");v?d?t.depth=s(r,u,c,v.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):p&&(t.depth=s(r,u,c,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):p&&d?t._depth_rb=l(r,u,c,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):p?t._depth_rb=l(r,u,c,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(t._depth_rb=l(r,u,c,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var b=r.checkFramebufferStatus(r.FRAMEBUFFER);if(b!==r.FRAMEBUFFER_COMPLETE){t._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(t.handle),t.handle=null,t.depth&&(t.depth.dispose(),t.depth=null),t._depth_rb&&(r.deleteRenderbuffer(t._depth_rb),t._depth_rb=null);for(var m=0;ms||r<0||r>s)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var l=n(i),u=0;uo||r<0||r>o)throw new Error("gl-fbo: Parameters are too large for FBO");n=n||{};var s=1;if("color"in n){if((s=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(s>1){if(!a)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(s>t.getParameter(a.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+s+" draw buffers")}}var l=t.UNSIGNED_BYTE,u=t.getExtension("OES_texture_float");if(n.float&&s>0){if(!u)throw new Error("gl-fbo: Context does not support floating point textures");l=t.FLOAT}else n.preferFloat&&s>0&&u&&(l=t.FLOAT);var f=!0;"depth"in n&&(f=!!n.depth);var h=!1;return"stencil"in n&&(h=!!n.stencil),new c(t,e,r,l,s,f,h,a)}var d=t("gl-texture2d");e.exports=h;var p,g,m,v,y=null,b=c.prototype;Object.defineProperties(b,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(t){if(Array.isArray(t)||(t=[0|t,0|t]),2!==t.length)throw new Error("gl-fbo: Shape vector must be length 2");var e=0|t[0],r=0|t[1];return f(this,e,r),[e,r]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(t){return t|=0,f(this,t,this._shape[1]),t},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(t){return t|=0,f(this,this._shape[0],t),t},enumerable:!1}}),b.bind=function(){if(!this._destroyed){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.handle),t.viewport(0,0,this._shape[0],this._shape[1])}},b.dispose=function(){if(!this._destroyed){this._destroyed=!0;var t=this.gl;t.deleteFramebuffer(this.handle),this.handle=null,this.depth&&(this.depth.dispose(),this.depth=null),this._depth_rb&&(t.deleteRenderbuffer(this._depth_rb),this._depth_rb=null);for(var e=0;e>8*d&255;this.pickOffset=r,a.bind();var p=a.uniforms;p.viewTransform=t,p.pickOffset=e,p.shape=this.shape;var g=a.attributes;return this.positionBuffer.bind(),g.position.pointer(),this.weightBuffer.bind(),g.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),g.pickId.pointer(s.UNSIGNED_BYTE,!1),s.drawArrays(s.TRIANGLES,0,o),r+this.shape[0]*this.shape[1]}}}(),f.pick=function(t,e,r){var n=this.pickOffset,a=this.shape[0]*this.shape[1];if(r=n+a)return null;var i=r-n,o=this.xData,s=this.yData;return{object:this,pointId:i,dataCoord:[o[i%this.shape[0]],s[i/this.shape[0]|0]]}},f.update=function(t){t=t||{};var e=t.shape||[0,0],r=t.x||o(e[0]),n=t.y||o(e[1]),a=t.z||new Float32Array(e[0]*e[1]);this.xData=r,this.yData=n;var l=t.colorLevels||[0],u=t.colorValues||[0,0,0,1],c=l.length,f=this.bounds,d=f[0]=r[0],p=f[1]=n[0],g=f[2]=r[r.length-1],m=f[3]=n[n.length-1],v=1/(g-d),y=1/(m-p),b=e[0],x=e[1];this.shape=[b,x];var _=(b-1)*(x-1)*(h.length>>>1);this.numVertices=_;for(var w=s.mallocUint8(4*_),A=s.mallocFloat32(2*_),k=s.mallocUint8(2*_),M=s.mallocUint32(_),T=0,E=0;E2&&!this.usingDashes){var b=this.mitreShader;this.lineBufferLo.bind(),b.attributes.aLo.pointer(l.FLOAT,!1,48,0),this.lineBufferHi.bind(),b.bind();var x=b.uniforms;this.setProjectionUniforms(x,i),x.color=c,x.radius=s*u,b.attributes.aHi.pointer(l.FLOAT,!1,48,0),l.drawArrays(l.POINTS,0,a/3|0)}}}}(),h.drawPick=function(){var t=[0,0,0,0];return function(e){var r=this.vertCount,n=this.numPoints;if(this.pickOffset=e,!r)return e+n;var a=this.setProjectionModel(),i=this.plot,o=this.width,s=i.gl,l=i.pickPixelRatio,u=this.pickShader,c=this.pickBuffer;t[0]=255&e,t[1]=e>>>8&255,t[2]=e>>>16&255,t[3]=e>>>24,u.bind();var f=u.uniforms;this.setProjectionUniforms(f,a),f.width=o*l,f.pickOffset=t;var h=u.attributes;return this.lineBufferHi.bind(),h.aHi.pointer(s.FLOAT,!1,16,0),h.dHi.pointer(s.FLOAT,!1,16,8),this.lineBufferLo.bind(),h.aLo.pointer(s.FLOAT,!1,16,0),c.bind(),h.pick0.pointer(s.UNSIGNED_BYTE,!1,8,0),h.pick1.pointer(s.UNSIGNED_BYTE,!1,8,4),s.drawArrays(s.TRIANGLES,0,r),e+n}}(),h.pick=function(t,e,r){var n=this.pickOffset,a=this.numPoints;if(r=n+a)return null;var i=r-n,o=this.data;return{object:this,pointId:i,dataCoord:[o[2*i],o[2*i+1]]}},h.update=function(t){t=t||{};var e,r,n,i,o,s=this.plot.gl;this.color=(t.color||[0,0,1,1]).slice(),this.width=+(t.width||1),this.fill=(t.fill||[!1,!1,!1,!1]).slice(),this.fillColor=a(t.fillColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]);var f=t.dashes||[1],h=0;for(e=0;e1,this.dashPattern=l(s,u(d,[h,1,4],[1,0,0])),this.dashPattern.minFilter=s.NEAREST,this.dashPattern.magFilter=s.NEAREST,this.dashLength=h,c.free(d);var g=t.positions;this.data=g;var m=this.bounds;m[0]=m[1]=1/0,m[2]=m[3]=-1/0;var v=this.numPoints=g.length>>>1;if(0!==v){for(e=0;e1;){var M=--n;i=g[2*n],o=g[2*n+1];var T=M-1,E=g[2*T],L=g[2*T+1];if(!(isNaN(i)||isNaN(o)||isNaN(E)||isNaN(L))){k+=1,i=(i-m[0])/(m[2]-m[0]),o=(o-m[1])/(m[3]-m[1]),E=(E-m[0])/(m[2]-m[0]),L=(L-m[1])/(m[3]-m[1]);var S=E-i,C=L-o,I=M|1<<24,O=M-1,R=M,D=M-1|1<<24;y[--w]=-C,y[--w]=-S,y[--w]=o,y[--w]=i,_[--A]=I,_[--A]=O,y[--w]=C,y[--w]=S,y[--w]=L,y[--w]=E,_[--A]=R,_[--A]=D,y[--w]=-C,y[--w]=-S,y[--w]=L,y[--w]=E,_[--A]=R,_[--A]=D,y[--w]=C,y[--w]=S,y[--w]=L,y[--w]=E,_[--A]=R,_[--A]=D,y[--w]=-C,y[--w]=-S,y[--w]=o,y[--w]=i,_[--A]=I,_[--A]=O,y[--w]=C,y[--w]=S,y[--w]=o,y[--w]=i,_[--A]=I,_[--A]=O}}for(e=0;es[k]&&(i.uniforms.dataAxis=t,i.uniforms.screenOffset=e,i.uniforms.color=m[n],i.uniforms.angle=v[n],u.drawArrays(u.TRIANGLES,s[k],s[M]-s[k]))),y[n]&&A&&(e[1^n]-=T*d*b[n],i.uniforms.dataAxis=r,i.uniforms.screenOffset=e,i.uniforms.color=x[n],i.uniforms.angle=_[n],u.drawArrays(u.TRIANGLES,w,A)),e[1^n]=T*c[2+(1^n)]-1,p[n+2]&&(e[1^n]+=T*d*g[n+2],ks[k]&&(i.uniforms.dataAxis=t,i.uniforms.screenOffset=e,i.uniforms.color=m[n+2],i.uniforms.angle=v[n+2],u.drawArrays(u.TRIANGLES,s[k],s[M]-s[k]))),y[n+2]&&A&&(e[1^n]+=T*d*b[n+2],i.uniforms.dataAxis=r,i.uniforms.screenOffset=e,i.uniforms.color=x[n+2],i.uniforms.angle=_[n+2],u.drawArrays(u.TRIANGLES,w,A))}}(),c.drawTitle=function(){var t=[0,0],e=[0,0];return function(){var r=this.plot,n=this.shader,a=r.gl,i=r.screenBox,o=r.titleCenter,s=r.titleAngle,l=r.titleColor,u=r.pixelRatio;if(this.titleCount){for(var c=0;c<2;++c)e[c]=2*(o[c]*u-i[c])/(i[2+c]-i[c])-1;n.bind(),n.uniforms.dataAxis=t,n.uniforms.screenOffset=e,n.uniforms.angle=s,n.uniforms.color=l,a.drawArrays(a.TRIANGLES,this.titleOffset,this.titleCount)}}}(),c.bind=function(){var t=[0,0],e=[0,0],r=[0,0];return function(){var n=this.plot,a=this.shader,i=n._tickBounds,o=n.dataBox,s=n.screenBox,l=n.viewBox;a.bind();for(var u=0;u<2;++u){var c=i[u],f=i[u+2],h=f-c,d=.5*(o[u+2]+o[u]),p=o[u+2]-o[u],g=l[u],m=l[u+2],v=m-g,y=s[u],b=s[u+2],x=b-y;e[u]=2*h/p*v/x,t[u]=2*(c-d)/p*v/x}r[1]=2*n.pixelRatio/(s[3]-s[1]),r[0]=r[1]*(s[3]-s[1])/(s[2]-s[0]),a.uniforms.dataScale=e,a.uniforms.dataShift=t,a.uniforms.textScale=r,this.vbo.bind(),a.attributes.textCoordinate.pointer()}}(),c.update=function(t){var e,r,n,a,i,o=[],l=t.ticks,u=t.bounds;for(i=0;i<2;++i){var c=[Math.floor(o.length/3)],f=[-1/0],h=l[i];for(e=0;er)for(t=r;te)for(t=e;t=0){for(var k=0|A.type.charAt(A.type.length-1),M=new Array(k),T=0;T=0;)E+=1;w[b]=E}var L=new Array(r.length);i(),d._relink=i,d.types={uniforms:l(r),attributes:l(n)},d.attributes=s(p,d,x,w),Object.defineProperty(d,"uniforms",o(p,d,r,L))},e.exports=i},{"./lib/GLError":96,"./lib/create-attributes":97,"./lib/create-uniforms":98,"./lib/reflect":99,"./lib/runtime-reflect":100,"./lib/shader-cache":101}],96:[function(t,e,r){function n(t,e,r){this.shortMessage=e||"",this.longMessage=r||"",this.rawError=t||"",this.message="gl-shader: "+(e||t||"")+(r?"\n"+r:""),this.stack=(new Error).stack}n.prototype=new Error,n.prototype.name="GLError",n.prototype.constructor=n,e.exports=n},{}],97:[function(t,e,r){"use strict";function n(t,e,r,n,a,i){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=a,this._constFunc=i}function a(t,e,r,a,i,o,s){for(var l=["gl","v"],u=[],c=0;c=0){var p=h.charCodeAt(h.length-1)-48;if(p<2||p>4)throw new s("","Invalid data type for attribute "+f+": "+h);a(t,e,d[0],n,p,o,f)}else{if(!(h.indexOf("mat")>=0))throw new s("","Unknown data type for attribute "+f+": "+h);var p=h.charCodeAt(h.length-1)-48;if(p<2||p>4)throw new s("","Invalid data type for attribute "+f+": "+h);i(t,e,d,n,p,o,f)}}}return o}e.exports=o;var s=t("./GLError"),l=n.prototype;l.pointer=function(t,e,r,n){var a=this,i=a._gl,o=a._locations[a._index];i.vertexAttribPointer(o,a._dimension,t||i.FLOAT,!!e,r||0,n||0),i.enableVertexAttribArray(o)},l.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(l,"location",{get:function(){return this._locations[this._index]},set:function(t){return t!==this._locations[this._index]&&(this._locations[this._index]=0|t,this._wrapper.program=null),0|t}})},{"./GLError":96}],98:[function(t,e,r){"use strict";function n(t){return new Function("y","return function(){return y}")(t)}function a(t,e){for(var r=new Array(t),n=0;n4)throw new s("","Invalid uniform dimension type for matrix "+name+": "+r);return"gl.uniformMatrix"+a+"fv(locations["+e+"],false,obj"+t+")"}throw new s("","Unknown uniform data type for "+name+": "+r)}var a=r.charCodeAt(r.length-1)-48;if(a<2||a>4)throw new s("","Invalid data type");switch(r.charAt(0)){case"b":case"i":return"gl.uniform"+a+"iv(locations["+e+"],obj"+t+")";case"v":return"gl.uniform"+a+"fv(locations["+e+"],obj"+t+")";default:throw new s("","Unrecognized data type for vector "+name+": "+r)}}}function c(t,e){if("object"!=typeof e)return[[t,e]];var r=[];for(var n in e){var a=e[n],i=t;parseInt(n)+""===n?i+="["+n+"]":i+="."+n,"object"==typeof a?r.push.apply(r,c(i,a)):r.push([i,a])}return r}function f(e){for(var n=["return function updateProperty(obj){"],a=c("",e),o=0;o4)throw new s("","Invalid data type");return"b"===t.charAt(0)?a(r,!1):a(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r=t.charCodeAt(t.length-1)-48;if(r<2||r>4)throw new s("","Invalid uniform dimension type for matrix "+name+": "+t);return a(r*r,0)}throw new s("","Unknown uniform data type for "+name+": "+t)}}function d(t,e,a){if("object"==typeof a){var o=p(a);Object.defineProperty(t,e,{get:n(o),set:f(a),enumerable:!0,configurable:!1})}else i[a]?Object.defineProperty(t,e,{get:l(a),set:f(a),enumerable:!0,configurable:!1}):t[e]=h(r[a].type)}function p(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r1){l[0]in o||(o[l[0]]=[]),o=o[l[0]];for(var u=1;u1)for(var l=0;l=0){var g=e[p]-n[p]*(e[p+2]-e[p])/(n[p+2]-n[p]);0===p?o.drawLine(g,e[1],g,e[3],d[p],h[p]):o.drawLine(e[0],g,e[2],g,d[p],h[p])}}for(var p=0;p=0;--t)this.objects[t].dispose();this.objects.length=0;for(var t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},h.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},h.removeObject=function(t){for(var e=this.objects,r=0;r>>1;for(r=0;r=e[0]&&i<=e[2]&&o>=e[1]&&o<=e[3]&&n++}return n}function i(t,e){var r=t.gl,a=s(r),i=s(r),l=o(r,u.pointVertex,u.pointFragment),c=o(r,u.pickVertex,u.pickFragment),f=new n(t,a,i,l,c);return f.update(e),t.addObject(f),f}var o=t("gl-shader"),s=t("gl-buffer"),l=t("typedarray-pool"),u=t("./lib/shader");e.exports=i;var c=n.prototype;c.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},c.update=function(t){function e(e,r){return e in t?t[e]:r}var r;t=t||{},this.sizeMin=e("sizeMin",.5),this.sizeMax=e("sizeMax",20),this.color=e("color",[1,0,0,1]).slice(),this.areaRatio=e("areaRatio",1),this.borderColor=e("borderColor",[0,0,0,1]).slice(),this.blend=e("blend",!1);var n=t.positions.length>>>1,a=t.positions instanceof Float32Array,i=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,o=t.positions,s=a?o:l.mallocFloat32(o.length),u=i?t.idToIndex:l.mallocInt32(n);if(a||s.set(o),!i)for(s.set(o),r=0;r>8&255,e[2]=r>>16&255,e[3]=r>>24&255,this.pickBuffer.bind(),i.attributes.pickId.pointer(o.UNSIGNED_BYTE),i.uniforms.pickOffset=e,this.pickOffset=r);var h=o.getParameter(o.BLEND),d=o.getParameter(o.DITHER);return h&&!this.blend&&o.disable(o.BLEND),d&&o.disable(o.DITHER),o.drawArrays(o.POINTS,0,this.pointCount),h&&!this.blend&&o.enable(o.BLEND),d&&o.enable(o.DITHER),r+this.pointCount}}(),c.draw=c.unifiedDraw,c.drawPick=c.unifiedDraw,c.pick=function(t,e,r){var n=this.pickOffset,a=this.pointCount;if(r=n+a)return null;var i=r-n,o=this.points;return{object:this,pointId:i,dataCoord:[o[2*i],o[2*i+1]]}}},{"./lib/shader":103,"gl-buffer":73,"gl-shader":104,"typedarray-pool":205}],112:[function(t,e,r){"use strict";e.exports={ -vertex:"precision highp float;\n#define GLSLIFY 1\n\n\nvec4 computePosition_1_0(vec2 posHi, vec2 posLo, vec2 scHi, vec2 scLo, vec2 trHi, vec2 trLo) {\n return vec4((posHi + trHi) * scHi\n \t\t\t//FIXME: this thingy does not give noticeable precision gain, need test\n + (posLo + trLo) * scHi\n + (posHi + trHi) * scLo\n + (posLo + trLo) * scLo\n , 0, 1);\n}\n\n\nattribute vec2 positionHi, positionLo;\nattribute float size, border;\nattribute vec2 char, color;\n\n//this is 64-bit form of scale and translate\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo;\nuniform float pixelRatio;\nuniform vec4 viewBox;\nuniform sampler2D palette;\n\nvarying vec4 charColor, borderColor;\nvarying vec2 charId;\nvarying vec2 pointCoord;\nvarying float pointSize;\nvarying float borderWidth;\n\n\nvoid main() {\n charColor = texture2D(palette, vec2(color.x / 255., 0));\n borderColor = texture2D(palette, vec2(color.y / 255., 0));\n\n gl_PointSize = size * pixelRatio;\n pointSize = size * pixelRatio;\n\n charId = char;\n borderWidth = border;\n\n gl_Position = computePosition_1_0(\n positionHi, positionLo,\n scaleHi, scaleLo,\n translateHi, translateLo);\n\n pointCoord = viewBox.xy + (viewBox.zw - viewBox.xy) * (gl_Position.xy * .5 + .5);\n}\n",fragment:"precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D chars;\nuniform vec2 charsShape;\nuniform float charsStep, pixelRatio, charOffset;\n\nvarying vec4 borderColor;\nvarying vec4 charColor;\nvarying vec2 charId;\nvarying vec2 pointCoord;\nvarying float pointSize;\nvarying float borderWidth;\n\nvoid main() {\n\tvec2 pointUV = (pointCoord - gl_FragCoord.xy + pointSize * .5) / pointSize;\n\tpointUV.x = 1. - pointUV.x;\n\tvec2 texCoord = ((charId + pointUV) * charsStep) / charsShape;\n\tfloat dist = texture2D(chars, texCoord).r;\n\n\t//max-distance alpha\n\tif (dist < 1e-2)\n\t\tdiscard;\n\n\tfloat gamma = .0045 * charsStep / pointSize;\n\n //null-border case\n \tif (borderWidth * borderColor.a == 0.) {\n\t\tfloat charAmt = smoothstep(.748 - gamma, .748 + gamma, dist);\n\t\tgl_FragColor = vec4(charColor.rgb, charAmt*charColor.a);\n\t\treturn;\n\t}\n\n\tfloat dif = 5. * pixelRatio * borderWidth / pointSize;\n\tfloat borderLevel = .748 - dif * .5;\n\tfloat charLevel = .748 + dif * .5;\n\n\tfloat borderAmt = smoothstep(borderLevel - gamma, borderLevel + gamma, dist);\n\tfloat charAmt = smoothstep(charLevel - gamma, charLevel + gamma, dist);\n\n\tvec4 color = borderColor;\n\tcolor.a *= borderAmt;\n\n\tgl_FragColor = mix(color, charColor, charAmt);\n}\n",pickVertex:"precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 positionHi, positionLo;\nattribute vec4 id;\nattribute float size;\n\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo;\nuniform vec4 pickOffset;\nuniform float pixelRatio;\n\nvarying vec4 fragColor;\n\n\nvec4 computePosition_1_0(vec2 posHi, vec2 posLo, vec2 scHi, vec2 scLo, vec2 trHi, vec2 trLo) {\n return vec4((posHi + trHi) * scHi\n \t\t\t//FIXME: this thingy does not give noticeable precision gain, need test\n + (posLo + trLo) * scHi\n + (posHi + trHi) * scLo\n + (posLo + trLo) * scLo\n , 0, 1);\n}\n\n\nvoid main() {\n vec4 fragId = id + pickOffset;\n\n fragId.y += floor(fragId.x / 256.0);\n fragId.x -= floor(fragId.x / 256.0) * 256.0;\n\n fragId.z += floor(fragId.y / 256.0);\n fragId.y -= floor(fragId.y / 256.0) * 256.0;\n\n fragId.w += floor(fragId.z / 256.0);\n fragId.z -= floor(fragId.z / 256.0) * 256.0;\n\n fragColor = fragId / 255.0;\n\n gl_PointSize = size * .25 * pixelRatio;\n\n gl_Position = computePosition_1_0(\n positionHi, positionLo,\n scaleHi, scaleLo,\n translateHi, translateLo);\n}\n",pickFragment:"precision lowp float;\n#define GLSLIFY 1\nvarying vec4 fragColor;\nvoid main() {\n gl_FragColor = fragColor;\n}\n"}},{}],113:[function(t,e,r){arguments[4][47][0].apply(r,arguments)},{dup:47}],114:[function(t,e,r){arguments[4][95][0].apply(r,arguments)},{"./lib/GLError":115,"./lib/create-attributes":116,"./lib/create-uniforms":117,"./lib/reflect":118,"./lib/runtime-reflect":119,"./lib/shader-cache":120,dup:95}],115:[function(t,e,r){arguments[4][96][0].apply(r,arguments)},{dup:96}],116:[function(t,e,r){arguments[4][97][0].apply(r,arguments)},{"./GLError":115,dup:97}],117:[function(t,e,r){arguments[4][98][0].apply(r,arguments)},{"./GLError":115,"./reflect":118,dup:98}],118:[function(t,e,r){arguments[4][99][0].apply(r,arguments)},{dup:99}],119:[function(t,e,r){arguments[4][100][0].apply(r,arguments)},{dup:100}],120:[function(t,e,r){arguments[4][101][0].apply(r,arguments)},{"./GLError":115,dup:101,"gl-format-compiler-error":82,"weakmap-shim":212}],121:[function(t,e,r){"use strict";function n(t,e,r,n,i){i<=4*h?a(0,i-1,t,e,r,n):f(0,i-1,t,e,r,n)}function a(t,e,r,n,a,i){for(var o=t+1;o<=e;++o){for(var s=r[o],l=n[2*o],u=n[2*o+1],c=a[o],f=i[o],h=o;h>t;){var d=r[h-1],p=n[2*(h-1)];if((d-s||l-p)>=0)break;r[h]=d,n[2*h]=p,n[2*h+1]=n[2*h-1],a[h]=a[h-1],i[h]=i[h-1],h-=1}r[h]=s,n[2*h]=l,n[2*h+1]=u,a[h]=c,i[h]=f}}function i(t,e,r,n,a,i){var o=r[t],s=n[2*t],l=n[2*t+1],u=a[t],c=i[t];r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],a[t]=a[e],i[t]=i[e],r[e]=o,n[2*e]=s,n[2*e+1]=l,a[e]=u,i[e]=c}function o(t,e,r,n,a,i){r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],a[t]=a[e],i[t]=i[e]}function s(t,e,r,n,a,i,o){var s=n[t],l=a[2*t],u=a[2*t+1],c=i[t],f=o[t];n[t]=n[e],a[2*t]=a[2*e],a[2*t+1]=a[2*e+1],i[t]=i[e],o[t]=o[e],n[e]=n[r],a[2*e]=a[2*r],a[2*e+1]=a[2*r+1],i[e]=i[r],o[e]=o[r],n[r]=s,a[2*r]=l,a[2*r+1]=u,i[r]=c,o[r]=f}function l(t,e,r,n,a,i,o,s,l,u,c){s[t]=s[e],l[2*t]=l[2*e],l[2*t+1]=l[2*e+1],u[t]=u[e],c[t]=c[e],s[e]=r,l[2*e]=n,l[2*e+1]=a,u[e]=i,c[e]=o}function u(t,e,r,n,a){return(r[t]-r[e]||n[2*e]-n[2*t]||a[t]-a[e])<0}function c(t,e,r,n,a,i,o,s){return(e-i[t]||o[2*t]-r||a-s[t])<0}function f(t,e,r,n,d,p){var g=(e-t+1)/6|0,m=t+g,v=e-g,y=t+e>>1,b=y-g,x=y+g,_=m,w=b,A=y,k=x,M=v,T=t+1,E=e-1,L=0;u(_,w,r,n,d,p)&&(L=_,_=w,w=L),u(k,M,r,n,d,p)&&(L=k,k=M,M=L),u(_,A,r,n,d,p)&&(L=_,_=A,A=L),u(w,A,r,n,d,p)&&(L=w,w=A,A=L),u(_,k,r,n,d,p)&&(L=_,_=k,k=L),u(A,k,r,n,d,p)&&(L=A,A=k,k=L),u(w,M,r,n,d,p)&&(L=w,w=M,M=L),u(w,A,r,n,d,p)&&(L=w,w=A,A=L),u(k,M,r,n,d,p)&&(L=k,k=M,M=L);var S=r[w],C=n[2*w],I=n[2*w+1],O=d[w],R=p[w],D=r[k],P=n[2*k],z=n[2*k+1],N=d[k],F=p[k],B=_,j=A,U=M,H=m,V=y,G=v,q=r[B],X=r[j],Y=r[U];r[H]=q,r[V]=X,r[G]=Y;for(var W=0;W<2;++W){var Z=n[2*B+W],Q=n[2*j+W],$=n[2*U+W];n[2*H+W]=Z,n[2*V+W]=Q,n[2*G+W]=$}var K=d[B],J=d[j],tt=d[U];d[H]=K,d[V]=J,d[G]=tt;var et=p[B],rt=p[j],nt=p[U];p[H]=et,p[V]=rt,p[G]=nt,o(b,t,r,n,d,p),o(x,e,r,n,d,p);for(var at=T;at<=E;++at)if(c(at,S,C,I,O,r,n,d))at!==T&&i(at,T,r,n,d,p),++T;else if(!c(at,D,P,z,N,r,n,d))for(;;){if(c(E,D,P,z,N,r,n,d)){c(E,S,C,I,O,r,n,d)?(s(at,T,E,r,n,d,p),++T,--E):(i(at,E,r,n,d,p),--E);break}if(--E=Math.max(.9*d,32)){var b=u+s>>>1;l(m,v,f,h,b,c+1),h=b}l(m,v,f,h,y,c+1),h=y}}}var u=t.length>>>1;if(u<1)return[];for(var c=1/0,f=1/0,h=-1/0,d=-1/0,p=0;p=0;--_){t[2*_]=(t[2*_]-c)*v,t[2*_+1]=(t[2*_+1]-f)*y;var M=x[_];M!==A&&(w.push(new a(b*Math.pow(.5,M),_+1,k-(_+1))),k=_+1,A=M)}return w.push(new a(b*Math.pow(.5,M+1),0,k)),o.free(x),w}var o=t("typedarray-pool"),s=t("./lib/sort");e.exports=i},{"./lib/sort":121,"typedarray-pool":205}],123:[function(t,e,r){"use strict";function n(t,e,r,n,a,i,o,s){this.plot=t,this.shader=e,this.pickShader=r,this.positionBuffer=n,this.sizeBuffer=a,this.colorBuffer=i,this.idBuffer=o,this.charBuffer=s,this.pointCount=0,this.pickOffset=0,this.points=null,this.scales=[],this.xCoords=[],this.charCanvas=document.createElement("canvas"),this.charTexture=g(this.plot.gl,this.charCanvas),this.charStep=400,this.charFit=.255,this.snapThreshold=1e4,this.paletteTexture=g(this.plot.gl,[256,1])}function a(){var t=this.plot,e=t.viewBox,r=t.dataBox,n=t.pixelRatio,a=r[2]-r[0],i=r[3]-r[1],u=2/a,c=2/i,f=-r[0]-.5*a,h=-r[1]-.5*i;_[0]=u,w[0]=u-_[0],_[1]=c,w[1]=c-_[1],A[0]=f,k[0]=f-A[0],A[1]=h,k[1]=h-A[1];var d=e[2]-e[0],p=e[3]-e[1];o=Math.min(a/d,i/p),M[0]=2*n/d,M[1]=2*n/p,s=r[0],l=r[2]}function i(t,e){var r=t.gl,a=u(r,h.vertex,h.fragment),i=u(r,h.pickVertex,h.pickFragment),o=c(r),s=c(r),l=c(r),f=c(r),d=c(r),p=new n(t,a,i,o,s,l,f,d);return p.update(e),t.addObject(p),p}e.exports=i;var o,s,l,u=t("gl-shader"),c=t("gl-buffer"),f=t("typedarray-pool"),h=t("./lib/shaders"),d=t("snap-points-2d"),p=t("font-atlas-sdf"),g=t("gl-texture2d"),m=t("color-id"),v=t("ndarray"),y=t("clamp"),b=t("binary-search-bounds"),x=n.prototype,_=new Float32Array([0,0]),w=new Float32Array([0,0]),A=new Float32Array([0,0]),k=new Float32Array([0,0]),M=[0,0],T=[0,0,0,0];x.drawPick=function(t){var e=void 0!==t,r=this.plot,n=this.pointCount,i=n>this.snapThreshold;if(!n)return t;a.call(this);var u=r.gl,c=e?this.pickShader:this.shader,f=u.isEnabled(u.BLEND);if(c.bind(),e){this.pickOffset=t;for(var h=0;h<4;++h)T[h]=t>>8*h&255;c.uniforms.pickOffset=T,this.idBuffer.bind(),c.attributes.id.pointer(u.UNSIGNED_BYTE,!1)}else u.blendFuncSeparate(u.SRC_ALPHA,u.ONE_MINUS_SRC_ALPHA,u.ONE,u.ONE_MINUS_SRC_ALPHA),u.blendColor(0,0,0,1),f||u.enable(u.BLEND),this.colorBuffer.bind(),c.attributes.color.pointer(u.UNSIGNED_BYTE,!1),this.charBuffer.bind(),c.attributes.char.pointer(u.UNSIGNED_BYTE,!1),c.uniforms.chars=this.charTexture.bind(0),c.uniforms.charsShape=[this.charCanvas.width,this.charCanvas.height],c.uniforms.charsStep=this.charStep,c.uniforms.palette=this.paletteTexture.bind(1);this.sizeBuffer.bind(),c.attributes.size.pointer(u.FLOAT,!1,8,0),e||c.attributes.border.pointer(u.FLOAT,!1,8,4),this.positionBuffer.bind(),c.attributes.positionHi.pointer(u.FLOAT,!1,16,0),c.attributes.positionLo.pointer(u.FLOAT,!1,16,8),c.uniforms.pixelRatio=r.pixelRatio,c.uniforms.scaleHi=_,c.uniforms.scaleLo=w,c.uniforms.translateHi=A,c.uniforms.translateLo=k,c.uniforms.viewBox=r.viewBox;var d=this.scales;if(i)for(var p=d.length-1;p>=0;p--){var g=d[p];if(!(g.pixelSize&&g.pixelSize<1.25*o&&p>1)){var m=g.offset,v=g.count+m,y=b.ge(this.xCoords,s,m,v-1),x=b.lt(this.xCoords,l,y,v-1)+1;x>y&&u.drawArrays(u.POINTS,y,x-y)}}else u.drawArrays(u.POINTS,0,n);if(e)return t+n;f?u.blendFunc(u.ONE,u.ONE_MINUS_SRC_ALPHA):u.disable(u.BLEND)},x.draw=x.drawPick,x.pick=function(t,e,r){var n=this.pickOffset,a=this.pointCount;if(r=n+a)return null;var i=r-n,o=this.points;return{object:this,pointId:i,dataCoord:[o[2*i],o[2*i+1]]}},x.update=function(t){t=t||{};var e=t.positions||[],r=t.colors||[],n=t.glyphs||[],a=t.sizes||[],i=t.borderWidths||[],o=t.borderColors||[],s=this.plot.gl,l=this.pointCount,u=l>this.snapThreshold;if(null!=t.positions){this.points=e,l=this.points.length/2,u=l>this.snapThreshold;var c=f.mallocFloat32(2*l),h=f.mallocFloat64(2*l),g=f.mallocUint32(l),b=f.mallocFloat32(4*l);h.set(this.points),u&&(this.i2idx&&f.free(this.i2idx),this.i2idx=f.mallocInt32(l),this.scales=d(h,this.i2idx,c)),this.pointCount=l;for(var x=0;xN&&(N=a[x]);var F=this.charStep;this.charStep=y(Math.ceil(4*N),128,768);var B=Object.keys(P),j=this.charStep,U=Math.floor(j/2),H=s.getParameter(s.MAX_TEXTURE_SIZE),V=H/j*(H/j),G=Math.min(H,j*B.length),q=Math.min(H,j*Math.ceil(j*B.length/H)),X=Math.floor(G/j);B.length>V&&console.warn("gl-scatter2d-fancy: number of characters is more than maximum texture size. Try reducing it."),this.chars&&this.chars+""==B+""&&this.charStep==F||(this.charCanvas=p({canvas:this.charCanvas,family:"sans-serif",size:U,shape:[G,q],step:[j,j],chars:B,align:!0,fit:this.charFit}),this.chars=B);for(var x=0;x>>1,n=u.mallocInt32(r),a=u.mallocFloat32(r),i=u.mallocFloat64(2*r);if(i.set(this.points),this.snapPoints)this.scales=l(i,n,a,this.bounds);else{this.bounds=h(i,2),f(i,2,this.bounds);for(var o=0;o>8&255,y[2]=t>>16&255,y[3]=t>>24&255,n.uniforms.pickOffset=y,s.bind(),n.attributes.pickId.pointer(f.UNSIGNED_BYTE)):(n.uniforms.useWeight=1,this.weightBuffer.bind(),n.attributes.weight.pointer());var I=!0;if(this.snapPoints)for(var O=a.length-1;O>=0;O--){var R=a[O];if(!(R.pixelSize1)){var D=this.getVisibleRange(R),P=D[0],z=D[1];z>P&&f.drawArrays(f.POINTS,P,z-P),!e&&I&&(I=!1,n.uniforms.useWeight=0)}}else f.drawArrays(f.POINTS,0,this.pointCount);return t+this.pointCount},d.getVisibleRange=function(t){var e=this.plot.dataBox,r=this.bounds,n=this.pixelSize,a=this.size,i=this.plot.pixelRatio,o=r[2]-r[0];r[3],r[1];if(!t)for(var t,l=this.scales.length-1;l>=0&&(t=this.scales[l],t.pixelSize1);l--);var u=this.xCoords,c=(e[0]-r[0]-n*a*i)/o,f=(e[2]-r[0]+n*a*i)/o,h=t.offset,d=t.count+h,p=s.ge(u,c,h,d-1);return[p,s.lt(u,f,p,d-1)+1]},d.drawPick=d.draw,d.pick=function(t,e,r){var n=r-this.pickOffset;return n<0||n>=this.pointCount?null:{object:this,pointId:n,dataCoord:[this.points[2*n],this.points[2*n+1]]}}},{"./lib/shader":124,"array-bounds":11,"array-normalize":12,"binary-search-bounds":125,"gl-buffer":73,"gl-shader":132,"snap-points-2d":127,"typedarray-pool":205}],129:[function(t,e,r){"use strict";r.boxVertex="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 vertex;\n\nuniform vec2 cornerA, cornerB;\n\nvoid main() {\n gl_Position = vec4(mix(cornerA, cornerB, vertex), 0, 1);\n}\n",r.boxFragment="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 color;\n\nvoid main() {\n gl_FragColor = color;\n}\n"},{}],130:[function(t,e,r){"use strict";function n(t,e,r){this.plot=t,this.boxBuffer=e,this.boxShader=r,this.enabled=!0,this.selectBox=[1/0,1/0,-1/0,-1/0],this.borderColor=[0,0,0,1],this.innerFill=!1,this.innerColor=[0,0,0,.25],this.outerFill=!0,this.outerColor=[0,0,0,.5],this.borderWidth=10}function a(t,e){var r=t.gl,a=o(r,[0,0,0,1,1,0,1,1]),l=i(r,s.boxVertex,s.boxFragment),u=new n(t,a,l);return u.update(e),t.addOverlay(u),u}var i=t("gl-shader"),o=t("gl-buffer"),s=t("./lib/shaders");e.exports=a;var l=n.prototype;l.draw=function(){if(this.enabled){var t=this.plot,e=this.selectBox,r=this.borderWidth,n=(this.innerFill,this.innerColor),a=(this.outerFill,this.outerColor),i=this.borderColor,o=t.box,s=t.screenBox,l=t.dataBox,u=t.viewBox,c=t.pixelRatio,f=(e[0]-l[0])*(u[2]-u[0])/(l[2]-l[0])+u[0],h=(e[1]-l[1])*(u[3]-u[1])/(l[3]-l[1])+u[1],d=(e[2]-l[0])*(u[2]-u[0])/(l[2]-l[0])+u[0],p=(e[3]-l[1])*(u[3]-u[1])/(l[3]-l[1])+u[1];if(f=Math.max(f,u[0]),h=Math.max(h,u[1]),d=Math.min(d,u[2]),p=Math.min(p,u[3]),!(d0){var v=r*c;o.drawBox(f-v,h-v,d+v,h+v,i),o.drawBox(f-v,p-v,d+v,p+v,i),o.drawBox(f-v,h-v,f+v,p+v,i),o.drawBox(d-v,h-v,d+v,p+v,i)}}}},l.update=function(t){t=t||{},this.innerFill=!!t.innerFill,this.outerFill=!!t.outerFill,this.innerColor=(t.innerColor||[0,0,0,.5]).slice(),this.outerColor=(t.outerColor||[0,0,0,.5]).slice(),this.borderColor=(t.borderColor||[0,0,0,1]).slice(),this.borderWidth=t.borderWidth||0,this.selectBox=(t.selectBox||this.selectBox).slice()},l.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{"./lib/shaders":129,"gl-buffer":73,"gl-shader":132}],131:[function(t,e,r){"use strict";function n(t,e,r,n,a){this.coord=[t,e],this.id=r,this.value=n,this.distance=a}function a(t,e,r){this.gl=t,this.fbo=e,this.buffer=r,this._readTimeout=null;var n=this;this._readCallback=function(){n.gl&&(e.bind(),t.readPixels(0,0,e.shape[0],e.shape[1],t.RGBA,t.UNSIGNED_BYTE,n.buffer),n._readTimeout=null)}}function i(t,e){return new a(t,o(t,e),s.mallocUint8(e[0]*e[1]*4))}e.exports=i;var o=t("gl-fbo"),s=t("typedarray-pool"),l=t("ndarray"),u=t("bit-twiddle").nextPow2,c=t("cwise/lib/wrapper")({args:["array",{offset:[0,0,1],array:0},{offset:[0,0,2],array:0},{offset:[0,0,3],array:0},"scalar","scalar","index"],pre:{body:"{this_closestD2=1e8,this_closestX=-1,this_closestY=-1}",args:[],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:[]},body:{body:"{if(_inline_55_arg0_<255||_inline_55_arg1_<255||_inline_55_arg2_<255||_inline_55_arg3_<255){var _inline_55_l=_inline_55_arg4_-_inline_55_arg6_[0],_inline_55_a=_inline_55_arg5_-_inline_55_arg6_[1],_inline_55_f=_inline_55_l*_inline_55_l+_inline_55_a*_inline_55_a;_inline_55_fthis.buffer.length){s.free(this.buffer);for(var n=this.buffer=s.mallocUint8(u(r*e*4)),a=0;a=0){for(var k=0|A.type.charAt(A.type.length-1),M=new Array(k),T=0;T=0;)E+=1;_[w]=E}var L=new Array(r.length);i(),d._relink=i,d.types={uniforms:l(r),attributes:l(n)},d.attributes=s(p,d,b,_),Object.defineProperty(d,"uniforms",o(p,d,r,L))},e.exports=i},{"./lib/GLError":133,"./lib/create-attributes":134,"./lib/create-uniforms":135,"./lib/reflect":136,"./lib/runtime-reflect":137,"./lib/shader-cache":138}],133:[function(t,e,r){arguments[4][96][0].apply(r,arguments)},{dup:96}],134:[function(t,e,r){arguments[4][97][0].apply(r,arguments)},{"./GLError":133,dup:97}],135:[function(t,e,r){arguments[4][98][0].apply(r,arguments)},{"./GLError":133,"./reflect":136,dup:98}],136:[function(t,e,r){arguments[4][99][0].apply(r,arguments)},{dup:99}],137:[function(t,e,r){arguments[4][100][0].apply(r,arguments)},{dup:100}],138:[function(t,e,r){arguments[4][101][0].apply(r,arguments)},{"./GLError":133,dup:101,"gl-format-compiler-error":82,"weakmap-shim":212}],139:[function(t,e,r){"use strict";function n(t){this.plot=t,this.enable=[!0,!0,!1,!1],this.width=[1,1,1,1],this.color=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.center=[1/0,1/0]}function a(t,e){var r=new n(t);return r.update(e),t.addOverlay(r),r}e.exports=a;var i=n.prototype;i.update=function(t){t=t||{},this.enable=(t.enable||[!0,!0,!1,!1]).slice(),this.width=(t.width||[1,1,1,1]).slice(),this.color=(t.color||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]).map(function(t){return t.slice()}),this.center=(t.center||[1/0,1/0]).slice(),this.plot.setOverlayDirty()},i.draw=function(){var t=this.enable,e=this.width,r=this.color,n=this.center,a=this.plot,i=a.line,o=a.dataBox,s=a.viewBox;if(i.bind(),o[0]<=n[0]&&n[0]<=o[2]&&o[1]<=n[1]&&n[1]<=o[3]){var l=s[0]+(n[0]-o[0])/(o[2]-o[0])*(s[2]-s[0]),u=s[1]+(n[1]-o[1])/(o[3]-o[1])*(s[3]-s[1]);t[0]&&i.drawLine(l,u,s[0],u,e[0],r[0]),t[1]&&i.drawLine(l,u,l,s[1],e[1],r[1]),t[2]&&i.drawLine(l,u,s[2],u,e[2],r[2]),t[3]&&i.drawLine(l,u,l,s[3],e[3],r[3])}},i.dispose=function(){this.plot.removeOverlay(this)}},{}],140:[function(t,e,r){"use strict";function n(t){v=[t.LINEAR,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_NEAREST],y=[t.NEAREST,t.LINEAR,t.NEAREST_MIPMAP_NEAREST,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_LINEAR],b=[t.REPEAT,t.CLAMP_TO_EDGE,t.MIRRORED_REPEAT]}function a(t){return"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement||"undefined"!=typeof ImageData&&t instanceof ImageData}function i(t,e,r){var n=t.gl,a=n.getParameter(n.MAX_TEXTURE_SIZE);if(e<0||e>a||r<0||r>a)throw new Error("gl-texture2d: Invalid texture size");return t._shape=[e,r],t.bind(),n.texImage2D(n.TEXTURE_2D,0,t.format,e,r,0,t.format,t.type,null),t._mipLevels=[0],t}function o(t,e,r,n,a,i){this.gl=t,this.handle=e,this.format=a,this.type=i,this._shape=[r,n],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(t){return o.wrapS=t}},{get:function(){ +vertex:"precision highp float;\n#define GLSLIFY 1\n\n\nvec4 computePosition_1_0(vec2 posHi, vec2 posLo, vec2 scHi, vec2 scLo, vec2 trHi, vec2 trLo) {\n return vec4((posHi + trHi) * scHi\n \t\t\t//FIXME: this thingy does not give noticeable precision gain, need test\n + (posLo + trLo) * scHi\n + (posHi + trHi) * scLo\n + (posLo + trLo) * scLo\n , 0, 1);\n}\n\n\nattribute vec2 positionHi, positionLo;\nattribute float size, border;\nattribute vec2 char, color;\n\n//this is 64-bit form of scale and translate\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo;\nuniform float pixelRatio;\nuniform vec4 viewBox;\nuniform sampler2D palette;\n\nvarying vec4 charColor, borderColor;\nvarying vec2 charId;\nvarying vec2 pointCoord;\nvarying float pointSize;\nvarying float borderWidth;\n\n\nvoid main() {\n charColor = texture2D(palette, vec2(color.x / 255., 0));\n borderColor = texture2D(palette, vec2(color.y / 255., 0));\n\n gl_PointSize = size * pixelRatio;\n pointSize = size * pixelRatio;\n\n charId = char;\n borderWidth = border;\n\n gl_Position = computePosition_1_0(\n positionHi, positionLo,\n scaleHi, scaleLo,\n translateHi, translateLo);\n\n pointCoord = viewBox.xy + (viewBox.zw - viewBox.xy) * (gl_Position.xy * .5 + .5);\n}\n",fragment:"precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D chars;\nuniform vec2 charsShape;\nuniform float charsStep, pixelRatio, charOffset;\n\nvarying vec4 borderColor;\nvarying vec4 charColor;\nvarying vec2 charId;\nvarying vec2 pointCoord;\nvarying float pointSize;\nvarying float borderWidth;\n\nvoid main() {\n\tvec2 pointUV = (pointCoord - gl_FragCoord.xy + pointSize * .5) / pointSize;\n\tpointUV.x = 1. - pointUV.x;\n\tvec2 texCoord = ((charId + pointUV) * charsStep) / charsShape;\n\tfloat dist = texture2D(chars, texCoord).r;\n\n\t//max-distance alpha\n\tif (dist < 1e-2)\n\t\tdiscard;\n\n\tfloat gamma = .0045 * charsStep / pointSize;\n\n //null-border case\n \tif (borderWidth * borderColor.a == 0.) {\n\t\tfloat charAmt = smoothstep(.748 - gamma, .748 + gamma, dist);\n\t\tgl_FragColor = vec4(charColor.rgb, charAmt*charColor.a);\n\t\treturn;\n\t}\n\n\tfloat dif = 5. * pixelRatio * borderWidth / pointSize;\n\tfloat borderLevel = .748 - dif * .5;\n\tfloat charLevel = .748 + dif * .5;\n\n\tfloat borderAmt = smoothstep(borderLevel - gamma, borderLevel + gamma, dist);\n\tfloat charAmt = smoothstep(charLevel - gamma, charLevel + gamma, dist);\n\n\tvec4 color = borderColor;\n\tcolor.a *= borderAmt;\n\n\tgl_FragColor = mix(color, charColor, charAmt);\n}\n",pickVertex:"precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 positionHi, positionLo;\nattribute vec4 id;\nattribute float size;\n\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo;\nuniform vec4 pickOffset;\nuniform float pixelRatio;\n\nvarying vec4 fragColor;\n\n\nvec4 computePosition_1_0(vec2 posHi, vec2 posLo, vec2 scHi, vec2 scLo, vec2 trHi, vec2 trLo) {\n return vec4((posHi + trHi) * scHi\n \t\t\t//FIXME: this thingy does not give noticeable precision gain, need test\n + (posLo + trLo) * scHi\n + (posHi + trHi) * scLo\n + (posLo + trLo) * scLo\n , 0, 1);\n}\n\n\nvoid main() {\n vec4 fragId = id + pickOffset;\n\n fragId.y += floor(fragId.x / 256.0);\n fragId.x -= floor(fragId.x / 256.0) * 256.0;\n\n fragId.z += floor(fragId.y / 256.0);\n fragId.y -= floor(fragId.y / 256.0) * 256.0;\n\n fragId.w += floor(fragId.z / 256.0);\n fragId.z -= floor(fragId.z / 256.0) * 256.0;\n\n fragColor = fragId / 255.0;\n\n gl_PointSize = size * .25 * pixelRatio;\n\n gl_Position = computePosition_1_0(\n positionHi, positionLo,\n scaleHi, scaleLo,\n translateHi, translateLo);\n}\n",pickFragment:"precision lowp float;\n#define GLSLIFY 1\nvarying vec4 fragColor;\nvoid main() {\n gl_FragColor = fragColor;\n}\n"}},{}],113:[function(t,e,r){arguments[4][47][0].apply(r,arguments)},{dup:47}],114:[function(t,e,r){arguments[4][95][0].apply(r,arguments)},{"./lib/GLError":115,"./lib/create-attributes":116,"./lib/create-uniforms":117,"./lib/reflect":118,"./lib/runtime-reflect":119,"./lib/shader-cache":120,dup:95}],115:[function(t,e,r){arguments[4][96][0].apply(r,arguments)},{dup:96}],116:[function(t,e,r){arguments[4][97][0].apply(r,arguments)},{"./GLError":115,dup:97}],117:[function(t,e,r){arguments[4][98][0].apply(r,arguments)},{"./GLError":115,"./reflect":118,dup:98}],118:[function(t,e,r){arguments[4][99][0].apply(r,arguments)},{dup:99}],119:[function(t,e,r){arguments[4][100][0].apply(r,arguments)},{dup:100}],120:[function(t,e,r){arguments[4][101][0].apply(r,arguments)},{"./GLError":115,dup:101,"gl-format-compiler-error":82,"weakmap-shim":212}],121:[function(t,e,r){"use strict";function n(t,e,r,n,i){i<=4*h?a(0,i-1,t,e,r,n):f(0,i-1,t,e,r,n)}function a(t,e,r,n,a,i){for(var o=t+1;o<=e;++o){for(var s=r[o],l=n[2*o],u=n[2*o+1],c=a[o],f=i[o],h=o;h>t;){var d=r[h-1],p=n[2*(h-1)];if((d-s||l-p)>=0)break;r[h]=d,n[2*h]=p,n[2*h+1]=n[2*h-1],a[h]=a[h-1],i[h]=i[h-1],h-=1}r[h]=s,n[2*h]=l,n[2*h+1]=u,a[h]=c,i[h]=f}}function i(t,e,r,n,a,i){var o=r[t],s=n[2*t],l=n[2*t+1],u=a[t],c=i[t];r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],a[t]=a[e],i[t]=i[e],r[e]=o,n[2*e]=s,n[2*e+1]=l,a[e]=u,i[e]=c}function o(t,e,r,n,a,i){r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],a[t]=a[e],i[t]=i[e]}function s(t,e,r,n,a,i,o){var s=n[t],l=a[2*t],u=a[2*t+1],c=i[t],f=o[t];n[t]=n[e],a[2*t]=a[2*e],a[2*t+1]=a[2*e+1],i[t]=i[e],o[t]=o[e],n[e]=n[r],a[2*e]=a[2*r],a[2*e+1]=a[2*r+1],i[e]=i[r],o[e]=o[r],n[r]=s,a[2*r]=l,a[2*r+1]=u,i[r]=c,o[r]=f}function l(t,e,r,n,a,i,o,s,l,u,c){s[t]=s[e],l[2*t]=l[2*e],l[2*t+1]=l[2*e+1],u[t]=u[e],c[t]=c[e],s[e]=r,l[2*e]=n,l[2*e+1]=a,u[e]=i,c[e]=o}function u(t,e,r,n,a){return(r[t]-r[e]||n[2*e]-n[2*t]||a[t]-a[e])<0}function c(t,e,r,n,a,i,o,s){return(e-i[t]||o[2*t]-r||a-s[t])<0}function f(t,e,r,n,d,p){var g=(e-t+1)/6|0,m=t+g,v=e-g,y=t+e>>1,b=y-g,x=y+g,_=m,w=b,A=y,k=x,M=v,T=t+1,E=e-1,L=0;u(_,w,r,n,d,p)&&(L=_,_=w,w=L),u(k,M,r,n,d,p)&&(L=k,k=M,M=L),u(_,A,r,n,d,p)&&(L=_,_=A,A=L),u(w,A,r,n,d,p)&&(L=w,w=A,A=L),u(_,k,r,n,d,p)&&(L=_,_=k,k=L),u(A,k,r,n,d,p)&&(L=A,A=k,k=L),u(w,M,r,n,d,p)&&(L=w,w=M,M=L),u(w,A,r,n,d,p)&&(L=w,w=A,A=L),u(k,M,r,n,d,p)&&(L=k,k=M,M=L);var S=r[w],C=n[2*w],I=n[2*w+1],O=d[w],R=p[w],D=r[k],P=n[2*k],z=n[2*k+1],N=d[k],F=p[k],B=_,j=A,U=M,H=m,V=y,G=v,q=r[B],X=r[j],Y=r[U];r[H]=q,r[V]=X,r[G]=Y;for(var W=0;W<2;++W){var Z=n[2*B+W],Q=n[2*j+W],$=n[2*U+W];n[2*H+W]=Z,n[2*V+W]=Q,n[2*G+W]=$}var K=d[B],J=d[j],tt=d[U];d[H]=K,d[V]=J,d[G]=tt;var et=p[B],rt=p[j],nt=p[U];p[H]=et,p[V]=rt,p[G]=nt,o(b,t,r,n,d,p),o(x,e,r,n,d,p);for(var at=T;at<=E;++at)if(c(at,S,C,I,O,r,n,d))at!==T&&i(at,T,r,n,d,p),++T;else if(!c(at,D,P,z,N,r,n,d))for(;;){if(c(E,D,P,z,N,r,n,d)){c(E,S,C,I,O,r,n,d)?(s(at,T,E,r,n,d,p),++T,--E):(i(at,E,r,n,d,p),--E);break}if(--E=Math.max(.9*d,32)){var b=u+s>>>1;l(m,v,f,h,b,c+1),h=b}l(m,v,f,h,y,c+1),h=y}}}var u=t.length>>>1;if(u<1)return[];for(var c=1/0,f=1/0,h=-1/0,d=-1/0,p=0;p=0;--_){t[2*_]=(t[2*_]-c)*v,t[2*_+1]=(t[2*_+1]-f)*y;var M=x[_];M!==A&&(w.push(new a(b*Math.pow(.5,M),_+1,k-(_+1))),k=_+1,A=M)}return w.push(new a(b*Math.pow(.5,M+1),0,k)),o.free(x),w}var o=t("typedarray-pool"),s=t("./lib/sort");e.exports=i},{"./lib/sort":121,"typedarray-pool":205}],123:[function(t,e,r){"use strict";function n(t,e,r,n,a,i,o,s){this.plot=t,this.shader=e,this.pickShader=r,this.positionBuffer=n,this.sizeBuffer=a,this.colorBuffer=i,this.idBuffer=o,this.charBuffer=s,this.pointCount=0,this.pickOffset=0,this.points=null,this.scales=[],this.xCoords=[],this.charCanvas=document.createElement("canvas"),this.charTexture=g(this.plot.gl,this.charCanvas),this.charStep=400,this.charFit=.255,this.snapThreshold=1e4,this.paletteTexture=g(this.plot.gl,[256,1])}function a(){var t=this.plot,e=t.viewBox,r=t.dataBox,n=t.pixelRatio,a=r[2]-r[0],i=r[3]-r[1],u=2/a,c=2/i,f=-r[0]-.5*a,h=-r[1]-.5*i;_[0]=u,w[0]=u-_[0],_[1]=c,w[1]=c-_[1],A[0]=f,k[0]=f-A[0],A[1]=h,k[1]=h-A[1];var d=e[2]-e[0],p=e[3]-e[1];o=Math.min(a/d,i/p),M[0]=2*n/d,M[1]=2*n/p,s=r[0],l=r[2]}function i(t,e){var r=t.gl,a=u(r,h.vertex,h.fragment),i=u(r,h.pickVertex,h.pickFragment),o=c(r),s=c(r),l=c(r),f=c(r),d=c(r),p=new n(t,a,i,o,s,l,f,d);return p.update(e),t.addObject(p),p}e.exports=i;var o,s,l,u=t("gl-shader"),c=t("gl-buffer"),f=t("typedarray-pool"),h=t("./lib/shaders"),d=t("snap-points-2d"),p=t("font-atlas-sdf"),g=t("gl-texture2d"),m=t("color-id"),v=t("ndarray"),y=t("clamp"),b=t("binary-search-bounds"),x=n.prototype,_=new Float32Array([0,0]),w=new Float32Array([0,0]),A=new Float32Array([0,0]),k=new Float32Array([0,0]),M=[0,0],T=[0,0,0,0];x.drawPick=function(t){var e=void 0!==t,r=this.plot,n=this.pointCount,i=n>this.snapThreshold;if(!n)return t;a.call(this);var u=r.gl,c=e?this.pickShader:this.shader,f=u.isEnabled(u.BLEND);if(c.bind(),e){this.pickOffset=t;for(var h=0;h<4;++h)T[h]=t>>8*h&255;c.uniforms.pickOffset=T,this.idBuffer.bind(),c.attributes.id.pointer(u.UNSIGNED_BYTE,!1)}else u.blendFuncSeparate(u.SRC_ALPHA,u.ONE_MINUS_SRC_ALPHA,u.ONE,u.ONE_MINUS_SRC_ALPHA),u.blendColor(0,0,0,1),f||u.enable(u.BLEND),this.colorBuffer.bind(),c.attributes.color.pointer(u.UNSIGNED_BYTE,!1),this.charBuffer.bind(),c.attributes.char.pointer(u.UNSIGNED_BYTE,!1),c.uniforms.chars=this.charTexture.bind(0),c.uniforms.charsShape=[this.charCanvas.width,this.charCanvas.height],c.uniforms.charsStep=this.charStep,c.uniforms.palette=this.paletteTexture.bind(1);this.sizeBuffer.bind(),c.attributes.size.pointer(u.FLOAT,!1,8,0),e||c.attributes.border.pointer(u.FLOAT,!1,8,4),this.positionBuffer.bind(),c.attributes.positionHi.pointer(u.FLOAT,!1,16,0),c.attributes.positionLo.pointer(u.FLOAT,!1,16,8),c.uniforms.pixelRatio=r.pixelRatio,c.uniforms.scaleHi=_,c.uniforms.scaleLo=w,c.uniforms.translateHi=A,c.uniforms.translateLo=k,c.uniforms.viewBox=r.viewBox;var d=this.scales;if(i)for(var p=d.length-1;p>=0;p--){var g=d[p];if(!(g.pixelSize&&g.pixelSize<1.25*o&&p>1)){var m=g.offset,v=g.count+m,y=b.ge(this.xCoords,s,m,v-1),x=b.lt(this.xCoords,l,y,v-1)+1;x>y&&u.drawArrays(u.POINTS,y,x-y)}}else u.drawArrays(u.POINTS,0,n);if(e)return t+n;f?u.blendFunc(u.ONE,u.ONE_MINUS_SRC_ALPHA):u.disable(u.BLEND)},x.draw=x.drawPick,x.pick=function(t,e,r){var n=this.pickOffset,a=this.pointCount;if(r=n+a)return null;var i=r-n,o=this.points;return{object:this,pointId:i,dataCoord:[o[2*i],o[2*i+1]]}},x.update=function(t){t=t||{};var e=t.positions||[],r=t.colors||[],n=t.glyphs||[],a=t.sizes||[],i=t.borderWidths||[],o=t.borderColors||[],s=this.plot.gl,l=this.pointCount,u=l>this.snapThreshold;if(null!=t.positions){this.points=e,l=this.points.length/2,u=l>this.snapThreshold;var c=f.mallocFloat32(2*l),h=f.mallocFloat64(2*l),g=f.mallocUint32(l),b=f.mallocFloat32(4*l);h.set(this.points),u&&(this.i2idx&&f.free(this.i2idx),this.i2idx=f.mallocInt32(l),this.scales=d(h,this.i2idx,c)),this.pointCount=l;for(var x=0;xN&&(N=a[x]);var F=this.charStep;this.charStep=y(Math.ceil(4*N),128,768);var B=Object.keys(P),j=this.charStep,U=Math.floor(j/2),H=s.getParameter(s.MAX_TEXTURE_SIZE),V=H/j*(H/j),G=Math.min(H,j*B.length),q=Math.min(H,j*Math.ceil(j*B.length/H)),X=Math.floor(G/j);B.length>V&&console.warn("gl-scatter2d-fancy: number of characters is more than maximum texture size. Try reducing it."),this.chars&&this.chars+""==B+""&&this.charStep==F||(this.charCanvas=p({canvas:this.charCanvas,family:"sans-serif",size:U,shape:[G,q],step:[j,j],chars:B,align:!0,fit:this.charFit}),this.chars=B);for(var x=0;x>>1,n=u.mallocInt32(r),a=u.mallocFloat32(r),i=u.mallocFloat64(2*r);if(i.set(this.points),this.snapPoints)this.scales=l(i,n,a,this.bounds);else{this.bounds=h(i,2),f(i,2,this.bounds);for(var o=0;o>8&255,y[2]=t>>16&255,y[3]=t>>24&255,n.uniforms.pickOffset=y,s.bind(),n.attributes.pickId.pointer(f.UNSIGNED_BYTE)):(n.uniforms.useWeight=1,this.weightBuffer.bind(),n.attributes.weight.pointer());var I=!0;if(this.snapPoints)for(var O=a.length-1;O>=0;O--){var R=a[O];if(!(R.pixelSize1)){var D=this.getVisibleRange(R),P=D[0],z=D[1];z>P&&f.drawArrays(f.POINTS,P,z-P),!e&&I&&(I=!1,n.uniforms.useWeight=0)}}else f.drawArrays(f.POINTS,0,this.pointCount);return t+this.pointCount},d.getVisibleRange=function(t){var e=this.plot.dataBox,r=this.bounds,n=this.pixelSize,a=this.size,i=this.plot.pixelRatio,o=r[2]-r[0];r[3],r[1];if(!t)for(var t,l=this.scales.length-1;l>=0&&(t=this.scales[l],t.pixelSize1);l--);var u=this.xCoords,c=(e[0]-r[0]-n*a*i)/o,f=(e[2]-r[0]+n*a*i)/o,h=t.offset,d=t.count+h,p=s.ge(u,c,h,d-1);return[p,s.lt(u,f,p,d-1)+1]},d.drawPick=d.draw,d.pick=function(t,e,r){var n=r-this.pickOffset;return n<0||n>=this.pointCount?null:{object:this,pointId:n,dataCoord:[this.points[2*n],this.points[2*n+1]]}}},{"./lib/shader":124,"array-bounds":11,"array-normalize":12,"binary-search-bounds":125,"gl-buffer":73,"gl-shader":132,"snap-points-2d":127,"typedarray-pool":205}],129:[function(t,e,r){"use strict";r.boxVertex="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 vertex;\n\nuniform vec2 cornerA, cornerB;\n\nvoid main() {\n gl_Position = vec4(mix(cornerA, cornerB, vertex), 0, 1);\n}\n",r.boxFragment="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 color;\n\nvoid main() {\n gl_FragColor = color;\n}\n"},{}],130:[function(t,e,r){"use strict";function n(t,e,r){this.plot=t,this.boxBuffer=e,this.boxShader=r,this.enabled=!0,this.selectBox=[1/0,1/0,-1/0,-1/0],this.borderColor=[0,0,0,1],this.innerFill=!1,this.innerColor=[0,0,0,.25],this.outerFill=!0,this.outerColor=[0,0,0,.5],this.borderWidth=10}function a(t,e){var r=t.gl,a=o(r,[0,0,0,1,1,0,1,1]),l=i(r,s.boxVertex,s.boxFragment),u=new n(t,a,l);return u.update(e),t.addOverlay(u),u}var i=t("gl-shader"),o=t("gl-buffer"),s=t("./lib/shaders");e.exports=a;var l=n.prototype;l.draw=function(){if(this.enabled){var t=this.plot,e=this.selectBox,r=this.borderWidth,n=(this.innerFill,this.innerColor),a=(this.outerFill,this.outerColor),i=this.borderColor,o=t.box,s=t.screenBox,l=t.dataBox,u=t.viewBox,c=t.pixelRatio,f=(e[0]-l[0])*(u[2]-u[0])/(l[2]-l[0])+u[0],h=(e[1]-l[1])*(u[3]-u[1])/(l[3]-l[1])+u[1],d=(e[2]-l[0])*(u[2]-u[0])/(l[2]-l[0])+u[0],p=(e[3]-l[1])*(u[3]-u[1])/(l[3]-l[1])+u[1];if(f=Math.max(f,u[0]),h=Math.max(h,u[1]),d=Math.min(d,u[2]),p=Math.min(p,u[3]),!(d0){var v=r*c;o.drawBox(f-v,h-v,d+v,h+v,i),o.drawBox(f-v,p-v,d+v,p+v,i),o.drawBox(f-v,h-v,f+v,p+v,i),o.drawBox(d-v,h-v,d+v,p+v,i)}}}},l.update=function(t){t=t||{},this.innerFill=!!t.innerFill,this.outerFill=!!t.outerFill,this.innerColor=(t.innerColor||[0,0,0,.5]).slice(),this.outerColor=(t.outerColor||[0,0,0,.5]).slice(),this.borderColor=(t.borderColor||[0,0,0,1]).slice(),this.borderWidth=t.borderWidth||0,this.selectBox=(t.selectBox||this.selectBox).slice()},l.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{"./lib/shaders":129,"gl-buffer":73,"gl-shader":132}],131:[function(t,e,r){"use strict";function n(t,e,r,n,a){this.coord=[t,e],this.id=r,this.value=n,this.distance=a}function a(t,e,r){this.gl=t,this.fbo=e,this.buffer=r,this._readTimeout=null;var n=this;this._readCallback=function(){n.gl&&(e.bind(),t.readPixels(0,0,e.shape[0],e.shape[1],t.RGBA,t.UNSIGNED_BYTE,n.buffer),n._readTimeout=null)}}function i(t,e){return new a(t,o(t,e),s.mallocUint8(e[0]*e[1]*4))}e.exports=i;var o=t("gl-fbo"),s=t("typedarray-pool"),l=t("ndarray"),u=t("bit-twiddle").nextPow2,c=t("cwise/lib/wrapper")({args:["array",{offset:[0,0,1],array:0},{offset:[0,0,2],array:0},{offset:[0,0,3],array:0},"scalar","scalar","index"],pre:{body:"{this_closestD2=1e8,this_closestX=-1,this_closestY=-1}",args:[],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:[]},body:{body:"{if(_inline_52_arg0_<255||_inline_52_arg1_<255||_inline_52_arg2_<255||_inline_52_arg3_<255){var _inline_52_l=_inline_52_arg4_-_inline_52_arg6_[0],_inline_52_a=_inline_52_arg5_-_inline_52_arg6_[1],_inline_52_f=_inline_52_l*_inline_52_l+_inline_52_a*_inline_52_a;_inline_52_fthis.buffer.length){s.free(this.buffer);for(var n=this.buffer=s.mallocUint8(u(r*e*4)),a=0;a=0){for(var k=0|A.type.charAt(A.type.length-1),M=new Array(k),T=0;T=0;)E+=1;_[w]=E}var L=new Array(r.length);i(),d._relink=i,d.types={uniforms:l(r),attributes:l(n)},d.attributes=s(p,d,b,_),Object.defineProperty(d,"uniforms",o(p,d,r,L))},e.exports=i},{"./lib/GLError":133,"./lib/create-attributes":134,"./lib/create-uniforms":135,"./lib/reflect":136,"./lib/runtime-reflect":137,"./lib/shader-cache":138}],133:[function(t,e,r){arguments[4][96][0].apply(r,arguments)},{dup:96}],134:[function(t,e,r){arguments[4][97][0].apply(r,arguments)},{"./GLError":133,dup:97}],135:[function(t,e,r){arguments[4][98][0].apply(r,arguments)},{"./GLError":133,"./reflect":136,dup:98}],136:[function(t,e,r){arguments[4][99][0].apply(r,arguments)},{dup:99}],137:[function(t,e,r){arguments[4][100][0].apply(r,arguments)},{dup:100}],138:[function(t,e,r){arguments[4][101][0].apply(r,arguments)},{"./GLError":133,dup:101,"gl-format-compiler-error":82,"weakmap-shim":212}],139:[function(t,e,r){"use strict";function n(t){this.plot=t,this.enable=[!0,!0,!1,!1],this.width=[1,1,1,1],this.color=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.center=[1/0,1/0]}function a(t,e){var r=new n(t);return r.update(e),t.addOverlay(r),r}e.exports=a;var i=n.prototype;i.update=function(t){t=t||{},this.enable=(t.enable||[!0,!0,!1,!1]).slice(),this.width=(t.width||[1,1,1,1]).slice(),this.color=(t.color||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]).map(function(t){return t.slice()}),this.center=(t.center||[1/0,1/0]).slice(),this.plot.setOverlayDirty()},i.draw=function(){var t=this.enable,e=this.width,r=this.color,n=this.center,a=this.plot,i=a.line,o=a.dataBox,s=a.viewBox;if(i.bind(),o[0]<=n[0]&&n[0]<=o[2]&&o[1]<=n[1]&&n[1]<=o[3]){var l=s[0]+(n[0]-o[0])/(o[2]-o[0])*(s[2]-s[0]),u=s[1]+(n[1]-o[1])/(o[3]-o[1])*(s[3]-s[1]);t[0]&&i.drawLine(l,u,s[0],u,e[0],r[0]),t[1]&&i.drawLine(l,u,l,s[1],e[1],r[1]),t[2]&&i.drawLine(l,u,s[2],u,e[2],r[2]),t[3]&&i.drawLine(l,u,l,s[3],e[3],r[3])}},i.dispose=function(){this.plot.removeOverlay(this)}},{}],140:[function(t,e,r){"use strict";function n(t){v=[t.LINEAR,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_NEAREST],y=[t.NEAREST,t.LINEAR,t.NEAREST_MIPMAP_NEAREST,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_LINEAR],b=[t.REPEAT,t.CLAMP_TO_EDGE,t.MIRRORED_REPEAT]}function a(t){return"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement||"undefined"!=typeof ImageData&&t instanceof ImageData}function i(t,e,r){var n=t.gl,a=n.getParameter(n.MAX_TEXTURE_SIZE);if(e<0||e>a||r<0||r>a)throw new Error("gl-texture2d: Invalid texture size");return t._shape=[e,r],t.bind(),n.texImage2D(n.TEXTURE_2D,0,t.format,e,r,0,t.format,t.type,null),t._mipLevels=[0],t}function o(t,e,r,n,a,i){this.gl=t,this.handle=e,this.format=a,this.type=i,this._shape=[r,n],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(t){return o.wrapS=t}},{get:function(){ return o._wrapT},set:function(t){return o.wrapT=t}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(t){return o.width=t}},{get:function(){return o._shape[1]},set:function(t){return o.height=t}}]),this._shapeVector=l}function s(t,e){return 3===t.length?1===e[2]&&e[1]===t[0]*t[2]&&e[0]===t[2]:1===e[0]&&e[1]===t[0]}function l(t,e,r,n,a,i,o,l){var u=l.dtype,c=l.shape.slice();if(c.length<2||c.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var f=0,h=0,d=s(c,l.stride.slice());"float32"===u?f=t.FLOAT:"float64"===u?(f=t.FLOAT,d=!1,u="float32"):"uint8"===u?f=t.UNSIGNED_BYTE:(f=t.UNSIGNED_BYTE,d=!1,u="uint8");if(2===c.length)h=t.LUMINANCE,c=[c[0],c[1],1],l=p(l.data,c,[l.stride[0],l.stride[1],1],l.offset);else{if(3!==c.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===c[2])h=t.ALPHA;else if(2===c[2])h=t.LUMINANCE_ALPHA;else if(3===c[2])h=t.RGB;else{if(4!==c[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");h=t.RGBA}c[2]}if(h!==t.LUMINANCE&&h!==t.ALPHA||a!==t.LUMINANCE&&a!==t.ALPHA||(h=a),h!==a)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var v=l.size,y=o.indexOf(n)<0;if(y&&o.push(n),f===i&&d)0===l.offset&&l.data.length===v?y?t.texImage2D(t.TEXTURE_2D,n,a,c[0],c[1],0,a,i,l.data):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],a,i,l.data):y?t.texImage2D(t.TEXTURE_2D,n,a,c[0],c[1],0,a,i,l.data.subarray(l.offset,l.offset+v)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],a,i,l.data.subarray(l.offset,l.offset+v));else{var b;b=i===t.FLOAT?m.mallocFloat32(v):m.mallocUint8(v);var _=p(b,c,[c[2],c[2]*c[0],1]);f===t.FLOAT&&i===t.UNSIGNED_BYTE?x(_,l):g.assign(_,l),y?t.texImage2D(t.TEXTURE_2D,n,a,c[0],c[1],0,a,i,b.subarray(0,v)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],a,i,b.subarray(0,v)),i===t.FLOAT?m.freeFloat32(b):m.freeUint8(b)}}function u(t){var e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e}function c(t,e,r,n,a){var i=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>i||r<0||r>i)throw new Error("gl-texture2d: Invalid texture shape");if(a===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var s=u(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,a,null),new o(t,s,e,r,n,a)}function f(t,e,r,n,a,i){var s=u(t);return t.texImage2D(t.TEXTURE_2D,0,a,a,i,e),new o(t,s,r,n,a,i)}function h(t,e){var r=e.dtype,n=e.shape.slice(),a=t.getParameter(t.MAX_TEXTURE_SIZE);if(n[0]<0||n[0]>a||n[1]<0||n[1]>a)throw new Error("gl-texture2d: Invalid texture size");var i=s(n,e.stride.slice()),l=0;"float32"===r?l=t.FLOAT:"float64"===r?(l=t.FLOAT,i=!1,r="float32"):"uint8"===r?l=t.UNSIGNED_BYTE:(l=t.UNSIGNED_BYTE,i=!1,r="uint8");var c=0;if(2===n.length)c=t.LUMINANCE,n=[n[0],n[1],1],e=p(e.data,n,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==n.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===n[2])c=t.ALPHA;else if(2===n[2])c=t.LUMINANCE_ALPHA;else if(3===n[2])c=t.RGB;else{if(4!==n[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");c=t.RGBA}}l!==t.FLOAT||t.getExtension("OES_texture_float")||(l=t.UNSIGNED_BYTE,i=!1);var f,h,d=e.size;if(i)f=0===e.offset&&e.data.length===d?e.data:e.data.subarray(e.offset,e.offset+d);else{var v=[n[2],n[2]*n[0],1];h=m.malloc(d,r);var y=p(h,n,v,0);"float32"!==r&&"float64"!==r||l!==t.UNSIGNED_BYTE?g.assign(y,e):x(y,e),f=h.subarray(0,d)}var b=u(t);return t.texImage2D(t.TEXTURE_2D,0,c,n[0],n[1],0,c,l,f),i||m.free(h),new o(t,b,n[0],n[1],c,l)}function d(t){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(v||n(t),"number"==typeof arguments[1])return c(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return c(t,0|arguments[1][0],0|arguments[1][1],arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if("object"==typeof arguments[1]){var e=arguments[1],r=a(e)?e:e.raw;if(r)return f(t,r,0|e.width,0|e.height,arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return h(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}var p=t("ndarray"),g=t("ndarray-ops"),m=t("typedarray-pool");e.exports=d;var v=null,y=null,b=null,x=function(t,e){g.muls(t,e,255)},_=o.prototype;Object.defineProperties(_,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&v.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),y.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),this._minFilter=t}},magFilter:{get:function(){return this._magFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&v.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),y.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var e=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),e!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),b.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,t),this._wrapS=t}},wrapT:{get:function(){return this._wrapT},set:function(t){if(this.bind(),b.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,t),this._wrapT=t}},wrap:{get:function(){return this._wrapVector},set:function(t){if(Array.isArray(t)||(t=[t,t]),2!==t.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var e=0;e<2;++e)if(b.indexOf(t[e])<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);this._wrapS=t[0],this._wrapT=t[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),t}},shape:{get:function(){return this._shapeVector},set:function(t){if(Array.isArray(t)){if(2!==t.length)throw new Error("gl-texture2d: Invalid texture shape")}else t=[0|t,0|t];return i(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return t|=0,i(this,t,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,i(this,this._shape[0],t),t}}}),_.bind=function(t){var e=this.gl;return void 0!==t&&e.activeTexture(e.TEXTURE0+(0|t)),e.bindTexture(e.TEXTURE_2D,this.handle),void 0!==t?0|t:e.getParameter(e.ACTIVE_TEXTURE)-e.TEXTURE0},_.dispose=function(){this.gl.deleteTexture(this.handle)},_.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var t=Math.min(this._shape[0],this._shape[1]),e=0;t>0;++e,t>>>=1)this._mipLevels.indexOf(e)<0&&this._mipLevels.push(e)},_.setPixels=function(t,e,r,n){var i=this.gl;this.bind(),Array.isArray(e)?(n=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),n=n||0;var o=a(t)?t:t.raw;if(o){this._mipLevels.indexOf(n)<0?(i.texImage2D(i.TEXTURE_2D,0,this.format,this.format,this.type,o),this._mipLevels.push(n)):i.texSubImage2D(i.TEXTURE_2D,n,e,r,this.format,this.type,o)}else{if(!(t.shape&&t.stride&&t.data))throw new Error("gl-texture2d: Unsupported data type");if(t.shape.length<2||e+t.shape[1]>this._shape[1]>>>n||r+t.shape[0]>this._shape[0]>>>n||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");l(i,e,r,n,this.format,this.type,this._mipLevels,t)}}},{ndarray:163,"ndarray-ops":162,"typedarray-pool":205}],141:[function(t,e,r){function n(t){for(var e=Array.isArray(t)?t:a(t),r=0;r0)continue;n=t.slice(0,1).join("")}return e(n),q+=n.length,U=U.slice(n.length),U.length}}function I(){return/[^a-fA-F0-9]/.test(P)?(e(U.join("")),j=u,F):(U.push(P),z=P,F+1)}function O(){return"."===P?(U.push(P),j=m,z=P,F+1):/[eE]/.test(P)?(U.push(P),j=m,z=P,F+1):"x"===P&&1===U.length&&"0"===U[0]?(j=w,U.push(P),z=P,F+1):/[^\d]/.test(P)?(e(U.join("")),j=u,F):(U.push(P),z=P,F+1)}function R(){return"f"===P&&(U.push(P),z=P,F+=1),/[eE]/.test(P)?(U.push(P),z=P,F+1):"-"===P&&/[eE]/.test(z)?(U.push(P),z=P,F+1):/[^\d]/.test(P)?(e(U.join("")),j=u,F):(U.push(P),z=P,F+1)}function D(){if(/[^\d\w_]/.test(P)){var t=U.join("");return j=Q.indexOf(t)>-1?b:Z.indexOf(t)>-1?y:v,e(U.join("")),j=u,F}return U.push(P),z=P,F+1}var P,z,N,F=0,B=0,j=u,U=[],H=[],V=1,G=0,q=0,X=!1,Y=!1,W="";t=t||{};var Z=o,Q=a;return"300 es"===t.version&&(Z=l,Q=s),function(t){return H=[],null!==t?r(t.replace?t.replace(/\r\n/g,"\n"):t):n()}}e.exports=n;var a=t("./lib/literals"),i=t("./lib/operators"),o=t("./lib/builtins"),s=t("./lib/literals-300es"),l=t("./lib/builtins-300es"),u=999,c=9999,f=0,h=1,d=2,p=3,g=4,m=5,v=6,y=7,b=8,x=9,_=10,w=11,A=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":144,"./lib/builtins-300es":143,"./lib/literals":146,"./lib/literals-300es":145,"./lib/operators":147}],143:[function(t,e,r){var n=t("./builtins");n=n.slice().filter(function(t){return!/^(gl\_|texture)/.test(t)}),e.exports=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},{"./builtins":144}],144:[function(t,e,r){e.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},{}],145:[function(t,e,r){var n=t("./literals");e.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},{"./literals":146}],146:[function(t,e,r){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},{}],147:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],148:[function(t,e,r){function n(t,e){var r=a(e),n=[];return n=n.concat(r(t)),n=n.concat(r(null))}var a=t("./index");e.exports=n},{"./index":142}],149:[function(t,e,r){(function(r){"use strict";var n,a=t("is-browser");n="function"==typeof r.matchMedia?!r.matchMedia("(hover: none)").matches:a,e.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"is-browser":154}],150:[function(t,e,r){r.read=function(t,e,r,n,a){var i,o,s=8*a-n-1,l=(1<>1,c=-7,f=r?a-1:0,h=r?-1:1,d=t[e+f];for(f+=h,i=d&(1<<-c)-1,d>>=-c,c+=s;c>0;i=256*i+t[e+f],f+=h,c-=8);for(o=i&(1<<-c)-1,i>>=-c,c+=n;c>0;o=256*o+t[e+f],f+=h,c-=8);if(0===i)i=1-u;else{if(i===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),i-=u}return(d?-1:1)*o*Math.pow(2,i-n)},r.write=function(t,e,r,n,a,i){var o,s,l,u=8*i-a-1,c=(1<>1,h=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,p=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),e+=o+f>=1?h/l:h*Math.pow(2,1-f),e*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(e*l-1)*Math.pow(2,a),o+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,a),o=0));a>=8;t[r+d]=255&s,d+=p,s/=256,a-=8);for(o=o<0;t[r+d]=255&o,d+=p,o/=256,u-=8);t[r+d-p]|=128*g}},{}],151:[function(t,e,r){"use strict";function n(t,e,r,n,a){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=a,this.count=(e?e.count:0)+(r?r.count:0)+n.length}function a(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function i(t,e){var r=p(e);t.mid=r.mid,t.left=r.left,t.right=r.right,t.leftPoints=r.leftPoints,t.rightPoints=r.rightPoints,t.count=r.count}function o(t,e){var r=t.intervals([]);r.push(e),i(t,r)}function s(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?y:(r.splice(n,1),i(t,r),b)}function l(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var a=r(t[n]);if(a)return a}}function c(t,e){for(var r=0;r>1],i=[],o=[],s=[],r=0;r3*(e+1)?o(this,t):this.left.insert(t):this.left=p([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?o(this,t):this.right.insert(t):this.right=p([t]);else{var r=v.ge(this.leftPoints,t,h),n=v.ge(this.rightPoints,t,d);this.leftPoints.splice(r,0,t),this.rightPoints.splice(n,0,t)}},x.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1))return s(this,t);var r=this.left.remove(t);return 2===r?(this.left=null,this.count-=1,b):(r===b&&(this.count-=1),r)}if(t[0]>this.mid){if(!this.right)return y;if(4*(this.left?this.left.count:0)>3*(e-1))return s(this,t);var r=this.right.remove(t);return 2===r?(this.right=null,this.count-=1,b):(r===b&&(this.count-=1),r)}if(1===this.count)return this.leftPoints[0]===t?2:y;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var n=this,i=this.left;i.right;)n=i,i=i.right;if(n===this)i.right=this.right;else{var o=this.left,r=this.right;n.count-=i.count,n.right=i.left,i.left=o,i.right=r}a(this,i),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?a(this,this.left):a(this,this.right);return b}for(var o=v.ge(this.leftPoints,t,h);othis.mid){if(this.right){var r=this.right.queryPoint(t,e);if(r)return r}return u(this.rightPoints,t,e)}return c(this.leftPoints,e)},x.queryInterval=function(t,e,r){if(tthis.mid&&this.right){var n=this.right.queryInterval(t,e,r);if(n)return n}return ethis.mid?u(this.rightPoints,t,r):c(this.leftPoints,r)};var _=g.prototype;_.insert=function(t){this.root?this.root.insert(t):this.root=new n(t[0],null,null,[t],[t])},_.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),e!==y}return!1},_.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},_.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(_,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(_,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":30}],152:[function(t,e,r){"use strict";function n(t,e){e=e||new Array(t.length);for(var r=0;r0)return 1<=0)return 1<=0;--e)S(e,0);for(var r=[],e=0;e0;_=_-1&g)x.push(w+"["+T+"+"+m(_)+"]");x.push(v(0));for(var _=0;_0){",h(x[t]),"=1;"),D(t-1,e|1<0&&q.push(s(U,x[H-1])+"*"+o(x[H-1])),B.push(d(U,x[H])+"=("+q.join("-")+")|0")}for(var U=0;U=0;--U)X.push(o(x[U]));B.push(M+"=("+X.join("*")+")|0",A+"=mallocUint32("+M+")",w+"=mallocUint32("+M+")",T+"=0"),B.push(p(0)+"=0");for(var H=1;H<1< 0"),"function"!=typeof t.vertex&&e("Must specify vertex creation function"), "function"!=typeof t.cell&&e("Must specify cell creation function"),"function"!=typeof t.phase&&e("Must specify phase function");for(var i=t.getters||[],o=new Array(n),s=0;s=0?o[s]=!0:o[s]=!1;return b(t.vertex,t.cell,t.phase,a,r,o)}var _=t("typedarray-pool");e.exports=x;var w="V",A="P",k="N",M="Q",T="X",E="T"},{"typedarray-pool":205}],162:[function(t,e,r){"use strict";function n(t){if(!t)return s;for(var e=0;e>",rrshift:">>>"};!function(){for(var t in l){var e=l[t];r[t]=i({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"eq"]=i({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),r[t+"s"]=i({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"seq"]=i({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var u={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in u){var e=u[t];r[t]=i({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),r[t+"eq"]=i({args:["array"],body:{args:["a"],body:"a="+e+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var c={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in c){var e=c[t];r[t]=i({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"s"]=i({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"eq"]=i({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=i({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var f=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;tthis_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=o({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=o({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=o({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=i({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=i({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=i({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=o({args:["array","array"],pre:s,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{"cwise-compiler":58}],163:[function(t,e,r){function n(t,e){return t[0]-e[0]}function a(){var t,e=this.stride,r=new Array(e.length);for(t=0;tMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&i.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):i.push("ORDER})")),i.push("proto.set=function "+r+"_set("+u.join(",")+",v){"),n?i.push("return this.data.set("+c+",v)}"):i.push("return this.data["+c+"]=v}"),i.push("proto.get=function "+r+"_get("+u.join(",")+"){"),n?i.push("return this.data.get("+c+")}"):i.push("return this.data["+c+"]}"),i.push("proto.index=function "+r+"_index(",u.join(),"){return "+c+"}"),i.push("proto.hi=function "+r+"_hi("+u.join(",")+"){return new "+r+"(this.data,"+s.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+s.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var p=s.map(function(t){return"a"+t+"=this.shape["+t+"]"}),g=s.map(function(t){return"c"+t+"=this.stride["+t+"]"});i.push("proto.lo=function "+r+"_lo("+u.join(",")+"){var b=this.offset,d=0,"+p.join(",")+","+g.join(","));for(var m=0;m=0){d=i"+m+"|0;b+=c"+m+"*d;a"+m+"-=d}");i.push("return new "+r+"(this.data,"+s.map(function(t){return"a"+t}).join(",")+","+s.map(function(t){return"c"+t}).join(",")+",b)}"),i.push("proto.step=function "+r+"_step("+u.join(",")+"){var "+s.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+s.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(var m=0;m=0){c=(c+this.stride["+m+"]*i"+m+")|0}else{a.push(this.shape["+m+"]);b.push(this.stride["+m+"])}");i.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),i.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+s.map(function(t){return"shape["+t+"]"}).join(",")+","+s.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}");var o=new Function("CTOR_LIST","ORDER",i.join("\n"));return o(f[t],a)}function o(t){if(u(t))return"buffer";if(c)switch(Object.prototype.toString.call(t)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped"}return Array.isArray(t)?"array":"generic"}function s(t,e,r,n){if(void 0===t){var a=f.array[0];return a([])}"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var s=e.length;if(void 0===r){r=new Array(s);for(var l=s-1,u=1;l>=0;--l)r[l]=u,u*=e[l]}if(void 0===n){n=0;for(var l=0;lt==t>0?n===o?(r+=1,n=0):n+=1:0===n?(n=o,r-=1):n-=1,a.pack(n,r)}var a=t("double-bits"),i=Math.pow(2,-1074),o=-1>>>0;e.exports=n},{"double-bits":63}],165:[function(t,e,r){"use strict";function n(t,e){var r,n,o;return"string"==typeof t?(r=a(t,e),n=r.width,o=r.height):t instanceof HTMLCanvasElement?(n=t.width,o=t.height,t=t.getContext("2d"),r=t.getImageData(0,0,n,o)):t instanceof ImageData&&(n=t.width,o=t.height,r=t),i(r)}function a(t,e){e||(e={});var r=e.family||"sans-serif",n=l.width,a=l.height,i=e.width||e.height||e.size;i&&i!=n&&(n=a=l.width=l.height=i);var o=e.fontSize||n/2;return u.fillStyle="#000",u.fillRect(0,0,n,a),u.font=o+"px "+r,u.textBaseline="middle",u.textAlign="center",u.fillStyle="white",u.fillText(t,n/2,a/2),u.getImageData(0,0,n,a)}function i(t){var e,r,n,a,i,l,u,c,f,h,d,p,g,m=t.data,v=t.width,y=t.height,b=Array(y),x=Array(y),_=0,w=0,A=v,k=0,M=0,T=Array(y);for(r=0;rk&&(k=d[1]),T[r]=d}for(l=0,c=0,u=0,r=0;rM&&(M=g);return{center:[f,h],bounds:[A,_,k,w+1],radius:Math.sqrt(M)}}function o(t,e){var r=0,n=t.length,a=0;for(e||(e=4);!t[a]&&ar;)a-=e;return n=a,[r/e,n/e]}function s(t,e){return t*t+e*e}e.exports=n;var l=document.createElement("canvas"),u=l.getContext("2d");l.width=200,l.height=200,n.canvas=l},{}],166:[function(t,e,r){"use strict";var n=t("repeat-string");e.exports=function(t,e,r){return r=void 0!==r?r+"":" ",n(r,e)+t}},{"repeat-string":180}],167:[function(t,e,r){e.exports=function(t,e){e||(e=[0,""]),t=String(t);var r=parseFloat(t,10);return e[0]=r,e[1]=t.match(/[\d.\-\+]*\s*(.*)/)[1]||"",e}},{}],168:[function(t,e,r){"use strict";function n(t){var e=t.length;if(e0;--a)n=l[a],r=s[a],s[a]=s[n],s[n]=r,l[a]=l[r],l[r]=n,u=(u+r)*a;return i.freeUint32(l),i.freeUint32(s),u}function a(t,e,r){switch(t){case 0:return r||[];case 1:return r?(r[0]=0,r):[0];case 2:return r?(e?(r[0]=0,r[1]=1):(r[0]=1,r[1]=0),r):e?[0,1]:[1,0]}r=r||new Array(t);var n,a,i,o=1;for(r[0]=0,i=1;i0;--i)n=e/o|0,e=e-n*o|0,o=o/i|0,a=0|r[i],r[i]=0|r[n],r[n]=0|a;return r}var i=t("typedarray-pool"),o=t("invert-permutation");r.rank=n,r.unrank=a},{"invert-permutation":152,"typedarray-pool":205}],170:[function(t,e,r){"use strict";function n(t,e){function r(t,e){var r=s[e][t[e]];r.splice(r.indexOf(t),1)}function n(t,n,i){for(var o,l,u,c=0;c<2;++c)if(s[c][n].length>0){o=s[c][n][0],u=c;break}l=o[1^u];for(var f=0;f<2;++f)for(var h=s[f][n],d=0;d0&&(o=p,l=g,u=f)}return i?l:(o&&r(o,u),l)}for(var i=0|e.length,o=t.length,s=[new Array(i),new Array(i)],l=0;l0;){var d=(s[0][l].length,function(t,i){var o=s[i][t][0],l=[t];r(o,i);for(var u=o[1^i];;){for(;u!==t;)l.push(u),u=n(l[l.length-2],u,!1);if(s[0][t].length+s[1][t].length===0)break;var c=l[l.length-1],f=t,h=l[1],d=n(c,f,!0);if(a(e[c],e[f],e[h],e[d])<0)break;l.push(t),u=n(c,f)}return l}(l,f));!function(t,e){return e[1]===e[e.length-1]}(h,d)?(h.length>0&&c.push(h),h=d):h.push.apply(h,d)}h.length>0&&c.push(h)}return c}e.exports=n;var a=t("compare-angle")},{"compare-angle":57}],171:[function(t,e,r){"use strict";function n(t,e){for(var r=a(t,e.length),n=new Array(e.length),i=new Array(e.length),o=[],s=0;s0;){var u=o.pop();n[u]=!1;for(var c=r[u],s=0;s0}function i(t){for(var e=t.length,r=0;r0;){var U=B.pop(),H=O[U];f(H,function(t,e){return t-e});var V,G=H.length,q=j[U];if(0===q){var T=v[U];V=[T]}for(var m=0;m=0)&&(j[X]=1^q,B.push(X),0===q)){var T=v[X];i(T)||(T.reverse(),V.push(T))}}0===q&&d.push(V)}return d}e.exports=i;var o=t("edges-to-adjacency-list"),s=t("planar-dual"),l=t("point-in-big-polygon"),u=t("two-product"),c=t("robust-sum"),f=t("uniq"),h=t("./lib/trim-leaves")},{"./lib/trim-leaves":171,"edges-to-adjacency-list":65,"planar-dual":170,"point-in-big-polygon":173,"robust-sum":187,"two-product":203,uniq:207}],173:[function(t,e,r){function n(){return!0}function a(t){return function(e,r){var a=t[e];return!!a&&!!a.queryPoint(r,n)}}function i(t){for(var e={},r=0;r0&&e[n]===r[0]))return 1;a=t[n-1]}for(var i=1;a;){var o=a.key,s=f(r,o[0],o[1]);if(o[0][0]0))return 0;i=-1,a=a.right}else if(s>0)a=a.left;else{if(!(s<0))return 0;i=1,a=a.right}}return i}}function s(t){return 1}function l(t){return function(e){return t(e[0],e[1])?0:1}}function u(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}function c(t){for(var e=t.length,r=[],n=[],a=0;a1)for(var r=1;r=0&&(0|t)===t||e("invalid parameter type, ("+t+")"+n(r)+". must be a nonnegative integer")}function l(t,r,a){r.indexOf(t)<0&&e("invalid value"+n(a)+". must be one of: "+r)}function u(t){Object.keys(t).forEach(function(t){te.indexOf(t)<0&&e('invalid regl constructor argument "'+t+'". must be one of '+te)})}function c(t,e){for(t+="";t.length0&&e.push(new d("unknown",0,t))}}),e}function y(t,e){e.forEach(function(e){var r=t[e.file];if(r){var n=r.index[e.line];if(n)return n.errors.push(e),void(r.hasErrors=!0)}t.unknown.hasErrors=!0,t.unknown.lines[0].errors.push(e)})}function b(t,e,n,a,i){if(!t.getShaderParameter(e,t.COMPILE_STATUS)){var o=t.getShaderInfoLog(e),s=a===t.FRAGMENT_SHADER?"fragment":"vertex";T(n,"string",s+" shader source must be a string",i);var l=m(n,i),u=v(o);y(l,u),Object.keys(l).forEach(function(t){function e(t,e){n.push(t),a.push(e||"")}var r=l[t];if(r.hasErrors){var n=[""],a=[""];e("file number "+t+": "+r.name+"\n","color:red;text-decoration:underline;font-weight:bold"),r.lines.forEach(function(t){if(t.errors.length>0){e(c(t.number,4)+"| ","background-color:yellow; font-weight:bold"),e(t.line+"\n","color:red; background-color:yellow; font-weight:bold");var r=0;t.errors.forEach(function(n){var a=n.message,i=/^\s*\'(.*)\'\s*\:\s*(.*)$/.exec(a);if(i){var o=i[1];switch(a=i[2],o){case"assign":o="="}r=Math.max(t.line.indexOf(o,r),0)}else r=0;e(c("| ",6)),e(c("^^^",r+3)+"\n","font-weight:bold"),e(c("| ",6)),e(a+"\n","font-weight:bold")}),e(c("| ",6)+"\n")}else e(c(t.number,4)+"| "),e(t.line+"\n","color:red")}),"undefined"!=typeof document?(a[0]=n.join("%c"),console.log.apply(console,a)):console.log(n.join(""))}}),r.raise("Error compiling "+s+" shader, "+l[0].name)}}function x(t,e,n,a,i){if(!t.getProgramParameter(e,t.LINK_STATUS)){var o=t.getProgramInfoLog(e),s=m(n,i),l=m(a,i),u='Error linking program with vertex shader, "'+l[0].name+'", and fragment shader "'+s[0].name+'"';"undefined"!=typeof document?console.log("%c"+u+"\n%c"+o,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(u+"\n"+o),r.raise(u)}}function _(t){t._commandRef=p()}function w(t,e,r,n){function a(t){return t?n.id(t):0}function i(t,e){Object.keys(e).forEach(function(e){t[n.id(e)]=!0})}_(t),t._fragId=a(t.static.frag),t._vertId=a(t.static.vert);var o=t._uniformSet={};i(o,e.static),i(o,e.dynamic);var s=t._attributeSet={};i(s,r.static),i(s,r.dynamic),t._hasCount="count"in t.static||"count"in t.dynamic||"elements"in t.static||"elements"in t.dynamic}function A(t,r){var n=g();e(t+" in command "+(r||p())+("unknown"===n?"":" called from "+n))}function k(t,e,r){t||A(e,r||p())}function M(t,e,r,a){t in e||A("unknown parameter ("+t+")"+n(r)+". possible values: "+Object.keys(e).join(),a||p())}function T(t,e,r,a){typeof t!==e&&A("invalid parameter type"+n(r)+". expected "+e+", got "+typeof t,a||p())}function E(t){t()}function L(t,e,r){t.texture?l(t.texture._texture.internalformat,e,"unsupported texture format for attachment"):l(t.renderbuffer._renderbuffer.format,r,"unsupported renderbuffer format for attachment")}function S(t,e){return t===ue||t===le||t===ce?2:t===fe?4:he[t]*e}function C(t){return!(t&t-1||!t)}function I(t,e,n){var a,i=e.width,o=e.height,s=e.channels;r(i>0&&i<=n.maxTextureSize&&o>0&&o<=n.maxTextureSize,"invalid texture shape"),t.wrapS===ee&&t.wrapT===ee||r(C(i)&&C(o),"incompatible wrap mode for texture, both width and height must be power of 2"), 1===e.mipmask?1!==i&&1!==o&&r(t.minFilter!==ne&&t.minFilter!==ie&&t.minFilter!==ae&&t.minFilter!==oe,"min filter requires mipmap"):(r(C(i)&&C(o),"texture must be a square power of 2 to support mipmapping"),r(e.mipmask===(i<<1)-1,"missing or incomplete mipmap data")),e.type===se&&(n.extensions.indexOf("oes_texture_float_linear")<0&&r(t.minFilter===re&&t.magFilter===re,"filter not supported, must enable oes_texture_float_linear"),r(!t.genMipmaps,"mipmap generation not supported with float textures"));var l=e.images;for(a=0;a<16;++a)if(l[a]){var u=i>>a,c=o>>a;r(e.mipmask&1<0&&i<=a.maxTextureSize&&o>0&&o<=a.maxTextureSize,"invalid texture shape"),r(i===o,"cube map must be square"),r(e.wrapS===ee&&e.wrapT===ee,"wrap mode not supported by cube map");for(var l=0;l>f,p=o>>f;r(u.mipmask&1<1&&e===r&&('"'===e||"'"===e))return['"'+D(t.substr(1,t.length-2))+'"'];var n=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(t);if(n)return P(t.substr(0,n.index)).concat(P(n[1])).concat(P(t.substr(n.index+n[0].length)));var a=t.split(".");if(1===a.length)return['"'+D(t)+'"'];for(var i=[],o=0;o0,"invalid pixel ratio"))):de.raise("invalid arguments to regl"),e&&("canvas"===e.nodeName.toLowerCase()?n=e:r=e),!a){if(!n){de("undefined"!=typeof document,"must manually specify webgl context outside of DOM environments");var d=U(r||document.body,f,u);if(!d)return null;n=d.canvas,h=d.onDestroy}a=H(n,o)}return a?{gl:a,canvas:n,container:r,extensions:s,optionalExtensions:l,pixelRatio:u,profile:c,onDone:f,onDestroy:h}:(h(),f("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function W(t,e){function r(e){de.type(e,"string","extension name must be string");var r,a=e.toLowerCase();try{r=n[a]=t.getExtension(a)}catch(t){}return!!r}for(var n={},a=0;a65535)<<4,t>>>=e,r=(t>255)<<3,t>>>=r,e|=r,r=(t>15)<<2,t>>>=r,e|=r,r=(t>3)<<1,t>>>=r,(e|=r)|t>>1}function J(t){var e=$(t),r=Le[K(e)>>2];return r.length>0?r.pop():new ArrayBuffer(e)}function tt(t){Le[K(t.byteLength)>>2].push(t)}function et(t,e){var r=null;switch(t){case _e:r=new Int8Array(J(e),0,e);break;case we:r=new Uint8Array(J(e),0,e);break;case Ae:r=new Int16Array(J(2*e),0,e);break;case ke:r=new Uint16Array(J(2*e),0,e);break;case Me:r=new Int32Array(J(4*e),0,e);break;case Te:r=new Uint32Array(J(4*e),0,e);break;case Ee:r=new Float32Array(J(4*e),0,e);break;default:return null}return r.length!==e?r.subarray(0,e):r}function rt(t){tt(t.buffer)}function nt(t,e,r){for(var n=0;n0){var l;if(Array.isArray(e[0])){s=De(e);for(var u=1,c=1;c0)if("number"==typeof t[0]){var a=Se.allocType(p.dtype,t.length);ct(a,t),f(a,n),Se.freeType(a)}else if(Array.isArray(t[0])||Kt(t[0])){r=De(t);var i=Re(t,r,p.dtype);f(i,n),Se.freeType(i)}else de.raise("invalid buffer data")}else if(Kt(t))f(t,n);else if(Z(t)){r=t.shape;var o=t.stride,s=0,l=0,u=0,h=0;1===r.length?(s=r[0],l=1,u=o[0],h=0):2===r.length?(s=r[0],l=r[1],u=o[0],h=o[1]):de.raise("invalid shape");var d=Array.isArray(t.data)?p.dtype:ut(t.data),g=Se.allocType(d,s*l);ft(g,t.data,s,l,u,h,t.offset),f(g,n),Se.freeType(g)}else de.raise("invalid data for buffer subdata");return c}e.bufferCount++;var p=new n(i);return h[p.id]=p,o||c(a),c._reglType="buffer",c._buffer=p,c.subdata=d,r.profile&&(c.stats=p.stats),c.destroy=function(){l(p)},c}function c(){xe(h).forEach(function(e){e.buffer=t.createBuffer(),t.bindBuffer(e.type,e.buffer),t.bufferData(e.type,e.persistentData||e.byteLength,e.usage)})}var f=0,h={};n.prototype.bind=function(){t.bindBuffer(this.type,this.buffer)},n.prototype.destroy=function(){l(this)};var d=[];return r.profile&&(e.getTotalBufferSize=function(){var t=0;return Object.keys(h).forEach(function(e){t+=h[e].stats.size}),t}),{create:u,createStream:a,destroyStream:i,clear:function(){xe(h).forEach(l),d.forEach(l)},getBuffer:function(t){return t&&t._buffer instanceof n?t._buffer:null},restore:c,_initBuffer:s}}function dt(t,e,r,n){function a(t){this.id=f++,c[this.id]=this,this.buffer=t,this.primType=Ve,this.vertCount=0,this.type=0}function i(t){var e=d.pop();return e||(e=new a(r.create(null,Qe,!0,!1)._buffer)),s(e,t,$e,-1,-1,0,0),e}function o(t){d.push(t)}function s(n,a,i,o,s,l,u){if(n.buffer.bind(),a){var c=u;u||Kt(a)&&(!Z(a)||Kt(a.data))||(c=e.oes_element_index_uint?Ze:Ye),r._initBuffer(n.buffer,a,i,c,3)}else t.bufferData(Qe,l,i),n.buffer.dtype=f||qe,n.buffer.usage=i,n.buffer.dimension=3,n.buffer.byteLength=l;var f=u;if(!u){switch(n.buffer.dtype){case qe:case Ge:f=qe;break;case Ye:case Xe:f=Ye;break;case Ze:case We:f=Ze;break;default:de.raise("unsupported type for element array")}n.buffer.dtype=f}n.type=f,de(f!==Ze||!!e.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var h=s;h<0&&(h=n.buffer.byteLength,f===Ye?h>>=1:f===Ze&&(h>>=2)),n.vertCount=h;var d=o;if(o<0){d=Ve;var p=n.buffer.dimension;1===p&&(d=Ue),2===p&&(d=He),3===p&&(d=Ve)}n.primType=d}function l(t){n.elementsCount--,de(null!==t.buffer,"must not double destroy elements"),delete c[t.id],t.buffer.destroy(),t.buffer=null}function u(t,e){function i(t){if(t)if("number"==typeof t)o(t),u.primType=Ve,u.vertCount=0|t,u.type=qe;else{var e=null,r=Ke,n=-1,a=-1,l=0,c=0;Array.isArray(t)||Kt(t)||Z(t)?e=t:(de.type(t,"object","invalid arguments for elements"),"data"in t&&(e=t.data,de(Array.isArray(e)||Kt(e)||Z(e),"invalid data for element buffer")),"usage"in t&&(de.parameter(t.usage,Oe,"invalid element buffer usage"),r=Oe[t.usage]),"primitive"in t&&(de.parameter(t.primitive,je,"invalid element buffer primitive"),n=je[t.primitive]),"count"in t&&(de("number"==typeof t.count&&t.count>=0,"invalid vertex count for elements"),a=0|t.count),"type"in t&&(de.parameter(t.type,h,"invalid buffer type"),c=h[t.type]),"length"in t?l=0|t.length:(l=a,c===Ye||c===Xe?l*=2:c!==Ze&&c!==We||(l*=4))),s(u,e,r,n,a,l,c)}else o(),u.primType=Ve,u.vertCount=0,u.type=qe;return i}var o=r.create(null,Qe,!0),u=new a(o._buffer);return n.elementsCount++,i(t),i._reglType="elements",i._elements=u,i.subdata=function(t,e){return o.subdata(t,e),i},i.destroy=function(){l(u)},i}var c={},f=0,h={uint8:qe,uint16:Ye};e.oes_element_index_uint&&(h.uint32=Ze),a.prototype.bind=function(){this.buffer.bind()};var d=[];return{create:u,createStream:i,destroyStream:o,getElements:function(t){return"function"==typeof t&&t._elements instanceof a?t._elements:null},clear:function(){xe(c).forEach(l)}}}function pt(t){for(var e=Se.allocType(er,t.length),r=0;r>>31<<15,i=(n<<1>>>24)-127,o=n>>13&1023;if(i<-24)e[r]=a;else if(i<-14){var s=-14-i;e[r]=a+(o+1024>>s)}else e[r]=i>15?a+31744:a+(i+15<<10)+o}return e}function gt(t){return Array.isArray(t)||Kt(t)}function mt(t){return"[object "+t+"]"}function vt(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function yt(t){return!!Array.isArray(t)&&!(0===t.length||!gt(t[0]))}function bt(t){return Object.prototype.toString.call(t)}function xt(t){return bt(t)===dn}function _t(t){return bt(t)===pn}function wt(t){return bt(t)===gn}function At(t){return bt(t)===mn}function kt(t){if(!t)return!1;var e=bt(t);return vn.indexOf(e)>=0||(vt(t)||yt(t)||Z(t))}function Mt(t){return 0|$t[Object.prototype.toString.call(t)]}function Tt(t,e){var r=e.length;switch(t.type){case Pr:case zr:case Nr:case Fr:var n=Se.allocType(t.type,r);n.set(e),t.data=n;break;case wr:t.data=pt(e);break;default:de.raise("unsupported texture type, must specify a typed array")}}function Et(t,e){return Se.allocType(t.type===wr?Fr:t.type,e)}function Lt(t,e){t.type===wr?(t.data=pt(e),Se.freeType(e)):t.data=e}function St(t,e,r,n,a,i){for(var o=t.width,s=t.height,l=t.channels,u=o*s*l,c=Et(t,u),f=0,h=0;h=1;)s+=o*l*l,l/=2;return s}return o*r*n}function It(t,e,r,n,a,i,o){function s(){this.internalformat=or,this.format=or,this.type=Pr,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=0,this.width=0,this.height=0,this.channels=0}function l(t,e){t.internalformat=e.internalformat,t.format=e.format,t.type=e.type,t.compressed=e.compressed,t.premultiplyAlpha=e.premultiplyAlpha,t.flipY=e.flipY,t.unpackAlignment=e.unpackAlignment,t.colorSpace=e.colorSpace,t.width=e.width,t.height=e.height,t.channels=e.channels}function u(t,n){if("object"==typeof n&&n){if("premultiplyAlpha"in n&&(de.type(n.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),t.premultiplyAlpha=n.premultiplyAlpha),"flipY"in n&&(de.type(n.flipY,"boolean","invalid texture flip"),t.flipY=n.flipY),"alignment"in n&&(de.oneOf(n.alignment,[1,2,4,8],"invalid texture unpack alignment"),t.unpackAlignment=n.alignment),"colorSpace"in n&&(de.parameter(n.colorSpace,F,"invalid colorSpace"),t.colorSpace=F[n.colorSpace]),"type"in n){var a=n.type;de(e.oes_texture_float||!("float"===a||"float32"===a),"you must enable the OES_texture_float extension in order to use floating point textures."),de(e.oes_texture_half_float||!("half float"===a||"float16"===a),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),de(e.webgl_depth_texture||!("uint16"===a||"uint32"===a||"depth stencil"===a),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),de.parameter(a,B,"invalid texture type"),t.type=B[a]}var i=t.width,o=t.height,s=t.channels,l=!1;"shape"in n?(de(Array.isArray(n.shape)&&n.shape.length>=2,"shape must be an array"),i=n.shape[0],o=n.shape[1],3===n.shape.length&&(s=n.shape[2],de(s>0&&s<=4,"invalid number of channels"),l=!0),de(i>=0&&i<=r.maxTextureSize,"invalid width"),de(o>=0&&o<=r.maxTextureSize,"invalid height")):("radius"in n&&(i=o=n.radius,de(i>=0&&i<=r.maxTextureSize,"invalid radius")),"width"in n&&(i=n.width,de(i>=0&&i<=r.maxTextureSize,"invalid width")),"height"in n&&(o=n.height,de(o>=0&&o<=r.maxTextureSize,"invalid height")),"channels"in n&&(s=n.channels,de(s>0&&s<=4,"invalid number of channels"),l=!0)),t.width=0|i,t.height=0|o,t.channels=0|s;var u=!1;if("format"in n){var c=n.format;de(e.webgl_depth_texture||!("depth"===c||"depth stencil"===c),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),de.parameter(c,j,"invalid texture format");var f=t.internalformat=j[c];t.format=Q[f],c in B&&("type"in n||(t.type=B[c])),c in U&&(t.compressed=!0),u=!0}!l&&u?t.channels=hn[t.format]:l&&!u?t.channels!==fn[t.format]&&(t.format=t.internalformat=fn[t.channels]):u&&l&&de(t.channels===hn[t.format],"number of channels inconsistent with specified format")}}function c(e){t.pixelStorei(an,e.flipY),t.pixelStorei(on,e.premultiplyAlpha),t.pixelStorei(sn,e.colorSpace),t.pixelStorei(nn,e.unpackAlignment)}function f(){s.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function h(t,e){var n=null;if(kt(e)?n=e:e&&(de.type(e,"object","invalid pixel data type"),u(t,e),"x"in e&&(t.xOffset=0|e.x),"y"in e&&(t.yOffset=0|e.y),kt(e.data)&&(n=e.data)),de(!t.compressed||n instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),e.copy){de(!n,"can not specify copy and data field for the same texture");var i=a.viewportWidth,o=a.viewportHeight;t.width=t.width||i-t.xOffset,t.height=t.height||o-t.yOffset,t.needsCopy=!0,de(t.xOffset>=0&&t.xOffset=0&&t.yOffset0&&t.width<=i&&t.height>0&&t.height<=o,"copy texture read out of bounds")}else if(n){if(Kt(n))t.channels=t.channels||4,t.data=n,"type"in e||t.type!==Pr||(t.type=Mt(n));else if(vt(n))t.channels=t.channels||4,Tt(t,n),t.alignment=1,t.needsFree=!0;else if(Z(n)){var s=n.data;Array.isArray(s)||t.type!==Pr||(t.type=Mt(s));var l,c,f,h,d,p,g=n.shape,m=n.stride;3===g.length?(f=g[2],p=m[2]):(de(2===g.length,"invalid ndarray pixel data, must be 2 or 3D"),f=1,p=1),l=g[0],c=g[1],h=m[0],d=m[1],t.alignment=1,t.width=l,t.height=c,t.channels=f,t.format=t.internalformat=fn[f],t.needsFree=!0,St(t,s,h,d,p,n.offset)}else if(xt(n)||_t(n))xt(n)?t.element=n:t.element=n.canvas,t.width=t.element.width,t.height=t.element.height,t.channels=4;else if(wt(n))t.element=n,t.width=n.naturalWidth,t.height=n.naturalHeight,t.channels=4;else if(At(n))t.element=n,t.width=n.videoWidth,t.height=n.videoHeight,t.channels=4;else if(yt(n)){var v=t.width||n[0].length,y=t.height||n.length,b=t.channels;b=gt(n[0][0])?b||n[0][0].length:b||1;for(var x=Ce.shape(n),_=1,w=0;w=0,"oes_texture_float extension not enabled"):t.type===wr&&de(r.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function d(e,r,a){var i=e.element,o=e.data,s=e.internalformat,l=e.format,u=e.type,f=e.width,h=e.height;c(e),i?t.texImage2D(r,a,l,l,u,i):e.compressed?t.compressedTexImage2D(r,a,s,f,h,0,o):e.needsCopy?(n(),t.copyTexImage2D(r,a,l,e.xOffset,e.yOffset,f,h,0)):t.texImage2D(r,a,l,f,h,0,l,u,o)}function p(e,r,a,i,o){var s=e.element,l=e.data,u=e.internalformat,f=e.format,h=e.type,d=e.width,p=e.height;c(e),s?t.texSubImage2D(r,o,a,i,f,h,s):e.compressed?t.compressedTexSubImage2D(r,o,a,i,u,d,p,l):e.needsCopy?(n(),t.copyTexSubImage2D(r,o,a,i,e.xOffset,e.yOffset,d,p)):t.texSubImage2D(r,o,a,i,d,p,f,h,l)}function g(){return $.pop()||new f}function m(t){t.needsFree&&Se.freeType(t.data),f.call(t),$.push(t)}function v(){s.call(this),this.genMipmaps=!1,this.mipmapHint=Jr,this.mipmask=0,this.images=Array(16)}function y(t,e,r){var n=t.images[0]=g();t.mipmask=1,n.width=t.width=e,n.height=t.height=r,n.channels=t.channels=4}function b(t,e){var r=null;if(kt(e))r=t.images[0]=g(),l(r,t),h(r,e),t.mipmask=1;else if(u(t,e),Array.isArray(e.mipmap))for(var n=e.mipmap,a=0;a>=a,r.height>>=a,h(r,n[a]),t.mipmask|=1<=0&&(t.genMipmaps=!0)}if("mag"in e){var a=e.mag;de.parameter(a,z),t.magFilter=z[a]}var i=t.wrapS,o=t.wrapT;if("wrap"in e){var s=e.wrap;"string"==typeof s?(de.parameter(s,P),i=o=P[s]):Array.isArray(s)&&(de.parameter(s[0],P),de.parameter(s[1],P),i=P[s[0]],o=P[s[1]])}else{if("wrapS"in e){var l=e.wrapS;de.parameter(l,P),i=P[l]}if("wrapT"in e){var u=e.wrapT;de.parameter(u,P),o=P[u]}}if(t.wrapS=i,t.wrapT=o,"anisotropic"in e){var c=e.anisotropic;de("number"==typeof c&&c>=1&&c<=r.maxAnisotropic,"aniso samples must be between 1 and "),t.anisotropic=e.anisotropic}if("mipmap"in e){var f=!1;switch(typeof e.mipmap){case"string":de.parameter(e.mipmap,D,"invalid mipmap hint"),t.mipmapHint=D[e.mipmap],t.genMipmaps=!0,f=!0;break;case"boolean":f=t.genMipmaps=e.mipmap;break;case"object":de(Array.isArray(e.mipmap),"invalid mipmap type"),t.genMipmaps=!1,f=!0;break;default:de.raise("invalid mipmap type")}!f||"min"in e||(t.minFilter=Wr)}}function M(r,n){t.texParameteri(n,qr,r.minFilter),t.texParameteri(n,Gr,r.magFilter),t.texParameteri(n,Br,r.wrapS),t.texParameteri(n,jr,r.wrapT),e.ext_texture_filter_anisotropic&&t.texParameteri(n,rn,r.anisotropic),r.genMipmaps&&(t.hint(Kr,r.mipmapHint),t.generateMipmap(n))}function T(e){s.call(this),this.mipmask=0,this.internalformat=or,this.id=J++,this.refCount=1,this.target=e,this.texture=t.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new A,o.profile&&(this.stats={size:0})}function E(e){t.activeTexture(un),t.bindTexture(e.target,e.texture)}function L(){var e=rt[0];e?t.bindTexture(e.target,e.texture):t.bindTexture(nr,null)}function S(e){var r=e.texture;de(r,"must not double destroy texture");var n=e.unit,a=e.target;n>=0&&(t.activeTexture(un+n),t.bindTexture(a,null),rt[n]=null),t.deleteTexture(r),e.texture=null,e.params=null,e.pixels=null,e.refCount=0,delete tt[e.id],i.textureCount--}function C(e,n){function a(t,e){var n=c.texInfo;A.call(n);var i=_();return"number"==typeof t?"number"==typeof e?y(i,0|t,0|e):y(i,0|t,0|t):t?(de.type(t,"object","invalid arguments to regl.texture"),k(n,t),b(i,t)):y(i,1,1),n.genMipmaps&&(i.mipmask=(i.width<<1)-1),c.mipmask=i.mipmask,l(c,i),de.texture2D(n,i,r),c.internalformat=i.internalformat,a.width=i.width,a.height=i.height,E(c),x(i,nr),M(n,nr),L(),w(i),o.profile&&(c.stats.size=Ct(c.internalformat,c.type,i.width,i.height,n.genMipmaps,!1)),a.format=G[c.internalformat],a.type=q[c.type],a.mag=X[n.magFilter],a.min=Y[n.minFilter],a.wrapS=W[n.wrapS],a.wrapT=W[n.wrapT],a}function s(t,e,r,n){de(!!t,"must specify image data");var i=0|e,o=0|r,s=0|n,u=g();return l(u,c),u.width=0,u.height=0,h(u,t),u.width=u.width||(c.width>>s)-i,u.height=u.height||(c.height>>s)-o,de(c.type===u.type&&c.format===u.format&&c.internalformat===u.internalformat,"incompatible format for texture.subimage"),de(i>=0&&o>=0&&i+u.width<=c.width&&o+u.height<=c.height,"texture.subimage write out of bounds"),de(c.mipmask&1<>s;++s)t.texImage2D(nr,s,c.format,n>>s,i>>s,0,c.format,c.type,null);return L(),o.profile&&(c.stats.size=Ct(c.internalformat,c.type,n,i,!1,!1)),a}var c=new T(nr);return tt[c.id]=c,i.textureCount++,a(e,n),a.subimage=s,a.resize=u,a._reglType="texture2d",a._texture=c,o.profile&&(a.stats=c.stats),a.destroy=function(){c.decRef()},a}function I(e,n,a,s,c,f){function d(t,e,n,a,i,s){var c,f=C.texInfo;for(A.call(f),c=0;c<6;++c)I[c]=_();if("number"!=typeof t&&t)if("object"==typeof t)if(e)b(I[0],t),b(I[1],e),b(I[2],n),b(I[3],a),b(I[4],i),b(I[5],s);else if(k(f,t),u(C,t),"faces"in t){var h=t.faces;for(de(Array.isArray(h)&&6===h.length,"cube faces must be a length 6 array"),c=0;c<6;++c)de("object"==typeof h[c]&&!!h[c],"invalid input for cube map face"),l(I[c],C),b(I[c],h[c])}else for(c=0;c<6;++c)b(I[c],t);else de.raise("invalid arguments to cube map");else{var p=0|t||1;for(c=0;c<6;++c)y(I[c],p,p)}for(l(C,I[0]),f.genMipmaps?C.mipmask=(I[0].width<<1)-1:C.mipmask=I[0].mipmask,de.textureCube(C,f,I,r),C.internalformat=I[0].internalformat,d.width=I[0].width,d.height=I[0].height,E(C),c=0;c<6;++c)x(I[c],ir+c);for(M(f,ar),L(),o.profile&&(C.stats.size=Ct(C.internalformat,C.type,d.width,d.height,f.genMipmaps,!0)),d.format=G[C.internalformat],d.type=q[C.type],d.mag=X[f.magFilter],d.min=Y[f.minFilter],d.wrapS=W[f.wrapS],d.wrapT=W[f.wrapT],c=0;c<6;++c)w(I[c]);return d}function v(t,e,r,n,a){de(!!e,"must specify image data"),de("number"==typeof t&&t===(0|t)&&t>=0&&t<6,"invalid face");var i=0|r,o=0|n,s=0|a,u=g();return l(u,C),u.width=0,u.height=0,h(u,e),u.width=u.width||(C.width>>s)-i,u.height=u.height||(C.height>>s)-o,de(C.type===u.type&&C.format===u.format&&C.internalformat===u.internalformat,"incompatible format for texture.subimage"),de(i>=0&&o>=0&&i+u.width<=C.width&&o+u.height<=C.height,"texture.subimage write out of bounds"),de(C.mipmask&1<>a;++a)t.texImage2D(ir+n,a,C.format,r>>a,r>>a,0,C.format,C.type,null);return L(),o.profile&&(C.stats.size=Ct(C.internalformat,C.type,d.width,d.height,!1,!0)),d}}var C=new T(ar);tt[C.id]=C,i.cubeCount++;var I=new Array(6);return d(e,n,a,s,c,f),d.subimage=v,d.resize=S,d._reglType="textureCube",d._texture=C,o.profile&&(d.stats=C.stats),d.destroy=function(){C.decRef()},d}function O(){for(var e=0;e>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;n<6;++n)t.texImage2D(ir+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);M(e.texInfo,e.target)})}var D={"don't care":Jr,"dont care":Jr,nice:en,fast:tn},P={repeat:Ur,clamp:Hr,mirror:Vr},z={nearest:Xr,linear:Yr},N=Jt({mipmap:$r,"nearest mipmap nearest":Wr,"linear mipmap nearest":Zr,"nearest mipmap linear":Qr,"linear mipmap linear":$r},z),F={none:0,browser:ln},B={uint8:Pr,rgba4:pr,rgb565:mr,"rgb5 a1":gr},j={alpha:sr,luminance:ur,"luminance alpha":cr,rgb:lr,rgba:or,rgba4:fr,"rgb5 a1":hr,rgb565:dr},U={};e.ext_srgb&&(j.srgb=xr,j.srgba=_r),e.oes_texture_float&&(B.float32=B.float=Fr),e.oes_texture_half_float&&(B.float16=B["half float"]=wr),e.webgl_depth_texture&&(Jt(j,{depth:yr,"depth stencil":br}),Jt(B,{uint16:zr,uint32:Nr,"depth stencil":vr})),e.webgl_compressed_texture_s3tc&&Jt(U,{"rgb s3tc dxt1":Ar,"rgba s3tc dxt1":kr,"rgba s3tc dxt3":Mr,"rgba s3tc dxt5":Tr}),e.webgl_compressed_texture_atc&&Jt(U,{"rgb atc":Er,"rgba atc explicit alpha":Lr,"rgba atc interpolated alpha":Sr}),e.webgl_compressed_texture_pvrtc&&Jt(U,{"rgb pvrtc 4bppv1":Cr,"rgb pvrtc 2bppv1":Ir,"rgba pvrtc 4bppv1":Or,"rgba pvrtc 2bppv1":Rr}),e.webgl_compressed_texture_etc1&&(U["rgb etc1"]=Dr);var H=Array.prototype.slice.call(t.getParameter(rr));Object.keys(U).forEach(function(t){var e=U[t];H.indexOf(e)>=0&&(j[t]=e)});var V=Object.keys(j);r.textureFormats=V;var G=[];Object.keys(j).forEach(function(t){var e=j[t];G[e]=t});var q=[];Object.keys(B).forEach(function(t){var e=B[t];q[e]=t});var X=[];Object.keys(z).forEach(function(t){var e=z[t];X[e]=t});var Y=[];Object.keys(N).forEach(function(t){var e=N[t];Y[e]=t});var W=[];Object.keys(P).forEach(function(t){var e=P[t];W[e]=t});var Q=V.reduce(function(t,e){var r=j[e];return r===ur||r===sr||r===ur||r===cr||r===yr||r===br?t[r]=r:r===hr||e.indexOf("rgba")>=0?t[r]=or:t[r]=lr,t},{}),$=[],K=[],J=0,tt={},et=r.maxTextureUnits,rt=Array(et).map(function(){return null});return Jt(T.prototype,{bind:function(){var e=this;e.bindCount+=1;var r=e.unit;if(r<0){for(var n=0;n0)continue;a.unit=-1}rt[n]=e,r=n;break}r>=et&&de.raise("insufficient number of texture units"),o.profile&&i.maxTextureUnits=0&&r.indexK.width||Q<0||Q>K.height)return b.unhoverRaw(t,e)}if(D="xval"in e?w.flat(h,e.xval):w.p2c(E,Z),P="yval"in e?w.flat(h,e.yval):w.p2c(L,Q),!f(D[0])||!f(P[0]))return d.warn("Fx.hover failed",e,t),b.unhoverRaw(t,e)}var J=1/0;for(N=0;NX&&(Y.splice(0,X),J=Y[0].distance)}if(0===Y.length)return b.unhoverRaw(t,e);Y.sort(function(t,e){return t.distance-e.distance});var at=t._hoverdata,it=[];for(z=0;z1,ut=y.combine(g.plot_bgcolor||y.background,g.paper_bgcolor),ct={hovermode:R,rotateLabels:lt,bgColor:ut,container:g._hoverlayer,outerContainer:g._paperdiv,commonLabelOpts:g.hoverlabel},ft=a(Y,ct,t);if(i(Y,lt?"xa":"ya"),o(ft,lt),e.target&&e.target.tagName){var ht=_.getComponentMethod("annotations","hasClickToShow")(t,it);m(c.select(e.target),ht?"pointer":"")}e.target&&!n&&u(t,e,at)&&(at&&t.emit("plotly_unhover",{event:e,points:at}),t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:E,yaxes:L,xvals:D,yvals:P}))}function a(t,e,r){var n,a,i=e.hovermode,o=e.rotateLabels,s=e.bgColor,l=e.container,u=e.outerContainer,f=e.commonLabelOpts||{},h=e.fontFamily||A.HOVERFONT,d=e.fontSize||A.HOVERFONTSIZE,p=t[0],m=p.xa,b=p.ya,x="y"===i?"yLabel":"xLabel",_=p[x],w=(String(_)||"").split(" ")[0],M=u.node().getBoundingClientRect(),T=M.top,E=M.width,L=M.height,I=p.distance<=A.MAXDIST&&("x"===i||"y"===i);for(n=0;n-1&&n.length>p&&(n=p>3?n.substr(0,p-3)+"...":n.substr(0,p))}void 0!==t.extraText&&(a+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(a+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(a+="y: "+t.yLabel+"
"),a+=(a?"z: ":"")+t.zLabel):I&&t[i+"Label"]===_?a=t[("x"===i?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(a=t.yLabel):a=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(a+=(a?"
":"")+t.text),""===a&&(""===n&&e.remove(),a=n);var m=e.select("text.nums").call(v.font,t.fontFamily||h,t.fontSize||d,t.fontColor||f).text(a).attr("data-notex",1).call(g.positionText,0,0).call(g.convertToTspans,r),b=e.select("text.name"),x=0;n&&n!==a?(b.call(v.font,t.fontFamily||h,t.fontSize||d,u).text(n).attr("data-notex",1).call(g.positionText,0,0).call(g.convertToTspans,r),x=b.node().getBoundingClientRect().width+2*C):(b.remove(),e.select("rect").remove()),e.select("path").style({fill:u,stroke:f});var w,A,M=m.node().getBoundingClientRect(),O=t.xa._offset+(t.x0+t.x1)/2,R=t.ya._offset+(t.y0+t.y1)/2,D=Math.abs(t.x1-t.x0),P=Math.abs(t.y1-t.y0),z=M.width+S+C+x;t.ty0=T-M.top,t.bx=M.width+2*C,t.by=M.height+2*C,t.anchor="start",t.txwidth=M.width,t.tx2width=x,t.offset=0,o?(t.pos=O,w=R+P/2+z<=L,A=R-P/2-z>=0,"top"!==t.idealAlign&&w||!A?w?(R+=P/2,t.anchor="start"):t.anchor="middle":(R-=P/2,t.anchor="end")):(t.pos=R,w=O+D/2+z<=E,A=O-D/2-z>=0,"left"!==t.idealAlign&&w||!A?w?(O+=D/2,t.anchor="start"):t.anchor="middle":(O-=D/2,t.anchor="end")),m.attr("text-anchor",t.anchor),x&&b.attr("text-anchor",t.anchor),e.attr("transform","translate("+O+","+R+")"+(o?"rotate("+k+")":""))}),D}function i(t,e){function r(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,i=r.pos+r.dp+r.size-e.pmax,a>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=i;n=!1}if(n){var u=0;for(o=0;oe.pmax&&u++;for(o=t.length-1;o>=0&&!(u<=0);o--)l=t[o],l.pos>e.pmax-1&&(l.del=!0,u--);for(o=0;o=0;s--)t[s].dp-=i;for(o=t.length-1;o>=0&&!(u<=0);o--)l=t[o],l.pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}for(var n,a,i,o,s,l,u,c=0,f=t.map(function(t,r){var n=t[e];return[{i:r,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===n._id.charAt(0)?T:1)/2,pmin:n._offset,pmax:n._offset+n._length}]}).sort(function(t,e){return t[0].posref-e[0].posref});!n&&c<=t.length;){for(c++,n=!0,o=0;o.01&&p.pmin===g.pmin&&p.pmax===g.pmax){for(s=d.length-1;s>=0;s--)d[s].dp+=a;for(h.push.apply(h,d),f.splice(o+1,1),u=0,s=h.length-1;s>=0;s--)u+=h[s].dp;for(i=u/h.length,s=h.length-1;s>=0;s--)h[s].dp-=i;n=!1}else o++}f.forEach(r)}for(o=f.length-1;o>=0;o--){var m=f[o];for(s=m.length-1;s>=0;s--){var v=m[s],y=t[v.i];y.offset=v.dp,y.del=v.del}}}function o(t,e){t.each(function(t){var r=c.select(this);if(t.del)return void r.remove();var n="end"===t.anchor?-1:1,a=r.select("text.nums"),i={start:1,end:-1,middle:0}[t.anchor],o=i*(S+C),s=o+i*(t.txwidth+C),l=0,u=t.offset;"middle"===t.anchor&&(o-=t.tx2width/2,s-=t.tx2width/2),e&&(u*=-L,l=t.offset*E),r.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(n*S+l)+","+(S+u)+"v"+(t.by/2-S)+"h"+n*t.bx+"v-"+t.by+"H"+(n*S+l)+"V"+(u-S)+"Z"),a.call(g.positionText,o+l,u+t.ty0-t.by/2+C),t.tx2width&&(r.select("text.name").call(g.positionText,s+i*C+l,u+t.ty0-t.by/2+C),r.select("rect").call(v.setRect,s+(i-1)*t.tx2width/2+l,u-t.by/2-1,t.tx2width,t.by+2))})}function s(t,e){function r(e,r,n){var a=s(r,n);a&&(t[e]=a)}var n=t.index,a=t.trace||{},i=t.cd[0],o=t.cd[n]||{},s=Array.isArray(n)?function(t,e){return d.castOption(i,n,t)||d.extractOption({},a,"",e)}:function(t,e){return d.extractOption(o,a,t,e)};r("hoverinfo","hi","hoverinfo"),r("color","hbg","hoverlabel.bgcolor"),r("borderColor","hbc","hoverlabel.bordercolor"),r("fontFamily","htf","hoverlabel.font.family"),r("fontSize","hts","hoverlabel.font.size"),r("fontColor","htc","hoverlabel.font.color"),r("nameLength","hnl","hoverlabel.namelength"),t.posref="y"===e?(t.x0+t.x1)/2:(t.y0+t.y1)/2,t.x0=d.constrain(t.x0,0,t.xa._length),t.x1=d.constrain(t.x1,0,t.xa._length),t.y0=d.constrain(t.y0,0,t.ya._length),t.y1=d.constrain(t.y1,0,t.ya._length);var l;if(void 0!==t.xLabelVal){l="log"===t.xa.type&&t.xLabelVal<=0;var u=x.tickText(t.xa,t.xa.c2l(l?-t.xLabelVal:t.xLabelVal),"hover");l?0===t.xLabelVal?t.xLabel="0":t.xLabel="-"+u.text:t.xLabel=u.text,t.xVal=t.xa.c2d(t.xLabelVal)}if(void 0!==t.yLabelVal){l="log"===t.ya.type&&t.yLabelVal<=0;var c=x.tickText(t.ya,t.ya.c2l(l?-t.yLabelVal:t.yLabelVal),"hover");l?0===t.yLabelVal?t.yLabel="0":t.yLabel="-"+c.text:t.yLabel=c.text,t.yVal=t.ya.c2d(t.yLabelVal)}if(void 0!==t.zLabelVal&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var f=x.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+f+" / -"+x.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+f,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var h=x.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+h+" / -"+x.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+h,"y"===e&&(t.distance+=1)}var p=t.hoverinfo||t.trace.hoverinfo;return"all"!==p&&(p=p.split("+"),-1===p.indexOf("x")&&(t.xLabel=void 0),-1===p.indexOf("y")&&(t.yLabel=void 0),-1===p.indexOf("z")&&(t.zLabel=void 0),-1===p.indexOf("text")&&(t.text=void 0),-1===p.indexOf("name")&&(t.name=void 0)),t}function l(t,e){var r=e.hovermode,n=e.container,a=t[0],i=a.xa,o=a.ya,s=i.showspikes,l=o.showspikes;if(n.selectAll(".spikeline").remove(),"closest"===r&&(s||l)){var u=e.fullLayout,c=i._offset+(a.x0+a.x1)/2,f=o._offset+(a.y0+a.y1)/2,d=y.combine(u.plot_bgcolor,u.paper_bgcolor),p=h.readability(a.color,d)<1.5?y.contrast(d):a.color;if(l){var g=o.spikemode,m=o.spikethickness,b=o.spikecolor||p,x=o._boundingBox,_=(x.left+x.right)/2=0;n--){var a=r[n],i=t._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber))return!0}return!1}var c=t("d3"),f=t("fast-isnumeric"),h=t("tinycolor2"),d=t("../../lib"),p=t("../../lib/events"),g=t("../../lib/svg_text_utils"),m=t("../../lib/override_cursor"),v=t("../drawing"),y=t("../color"),b=t("../dragelement"),x=t("../../plots/cartesian/axes"),_=t("../../registry"),w=t("./helpers"),A=t("./constants"),k=A.YANGLE,M=Math.PI*k/180,T=1/Math.sin(M),E=Math.cos(M),L=Math.sin(M),S=A.HOVERARROWSIZE,C=A.HOVERTEXTPAD;r.hover=function(t,e,r,a){t=d.getGraphDiv(t),d.throttle(t._fullLayout._uid+A.HOVERID,A.HOVERMINTIME,function(){n(t,e,r,a)})},r.loneHover=function(t,e){var r={color:t.color||y.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,trace:{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0},n=c.select(e.container),i=e.outerContainer?c.select(e.outerContainer):n,s={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||y.background,container:n,outerContainer:i},l=a([r],s,e.gd);return o(l,s.rotateLabels),l.node()}},{"../../lib":353,"../../lib/events":343,"../../lib/override_cursor":363,"../../lib/svg_text_utils":375,"../../plots/cartesian/axes":396,"../../registry":436,"../color":233,"../dragelement":254,"../drawing":257,"./constants":269,"./helpers":271,d3:62,"fast-isnumeric":68,tinycolor2:200}],273:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,a){a=a||{},r("hoverlabel.bgcolor",a.bgcolor),r("hoverlabel.bordercolor",a.bordercolor),r("hoverlabel.namelength",a.namelength),n.coerceFont(r,"hoverlabel.font",a.font)}},{"../../lib":353}],274:[function(t,e,r){"use strict";function n(t){var e=s.isD3Selection(t)?t:o.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()}function a(t,e,r){return s.castOption(t,e,"hoverlabel."+r)}function i(t,e,r){function n(r){return s.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}return s.castOption(t,r,"hoverinfo",n)}var o=t("d3"),s=t("../../lib"),l=t("../dragelement"),u=t("./helpers"),c=t("./layout_attributes");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:c},attributes:t("./attributes"),layoutAttributes:c,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:u.getDistanceFunction,getClosest:u.getClosest,inbox:u.inbox,appendArrayPointValue:u.appendArrayPointValue,castHoverOption:a,castHoverinfo:i,hover:t("./hover").hover,unhover:l.unhover,loneHover:t("./hover").loneHover,loneUnhover:n,click:t("./click")}},{"../../lib":353,"../dragelement":254,"./attributes":266,"./calc":267,"./click":268,"./constants":269,"./defaults":270,"./helpers":271,"./hover":272,"./layout_attributes":275,"./layout_defaults":276,"./layout_global_defaults":277,d3:62}],275:[function(t,e,r){"use strict";var n=t("./constants"),a=t("../../plots/font_attributes")({editType:"none"});a.family.dflt=n.HOVERFONT,a.size.dflt=n.HOVERFONTSIZE,e.exports={dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1],editType:"modebar"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"}}},{"../../plots/font_attributes":420,"./constants":269}],276:[function(t,e,r){"use strict";function n(t){for(var e=!0,r=0;r=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}},{}],284:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes");e.exports={bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:a.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:n({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},x:{valType:"number",min:-2,max:3,dflt:1.02,editType:"legend"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",min:-2,max:3,dflt:1,editType:"legend"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"legend"},editType:"legend"}},{"../../plots/font_attributes":420,"../color/attributes":232}],285:[function(t,e,r){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],286:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("./attributes"),o=t("../../plots/layout_attributes"),s=t("./helpers");e.exports=function(t,e,r){function l(t,e){return a.coerce(d,p,i,t,e)}for(var u,c,f,h,d=t.legend||{},p=e.legend={},g=0,m="normal",v=0;v1)){if(l("bgcolor",e.paper_bgcolor),l("bordercolor"),l("borderwidth"),a.coerceFont(l,"font",e.font),l("orientation"),"h"===p.orientation){var b=t.xaxis;b&&b.rangeslider&&b.rangeslider.visible?(u=0,f="left",c=1.1,h="bottom"):(u=0,f="left",c=-.1,h="top")}l("traceorder",m),s.isGrouped(e.legend)&&l("tracegroupgap"),l("x",u),l("xanchor",f),l("y",c),l("yanchor",h),a.noneOrAll(d,p,["x","y"])}}},{"../../lib":353,"../../plots/layout_attributes":427,"../../registry":436,"./attributes":284,"./helpers":290}],287:[function(t,e,r){"use strict";function n(t,e){function r(r){v.convertToTspans(r,e,function(){i(t,e)})}var n=t.data()[0][0],a=e._fullLayout,o=n.trace,s=d.traceIs(o,"pie"),l=o.index,u=s?n.label:o.name,h=t.selectAll("text.legendtext").data([0]);h.enter().append("text").classed("legendtext",!0),h.attr("text-anchor","start").classed("user-select-none",!0).call(g.font,a.legend.font).text(u),e._context.edits.legendText&&!s?h.call(v.makeEditable,{gd:e}).call(r).on("edit",function(t){this.text(t).call(r);var a=t;this.text()||(t=" ");var i,o,s=n.trace._fullInput||{},u={};if(-1!==["ohlc","candlestick"].indexOf(s.type))i=n.trace.transforms,o=i[i.length-1].direction,u[o+".name"]=t;else if(d.hasTransform(s,"groupby")){var h=d.getTransformIndices(s,"groupby"),p=h[h.length-1],g=f.keyedContainer(s,"transforms["+p+"].styles","target","value.name");""===a?g.remove(n.trace._group):g.set(n.trace._group,t),u=g.constructUpdate()}else u.name=t;return c.restyle(e,u,l)}):h.call(r)}function a(t,e){var r,n=1,a=t.selectAll("rect").data([0]);a.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(m.fill,"rgba(0,0,0,0)"),a.on("mousedown",function(){r=(new Date).getTime(),r-e._legendMouseDownTimeT&&(n=Math.max(n-1,1)),1===n?r._clickTimeout=setTimeout(function(){y(t,e,n)},T):2===n&&(r._clickTimeout&&clearTimeout(r._clickTimeout),e._legendMouseDownTime=0,y(t,e,n))}})}function i(t,e){var r=t.data()[0][0];if(!r.trace.showlegend)return void t.remove();var n,a,i=t.select("g[class*=math-group]"),o=i.node(),s=e._fullLayout.legend,l=s.font.size*_;if(o){var u=g.bBox(o);n=u.height,a=u.width,g.setTranslate(i,0,n/4)}else{var c=t.select(".legendtext"),f=v.lineCount(c),h=c.node();n=l*f,a=h?g.bBox(h).width:0;var d=l*(.3+(1-f)/2);v.positionText(c,40,d)}n=Math.max(n,16)+3,r.height=n,r.width=a}function o(t,e,r){var n=t._fullLayout,a=n.legend,i=a.borderwidth,o=k.isGrouped(a),s=0;if(a.width=0,a.height=0, k.isVertical(a))o&&e.each(function(t,e){g.setTranslate(this,0,e*a.tracegroupgap)}),r.each(function(t){var e=t[0],r=e.height,n=e.width;g.setTranslate(this,i,5+i+a.height+r/2),a.height+=r,a.width=Math.max(a.width,n)}),a.width+=45+2*i,a.height+=10+2*i,o&&(a.height+=(a._lgroupsLength-1)*a.tracegroupgap),s=40;else if(o){for(var l=[a.width],c=e.data(),f=0,h=c.length;fn.width-(n.margin.r+n.margin.l)&&(b=0,m+=v,a.height=a.height+v,v=0),g.setTranslate(this,i+b,5+i+e.height/2+m),a.width+=o+r,a.height=Math.max(a.height,e.height),b+=o+r,v=Math.max(e.height,v)}),a.width+=2*i,a.height+=10+2*i}a.width=Math.ceil(a.width),a.height=Math.ceil(a.height),r.each(function(e){var r=e[0];u.select(this).select(".legendtoggle").call(g.setRect,0,-r.height/2,(t._context.edits.legendText?0:a.width)+s,r.height)})}function s(t){var e=t._fullLayout,r=e.legend,n="left";M.isRightAnchor(r)?n="right":M.isCenterAnchor(r)&&(n="center");var a="top";M.isBottomAnchor(r)?a="bottom":M.isMiddleAnchor(r)&&(a="middle"),h.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 l(t){var e=t._fullLayout,r=e.legend,n="left";M.isRightAnchor(r)?n="right":M.isCenterAnchor(r)&&(n="center"),h.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 u=t("d3"),c=t("../../plotly"),f=t("../../lib"),h=t("../../plots/plots"),d=t("../../registry"),p=t("../dragelement"),g=t("../drawing"),m=t("../color"),v=t("../../lib/svg_text_utils"),y=t("./handle_click"),b=t("./constants"),x=t("../../constants/interactions"),_=t("../../constants/alignment").LINE_SPACING,w=t("./get_legend_data"),A=t("./style"),k=t("./helpers"),M=t("./anchor_utils"),T=x.DBLCLICKDELAY;e.exports=function(t){function e(t,e){S.attr("data-scroll",e).call(g.setTranslate,0,e),C.call(g.setRect,B,t,b.scrollBarWidth,b.scrollBarHeight),E.select("rect").attr({y:v.borderwidth-e})}var r=t._fullLayout,i="legend"+r._uid;if(r._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var v=r.legend,x=r.showlegend&&w(t.calcdata,v),_=r.hiddenlabels||[];if(!r.showlegend||!x.length)return r._infolayer.selectAll(".legend").remove(),r._topdefs.select("#"+i).remove(),void h.autoMargin(t,"legend");var k=r._infolayer.selectAll("g.legend").data([0]);k.enter().append("g").attr({class:"legend","pointer-events":"all"});var E=r._topdefs.selectAll("#"+i).data([0]);E.enter().append("clipPath").attr("id",i).append("rect");var L=k.selectAll("rect.bg").data([0]);L.enter().append("rect").attr({class:"bg","shape-rendering":"crispEdges"}),L.call(m.stroke,v.bordercolor),L.call(m.fill,v.bgcolor),L.style("stroke-width",v.borderwidth+"px");var S=k.selectAll("g.scrollbox").data([0]);S.enter().append("g").attr("class","scrollbox");var C=k.selectAll("rect.scrollbar").data([0]);C.enter().append("rect").attr({class:"scrollbar",rx:20,ry:2,width:0,height:0}).call(m.fill,"#808BA4");var I=S.selectAll("g.groups").data(x);I.enter().append("g").attr("class","groups"),I.exit().remove();var O=I.selectAll("g.traces").data(f.identity);O.enter().append("g").attr("class","traces"),O.exit().remove(),O.call(A,t).style("opacity",function(t){var e=t[0].trace;return d.traceIs(e,"pie")?-1!==_.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){u.select(this).call(n,t).call(a,t)});var R=0!==k.enter().size();R&&(o(t,I,O),s(t));var D=r.width,P=r.height;o(t,I,O),v.height>P?l(t):s(t);var z=r._size,N=z.l+z.w*v.x,F=z.t+z.h*(1-v.y);M.isRightAnchor(v)?N-=v.width:M.isCenterAnchor(v)&&(N-=v.width/2),M.isBottomAnchor(v)?F-=v.height:M.isMiddleAnchor(v)&&(F-=v.height/2);var B=v.width,j=z.w;B>j?(N=z.l,B=j):(N+B>D&&(N=D-B),N<0&&(N=0),B=Math.min(D-N,v.width));var U=v.height,H=z.h;U>H?(F=z.t,U=H):(F+U>P&&(F=P-U),F<0&&(F=0),U=Math.min(P-F,v.height)),g.setTranslate(k,N,F);var V,G,q=U-b.scrollBarHeight-2*b.scrollBarMargin,X=v.height-U;if(v.height<=U||t._context.staticPlot)L.attr({width:B-v.borderwidth,height:U-v.borderwidth,x:v.borderwidth/2,y:v.borderwidth/2}),g.setTranslate(S,0,0),E.select("rect").attr({width:B-2*v.borderwidth,height:U-2*v.borderwidth,x:v.borderwidth,y:v.borderwidth}),S.call(g.setClipUrl,i);else{V=b.scrollBarMargin,G=S.attr("data-scroll")||0,L.attr({width:B-2*v.borderwidth+b.scrollBarWidth+b.scrollBarMargin,height:U-v.borderwidth,x:v.borderwidth/2,y:v.borderwidth/2}),E.select("rect").attr({width:B-2*v.borderwidth+b.scrollBarWidth+b.scrollBarMargin,height:U-2*v.borderwidth,x:v.borderwidth,y:v.borderwidth-G}),S.call(g.setClipUrl,i),R&&e(V,G),k.on("wheel",null),k.on("wheel",function(){G=f.constrain(S.attr("data-scroll")-u.event.deltaY/q*X,-X,0),V=b.scrollBarMargin-G/X*q,e(V,G),0!==G&&G!==-X&&u.event.preventDefault()}),C.on(".drag",null),S.on(".drag",null);var Y=u.behavior.drag().on("drag",function(){V=f.constrain(u.event.y-b.scrollBarHeight/2,b.scrollBarMargin,b.scrollBarMargin+q),G=-(V-b.scrollBarMargin)/q*X,e(V,G)});C.call(Y),S.call(Y)}if(t._context.edits.legendPosition){var W,Z,Q,$;k.classed("cursor-move",!0),p.init({element:k.node(),gd:t,prepFn:function(){var t=g.getTranslate(k);Q=t.x,$=t.y},moveFn:function(t,e){var r=Q+t,n=$+e;g.setTranslate(k,r,n),W=p.align(r,0,z.l,z.l+z.w,v.xanchor),Z=p.align(n,0,z.t+z.h,z.t,v.yanchor)},doneFn:function(e,n,a){if(e&&void 0!==W&&void 0!==Z)c.relayout(t,{"legend.x":W,"legend.y":Z});else{var i=r._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return a.clientX>=t.left&&a.clientX<=t.right&&a.clientY>=t.top&&a.clientY<=t.bottom});i.size()>0&&(1===n?k._clickTimeout=setTimeout(function(){y(i,t,n)},T):2===n&&(k._clickTimeout&&clearTimeout(k._clickTimeout),y(i,t,n)))}}})}}}},{"../../constants/alignment":330,"../../constants/interactions":333,"../../lib":353,"../../lib/svg_text_utils":375,"../../plotly":391,"../../plots/plots":429,"../../registry":436,"../color":233,"../dragelement":254,"../drawing":257,"./anchor_utils":283,"./constants":285,"./get_legend_data":288,"./handle_click":289,"./helpers":290,"./style":292,d3:62}],288:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./helpers");e.exports=function(t,e){function r(t,r){if(""!==t&&a.isGrouped(e))-1===l.indexOf(t)?(l.push(t),u=!0,s[t]=[[r]]):s[t].push([r]);else{var n="~~i"+f;l.push(n),s[n]=[[r]],f++}}var i,o,s={},l=[],u=!1,c={},f=0;for(i=0;ir[1])return r[1]}return a}function a(t){return t[0]}var s,u,c=t[0],f=c.trace,h=l.hasMarkers(f),d=l.hasText(f),p=l.hasLines(f);if(h||d||p){var g={},m={};h&&(g.mc=r("marker.color",a),g.mo=r("marker.opacity",i.mean,[.2,1]),g.ms=r("marker.size",i.mean,[2,16]),g.mlc=r("marker.line.color",a),g.mlw=r("marker.line.width",i.mean,[0,5]),m.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),p&&(m.line={width:r("line.width",a,[0,10])}),d&&(g.tx="Aa",g.tp=r("textposition",a),g.ts=10,g.tc=r("textfont.color",a),g.tf=r("textfont.family",a)),s=[i.minExtend(c,g)],u=i.minExtend(f,m)}var v=n.select(this).select("g.legendpoints"),y=v.selectAll("path.scatterpts").data(h?s:[]);y.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),y.exit().remove(),y.call(o.pointStyle,u,e),h&&(s[0].mrc=3);var b=v.selectAll("g.pointtext").data(d?s:[]);b.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),b.exit().remove(),b.selectAll("text").call(o.textPointStyle,u,e)}function f(t){var e=t[0].trace,r=e.marker||{},i=r.line||{},o=n.select(this).select("g.legendpoints").selectAll("path.legendbar").data(a.traceIs(e,"bar")?[t]:[]);o.enter().append("path").classed("legendbar",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),o.exit().remove(),o.each(function(t){var e=n.select(this),a=t[0],o=(a.mlw+1||i.width+1)-1;e.style("stroke-width",o+"px").call(s.fill,a.mc||r.color),o&&e.call(s.stroke,a.mlc||i.color)})}function h(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(a.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(){var t=e.line.width,r=n.select(this);r.style("stroke-width",t+"px").call(s.fill,e.fillcolor),t&&r.call(s.stroke,e.line.color)})}function d(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendpie").data(a.traceIs(e,"pie")&&e.visible?[t]:[]);r.enter().append("path").classed("legendpie",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.size()&&r.call(u,t[0],e)}t.each(function(t){var e=n.select(this),r=e.selectAll("g.layers").data([0]);r.enter().append("g").classed("layers",!0),r.style("opacity",t[0].trace.opacity),r.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),r.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var a=r.selectAll("g.legendsymbols").data([t]);a.enter().append("g").classed("legendsymbols",!0),a.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(f).each(h).each(d).each(r).each(c)}},{"../../lib":353,"../../registry":436,"../../traces/pie/style_one":485,"../../traces/scatter/subtypes":512,"../color":233,"../drawing":257,d3:62}],293:[function(t,e,r){"use strict";function n(t,e){var r,n,a=e.currentTarget,i=a.getAttribute("data-attr"),o=a.getAttribute("data-val")||!0,s=t._fullLayout,l={},u=d.list(t,null,!0),c="on";if("zoom"===i){var h,p="in"===o?.5:2,g=(1+p)/2,m=(1-p)/2;for(n=0;n1)return n(["resetViews","toggleHover"]),o(v,r);c&&(n(["zoom3d","pan3d","orbitRotation","tableRotation"]),n(["resetCameraDefault3d","resetCameraLastSave3d"]),n(["hoverClosest3d"]));var y=a(s),b=[];return((u||p)&&!y||g)&&(b=["zoom2d","pan2d"]),(m||f)&&(b=["pan2d"]),i(l)&&(b.push("select2d"),b.push("lasso2d")),b.length&&n(b),!u&&!p||y||g||n(["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"]),u&&d?n(["toggleHover"]):p?n(["hoverClosestGl2d"]):u?n(["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]):d?n(["hoverClosestPie"]):m?n(["resetViewMapbox","toggleHover"]):f&&(n(["zoomInGeo","zoomOutGeo","resetGeo"]),n(["hoverClosestGeo"])),o(v,r)}function a(t){for(var e=l.list({_fullLayout:t},null,!0),r=!0,n=0;n0)){var p=a(e,r,l);f("x",p[0]),f("y",p[1]),i.noneOrAll(t,e,["x","y"]),f("xanchor"),f("yanchor"),i.coerceFont(f,"font",r.font);var g=f("bgcolor");f("activecolor",o.contrast(g,u.lightAmount,u.darkAmount)),f("bordercolor"),f("borderwidth")}}},{"../../lib":353,"../color":233,"./attributes":297,"./button_attributes":298,"./constants":299}],301:[function(t,e,r){"use strict";function n(t){for(var e=v.list(t,"x",!0),r=[],n=0;np&&(p=h)));return p>=d?[d,p]:void 0}}var a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=t("./constants"),s=t("./helpers");e.exports=function(t){var e=t._fullLayout,r=a.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var s=0;sX&&n>Y&&!t.shiftKey?p.getCursor(a/r,1-i/n):"move";g(e,o),q=o.split("-")[0]}function i(e){B=f.getFromId(t,r.xref),j=f.getFromId(t,r.yref),U=v.getDataToPixel(t,B),H=v.getDataToPixel(t,j,!0),V=v.getPixelToData(t,B),G=v.getPixelToData(t,j,!0);var i="shapes["+n+"]";"path"===r.type?(N=r.path,F=i+".path"):(m=U(r.x0),y=H(r.y0),b=U(r.x1),x=H(r.y1),_=i+".x0",w=i+".y0",A=i+".x1",k=i+".y1"),mY&&(d[S]=r[R]=G(u),d[C]=r[D]=G(c)),h-f>X&&(d[I]=r[P]=V(f),d[O]=r[z]=V(h))}e.attr("d",o(t,r))}var d,m,y,b,x,_,w,A,k,M,T,E,L,S,C,I,O,R,D,P,z,N,F,B,j,U,H,V,G,q,X=10,Y=10,W={element:e.node(),gd:t,prepFn:i,doneFn:s},Z=W.element.getBoundingClientRect();p.init(W),e.node().onmousemove=a}function o(t,e){var r,n,a,i,o=e.type,l=f.getFromId(t,e.xref),u=f.getFromId(t,e.yref),c=t._fullLayout._size;if(l?(r=v.shapePositionToRange(l),n=function(t){return l._offset+l.r2p(r(t,!0))}):n=function(t){return c.l+c.w*t},u?(a=v.shapePositionToRange(u),i=function(t){return u._offset+u.r2p(a(t,!0))}):i=function(t){return c.t+c.h*(1-t)},"path"===o)return l&&"date"===l.type&&(n=v.decodeDate(n)),u&&"date"===u.type&&(i=v.decodeDate(i)),s(e.path,n,i);var h=n(e.x0),d=n(e.x1),p=i(e.y0),g=i(e.y1);if("line"===o)return"M"+h+","+p+"L"+d+","+g;if("rect"===o)return"M"+h+","+p+"H"+d+"V"+g+"H"+h+"Z";var m=(h+d)/2,y=(p+g)/2,b=Math.abs(m-h),x=Math.abs(y-p),_="A"+b+","+x,w=m+b+","+y;return"M"+w+_+" 0 1,1 "+m+","+(y-x)+_+" 0 0,1 "+w+"Z"}function s(t,e,r){return t.replace(m.segmentRE,function(t){var n=0,a=t.charAt(0),i=m.paramIsX[a],o=m.paramIsY[a],s=m.numParams[a],l=t.substr(1).replace(m.paramRE,function(t){return i[n]?t=e(t):o[n]&&(t=r(t)),n++,n>s&&(t="X"),t});return n>s&&(l=l.replace(/[\s,]*X.*/,""),c.log("Ignoring extra params in segment "+t)),a+l})}function l(t,e,r){return t.replace(m.segmentRE,function(t){var n=0,a=t.charAt(0),i=m.paramIsX[a],o=m.paramIsY[a],s=m.numParams[a];return a+t.substr(1).replace(m.paramRE,function(t){return n>=s?t:(i[n]?t=e(t):o[n]&&(t=r(t)),n++,t)})})}var u=t("../../plotly"),c=t("../../lib"),f=t("../../plots/cartesian/axes"),h=t("../color"),d=t("../drawing"),p=t("../dragelement"),g=t("../../lib/setcursor"),m=t("./constants"),v=t("./helpers");e.exports={draw:n,drawOne:a}},{"../../lib":353,"../../lib/setcursor":371,"../../plotly":391,"../../plots/cartesian/axes":396,"../color":233,"../dragelement":254,"../drawing":257,"./constants":312,"./helpers":315}],315:[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,i=t._fullLayout._size;if(e){var o=r.shapePositionToRange(e);a=function(t){return e._offset+e.r2p(o(t,!0))},"date"===e.type&&(a=r.decodeDate(a))}else a=n?function(t){return i.t+i.h*(1-t)}:function(t){return i.l+i.w*t};return a},r.getPixelToData=function(t,e,n){var a,i=t._fullLayout._size;if(e){var o=r.rangeToShapePosition(e);a=function(t){return o(e.p2r(t-e._offset))}}else a=n?function(t){return 1-(t-i.t)/i.h}:function(t){return(t-i.l)/i.w};return a}},{}],316:[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":310,"./calc_autorange":311,"./defaults":313,"./draw":314}],317:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("./attributes"),o=t("./helpers");e.exports=function(t,e,r,s,l){function u(r,a){return n.coerce(t,e,i,r,a)}if(s=s||{},l=l||{},!u("visible",!l.itemIsNotPlainObject))return e;u("layer"),u("opacity"),u("fillcolor"),u("line.color"),u("line.width"),u("line.dash");for(var c=t.path?"path":"rect",f=u("type",c),h=["x","y"],d=0;d<2;d++){var p=h[d],g={_fullLayout:r},m=a.coerceRef(t,e,g,p,"","paper");if("path"!==f){var v,y,b;"paper"!==m?(v=a.getFromId(g,m),b=o.rangeToShapePosition(v),y=o.shapePositionToRange(v)):y=b=n.identity;var x=p+"0",_=p+"1",w=t[x],A=t[_];t[x]=y(t[x],!0),t[_]=y(t[_],!0),a.coercePosition(e,g,u,m,x,.25),a.coercePosition(e,g,u,m,_,.75),e[x]=b(e[x]),e[_]=b(e[_]),t[x]=w,t[_]=A}}return"path"===f?u("path"):n.noneOrAll(t,e,["x0","x1","y0","y1"]),e}},{"../../lib":353,"../../plots/cartesian/axes":396,"./attributes":310,"./helpers":315}],318:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../../plots/pad_attributes"),i=t("../../lib/extend").extendDeepAll,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/animation_attributes"),l=t("./constants"),u={_isLinkedToArray:"step",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}};e.exports=o({_isLinkedToArray:"slider",visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:u,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:i({},a,{},{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:s.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:n({})},font:n({}),activebgcolor:{valType:"color",dflt:l.gripBgActiveColor},bgcolor:{valType:"color",dflt:l.railBgColor},bordercolor:{valType:"color",dflt:l.railBorderColor},borderwidth:{valType:"number",min:0,dflt:l.railBorderWidth},ticklen:{valType:"number",min:0,dflt:l.tickLength},tickcolor:{valType:"color",dflt:l.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:l.minorTickLength}},"arraydraw","from-root")},{"../../lib/extend":344,"../../plot_api/edit_types":380,"../../plots/animation_attributes":392,"../../plots/font_attributes":420,"../../plots/pad_attributes":428,"./constants":319}],319:[function(t,e,r){"use strict";e.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],320:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return i.coerce(t,e,s,r,n)}n("visible",a(t,e).length>0)&&(n("active"),n("x"),n("y"),i.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"),i.coerceFont(n,"font",r.font),n("currentvalue.visible")&&(n("currentvalue.xanchor"),n("currentvalue.prefix"),n("currentvalue.suffix"),n("currentvalue.offset"),i.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 i.coerce(n,a,c,t,e)}for(var n,a,o=t.steps||[],s=e.steps=[],l=0;l=r.steps.length&&(r.active=0),e.call(s,r).call(x,r).call(c,r).call(p,r).call(b,t,r).call(l,t,r),M.setTranslate(e,r.lx+r.pad.l,r.ly+r.pad.t),e.call(m,r,r.active/(r.steps.length-1),!1),e.call(s,r)}function s(t,e,r){if(e.currentvalue.visible){var n,a,i=t.selectAll("text").data([0]);switch(e.currentvalue.xanchor){case"right":n=e.inputAreaLength-L.currentValueInset-e.currentValueMaxWidth,a="left";break;case"center":n=.5*e.inputAreaLength,a="middle";break;default:n=L.currentValueInset,a="left"}i.enter().append("text").classed(L.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":a,"data-notex":1});var o=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)o+=r;else{o+=e.steps[e.active].label}e.currentvalue.suffix&&(o+=e.currentvalue.suffix),i.call(M.font,e.currentvalue.font).text(o).call(T.convertToTspans,e.gd);var s=T.lineCount(i),l=(e.currentValueMaxLines+1-s)*e.currentvalue.font.size*S;return T.positionText(i,n,l),i}}function l(t,e,r){var n=t.selectAll("rect."+L.gripRectClass).data([0]);n.enter().append("rect").classed(L.gripRectClass,!0).call(d,e,t,r).style("pointer-events","all"),n.attr({width:L.gripWidth,height:L.gripHeight,rx:L.gripRadius,ry:L.gripRadius}).call(k.stroke,r.bordercolor).call(k.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function u(t,e,r){var n=t.selectAll("text").data([0]);return n.enter().append("text").classed(L.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1}),n.call(M.font,r.font).text(e.step.label).call(T.convertToTspans,r.gd),n}function c(t,e){var r=t.selectAll("g."+L.labelsClass).data([0]);r.enter().append("g").classed(L.labelsClass,!0);var n=r.selectAll("g."+L.labelGroupClass).data(e.labelSteps);n.enter().append("g").classed(L.labelGroupClass,!0),n.exit().remove(),n.each(function(t){var r=w.select(this);r.call(u,t,e),M.setTranslate(r,v(e,t.fraction),L.tickOffset+e.ticklen+e.font.size*S+L.labelOffset+e.currentValueTotalHeight)})}function f(t,e,r,n,a){var i=Math.round(n*(r.steps.length-1));i!==r.active&&h(t,e,r,i,!0,a)}function h(t,e,r,n,a,i){var o=r.active;r._input.active=r.active=n;var l=r.steps[r.active];e.call(m,r,r.active/(r.steps.length-1),i),e.call(s,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:a,previousActive:o}),l&&l.method&&a&&(e._nextMethod?(e._nextMethod.step=l,e._nextMethod.doCallback=a,e._nextMethod.doTransition=i):(e._nextMethod={step:l,doCallback:a,doTransition:i},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(r.execute&&A.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function d(t,e,r){function n(){return r.data()[0]}var a=r.node(),i=w.select(e);t.on("mousedown",function(){var t=n();e.emit("plotly_sliderstart",{slider:t});var o=r.select("."+L.gripRectClass);w.event.stopPropagation(),w.event.preventDefault(),o.call(k.fill,t.activebgcolor);var s=y(t,w.mouse(a)[0]);f(e,r,t,s,!0),t._dragging=!0,i.on("mousemove",function(){var t=n(),i=y(t,w.mouse(a)[0]);f(e,r,t,i,!1)}),i.on("mouseup",function(){var t=n();t._dragging=!1,o.call(k.fill,t.bgcolor),i.on("mouseup",null),i.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function p(t,e){var r=t.selectAll("rect."+L.tickRectClass).data(e.steps);r.enter().append("rect").classed(L.tickRectClass,!0), -r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each(function(t,r){var n=r%e.labelStride==0,a=w.select(this);a.attr({height:n?e.ticklen:e.minorticklen}).call(k.fill,e.tickcolor),M.setTranslate(a,v(e,r/(e.steps.length-1))-.5*e.tickwidth,(n?L.tickOffset:L.minorTickOffset)+e.currentValueTotalHeight)})}function g(t){t.labelSteps=[];for(var e=t.steps.length,r=0;r0&&(o=o.transition().duration(e.transition.duration).ease(e.transition.easing)),o.attr("transform","translate("+(i-.5*L.gripWidth)+","+e.currentValueTotalHeight+")")}}function v(t,e){return t.inputAreaStart+L.stepInset+(t.inputAreaLength-2*L.stepInset)*Math.min(1,Math.max(0,e))}function y(t,e){return Math.min(1,Math.max(0,(e-L.stepInset-t.inputAreaStart)/(t.inputAreaLength-2*L.stepInset-2*t.inputAreaStart)))}function b(t,e,r){var n=t.selectAll("rect."+L.railTouchRectClass).data([0]);n.enter().append("rect").classed(L.railTouchRectClass,!0).call(d,e,t,r).style("pointer-events","all"),n.attr({width:r.inputAreaLength,height:Math.max(r.inputAreaWidth,L.tickOffset+r.ticklen+r.labelHeight)}).call(k.fill,r.bgcolor).attr("opacity",0),M.setTranslate(n,0,r.currentValueTotalHeight)}function x(t,e){var r=t.selectAll("rect."+L.railRectClass).data([0]);r.enter().append("rect").classed(L.railRectClass,!0);var n=e.inputAreaLength-2*L.railInset;r.attr({width:n,height:L.railWidth,rx:L.railRadius,ry:L.railRadius,"shape-rendering":"crispEdges"}).call(k.stroke,e.bordercolor).call(k.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),M.setTranslate(r,L.railInset,.5*(e.inputAreaWidth-L.railWidth)+e.currentValueTotalHeight)}function _(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n0?[0]:[]);if(s.enter().append("g").classed(L.containerClassName,!0).style("cursor","ew-resize"),s.exit().remove(),s.exit().size()&&_(t),0!==r.length){var l=s.selectAll("g."+L.groupClassName).data(r,a);l.enter().append("g").classed(L.groupClassName,!0),l.exit().each(function(e){w.select(this).remove(),e._commandObserver.remove(),delete e._commandObserver,A.autoMargin(t,L.autoMarginIdRoot+e._index)});for(var u=0;u0||h<0){var g={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[_.side];e.attr("transform","translate("+g+")")}}}var m,v=r.propContainer,y=r.propName,b=r.traceIndex,x=r.dfltName,_=r.avoid||{},w=r.attributes,A=r.transform,k=r.containerGroup,M=t._fullLayout,T=v.titlefont.family,E=v.titlefont.size,L=v.titlefont.color,S=1,C=!1,I=v.title.trim();"title"===y?m="titleText":-1!==y.indexOf("axis")?m="axisTitleText":y.indexOf(!0)&&(m="colorbarTitleText");var O=t._context.edits[m];""===I&&(S=0),I.match(h)&&(S=.2,C=!0,O||(I=""));var R=I||O;k||(k=M._infolayer.selectAll(".g-"+e).data([0]),k.enter().append("g").classed("g-"+e,!0));var D=k.selectAll("text").data(R?[0]:[]);if(D.enter().append("text"),D.text(I).attr("class",e),D.exit().remove(),R){D.call(d);var P="Click to enter "+x+" title";O&&(I?D.on(".opacity",null):function(){S=0,C=!0,I=P,D.text(I).on("mouseover.opacity",function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)})}(),D.call(c.makeEditable,{gd:t}).on("edit",function(e){void 0!==b?i.restyle(t,y,e,b):i.relayout(t,y,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(d)}).on("input",function(t){this.text(t||" ").call(c.positionText,w.x,w.y)})),D.classed("js-placeholder",C)}}},{"../../constants/interactions":333,"../../lib":353,"../../lib/svg_text_utils":375,"../../plotly":391,"../../plots/plots":429,"../color":233,"../drawing":257,d3:62,"fast-isnumeric":68}],324:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l={_isLinkedToArray:"button",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}};e.exports=o({_isLinkedToArray:"updatemenu",_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons: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:i({},s,{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}},"arraydraw","from-root")},{"../../lib/extend":344,"../../plot_api/edit_types":380,"../../plots/font_attributes":420,"../../plots/pad_attributes":428,"../color/attributes":232}],325:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],326:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return i.coerce(t,e,s,r,n)}n("visible",a(t,e).length>0)&&(n("active"),n("direction"),n("type"),n("showactive"),n("x"),n("y"),i.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),i.coerceFont(n,"font",r.font),n("bgcolor",r.paper_bgcolor),n("bordercolor"),n("borderwidth"))}function a(t,e){function r(t,e){return i.coerce(n,a,c,t,e)}for(var n,a,o=t.buttons||[],s=e.buttons=[],l=0;l0?[0]:[]);if(i.enter().append("g").classed(S.containerClassName,!0).style("cursor","pointer"),i.exit().remove(),i.exit().size()&&_(t),0!==r.length){var c=i.selectAll("g."+S.headerGroupClassName).data(r,a);c.enter().append("g").classed(S.headerGroupClassName,!0);var f=i.selectAll("g."+S.dropdownButtonGroupClassName).data([0]);f.enter().append("g").classed(S.dropdownButtonGroupClassName,!0).style("pointer-events","all");for(var h=0;hA,T=n.barLength+2*n.barPad,E=n.barWidth+2*n.barPad,L=p,S=m+v;S+E>u&&(S=u-E);var C=this.container.selectAll("rect.scrollbar-horizontal").data(M?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,n.barColor),M?(this.hbar=C.attr({rx:n.barRadius,ry:n.barRadius,x:L,y:S,width:T,height:E}),this._hbarXMin=L+T/2,this._hbarTranslateMax=A-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var I=v>k,O=n.barWidth+2*n.barPad,R=n.barLength+2*n.barPad,D=p+g,P=m;D+O>l&&(D=l-O);var z=this.container.selectAll("rect.scrollbar-vertical").data(I?[0]:[]);z.exit().on(".drag",null).remove(),z.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,n.barColor),I?(this.vbar=z.attr({rx:n.barRadius,ry:n.barRadius,x:D,y:P,width:O,height:R}),this._vbarYMin=P+R/2,this._vbarTranslateMax=k-R):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var N=this.id,F=c-.5,B=I?f+O+.5:f+.5,j=h-.5,U=M?d+E+.5:d+.5,H=s._topdefs.selectAll("#"+N).data(M||I?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",N).append("rect"),M||I?(this._clipRect=H.select("rect").attr({x:Math.floor(F),y:Math.floor(j),width:Math.ceil(B)-Math.floor(F),height:Math.ceil(U)-Math.floor(j)}),this.container.call(o.setClipUrl,N),this.bg.attr({x:p,y:m,width:g,height:v})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),M||I){var V=a.behavior.drag().on("dragstart",function(){a.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var G=a.behavior.drag().on("dragstart",function(){a.event.sourceEvent.preventDefault(),a.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));M&&this.hbar.on(".drag",null).call(G),I&&this.vbar.on(".drag",null).call(G)}this.setTranslate(e,r)},n.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},n.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=a.event.dx),this.vbar&&(e-=a.event.dy),this.setTranslate(t,e)},n.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=a.event.deltaY),this.vbar&&(e+=a.event.deltaY),this.setTranslate(t,e)},n.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,n=r+this._hbarTranslateMax;t=(s.constrain(a.event.x,r,n)-r)/(n-r)*(this.position.w-this._box.w)}if(this.vbar){var i=e+this._vbarYMin,o=i+this._vbarTranslateMax;e=(s.constrain(a.event.y,i,o)-i)/(o-i)*(this.position.h-this._box.h)}this.setTranslate(t,e)},n.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=s.constrain(t||0,0,r),e=s.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(o.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var a=t/r;this.hbar.call(o.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var i=e/n;this.vbar.call(o.setTranslate,t,e+i*this._vbarTranslateMax)}}},{"../../lib":353,"../color":233,"../drawing":257,d3:62}],330:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},LINE_SPACING:1.3,MID_SHIFT:.35}},{}],331:[function(t,e,r){"use strict";e.exports={solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}},{}],332:[function(t,e,r){"use strict";for(var n=t("../lib/extend").extendFlat,a={circle:{unicode:"\u25cf"},square:{unicode:"\u25a0"},diamond:{unicode:"\u25c6"},cross:{unicode:"\u271a"},x:{unicode:"\u274c"},"triangle-up":{unicode:"\u25b2"},"triangle-down":{unicode:"\u25bc"},"triangle-left":{unicode:"\u25c4"},"triangle-right":{unicode:"\u25ba"},"triangle-ne":{unicode:"\u25e5"},"triangle-nw":{unicode:"\u25e4"},"triangle-se":{unicode:"\u25e2"},"triangle-sw":{unicode:"\u25e3"},pentagon:{unicode:"\u2b1f"},hexagon:{unicode:"\u2b22"},hexagon2:{unicode:"\u2b23"},star:{unicode:"\u2605"},"diamond-tall":{unicode:"\u2666"},bowtie:{unicode:"\u29d3"},"diamond-x":{unicode:"\u2756"},"cross-thin":{unicode:"+",noBorder:!0},asterisk:{unicode:"\u2733",noBorder:!0},"y-up":{unicode:"\u2144",noBorder:!0},"y-down":{unicode:"Y",noBorder:!0},"line-ew":{unicode:"\u2500",noBorder:!0},"line-ns":{unicode:"\u2502",noBorder:!0}},i={},o=Object.keys(a),s=0;s","#62":">",nbsp:"\xa0","#160":"\xa0",times:"\xd7","#215":"\xd7",plusmn:"\xb1","#177":"\xb1",deg:"\xb0","#176":"\xb0"}}},{}],336:[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}},{}],337:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.31.1",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/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":226,"./components/annotations3d":231,"./components/fx":274,"./components/images":282,"./components/legend":291,"./components/rangeselector":303,"./components/rangeslider":309,"./components/shapes":316,"./components/sliders":322,"./components/updatemenus":328,"./fonts/mathjax_config":338,"./lib/queue":366,"./plot_api/plot_schema":385,"./plot_api/register":386,"./plot_api/set_plot_config":387,"./plot_api/to_image":389,"./plot_api/validate":390,"./plotly":391,"./snapshot":441,"./snapshot/download":438,"./traces/scatter":502,d3:62,"es6-promise":66}],338:[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},{}],339:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../constants/numerical").BADNUM,i=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(i,"")),n(t)?Number(t):a}},{"../constants/numerical":334,"fast-isnumeric":68}],340:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("tinycolor2"),i=t("../plots/attributes"),o=t("../components/colorscale/get_scale"),s=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),l=t("./regex").counter;r.valObjectMeta={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),-1===n.values.indexOf(t)?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;na.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,a){t%1||!n(t)||void 0!==a.min&&ta.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var a="number"==typeof t;!0!==n.strict&&a?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){a(t).isValid()?e.set(t):e.set(r)}},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){if("string"==typeof t&&l(r).test(t))return void e.set(t);e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!l(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"!=typeof t)return void e.set(r);if(-1!==(n.extras||[]).indexOf(t))return void e.set(t);for(var a=t.split("+"),i=0;i0&&(o=o.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+o}return n}function l(t){return t.formatDate("yyyy")}function u(t){return t.formatDate("M yyyy")}function c(t){return t.formatDate("M d")}function f(t){return t.formatDate("M d, yyyy")} +r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each(function(t,r){var n=r%e.labelStride==0,a=w.select(this);a.attr({height:n?e.ticklen:e.minorticklen}).call(k.fill,e.tickcolor),M.setTranslate(a,v(e,r/(e.steps.length-1))-.5*e.tickwidth,(n?L.tickOffset:L.minorTickOffset)+e.currentValueTotalHeight)})}function g(t){t.labelSteps=[];for(var e=t.steps.length,r=0;r0&&(o=o.transition().duration(e.transition.duration).ease(e.transition.easing)),o.attr("transform","translate("+(i-.5*L.gripWidth)+","+e.currentValueTotalHeight+")")}}function v(t,e){return t.inputAreaStart+L.stepInset+(t.inputAreaLength-2*L.stepInset)*Math.min(1,Math.max(0,e))}function y(t,e){return Math.min(1,Math.max(0,(e-L.stepInset-t.inputAreaStart)/(t.inputAreaLength-2*L.stepInset-2*t.inputAreaStart)))}function b(t,e,r){var n=t.selectAll("rect."+L.railTouchRectClass).data([0]);n.enter().append("rect").classed(L.railTouchRectClass,!0).call(d,e,t,r).style("pointer-events","all"),n.attr({width:r.inputAreaLength,height:Math.max(r.inputAreaWidth,L.tickOffset+r.ticklen+r.labelHeight)}).call(k.fill,r.bgcolor).attr("opacity",0),M.setTranslate(n,0,r.currentValueTotalHeight)}function x(t,e){var r=t.selectAll("rect."+L.railRectClass).data([0]);r.enter().append("rect").classed(L.railRectClass,!0);var n=e.inputAreaLength-2*L.railInset;r.attr({width:n,height:L.railWidth,rx:L.railRadius,ry:L.railRadius,"shape-rendering":"crispEdges"}).call(k.stroke,e.bordercolor).call(k.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),M.setTranslate(r,L.railInset,.5*(e.inputAreaWidth-L.railWidth)+e.currentValueTotalHeight)}function _(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n0?[0]:[]);if(s.enter().append("g").classed(L.containerClassName,!0).style("cursor","ew-resize"),s.exit().remove(),s.exit().size()&&_(t),0!==r.length){var l=s.selectAll("g."+L.groupClassName).data(r,a);l.enter().append("g").classed(L.groupClassName,!0),l.exit().each(function(e){w.select(this).remove(),e._commandObserver.remove(),delete e._commandObserver,A.autoMargin(t,L.autoMarginIdRoot+e._index)});for(var u=0;u0||h<0){var g={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[_.side];e.attr("transform","translate("+g+")")}}}var m,v=r.propContainer,y=r.propName,b=r.traceIndex,x=r.dfltName,_=r.avoid||{},w=r.attributes,A=r.transform,k=r.containerGroup,M=t._fullLayout,T=v.titlefont.family,E=v.titlefont.size,L=v.titlefont.color,S=1,C=!1,I=v.title.trim();"title"===y?m="titleText":-1!==y.indexOf("axis")?m="axisTitleText":y.indexOf(!0)&&(m="colorbarTitleText");var O=t._context.edits[m];""===I&&(S=0),I.match(h)&&(S=.2,C=!0,O||(I=""));var R=I||O;k||(k=M._infolayer.selectAll(".g-"+e).data([0]),k.enter().append("g").classed("g-"+e,!0));var D=k.selectAll("text").data(R?[0]:[]);if(D.enter().append("text"),D.text(I).attr("class",e),D.exit().remove(),R){D.call(d);var P="Click to enter "+x+" title";O&&(I?D.on(".opacity",null):function(){S=0,C=!0,I=P,D.text(I).on("mouseover.opacity",function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)})}(),D.call(c.makeEditable,{gd:t}).on("edit",function(e){void 0!==b?i.restyle(t,y,e,b):i.relayout(t,y,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(d)}).on("input",function(t){this.text(t||" ").call(c.positionText,w.x,w.y)})),D.classed("js-placeholder",C)}}},{"../../constants/interactions":333,"../../lib":353,"../../lib/svg_text_utils":375,"../../plotly":391,"../../plots/plots":429,"../color":233,"../drawing":257,d3:62,"fast-isnumeric":68}],324:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l={_isLinkedToArray:"button",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}};e.exports=o({_isLinkedToArray:"updatemenu",_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons: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:i({},s,{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}},"arraydraw","from-root")},{"../../lib/extend":344,"../../plot_api/edit_types":380,"../../plots/font_attributes":420,"../../plots/pad_attributes":428,"../color/attributes":232}],325:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],326:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return i.coerce(t,e,s,r,n)}n("visible",a(t,e).length>0)&&(n("active"),n("direction"),n("type"),n("showactive"),n("x"),n("y"),i.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),i.coerceFont(n,"font",r.font),n("bgcolor",r.paper_bgcolor),n("bordercolor"),n("borderwidth"))}function a(t,e){function r(t,e){return i.coerce(n,a,c,t,e)}for(var n,a,o=t.buttons||[],s=e.buttons=[],l=0;l0?[0]:[]);if(i.enter().append("g").classed(S.containerClassName,!0).style("cursor","pointer"),i.exit().remove(),i.exit().size()&&_(t),0!==r.length){var c=i.selectAll("g."+S.headerGroupClassName).data(r,a);c.enter().append("g").classed(S.headerGroupClassName,!0);var f=i.selectAll("g."+S.dropdownButtonGroupClassName).data([0]);f.enter().append("g").classed(S.dropdownButtonGroupClassName,!0).style("pointer-events","all");for(var h=0;hA,T=n.barLength+2*n.barPad,E=n.barWidth+2*n.barPad,L=p,S=m+v;S+E>u&&(S=u-E);var C=this.container.selectAll("rect.scrollbar-horizontal").data(M?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,n.barColor),M?(this.hbar=C.attr({rx:n.barRadius,ry:n.barRadius,x:L,y:S,width:T,height:E}),this._hbarXMin=L+T/2,this._hbarTranslateMax=A-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var I=v>k,O=n.barWidth+2*n.barPad,R=n.barLength+2*n.barPad,D=p+g,P=m;D+O>l&&(D=l-O);var z=this.container.selectAll("rect.scrollbar-vertical").data(I?[0]:[]);z.exit().on(".drag",null).remove(),z.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,n.barColor),I?(this.vbar=z.attr({rx:n.barRadius,ry:n.barRadius,x:D,y:P,width:O,height:R}),this._vbarYMin=P+R/2,this._vbarTranslateMax=k-R):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var N=this.id,F=c-.5,B=I?f+O+.5:f+.5,j=h-.5,U=M?d+E+.5:d+.5,H=s._topdefs.selectAll("#"+N).data(M||I?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",N).append("rect"),M||I?(this._clipRect=H.select("rect").attr({x:Math.floor(F),y:Math.floor(j),width:Math.ceil(B)-Math.floor(F),height:Math.ceil(U)-Math.floor(j)}),this.container.call(o.setClipUrl,N),this.bg.attr({x:p,y:m,width:g,height:v})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),M||I){var V=a.behavior.drag().on("dragstart",function(){a.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var G=a.behavior.drag().on("dragstart",function(){a.event.sourceEvent.preventDefault(),a.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));M&&this.hbar.on(".drag",null).call(G),I&&this.vbar.on(".drag",null).call(G)}this.setTranslate(e,r)},n.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},n.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=a.event.dx),this.vbar&&(e-=a.event.dy),this.setTranslate(t,e)},n.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=a.event.deltaY),this.vbar&&(e+=a.event.deltaY),this.setTranslate(t,e)},n.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,n=r+this._hbarTranslateMax;t=(s.constrain(a.event.x,r,n)-r)/(n-r)*(this.position.w-this._box.w)}if(this.vbar){var i=e+this._vbarYMin,o=i+this._vbarTranslateMax;e=(s.constrain(a.event.y,i,o)-i)/(o-i)*(this.position.h-this._box.h)}this.setTranslate(t,e)},n.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=s.constrain(t||0,0,r),e=s.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(o.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var a=t/r;this.hbar.call(o.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var i=e/n;this.vbar.call(o.setTranslate,t,e+i*this._vbarTranslateMax)}}},{"../../lib":353,"../color":233,"../drawing":257,d3:62}],330:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},LINE_SPACING:1.3,MID_SHIFT:.35}},{}],331:[function(t,e,r){"use strict";e.exports={solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}},{}],332:[function(t,e,r){"use strict";for(var n=t("../lib/extend").extendFlat,a={circle:{unicode:"\u25cf"},square:{unicode:"\u25a0"},diamond:{unicode:"\u25c6"},cross:{unicode:"\u271a"},x:{unicode:"\u274c"},"triangle-up":{unicode:"\u25b2"},"triangle-down":{unicode:"\u25bc"},"triangle-left":{unicode:"\u25c4"},"triangle-right":{unicode:"\u25ba"},"triangle-ne":{unicode:"\u25e5"},"triangle-nw":{unicode:"\u25e4"},"triangle-se":{unicode:"\u25e2"},"triangle-sw":{unicode:"\u25e3"},pentagon:{unicode:"\u2b1f"},hexagon:{unicode:"\u2b22"},hexagon2:{unicode:"\u2b23"},star:{unicode:"\u2605"},"diamond-tall":{unicode:"\u2666"},bowtie:{unicode:"\u29d3"},"diamond-x":{unicode:"\u2756"},"cross-thin":{unicode:"+",noBorder:!0},asterisk:{unicode:"\u2733",noBorder:!0},"y-up":{unicode:"\u2144",noBorder:!0},"y-down":{unicode:"Y",noBorder:!0},"line-ew":{unicode:"\u2500",noBorder:!0},"line-ns":{unicode:"\u2502",noBorder:!0}},i={},o=Object.keys(a),s=0;s","#62":">",nbsp:"\xa0","#160":"\xa0",times:"\xd7","#215":"\xd7",plusmn:"\xb1","#177":"\xb1",deg:"\xb0","#176":"\xb0"}}},{}],336:[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}},{}],337:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.31.2",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/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":226,"./components/annotations3d":231,"./components/fx":274,"./components/images":282,"./components/legend":291,"./components/rangeselector":303,"./components/rangeslider":309,"./components/shapes":316,"./components/sliders":322,"./components/updatemenus":328,"./fonts/mathjax_config":338,"./lib/queue":366,"./plot_api/plot_schema":385,"./plot_api/register":386,"./plot_api/set_plot_config":387,"./plot_api/to_image":389,"./plot_api/validate":390,"./plotly":391,"./snapshot":441,"./snapshot/download":438,"./traces/scatter":502,d3:62,"es6-promise":66}],338:[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},{}],339:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../constants/numerical").BADNUM,i=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(i,"")),n(t)?Number(t):a}},{"../constants/numerical":334,"fast-isnumeric":68}],340:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("tinycolor2"),i=t("../plots/attributes"),o=t("../components/colorscale/get_scale"),s=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),l=t("./regex").counter;r.valObjectMeta={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),-1===n.values.indexOf(t)?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;na.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,a){t%1||!n(t)||void 0!==a.min&&ta.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var a="number"==typeof t;!0!==n.strict&&a?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){a(t).isValid()?e.set(t):e.set(r)}},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){if("string"==typeof t&&l(r).test(t))return void e.set(t);e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!l(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"!=typeof t)return void e.set(r);if(-1!==(n.extras||[]).indexOf(t))return void e.set(t);for(var a=t.split("+"),i=0;i0&&(o=o.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+o}return n}function l(t){return t.formatDate("yyyy")}function u(t){return t.formatDate("M yyyy")}function c(t){return t.formatDate("M d")}function f(t){return t.formatDate("M d, yyyy")} var h=t("d3"),d=t("fast-isnumeric"),p=t("./loggers").error,g=t("./mod"),m=t("../constants/numerical"),v=m.BADNUM,y=m.ONEDAY,b=m.ONEHOUR,x=m.ONEMIN,_=m.ONESEC,w=m.EPOCHJD,A=t("../registry"),k=h.time.format.utc,M=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,T=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,E=(new Date).getFullYear()-70;r.dateTick0=function(t,e){return n(t)?e?A.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:A.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},r.dfltRange=function(t){return n(t)?A.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},r.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime};var L,S;r.dateTime2ms=function(t,e){if(r.isJSDate(t))return t=Number(t)-t.getTimezoneOffset()*x,t>=L&&t<=S?t:v;if("string"!=typeof t&&"number"!=typeof t)return v;t=String(t);var a=n(e),i=t.charAt(0);!a||"G"!==i&&"g"!==i||(t=t.substr(1),e="");var o=a&&"chinese"===e.substr(0,7),s=t.match(o?T:M);if(!s)return v;var l=s[1],u=s[3]||"1",c=Number(s[5]||1),f=Number(s[7]||0),h=Number(s[9]||0),d=Number(s[11]||0);if(a){if(2===l.length)return v;l=Number(l);var p;try{var g=A.getComponentMethod("calendars","getCal")(e);if(o){var m="i"===u.charAt(u.length-1);u=parseInt(u,10),p=g.newDate(l,g.toMonthIndex(l,u,m),c)}else p=g.newDate(l,Number(u),c)}catch(t){return v}return p?(p.toJD()-w)*y+f*b+h*x+d*_:v}l=2===l.length?(Number(l)+2e3-E)%100+E:Number(l),u-=1;var k=new Date(Date.UTC(2e3,u,c,f,h));return k.setUTCFullYear(l),k.getUTCMonth()!==u?v:k.getUTCDate()!==c?v:k.getTime()+d*_},L=r.MIN_MS=r.dateTime2ms("-9999"),S=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==v};var C=90*y,I=3*b,O=5*x;r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=L&&t<=S))return v;e||(e=0);var a,o,s,l,u,c,f=Math.floor(10*g(t+.05,1)),h=Math.round(t-f/10);if(n(r)){var d=Math.floor(h/y)+w,p=Math.floor(g(t,y));try{a=A.getComponentMethod("calendars","getCal")(r).fromJD(d).formatDate("yyyy-mm-dd")}catch(t){a=k("G%Y-%m-%d")(new Date(h))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;o=e=L+y&&t<=S-y))return v;var e=Math.floor(10*g(t+.05,1)),r=new Date(Math.round(t-e/10));return i(h.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,a){if(r.isJSDate(t)||"number"==typeof t){if(n(a))return p("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,a))return p("unrecognized date",t),e;return t};var R=/%\d?f/g,D=[59,59.9,59.99,59.999,59.9999],P=k("%Y"),z=k("%b %Y"),N=k("%b %-d"),F=k("%b %-d, %Y");r.formatDate=function(t,e,r,a){var i,h;if(a=n(a)&&a,e)return o(e,t,a);if(a)try{var d=Math.floor((t+.05)/y)+w,p=A.getComponentMethod("calendars","getCal")(a).fromJD(d);"y"===r?h=l(p):"m"===r?h=u(p):"d"===r?(i=l(p),h=c(p)):(i=f(p),h=s(t,r))}catch(t){return"Invalid"}else{var g=new Date(Math.floor(t+.05));"y"===r?h=P(g):"m"===r?h=z(g):"d"===r?(i=P(g),h=N(g)):(i=F(g),h=s(t,r))}return h+(i?"\n"+i:"")};var B=3*y;r.incrementMonth=function(t,e,r){r=n(r)&&r;var a=g(t,y);if(t=Math.round(t-a),r)try{var i=Math.round(t/y)+w,o=A.getComponentMethod("calendars","getCal")(r),s=o.fromJD(i);return e%12?o.add(s,e,"m"):o.add(s,e/12,"y"),(s.toJD()-w)*y+a}catch(e){p("invalid ms "+t+" in calendar "+r)}var l=new Date(t+B);return l.setUTCMonth(l.getUTCMonth()+e)+a-B},r.findExactDates=function(t,e){for(var r,a,i=0,o=0,s=0,l=0,u=n(e)&&A.getComponentMethod("calendars","getCal")(e),c=0;c1||g<0||g>1?null:{x:t+l*g,y:e+f*g}}function a(t,e,r,n,a){var i=n*t+a*e;if(i<0)return n*n+a*a;if(i>r){var o=n-t,s=a-e;return o*o+s*s}var l=n*e-a*t;return l*l/r}var i=t("./mod");r.segmentsIntersect=n,r.segmentDistance=function(t,e,r,i,o,s,l,u){if(n(t,e,r,i,o,s,l,u))return 0;var c=r-t,f=i-e,h=l-o,d=u-s,p=c*c+f*f,g=h*h+d*d,m=Math.min(a(c,f,p,o-t,s-e),a(c,f,p,l-t,u-e),a(h,d,g,t-o,e-s),a(h,d,g,r-o,i-s));return Math.sqrt(m)};var o,s,l;r.getTextLocation=function(t,e,r,n){if(t===s&&n===l||(o={},s=t,l=n),o[r])return o[r];var a=t.getPointAtLength(i(r-n/2,e)),u=t.getPointAtLength(i(r+n/2,e)),c=Math.atan((u.y-a.y)/(u.x-a.x)),f=t.getPointAtLength(i(r,e)),h=(4*f.x+a.x+u.x)/6,d=(4*f.y+a.y+u.y)/6,p={x:h,y:d,theta:c};return o[r]=p,p},r.clearLocationCache=function(){s=null},r.getVisibleSegment=function(t,e,r){function n(e){var r=t.getPointAtLength(e);0===e?a=r:e===f&&(i=r);var n=r.xs?r.x-s:0,c=r.yu?r.y-u:0;return Math.sqrt(n*n+c*c)}for(var a,i,o=e.left,s=e.right,l=e.top,u=e.bottom,c=0,f=t.getTotalLength(),h=f,d=n(c);d;){if((c+=d+r)>h)return;d=n(c)}for(d=n(h);d;){if(h-=d+r,c>h)return;d=n(h)}return{min:c,max:h,len:h-c,total:f,isClosed:0===c&&h===f&&Math.abs(a.x-i.x)<.1&&Math.abs(a.y-i.y)<.1}}},{"./mod":359}],348:[function(t,e,r){"use strict";e.exports=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t}},{}],349:[function(t,e,r){"use strict";function n(t,e){var r=t;return r[3]*=e,r}function a(t){if(s(t))return f;var e=l(t);return e.length?e:f}function i(t){return s(t)?t:h}function o(t,e,r){var o,s,c,d,p,g=t.color,m=Array.isArray(g),v=Array.isArray(e),y=[];if(o=void 0!==t.colorscale?u.makeColorScaleFunc(u.extractScale(t.colorscale,t.cmin,t.cmax)):a,s=m?function(t,e){return void 0===t[e]?f:l(o(t[e]))}:a,c=v?function(t,e){return void 0===t[e]?h:i(t[e])}:i,m||v)for(var b=0;b",e))>=0;){var r=t.indexOf("",e);if(r/g,"\n")}function i(t){return t.replace(/\<.*\>/g,"")}function o(t){for(var e=u.entityToUnicode,r=0;(r=t.indexOf("&",r))>=0;){var n=t.indexOf(";",r);if(no?s:a(t)?Number(t):s):s},l.noop=t("./noop"),l.identity=t("./identity"),l.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var a=0;ar?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},l.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},l.simpleMap=function(t,e,r,n){for(var a=t.length,i=new Array(a),o=0;o-1||c!==1/0&&c>=Math.pow(2,r)?t(e,r,n):l},l.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},l.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,a,i,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(r=0;r=s&&(a-=s*Math.floor(a/s)),a<0?a=-1-a:a>=o&&(a=s-1-a),i+=t[a]*u[n];c[r]=i}return c},l.syncOrAsync=function(t,e,r){function n(){return l.syncOrAsync(t,e,r)}for(var a,i;t.length;)if(i=t.splice(0,1)[0],(a=i(e))&&a.then)return a.then(n).then(void 0,l.promiseError);return r&&r(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,r){if(t){var n,a,i=!1,o=!0;for(n=0;n1?a+o[1]:"";if(i&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+i+"$2");return s+l};var _=/%{([^\s%{}]*)}/g,w=/^\w*$/;l.templateString=function(t,e){var r={};return t.replace(_,function(t,n){return w.test(n)?e[n]||"":(r[n]=r[n]||l.nestedProperty(e,n).get,r[n]()||"")})}},{"../constants/numerical":334,"./clean_number":339,"./coerce":340,"./dates":341,"./ensure_array":342,"./extend":344,"./filter_unique":345,"./filter_visible":346,"./geometry2d":347,"./get_graph_div":348,"./identity":352,"./is_array":354,"./is_plain_object":355,"./keyed_container":356,"./loggers":357,"./matrix":358,"./mod":359,"./nested_property":360,"./noop":361,"./notifier":362,"./push_unique":365,"./regex":367,"./relative_attr":368,"./relink_private":369,"./search":370,"./stats":373,"./throttle":376,"./to_log_range":377,d3:62,"fast-isnumeric":68}],354:[function(t,e,r){"use strict";var n="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}};e.exports=function(t){return Array.isArray(t)||n.isView(t)}},{}],355:[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}},{}],356:[function(t,e,r){"use strict";var n=t("./nested_property"),a=/^\w*$/;e.exports=function(t,e,r,i){r=r||"name",i=i||"value";var o,s,l={};s=e&&e.length?n(t,e).get():t,e=e||"",s=s||[];var u={};for(o=0;o2)return l[e]=2|l[e],f.set(t,null);if(c){for(o=e;o1){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][0],i=t[e][1],l=!1,d(n))for(r=n.length-1;r>=0;r--)a(n[r],o(i,r))?l?n[r]=void 0:n.pop():l=!0;else if("object"==typeof n&&null!==n)for(s=Object.keys(n),l=!1,r=s.length-1;r>=0;r--)a(n[s[r]],o(i,s[r]))?delete n[s[r]]:l=!0;if(l)return}}function c(t){return void 0===t||null===t||"object"==typeof t&&(d(t)?!t.length:!Object.keys(t).length)}function f(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}var h=t("fast-isnumeric"),d=t("./is_array"),p=t("./is_plain_object"),g=t("../plot_api/container_array_match");e.exports=function(t,e){if(h(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,a,o,s=0,l=e.split(".");s/g),s=0;so||n===a||nl)&&(!e||!c(t))}function r(t,e){var r=t[0],u=t[1];if(r===a||ro||u===a||ul)return!1;var c,f,h,d,p,g=n.length,m=n[0][0],v=n[0][1],y=0;for(c=1;cMath.max(f,m)||u>Math.max(h,v)))if(uc||Math.abs(n(o,h))>a)return!0;return!1};i.filter=function(t,e){function r(r){t.push(r);var s=n.length,l=a;n.splice(i+1);for(var u=l+1;u1){r(t.pop())}return{addPt:r,raw:t,filtered:n}}},{"../constants/numerical":334,"./matrix":358}],365:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){var r,n=e.toString();for(r=0;ri.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--)},o.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},o.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},o.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 o(t,e){return t>=e}var s=t("fast-isnumeric"),l=t("./loggers");r.findBin=function(t,e,r){if(s(e.start))return r?Math.ceil((t-e.start)/e.size)-1:Math.floor((t-e.start)/e.size);var u,c,f=0,h=e.length,d=0;for(c=e[e.length-1]>=e[0]?r?n:a:r?o:i;f90&&l.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e=t.slice();e.sort(r.sorterAsc);for(var n=e.length-1,a=e[n]-e[0]||1,i=a/(n||1)/1e4,o=[e[0]],s=0;se[s]+i&&(a=Math.min(a,e[s+1]-e[s]),o.push(e[s+1]));return{vals:o,minDiff:a}},r.roundUp=function(t,e,r){for(var n,a=0,i=e.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;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":68}],374:[function(t,e,r){"use strict";function n(t){var e=a(t);return e.length?e:[0,0,0,1]}var a=t("color-rgba");e.exports=n},{"color-rgba":54}],375:[function(t,e,r){"use strict";function n(t,e){return t.node().getBoundingClientRect()[e]}function a(t){return t.replace(v,"\\lt ").replace(y,"\\gt ")}function i(t,e,r){var n="math-output-"+h.randstr([],64),i=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,i.node()],function(){var e=f.select("body").select("#MathJax_SVG_glyphs");if(i.select(".MathJax_SVG").empty()||!i.select("svg").node())h.log("There was an error in the tex syntax.",t),r();else{var n=i.select("svg").node().getBoundingClientRect();r(i.select(".MathJax_SVG"),e,n)}i.remove()})}function o(t,e){if(!t)return null;var r=t.match(e);return r&&(r[3]||r[4])}function s(t,e){if(!t)return"";for(var r=0;r1)for(var a=1;a.",e);var r=u.pop();t!==r.type&&h.log("Start tag <"+r.type+"> doesnt match end tag <"+t+">. Pretending it did match.",e),i=u[u.length-1].node}(k);else{var P=y[4],z={type:k},N=o(P,C);if(N?(N=N.replace(D,"$1 fill:"),M&&(N+=";"+M)):M&&(N=M),N&&(z.style=N),"a"===k){s=!0;var F=o(P,I);if(F){var B=document.createElement("a");B.href=F,-1!==A.indexOf(B.protocol)&&(z.href=encodeURI(F),z.target=o(P,O)||"_blank",z.popup=o(P,R))}}n(z)}}return s}function c(t,e,r){var n,a,i,o=r.horizontalAlign,s=r.verticalAlign||"top",l=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return a="bottom"===s?function(){return l.bottom-n.height}:"middle"===s?function(){return l.top+(l.height-n.height)/2}:function(){return l.top},i="right"===o?function(){return l.right-n.width}:"center"===o?function(){return l.left+(l.width-n.width)/2}:function(){return l.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:a()-u.top+"px",left:i()-u.left+"px","z-index":1e3}),this}}var f=t("d3"),h=t("../lib"),d=t("../constants/xmlns_namespaces"),p=t("../constants/string_mappings"),g=t("../constants/alignment").LINE_SPACING,m=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,a){function o(){c.empty()||(h=t.attr("class")+"-math",c.select("svg."+h).remove()),t.text("").style("white-space","pre"),u(t.node(),s)&&t.style("pointer-events","all"),r.positionText(t),a&&a.call(t)}var s=t.text(),l=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&s.match(m),c=f.select(t.node().parentNode);if(!c.empty()){var h=t.attr("class")?t.attr("class").split(" ")[0]:"text";return h+="-math",c.selectAll("svg."+h).remove(),c.selectAll("g."+h+"-group").remove(),t.style("display",null).attr({"data-unformatted":s,"data-math":"N"}),l?(e&&e._promises||[]).push(new Promise(function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10);i(l[2],{fontSize:r},function(i,l,u){c.selectAll("svg."+h).remove(),c.selectAll("g."+h+"-group").remove();var f=i&&i.select("svg");if(!f||!f.node())return o(),void e();var d=c.append("g").classed(h+"-group",!0).attr({"pointer-events":"none","data-unformatted":s,"data-math":"Y"});d.node().appendChild(f.node()),l&&l.node()&&f.node().insertBefore(l.node().cloneNode(!0),f.node().firstChild),f.attr({class:h,height:u.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var p=t.node().style.fill||"black";f.select("g").attr({fill:p,stroke:p});var g=n(f,"width"),m=n(f,"height"),v=+t.attr("x")-g*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],y=r||n(t,"height"),b=-y/4;"y"===h[0]?(d.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-g/2,b-m/2]+")"}),f.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===h[0]?f.attr({x:t.attr("x"),y:b-m/2}):"a"===h[0]?f.attr({x:0,y:b}):f.attr({x:v,y:+t.attr("y")+b-m/2}),a&&a.call(t,d),e(d)})})):o(),t}};var v=/(<|<|<)/g,y=/(>|>|>)/g,b={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},x={sub:"0.3em",sup:"-0.6em"},_={sub:"-0.21em",sup:"0.42em"},w="\u200b",A=["http:","https:","mailto:","",void 0,":"],k=new RegExp("]*)?/?>","g"),M=Object.keys(p.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:p.entityToUnicode[t]}}),T=/(\r\n?|\n)/g,E=/(<[^<>]*>)/,L=/<(\/?)([^ >]*)(\s+(.*))?>/i,S=//i,C=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,I=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,O=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,R=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i,D=/(^|;)\s*color:/;r.plainText=function(t){return(t||"").replace(k," ")},r.lineCount=function(t){return t.selectAll("tspan.line").size()||1},r.positionText=function(t,e,r){return t.each(function(){function t(t,e){return void 0===e?null===(e=n.attr(t))&&(n.attr(t,0),e=0):n.attr(t,e),e}var n=f.select(this),a=t("x",e),i=t("y",r);"text"===this.nodeName&&n.selectAll("tspan.line").attr({x:a,y:i})})},r.makeEditable=function(t,e){function r(){a(),t.style({opacity:0});var e,r=l.attr("class");(e=r?"."+r.split(" ")[0]+"-math-group":"[class*=-math-group]")&&f.select(t.node().parentNode).select(e).style({opacity:0})}function n(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}function a(){var r=f.select(i),a=r.select(".svg-container"),o=a.append("div"),l=t.node().style,u=parseFloat(l.fontSize||12);o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":l.fontFamily||"Arial","font-size":u,color:e.fill||l.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-u/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(e.text||t.attr("data-unformatted")).call(c(t,a,e)).on("blur",function(){i._editing=!1,t.text(this.textContent).style({opacity:1});var e,r=f.select(this).attr("class");(e=r?"."+r.split(" ")[0]+"-math-group":"[class*=-math-group]")&&f.select(t.node().parentNode).select(e).style({opacity:0});var n=this.textContent;f.select(this).transition().duration(0).remove(),f.select(document).on("mouseup",null),s.edit.call(t,n)}).on("focus",function(){var t=this;i._editing=!0,f.select(document).on("mouseup",function(){if(f.event.target===t)return!1;document.activeElement===o.node()&&o.node().blur()})}).on("keyup",function(){27===f.event.which?(i._editing=!1,t.style({opacity:1}),f.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),s.cancel.call(t,this.textContent)):(s.input.call(t,this.textContent),f.select(this).call(c(t,a,e)))}).on("keydown",function(){13===f.event.which&&this.blur()}).call(n)}var i=e.gd,o=e.delegate,s=f.dispatch("edit","input","cancel"),l=o||t;if(t.style({"pointer-events":o?"none":"all"}),1!==t.size())throw new Error("boo");return e.immediate?r():l.on("click",r),f.rebind(t,s,"on")}},{"../constants/alignment":330,"../constants/string_mappings":335,"../constants/xmlns_namespaces":336,"../lib":353,d3:62}],376:[function(t,e,r){"use strict";function n(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}var a={};r.throttle=function(t,e,r){function i(){r(),o.ts=Date.now(),o.onDone&&(o.onDone(),o.onDone=null)}var o=a[t],s=Date.now();if(!o){for(var l in a)a[l].tso.ts+e)return void i();o.timer=setTimeout(function(){i(),o.timer=null},e)},r.done=function(t){var e=a[t];return e&&e.timer?new Promise(function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}}):Promise.resolve()},r.clear=function(t){if(t)n(a[t]),delete a[t];else for(var e in a)r.clear(e)}},{}],377:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},{"fast-isnumeric":68}],378:[function(t,e,r){"use strict";function n(t,e){for(var r=new Float32Array(e),n=0;n0)return t.substr(0,e)}var s=t("fast-isnumeric"),l=t("gl-mat4/fromQuat"),u=t("../registry"),c=t("../lib"),f=t("../plots/plots"),h=t("../plots/cartesian/axes"),d=t("../components/color");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=h.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=f.getSubplotIds(t,"gl3d");for(e=0;e1&&o.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(c(y))e.set(null);else{if(!Array.isArray(y))return o.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!g&&(h(m,v),d(t),!0)}var b,x,_,w,A,k,M,T=Object.keys(r).map(Number).sort(s),E=e.get(),L=E||[],S=n(v,f).get(),C=[],I=-1,O=L.length;for(b=0;bL.length-(M?0:1))o.warn("index out of range",f,_);else if(void 0!==k)A.length>1&&o.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(k)?C.push(_):M?("add"===k&&(k={}),L.splice(_,0,k),S&&S.splice(_,0,{})):o.warn("Unrecognized full object edit value",f,_,k),-1===I&&(I=_);else for(x=0;x=0;b--)L.splice(C[b],1),S&&S.splice(C[b],1);if(L.length?E||e.set(L):e.set(null),g)return!1;if(h(m,v),p!==i){var R;if(-1===I)R=T;else{for(O=Math.max(L.length,O),R=[],b=0;b=I);b++)R.push(_);for(b=I;b=t.data.length||a<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(a,n+1)>-1||a>=0&&e.indexOf(-t.data.length+a)>-1||a<0&&e.indexOf(t.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function u(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),l(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&l(t,r,"newIndices"),void 0!==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(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&lX.range[0]?[1,2]:[2,1]);else{var Z=X.range[0],Q=X.range[1] ;Y?(Z<=0&&Q<=0&&r(D+".autorange",!0),Z<=0?Z=Q/1e6:Q<=0&&(Q=Z/1e6),r(D+".range[0]",Math.log(Z)/Math.LN10),r(D+".range[1]",Math.log(Q)/Math.LN10)):(r(D+".range[0]",Math.pow(10,Z)),r(D+".range[1]",Math.pow(10,Q)))}else r(D+".autorange",!0);M.getComponentMethod("annotations","convertCoords")(t,j,S,r),M.getComponentMethod("images","convertCoords")(t,j,S,r)}else r(D+".autorange",!0),r(D+".range",null);w.nestedProperty(u,D+"._inputRange").set(null)}else if(O.match(B.AX_NAME_PATTERN)){var $=w.nestedProperty(u,k).get(),K=(S||{}).type;K&&"-"!==K||(K="linear"),M.getComponentMethod("annotations","convertCoords")(t,$,K,r),M.getComponentMethod("images","convertCoords")(t,$,K,r)}var J=P.containerArrayMatch(k);if(J){i=J.array,o=J.index;var tt=J.property,et=w.nestedProperty(l,i),rt=(et||[])[o]||{},nt=rt,at=H||{editType:"calc"},it=-1!==at.editType.indexOf("calcIfAutorange");""===o?(it?y.calc=!0:F.update(y,at),it=!1):""===tt&&(nt=S,P.isAddVal(S)?x[k]=null:P.isRemoveVal(S)?(x[k]=rt,nt=rt):w.warn("unrecognized full object value",e)),it&&(n(nt,"x")||n(nt,"y"))?y.calc=!0:F.update(y,at),h[i]||(h[i]={});var ot=h[i][o];ot||(ot=h[i][o]={}),ot[tt]=S,delete e[k]}else"reverse"===O?(N.range?N.range.reverse():(r(D+".autorange",!0),N.range=[1,0]),j.autorange?y.calc=!0:y.plot=!0):((!u._has("gl2d")||"dragmode"!==k||"lasso"!==S&&"select"!==S||"lasso"===U||"select"===U)&&H?F.update(y,H):y.calc=!0,L.set(S))}}for(i in h){P.applyContainerArrayChanges(t,w.nestedProperty(l,i),h[i],y)||(y.plot=!0)}var st=u._axisConstraintGroups;for(v in A)for(o=0;o=s.length?s[0]:s[t]:s}function a(t){return Array.isArray(l)?t>=l.length?l[0]:l[t]:l}function i(t,e){var r=0;return function(){if(t&&++r===e)return t()}}if(t=w.getGraphDiv(t),!w.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 o=t._transitionData;o._frameQueue||(o._frameQueue=[]),r=E.supplyAnimationDefaults(r);var s=r.transition,l=r.frame;return void 0===o._frameWaitingCnt&&(o._frameWaitingCnt=0),new Promise(function(l,u){function c(){t.emit("plotly_animated"),window.cancelAnimationFrame(o._animationRaf),o._animationRaf=null}function f(){o._currentFrame&&o._currentFrame.onComplete&&o._currentFrame.onComplete();var e=o._currentFrame=o._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,o._lastFrameAt=Date.now(),o._timeToNext=e.frameOpts.duration,E.transition(t,e.frame.data,e.frame.layout,z.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then(function(){e.onComplete&&e.onComplete()}),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else c()}function h(){t.emit("plotly_animating"),o._lastFrameAt=-1/0,o._timeToNext=0,o._runningTransitions=0,o._currentFrame=null;var e=function(){o._animationRaf=window.requestAnimationFrame(e),Date.now()-o._lastFrameAt>o._timeToNext&&f()};e()}function d(t){return Array.isArray(s)?m>=s.length?t.transitionOpts=s[m]:t.transitionOpts=s[0]:t.transitionOpts=s,m++,t}var p,g,m=0,v=[],y=void 0===e||null===e,b=Array.isArray(e);if(y||b||!w.isPlainObject(e)){if(y||-1!==["string","number"].indexOf(typeof e))for(p=0;p0&&AA)&&k.push(g);v=k}}v.length>0?function(e){if(0!==e.length){for(var s=0;s=0;a--)if(w.isPlainObject(e[a])){var h=(u[e[a].name]||{}).name,d=e[a].name;h&&d&&"number"==typeof d&&u[h]&&(n++,w.warn('addFrames: overwriting frame "'+u[h].name+'" with a frame whose name of type "number" also equates to "'+h+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),n>5&&w.warn("addFrames: This API call has yielded too many warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),f.push({frame:E.supplyFrameDefaults(e[a]),index:r&&void 0!==r[a]&&null!==r[a]?r[a]:c+a})}f.sort(function(t,e){return t.index>e.index?-1:t.index=0;a--){if(i=f[a].frame,"number"==typeof i.name&&w.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!i.name)for(;u[i.name="frame "+t._transitionData._counter++];);if(u[i.name]){for(o=0;o=0;r--)n=e[r],i.push({type:"delete",index:n}),o.unshift({type:"insert",index:n,value:a[n]});var s=E.modifyFrames,l=E.modifyFrames,u=[t,o],c=[t,i];return k&&k.add(t,s,u,l,c),E.modifyFrames(t,i)},_.purge=function(t){t=w.getGraphDiv(t);var e=t._fullLayout||{},r=t._fullData||[];return E.cleanPlot([],{},r,e),E.purge(t),A.purge(t),e._container&&e._container.remove(),delete t._context,t}},{"../components/color":233,"../components/drawing":257,"../components/errorbars":263,"../constants/xmlns_namespaces":336,"../lib":353,"../lib/events":343,"../lib/queue":366,"../lib/svg_text_utils":375,"../plotly":391,"../plots/cartesian/axis_ids":399,"../plots/cartesian/constants":401,"../plots/cartesian/constraints":403,"../plots/cartesian/graph_interact":405,"../plots/plots":429,"../plots/polar":432,"../registry":436,"./edit_types":380,"./helpers":381,"./manage_arrays":382,"./plot_schema":385,"./subroutines":388,d3:62,"fast-isnumeric":68,"has-hover":149}],384:[function(t,e,r){"use strict";e.exports={staticPlot:!1,editable:!1,edits:{annotationPosition:!1,annotationTail:!1,annotationText:!1,axisTitleText:!1,colorbarPosition:!1,colorbarTitleText:!1,legendPosition:!1,legendText:!1,shapePosition:!1,titleText:!1},autosizable:!1,queueLength:0,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showAxisDragHandles:!0,showAxisRangeEntryBoxes:!0,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:"transparent",topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:!1,globalTransforms:[]}},{}],385:[function(t,e,r){"use strict";function n(t,e){var r,n,a,i,o=t._basePlotModules;if(o){var s;for(r=0;r=t.items.length)return!1;t=t.items[a]}}return t}function i(t){return t===Math.round(t)&&t>=0}function o(t){var e,r;"area"===t?(e={attributes:w},r={}):(e=m.modules[t]._module,r=e.basePlotModule);var n={};n.type=null,T(n,y),T(n,e.attributes),r.attributes&&T(n,r.attributes),n.type=t;var a={meta:e.meta||{},attributes:c(n)};if(e.layoutAttributes){var i={};T(i,e.layoutAttributes),a.layoutAttributes=c(i)}return a}function s(){var t,e,r={};T(r,b);for(t in m.subplotsRegistry)if(e=m.subplotsRegistry[t],e.layoutAttributes)if("cartesian"===e.name)p(r,e,"xaxis"),p(r,e,"yaxis");else{var n="subplot"===e.attr?e.name:e.attr;p(r,e,n)}r=d(r);for(t in m.componentsRegistry){e=m.componentsRegistry[t];var a=e.schema;if(a&&(a.subplots||a.layout)){var i=a.subplots;if(i&&i.xaxis&&!i.yaxis)for(var o in i.xaxis)delete r.yaxis[o]}else e.layoutAttributes&&g(r,e.layoutAttributes,e.name)}return{layoutAttributes:c(r)}}function l(t){var e=m.transformsRegistry[t],r=T({},e.attributes);return Object.keys(m.componentsRegistry).forEach(function(e){var n=m.componentsRegistry[e];n.schema&&n.schema.transforms&&n.schema.transforms[t]&&Object.keys(n.schema.transforms[t]).forEach(function(e){g(r,n.schema.transforms[t][e],e)})}),{attributes:c(r)}}function u(){var t={frames:v.extendDeepAll({},x)};return c(t),t.frames}function c(t){return f(t),h(t),t}function f(t){function e(t){return{valType:"string",editType:"none"}}function n(t,n,a){r.isValObject(t)?"data_array"===t.valType?(t.role="data",a[n+"src"]=e(n)):!0===t.arrayOk&&(a[n+"src"]=e(n)):v.isPlainObject(t)&&(t.role="object")}r.crawl(t,n)}function h(t){function e(t,e,r){if(t){var n=t[L];n&&(delete t[L],r[e]={items:{}},r[e].items[n]=t,r[e].role="object")}}r.crawl(t,e)}function d(t){return M(t,{radialaxis:A.radialaxis,angularaxis:A.angularaxis}),M(t,A.layout),t}function p(t,e,r){var n=v.nestedProperty(t,r),a=T({},e.layoutAttributes);a[E]=!0,n.set(a)}function g(t,e,r){var n=v.nestedProperty(t,r);n.set(T(n.get()||{},e))}var m=t("../registry"),v=t("../lib"),y=t("../plots/attributes"),b=t("../plots/layout_attributes"),x=t("../plots/frame_attributes"),_=t("../plots/animation_attributes"),w=t("../plots/polar/area_attributes"),A=t("../plots/polar/axis_attributes"),k=t("./edit_types"),M=v.extendFlat,T=v.extendDeepAll,E="_isSubplotObj",L="_isLinkedToArray",S=[E,L,"_arrayAttrRegexps","_deprecated"];r.IS_SUBPLOT_OBJ=E,r.IS_LINKED_TO_ARRAY=L,r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=S,r.get=function(){var t={};m.allTypes.concat("area").forEach(function(e){t[e]=o(e)});var e={};return Object.keys(m.transformsRegistry).forEach(function(t){e[t]=l(t)}),{defs:{valObjects:v.valObjectMeta,metaKeys:S.concat(["description","role","editType","impliedEdits"]),editType:{traces:k.traces,layout:k.layout},impliedEdits:{}},traces:t,layout:s(),transforms:e,frames:u(),animation:c(_)}},r.crawl=function(t,e,n,a){var i=n||0;a=a||"",Object.keys(t).forEach(function(n){var o=t[n];if(-1===S.indexOf(n)){var s=(a?a+".":"")+n;e(o,n,t,i,s),r.isValObject(o)||v.isPlainObject(o)&&"impliedEdits"!==n&&r.crawl(o,e,i+1,s)}})},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){function e(e,r,o,s){if(i=i.slice(0,s).concat([r]),e&&("data_array"===e.valType||!0===e.arrayOk)&&!("colorbar"===i[s-1]&&("ticktext"===r||"tickvals"===r))){var l=n(i),u=v.nestedProperty(t,l).get();Array.isArray(u)&&a.push(l)}}function n(t){return t.join(".")}var a=[],i=[];if(r.crawl(y,e),t._module&&t._module.attributes&&r.crawl(t._module.attributes,e),t.transforms)for(var o=t.transforms,s=0;s=t.transforms.length)return!1;r=(m.transformsRegistry[t.transforms[l].type]||{}).attributes,n=r&&r[e[2]],s=3}else if("area"===t.type)n=w[o];else{var u=t._module;if(u||(u=(m.modules[t.type||y.type.dflt]||{})._module),!u)return!1;if(r=u.attributes,!(n=r&&r[o])){var c=u.basePlotModule;c&&c.attributes&&(n=c.attributes[o])}n||(n=y[o])}return a(n,e,s)},r.getLayoutValObject=function(t,e){return a(n(t,e[0]),e,1)}},{"../lib":353,"../plots/animation_attributes":392,"../plots/attributes":394,"../plots/frame_attributes":421,"../plots/layout_attributes":427,"../plots/polar/area_attributes":430,"../plots/polar/axis_attributes":431,"../registry":436,"./edit_types":380}],386:[function(t,e,r){"use strict";function n(t){o.register(t,t.name,t.categories,t.meta),o.subplotsRegistry[t.basePlotModule.name]||o.registerSubplot(t.basePlotModule)}function a(t){if("string"!=typeof t.name)throw new Error("Transform module *name* must be a string.");var e="Transform module "+t.name,r="function"==typeof t.transform,n="function"==typeof t.calcTransform;if(!r&&!n)throw new Error(e+" is missing a *transform* or *calcTransform* method.");r&&n&&s.log([e+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),s.isPlainObject(t.attributes)||s.log(e+" registered without an *attributes* object."),"function"!=typeof t.supplyDefaults&&s.log(e+" registered without a *supplyDefaults* method."),o.registerTransform(t)}function i(t){if("string"!=typeof t.name)throw new Error("Component module *name* must be a string.");o.registerComponent(t)}var o=t("../registry"),s=t("../lib");e.exports=function(t){if(!t)throw new Error("No argument passed to Plotly.register.");t&&!Array.isArray(t)&&(t=[t]);for(var e=0;e=t[1]||a[1]<=t[0])&&(i[0]e[0]))return!0}return!1}function a(t,e,r){return t._anchorAxis===e&&(t.mirror||t.side===r)||"all"===t.mirror||"allticks"===t.mirror||t.mirrors&&t.mirrors[e._id+r]}function i(t,e,r){var n=[],a=e._anchorAxis;if(a){var i=a._mainAxis;if(-1===n.indexOf(i)){n.push(i);for(var o=0;o1&&l.push(o("object","layout"))),h.supplyDefaults(u);for(var c=u._fullData,m=r.length,v=0;v.3*f||i(n)||i(a))){var h=r.dtick/2;t+=t+h.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?t=j.tickIncrement(t,"M6","reverse")+1.5*D:i.exactMonths>.8?t=j.tickIncrement(t,"M1","reverse")+15.5*D:t-=D/2;var s=j.tickIncrement(t,r);if(s<=n)return s}return t}function s(t){var e,r,n=t.tickvals,a=t.ticktext,i=new Array(n.length),o=M.simpleMap(t.range,t.r2l),s=1.0001*o[0]-1e-4*o[1],l=1.0001*o[1]-1e-4*o[0],u=Math.min(s,l),f=Math.max(s,l),h=0;Array.isArray(a)||(a=[]);var d="category"===t.type?t.d2l_noadd:t.d2l;for("log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1)),r=0;ru&&e10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=D&&a<=10||e>=15*D)t._tickround="d";else if(e>=z&&a<=16||e>=P)t._tickround="M";else if(e>=N&&a<=19||e>=z)t._tickround="S";else{var i=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,i)-20}}else if(A(e)||"L"===e.charAt(0)){var o=t.range.map(t.r2d||Number);A(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var s=Math.max(Math.abs(o[0]),Math.abs(o[1])),l=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(l)>3&&(g(t.exponentformat)&&!m(l)?t._tickexponent=3*Math.round((l-1)/3):t._tickexponent=l)}else t._tickround=null}function c(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}function f(t,e,r,n){var a=t._tickround,i=r&&t.hoverformat||t.tickformat;n&&(a=A(a)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[a]);var o,s=M.formatDate(e.x,i,a,t.calendar),l=s.indexOf("\n");-1!==l&&(o=s.substr(l+1),s=s.substr(0,l)),n&&("00:00:00"===s||"00:00"===s?(s=o,o=""):8===s.length&&(s=s.replace(/:00$/,""))),o&&(r?"d"===a?s+=", "+o:s=o+(s?", "+s:""):t._inCalcTicks&&o===t._prevDateHead||(s+="
"+o,t._prevDateHead=o)),e.text=s}function h(t,e,r,n,a){var i=t.dtick,o=e.x;if("never"===a&&(a=""),!n||"string"==typeof i&&"L"===i.charAt(0)||(i="L3"),t.tickformat||"string"==typeof i&&"L"===i.charAt(0))e.text=v(Math.pow(10,o),t,a,n);else if(A(i)||"D"===i.charAt(0)&&M.mod(o+.01,1)<.1){var s=Math.round(o);-1!==["e","E","power"].indexOf(t.exponentformat)||g(t.exponentformat)&&m(s)?(e.text=0===s?1:1===s?"10":s>1?"10"+s+"":"10"+F+-s+"",e.fontSize*=1.25):(e.text=v(Math.pow(10,o),t,"","fakehover"),"D1"===i&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==i.charAt(0))throw"unrecognized dtick "+String(i);e.text=String(Math.round(Math.pow(10,M.mod(o,1)))),e.fontSize*=.75}if("D1"===t.dtick){var l=String(e.text).charAt(0);"0"!==l&&"1"!==l||("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*(o<0?.5:.25)))}}function d(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}function p(t,e,r,n,a){"never"===a?a="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide"),e.text=v(e.x,t,a,n)}function g(t){return"SI"===t||"B"===t}function m(t){return t>14||t<-15}function v(t,e,r,n){var a=t<0,i=e._tickround,o=r||e.exponentformat||"B",s=e._tickexponent,l=e.tickformat,c=e.separatethousands;if(n){var f={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:A(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};u(f),i=(Number(f._tickround)||0)+4,s=f._tickexponent,e.hoverformat&&(l=e.hoverformat)}if(l)return w.format(l)(t).replace(/-/g,F);var h=Math.pow(10,-i)/2;if("none"===o&&(s=0),(t=Math.abs(t))"+v+"":"B"===o&&9===s?t+="B":g(o)&&(t+=Q[s/3+5])}return a?F+t:t}function y(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},j.getAutoRange=function(t){var e,r=[],n=t._min[0].val,a=t._max[0].val;for(e=1;e0&&c>0&&f/c>h&&(l=o,u=s,h=f/c);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 h&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(l.val>=0&&(l={val:0,pad:0}),u.val<=0&&(u={val:0,pad:0})):"nonnegative"===t.rangemode&&(l.val-h*l.pad<0&&(l={val:0,pad:0}),u.val<0&&(u={val:1,pad:0})),h=(u.val-l.val)/(t._length-l.pad-u.pad)),r=[l.val-h*l.pad,u.val+h*u.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])))),d&&r.reverse(),M.simpleMap(r,t.l2r||Number)},j.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=j.getAutoRange(t),t._r=t.range.slice(),t._rl=M.simpleMap(t._r,t.r2l);var r=t._input;r.range=t.range.slice(),r.autorange=t.autorange}},j.saveRangeInitial=function(t,e){for(var r=j.list(t,"",!0),n=!1,a=0;a=h?d=!1:s.val>=u&&s.pad<=h&&(t._min.splice(o,1),o--);d&&t._min.push({val:u,pad:y&&0===u?0:h})}if(n(c)){for(d=!0,o=0;o=c&&s.pad>=f?d=!1:s.val<=c&&s.pad<=f&&(t._max.splice(o,1),o--);d&&t._max.push({val:c,pad:y&&0===c?0:f})}}}if((t.autorange||!!M.nestedProperty(t,"rangeslider.autorange").get())&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var i,o,s,l,u,c,f,h,d,p,g,m=e.length,v=r.padded?.05*t._length:0,y=r.tozero&&("linear"===t.type||"-"===t.type);v&&"domain"===t.constrain&&t._inputDomain&&(v*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0]));var b=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),x=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),_=n(r.vpadplus||r.vpad),w=n(r.vpadminus||r.vpad);for(i=0;i<6;i++)a(i);for(i=m-1;i>5;i--)a(i)}},j.autoBin=function(t,e,r,n,a){var s=M.aggNums(Math.min,null,t),l=M.aggNums(Math.max,null,t);if(a||(a=e.calendar),"category"===e.type)return{start:s-.5,end:l+.5,size:1,_count:l-s+1};var u;if(r)u=(l-s)/r;else{var c=M.distinctVals(t),f=Math.pow(10,Math.floor(Math.log(c.minDiff)/Math.LN10)),h=f*M.roundUp(c.minDiff/f,[.9,1.9,4.9,9.9],!0);u=Math.max(h,2*M.stdev(t)/Math.pow(t.length,n?.25:.4)),A(u)||(u=1)}var d;d="log"===e.type?{type:"linear",range:[s,l]}:{type:e.type,range:M.simpleMap([s,l],e.c2r,0,a),calendar:a},j.setConvert(d),j.autoTicks(d,u);var p,g,m=j.tickIncrement(j.tickFirst(d),d.dtick,"reverse",a);if("number"==typeof d.dtick)m=i(m,t,d,s,l),g=1+Math.floor((l-m)/d.dtick),p=m+g*d.dtick;else for("M"===d.dtick.charAt(0)&&(m=o(m,t,d.dtick,s,a)),p=m,g=0;p<=l;)p=j.tickIncrement(p,d.dtick,!1,a),g++;return{start:e.c2r(m,0,a),end:e.c2r(p,0,a),size:d.dtick,_count:g}},j.calcTicks=function(t){var e=M.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var r,n=t.nticks;n||("category"===t.type?(r=t.tickfont?1.2*(t.tickfont.size||12):15,n=t._length/r):(r="y"===t._id.charAt(0)?40:80,n=M.constrain(t._length/r,4,9)+1)),"array"===t.tickmode&&(n*=100),j.autoTicks(t,Math.abs(e[1]-e[0])/n),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}if(t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),u(t),"array"===t.tickmode)return s(t);t._tmin=j.tickFirst(t);var a=e[1]=o:f<=o)&&!(i.length>c||f===l);f=j.tickIncrement(f,t.dtick,a,t.calendar))l=f,i.push(f);t._tmax=i[i.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var h=new Array(i.length),d=0;dO?(e/=O,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*l(e,r,G)):n>R?(e/=R,t.dtick="M"+l(e,1,q)):n>D?(t.dtick=l(e,D,Y),t.tick0=M.dateTick0(t.calendar,!0)):n>P?t.dtick=l(e,P,q):n>z?t.dtick=l(e,z,X):n>N?t.dtick=l(e,N,X):(r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=l(e,r,G))}else if("log"===t.type){t.tick0=0;var a=M.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(a[1]-a[0])<1){var i=1.5*Math.abs((a[1]-a[0])/e);e=Math.abs(Math.pow(10,a[1])-Math.pow(10,a[0]))/i,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+l(e,r,G)}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=l(e,r,G));if(0===t.dtick&&(t.dtick=1),!A(t.dtick)&&"string"!=typeof t.dtick){var o=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(o)}},j.tickIncrement=function(t,e,r,n){var a=r?-1:1;if(A(e))return t+a*e;var i=e.charAt(0),o=a*Number(e.substr(1));if("M"===i)return M.incrementMonth(t,o,n);if("L"===i)return Math.log(Math.pow(10,t)+o)/Math.LN10;if("D"===i){var s="D2"===e?Z:W,l=t+.01*a,u=M.roundUp(M.mod(l,1),s,r);return Math.floor(l)+Math.log(w.round(Math.pow(10,u),1))/Math.LN10}throw"unrecognized dtick "+String(e)},j.tickFirst=function(t){var e=t.r2l||Number,r=M.simpleMap(t.range,e),n=r[1]1&&e2*a}function i(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,a=0,i=0;i2*n}var o=t("fast-isnumeric"),s=t("../../lib"),l=t("../../constants/numerical").BADNUM;e.exports=function(t,e){return a(t,e)?"date":i(t)?"category":n(t)?"linear":"-"}},{"../../constants/numerical":334,"../../lib":353,"fast-isnumeric":68}],398:[function(t,e,r){"use strict";var n=t("tinycolor2").mix,a=t("../../registry"),i=t("../../lib"),o=t("../../components/color/attributes").lightFraction,s=t("./layout_attributes"),l=t("./tick_value_defaults"),u=t("./tick_mark_defaults"),c=t("./tick_label_defaults"),f=t("./category_order_defaults"),h=t("./set_convert"),d=t("./ordered_categories");e.exports=function(t,e,r,p,g){function m(r,n){return i.coerce2(t,e,s,r,n)}var v=p.letter,y=p.font||{},b="Click to enter "+(p.title||v.toUpperCase()+" axis")+" title",x=r("visible",!p.cheateronly),_=e.type;if("date"===_){a.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",p.calendar)}if(h(e,g),r("autorange",!e.isValidRange(t.range))&&r("rangemode"),r("range"),e.cleanRange(),f(t,e,r),e._initialCategories="category"===_?d(v,e.categoryorder,e.categoryarray,p.data):[],!x)return e;var w=r("color"),A=w===t.color?w:y.color;r("title",b),i.coerceFont(r,"titlefont",{family:y.family,size:Math.round(1.2*y.size),color:A}),l(t,e,r,_),c(t,e,r,_,p),u(t,e,r,p);var k=m("linecolor",w),M=m("linewidth"),T=r("showline",!!k||!!M);T||(delete e.linecolor,delete e.linewidth),(T||e.ticks)&&r("mirror");var E=m("gridcolor",n(w,p.bgColor,o).toRgbString()),L=m("gridwidth");r("showgrid",p.showGrid||!!E||!!L)||(delete e.gridcolor,delete e.gridwidth);var S=m("zerolinecolor",w),C=m("zerolinewidth");return r("zeroline",p.showGrid||!!S||!!C)||(delete e.zerolinecolor,delete e.zerolinewidth),e}},{"../../components/color/attributes":232,"../../lib":353,"../../registry":436,"./category_order_defaults":400,"./layout_attributes":407,"./ordered_categories":409,"./set_convert":413,"./tick_label_defaults":414,"./tick_mark_defaults":415,"./tick_value_defaults":416,tinycolor2:200}],399:[function(t,e,r){"use strict";function n(t,e,r){function n(t,r){for(var n=Object.keys(t),a=/^[xyz]axis[0-9]*/,i=[],o=0;o0;i&&(n="array");var o=r("categoryorder",n);"array"===o&&r("categoryarray"),i||"array"!==o||(e.categoryorder="trace")}}},{}],401:[function(t,e,r){"use strict";var n=t("../../lib").counterRegex;e.exports={idRegex:{x:n("x"),y:n("y")},attrRegex:n("[xy]axis"),xAxisMatch:n("xaxis"),yAxisMatch:n("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,SELECTDELAY:100,SELECTID:"-select",DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","maplayer","barlayer","carpetlayer","boxlayer","scatterlayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},{"../../lib":353}],402:[function(t,e,r){"use strict";function n(t,e,r,n){var a,i,s,l,u=n[o(e)].type,c=[];for(i=0;io*v)||_)for(r=0;rI&&RS&&(S=R);var z=(S-L)/(2*C);f/=z,L=l.l2r(L),S=l.l2r(S),l.range=l._input.range=M=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function u(t,e){return t?"nsew"===t?"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}function c(t,e,r,n,a){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",a+"Z")}function f(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:T.background,stroke:T.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function h(t){t.selectAll(".select-outline").remove()}function d(t,e,r,n,a,i){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),a||(t.transition().style("fill",i>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function p(t){x.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function g(t){return-1!==["lasso","select"].indexOf(t)}function m(t,e){return"M"+(t.l-.5)+","+(e-F-.5)+"h-3v"+(2*F+1)+"h3ZM"+(t.r+.5)+","+(e-F-.5)+"h3v"+(2*F+1)+"h-3Z"}function v(t,e){return"M"+(e-F-.5)+","+(t.t-.5)+"v-3h"+(2*F+1)+"v3ZM"+(e-F-.5)+","+(t.b+.5)+"v3h"+(2*F+1)+"v-3Z"}function y(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,F)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function b(t,e,r){var n,a,i,o,s,l,u=!1,c={},f={};for(n=0;nF||s>F?(kt="xy",o/it>s/ot?(s=o*ot/it,bt>i?xt.t=bt-s:xt.b=bt+s):(o=s*it/ot,yt>a?xt.l=yt-o:xt.r=yt+o),Tt.attr("d",y(xt))):n():!lt||szoom back out","long"),B=!1)}function Y(e,r){var n=1===(U+H).length;if(e)K();else if(2!==r||n){if(1===r&&n){var a=U?rt[0]:et[0],o="s"===U||"w"===H?0:1,s=a._name+".range["+o+"]",l=i(a,o),u="left",c="middle";if(a.fixedrange)return;U?(c="n"===U?"top":"bottom","right"===a.side&&(u="right")):"e"===H&&(u="right"),t._context.showAxisRangeEntryBoxes&&x.select(mt).call(M.makeEditable,{gd:t,immediate:!0,background:dt.paper_bgcolor,text:String(l),fill:a.tickfont?a.tickfont.color:"#444",horizontalAlign:u,verticalAlign:c}).on("edit",function(e){var r=a.d2r(e);void 0!==r&&w.relayout(t,s,r)})}}else $()}function W(e){function r(t,e,r){function n(e){return t.l2r(i+(e-i)*r)}if(!t.fixedrange){var a=k.simpleMap(t.range,t.r2l),i=a[0]+(a[1]-a[0])*e;t.range=a.map(n)}}if(t._context.scrollZoom||dt._enablescrollzoom){if(t._transitioningWithDuration)return k.pauseEvent(e);var n=t.querySelector(".plotly");if(V(),!(n.scrollHeight-n.clientHeight>10||n.scrollWidth-n.clientWidth>10)){clearTimeout(St);var a=-e.deltaY;if(isFinite(a)||(a=e.wheelDelta/10),!isFinite(a))return void k.log("Did not find wheel motion attributes: ",e);var i,o=Math.exp(-Math.min(Math.max(a,-20),20)/200),s=It.draglayer.select(".nsewdrag").node().getBoundingClientRect(),l=(e.clientX-s.left)/s.width,u=(s.bottom-e.clientY)/s.height;if(H||ct){for(H||(l=.5),i=0;i rect").call(E.setTranslate,s,l).call(E.setScale,i,o);var w=g.plot.selectAll(".scatterlayer .points, .boxlayer .points");g.plot.call(E.setTranslate,x,_).call(E.setScale,1/i,1/o),w.selectAll(".point").call(E.setPointGroupScale,i,o).call(E.hideOutsideRangePoints,g),w.selectAll(".textpoint").call(E.setTextPointsScale,i,o).call(E.hideOutsideRangePoints,g)}}}var tt,et,rt,nt,at,it,ot,st,lt,ut,ct,ft,ht,dt=t._fullLayout,pt=t._fullLayout._zoomlayer,gt=U+H==="nsew";V();var mt=n(e,U+H+"drag",ut,r,T,L,j);if(!lt&&!st&&!g(dt.dragmode))return mt.onmousedown=null,mt.style.pointerEvents=gt?"all":"none",mt;var vt={element:mt,gd:t,plotinfo:e,prepFn:function(e,r,n){var a=t._fullLayout.dragmode;gt?e.shiftKey&&(a="pan"===a?"zoom":"pan"):a="pan",vt.minDrag="lasso"===a?1:void 0,"zoom"===a?(vt.moveFn=q,vt.doneFn=X,vt.minDrag=1,G(e,r,n)):"pan"===a?(vt.moveFn=Z,vt.doneFn=Y,h(pt)):g(a)&&(vt.xaxes=et,vt.yaxes=rt,D(e,r,n,vt,a))}};S.init(vt);var yt,bt,xt,_t,wt,At,kt,Mt,Tt,Et={},Lt=[0,0,it,ot],St=null,Ct=z.REDRAWDELAY,It=e.mainplot?dt._plots[e.mainplot]:e;return U.length*H.length!=1&&(void 0!==mt.onwheel?mt.onwheel=W:void 0!==mt.onmousewheel&&(mt.onmousewheel=W)),mt}},{"../../components/color":233,"../../components/dragelement":254,"../../components/drawing":257,"../../constants/alignment":330,"../../lib":353,"../../lib/setcursor":371,"../../lib/svg_text_utils":375,"../../plotly":391,"../../registry":436,"../plots":429,"./axes":396,"./axis_ids":399,"./constants":401,"./scale_zoom":411,"./select":412,d3:62,tinycolor2:200}],405:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../components/fx"),i=t("../../components/dragelement"),o=t("./constants"),s=t("./dragbox");e.exports=function(t){var e=t._fullLayout;if((e._has("cartesian")||e._has("gl2d"))&&!t._context.staticPlot){Object.keys(e._plots||{}).sort(function(t,r){if((e._plots[t].mainplot&&!0)===(e._plots[r].mainplot&&!0)){var n=t.split("y"),a=r.split("y");return n[0]===a[0]?Number(n[1]||1)-Number(a[1]||1):Number(n[0]||1)-Number(a[0]||1)}return e._plots[t].mainplot?1:-1}).forEach(function(r){var l=e._plots[r],u=l.xaxis,c=l.yaxis,f=(u._linepositions[r]||[])[3],h=(c._linepositions[r]||[])[3],d=o.DRAGGERSIZE;if(n(f)&&"top"===u.side&&(f-=d),n(h)&&"right"!==c.side&&(h-=d),!l.mainplot){var p=s(t,l,0,0,u._length,c._length,"ns","ew");p.onmousemove=function(e){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===r&&a.hover(t,e,r)},a.hover(t,e,r),t._fullLayout._lasthover=p,t._fullLayout._hoversubplot=r},p.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,i.unhover(t,e))},p.onclick=function(e){a.click(t,e,r)},t._context.showAxisDragHandles&&(s(t,l,-d,-d,d,d,"n","w"),s(t,l,u._length,-d,d,d,"n","e"),s(t,l,-d,c._length,d,d,"s","w"),s(t,l,u._length,c._length,d,d,"s","e"))}t._context.showAxisDragHandles&&(n(f)&&("free"===u.anchor&&(f-=e._size.h*(1-c.domain[1])),s(t,l,.1*u._length,f,.8*u._length,d,"","ew"),s(t,l,0,f,.1*u._length,d,"","w"),s(t,l,.9*u._length,f,.1*u._length,d,"","e")),n(h)&&("free"===c.anchor&&(h-=e._size.w*u.domain[0]),s(t,l,h,.1*c._length,d,.8*c._length,"ns",""),s(t,l,h,.9*c._length,d,.1*c._length,"s",""),s(t,l,h,0,d,.1*c._length,"n","")))});var r=e._hoverlayer.node();r.onmousemove=function(r){r.target=e._lasthover,a.hover(t,r,e._hoversubplot)},r.onclick=function(r){r.target=e._lasthover,a.click(t,r)},r.onmousedown=function(t){e._lasthover.onmousedown(t)}}}},{"../../components/dragelement":254,"../../components/fx":274,"./constants":401,"./dragbox":404,"fast-isnumeric":68}],406:[function(t,e,r){"use strict";function n(t,e,r,n,a){var i=t._fullLayout,o=i._modules;e.plot&&e.plot.selectAll("g:not(.scatterlayer)").selectAll("g.trace").remove();for(var s=0;sc[1]-.01&&(e.domain=[0,1]),a.noneOrAll(t.domain,e.domain,[0,1])}return r("layer"),e}},{"../../lib":353,"fast-isnumeric":68}],411:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var a=[t.r2l(t.range[0]),t.r2l(t.range[1])],i=a[0]+(a[1]-a[0])*r;t.range=t._input.range=[t.l2r(i+(a[0]-i)*e),t.l2r(i+(a[1]-i)*e)]}},{"../../constants/alignment":330}],412:[function(t,e,r){"use strict";function n(t){return t._id}function a(t,e){if(Array.isArray(t))for(var r=e.cd[0].trace,n=0;n0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],a=t.range[1];return.5*(n+a-3*A*Math.abs(n-a))}return d}function f(e,r,n){var a=u(e,n||t.calendar);if(a===d){if(!i(e))return d;a=u(new Date(+e))}return a}function m(e,r,n){return l(e,r,n||t.calendar)}function v(e){return t._categories[Math.round(e)]}function y(e){if(null!==e&&void 0!==e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return d}function b(e){if(t._categoriesMap){var r=t._categoriesMap[e];if(void 0!==r)return r}if(i(e))return+e}function x(e){return i(e)?a.round(t._b+t._m*e,2):d}function _(e){return(e-t._b)/t._m}e=e||{};var w=(t._id||"x").charAt(0),A=10;t.c2l="log"===t.type?r:c,t.l2c="log"===t.type?n:c,t.l2p=x,t.p2l=_,t.c2p="log"===t.type?function(t,e){return x(r(t,e))}:x,t.p2c="log"===t.type?function(t){return n(_(t))}:_,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=s,t.c2d=t.c2r=t.l2d=t.l2r=c,t.d2p=t.r2p=function(e){return t.l2p(s(e))},t.p2d=t.p2r=_,t.cleanPos=c):"log"===t.type?(t.d2r=t.d2l=function(t,e){return r(s(t),e)},t.r2d=t.r2c=function(t){return n(s(t))},t.d2c=t.r2l=s,t.c2d=t.l2r=c,t.c2r=r,t.l2d=n,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return n(_(t))},t.r2p=function(e){return t.l2p(s(e))},t.p2r=_,t.cleanPos=c):"date"===t.type?(t.d2r=t.r2d=o.identity,t.d2c=t.r2c=t.d2l=t.r2l=f,t.c2d=t.c2r=t.l2d=t.l2r=m,t.d2p=t.r2p=function(e,r,n){return t.l2p(f(e,0,n))},t.p2d=t.p2r=function(t,e,r){return m(_(t),e,r)},t.cleanPos=function(e){return o.cleanDate(e,d,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=y,t.r2d=t.c2d=t.l2d=v,t.d2r=t.d2l_noadd=b,t.r2c=function(e){var r=b(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=c,t.r2l=b,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return v(_(t))},t.r2p=t.d2p,t.p2r=_,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:c(t)}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e){e||(e="range");var r,n,a=o.nestedProperty(t,e).get();if(n="date"===t.type?o.dfltRange(t.calendar):"y"===w?p.DFLTRANGEY:p.DFLTRANGEX,n=n.slice(),!a||2!==a.length)return void o.nestedProperty(t,e).set(n);for("date"===t.type&&(a[0]=o.cleanDate(a[0],d,t.calendar),a[1]=o.cleanDate(a[1],d,t.calendar)),r=0;r<2;r++)if("date"===t.type){if(!o.isDateTime(a[r],t.calendar)){t[e]=n;break}if(t.r2l(a[0])===t.r2l(a[1])){var s=o.constrain(t.r2l(a[0]),o.MIN_MS+1e3,o.MAX_MS-1e3);a[0]=t.l2r(s-1e3),a[1]=t.l2r(s+1e3);break}}else{if(!i(a[r])){if(!i(a[1-r])){t[e]=n;break}a[r]=a[1-r]*(r?10:.1)}if(a[r]<-h?a[r]=-h:a[r]>h&&(a[r]=h),a[0]===a[1]){var l=Math.max(1,Math.abs(1e-6*a[0]));a[0]-=l,a[1]+=l}}},t.setScale=function(r){var n=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var a=g.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var i=r&&t._r?"_r":"range",s=t.calendar;t.cleanRange(i);var l=t.r2l(t[i][0],s),u=t.r2l(t[i][1],s);if("y"===w?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(l-u),t._b=-t._m*u):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(u-l),t._b=-t._m*l),!isFinite(t._m)||!isFinite(t._b))throw o.notifier("Something went wrong with axis scaling","long"),e._replotting=!1,new Error("axis scaling")},t.makeCalcdata=function(e,r){var n,a,i,o="date"===t.type&&e[r+"calendar"];if(r in e)for(n=e[r],a=new Array(n.length),i=0;i=t.range[0]&&r<=t.range[1]}:function(e){var r=e.y;return r>=t.range[0]&&r<=t.range[1]},t._min=[],t._max=[],t._separators=e.separators,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":334,"../../lib":353,"./axis_ids":399,"./constants":401,d3:62,"fast-isnumeric":68}],414:[function(t,e,r){"use strict";function n(t){var e=["showexponent","showtickprefix","showticksuffix"],r=e.filter(function(e){return void 0!==t[e]}),n=function(e){return t[e]===t[r[0]]};if(r.every(n)||1===r.length)return t[r[0]]}var a=t("../../lib");e.exports=function(t,e,r,i,o){var s=n(t);if(r("tickprefix")&&r("showtickprefix",s),r("ticksuffix")&&r("showticksuffix",s),r("showticklabels")){var l=o.font||{},u=e.color===t.color?e.color:l.color;a.coerceFont(r,"tickfont",{family:l.family,size:l.size,color:u}),r("tickangle"),"category"!==i&&(r("tickformat")||"date"===i||(r("showexponent",s),r("exponentformat"),r("separatethousands")))}"category"===i||o.noHover||r("hoverformat")}},{"../../lib":353}],415:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r,i){var o=n.coerce2(t,e,a,"ticklen"),s=n.coerce2(t,e,a,"tickwidth"),l=n.coerce2(t,e,a,"tickcolor",e.color);r("ticks",i.outerTicks||o||s||l?"outside":"")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":353,"./layout_attributes":407}],416:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").ONEDAY;e.exports=function(t,e,r,o){var s="auto";"array"!==t.tickmode||"log"!==o&&"date"!==o||(t.tickmode="auto"),Array.isArray(t.tickvals)?s="array":t.dtick&&(s="linear");var l=r("tickmode",s);if("auto"===l)r("nticks");else if("linear"===l){var u="date"===o?i:1,c=r("dtick",u);if(n(c))e.dtick=c>0?Number(c):u;else if("string"!=typeof c)e.dtick=u;else{var f=c.charAt(0),h=c.substr(1);h=n(h)?Number(h):0,(h<=0||!("date"===o&&"M"===f&&h===Math.round(h)||"log"===o&&"L"===f||"log"===o&&"D"===f&&(1===h||2===h)))&&(e.dtick=u)}var d="date"===o?a.dateTick0(e.calendar):0,p=r("tick0",d);"date"===o?e.tick0=a.cleanDate(p,d):n(p)&&"D1"!==c&&"D2"!==c?e.tick0=Number(p):e.tick0=d}else{var g=r("tickvals");void 0===g?e.tickmode="auto":r("ticktext")}}},{"../../constants/numerical":334,"../../lib":353,"fast-isnumeric":68}],417:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plotly"),i=t("../../registry"),o=t("../../components/drawing"),s=t("./axes"),l=t("./constants").attrRegex;e.exports=function(t,e,r,u){function c(e,r){function n(e,r,n){for(a=0;a rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.select(".scatterlayer").selectAll(".points");n.selectAll(".point").call(o.setPointGroupScale,1,1).call(o.hideOutsideRangePoints,t),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1).call(o.hideOutsideRangePoints,t)}function h(e,r){var n,a,i,s=y[e.xaxis._id],l=y[e.yaxis._id],u=[];if(s){n=t._fullLayout[s.axisName],a=n._r,i=s.to,u[0]=(a[0]*(1-r)+r*i[0]-a[0])/(a[1]-a[0])*e.xaxis._length;var f=a[1]-a[0],h=i[1]-i[0];n.range[0]=a[0]*(1-r)+r*i[0],n.range[1]=a[1]*(1-r)+r*i[1],u[2]=e.xaxis._length*(1-r+r*h/f)}else u[0]=0,u[2]=e.xaxis._length;if(l){n=t._fullLayout[l.axisName],a=n._r,i=l.to,u[1]=(a[1]*(1-r)+r*i[1]-a[1])/(a[0]-a[1])*e.yaxis._length;var d=a[1]-a[0],p=i[1]-i[0];n.range[0]=a[0]*(1-r)+r*i[0],n.range[1]=a[1]*(1-r)+r*i[1],u[3]=e.yaxis._length*(1-r+r*p/d)}else u[1]=0,u[3]=e.yaxis._length;c(e.xaxis,e.yaxis);var g=e.xaxis,v=e.yaxis,b=!!s,x=!!l,_=b?g._length/u[2]:1,w=x?v._length/u[3]:1,A=b?u[0]:0,k=x?u[1]:0,M=b?u[0]/u[2]*g._length:0,T=x?u[1]/u[3]*v._length:0,E=g._offset-M,L=v._offset-T;m._defs.select("#"+e.clipId+"> rect").call(o.setTranslate,A,k).call(o.setScale,1/_,1/w),e.plot.call(o.setTranslate,E,L).call(o.setScale,_,w).selectAll(".points").selectAll(".point").call(o.setPointGroupScale,1/_,1/w),e.plot.selectAll(".points").selectAll(".textpoint").call(o.setTextPointsScale,1/_,1/w)}function d(){for(var e={},r=0;rr.duration?(d(),k=window.cancelAnimationFrame(g)):k=window.requestAnimationFrame(g)}var m=t._fullLayout,v=[],y=function(t){var e,r,n,a,i={};for(e in t)if(r=e.split("."),r[0].match(l)){var o=e.charAt(0),s=r[0];if(n=m[s],a={},Array.isArray(t[e])?a.to=t[e].slice(0):Array.isArray(t[e].range)&&(a.to=t[e].range.slice(0)),!a.to)continue;a.axisName=s,a.length=n._length,v.push(o),i[o]=a}return i}(e),b=Object.keys(y),x=function(t,e,r){var n,a,i,o=t._plots,s=[];for(n in o){var l=o[n];if(-1===s.indexOf(l)){var u=l.xaxis._id,c=l.yaxis._id,f=l.xaxis.range,h=l.yaxis.range;l.xaxis._r=l.xaxis.range.slice(),l.yaxis._r=l.yaxis.range.slice(),a=r[u]?r[u].to:f,i=r[c]?r[c].to:h,f[0]===a[0]&&f[1]===a[1]&&h[0]===i[0]&&h[1]===i[1]||-1===e.indexOf(u)&&-1===e.indexOf(c)||s.push(l)}}return s}(m,b,y);if(!x.length)return function(){function e(e,r,n){for(var a=0;a0?".":"")+a;u.isPlainObject(i)?s(i,e,o,n+1):e(o,a,i)}})}var l=t("../plotly"),u=t("../lib");r.manageCommandObserver=function(t,e,a,i){var o={},s=!0;e&&e._commandObserver&&(o=e._commandObserver),o.cache||(o.cache={}),o.lookupTable={};var l=r.hasSimpleAPICommandBindings(t,a,o.lookupTable);if(e&&e._commandObserver){if(l)return o;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,o}if(l){n(t,l,o.cache),o.check=function(){if(s){var e=n(t,l,o.cache);return e.changed&&i&&void 0!==o.lookupTable[e.value]&&(o.disable(),Promise.resolve(i({value:e.value,type:l.type,prop:l.prop,traces:l.traces,index:o.lookupTable[e.value]})).then(o.enable,o.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;fMath.abs(u)?(f.boxEnd[1]=f.boxStart[1]+Math.abs(s)*w*(u>=0?1:-1),f.boxEnd[1]h[3]&&(f.boxEnd[1]=h[3],f.boxEnd[0]=f.boxStart[0]+(h[3]-f.boxStart[1])/Math.abs(w))):(f.boxEnd[0]=f.boxStart[0]+Math.abs(u)/w*(s>=0?1:-1),f.boxEnd[0]h[2]&&(f.boxEnd[0]=h[2],f.boxEnd[1]=f.boxStart[1]+(h[2]-f.boxStart[0])*Math.abs(w)))}}else f.boxEnabled?(s=f.boxStart[0]!==f.boxEnd[0],u=f.boxStart[1]!==f.boxEnd[1],s||u?(s&&(o(0,f.boxStart[0],f.boxEnd[0]),t.xaxis.autorange=!1),u&&(o(1,f.boxStart[1],f.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),f.boxEnabled=!1,f.boxInited=!1):f.boxInited&&(f.boxInited=!1);break;case"pan":f.boxEnabled=!1,f.boxInited=!1,n?(f.panning||(f.dragStart[0]=a,f.dragStart[1]=i),Math.abs(f.dragStart[0]-a)c[1]-.01&&(e.domain=[0,1]),a.noneOrAll(t.domain,e.domain,[0,1])}return r("layer"),e}},{"../../lib":353,"fast-isnumeric":68}],411:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var a=[t.r2l(t.range[0]),t.r2l(t.range[1])],i=a[0]+(a[1]-a[0])*r;t.range=t._input.range=[t.l2r(i+(a[0]-i)*e),t.l2r(i+(a[1]-i)*e)]}},{"../../constants/alignment":330}],412:[function(t,e,r){"use strict";function n(t){return t._id}function a(t,e){if(Array.isArray(t))for(var r=e.cd[0].trace,n=0;n0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],a=t.range[1];return.5*(n+a-3*A*Math.abs(n-a))}return d}function f(e,r,n){var a=u(e,n||t.calendar);if(a===d){if(!i(e))return d;a=u(new Date(+e))}return a}function m(e,r,n){return l(e,r,n||t.calendar)}function v(e){return t._categories[Math.round(e)]}function y(e){if(null!==e&&void 0!==e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return d}function b(e){if(t._categoriesMap){var r=t._categoriesMap[e];if(void 0!==r)return r}if(i(e))return+e}function x(e){return i(e)?a.round(t._b+t._m*e,2):d}function _(e){return(e-t._b)/t._m}e=e||{};var w=(t._id||"x").charAt(0),A=10;t.c2l="log"===t.type?r:c,t.l2c="log"===t.type?n:c,t.l2p=x,t.p2l=_,t.c2p="log"===t.type?function(t,e){return x(r(t,e))}:x,t.p2c="log"===t.type?function(t){return n(_(t))}:_,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=s,t.c2d=t.c2r=t.l2d=t.l2r=c,t.d2p=t.r2p=function(e){return t.l2p(s(e))},t.p2d=t.p2r=_,t.cleanPos=c):"log"===t.type?(t.d2r=t.d2l=function(t,e){return r(s(t),e)},t.r2d=t.r2c=function(t){return n(s(t))},t.d2c=t.r2l=s,t.c2d=t.l2r=c,t.c2r=r,t.l2d=n,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return n(_(t))},t.r2p=function(e){return t.l2p(s(e))},t.p2r=_,t.cleanPos=c):"date"===t.type?(t.d2r=t.r2d=o.identity,t.d2c=t.r2c=t.d2l=t.r2l=f,t.c2d=t.c2r=t.l2d=t.l2r=m,t.d2p=t.r2p=function(e,r,n){return t.l2p(f(e,0,n))},t.p2d=t.p2r=function(t,e,r){return m(_(t),e,r)},t.cleanPos=function(e){return o.cleanDate(e,d,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=y,t.r2d=t.c2d=t.l2d=v,t.d2r=t.d2l_noadd=b,t.r2c=function(e){var r=b(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=c,t.r2l=b,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return v(_(t))},t.r2p=t.d2p,t.p2r=_,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:c(t)}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e){e||(e="range");var r,n,a=o.nestedProperty(t,e).get();if(n="date"===t.type?o.dfltRange(t.calendar):"y"===w?p.DFLTRANGEY:p.DFLTRANGEX,n=n.slice(),!a||2!==a.length)return void o.nestedProperty(t,e).set(n);for("date"===t.type&&(a[0]=o.cleanDate(a[0],d,t.calendar),a[1]=o.cleanDate(a[1],d,t.calendar)),r=0;r<2;r++)if("date"===t.type){if(!o.isDateTime(a[r],t.calendar)){t[e]=n;break}if(t.r2l(a[0])===t.r2l(a[1])){var s=o.constrain(t.r2l(a[0]),o.MIN_MS+1e3,o.MAX_MS-1e3);a[0]=t.l2r(s-1e3),a[1]=t.l2r(s+1e3);break}}else{if(!i(a[r])){if(!i(a[1-r])){t[e]=n;break}a[r]=a[1-r]*(r?10:.1)}if(a[r]<-h?a[r]=-h:a[r]>h&&(a[r]=h),a[0]===a[1]){var l=Math.max(1,Math.abs(1e-6*a[0]));a[0]-=l,a[1]+=l}}},t.setScale=function(r){var n=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var a=g.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var i=r&&t._r?"_r":"range",s=t.calendar;t.cleanRange(i);var l=t.r2l(t[i][0],s),u=t.r2l(t[i][1],s);if("y"===w?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(l-u),t._b=-t._m*u):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(u-l),t._b=-t._m*l),!isFinite(t._m)||!isFinite(t._b))throw o.notifier("Something went wrong with axis scaling","long"),e._replotting=!1,new Error("axis scaling")},t.makeCalcdata=function(e,r){var n,a,i,o="date"===t.type&&e[r+"calendar"];if(r in e)for(n=e[r],a=new Array(n.length),i=0;i=t.range[0]&&r<=t.range[1]}:function(e){var r=e.y;return r>=t.range[0]&&r<=t.range[1]},t._min=[],t._max=[],t._separators=e.separators,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":334,"../../lib":353,"./axis_ids":399,"./constants":401,d3:62,"fast-isnumeric":68}],414:[function(t,e,r){"use strict";function n(t){var e=["showexponent","showtickprefix","showticksuffix"],r=e.filter(function(e){return void 0!==t[e]}),n=function(e){return t[e]===t[r[0]]};if(r.every(n)||1===r.length)return t[r[0]]}var a=t("../../lib");e.exports=function(t,e,r,i,o){var s=n(t);if(r("tickprefix")&&r("showtickprefix",s),r("ticksuffix")&&r("showticksuffix",s),r("showticklabels")){var l=o.font||{},u=e.color===t.color?e.color:l.color;a.coerceFont(r,"tickfont",{family:l.family,size:l.size,color:u}),r("tickangle"),"category"!==i&&(r("tickformat")||"date"===i||(r("showexponent",s),r("exponentformat"),r("separatethousands")))}"category"===i||o.noHover||r("hoverformat")}},{"../../lib":353}],415:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r,i){var o=n.coerce2(t,e,a,"ticklen"),s=n.coerce2(t,e,a,"tickwidth"),l=n.coerce2(t,e,a,"tickcolor",e.color);r("ticks",i.outerTicks||o||s||l?"outside":"")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":353,"./layout_attributes":407}],416:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").ONEDAY;e.exports=function(t,e,r,o){var s="auto";"array"!==t.tickmode||"log"!==o&&"date"!==o||(t.tickmode="auto"),Array.isArray(t.tickvals)?s="array":t.dtick&&(s="linear");var l=r("tickmode",s);if("auto"===l)r("nticks");else if("linear"===l){var u="date"===o?i:1,c=r("dtick",u);if(n(c))e.dtick=c>0?Number(c):u;else if("string"!=typeof c)e.dtick=u;else{var f=c.charAt(0),h=c.substr(1);h=n(h)?Number(h):0,(h<=0||!("date"===o&&"M"===f&&h===Math.round(h)||"log"===o&&"L"===f||"log"===o&&"D"===f&&(1===h||2===h)))&&(e.dtick=u)}var d="date"===o?a.dateTick0(e.calendar):0,p=r("tick0",d);"date"===o?e.tick0=a.cleanDate(p,d):n(p)&&"D1"!==c&&"D2"!==c?e.tick0=Number(p):e.tick0=d}else{var g=r("tickvals");void 0===g?e.tickmode="auto":r("ticktext")}}},{"../../constants/numerical":334,"../../lib":353,"fast-isnumeric":68}],417:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plotly"),i=t("../../registry"),o=t("../../components/drawing"),s=t("./axes"),l=t("./constants").attrRegex;e.exports=function(t,e,r,u){function c(e,r){function n(e,r,n){for(a=0;a rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.select(".scatterlayer").selectAll(".points");n.selectAll(".point").call(o.setPointGroupScale,1,1).call(o.hideOutsideRangePoints,t),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1).call(o.hideOutsideRangePoints,t)}function h(e,r){var n,a,i,s=y[e.xaxis._id],l=y[e.yaxis._id],u=[];if(s){n=t._fullLayout[s.axisName],a=n._r,i=s.to,u[0]=(a[0]*(1-r)+r*i[0]-a[0])/(a[1]-a[0])*e.xaxis._length;var f=a[1]-a[0],h=i[1]-i[0];n.range[0]=a[0]*(1-r)+r*i[0],n.range[1]=a[1]*(1-r)+r*i[1],u[2]=e.xaxis._length*(1-r+r*h/f)}else u[0]=0,u[2]=e.xaxis._length;if(l){n=t._fullLayout[l.axisName],a=n._r,i=l.to,u[1]=(a[1]*(1-r)+r*i[1]-a[1])/(a[0]-a[1])*e.yaxis._length;var d=a[1]-a[0],p=i[1]-i[0];n.range[0]=a[0]*(1-r)+r*i[0],n.range[1]=a[1]*(1-r)+r*i[1],u[3]=e.yaxis._length*(1-r+r*p/d)}else u[1]=0,u[3]=e.yaxis._length;c(e.xaxis,e.yaxis);var g=e.xaxis,v=e.yaxis,b=!!s,x=!!l,_=b?g._length/u[2]:1,w=x?v._length/u[3]:1,A=b?u[0]:0,k=x?u[1]:0,M=b?u[0]/u[2]*g._length:0,T=x?u[1]/u[3]*v._length:0,E=g._offset-M,L=v._offset-T;m._defs.select("#"+e.clipId+"> rect").call(o.setTranslate,A,k).call(o.setScale,1/_,1/w),e.plot.call(o.setTranslate,E,L).call(o.setScale,_,w).selectAll(".points").selectAll(".point").call(o.setPointGroupScale,1/_,1/w),e.plot.selectAll(".points").selectAll(".textpoint").call(o.setTextPointsScale,1/_,1/w)}function d(){for(var e={},r=0;rr.duration?(d(),k=window.cancelAnimationFrame(g)):k=window.requestAnimationFrame(g)}var m=t._fullLayout,v=[],y=function(t){var e,r,n,a,i={};for(e in t)if(r=e.split("."),r[0].match(l)){var o=e.charAt(0),s=r[0];if(n=m[s],a={},Array.isArray(t[e])?a.to=t[e].slice(0):Array.isArray(t[e].range)&&(a.to=t[e].range.slice(0)),!a.to)continue;a.axisName=s,a.length=n._length,v.push(o),i[o]=a}return i}(e),b=Object.keys(y),x=function(t,e,r){var n,a,i,o=t._plots,s=[];for(n in o){var l=o[n];if(-1===s.indexOf(l)){var u=l.xaxis._id,c=l.yaxis._id,f=l.xaxis.range,h=l.yaxis.range;l.xaxis._r=l.xaxis.range.slice(),l.yaxis._r=l.yaxis.range.slice(),a=r[u]?r[u].to:f,i=r[c]?r[c].to:h,f[0]===a[0]&&f[1]===a[1]&&h[0]===i[0]&&h[1]===i[1]||-1===e.indexOf(u)&&-1===e.indexOf(c)||s.push(l)}}return s}(m,b,y);if(!x.length)return function(){function e(e,r,n){for(var a=0;a0?".":"")+a;u.isPlainObject(i)?s(i,e,o,n+1):e(o,a,i)}})}var l=t("../plotly"),u=t("../lib");r.manageCommandObserver=function(t,e,a,i){var o={},s=!0;e&&e._commandObserver&&(o=e._commandObserver),o.cache||(o.cache={}),o.lookupTable={};var l=r.hasSimpleAPICommandBindings(t,a,o.lookupTable);if(e&&e._commandObserver){if(l)return o;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,o}if(l){n(t,l,o.cache),o.check=function(){if(s){var e=n(t,l,o.cache);return e.changed&&i&&void 0!==o.lookupTable[e.value]&&(o.disable(),Promise.resolve(i({value:e.value,type:l.type,prop:l.prop,traces:l.traces,index:o.lookupTable[e.value]})).then(o.enable,o.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;fMath.abs(u)?(f.boxEnd[1]=f.boxStart[1]+Math.abs(s)*w*(u>=0?1:-1),f.boxEnd[1]h[3]&&(f.boxEnd[1]=h[3],f.boxEnd[0]=f.boxStart[0]+(h[3]-f.boxStart[1])/Math.abs(w))):(f.boxEnd[0]=f.boxStart[0]+Math.abs(u)/w*(s>=0?1:-1),f.boxEnd[0]h[2]&&(f.boxEnd[0]=h[2],f.boxEnd[1]=f.boxStart[1]+(h[2]-f.boxStart[0])*Math.abs(w)))}}else f.boxEnabled?(s=f.boxStart[0]!==f.boxEnd[0],u=f.boxStart[1]!==f.boxEnd[1],s||u?(s&&(o(0,f.boxStart[0],f.boxEnd[0]),t.xaxis.autorange=!1),u&&(o(1,f.boxStart[1],f.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),f.boxEnabled=!1,f.boxInited=!1):f.boxInited&&(f.boxInited=!1);break;case"pan":f.boxEnabled=!1,f.boxInited=!1,n?(f.panning||(f.dragStart[0]=a,f.dragStart[1]=i),Math.abs(f.dragStart[0]-a)h[p+2]&&(h[p]=-1,h[p+2]=1),d=this[_[p]],d._length=o.viewBox[p+2]-o.viewBox[p],l.doAutoRange(d),d.setScale();b(s),o.ticks=this.computeTickMarks(),o.dataBox=this.calcDataBox(),o.merge(r),n.update(o),this.glplot.draw()},w.calcDataBox=function(){var t=this.xaxis,e=this.yaxis,r=t.range,n=e.range,a=t.r2l,i=e.r2l;return[a(r[0]),i(n[0]),a(r[1]),i(n[1])]},w.setRanges=function(t){var e=this.xaxis,r=this.yaxis,n=e.l2r,a=r.l2r;e.range=[n(t[0]),n(t[2])],r.range=[a(t[1]),a(t[3])]},w.updateTraces=function(t,e){var r,n,a,i=Object.keys(this.traces);this.fullData=t;t:for(r=0;r=e.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=e._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),u=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&n(t,o),s.text(o.text()&&u.text()?" - ":"")}},m.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=l.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return n.append("input").attr({type:"text",name:"data"}).node().value=m.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},m.supplyDefaults=function(t){var e,r=t._fullLayout||{},n=t._fullLayout={},i=t.layout||{},o=t._fullData||[],s=t._fullData=[],l=t.data||[];if(t._transitionData||m.createTransitionData(t),r._initialAutoSizeIsDone){var u=r.width,f=r.height;m.supplyLayoutGlobalDefaults(i,n),i.width||(n.width=u),i.height||(n.height=f)}else{m.supplyLayoutGlobalDefaults(i,n);var h=!i.width||!i.height,d=n.autosize,p=t._context&&t._context.autosizable;h&&(d||p)?m.plotAutoSize(t,i,n):h&&m.sanitizeMargins(t),!d&&h&&(i.width=n.width,i.height=n.height)}n._initialAutoSizeIsDone=!0,n._dataLength=l.length,n._globalTransforms=(t._context||{}).globalTransforms,m.supplyDataDefaults(l,s,i,n),n._has=m._hasPlotType.bind(n);var g=n._modules;for(e=0;e0){var c=o(t._boundingBoxMargins),f=c.left+c.right,h=c.bottom+c.top,p=1-2*s,g=r._container&&r._container.node?r._container.node().getBoundingClientRect():{width:r.width,height:r.height};n=Math.round(p*(g.width-f)),a=Math.round(p*(g.height-h))}else{var v=l?window.getComputedStyle(t):{};n=parseFloat(v.width)||r.width,a=parseFloat(v.height)||r.height}var y=m.layoutAttributes.width.min,b=m.layoutAttributes.height.min;n1,_=!e.height&&Math.abs(r.height-a)>1;(_||x)&&(x&&(r.width=n),_&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),m.sanitizeMargins(r)},m.supplyLayoutModuleDefaults=function(t,e,r,n){var a,i;c.Axes.supplyLayoutDefaults(t,e,r);var o=e._basePlotModules;for(a=0;a.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+a},r:{val:r.x,size:r.r+a},b:{val:r.y,size:r.b+a},t:{val:r.y,size:r.t+a}}}else delete n._pushmargin[e];n._replotting||m.doAutoMargin(t)}},m.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),a=Math.max(e.margin.l||0,0),i=Math.max(e.margin.r||0,0),o=Math.max(e.margin.t||0,0),s=Math.max(e.margin.b||0,0),l=e._pushmargin;if(!1!==e.margin.autoexpand){l.base={l:{val:0,size:a},r:{val:1,size:i},t:{val:1,size:o},b:{val:0,size:s}};for(var f=Object.keys(l),h=0;hm){var k=(v*w+(A-e.width)*m)/(w-m),M=(A*(1-m)+(v-e.width)*(1-w))/(w-m);k>=0&&M>=0&&k+M>a+i&&(a=k,i=M)}}if(u(b)&&l[_].t){var T=l[_].t.val,E=l[_].t.size;if(T>y){var L=(b*T+(E-e.height)*y)/(T-y),S=(E*(1-y)+(b-e.height)*(1-T))/(T-y);L>=0&&S>=0&&L+S>s+o&&(s=L,o=S)}}}}if(r.l=Math.round(a),r.r=Math.round(i),r.t=Math.round(o),r.b=Math.round(s),r.p=Math.round(e.margin.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,!e._replotting&&"{}"!==n&&n!==JSON.stringify(e._size))return c.plot(t)},m.graphJson=function(t,e,r,n,a){function i(t){if("function"==typeof t)return null;if(d.isPlainObject(t)){var e,n,a={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0&&!d.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;a[e]=i(t[e])}return a}return Array.isArray(t)?t.map(i):d.isJSDate(t)?d.ms2DateTimeLocal(+t):t}(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&m.supplyDefaults(t);var o=a?t._fullData:t.data,s=a?t._fullLayout:t.layout,l=(t._transitionData||{})._frames,u={data:(o||[]).map(function(t){var r=i(t);return e&&delete r.fit,r})};return e||(u.layout=i(s)),t.framework&&t.framework.isPolar&&(u=t.framework.getConfig()),l&&(u.frames=i(l)),"object"===n?u:JSON.stringify(u)},m.modifyFrames=function(t,e){var r,n,a,i=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){x=!0}),a.redraw&&t._transitionData._interruptCallbacks.push(function(){return c.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var o,s,l=0,u=0,h=t._fullLayout._basePlotModules,p=!1;if(r)for(s=0;s=0,S=L?h.angularAxis.domain:n.extent(k),C=Math.abs(k[1]-k[0]);T&&!M&&(C=0);var I=S.slice();E&&M&&(I[1]+=C);var O=h.angularAxis.ticksCount||4;O>8&&(O=O/(O/8)+O%8),h.angularAxis.ticksStep&&(O=(I[1]-I[0])/O);var R=h.angularAxis.ticksStep||(I[1]-I[0])/(O*(h.minorTicks+1));A&&(R=Math.max(Math.round(R),1)),I[2]||(I[2]=R);var D=n.range.apply(this,I);if(D=D.map(function(t,e){return parseFloat(t.toPrecision(12))}),l=n.scale.linear().domain(I.slice(0,2)).range("clockwise"===h.direction?[0,360]:[360,0]),f.layout.angularAxis.domain=l.domain(),f.layout.angularAxis.endPadding=E?C:0,void 0===(e=n.select(this).select("svg.chart-root"))||e.empty()){var P=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),z=this.appendChild(this.ownerDocument.importNode(P.documentElement,!0));e=n.select(z)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var N,F=e.select(".chart-group"),B={fill:"none",stroke:h.tickColor},j={"font-size":h.font.size,"font-family":h.font.family,fill:h.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+h.font.outlineColor}).join(",")};if(h.showLegend){N=e.select(".legend-group").attr({transform:"translate("+[x,h.margin.top]+")"}).style({display:"block"});var U=p.map(function(t,e){var r=s.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});s.Legend().config({data:p.map(function(t,e){return t.name||"Element"+e}),legendConfig:i({},s.Legend.defaultConfig().legendConfig,{container:N,elements:U,reverseOrder:h.legend.reverseOrder})})();var H=N.node().getBBox();x=Math.min(h.width-H.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2,x=Math.max(10,x),w=[h.margin.left+x,h.margin.top+x],a.range([0,x]),f.layout.radialAxis.domain=a.domain(),N.attr("transform","translate("+[w[0]+x,w[1]-x]+")")}else N=e.select(".legend-group").style({display:"none"});e.attr({width:h.width,height:h.height}).style({opacity:h.opacity}),F.attr("transform","translate("+w+")").style({cursor:"crosshair"});var V=[(h.width-(h.margin.left+h.margin.right+2*x+(H?H.width:0)))/2,(h.height-(h.margin.top+h.margin.bottom+2*x))/2];if(V[0]=Math.max(0,V[0]),V[1]=Math.max(0,V[1]),e.select(".outer-group").attr("transform","translate("+V+")"),h.title){var G=e.select("g.title-group text").style(j).text(h.title),q=G.node().getBBox();G.attr({x:w[0]-q.width/2,y:w[1]-x-20})}var X=e.select(".radial.axis-group");if(h.radialAxis.gridLinesVisible){var Y=X.selectAll("circle.grid-circle").data(a.ticks(5));Y.enter().append("circle").attr({class:"grid-circle"}).style(B),Y.attr("r",a),Y.exit().remove()}X.select("circle.outside-circle").attr({r:x}).style(B);var W=e.select("circle.background-circle").attr({r:x}).style({fill:h.backgroundColor,stroke:h.stroke});if(h.radialAxis.visible){var Z=n.svg.axis().scale(a).ticks(5).tickSize(5);X.call(Z).attr({transform:"rotate("+h.radialAxis.orientation+")"}),X.selectAll(".domain").style(B),X.selectAll("g>text").text(function(t,e){return this.textContent+h.radialAxis.ticksSuffix}).style(j).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===h.radialAxis.tickOrientation?"rotate("+-h.radialAxis.orientation+") translate("+[0,j["font-size"]]+")":"translate("+[0,j["font-size"]]+")"}}),X.selectAll("g>line").style({stroke:"black"})}var Q=e.select(".angular.axis-group").selectAll("g.angular-tick").data(D),$=Q.enter().append("g").classed("angular-tick",!0);Q.attr({transform:function(t,e){return"rotate("+u(t,e)+")"}}).style({display:h.angularAxis.visible?"block":"none"}),Q.exit().remove(),$.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(h.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(h.minorTicks+1)==0)}).style(B),$.selectAll(".minor").style({stroke:h.minorTickColor}),Q.select("line.grid-line").attr({x1:h.tickLength?x-h.tickLength:0,x2:x}).style({display:h.angularAxis.gridLinesVisible?"block":"none"}),$.append("text").classed("axis-text",!0).style(j);var K=Q.select("text.axis-text").attr({x:x+h.labelOffset,dy:o+"em",transform:function(t,e){var r=u(t,e),n=x+h.labelOffset,a=h.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-r+" "+n+" 0)":"radial"==a?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:h.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(h.minorTicks+1)!=0?"":A?A[t]+h.angularAxis.ticksSuffix:t+h.angularAxis.ticksSuffix}).style(j);h.angularAxis.rewriteTicks&&K.text(function(t,e){return e%(h.minorTicks+1)!=0?"":h.angularAxis.rewriteTicks(this.textContent,e)});var J=n.max(F.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));N.attr({transform:"translate("+[x+J,h.margin.top]+")"});var tt=e.select("g.geometry-group").selectAll("g").size()>0,et=e.select("g.geometry-group").selectAll("g.geometry").data(p);if(et.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),et.exit().remove(),p[0]||tt){var rt=[];p.forEach(function(t,e){var r={};r.radialScale=a,r.angularScale=l,r.container=et.filter(function(t,r){return r==e}),r.geometry=t.geometry,r.orientation=h.orientation,r.direction=h.direction,r.index=e,rt.push({data:t,geometryConfig:r})});var nt=n.nest().key(function(t,e){return void 0!==t.data.groupId||"unstacked"}).entries(rt),at=[];nt.forEach(function(t,e){"unstacked"===t.key?at=at.concat(t.values.map(function(t,e){return[t]})):at.push(t.values)}),at.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return i(s[r].defaultConfig(),t)});s[r]().config(n)()})}var it,ot,st=e.select(".guides-group"),lt=e.select(".tooltips-group"),ut=s.tooltipPanel().config({container:lt,fontSize:8})(),ct=s.tooltipPanel().config({container:lt,fontSize:8})(),ft=s.tooltipPanel().config({container:lt,hasTick:!0})();if(!M){var ht=st.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});F.on("mousemove.angular-guide",function(t,e){var r=s.util.getMousePos(W).angle;ht.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-h.orientation)%360;it=l.invert(n);var a=s.util.convertToCartesian(x+12,r+180);ut.text(s.util.round(it)).move([a[0]+w[0],a[1]+w[1]])}).on("mouseout.angular-guide",function(t,e){st.select("line").style({opacity:0})})}var dt=st.select("circle").style({stroke:"grey",fill:"none"});F.on("mousemove.radial-guide",function(t,e){var r=s.util.getMousePos(W).radius;dt.attr({r:r}).style({opacity:.5}),ot=a.invert(s.util.getMousePos(W).radius);var n=s.util.convertToCartesian(r,h.radialAxis.orientation);ct.text(s.util.round(ot)).move([n[0]+w[0],n[1]+w[1]])}).on("mouseout.radial-guide",function(t,e){dt.style({opacity:0}),ft.hide(),ut.hide(),ct.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,r){var a=n.select(this),i=this.style.fill,o="black",l=this.style.opacity||1;if(a.attr({"data-opacity":l}),i&&"none"!==i){a.attr({"data-fill":i}),o=n.hsl(i).darker().toString(),a.style({fill:o,opacity:1});var u={t:s.util.round(t[0]),r:s.util.round(t[1])};M&&(u.t=A[t[0]]);var c="t: "+u.t+", r: "+u.r,f=this.getBoundingClientRect(),h=e.node().getBoundingClientRect(),d=[f.left+f.width/2-V[0]-h.left,f.top+f.height/2-V[1]-h.top];ft.config({color:o}).text(c),ft.move(d)}else i=this.style.stroke||"black",a.attr({"data-stroke":i}),o=n.hsl(i).darker().toString(),a.style({stroke:o,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ft.show()}).on("mouseout.tooltip",function(t,e){ft.hide();var r=n.select(this),a=r.attr("data-fill");a?r.style({fill:a,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})}),d}var e,r,a,l,u={data:[],layout:{}},c={},f={},h=n.dispatch("hover"),d={};return d.render=function(e){return t(e),this},d.config=function(t){if(!arguments.length)return u;var e=s.util.cloneJson(t);return e.data.forEach(function(t,e){u.data[e]||(u.data[e]={}),i(u.data[e],s.Axis.defaultConfig().data[0]),i(u.data[e],t)}),i(u.layout,s.Axis.defaultConfig().layout),i(u.layout,e.layout),this},d.getLiveConfig=function(){return f},d.getinputConfig=function(){return c},d.radialScale=function(t){return a},d.angularScale=function(t){return l},d.svg=function(){return e},n.rebind(d,h,"on"),d},s.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},s.util={},s.DATAEXTENT="dataExtent",s.AREA="AreaChart",s.LINE="LinePlot",s.DOT="DotPlot",s.BAR="BarChart",s.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},s.util._extend=function(t,e){for(var r in t)e[r]=t[r]},s.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},s.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180;return[e,t(n)]})},s.util.dataFromEquation=function(t,e,r){var a=e||6,i=[],o=[];n.range(0,360+a,a).forEach(function(e,r){var n=e*Math.PI/180,a=t(n);i.push(e),o.push(a)});var s={t:i,r:o};return r&&(s.name=r),s},s.util.ensureArray=function(t,e){if(void 0===t)return null;var r=[].concat(t);return n.range(e).map(function(t,e){return r[e]||r[0]})},s.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=s.util.ensureArray(t[e],r)}),t},s.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},s.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},s.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},s.util.arrayLast=function(t){return t[t.length-1]},s.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},s.util.flattenArray=function(t){for(var e=[];!s.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},s.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},s.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},s.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},s.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],a=e[1],i={};return i.x=r,i.y=a,i.pos=e,i.angle=180*(Math.atan2(a,r)+Math.PI)/Math.PI,i.radius=Math.sqrt(r*r+a*a),i},s.util.duplicatesCount=function(t){for(var e,r={},n={},a=0,i=t.length;a0)){var s=n.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({class:"line",d:h(o),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return m.fill(r,a,i)},"fill-opacity":0,stroke:function(t,e){return m.stroke(r,a,i)},"stroke-width":function(t,e){return m["stroke-width"](r,a,i)},"stroke-dasharray":function(t,e){return m["stroke-dasharray"](r,a,i)},opacity:function(t,e){return m.opacity(r,a,i)},display:function(t,e){return m.display(r,a,i)}})}};var d=t.angularScale.range(),p=Math.abs(d[1]-d[0])/l[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(c+(e[2]||0))}).outerRadius(function(e){return t.radialScale(c+(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+u(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 a[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return void 0===e[n].data.visible||e[n].data.visible?"block":"none"}},v=n.select(this).selectAll("g.layer").data(l);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=[s.PolyChart.defaultConfig()],r=n.dispatch("hover"),a={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,r){e[r]||(e[r]={}),i(e[r],s.PolyChart.defaultConfig()),i(e[r],t)}),this):e},t.getColorScale=function(){},n.rebind(t,r,"on"),t},s.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},s.BarChart=function(){return s.PolyChart()},s.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},s.AreaChart=function(){return s.PolyChart()},s.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},s.DotPlot=function(){return s.PolyChart()},s.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},s.LinePlot=function(){return s.PolyChart()},s.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},s.Legend=function(){function t(){var r=e.legendConfig,a=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var a=i({},r.elements[e]);return a.name=t,a.color=[].concat(r.elements[e].color)[n],a})}),o=n.merge(a);o=o.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||void 0===r.elements[e].visibleInLegend)}),r.reverseOrder&&(o=o.reverse());var s=r.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map(function(t,e){return t.color}),u=r.fontSize,c=null==r.isContinuous?"number"==typeof o[0]:r.isContinuous,f=c?r.height:u*o.length,h=s.classed("legend-group",!0),d=h.selectAll("svg").data([0]),p=d.enter().append("svg").attr({width:300,height:f+u,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var g=n.range(o.length),m=n.scale[c?"linear":"ordinal"]().domain(g).range(l),v=n.scale[c?"linear":"ordinal"]().domain(g)[c?"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":-1!=n.svg.symbolTypes.indexOf(t)?n.svg.symbol().type(t).size(r)():n.svg.symbol().type("square").size(r)()};if(c){ var b=d.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);b.enter().append("stop"),b.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),d.append("rect").classed("legend-mark",!0).attr({height:r.height,width:r.colorBandWidth,fill:"url(#grad1)"})}else{var x=d.select(".legend-marks").selectAll("path.legend-mark").data(o);x.enter().append("path").classed("legend-mark",!0),x.attr({transform:function(t,e){return"translate("+[u/2,v(e)+u/2]+")"},d:function(t,e){var r=t.symbol;return y(r,u)},fill:function(t,e){return m(e)}}),x.exit().remove()}var _=n.svg.axis().scale(v).orient("right"),w=d.select("g.legend-axis").attr({transform:"translate("+[c?r.colorBandWidth:u,u/2]+")"}).call(_);return w.selectAll(".domain").style({fill:"none",stroke:"none"}),w.selectAll("line").style({fill:"none",stroke:c?r.textColor:"none"}),w.selectAll("text").style({fill:r.textColor,"font-size":r.fontSize}).text(function(t,e){return o[e].name}),t}var e=s.Legend.defaultConfig(),r=n.dispatch("hover");return t.config=function(t){return arguments.length?(i(e,t),this):e},n.rebind(t,r,"on"),t},s.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},s.tooltipPanel=function(){var t,e,r,a={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},o="tooltip-"+s.tooltipPanel.uid++,l=function(){t=a.container.selectAll("g."+o).data([0]);var n=t.enter().append("g").classed(o,!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+10,dy:.3*+a.fontSize}),l};return l.text=function(i){var o=n.hsl(a.color).l,s=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",c=i||"";e.style({fill:u,"font-size":a.fontSize+"px"}).text(c);var f=a.padding,h=e.node().getBBox(),d={fill:a.color,stroke:s,"stroke-width":"2px"},p=h.width+2*f+10,g=h.height+2*f;return r.attr({d:"M"+[[10,-g/2],[10,-g/4],[a.hasTick?0:10,0],[10,g/4],[10,g/2],[p,g/2],[p,-g/2]].join("L")+"Z"}).style(d),t.attr({transform:"translate("+[10,-g/2+2*f]+")"}),t.style({display:"block"}),l},l.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),l},l.hide=function(){if(t)return t.style({display:"none"}),l},l.show=function(){if(t)return t.style({display:"block"}),l},l.config=function(t){return i(a,t),l},l},s.tooltipPanel.uid=1,s.adapter={},s.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=i({},t);return[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]].forEach(function(t,r){s.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var a=s.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=a.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)})}if(t.layout){var o=i({},t.layout);if([[o,["plot_bgcolor"],["backgroundColor"]],[o,["showlegend"],["showLegend"]],[o,["radialaxis"],["radialAxis"]],[o,["angularaxis"],["angularAxis"]],[o.angularaxis,["showline"],["gridLinesVisible"]],[o.angularaxis,["showticklabels"],["labelsVisible"]],[o.angularaxis,["nticks"],["ticksCount"]],[o.angularaxis,["tickorientation"],["tickOrientation"]],[o.angularaxis,["ticksuffix"],["ticksSuffix"]],[o.angularaxis,["range"],["domain"]],[o.angularaxis,["endpadding"],["endPadding"]],[o.radialaxis,["showline"],["gridLinesVisible"]],[o.radialaxis,["tickorientation"],["tickOrientation"]],[o.radialaxis,["ticksuffix"],["ticksSuffix"]],[o.radialaxis,["range"],["domain"]],[o.angularAxis,["showline"],["gridLinesVisible"]],[o.angularAxis,["showticklabels"],["labelsVisible"]],[o.angularAxis,["nticks"],["ticksCount"]],[o.angularAxis,["tickorientation"],["tickOrientation"]],[o.angularAxis,["ticksuffix"],["ticksSuffix"]],[o.angularAxis,["range"],["domain"]],[o.angularAxis,["endpadding"],["endPadding"]],[o.radialAxis,["showline"],["gridLinesVisible"]],[o.radialAxis,["tickorientation"],["tickOrientation"]],[o.radialAxis,["ticksuffix"],["ticksSuffix"]],[o.radialAxis,["range"],["domain"]],[o.font,["outlinecolor"],["outlineColor"]],[o.legend,["traceorder"],["reverseOrder"]],[o,["labeloffset"],["labelOffset"]],[o,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(t,r){s.util.translator.apply(null,t.concat(e))}),e?(void 0!==o.tickLength&&(o.angularaxis.ticklen=o.tickLength,delete o.tickLength),o.tickColor&&(o.angularaxis.tickcolor=o.tickColor,delete o.tickColor)):(o.angularAxis&&void 0!==o.angularAxis.ticklen&&(o.tickLength=o.angularAxis.ticklen),o.angularAxis&&void 0!==o.angularAxis.tickcolor&&(o.tickColor=o.angularAxis.tickcolor)),o.legend&&"boolean"!=typeof o.legend.reverseOrder&&(o.legend.reverseOrder="normal"!=o.legend.reverseOrder),o.legend&&"boolean"==typeof o.legend.traceorder&&(o.legend.traceorder=o.legend.traceorder?"reversed":"normal",delete o.legend.reverseOrder),o.margin&&void 0!==o.margin.t){var l=["t","r","b","l","pad"],u=["top","right","bottom","left","pad"],c={};n.entries(o.margin).forEach(function(t,e){c[u[l.indexOf(t.key)]]=t.value}),o.margin=c}e&&(delete o.needsEndSpacing,delete o.minorTickColor,delete o.minorTicks,delete o.angularaxis.ticksCount,delete o.angularaxis.ticksCount,delete o.angularaxis.ticksStep,delete o.angularaxis.rewriteTicks,delete o.angularaxis.nticks,delete o.radialaxis.ticksCount,delete o.radialaxis.ticksCount,delete o.radialaxis.ticksStep,delete o.radialaxis.rewriteTicks,delete o.radialaxis.nticks),r.layout=o}return r},t}},{"../../constants/alignment":330,"../../lib":353,d3:62}],434:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=a.extendDeepAll,u=e.exports={};u.framework=function(t){function e(e,a){return a&&(f=a),n.select(n.select(f).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),r=r?l(r,e):e,i||(i=o.Axis()),c=o.adapter.plotly().convert(r),i.config(c).render(f),t.data=r.data,t.layout=r.layout,u.fillLayout(t),r}var r,a,i,c,f,h=new s;return e.isPolar=!0,e.svg=function(){return i.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return o.adapter.plotly().convert(i.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:i.angularScale(),r:i.radialScale()}},e.setUndoPoint=function(){var t=this,e=o.util.cloneJson(r);!function(e,r){h.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,a),a=o.util.cloneJson(e)},e.undo=function(){h.undo()},e.redo=function(){h.redo()},e},u.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),a=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:i.background,_container:e,_paperdiv:r,_paper:a};t._fullLayout=l(o,t.layout)}},{"../../components/color":233,"../../lib":353,"./micropolar":433,"./undo_manager":435,d3:62}],435:[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-1!==n},hasRedo:function(){return n-1}var i=t("../lib"),o=t("../plots/plots"),s=i.extendFlat,l=i.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,i=t.data,u=t.layout,c=l([],i),f=l({},u,n(e.tileClass)),h=t._context||{};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")?"":e.html(t).text()});return e.remove(),r}function a(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}var i=t("d3"),o=t("../lib"),s=t("../components/drawing"),l=t("../components/color"),u=t("../constants/xmlns_namespaces"),c=/"/g,f=new RegExp('("TOBESTRIPPED)|(TOBESTRIPPED")',"g");e.exports=function(t,e,r){var h,d=t._fullLayout,p=d._paper,g=d._toppaper,m=d.width,v=d.height;p.insert("rect",":first-child").call(s.setRect,0,0,m,v).call(l.fill,d.paper_bgcolor);var y=d._basePlotModules||[];for(h=0;hs.end&&(s.start=s.end=(s.start+s.end)/2),e._input.contours||(e._input.contours={}),i(e._input.contours,{start:s.start,end:s.end,size:s.size}),e._input.autocontour=!0}else{var u=s.start,c=s.end,f=e._input.contours;if(u>c&&(s.start=f.start=c,c=s.end=f.end=u,u=s.start),!(s.size>0)){var h;h=u===c?1:n(u,c,e.ncontours).dtick,f.size=s.size=h}}return r}},{"../../lib":353,"../../plots/cartesian/axes":396,"../heatmap/calc":456}],447:[function(t,e,r){"use strict";var n=t("../../plots/plots"),a=t("../../components/colorbar/draw"),i=t("./make_color_map"),o=t("./end_plus");e.exports=function(t,e){var r=e[0].trace,s="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+s).remove(),!r.showscale)return void n.autoMargin(t,s);var l=a(t,s);e[0].t.cb=l;var u=r.contours,c=r.line,f=u.size||1,h=u.coloring,d=i(r,{isColorbar:!0});"heatmap"===h&&l.filllevels({start:r.zmin,end:r.zmax,size:(r.zmax-r.zmin)/254}),l.fillcolor("fill"===h||"heatmap"===h?d:"").line({color:"lines"===h?d:c.color,width:!1!==u.showlines?c.width:0,dash:c.dash}).levels({start:u.start,end:o(u),size:f}).options(r.colorbar)()}},{"../../components/colorbar/draw":236,"../../plots/plots":429,"./end_plus":450,"./make_color_map":451}],448:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes");e.exports=function(t,e,r){var i,o=n.coerce2(t,e,a,"contours.start"),s=n.coerce2(t,e,a,"contours.end"),l=!1===o||!1===s,u=r("contours.size");!(i=l?e.autocontour=!0:r("autocontour",!1))&&u||r("ncontours")}},{"../../lib":353,"./attributes":445}],449:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../heatmap/has_columns"),i=t("../heatmap/xyz_defaults"),o=t("./contours_defaults"),s=t("./style_defaults"),l=t("./attributes");e.exports=function(t,e,r,u){function c(r,a){return n.coerce(t,e,l,r,a)}if(!i(t,e,c,u))return void(e.visible=!1);c("text"),c("connectgaps",a(e)),o(t,e,c),s(t,e,c,u)}},{"../../lib":353,"../heatmap/has_columns":462,"../heatmap/xyz_defaults":466,"./attributes":445,"./contours_defaults":448,"./style_defaults":452}],450:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],451:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/colorscale"),i=t("./end_plus");e.exports=function(t){var e=t.contours,r=e.start,o=i(e),s=e.size||1,l=Math.floor((o-r)/s)+1,u="lines"===e.coloring?0:1;isFinite(s)||(s=1,l=1);var c,f,h=t.colorscale,d=h.length,p=new Array(d),g=new Array(d);if("heatmap"===e.coloring){for(t.zauto&&!1===t.autocontour&&(t.zmin=r-s/2,t.zmax=t.zmin+l*s),f=0;fI){r("x scale is not linear");break}}if(y.length&&"fast"===L){var O=(y[y.length-1]-y[0])/(y.length-1),R=Math.abs(O/100);for(w=0;wR){r("y scale is not linear");break}}}var D=c(_),P="scaled"===e.xtype?"":g,z=p(e,P,m,v,D,A),N="scaled"===e.ytype?"":y,F=p(e,N,b,x,_.length,k);E||(i.expand(A,z),i.expand(k,F));var B={x:z,y:F,z:_,text:e.text};if(s(e,_,"","z"),M&&e.contours&&"heatmap"===e.contours.coloring){var j={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};B.xfill=p(j,P,m,v,D,A),B.yfill=p(j,N,b,x,_.length,k)}return[B]}},{"../../components/colorscale/calc":239,"../../lib":353,"../../plots/cartesian/axes":396,"../../registry":436,"../histogram2d/calc":474,"./clean_2d_array":457,"./convert_column_xyz":459,"./find_empties":461,"./has_columns":462,"./interp2d":463,"./make_bound_array":464,"./max_row_length":465}],457:[function(t,e,r){"use strict";var n=t("fast-isnumeric") ;e.exports=function(t,e){var r,a,i,o,s,l;if(e){for(r=0,s=0;s=0;o--)i=h[o],r=i[0],a=i[1],(s=((f[[r-1,a]]||g)[2]+(f[[r+1,a]]||g)[2]+(f[[r,a-1]]||g)[2]+(f[[r,a+1]]||g)[2])/20)&&(l[i]=[r,a,s],h.splice(o,1),u=!0);if(!u)throw"findEmpties iterated with no new neighbors";for(i in l)f[i]=l[i],c.push(l[i])}return c.sort(function(t,e){return e[2]-t[2]})}},{"./max_row_length":465}],462:[function(t,e,r){"use strict";e.exports=function(t){return!Array.isArray(t.z[0])}},{}],463:[function(t,e,r){"use strict";function n(t){return.5-.25*Math.min(1,.5*t)}function a(t,e,r){var n,a,i,s,l,u,c,f,h,d,p,g,m,v=0;for(s=0;sg&&(v=Math.max(v,Math.abs(t[a][i]-p)/(m-g))))}return v}var i=t("../../lib"),o=[[-1,0],[1,0],[0,-1],[0,1]];e.exports=function(t,e,r){var o,s,l=1;if(Array.isArray(r))for(o=0;o.01;o++)l=a(t,e,n(l));return l>.01&&i.log("interp2d didn't converge quickly",l),t}},{"../../lib":353}],464:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e,r,a,i,o){var s,l,u,c=[],f=n.traceIs(t,"contour"),h=n.traceIs(t,"histogram"),d=n.traceIs(t,"gl2d");if(Array.isArray(e)&&e.length>1&&!h&&"category"!==o.type){var p=e.length;if(!(p<=i))return f?e.slice(0,i):e.slice(0,i+1);if(f||d)c=e.slice(0,i);else if(1===i)c=[e[0]-.5,e[0]+.5];else{for(c=[1.5*e[0]-.5*e[1]],u=1;u0&&(n=!0);for(var s=0;si){var o=i-r[t];return r[t]=i,o}}return 0},max:function(t,e,r,a){var i=a[e];if(n(i)){if(i=Number(i),!n(r[t]))return r[t]=i,i;if(r[t]0?Number(h):f;else if("string"!=typeof h)u.size=f;else{var d=h.charAt(0),p=h.substr(1);p=n(p)?Number(p):0,(p<=0||"date"!==i||"M"!==d||p!==Math.round(p))&&(u.size=f)}var g="autobin"+r;"boolean"!=typeof t[g]&&(t[g]=!((u.start||0===u.start)&&(u.end||0===u.end))),t[g]||delete t["nbins"+r]}},{"../../constants/numerical":334,"../../lib":353,"fast-isnumeric":68}],473:[function(t,e,r){"use strict";e.exports={percent:function(t,e){for(var r=t.length,n=100/e,a=0;ak&&g.splice(k,g.length-k),v.length>k&&v.splice(k,v.length-k),!e.autobinx&&e.xbins&&null!==e.xbins.start&&null!==e.xbins.end||(e.xbins=a.autoBin(g,p,e.nbinsx,"2d",y),"histogram2dcontour"===e.type&&(e.xbins.start=w(a.tickIncrement(x(e.xbins.start),e.xbins.size,!0,y)),e.xbins.end=w(a.tickIncrement(x(e.xbins.end),e.xbins.size,!1,y))),e._input.xbins=e.xbins,e._input.autobinx=e.autobinx),!e.autobiny&&e.ybins&&null!==e.ybins.start&&null!==e.ybins.end||(e.ybins=a.autoBin(v,m,e.nbinsy,"2d",b),"histogram2dcontour"===e.type&&(e.ybins.start=A(a.tickIncrement(_(e.ybins.start),e.ybins.size,!0,b)),e.ybins.end=A(a.tickIncrement(_(e.ybins.end),e.ybins.size,!1,b))),e._input.ybins=e.ybins,e._input.autobiny=e.autobiny),h=[];var M,T,E=[],L=[],S="string"==typeof e.xbins.size,C="string"==typeof e.ybins.size,I=S?[]:e.xbins,O=C?[]:e.ybins,R=0,D=[],P=e.histnorm,z=e.histfunc,N=-1!==P.indexOf("density"),F="max"===z||"min"===z,B=F?null:0,j=i.count,U=o[P],H=!1,V=[],G=[],q="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";q&&"count"!==z&&(H="avg"===z,j=i[z]);var X=e.xbins,Y=x(X.start),W=x(X.end)+(Y-a.tickIncrement(Y,X.size,!1,y))/1e6;for(d=Y;d=0&&M=0&&T<$&&(R+=j(M,d,h[T],q,D[T]));if(H)for(T=0;T<$;T++)R+=s(h[T],D[T]);if(U)for(T=0;T<$;T++)U(h[T],R,V,G[T]);return{x:g,x0:r,dx:u,y:v,y0:c,dy:f,z:h}}},{"../../lib":353,"../../plots/cartesian/axes":396,"../histogram/average":470,"../histogram/bin_functions":471,"../histogram/clean_bins":472,"../histogram/norm_functions":473}],475:[function(t,e,r){"use strict";var n=t("../../components/colorscale/color_attributes"),a=t("../../components/colorbar/attributes"),i=t("../../components/colorscale/scales"),o=t("../../plots/cartesian/layout_attributes"),s=t("../../plots/font_attributes"),l=t("../../lib/extend"),u=l.extendDeepAll,c=l.extendFlat;e.exports={domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},y:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},editType:"calc"},labelfont:s({editType:"calc"}),tickfont:s({editType:"calc"}),rangefont:s({editType:"calc"}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",editType:"calc"},tickvals:c({},o.tickvals,{editType:"calc"}),ticktext:c({},o.ticktext,{editType:"calc"}),tickformat:{valType:"string",dflt:"3s",editType:"calc"},visible:{valType:"boolean",dflt:!0,editType:"calc"},range:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc"},constraintrange:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc"},values:{valType:"data_array",dflt:[],editType:"calc"},editType:"calc"},line:c(u(n("line","calc"),{colorscale:{dflt:i.Viridis},autocolorscale:{dflt:!1}}),{showscale:{valType:"boolean",dflt:!1,editType:"calc"},colorbar:a,editType:"calc"})}},{"../../components/colorbar/attributes":234,"../../components/colorscale/color_attributes":240,"../../components/colorscale/scales":251,"../../lib/extend":344,"../../plots/cartesian/layout_attributes":407,"../../plots/font_attributes":420}],476:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plots/plots"),i=t("./plot"),o=t("../../constants/xmlns_namespaces"),s=t("./constants");r.name="parcoords",r.attr="type",r.plot=function(t){var e=a.getSubplotCalcData(t.calcdata,"parcoords","parcoords");e.length&&i(t,e)},r.clean=function(t,e,r,n){var a=n._has&&n._has("parcoords"),i=e._has&&e._has("parcoords");a&&!i&&(n._paperdiv.selectAll(".parcoords-line-layers").remove(),n._paperdiv.selectAll(".parcoords-line-layers").remove(),n._paperdiv.selectAll(".parcoords").remove(),n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},r.toSVG=function(t){function e(e){var n=this,a=n.toDataURL("image/png"),i=r.append("svg:image"),l=t._fullLayout._size,u=t._fullData[e.model.key].domain;i.attr({xmlns:o.svg,"xlink:href":a,x:l.l+l.w*u.x[0]-s.overdrag,y:l.t+l.h*(1-u.y[1]),width:(u.x[1]-u.x[0])*l.w+2*s.overdrag,height:(u.y[1]-u.y[0])*l.h,preserveAspectRatio:"none"})}var r=t._fullLayout._glimages,a=n.select(t).selectAll(".svg-container");a.filter(function(t,e){return e===a.size()-1}).selectAll(".parcoords-lines.context, .parcoords-lines.focus").each(e),window.setTimeout(function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}},{"../../constants/xmlns_namespaces":336,"../../plots/plots":429,"./constants":479,"./plot":484,d3:62}],477:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/calc"),i=t("../../lib"),o=t("../../lib/gup").wrap;e.exports=function(t,e){var r=!!e.line.colorscale&&i.isArray(e.line.color),s=r?e.line.color:Array.apply(0,Array(e.dimensions.reduce(function(t,e){return Math.max(t,e.values.length)},0))).map(function(){return.5}),l=r?e.line.colorscale:[[0,e.line.color],[1,e.line.color]];return n(e,"line")&&a(e,e.line.color,"line","c"),o({lineColor:s,cscale:l})}},{"../../components/colorscale/calc":239,"../../components/colorscale/has_colorscale":246,"../../lib":353,"../../lib/gup":350}],478:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l=r.line,u="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+u).remove(),void 0===l||!l.showscale)return void i.autoMargin(t,u);var c=l.color,f=l.cmin,h=l.cmax;n(f)||(f=a.aggNums(Math.min,null,c)),n(h)||(h=a.aggNums(Math.max,null,c));var d=e[0].t.cb=s(t,u),p=o.makeColorScaleFunc(o.extractScale(l.colorscale,f,h),{noNumericCheck:!0});d.fillcolor(p).filllevels({start:f,end:h,size:(h-f)/254}).options(l.colorbar)()}},{"../../components/colorbar/draw":236,"../../components/colorscale":247,"../../lib":353,"../../plots/plots":429,"fast-isnumeric":68}],479:[function(t,e,r){"use strict";e.exports={maxDimensionCount:60,overdrag:45,verticalPadding:2,tickDistance:50,canvasPixelRatio:1,blockLineCount:5e3,scatter:!1,layers:["contextLineLayer","focusLineLayer","pickLineLayer"],axisTitleOffset:28,axisExtentOffset:10,bar:{width:4,capturewidth:10,fillcolor:"magenta",fillopacity:1,strokecolor:"white",strokeopacity:1,strokewidth:1,handleheight:16,handleopacity:1,handleoverlap:0},cn:{axisExtentText:"axis-extent-text",parcoordsLineLayers:"parcoords-line-layers",parcoordsLineLayer:"parcoords-lines",parcoords:"parcoords",parcoordsControlView:"parcoords-control-view",yAxis:"y-axis",axisOverlays:"axis-overlays",axis:"axis",axisHeading:"axis-heading",axisTitle:"axis-title",axisExtent:"axis-extent",axisExtentTop:"axis-extent-top",axisExtentTopText:"axis-extent-top-text",axisExtentBottom:"axis-extent-bottom",axisExtentBottomText:"axis-extent-bottom-text",axisBrush:"axis-brush"},id:{filterBarPattern:"filter-bar-pattern"}}},{}],480:[function(t,e,r){"use strict";function n(t,e,r,n,a){a("line.color",r),s(t,"line")&&i.isArray(t.line.color)?(a("line.colorscale"),l(t,e,n,a,{prefix:"line.",cLetter:"c"})):a("line.color",r)}function a(t,e){function r(t,e){return i.coerce(n,a,o.dimensions,t,e)}var n,a,s,l=t.dimensions||[],c=e.dimensions=[],f=1/0;for(l.length>u&&(i.log("parcoords traces support up to "+u+" dimensions at the moment"),l.splice(u)),s=0;s0);d&&(r("label"),r("tickvals"),r("ticktext"),r("tickformat"),r("range"),r("constraintrange"),f=Math.min(f,a.values.length)),a._index=s,c.push(a)}if(isFinite(f))for(s=0;sf&&(a.values=a.values.slice(0,f));return c}var i=t("../../lib"),o=t("./attributes"),s=t("../../components/colorscale/has_colorscale"),l=t("../../components/colorscale/defaults"),u=t("./constants").maxDimensionCount;e.exports=function(t,e,r,s){function l(r,n){return i.coerce(t,e,o,r,n)}var u=a(t,e);n(t,e,r,s,l),l("domain.x"),l("domain.y"),Array.isArray(u)&&u.length||(e.visible=!1);var c={family:s.font.family,size:Math.round(s.font.size*(10/12)),color:s.font.color};i.coerceFont(l,"labelfont",c),i.coerceFont(l,"tickfont",c),i.coerceFont(l,"rangefont",c)}},{"../../components/colorscale/defaults":242,"../../components/colorscale/has_colorscale":246,"../../lib":353,"./attributes":475,"./constants":479}],481:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.moduleType="trace",n.name="parcoords",n.basePlotModule=t("./base_plot"),n.categories=["gl","noOpacity"],n.meta={},e.exports=n},{"./attributes":475,"./base_plot":476,"./calc":477,"./colorbar":478,"./defaults":480,"./plot":484}],482:[function(t,e,r){"use strict";function n(t){t.read({x:0,y:0,width:1,height:1,data:x})}function a(t,e,r,n,a){var i=t._gl;i.enable(i.SCISSOR_TEST),i.scissor(e,r,n,a),t.clear({color:[0,0,0,0],depth:1})}function i(t,e,r,i,o,s){function l(n){var c;c=Math.min(i,o-n*i),s.offset=v*n*i,s.count=v*c,0===n&&(window.cancelAnimationFrame(r.currentRafs[u]),delete r.currentRafs[u],a(t,s.scissorX,s.scissorY,s.scissorWidth,s.viewBoxSize[1])),r.clearOnly||(e(s),n*i+c>>8*e)%256/255}function u(t,e,r,n){for(var a=[],i=0;i=m-4?l(i,m-2-s):.5);return a}function c(t,e,r){var n,a,i,o=[];for(a=0;ah&&(h=t[l].dim2.canvasX,c=l),t[l].dim1.canvasXa)return i;a=o,i=n[r]}return n[n.length-1]}function o(t,e){return function(r,n){if(e){var a=e[n];return null===a||void 0===a?t(r):a}return t(r)}}function s(t,e,r){var n=a(r),i=r.ticktext;return r.tickvals?b.scale.ordinal().domain(r.tickvals.map(o(b.format(r.tickformat),i))).range(r.tickvals.map(function(t){return(t-n[0])/(n[1]-n[0])}).map(function(r){return t-e+r*(e-(t-e))})):b.scale.linear().domain(n).range([t-e,e])}function l(t,e){return b.scale.linear().range([t-e,e])}function u(t){return b.scale.linear().domain(a(t))}function c(t){var e=a(t);return t.tickvals&&b.scale.ordinal().domain(t.tickvals).range(t.tickvals.map(function(t){return(t-e[0])/(e[1]-e[0])}))}function f(t){var e=t.map(function(t){return t[0]}),r=t.map(function(t){return t[1]}),n=r.map(function(t){return b.rgb(t)}),a=function(t){return function(e){return e[t]}},i="rgb".split("").map(function(t){return b.scale.linear().clamp(!0).domain(e).range(n.map(a(t)))});return function(t){return i.map(function(e){return e(t)})}}function h(t,e,r){var a=A(e),i=a.trace,o=a.lineColor,s=a.cscale,l=i.line,c=i.domain,h=i.dimensions,d=t.width,p=i.labelfont,g=i.tickfont,m=i.rangefont,b=y.extendDeep({},l,{color:o.map(u({values:o,range:[l.cmin,l.cmax]})),blockLineCount:v.blockLineCount,canvasOverdrag:v.overdrag*v.canvasPixelRatio}),x=Math.floor(d*(c.x[1]-c.x[0])),_=Math.floor(t.height*(c.y[1]-c.y[0])),w=t.margin||{l:80,r:80,t:100,b:80},k=x,M=_;return{key:r,colCount:h.filter(n).length,dimensions:h,tickDistance:v.tickDistance,unitToColor:f(s),lines:b,labelFont:p,tickFont:g,rangeFont:m,translateX:c.x[0]*d,translateY:t.height-c.y[1]*t.height,pad:w, canvasWidth:k*v.canvasPixelRatio+2*b.canvasOverdrag,canvasHeight:M*v.canvasPixelRatio,width:k,height:M,canvasPixelRatio:v.canvasPixelRatio}}function d(t){var e=t.width,r=t.height,a=t.dimensions,i=t.canvasPixelRatio,o=function(r){return e*r/Math.max(1,t.colCount-1)},f=v.verticalPadding/(r*i),h=1-2*f,d=function(t){return f+h*t},p={key:t.key,xScale:o,model:t},g={};return p.dimensions=a.filter(n).map(function(e,n){var a=u(e),f=g[e.label];return g[e.label]=(f||0)+1,{key:e.label+(f?"__"+f:""),label:e.label,tickFormat:e.tickformat,tickvals:e.tickvals,ticktext:e.ticktext,ordinal:!!e.tickvals,scatter:v.scatter||e.scatter,xIndex:n,crossfilterDimensionIndex:n,visibleIndex:e._index,height:r,values:e.values,paddedUnitValues:e.values.map(a).map(d),xScale:o,x:o(n),canvasX:o(n)*i,unitScale:l(r,v.verticalPadding),domainScale:s(r,v.verticalPadding,e),ordinalScale:c(e),domainToUnitScale:a,filter:e.constraintrange?e.constraintrange.map(a):[0,1],parent:p,model:t}}),p}function p(t){return v.layers.map(function(e){return{key:e,context:"contextLineLayer"===e,pick:"pickLineLayer"===e,viewModel:t,model:t.model}})}function g(t){t.classed(v.cn.axisExtentText,!0).attr("text-anchor","middle").style("cursor","default").style("user-select","none")}var m=t("./lines"),v=t("./constants"),y=t("../../lib"),b=t("d3"),x=t("../../components/drawing"),_=t("../../lib/gup").keyFun,w=t("../../lib/gup").repeat,A=t("../../lib/gup").unwrap;e.exports=function(t,e,r,n,a){function o(t){var e=t.selectAll("defs").data(w,_);e.enter().append("defs");var r=e.selectAll("#"+v.id.filterBarPattern).data(w,_);r.enter().append("pattern").attr("id",v.id.filterBarPattern).attr("patternUnits","userSpaceOnUse"),r.attr("x",-v.bar.width).attr("width",v.bar.capturewidth).attr("height",function(t){return t.model.height});var n=r.selectAll("rect").data(w,_);n.enter().append("rect").attr("shape-rendering","crispEdges"),n.attr("height",function(t){return t.model.height}).attr("width",v.bar.width).attr("x",v.bar.width/2).attr("fill",v.bar.fillcolor).attr("fill-opacity",v.bar.fillopacity).attr("stroke",v.bar.strokecolor).attr("stroke-opacity",v.bar.strokeopacity).attr("stroke-width",v.bar.strokewidth)}function s(t){return t.dimensions.some(function(t){return 0!==t.filter[0]||1!==t.filter[1]})}function l(t,e){for(var r=e.panels||(e.panels=[]),n=t.each(function(t){return t})[e.key].map(function(t){return t.__data__}),a=n.length-1,i=0;i<1;i++)for(var o=0;o=r||s>=n)return;var l=t.lineLayer.readPixel(o,n-1-s),u=0!==l[3],c=u?l[2]+256*(l[1]+256*l[0]):null,f={x:o,y:s,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:c};c!==O&&(u?a.hover(f):a.unhover&&a.unhover(f),O=c)}}),C.style("margin",function(t){var e=t.model.pad;return e.t+"px "+e.r+"px "+e.b+"px "+e.l+"px"}).attr("width",function(t){return t.model.canvasWidth}).attr("height",function(t){return t.model.canvasHeight}).style("width",function(t){return t.model.width+2*v.overdrag+"px"}).style("height",function(t){return t.model.height+"px"}).style("opacity",function(t){return t.pick?.01:1}),e.style("background","rgba(255, 255, 255, 0)");var R=e.selectAll("."+v.cn.parcoords).data(L,_);R.exit().remove(),R.enter().append("g").classed(v.cn.parcoords,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","none").call(o),R.attr("width",function(t){return t.model.width+t.model.pad.l+t.model.pad.r}).attr("height",function(t){return t.model.height+t.model.pad.t+t.model.pad.b}).attr("transform",function(t){return"translate("+t.model.translateX+","+t.model.translateY+")"});var D=R.selectAll("."+v.cn.parcoordsControlView).data(w,_);D.enter().append("g").classed(v.cn.parcoordsControlView,!0).style("box-sizing","content-box"),D.attr("transform",function(t){return"translate("+t.model.pad.l+","+t.model.pad.t+")"});var P=D.selectAll("."+v.cn.yAxis).data(function(t){return t.dimensions},_);P.enter().append("g").classed(v.cn.yAxis,!0).each(function(t){I.dimensions.push(t)}),D.each(function(t){c(P,t)}),C.each(function(t){t.lineLayer=m(this,t.model.lines,t.model.canvasWidth,t.model.canvasHeight,t.viewModel.dimensions,t.viewModel.panels,t.model.unitToColor,t.context,t.pick,v.scatter),t.viewModel[t.key]=t.lineLayer,I.renderers.push(function(){t.lineLayer.render(t.viewModel.panels,!0)}),t.lineLayer.render(t.viewModel.panels,!t.context)}),P.attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),P.call(b.behavior.drag().origin(function(t){return t}).on("drag",function(t){var e=t.parent;E=!1,T||(t.x=Math.max(-v.overdrag,Math.min(t.model.width+v.overdrag,b.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,P.sort(function(t,e){return t.x-e.x}).each(function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio}),c(P,e),P.filter(function(e){return 0!==Math.abs(t.xIndex-e.xIndex)}).attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),b.select(this).attr("transform","translate("+t.x+", 0)"),P.each(function(r,n,a){a===t.parent.key&&(e.dimensions[n]=r)}),e.contextLineLayer&&e.contextLineLayer.render(e.panels,!1,!s(e)),e.focusLineLayer.render&&e.focusLineLayer.render(e.panels))}).on("dragend",function(t){var e=t.parent;if(T)return void("ending"===T&&(T=!1));t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,c(P,e),b.select(this).attr("transform",function(t){return"translate("+t.x+", 0)"}),e.contextLineLayer&&e.contextLineLayer.render(e.panels,!1,!s(e)),e.focusLineLayer&&e.focusLineLayer.render(e.panels),e.pickLineLayer&&e.pickLineLayer.render(e.panels,!0),E=!0,a&&a.axesMoved&&a.axesMoved(e.key,e.dimensions.map(function(t){return t.crossfilterDimensionIndex}))})),P.exit().remove();var z=P.selectAll("."+v.cn.axisOverlays).data(w,_);z.enter().append("g").classed(v.cn.axisOverlays,!0),z.selectAll("."+v.cn.axis).remove();var N=z.selectAll("."+v.cn.axis).data(w,_);N.enter().append("g").classed(v.cn.axis,!0),N.each(function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,n=r.domain();b.select(this).call(b.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?n:null).tickFormat(t.ordinal?function(t){return t}:null).scale(r)),x.font(N.selectAll("text"),t.model.tickFont)}),N.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),N.selectAll("text").style("text-shadow","1px 1px 1px #fff, -1px -1px 1px #fff, 1px -1px 1px #fff, -1px 1px 1px #fff").style("cursor","default").style("user-select","none");var F=z.selectAll("."+v.cn.axisHeading).data(w,_);F.enter().append("g").classed(v.cn.axisHeading,!0);var B=F.selectAll("."+v.cn.axisTitle).data(w,_);B.enter().append("text").classed(v.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("user-select","none").style("pointer-events","auto"),B.attr("transform","translate(0,"+-v.axisTitleOffset+")").text(function(t){return t.label}).each(function(t){x.font(B,t.model.labelFont)});var j=z.selectAll("."+v.cn.axisExtent).data(w,_);j.enter().append("g").classed(v.cn.axisExtent,!0);var U=j.selectAll("."+v.cn.axisExtentTop).data(w,_);U.enter().append("g").classed(v.cn.axisExtentTop,!0),U.attr("transform","translate(0,"+-v.axisExtentOffset+")");var H=U.selectAll("."+v.cn.axisExtentTopText).data(w,_);H.enter().append("text").classed(v.cn.axisExtentTopText,!0).call(g),H.text(function(t){return f(t)(t.domainScale.domain().slice(-1)[0])}).each(function(t){x.font(H,t.model.rangeFont)});var V=j.selectAll("."+v.cn.axisExtentBottom).data(w,_);V.enter().append("g").classed(v.cn.axisExtentBottom,!0),V.attr("transform",function(t){return"translate(0,"+(t.model.height+v.axisExtentOffset)+")"});var G=V.selectAll("."+v.cn.axisExtentBottomText).data(w,_);G.enter().append("text").classed(v.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(g),G.text(function(t){return f(t)(t.domainScale.domain()[0])}).each(function(t){x.font(G,t.model.rangeFont)});var q=z.selectAll("."+v.cn.axisBrush).data(w,_),X=q.enter().append("g").classed(v.cn.axisBrush,!0);q.each(function(t){t.brush||(t.brush=b.svg.brush().y(t.unitScale).on("brushstart",y).on("brush",k).on("brushend",M),0===t.filter[0]&&1===t.filter[1]||t.brush.extent(t.filter),b.select(this).call(t.brush))}),X.selectAll("rect").attr("x",-v.bar.capturewidth/2).attr("width",v.bar.capturewidth),X.selectAll("rect.extent").attr("fill","url(#"+v.id.filterBarPattern+")").style("cursor","ns-resize").filter(function(t){return 0===t.filter[0]&&1===t.filter[1]}).attr("y",-100),X.selectAll(".resize rect").attr("height",v.bar.handleheight).attr("opacity",0).style("visibility","visible"),X.selectAll(".resize.n rect").style("cursor","n-resize").attr("y",v.bar.handleoverlap-v.bar.handleheight),X.selectAll(".resize.s rect").style("cursor","s-resize").attr("y",v.bar.handleoverlap);var Y=!1,W=!1;return I}},{"../../components/drawing":257,"../../lib":353,"../../lib/gup":350,"./constants":479,"./lines":482,d3:62}],484:[function(t,e,r){"use strict";var n=t("./parcoords");e.exports=function(t,e){var r=t._fullLayout,a=r._paper,i=r._paperdiv,o={},s={},l=r._size;e.forEach(function(e,r){o[r]=t.data[r].dimensions,s[r]=t.data[r].dimensions.slice()});var u=function(e,r,n){var a=s[e][r],i=a.constraintrange;i&&2===i.length||(i=a.constraintrange=[]),i[0]=n[0],i[1]=n[1],t.emit("plotly_restyle")},c=function(e){t.emit("plotly_hover",e)},f=function(e){t.emit("plotly_unhover",e)},h=function(e,r){function n(t){return!("visible"in t)||t.visible}function a(t,e,r){var n=e.indexOf(r),a=t.indexOf(n);return-1===a&&(a+=e.length),a}var i=function(t){return function(e,n){return a(r,t,e)-a(r,t,n)}}(s[e].filter(n));o[e].sort(i),s[e].filter(function(t){return!n(t)}).sort(function(t){return s[e].indexOf(t)}).forEach(function(t){o[e].splice(o[e].indexOf(t),1),o[e].splice(s[e].indexOf(t),0,t)}),t.emit("plotly_restyle")};n(i,a,e,{width:l.w,height:l.h,margin:{t:l.t,r:l.r,b:l.b,l:l.l}},{filterChanged:u,hover:c,unhover:f,axesMoved:h})}},{"./parcoords":483}],485:[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 i=r.marker.line.width||0;Array.isArray(i)&&(i=i[e.i]||0),t.style({"stroke-width":i}).call(n.fill,e.color).call(n.stroke,a)}},{"../../components/color":233}],486:[function(t,e,r){"use strict";var n=t("../scattergl/attributes");e.exports={x:n.x,y:n.y,xy:{valType:"data_array",editType:"calc"},indices:{valType:"data_array",editType:"calc"},xbounds:{valType:"data_array",editType:"calc"},ybounds:{valType:"data_array",editType:"calc"},text:n.text,marker:{color:{valType:"color",arrayOk:!1,editType:"calc"},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,editType:"calc"},blend:{valType:"boolean",dflt:null,editType:"calc"},sizemin:{valType:"number",min:.1,max:2,dflt:.5,editType:"calc"},sizemax:{valType:"number",min:.1,dflt:20,editType:"calc"},border:{color:{valType:"color",arrayOk:!1,editType:"calc"},arearatio:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},editType:"calc"},editType:"calc"}}},{"../scattergl/attributes":516}],487:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.type="pointcloud",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=i(t.glplot,this.pointcloudOptions),this.pointcloud._trace=this}function a(t,e){var r=new n(t,e.uid);return r.update(e),r}var i=t("gl-pointcloud2d"),o=t("../../lib/str2rgbarray"),s=t("../scatter/get_trace_color"),l=["xaxis","yaxis"],u=n.prototype;u.handlePick=function(t){var e=this.idToIndex[t.pointId];return{trace:this,dataCoord:t.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*e],this.pickXYData[2*e+1]]:[this.pickXData[e],this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:this.color,name:this.name,pointIndex:e,hoverinfo:this.hoverinfo}},u.update=function(t){this.index=t.index,this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.updateFast(t),this.color=s(t,{})},u.updateFast=function(t){var e,r,n,a,i,s,l=this.xData=this.pickXData=t.x,u=this.yData=this.pickYData=t.y,c=this.pickXYData=t.xy,f=t.xbounds&&t.ybounds,h=t.indices,d=this.bounds;if(c){if(n=c,e=c.length>>>1,f)d[0]=t.xbounds[0],d[2]=t.xbounds[1],d[1]=t.ybounds[0],d[3]=t.ybounds[1];else for(s=0;sd[2]&&(d[2]=a),id[3]&&(d[3]=i);if(h)r=h;else for(r=new Int32Array(e),s=0;sd[2]&&(d[2]=a),id[3]&&(d[3]=i);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var p=o(t.marker.color),g=o(t.marker.border.color),m=t.opacity*t.marker.opacity;p[3]*=m,this.pointcloudOptions.color=p;var v=t.marker.blend;if(null===v){v=l.length<100||u.length<100}this.pointcloudOptions.blend=v,g[3]*=m,this.pointcloudOptions.borderColor=g;var y=t.marker.sizemin,b=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=y,this.pointcloudOptions.sizeMax=b,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions),this.expandAxesFast(d,b/2)},u.expandAxesFast=function(t,e){for(var r,n,a,i=e||.5,o=0;o<2;o++)r=this.scene[l[o]],n=r._min,n||(n=[]),n.push({val:t[o],pad:i}),a=r._max,a||(a=[]),a.push({val:t[o+2],pad:i})},u.dispose=function(){this.pointcloud.dispose()},e.exports=a},{"../../lib/str2rgbarray":374,"../scatter/get_trace_color":500,"gl-pointcloud2d":111}],488:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes");e.exports=function(t,e,r){function i(r,i){return n.coerce(t,e,a,r,i)}i("x"),i("y"),i("xbounds"),i("ybounds"),t.xy&&t.xy instanceof Float32Array&&(e.xy=t.xy),t.indices&&t.indices instanceof Int32Array&&(e.indices=t.indices),i("text"),i("marker.color",r),i("marker.opacity"),i("marker.blend"),i("marker.sizemin"),i("marker.sizemax"),i("marker.border.color",r),i("marker.border.arearatio")}},{"../../lib":353,"./attributes":486}],489:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("../scatter3d/calc"),n.plot=t("./convert"),n.moduleType="trace",n.name="pointcloud",n.basePlotModule=t("../../plots/gl2d"),n.categories=["gl2d","showLegend"],n.meta={},e.exports=n},{"../../plots/gl2d":424,"../scatter3d/calc":515,"./attributes":486,"./convert":487,"./defaults":488}],490:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rg&&d.splice(g,d.length-g),p.length>g&&p.splice(g,p.length-g);var m={padded:!0},v={padded:!0};if(o.hasMarkers(e)){if(r=e.marker,u=r.size,Array.isArray(u)){var y={type:"linear"};a.setConvert(y),u=y.makeCalcdata(e.marker,"size"),u.length>g&&u.splice(g,u.length-g)}var b,x=1.6*(e.marker.sizeref||1);b="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/x),3)}:function(t){return Math.max((t||0)/x,3)},m.ppad=v.ppad=Array.isArray(u)?u.map(b):b(u)}s(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||d[0]===d[g-1]&&p[0]===p[g-1]?e.error_y.visible||-1===["tonexty","tozeroy"].indexOf(e.fill)&&(o.hasMarkers(e)||o.hasText(e))||(m.padded=!1,m.ppad=0):m.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||d[0]===d[g-1]&&p[0]===p[g-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(v.padded=!1):v.tozero=!0,a.expand(f,d,m),a.expand(h,p,v);var _=new Array(g);for(c=0;c=0;a--){var i=t[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],494:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l=r.marker,u="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+u).remove(),void 0===l||!l.showscale)return void i.autoMargin(t,u);var c=l.color,f=l.cmin,h=l.cmax;n(f)||(f=a.aggNums(Math.min,null,c)),n(h)||(h=a.aggNums(Math.max,null,c));var d=e[0].t.cb=s(t,u),p=o.makeColorScaleFunc(o.extractScale(l.colorscale,f,h),{noNumericCheck:!0});d.fillcolor(p).filllevels({start:f,end:h,size:(h-f)/254}).options(l.colorbar)()}},{"../../components/colorbar/draw":236,"../../components/colorscale":247,"../../lib":353,"../../plots/plots":429,"fast-isnumeric":68}],495:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/calc"),i=t("./subtypes");e.exports=function(t){i.hasLines(t)&&n(t,"line")&&a(t,t.line.color,"line","c"),i.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":239,"../../components/colorscale/has_colorscale":246,"./subtypes":512}],496:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20}},{}],497:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("./constants"),o=t("./subtypes"),s=t("./xy_defaults"),l=t("./marker_defaults"),u=t("./line_defaults"),c=t("./line_shape_defaults"),f=t("./text_defaults"),h=t("./fillcolor_defaults"),d=t("../../components/errorbars/defaults");e.exports=function(t,e,r,p){function g(r,i){return n.coerce(t,e,a,r,i)}var m=s(t,e,p,g),v=mV!=P>=V&&(O=C[L-1][0],R=C[L][0],I=O+(R-O)*(V-D)/(P-D),B=Math.min(B,I),j=Math.max(j,I));B=Math.max(B,0),j=Math.min(j,d._length);var G=s.defaultLine;return s.opacity(h.fillcolor)?G=h.fillcolor:s.opacity((h.line||{}).color)&&(G=h.line.color),n.extendFlat(t,{distance:u+10,x0:B,x1:j,y0:V,y1:V,color:G}),delete t.index,h.text&&!Array.isArray(h.text)?t.text=String(h.text):t.text=h.name,[t]}}}},{"../../components/color":233,"../../components/errorbars":263,"../../components/fx":274,"../../lib":353,"./fill_hover_text":498,"./get_trace_color":500}],502:[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","scatter-like"],n.meta={},e.exports=n},{"../../plots/cartesian":406,"./arrays_to_calcdata":490,"./attributes":491,"./calc":492,"./clean_data":493,"./colorbar":494,"./defaults":497,"./hover":501,"./plot":509,"./select":510,"./style":511,"./subtypes":512}],503:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,i,o,s){var l=(t.marker||{}).color;if(o("line.color",r),n(t,"line"))a(t,e,i,o,{prefix:"line.",cLetter:"c"});else{o("line.color",!Array.isArray(l)&&l||r)}o("line.width"),(s||{}).noDash||o("line.dash")}},{"../../components/colorscale/defaults":242,"../../components/colorscale/has_colorscale":246}],504:[function(t,e,r){"use strict";var n=t("../../constants/numerical").BADNUM,a=t("../../lib"),i=a.segmentsIntersect,o=a.constrain,s=t("./constants");e.exports=function(t,e){function r(e){var r=P.c2p(t[e].x),a=z.c2p(t[e].y);return r!==n&&a!==n&&[r,a]}function l(t){var e=t[0]/P._length,r=t[1]/z._length;return(1+s.toleranceGrowth*Math.max(0,-e,e-1,-r,r-1))*B}function u(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function c(t,e){for(var r=[],n=0,a=0;a<4;a++){var o=at[a],s=i(t[0],t[1],e[0],e[1],o[0],o[1],o[2],o[3]);s&&(!n||Math.abs(s.x-r[0][0])>1||Math.abs(s.y-r[0][1])>1)&&(s=[s.x,s.y],n&&u(s,t)et||t[1]nt)return[o(t[0],tt,et),o(t[1],rt,nt)]}function h(t,e){return t[0]===e[0]&&(t[0]===tt||t[0]===et)||(t[1]===e[1]&&(t[1]===rt||t[1]===nt)||void 0)}function d(t,e){var r=[],n=f(t),a=f(e);return n&&a&&h(n,a)?r:(n&&r.push(n),a&&r.push(a),r)}function p(t,e,r){return function(n,i){var o=f(n),s=f(i),l=[];if(o&&s&&h(o,s))return l;o&&l.push(o),s&&l.push(s);var u=2*a.constrain((n[t]+i[t])/2,e,r)-((o||n)[t]+(s||i)[t]);if(u){var c;c=o&&s?u>0==o[t]>s[t]?o:s:o||s,c[t]+=u}return l}}function g(t,e){var r=e[0]-t[0],n=(e[1]-t[1])/r;return(t[1]*e[0]-e[1]*t[0])/r>0?[n>0?tt:et,nt]:[n>0?et:tt,rt]}function m(t){var e=t[0],r=t[1],n=e===G[q-1][0],a=r===G[q-1][1];if(!n||!a)if(q>1){var i=e===G[q-2][0],o=r===G[q-2][1];n&&(e===tt||e===et)&&i?o?q--:G[q-1]=t:a&&(r===rt||r===nt)&&o?i?q--:G[q-1]=t:G[q++]=t}else G[q++]=t}function v(t){ -G[q-1][0]!==t[0]&&G[q-1][1]!==t[1]&&m([W,Z]),m(t),Q=null,W=Z=0}function y(t){if(X=t[0]et?et:0,Y=t[1]nt?nt:0,X||Y){if(q)if(Q){var e=K(Q,t);e.length>1&&(v(e[0]),G[q++]=e[1])}else $=K(G[q-1],t)[0],G[q++]=$;else G[q++]=[X||t[0],Y||t[1]];var r=G[q-1];X&&Y&&(r[0]!==X||r[1]!==Y)?(Q&&(W!==X&&Z!==Y?m(W&&Z?g(Q,t):[W||X,Z||Y]):W&&Z&&m([W,Z])),m([X,Y])):W-X&&Z-Y&&m([X||W,Y||Z]),Q=t,W=X,Z=Y}else Q&&v(K(Q,t)[0]),G[q++]=t}var b,x,_,w,A,k,M,T,E,L,S,C,I,O,R,D,P=e.xaxis,z=e.yaxis,N=e.simplify,F=e.connectGaps,B=e.baseTolerance,j=e.shape,U="linear"===j,H=[],V=s.minTolerance,G=new Array(t.length),q=0;N||(B=V=-1);var X,Y,W,Z,Q,$,K,J=s.maxScreensAway,tt=-P._length*J,et=P._length*(1+J),rt=-z._length*J,nt=z._length*(1+J),at=[[tt,rt,et,rt],[et,rt,et,nt],[et,nt,tt,nt],[tt,nt,tt,rt]];for("linear"===j||"spline"===j?K=c:"hv"===j||"vh"===j?K=d:"hvh"===j?K=p(0,tt,et):"vhv"===j&&(K=p(1,rt,nt)),b=0;bl(k))break;_=k,I=E[0]*T[0]+E[1]*T[1],I>S?(S=I,w=k,M=!1):I=t.length||!k)break;y(k),x=k}}else y(w)}Q&&m([W||Q[0],Z||Q[1]]),H.push(G.slice(0,q))}return H}},{"../../constants/numerical":334,"../../lib":353,"./constants":496}],505:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],506:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n,a,i=null,o=0;o0?Math.max(e,a):0}}},{"fast-isnumeric":68}],508:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,u){var c,f=o.isBubble(t),h=(t.line||{}).color;if(u=u||{},h&&(r=h),l("marker.symbol"),l("marker.opacity",f?.7:1),l("marker.size"),l("marker.color",r),a(t,"marker")&&i(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noLine||(c=h&&!Array.isArray(h)&&e.marker.color!==h?h:f?n.background:n.defaultLine,l("marker.line.color",c),a(t,"marker.line")&&i(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",f?1:0)),f&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),u.gradient){"none"!==l("marker.gradient.type")&&l("marker.gradient.color")}}},{"../../components/color":233,"../../components/colorscale/defaults":242,"../../components/colorscale/has_colorscale":246,"./subtypes":512}],509:[function(t,e,r){"use strict";function n(t,e,r){var n;e.selectAll("g.trace").each(function(t){var e=o.select(this);if(n=t[0].trace,n._nexttrace){if(n._nextFill=e.select(".js-fill.js-tonext"),!n._nextFill.size()){var a=":first-child";e.select(".js-fill.js-tozero").size()&&(a+=" + *"),n._nextFill=e.insert("path",a).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),n._nextFill=null;n.fill&&("tozero"===n.fill.substr(0,6)||"toself"===n.fill||"to"===n.fill.substr(0,2)&&!n._prevtrace)?(n._ownFill=e.select(".js-fill.js-tozero"),n._ownFill.size()||(n._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),n._ownFill=null),e.selectAll(".js-fill").call(l.setClipUrl,r.layerClipId)})}function a(t,e,r,n,a,h,p){function g(t){return A?t.transition():t}function m(t){return t.filter(function(t){return t.vis})}function v(t){return t.id}function y(t){if(t.ids)return v}function b(){return!1}function x(e){var n,a,i,u=e[0].trace,f=o.select(this),h=c.hasMarkers(u),d=c.hasText(u),p=y(u),v=b,x=b;h&&(v=u.marker.maxdisplayed||u._needsCull?m:s.identity),d&&(x=u.marker.maxdisplayed||u._needsCull?m:s.identity),a=f.selectAll("path.point"),n=a.data(v,p);var _=n.enter().append("path").classed("point",!0);A&&_.call(l.pointStyle,u,t).call(l.translatePoints,k,M).style("opacity",0).transition().style("opacity",1);var w=h&&l.tryColorscale(u.marker,""),T=h&&l.tryColorscale(u.marker,"line");n.order(),n.each(function(e){var n=o.select(this),a=g(n);i=l.translatePoint(e,a,k,M),i?(l.singlePointStyle(e,a,u,w,T,t),r.layerClipId&&l.hideOutsideRangePoint(e,a,k,M),u.customdata&&n.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()}),A?n.exit().transition().style("opacity",0).remove():n.exit().remove(),a=f.selectAll("g"),n=a.data(x,p),n.enter().append("g").classed("textpoint",!0).append("text"),n.order(),n.each(function(t){var e=o.select(this),n=g(e.select("text"));i=l.translatePoint(t,n,k,M),i?r.layerClipId&&l.hideOutsideRangePoint(t,e,k,M):e.remove()}),n.selectAll("text").call(l.textPointStyle,u,t).each(function(t){var e=k.c2p(t.x),r=M.c2p(t.y);o.select(this).selectAll("tspan.line").each(function(){g(o.select(this)).attr({x:e,y:r})})}),n.exit().remove()}var _,w;i(t,e,r,n,a);var A=!!p&&p.duration>0,k=r.xaxis,M=r.yaxis,T=n[0].trace,E=T.line,L=o.select(h);if(L.call(u.plot,r,p),!0===T.visible){g(L).style("opacity",T.opacity);var S,C,I=T.fill.charAt(T.fill.length-1);"x"!==I&&"y"!==I&&(I=""),n[0].node3=L;var O="",R=[],D=T._prevtrace;D&&(O=D._prevRevpath||"",C=D._nextFill,R=D._polygons);var P,z,N,F,B,j,U,H,V,G="",q="",X=[],Y=s.noop;if(S=T._ownFill,c.hasLines(T)||"none"!==T.fill){for(C&&C.datum(n),-1!==["hv","vh","hvh","vhv"].indexOf(E.shape)?(N=l.steps(E.shape),F=l.steps(E.shape.split("").reverse().join(""))):N=F="spline"===E.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),E.smoothing):l.smoothopen(t,E.smoothing)}:function(t){return"M"+t.join("L")},B=function(t){return F(t.reverse())},X=f(n,{xaxis:k,yaxis:M,connectGaps:T.connectgaps,baseTolerance:Math.max(E.width||1,3)/4,shape:E.shape,simplify:E.simplify}),V=T._polygons=new Array(X.length),w=0;w1){var r=o.select(this);if(r.datum(n),t)g(r.style("opacity",0).attr("d",P).call(l.lineGroupStyle)).style("opacity",1);else{var a=g(r);a.attr("d",P),l.singleLineStyle(n,a)}}}}}var W=L.selectAll(".js-line").data(X);g(W.exit()).style("opacity",0).remove(),W.each(Y(!1)),W.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(Y(!0)),l.setClipUrl(W,r.layerClipId),X.length&&(S?j&&H&&(I?("y"===I?j[1]=H[1]=M.c2p(0,!0):"x"===I&&(j[0]=H[0]=k.c2p(0,!0)),g(S).attr("d","M"+H+"L"+j+"L"+G.substr(1)).call(l.singleFillStyle)):g(S).attr("d",G+"Z").call(l.singleFillStyle)):"tonext"===T.fill.substr(0,6)&&G&&O&&("tonext"===T.fill?g(C).attr("d",G+"Z"+O+"Z").call(l.singleFillStyle):g(C).attr("d",G+"L"+O.substr(1)+"Z").call(l.singleFillStyle),T._polygons=T._polygons.concat(R)),T._prevRevpath=q,T._prevPolygons=V);var Z=L.selectAll(".points");_=Z.data([n]),Z.each(x),_.enter().append("g").classed("points",!0).each(x),_.exit().remove(),_.each(function(t){var e=!1===t[0].trace.cliponaxis;l.setClipUrl(o.select(this),e?null:r.layerClipId)})}}function i(t,e,r,n,a){var i=r.xaxis,l=r.yaxis,u=o.extent(s.simpleMap(i.range,i.r2c)),f=o.extent(s.simpleMap(l.range,l.r2c)),h=n[0].trace;if(c.hasMarkers(h)){var d=h.marker.maxdisplayed;if(0!==d){var p=n.filter(function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=f[0]&&t.y<=f[1]}),g=Math.ceil(p.length/d),m=0;a.forEach(function(t,r){var n=t[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;for(c=p.selectAll("g.trace"),f=c.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,e),l=0,u={};lu[e[0].trace.uid]?1:-1}),m){s&&(d=s());o.transition().duration(i.duration).ease(i.easing).each("end",function(){d&&d()}).each("interrupt",function(){d&&d()}).each(function(){p.selectAll("g.trace").each(function(n,o){a(t,o,e,n,r,this,i)})})}else p.selectAll("g.trace").each(function(n,o){a(t,o,e,n,r,this,i)});g&&f.exit().remove(),p.selectAll("path:not([d])").remove()}},{"../../components/drawing":257,"../../components/errorbars":263,"../../lib":353,"../../lib/polygon":364,"./line_points":504,"./link_traces":506,"./subtypes":512,d3:62}],510:[function(t,e,r){"use strict";var n=t("./subtypes"),a=t("../../constants/interactions").DESELECTDIM;e.exports=function(t,e){var r,i,o,s,l=t.cd,u=t.xaxis,c=t.yaxis,f=[],h=l[0].trace,d=h.marker,p=!n.hasMarkers(h)&&!n.hasText(h);if(!0!==h.visible||p)return[];var g=Array.isArray(d.opacity)?1:d.opacity;if(!1===e)for(r=0;r=e.length?a:e[i]);return n}function o(t,e,r){return l(P(t,r),D(e,r),r)}function s(t,e,r,n){var a=k(t,e,n);return a=Array.isArray(a[0])?a:i(y.identity,[a],n),l(a,D(r,n),n)}function l(t,e,r){for(var n=new Array(4*r),a=0;aZ?W-Z:0),!G||V.noBorder||V.noFill?c(this.scatter.options.colors,X,h,j,q):c(this.scatter.options.colors,O,h,0),c(this.scatter.options.borderColors,Y,h,j,q);B?(this.scatter.options.positions=null,this.fancyScatter.update(),this.scatter.options.positions=k):this.fancyScatter.update()}else this.fancyScatter.clear();this.scatter.clear(),this.expandAxesFancy(l,f,F)},R.updateLines=function(t,e){var r;if(this.hasLines){var n=e;if(!t.connectgaps){var a=0,i=this.xData,s=this.yData;for(n=new Float64Array(2*i.length),r=0;ret?et:0,Y=t[1]nt?nt:0,X||Y){if(q)if(Q){var e=K(Q,t);e.length>1&&(v(e[0]),G[q++]=e[1])}else $=K(G[q-1],t)[0],G[q++]=$;else G[q++]=[X||t[0],Y||t[1]];var r=G[q-1];X&&Y&&(r[0]!==X||r[1]!==Y)?(Q&&(W!==X&&Z!==Y?m(W&&Z?g(Q,t):[W||X,Z||Y]):W&&Z&&m([W,Z])),m([X,Y])):W-X&&Z-Y&&m([X||W,Y||Z]),Q=t,W=X,Z=Y}else Q&&v(K(Q,t)[0]),G[q++]=t}var b,x,_,w,A,k,M,T,E,L,S,C,I,O,R,D,P=e.xaxis,z=e.yaxis,N=e.simplify,F=e.connectGaps,B=e.baseTolerance,j=e.shape,U="linear"===j,H=[],V=s.minTolerance,G=new Array(t.length),q=0;N||(B=V=-1);var X,Y,W,Z,Q,$,K,J=s.maxScreensAway,tt=-P._length*J,et=P._length*(1+J),rt=-z._length*J,nt=z._length*(1+J),at=[[tt,rt,et,rt],[et,rt,et,nt],[et,nt,tt,nt],[tt,nt,tt,rt]];for("linear"===j||"spline"===j?K=c:"hv"===j||"vh"===j?K=d:"hvh"===j?K=p(0,tt,et):"vhv"===j&&(K=p(1,rt,nt)),b=0;bl(k))break;_=k,I=E[0]*T[0]+E[1]*T[1],I>S?(S=I,w=k,M=!1):I=t.length||!k)break;y(k),x=k}}else y(w)}Q&&m([W||Q[0],Z||Q[1]]),H.push(G.slice(0,q))}return H}},{"../../constants/numerical":334,"../../lib":353,"./constants":496}],505:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],506:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n,a,i=null,o=0;o0?Math.max(e,a):0}}},{"fast-isnumeric":68}],508:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,u){var c,f=o.isBubble(t),h=(t.line||{}).color;if(u=u||{},h&&(r=h),l("marker.symbol"),l("marker.opacity",f?.7:1),l("marker.size"),l("marker.color",r),a(t,"marker")&&i(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noLine||(c=h&&!Array.isArray(h)&&e.marker.color!==h?h:f?n.background:n.defaultLine,l("marker.line.color",c),a(t,"marker.line")&&i(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",f?1:0)),f&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),u.gradient){"none"!==l("marker.gradient.type")&&l("marker.gradient.color")}}},{"../../components/color":233,"../../components/colorscale/defaults":242,"../../components/colorscale/has_colorscale":246,"./subtypes":512}],509:[function(t,e,r){"use strict";function n(t,e,r){var n;e.selectAll("g.trace").each(function(t){var e=o.select(this);if(n=t[0].trace,n._nexttrace){if(n._nextFill=e.select(".js-fill.js-tonext"),!n._nextFill.size()){var a=":first-child";e.select(".js-fill.js-tozero").size()&&(a+=" + *"),n._nextFill=e.insert("path",a).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),n._nextFill=null;n.fill&&("tozero"===n.fill.substr(0,6)||"toself"===n.fill||"to"===n.fill.substr(0,2)&&!n._prevtrace)?(n._ownFill=e.select(".js-fill.js-tozero"),n._ownFill.size()||(n._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),n._ownFill=null),e.selectAll(".js-fill").call(l.setClipUrl,r.layerClipId)})}function a(t,e,r,n,a,h,p){function g(t){return A?t.transition():t}function m(t){return t.filter(function(t){return t.vis})}function v(t){return t.id}function y(t){if(t.ids)return v}function b(){return!1}function x(e){var n,a,i,u=e[0].trace,f=o.select(this),h=c.hasMarkers(u),d=c.hasText(u),p=y(u),v=b,x=b;h&&(v=u.marker.maxdisplayed||u._needsCull?m:s.identity),d&&(x=u.marker.maxdisplayed||u._needsCull?m:s.identity),a=f.selectAll("path.point"),n=a.data(v,p);var _=n.enter().append("path").classed("point",!0);A&&_.call(l.pointStyle,u,t).call(l.translatePoints,k,M).style("opacity",0).transition().style("opacity",1);var w=h&&l.tryColorscale(u.marker,""),T=h&&l.tryColorscale(u.marker,"line");n.order(),n.each(function(e){var n=o.select(this),a=g(n);i=l.translatePoint(e,a,k,M),i?(l.singlePointStyle(e,a,u,w,T,t),r.layerClipId&&l.hideOutsideRangePoint(e,a,k,M),u.customdata&&n.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()}),A?n.exit().transition().style("opacity",0).remove():n.exit().remove(),a=f.selectAll("g"),n=a.data(x,p),n.enter().append("g").classed("textpoint",!0).append("text"),n.order(),n.each(function(t){var e=o.select(this),n=g(e.select("text"));i=l.translatePoint(t,n,k,M),i?r.layerClipId&&l.hideOutsideRangePoint(t,e,k,M):e.remove()}),n.selectAll("text").call(l.textPointStyle,u,t).each(function(t){var e=k.c2p(t.x),r=M.c2p(t.y);o.select(this).selectAll("tspan.line").each(function(){g(o.select(this)).attr({x:e,y:r})})}),n.exit().remove()}var _,w;i(t,e,r,n,a);var A=!!p&&p.duration>0,k=r.xaxis,M=r.yaxis,T=n[0].trace,E=T.line,L=o.select(h);if(L.call(u.plot,r,p),!0===T.visible){g(L).style("opacity",T.opacity);var S,C,I=T.fill.charAt(T.fill.length-1);"x"!==I&&"y"!==I&&(I=""),n[0].node3=L;var O="",R=[],D=T._prevtrace;D&&(O=D._prevRevpath||"",C=D._nextFill,R=D._polygons);var P,z,N,F,B,j,U,H,V,G="",q="",X=[],Y=s.noop;if(S=T._ownFill,c.hasLines(T)||"none"!==T.fill){for(C&&C.datum(n),-1!==["hv","vh","hvh","vhv"].indexOf(E.shape)?(N=l.steps(E.shape),F=l.steps(E.shape.split("").reverse().join(""))):N=F="spline"===E.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),E.smoothing):l.smoothopen(t,E.smoothing)}:function(t){return"M"+t.join("L")},B=function(t){return F(t.reverse())},X=f(n,{xaxis:k,yaxis:M,connectGaps:T.connectgaps,baseTolerance:Math.max(E.width||1,3)/4,shape:E.shape,simplify:E.simplify}),V=T._polygons=new Array(X.length),w=0;w1){var r=o.select(this);if(r.datum(n),t)g(r.style("opacity",0).attr("d",P).call(l.lineGroupStyle)).style("opacity",1);else{var a=g(r);a.attr("d",P),l.singleLineStyle(n,a)}}}}}var W=L.selectAll(".js-line").data(X);g(W.exit()).style("opacity",0).remove(),W.each(Y(!1)),W.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(Y(!0)),l.setClipUrl(W,r.layerClipId),X.length&&(S?j&&H&&(I?("y"===I?j[1]=H[1]=M.c2p(0,!0):"x"===I&&(j[0]=H[0]=k.c2p(0,!0)),g(S).attr("d","M"+H+"L"+j+"L"+G.substr(1)).call(l.singleFillStyle)):g(S).attr("d",G+"Z").call(l.singleFillStyle)):"tonext"===T.fill.substr(0,6)&&G&&O&&("tonext"===T.fill?g(C).attr("d",G+"Z"+O+"Z").call(l.singleFillStyle):g(C).attr("d",G+"L"+O.substr(1)+"Z").call(l.singleFillStyle),T._polygons=T._polygons.concat(R)),T._prevRevpath=q,T._prevPolygons=V);var Z=L.selectAll(".points");_=Z.data([n]),Z.each(x),_.enter().append("g").classed("points",!0).each(x),_.exit().remove(),_.each(function(t){var e=!1===t[0].trace.cliponaxis;l.setClipUrl(o.select(this),e?null:r.layerClipId)})}}function i(t,e,r,n,a){var i=r.xaxis,l=r.yaxis,u=o.extent(s.simpleMap(i.range,i.r2c)),f=o.extent(s.simpleMap(l.range,l.r2c)),h=n[0].trace;if(c.hasMarkers(h)){var d=h.marker.maxdisplayed;if(0!==d){var p=n.filter(function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=f[0]&&t.y<=f[1]}),g=Math.ceil(p.length/d),m=0;a.forEach(function(t,r){var n=t[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;for(c=p.selectAll("g.trace"),f=c.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,e),l=0,u={};lu[e[0].trace.uid]?1:-1}),m){s&&(d=s());o.transition().duration(i.duration).ease(i.easing).each("end",function(){d&&d()}).each("interrupt",function(){d&&d()}).each(function(){p.selectAll("g.trace").each(function(n,o){a(t,o,e,n,r,this,i)})})}else p.selectAll("g.trace").each(function(n,o){a(t,o,e,n,r,this,i)});g&&f.exit().remove(),p.selectAll("path:not([d])").remove()}},{"../../components/drawing":257,"../../components/errorbars":263,"../../lib":353,"../../lib/polygon":364,"./line_points":504,"./link_traces":506,"./subtypes":512,d3:62}],510:[function(t,e,r){"use strict";var n=t("./subtypes"),a=t("../../constants/interactions").DESELECTDIM;e.exports=function(t,e){var r,i,o,s,l=t.cd,u=t.xaxis,c=t.yaxis,f=[],h=l[0].trace,d=h.marker;if(!n.hasMarkers(h)&&!n.hasText(h))return[];var p=Array.isArray(d.opacity)?1:d.opacity;if(!1===e)for(r=0;r=e.length?a:e[i]);return n}function o(t,e,r){return l(P(t,r),D(e,r),r)}function s(t,e,r,n){var a=k(t,e,n);return a=Array.isArray(a[0])?a:i(y.identity,[a],n),l(a,D(r,n),n)}function l(t,e,r){for(var n=new Array(4*r),a=0;aZ?W-Z:0),!G||V.noBorder||V.noFill?c(this.scatter.options.colors,X,h,j,q):c(this.scatter.options.colors,O,h,0),c(this.scatter.options.borderColors,Y,h,j,q);B?(this.scatter.options.positions=null,this.fancyScatter.update(),this.scatter.options.positions=k):this.fancyScatter.update()}else this.fancyScatter.clear();this.scatter.clear(),this.expandAxesFancy(l,f,F)},R.updateLines=function(t,e){var r;if(this.hasLines){var n=e;if(!t.connectgaps){var a=0,i=this.xData,s=this.yData;for(n=new Float64Array(2*i.length),r=0;r1){var u=t[l-2];u.left===r?u.left=n:u.right=n}return void(t[l-1]=n)}if(n.left&&n.left._color===v){if(n=r.right=i(n),s=n.left=i(n.left),r.right=s.left,n.left=s.right,s.left=r,s.right=n,s._color=r._color,r._color=m,n._color=m,e._color=m,o(r),o(n),o(s),l>1){var u=t[l-2];u.left===r?u.left=s:u.right=s}return void(t[l-1]=s)}if(n._color===m){if(r._color===v)return r._color=m,void(r.right=a(v,n));r.right=a(v,n);continue}if(n=i(n),r.right=n.left,n.left=r,n._color=r._color,r._color=v,o(r),o(n),l>1){var u=t[l-2];u.left===r?u.left=n:u.right=n}t[l-1]=n,t[l]=r,l+11){var u=t[l-2];u.right===r?u.right=n:u.left=n}return void(t[l-1]=n)}if(n.right&&n.right._color===v){if(n=r.left=i(n),s=n.right=i(n.right),r.left=s.right,n.right=s.left,s.right=r,s.left=n,s._color=r._color,r._color=m,n._color=m,e._color=m,o(r),o(n),o(s),l>1){var u=t[l-2];u.right===r?u.right=s:u.left=s}return void(t[l-1]=s)}if(n._color===m){if(r._color===v)return r._color=m,void(r.left=a(v,n));r.left=a(v,n);continue}if(n=i(n),r.left=n.right,n.right=r,n._color=r._color,r._color=v,o(r),o(n),l>1){var u=t[l-2];u.right===r?u.right=n:u.left=n}t[l-1]=n,t[l]=r,l+1e?1:0}function g(t){return new s(t||p,null)}e.exports=g;var v=0,m=1,y=s.prototype;Object.defineProperty(y,"keys",{get:function(){var t=[];return this.forEach(function(e,r){t.push(e)}),t}}),Object.defineProperty(y,"values",{get:function(){var t=[];return this.forEach(function(e,r){t.push(r)}),t}}),Object.defineProperty(y,"length",{get:function(){return this.root?this.root._count:0}}),y.insert=function(t,e){for(var r=this._compare,i=this.root,l=[],u=[];i;){var c=r(t,i.key);l.push(i),u.push(c),i=c<=0?i.left:i.right}l.push(new n(v,t,e,null,null,1));for(var f=l.length-2;f>=0;--f){var i=l[f];u[f]<=0?l[f]=new n(i._color,i.key,i.value,l[f+1],i.right,i._count+1):l[f]=new n(i._color,i.key,i.value,i.left,l[f+1],i._count+1)}for(var f=l.length-1;f>1;--f){var h=l[f-1],i=l[f];if(h._color===m||i._color===m)break;var d=l[f-2];if(d.left===h)if(h.left===i){var p=d.right;if(!p||p._color!==v){if(d._color=v,d.left=h.right,h._color=m,h.right=d,l[f-2]=h,l[f-1]=i,o(d),o(h),f>=3){var g=l[f-3];g.left===d?g.left=h:g.right=h}break}h._color=m,d.right=a(m,p),d._color=v,f-=1}else{var p=d.right;if(!p||p._color!==v){if(h.right=i.left,d._color=v,d.left=i.right,i._color=m,i.left=h,i.right=d,l[f-2]=i,l[f-1]=h,o(d),o(h),o(i),f>=3){var g=l[f-3];g.left===d?g.left=i:g.right=i}break}h._color=m,d.right=a(m,p),d._color=v,f-=1}else if(h.right===i){var p=d.left;if(!p||p._color!==v){if(d._color=v,d.right=h.left,h._color=m,h.left=d,l[f-2]=h,l[f-1]=i,o(d),o(h),f>=3){var g=l[f-3];g.right===d?g.right=h:g.left=h}break}h._color=m,d.left=a(m,p),d._color=v,f-=1}else{var p=d.left;if(!p||p._color!==v){if(h.left=i.right,d._color=v,d.right=i.left,i._color=m,i.right=h,i.left=d,l[f-2]=i,l[f-1]=h,o(d),o(h),o(i),f>=3){var g=l[f-3];g.right===d?g.right=i:g.left=i}break}h._color=m,d.left=a(m,p),d._color=v,f-=1}}return l[0]._color=m,new s(r,l[0])},y.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return l(t,this.root);case 2:return u(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return c(e,r,this._compare,t,this.root)}},Object.defineProperty(y,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new f(this,t)}}),Object.defineProperty(y,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new f(this,t)}}),y.at=function(t){if(t<0)return new f(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t=e.right._count)break;e=e.right}return new f(this,[])},y.ge=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<=0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new f(this,n)},y.gt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new f(this,n)},y.lt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new f(this,n)},y.le=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>=0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new f(this,n)},y.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var i=e(t,r.key);if(n.push(r),0===i)return new f(this,n);r=i<=0?r.left:r.right}return new f(this,[])},y.remove=function(t){var e=this.find(t);return e?e.remove():this},y.get=function(t){for(var e=this._compare,r=this.root;r;){var n=e(t,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var b=f.prototype;Object.defineProperty(b,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(b,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),b.clone=function(){return new f(this.tree,this._stack.slice())},b.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var e=new Array(t.length),r=t[t.length-1];e[e.length-1]=new n(r._color,r.key,r.value,r.left,r.right,r._count);for(var i=t.length-2;i>=0;--i){var r=t[i];r.left===t[i+1]?e[i]=new n(r._color,r.key,r.value,e[i+1],r.right,r._count):e[i]=new n(r._color,r.key,r.value,r.left,e[i+1],r._count)}if(r=e[e.length-1],r.left&&r.right){var a=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var o=e[a-1];e.push(new n(r._color,o.key,o.value,r.left,r.right,r._count)),e[a-1].key=r.key,e[a-1].value=r.value;for(var i=e.length-2;i>=a;--i)r=e[i],e[i]=new n(r._color,r.key,r.value,r.left,e[i+1],r._count);e[a-1].left=e[a]}if(r=e[e.length-1],r._color===v){var l=e[e.length-2];l.left===r?l.left=null:l.right===r&&(l.right=null),e.pop();for(var i=0;i0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(b,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(b,"index",{get:function(){var t=0,e=this._stack;if(0===e.length){var r=this.tree.root;return r?r._count:0}e[e.length-1].left&&(t=e[e.length-1].left._count);for(var n=e.length-2;n>=0;--n)e[n+1]===e[n].right&&(++t,e[n].left&&(t+=e[n].left._count));return t},enumerable:!0}),b.next=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.right)for(e=e.right;e;)t.push(e),e=e.left;else for(t.pop();t.length>0&&t[t.length-1].right===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(b,"hasNext",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].right)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].left===t[e])return!0;return!1}}),b.update=function(t){var e=this._stack;if(0===e.length)throw new Error("Can't update empty node!");var r=new Array(e.length),i=e[e.length-1];r[r.length-1]=new n(i._color,i.key,t,i.left,i.right,i._count);for(var a=e.length-2;a>=0;--a)i=e[a],i.left===e[a+1]?r[a]=new n(i._color,i.key,i.value,r[a+1],i.right,i._count):r[a]=new n(i._color,i.key,i.value,i.left,r[a+1],i._count);return new s(this.tree._compare,r[0])},b.prev=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.left)for(e=e.left;e;)t.push(e),e=e.right;else for(t.pop();t.length>0&&t[t.length-1].left===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(b,"hasPrev",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].left)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].right===t[e])return!0;return!1}})},{}],90:[function(t,e,r){function n(t){if(t<0)return Number("0/0");for(var e=o[0],r=o.length-1;r>0;--r)e+=o[r]/(t+r);var n=t+a+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}var i=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],a=607/128,o=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];e.exports=function t(e){if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*t(1-e));if(e>100)return Math.exp(n(e));e-=1;for(var r=i[0],a=1;a<9;a++)r+=i[a]/(e+a);var o=e+7+.5;return Math.sqrt(2*Math.PI)*Math.pow(o,e+.5)*Math.exp(-o)*r},e.exports.log=n},{}],91:[function(t,e,r){function n(t,e){if("string"!=typeof t)throw new TypeError("must specify type string");if(e=e||{},"undefined"==typeof document&&!e.canvas)return null;var r=e.canvas||document.createElement("canvas");"number"==typeof e.width&&(r.width=e.width),"number"==typeof e.height&&(r.height=e.height);var n,i=e;try{var a=[t];0===t.indexOf("webgl")&&a.push("experimental-"+t);for(var o=0;o0?(d[c]=-1,p[c]=0):(d[c]=0,p[c]=1)}}function s(t,e){var r=new i(t);return r.update(e),r}e.exports=s;var l=t("./lib/text.js"),u=t("./lib/lines.js"),c=t("./lib/background.js"),f=t("./lib/cube.js"),h=t("./lib/ticks.js"),d=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),p=i.prototype;p.update=function(t){function e(e,r,n){if(n in t){var i,a=t[n],o=this[n];(e?Array.isArray(a)&&Array.isArray(a[0]):Array.isArray(a))?this[n]=i=[r(a[0]),r(a[1]),r(a[2])]:this[n]=i=[r(a),r(a),r(a)];for(var s=0;s<3;++s)if(i[s]!==o[s])return!0}return!1}t=t||{};var r,n=e.bind(this,!1,Number),i=e.bind(this,!1,Boolean),a=e.bind(this,!1,String),o=e.bind(this,!0,function(t){if(Array.isArray(t)){if(3===t.length)return[+t[0],+t[1],+t[2],1];if(4===t.length)return[+t[0],+t[1],+t[2],+t[3]]}return[0,0,0,1]}),s=!1,c=!1;if("bounds"in t)for(var f=t.bounds,d=0;d<2;++d)for(var p=0;p<3;++p)f[d][p]!==this.bounds[d][p]&&(c=!0),this.bounds[d][p]=f[d][p];if("ticks"in t){r=t.ticks,s=!0,this.autoTicks=!1;for(var d=0;d<3;++d)this.tickSpacing[d]=0}else n("tickSpacing")&&(this.autoTicks=!0,c=!0);if(this._firstInit&&("ticks"in t||"tickSpacing"in t||(this.autoTicks=!0),c=!0,s=!0,this._firstInit=!1),c&&this.autoTicks&&(r=h.create(this.bounds,this.tickSpacing),s=!0),s){for(var d=0;d<3;++d)r[d].sort(function(t,e){return t.x-e.x});h.equal(r,this.ticks)?s=!1:this.ticks=r}i("tickEnable"),a("tickFont")&&(s=!0),n("tickSize"),n("tickAngle"),n("tickPad"),o("tickColor");var g=a("labels");a("labelFont")&&(g=!0),i("labelEnable"),n("labelSize"),n("labelPad"),o("labelColor"),i("lineEnable"),i("lineMirror"),n("lineWidth"),o("lineColor"),i("lineTickEnable"),i("lineTickMirror"),n("lineTickLength"),n("lineTickWidth"),o("lineTickColor"),i("gridEnable"),n("gridWidth"),o("gridColor"),i("zeroEnable"),o("zeroLineColor"),n("zeroLineWidth"),i("backgroundEnable"),o("backgroundColor"),this._text?this._text&&(g||s)&&this._text.update(this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont):this._text=l(this.gl,this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont),this._lines&&s&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=u(this.gl,this.bounds,this.ticks))};var g=[new a,new a,new a],v=[0,0,0],m={model:d,view:d,projection:d};p.isOpaque=function(){return!0},p.isTransparent=function(){return!1},p.drawTransparent=function(t){};var y=[0,0,0],b=[0,0,0],x=[0,0,0];p.draw=function(t){t=t||m;for(var e=this.gl,r=t.model||d,i=t.view||d,a=t.projection||d,s=this.bounds,l=f(r,i,a,s),u=l.cubeEdges,c=l.axis,h=i[12],p=i[13],_=i[14],w=i[15],M=this.pixelRatio*(a[3]*h+a[7]*p+a[11]*_+a[15]*w)/e.drawingBufferHeight,A=0;A<3;++A)this.lastCubeProps.cubeEdges[A]=u[A],this.lastCubeProps.axis[A]=c[A];for(var k=g,A=0;A<3;++A)o(g[A],A,this.bounds,u,c);for(var e=this.gl,T=v,A=0;A<3;++A)this.backgroundEnable[A]?T[A]=c[A]:T[A]=0;this._background.draw(r,i,a,s,T,this.backgroundColor),this._lines.bind(r,i,a,this);for(var A=0;A<3;++A){var E=[0,0,0];c[A]>0?E[A]=s[1][A]:E[A]=s[0][A];for(var L=0;L<2;++L){var C=(A+1+L)%3,S=(A+1+(1^L))%3;this.gridEnable[C]&&this._lines.drawGrid(C,S,this.bounds,E,this.gridColor[C],this.gridWidth[C]*this.pixelRatio)}for(var L=0;L<2;++L){var C=(A+1+L)%3,S=(A+1+(1^L))%3;this.zeroEnable[S]&&s[0][S]<=0&&s[1][S]>=0&&this._lines.drawZero(C,S,this.bounds,E,this.zeroLineColor[S],this.zeroLineWidth[S]*this.pixelRatio)}}for(var A=0;A<3;++A){this.lineEnable[A]&&this._lines.drawAxisLine(A,this.bounds,k[A].primalOffset,this.lineColor[A],this.lineWidth[A]*this.pixelRatio),this.lineMirror[A]&&this._lines.drawAxisLine(A,this.bounds,k[A].mirrorOffset,this.lineColor[A],this.lineWidth[A]*this.pixelRatio);for(var P=n(y,k[A].primalMinor),R=n(b,k[A].mirrorMinor),I=this.lineTickLength,L=0;L<3;++L){var O=M/r[5*L];P[L]*=I[L]*O,R[L]*=I[L]*O}this.lineTickEnable[A]&&this._lines.drawAxisTicks(A,k[A].primalOffset,P,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio),this.lineTickMirror[A]&&this._lines.drawAxisTicks(A,k[A].mirrorOffset,R,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio)}this._text.bind(r,i,a,this.pixelRatio);for(var A=0;A<3;++A){for(var N=k[A].primalMinor,D=n(x,k[A].primalOffset),L=0;L<3;++L)this.lineTickEnable[A]&&(D[L]+=M*N[L]*Math.max(this.lineTickLength[L],0)/r[5*L]);if(this.tickEnable[A]){for(var L=0;L<3;++L)D[L]+=M*N[L]*this.tickPad[L]/r[5*L];this._text.drawTicks(A,this.tickSize[A],this.tickAngle[A],D,this.tickColor[A])}if(this.labelEnable[A]){for(var L=0;L<3;++L)D[L]+=M*N[L]*this.labelPad[L]/r[5*L];D[A]+=.5*(s[0][A]+s[1][A]),this._text.drawLabel(A,this.labelSize[A],this.labelAngle[A],D,this.labelColor[A])}}},p.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},{"./lib/background.js":93,"./lib/cube.js":94,"./lib/lines.js":95,"./lib/text.js":97,"./lib/ticks.js":98}],93:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}function i(t){for(var e=[],r=[],i=0,l=0;l<3;++l)for(var u=(l+1)%3,c=(l+2)%3,f=[0,0,0],h=[0,0,0],d=-1;d<=1;d+=2){r.push(i,i+2,i+1,i+1,i+2,i+3),f[l]=d,h[l]=d;for(var p=-1;p<=1;p+=2){f[u]=p;for(var g=-1;g<=1;g+=2)f[c]=g,e.push(f[0],f[1],f[2],h[0],h[1],h[2]),i+=1}var v=u;u=c,c=v}var m=a(t,new Float32Array(e)),y=a(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),b=o(t,[{buffer:m,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:m,type:t.FLOAT,size:3,offset:12,stride:24}],y),x=s(t);return x.attributes.position.location=0,x.attributes.normal.location=1,new n(t,m,b,x)}e.exports=i;var a=t("gl-buffer"),o=t("gl-vao"),s=t("./shaders").bg,l=n.prototype;l.draw=function(t,e,r,n,i,a){for(var o=!1,s=0;s<3;++s)o=o||i[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:t,view:e,projection:r,bounds:n,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),l.disable(l.POLYGON_OFFSET_FILL)}},l.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders":96,"gl-buffer":100,"gl-vao":155}],94:[function(t,e,r){"use strict";function n(t,e,r){for(var n=0;n<4;++n){t[n]=r[12+n];for(var i=0;i<3;++i)t[n]+=e[i]*r[4*i+n]}}function i(t){for(var e=0;eE&&(_|=1<E&&(_|=1<h[g][1]&&(N=g));for(var D=-1,g=0;g<3;++g){var z=N^1<h[j][0]&&(j=z)}}var F=v;F[0]=F[1]=F[2]=0,F[o.log2(D^N)]=N&D,F[o.log2(N^j)]=N&j;var B=7^j;B===_||B===O?(B=7^D,F[o.log2(j^B)]=B&j):F[o.log2(D^B)]=B&D;for(var U=m,V=_,A=0;A<3;++A)U[A]=V&1< 0.0) {\n vec3 nPosition = mix(bounds[0], bounds[1], 0.5 * (position + 1.0));\n gl_Position = projection * view * model * vec4(nPosition, 1.0);\n } else {\n gl_Position = vec4(0,0,0,0);\n }\n colorChannel = abs(normal);\n}","precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 colors[3];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n gl_FragColor = colorChannel.x * colors[0] + \n colorChannel.y * colors[1] +\n colorChannel.z * colors[2];\n}",null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":140}],97:[function(t,e,r){(function(r){"use strict";function n(t,e,r,n){this.gl=t,this.shader=e,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}function i(t,e){try{return l(t,e)}catch(t){return console.warn("error vectorizing text:",t),{cells:[],positions:[]}}}function a(t,e,r,i,a,l){var c=o(t),f=s(t,[{buffer:c,size:3}]),h=u(t);h.attributes.position.location=0;var d=new n(t,h,c,f);return d.update(e,r,i,a,l),d}e.exports=a;var o=t("gl-buffer"),s=t("gl-vao"),l=t("vectorize-text"),u=t("./shaders").text,c=window||r.global||{},f=c.__TEXT_CACHE||{};c.__TEXT_CACHE={};var h=n.prototype,d=[0,0];h.bind=function(t,e,r,n){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=t,i.view=e,i.projection=r,i.pixelScale=n,d[0]=this.gl.drawingBufferWidth,d[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=d},h.update=function(t,e,r,n,a){function o(t,e,r,n){var a=f[r];a||(a=f[r]={});var o=a[e];o||(o=a[e]=i(e,{triangles:!0,font:r,textAlign:"center",textBaseline:"middle"}));for(var l=(n||12)/12,u=o.positions,c=o.cells,h=0,d=c.length;h=0;--g){var v=u[p[g]];s.push(l*v[0],-l*v[1],t)}}for(var s=(this.gl,[]),l=[0,0,0],u=[0,0,0],c=[0,0,0],h=[0,0,0],d=0;d<3;++d){c[d]=s.length/3|0,o(.5*(t[0][d]+t[1][d]),e[d],r),h[d]=(s.length/3|0)-c[d],l[d]=s.length/3|0;for(var p=0;p=0&&(i=r.length-n-1);var a=Math.pow(10,i),o=Math.round(t*e*a),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/a,u=o%a;o<0?(l=0|-Math.ceil(l),u=0|-u):(l=0|Math.floor(l),u|=0);var c=""+l;if(o<0&&(c="-"+c),i){for(var f=""+u;f.length=t[0][i];--o)a.push({x:o*e[i],text:n(e[i],o)});r.push(a)}return r}function a(t,e){for(var r=0;r<3;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;nr)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,a,i),r}function a(t,e){for(var r=l.malloc(t.length,e),n=t.length,i=0;i=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}function s(t,e,r,i){if(r=r||t.ARRAY_BUFFER,i=i||t.DYNAMIC_DRAW,r!==t.ARRAY_BUFFER&&r!==t.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(i!==t.DYNAMIC_DRAW&&i!==t.STATIC_DRAW&&i!==t.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var a=t.createBuffer(),o=new n(t,r,a,0,i);return o.update(e),o}var l=t("typedarray-pool"),u=t("ndarray-ops"),c=t("ndarray"),f=["uint8","uint8_clamped","uint16","uint32","int8","int16","int32","float32"],h=n.prototype;h.bind=function(){this.gl.bindBuffer(this.type,this.handle)},h.unbind=function(){this.gl.bindBuffer(this.type,null)},h.dispose=function(){this.gl.deleteBuffer(this.handle)},h.update=function(t,e){if("number"!=typeof e&&(e=-1),this.bind(),"object"==typeof t&&void 0!==t.shape){var r=t.dtype;if(f.indexOf(r)<0&&(r="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER){r=gl.getExtension("OES_element_index_uint")&&"uint16"!==r?"uint32":"uint16"}if(r===t.dtype&&o(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=i(this.gl,this.type,this.length,this.usage,t.data,e):this.length=i(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var n=l.malloc(t.size,r),s=c(n,t.shape);u.assign(s,t), this.length=e<0?i(this.gl,this.type,this.length,this.usage,n,e):i(this.gl,this.type,this.length,this.usage,n.subarray(0,t.size),e),l.free(n)}}else if(Array.isArray(t)){var h;h=this.type===this.gl.ELEMENT_ARRAY_BUFFER?a(t,"uint16"):a(t,"float32"),this.length=e<0?i(this.gl,this.type,this.length,this.usage,h,e):i(this.gl,this.type,this.length,this.usage,h.subarray(0,t.length),e),l.free(h)}else if("object"==typeof t&&"number"==typeof t.length)this.length=i(this.gl,this.type,this.length,this.usage,t,e);else{if("number"!=typeof t&&void 0!==t)throw new Error("gl-buffer: Invalid data type");if(e>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");t|=0,t<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=s},{ndarray:203,"ndarray-ops":197,"typedarray-pool":258}],101:[function(t,e,r){e.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},{}],102:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":101}],103:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.shader=n,this.buffer=e,this.vao=r,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1}function i(t,e){for(var r=0;r<3;++r)t[0][r]=Math.min(t[0][r],e[r]),t[1][r]=Math.max(t[1][r],e[r])}function a(t,e,r,n){for(var i=h[n],a=0;a=1},f.isTransparent=function(){return this.opacity<1},f.drawTransparent=f.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||c,i=r.projection=t.projection||c;r.model=t.model||c,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],o=n[13],s=n[14],l=n[15],u=this.pixelRatio*(i[3]*a+i[7]*o+i[11]*s+i[15]*l)/e.drawingBufferHeight;this.vao.bind();for(var f=0;f<3;++f)e.lineWidth(this.lineWidth[f]),r.capSize=this.capSize[f]*u,this.lineCount[f]&&e.drawArrays(e.LINES,this.lineOffset[f],this.lineCount[f]);this.vao.unbind()};var h=function(){for(var t=new Array(3),e=0;e<3;++e){for(var r=[],n=1;n<=2;++n)for(var i=-1;i<=1;i+=2){var a=(n+e)%3,o=[0,0,0];o[a]=i,r.push(o)}t[e]=r}return t}();f.update=function(t){t=t||{},"lineWidth"in t&&(this.lineWidth=t.lineWidth,Array.isArray(this.lineWidth)||(this.lineWidth=[this.lineWidth,this.lineWidth,this.lineWidth])),"capSize"in t&&(this.capSize=t.capSize,Array.isArray(this.capSize)||(this.capSize=[this.capSize,this.capSize,this.capSize])),"opacity"in t&&(this.opacity=t.opacity);var e=t.color||[[0,0,0],[0,0,0],[0,0,0]],r=t.position,n=t.error;if(Array.isArray(e[0])||(e=[e,e,e]),r&&n){var o=[],s=r.length,l=0;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.lineCount=[0,0,0];for(var u=0;u<3;++u){this.lineOffset[u]=l;t:for(var c=0;c0){var g=f.slice();g[u]+=d[1][u],o.push(f[0],f[1],f[2],p[0],p[1],p[2],p[3],0,0,0,g[0],g[1],g[2],p[0],p[1],p[2],p[3],0,0,0),i(this.bounds,g),l+=2+a(o,g,p,u)}}}this.lineCount[u]=l-this.lineOffset[u]}this.buffer.update(o)}},f.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":105,"gl-buffer":100,"gl-vao":155}],104:[function(t,e,r){e.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n1&&h.drawBuffersWEBGL(y[f]);var m=r.getExtension("WEBGL_depth_texture");m?d?t.depth=s(r,u,c,m.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):p&&(t.depth=s(r,u,c,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):p&&d?t._depth_rb=l(r,u,c,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):p?t._depth_rb=l(r,u,c,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(t._depth_rb=l(r,u,c,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var b=r.checkFramebufferStatus(r.FRAMEBUFFER);if(b!==r.FRAMEBUFFER_COMPLETE){t._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(t.handle),t.handle=null,t.depth&&(t.depth.dispose(),t.depth=null),t._depth_rb&&(r.deleteRenderbuffer(t._depth_rb),t._depth_rb=null);for(var v=0;vs||r<0||r>s)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var l=n(a),u=0;uo||r<0||r>o)throw new Error("gl-fbo: Parameters are too large for FBO");n=n||{};var s=1;if("color"in n){if((s=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(s>1){if(!i)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(s>t.getParameter(i.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+s+" draw buffers")}}var l=t.UNSIGNED_BYTE,u=t.getExtension("OES_texture_float");if(n.float&&s>0){if(!u)throw new Error("gl-fbo: Context does not support floating point textures");l=t.FLOAT}else n.preferFloat&&s>0&&u&&(l=t.FLOAT);var f=!0;"depth"in n&&(f=!!n.depth);var h=!1;return"stencil"in n&&(h=!!n.stencil),new c(t,e,r,l,s,f,h,i)}var d=t("gl-texture2d");e.exports=h;var p,g,v,m,y=null,b=c.prototype;Object.defineProperties(b,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(t){if(Array.isArray(t)||(t=[0|t,0|t]),2!==t.length)throw new Error("gl-fbo: Shape vector must be length 2");var e=0|t[0],r=0|t[1];return f(this,e,r),[e,r]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(t){return t|=0,f(this,t,this._shape[1]),t},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(t){return t|=0,f(this,this._shape[0],t),t},enumerable:!1}}),b.bind=function(){if(!this._destroyed){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.handle),t.viewport(0,0,this._shape[0],this._shape[1])}},b.dispose=function(){if(!this._destroyed){this._destroyed=!0;var t=this.gl;t.deleteFramebuffer(this.handle),this.handle=null,this.depth&&(this.depth.dispose(),this.depth=null),this._depth_rb&&(t.deleteRenderbuffer(this._depth_rb),this._depth_rb=null);for(var e=0;e FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n highp float e = floor(log2(av));\n highp float m = av * pow(2.0, -e) - 1.0;\n \n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n \n //Unpack exponent\n highp float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0; \n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\n\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if(any(lessThan(worldPosition, clipBounds[0])) || any(greaterThan(worldPosition, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = vec4(pickId/255.0, encode_float_1_0(pixelArcLength).xyz);\n}",null,a)}},{"gl-shader":140}],109:[function(t,e,r){"use strict";function n(t,e){for(var r=0,n=0;n<3;++n){var i=t[n]-e[n];r+=i*i}return Math.sqrt(r)}function i(t){for(var e=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)e[0][r]=Math.max(t[0][r],e[0][r]),e[1][r]=Math.min(t[1][r],e[1][r]);return e}function a(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function o(t,e,r,n,i,a){this.gl=t,this.shader=e,this.pickShader=r,this.buffer=n,this.vao=i,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=a,this.dashScale=1,this.opacity=1,this.dirty=!0,this.pixelRatio=1}function s(t){var e=t.gl||t.scene&&t.scene.gl,r=g(e);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var n=v(e);n.attributes.position.location=0,n.attributes.nextPosition.location=1,n.attributes.arcLength.location=2,n.attributes.lineWidth.location=3,n.attributes.color.location=4;for(var i=l(e),a=u(e,[{buffer:i,size:3,offset:0,stride:48},{buffer:i,size:3,offset:12,stride:48},{buffer:i,size:1,offset:24,stride:48},{buffer:i,size:1,offset:28,stride:48},{buffer:i,size:4,offset:32,stride:48}]),s=d(new Array(1024),[256,1,4]),f=0;f<1024;++f)s.data[f]=255;var h=c(e,s);h.wrap=e.REPEAT;var p=new o(e,r,n,i,a,h);return p.update(t),p}e.exports=s;var l=t("gl-buffer"),u=t("gl-vao"),c=t("gl-texture2d"),f=t("glsl-read-float"),h=t("binary-search-bounds"),d=t("ndarray"),p=t("./lib/shaders"),g=p.createShader,v=p.createPickShader,m=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],y=o.prototype;y.isTransparent=function(){return this.opacity<1},y.isOpaque=function(){return this.opacity>=1},y.pickSlots=1,y.setPickBase=function(t){this.pickId=t},y.drawTransparent=y.draw=function(t){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||m,view:t.view||m,projection:t.projection||m,clipBounds:i(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount)},y.drawPick=function(t){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||m,view:t.view||m,projection:t.projection||m,pickId:this.pickId,clipBounds:i(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount)},y.update=function(t){var e,r;this.dirty=!0;var i=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),"opacity"in t&&(this.opacity=+t.opacity);var a=t.position||t.positions;if(a){var o=t.color||t.colors||[0,0,0,1],s=t.lineWidth||1,l=[],u=[],c=[],f=0,p=0,g=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],v=!1;t:for(e=1;e0){for(var b=0;b<24;++b)l.push(l[l.length-12]);p+=2,v=!0}continue t}g[0][r]=Math.min(g[0][r],m[r],y[r]),g[1][r]=Math.max(g[1][r],m[r],y[r])}var x,_;Array.isArray(o[0])?(x=o[e-1],_=o[e]):x=_=o,3===x.length&&(x=[x[0],x[1],x[2],1]),3===_.length&&(_=[_[0],_[1],_[2],1]);var w;w=Array.isArray(s)?s[e-1]:s;var M=f;if(f+=n(m,y),v){for(r=0;r<2;++r)l.push(m[0],m[1],m[2],y[0],y[1],y[2],M,w,x[0],x[1],x[2],x[3]);p+=2,v=!1}l.push(m[0],m[1],m[2],y[0],y[1],y[2],M,w,x[0],x[1],x[2],x[3],m[0],m[1],m[2],y[0],y[1],y[2],M,-w,x[0],x[1],x[2],x[3],y[0],y[1],y[2],m[0],m[1],m[2],f,-w,_[0],_[1],_[2],_[3],y[0],y[1],y[2],m[0],m[1],m[2],f,w,_[0],_[1],_[2],_[3]),p+=4}if(this.buffer.update(l),u.push(f),c.push(a[a.length-1].slice()),this.bounds=g,this.vertexCount=p,this.points=c,this.arcLength=u,"dashes"in t){var A=t.dashes,k=A.slice();for(k.unshift(0),e=1;e1.0001)return null;v+=g[c]}return Math.abs(v-1)>.001?null:[f,o(t,g),g]}var l=t("barycentric"),u=t("polytope-closest-point/lib/closest_point_2d.js");e.exports=s},{barycentric:17,"polytope-closest-point/lib/closest_point_2d.js":216}],131:[function(t,e,r){var n="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if(any(lessThan(f_position, clipBounds[0])) || \n any(greaterThan(f_position, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = vec4(pickId, f_id.xyz);\n}";r.meshShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec4 m_position = model * vec4(position, 1.0);\n vec4 t_position = view * m_position;\n gl_Position = projection * t_position;\n f_color = color;\n f_normal = normal;\n f_data = position;\n f_eyeDirection = eyePosition - position;\n f_lightDirection = lightPosition - position;\n f_uv = uv;\n}",fragment:"precision mediump float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution_2_0(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\n\n\nfloat cookTorranceSpecular_1_1(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution_2_0(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\n\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular\n , opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if(any(lessThan(f_data, clipBounds[0])) || \n any(greaterThan(f_data, clipBounds[1]))) {\n discard;\n }\n\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n \n if(!gl_FrontFacing) {\n N = -N;\n }\n\n float specular = cookTorranceSpecular_1_1(L, V, N, roughness, fresnel);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}",attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.wireShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model, view, projection;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_color = color;\n f_data = position;\n f_uv = uv;\n}",fragment:"precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 clipBounds[2];\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n if(any(lessThan(f_data, clipBounds[0])) || \n any(greaterThan(f_data, clipBounds[1]))) {\n discard;\n }\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}",attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.pointShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\nattribute float pointSize;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(0,0,0,0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n }\n gl_PointSize = pointSize;\n f_color = color;\n f_uv = uv;\n}",fragment:"precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec2 pointR = gl_PointCoord.xy - vec2(0.5,0.5);\n if(dot(pointR, pointR) > 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}",attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_id = id;\n f_position = position;\n}",fragment:n,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute float pointSize;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(0,0,0,0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n gl_PointSize = pointSize;\n }\n f_id = id;\n f_position = position;\n}",fragment:n,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n}",fragment:"precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor,1);\n}\n",attributes:[{name:"position",type:"vec3"}]}},{}],132:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,u,c,f,h,d,p,g,v,m,y,b,x,_,w,M,A,k,T){this.gl=t,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=c,this.triangleNormals=h,this.triangleUVs=f,this.triangleIds=u,this.triangleVAO=d,this.triangleCount=0,this.lineWidth=1,this.edgePositions=p,this.edgeColors=v,this.edgeUVs=m,this.edgeIds=g,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=b,this.pointColors=_,this.pointUVs=w,this.pointSizes=M,this.pointIds=x,this.pointVAO=A,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=k,this.contourVAO=T,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this._model=I,this._view=I,this._projection=I,this._resolution=[1,1]}function i(t){for(var e=w({colormap:t,nshades:256,format:"rgba"}),r=new Uint8Array(1024),n=0;n<256;++n){for(var i=e[n],a=0;a<3;++a)r[4*n+a]=i[a];r[4*n+3]=255*i[3]}return _(r,[256,256,4],[4,0,1])}function a(t,e,r){for(var n=new Array(e),i=0;i=1},O.isTransparent=function(){return this.opacity<1},O.pickSlots=1,O.setPickBase=function(t){this.pickId=t},O.highlight=function(t){if(!t||!this.contourEnable)return void(this.contourCount=0);for(var e=M(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=A.mallocFloat32(6*a),s=0,l=0;l0){var h=this.triShader;h.bind(),h.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var h=this.lineShader;h.bind(),h.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()}if(this.pointCount>0){var h=this.pointShader;h.bind(),h.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var h=this.contourShader;h.bind(),h.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind()}},O.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||I,n=t.view||I,i=t.projection||I,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255},l=this.pickShader;if(l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0){var l=this.pointPickShader;l.bind(),l.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}},O.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;for(var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions,i=new Array(r.length),a=0;a0){var r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function o(t){return"boolean"!=typeof t||t}function s(t){function e(){if(!w&&G.autoResize){var t=M.parentNode,e=1,r=1;t&&t!==document.body?(e=t.clientWidth,r=t.clientHeight):(e=window.innerWidth,r=window.innerHeight);var n=0|Math.ceil(e*G.pixelRatio),i=0|Math.ceil(r*G.pixelRatio);if(n!==M.width||i!==M.height){M.width=n,M.height=i;var a=M.style;a.position=a.position||"absolute",a.left="0px",a.top="0px",a.width=e+"px",a.height=r+"px",F=!0}}}function r(){for(var t=N.length,e=j.length,r=0;r0&&0===z[e-1];)z.pop(),j.pop().dispose()}function s(){if(G.contextLost)return!0;k.isContextLost()&&(G.contextLost=!0,G.mouseListener.enabled=!1,G.selection.object=null,G.oncontextloss&&G.oncontextloss())}function b(){if(!s()){k.colorMask(!0,!0,!0,!0),k.depthMask(!0),k.disable(k.BLEND),k.enable(k.DEPTH_TEST);for(var t=N.length,e=j.length,r=0;rE.distance)continue;for(var u=0;u1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),t[0]=s*u+l*d,t[1]=s*c+l*p,t[2]=s*f+l*g,t[3]=s*h+l*v,t}e.exports=n},{}],136:[function(t,e,r){"use strict";function n(t,e){var r=a[e];if(r||(r=a[e]={}),t in r)return r[t];for(var n=i(t,{textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),o=i(t,{triangles:!0,textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),s=[[1/0,1/0],[-1/0,-1/0]],l=0;lMath.abs(D[1])){var z=N;N=D,D=z,z=I,I=O,O=z;var j=P;P=R,R=j}N[0]<0&&(I[P]=-1),D[1]>0&&(O[R]=-1);for(var F=0,B=0,S=0;S<4;++S)F+=Math.pow(p[4*P+S],2),B+=Math.pow(p[4*R+S],2);I[P]/=Math.sqrt(F),O[R]/=Math.sqrt(B),d.axes[0]=I,d.axes[1]=O,d.fragClipBounds[0]=u(L,b[0],_,-1e8),d.fragClipBounds[1]=u(L,b[1],_,1e8),e.vao.draw(h.TRIANGLES,e.vertexCount),e.lineWidth>0&&(h.lineWidth(e.lineWidth),e.vao.draw(h.LINES,e.lineVertexCount,e.vertexCount))}}function h(t,e,r,n,i,a){var o=r.gl;if(r.vao.bind(),i===r.opacity<1||a){t.bind();var s=t.uniforms;s.model=n.model||x,s.view=n.view||x,s.projection=n.projection||x,w[0]=2/o.drawingBufferWidth,w[1]=2/o.drawingBufferHeight,s.screenSize=w,s.highlightId=r.highlightId,s.highlightScale=r.highlightScale,s.fragClipBounds=R,s.clipBounds=r.axes.bounds,s.opacity=r.opacity,s.pickGroup=r.pickId/255,s.pixelRatio=r.pixelRatio,r.vao.draw(o.TRIANGLES,r.vertexCount),r.lineWidth>0&&(o.lineWidth(r.lineWidth),r.vao.draw(o.LINES,r.lineVertexCount,r.vertexCount))}f(e,r,n,i,a),r.vao.unbind()}function d(t){var e=t.gl,r=y.createPerspective(e),n=y.createOrtho(e),i=y.createProject(e),a=y.createPickPerspective(e),s=y.createPickOrtho(e),l=y.createPickProject(e),u=p(e),c=p(e),f=p(e),h=p(e),d=g(e,[{buffer:u,size:3,type:e.FLOAT},{buffer:c,size:4,type:e.FLOAT},{buffer:f,size:2,type:e.FLOAT},{buffer:h,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),v=new o(e,r,n,i,u,c,f,h,d,a,s,l);return v.update(t),v}var p=t("gl-buffer"),g=t("gl-vao"),v=t("typedarray-pool"),m=t("gl-mat4/multiply"),y=t("./lib/shaders"),b=t("./lib/glyphs"),x=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];e.exports=d;var _=o.prototype;_.pickSlots=1,_.setPickBase=function(t){this.pickId=t},_.isTransparent=function(){if(this.opacity<1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]<1)return!0;return!1},_.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]>=1)return!0;return!1};var w=[0,0],M=[0,0,0],A=[0,0,0],k=[0,0,0,1],T=[0,0,0,1],E=x.slice(),L=[0,0,0],C=[[0,0,0],[0,0,0]],S=[-1e8,-1e8,-1e8],P=[1e8,1e8,1e8],R=[S,P];_.draw=function(t){h(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!1,!1)},_.drawTransparent=function(t){h(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!0,!1)},_.drawPick=function(t){h(this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader,this.pickProjectShader,this,t,!1,!0)},_.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[2]+(t.value[1]<<8)+(t.value[0]<<16);if(e>=this.pointCount||e<0)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},_.highlight=function(t){if(t){var e=t.index,r=255&e,n=e>>8&255,i=e>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},_.update=function(t){if(t=t||{},"perspective"in t&&(this.useOrtho=!t.perspective),"orthographic"in t&&(this.useOrtho=!!t.orthographic),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"project"in t)if(Array.isArray(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(Array.isArray(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if("projectOpacity"in t)if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{var r=+t.projectOpacity;this.projectOpacity=[r,r,r]}"opacity"in t&&(this.opacity=t.opacity),this.dirty=!0;var n=t.position;if(n){var i=t.font||"normal",a=t.alignment||[0,0],o=[1/0,1/0,1/0],s=[-1/0,-1/0,-1/0],l=t.glyph,u=t.color,c=t.size,f=t.angle,h=t.lineColor,d=0,p=0,g=0,m=n.length;t:for(var y=0;y0&&(P[0]=-a[0]*(1+k[0][0]));for(var H=M.cells,q=M.positions,_=0;_this.buffer.length){s.free(this.buffer);for(var n=this.buffer=s.mallocUint8(u(r*e*4)),i=0;i=0){for(var A=0|M.type.charAt(M.type.length-1),k=new Array(A),T=0;T=0;)E+=1;_[w]=E}var L=new Array(r.length);a(),d._relink=a,d.types={uniforms:l(r),attributes:l(n)},d.attributes=s(p,d,b,_),Object.defineProperty(d,"uniforms",o(p,d,r,L))},e.exports=a},{"./lib/GLError":141,"./lib/create-attributes":142,"./lib/create-uniforms":143,"./lib/reflect":144,"./lib/runtime-reflect":145,"./lib/shader-cache":146}],141:[function(t,e,r){function n(t,e,r){this.shortMessage=e||"",this.longMessage=r||"",this.rawError=t||"",this.message="gl-shader: "+(e||t||"")+(r?"\n"+r:""),this.stack=(new Error).stack}n.prototype=new Error,n.prototype.name="GLError",n.prototype.constructor=n,e.exports=n},{}],142:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}function i(t,e,r,i,a,o,s){for(var l=["gl","v"],u=[],c=0;c=0){var p=h.charCodeAt(h.length-1)-48;if(p<2||p>4)throw new s("","Invalid data type for attribute "+f+": "+h);i(t,e,d[0],n,p,o,f)}else{if(!(h.indexOf("mat")>=0))throw new s("","Unknown data type for attribute "+f+": "+h);var p=h.charCodeAt(h.length-1)-48;if(p<2||p>4)throw new s("","Invalid data type for attribute "+f+": "+h);a(t,e,d,n,p,o,f)}}}return o}e.exports=o;var s=t("./GLError"),l=n.prototype;l.pointer=function(t,e,r,n){var i=this,a=i._gl,o=i._locations[i._index];a.vertexAttribPointer(o,i._dimension,t||a.FLOAT,!!e,r||0,n||0),a.enableVertexAttribArray(o)},l.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(l,"location",{get:function(){return this._locations[this._index]},set:function(t){return t!==this._locations[this._index]&&(this._locations[this._index]=0|t,this._wrapper.program=null),0|t}})},{"./GLError":141}],143:[function(t,e,r){"use strict";function n(t){return new Function("y","return function(){return y}")(t)}function i(t,e){for(var r=new Array(t),n=0;n4)throw new s("","Invalid uniform dimension type for matrix "+name+": "+r);return"gl.uniformMatrix"+i+"fv(locations["+e+"],false,obj"+t+")"}throw new s("","Unknown uniform data type for "+name+": "+r)}var i=r.charCodeAt(r.length-1)-48;if(i<2||i>4)throw new s("","Invalid data type");switch(r.charAt(0)){case"b":case"i":return"gl.uniform"+i+"iv(locations["+e+"],obj"+t+")";case"v":return"gl.uniform"+i+"fv(locations["+e+"],obj"+t+")";default:throw new s("","Unrecognized data type for vector "+name+": "+r)}}}function c(t,e){if("object"!=typeof e)return[[t,e]];var r=[];for(var n in e){var i=e[n],a=t;parseInt(n)+""===n?a+="["+n+"]":a+="."+n,"object"==typeof i?r.push.apply(r,c(a,i)):r.push([a,i])}return r}function f(e){for(var n=["return function updateProperty(obj){"],i=c("",e),o=0;o4)throw new s("","Invalid data type");return"b"===t.charAt(0)?i(r,!1):i(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r=t.charCodeAt(t.length-1)-48;if(r<2||r>4)throw new s("","Invalid uniform dimension type for matrix "+name+": "+t);return i(r*r,0)}throw new s("","Unknown uniform data type for "+name+": "+t)}}function d(t,e,i){if("object"==typeof i){var o=p(i);Object.defineProperty(t,e,{get:n(o),set:f(i),enumerable:!0,configurable:!1})}else a[i]?Object.defineProperty(t,e,{get:l(i),set:f(i),enumerable:!0,configurable:!1}):t[e]=h(r[i].type)}function p(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r1){l[0]in o||(o[l[0]]=[]),o=o[l[0]];for(var u=1;u1)for(var l=0;l1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),t[0]=s*u+l*d,t[1]=s*c+l*p,t[2]=s*f+l*g,t[3]=s*h+l*v,t}e.exports=n},{}],136:[function(t,e,r){"use strict";function n(t,e){var r=a[e];if(r||(r=a[e]={}),t in r)return r[t];for(var n=i(t,{textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),o=i(t,{triangles:!0,textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),s=[[1/0,1/0],[-1/0,-1/0]],l=0;lMath.abs(D[1])){var z=N;N=D,D=z,z=I,I=O,O=z;var j=P;P=R,R=j}N[0]<0&&(I[P]=-1),D[1]>0&&(O[R]=-1);for(var F=0,B=0,S=0;S<4;++S)F+=Math.pow(p[4*P+S],2),B+=Math.pow(p[4*R+S],2);I[P]/=Math.sqrt(F),O[R]/=Math.sqrt(B),d.axes[0]=I,d.axes[1]=O,d.fragClipBounds[0]=u(L,b[0],_,-1e8),d.fragClipBounds[1]=u(L,b[1],_,1e8),e.vao.draw(h.TRIANGLES,e.vertexCount),e.lineWidth>0&&(h.lineWidth(e.lineWidth),e.vao.draw(h.LINES,e.lineVertexCount,e.vertexCount))}}function h(t,e,r,n,i,a){var o=r.gl;if(r.vao.bind(),i===r.opacity<1||a){t.bind();var s=t.uniforms;s.model=n.model||x,s.view=n.view||x,s.projection=n.projection||x,w[0]=2/o.drawingBufferWidth,w[1]=2/o.drawingBufferHeight,s.screenSize=w,s.highlightId=r.highlightId,s.highlightScale=r.highlightScale,s.fragClipBounds=R,s.clipBounds=r.axes.bounds,s.opacity=r.opacity,s.pickGroup=r.pickId/255,s.pixelRatio=r.pixelRatio,r.vao.draw(o.TRIANGLES,r.vertexCount),r.lineWidth>0&&(o.lineWidth(r.lineWidth),r.vao.draw(o.LINES,r.lineVertexCount,r.vertexCount))}f(e,r,n,i,a),r.vao.unbind()}function d(t){var e=t.gl,r=y.createPerspective(e),n=y.createOrtho(e),i=y.createProject(e),a=y.createPickPerspective(e),s=y.createPickOrtho(e),l=y.createPickProject(e),u=p(e),c=p(e),f=p(e),h=p(e),d=g(e,[{buffer:u,size:3,type:e.FLOAT},{buffer:c,size:4,type:e.FLOAT},{buffer:f,size:2,type:e.FLOAT},{buffer:h,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),v=new o(e,r,n,i,u,c,f,h,d,a,s,l);return v.update(t),v}var p=t("gl-buffer"),g=t("gl-vao"),v=t("typedarray-pool"),m=t("gl-mat4/multiply"),y=t("./lib/shaders"),b=t("./lib/glyphs"),x=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];e.exports=d;var _=o.prototype;_.pickSlots=1,_.setPickBase=function(t){this.pickId=t},_.isTransparent=function(){if(this.opacity<1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]<1)return!0;return!1},_.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]>=1)return!0;return!1};var w=[0,0],M=[0,0,0],A=[0,0,0],k=[0,0,0,1],T=[0,0,0,1],E=x.slice(),L=[0,0,0],C=[[0,0,0],[0,0,0]],S=[-1e8,-1e8,-1e8],P=[1e8,1e8,1e8],R=[S,P];_.draw=function(t){h(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!1,!1)},_.drawTransparent=function(t){h(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!0,!1)},_.drawPick=function(t){h(this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader,this.pickProjectShader,this,t,!1,!0)},_.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[2]+(t.value[1]<<8)+(t.value[0]<<16);if(e>=this.pointCount||e<0)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},_.highlight=function(t){if(t){var e=t.index,r=255&e,n=e>>8&255,i=e>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},_.update=function(t){if(t=t||{},"perspective"in t&&(this.useOrtho=!t.perspective),"orthographic"in t&&(this.useOrtho=!!t.orthographic),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"project"in t)if(Array.isArray(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(Array.isArray(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if("projectOpacity"in t)if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{var r=+t.projectOpacity;this.projectOpacity=[r,r,r]}"opacity"in t&&(this.opacity=t.opacity),this.dirty=!0;var n=t.position;if(n){var i=t.font||"normal",a=t.alignment||[0,0],o=[1/0,1/0,1/0],s=[-1/0,-1/0,-1/0],l=t.glyph,u=t.color,c=t.size,f=t.angle,h=t.lineColor,d=0,p=0,g=0,m=n.length;t:for(var y=0;y0&&(P[0]=-a[0]*(1+k[0][0]));for(var H=M.cells,q=M.positions,_=0;_this.buffer.length){s.free(this.buffer);for(var n=this.buffer=s.mallocUint8(u(r*e*4)),i=0;i=0){for(var A=0|M.type.charAt(M.type.length-1),k=new Array(A),T=0;T=0;)E+=1;_[w]=E}var L=new Array(r.length);a(),d._relink=a,d.types={uniforms:l(r),attributes:l(n)},d.attributes=s(p,d,b,_),Object.defineProperty(d,"uniforms",o(p,d,r,L))},e.exports=a},{"./lib/GLError":141,"./lib/create-attributes":142,"./lib/create-uniforms":143,"./lib/reflect":144,"./lib/runtime-reflect":145,"./lib/shader-cache":146}],141:[function(t,e,r){function n(t,e,r){this.shortMessage=e||"",this.longMessage=r||"",this.rawError=t||"",this.message="gl-shader: "+(e||t||"")+(r?"\n"+r:""),this.stack=(new Error).stack}n.prototype=new Error,n.prototype.name="GLError",n.prototype.constructor=n,e.exports=n},{}],142:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}function i(t,e,r,i,a,o,s){for(var l=["gl","v"],u=[],c=0;c=0){var p=h.charCodeAt(h.length-1)-48;if(p<2||p>4)throw new s("","Invalid data type for attribute "+f+": "+h);i(t,e,d[0],n,p,o,f)}else{if(!(h.indexOf("mat")>=0))throw new s("","Unknown data type for attribute "+f+": "+h);var p=h.charCodeAt(h.length-1)-48;if(p<2||p>4)throw new s("","Invalid data type for attribute "+f+": "+h);a(t,e,d,n,p,o,f)}}}return o}e.exports=o;var s=t("./GLError"),l=n.prototype;l.pointer=function(t,e,r,n){var i=this,a=i._gl,o=i._locations[i._index];a.vertexAttribPointer(o,i._dimension,t||a.FLOAT,!!e,r||0,n||0),a.enableVertexAttribArray(o)},l.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(l,"location",{get:function(){return this._locations[this._index]},set:function(t){return t!==this._locations[this._index]&&(this._locations[this._index]=0|t,this._wrapper.program=null),0|t}})},{"./GLError":141}],143:[function(t,e,r){"use strict";function n(t){return new Function("y","return function(){return y}")(t)}function i(t,e){for(var r=new Array(t),n=0;n4)throw new s("","Invalid uniform dimension type for matrix "+name+": "+r);return"gl.uniformMatrix"+i+"fv(locations["+e+"],false,obj"+t+")"}throw new s("","Unknown uniform data type for "+name+": "+r)}var i=r.charCodeAt(r.length-1)-48;if(i<2||i>4)throw new s("","Invalid data type");switch(r.charAt(0)){case"b":case"i":return"gl.uniform"+i+"iv(locations["+e+"],obj"+t+")";case"v":return"gl.uniform"+i+"fv(locations["+e+"],obj"+t+")";default:throw new s("","Unrecognized data type for vector "+name+": "+r)}}}function c(t,e){if("object"!=typeof e)return[[t,e]];var r=[];for(var n in e){var i=e[n],a=t;parseInt(n)+""===n?a+="["+n+"]":a+="."+n,"object"==typeof i?r.push.apply(r,c(a,i)):r.push([a,i])}return r}function f(e){for(var n=["return function updateProperty(obj){"],i=c("",e),o=0;o4)throw new s("","Invalid data type");return"b"===t.charAt(0)?i(r,!1):i(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r=t.charCodeAt(t.length-1)-48;if(r<2||r>4)throw new s("","Invalid uniform dimension type for matrix "+name+": "+t);return i(r*r,0)}throw new s("","Unknown uniform data type for "+name+": "+t)}}function d(t,e,i){if("object"==typeof i){var o=p(i);Object.defineProperty(t,e,{get:n(o),set:f(i),enumerable:!0,configurable:!1})}else a[i]?Object.defineProperty(t,e,{get:l(i),set:f(i),enumerable:!0,configurable:!1}):t[e]=h(r[i].type)}function p(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r1){l[0]in o||(o[l[0]]=[]),o=o[l[0]];for(var u=1;u1)for(var l=0;l0)][r],M(l,t.model,l);var u=F.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)u[i][n]=t.clipBounds[i][n];u[0][r]=-1e8,u[1][r]=1e8}return F.showSurface=o,F.showContour=s,F}function s(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=B;n.model=t.model||I,n.view=t.view||I,n.projection=t.projection||I,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.contourColor=this.contourColor[0],n.inverseModel=A(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],s=0;s<3;++s)a[s]=Math.min(Math.max(this.clipBounds[i][s],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=V,n.vertexColor=this.vertexColor;var l=U;for(M(l,n.view,n.model),M(l,n.projection,l),A(l,l),i=0;i<3;++i)n.eyePosition[i]=l[12+i]/l[15];var u=l[15];for(i=0;i<3;++i)u+=this.lightPosition[i]*l[4*i+3];for(i=0;i<3;++i){var c=l[12+i];for(s=0;s<3;++s)c+=l[4*s+i]*this.lightPosition[s];n.lightPosition[i]=c/u}var f=o(n,this);if(f.showSurface&&e===this.opacity<1){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;i<3;++i)this.surfaceProject[i]&&this.vertexCount&&(this._shader.uniforms.model=f.projections[i],this._shader.uniforms.clipBounds=f.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(f.showContour&&!e){var h=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,h.bind(),h.uniforms=n;var d=this._contourVAO;for(d.bind(),i=0;i<3;++i)for(h.uniforms.permutation=N[i],r.lineWidth(this.contourWidth[i]),s=0;s=1)return!0;for(var t=0;t<3;++t)if(this._contourCounts[t].length>0||this._dynamicCounts[t]>0)return!0;return!1},z.pickSlots=1,z.setPickBase=function(t){this.pickId=t};var j=[0,0,0],F={showSurface:!1,showContour:!1,projections:[I.slice(),I.slice(),I.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]},B={model:I,view:I,projection:I,inverseModel:I.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},U=I.slice(),V=[1,0,0,0,1,0,0,0,1];z.draw=function(t){return s.call(this,t,!1)},z.drawTransparent=function(t){return s.call(this,t,!0)};var H={model:I,view:I,projection:I,inverseModel:I,clipBounds:[[0,0,0],[0,0,0]],height:0,shape:[0,0],pickId:0,lowerBound:[0,0,0],upperBound:[0,0,0],zOffset:0,permutation:[1,0,0,0,1,0,0,0,1],lightPosition:[0,0,0],eyePosition:[0,0,0]};z.drawPick=function(t){t=t||{};var e=this.gl;e.disable(e.CULL_FACE);var r=H;r.model=t.model||I,r.view=t.view||I,r.projection=t.projection||I,r.shape=this._field[2].shape,r.pickId=this.pickId/255,r.lowerBound=this.bounds[0],r.upperBound=this.bounds[1],r.permutation=V;for(var n=0;n<2;++n)for(var i=r.clipBounds[n],a=0;a<3;++a)i[a]=Math.min(Math.max(this.clipBounds[n][a],-1e8),1e8);var s=o(r,this);if(s.showSurface){for(this._pickShader.bind(),this._pickShader.uniforms=r,this._vao.bind(),this._vao.draw(e.TRIANGLES,this._vertexCount),n=0;n<3;++n)this.surfaceProject[n]&&(this._pickShader.uniforms.model=s.projections[n],this._pickShader.uniforms.clipBounds=s.clipBounds[n],this._vao.draw(e.TRIANGLES,this._vertexCount));this._vao.unbind()}if(s.showContour){var l=this._contourPickShader;l.bind(),l.uniforms=r;var u=this._contourVAO;for(u.bind(),a=0;a<3;++a)for(e.lineWidth(this.contourWidth[a]),l.uniforms.permutation=N[a],n=0;n>4)/16)/255,i=Math.floor(n),a=n-i,o=e[1]*(t.value[1]+(15&t.value[2])/16)/255,s=Math.floor(o),l=o-s;i+=1,s+=1;var u=r.position;u[0]=u[1]=u[2]=0;for(var c=0;c<2;++c)for(var f=c?a:1-a,h=0;h<2;++h)for(var d=h?l:1-l,p=i+c,g=s+h,v=f*d,m=0;m<3;++m)u[m]+=this._field[m].get(p,g)*v;for(var y=this._pickResult.level,b=0;b<3;++b)if(y[b]=k.le(this.contourLevels[b],u[b]),y[b]<0)this.contourLevels[b].length>0&&(y[b]=0);else if(y[b]Math.abs(_-u[b])&&(y[b]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],m=0;m<3;++m)r.dataCoordinate[m]=this._field[m].get(r.index[0],r.index[1]);return r},z.update=function(t){t=t||{},this.dirty=!0,"contourWidth"in t&&(this.contourWidth=u(t.contourWidth,Number)),"showContour"in t&&(this.showContour=u(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=u(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=f(t.contourColor)),"contourProject"in t&&(this.contourProject=u(t.contourProject,function(t){return u(t,Boolean)})),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=f(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=u(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=u(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0);var e=t.field||t.coords&&t.coords[2]||null,r=!1;if(e||(e=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in t||"coords"in t){var n=(e.shape[0]+2)*(e.shape[1]+2);n>this._field[2].data.length&&(m.freeFloat(this._field[2].data),this._field[2].data=m.mallocFloat(d.nextPow2(n))),this._field[2]=_(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),l(this._field[2],e),this.shape=e.shape.slice();for(var a=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(m.freeFloat(this._field[o].data),this._field[o].data=m.mallocFloat(this._field[2].size)),this._field[o]=_(this._field[o].data,[a[0]+2,a[1]+2]);if(t.coords){var s=t.coords;if(!Array.isArray(s)||3!==s.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var c=s[o];for(y=0;y<2;++y)if(c.shape[y]!==a[y])throw new Error("gl-surface: coords have incorrect shape");l(this._field[o],c)}}else if(t.ticks){var h=t.ticks;if(!Array.isArray(h)||2!==h.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var p=h[o];if((Array.isArray(p)||p.length)&&(p=_(p)),p.shape[0]!==a[o])throw new Error("gl-surface: invalid tick length");var g=_(p.data,a);g.stride[o]=p.stride[0],g.stride[1^o]=0,l(this._field[o],g)}}else{for(o=0;o<2;++o){var v=[0,0];v[o]=1,this._field[o]=_(this._field[o].data,[a[0]+2,a[1]+2],v,0)}this._field[0].set(0,0,0);for(var y=0;y0){for(var xt=0;xt<5;++xt)tt.pop();H-=1}continue t}tt.push(it[0],it[1],st[0],st[1],it[2]),H+=1}}nt.push(H)}this._contourOffsets[et]=rt,this._contourCounts[et]=nt}var _t=m.mallocFloat(tt.length);for(o=0;oi||r<0||r>i)throw new Error("gl-texture2d: Invalid texture size");return t._shape=[e,r],t.bind(),n.texImage2D(n.TEXTURE_2D,0,t.format,e,r,0,t.format,t.type,null),t._mipLevels=[0],t}function o(t,e,r,n,i,a){this.gl=t,this.handle=e,this.format=i,this.type=a,this._shape=[r,n],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(t){return o.wrapS=t}},{get:function(){return o._wrapT},set:function(t){return o.wrapT=t}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(t){return o.width=t}},{get:function(){return o._shape[1]},set:function(t){return o.height=t}}]),this._shapeVector=l}function s(t,e){return 3===t.length?1===e[2]&&e[1]===t[0]*t[2]&&e[0]===t[2]:1===e[0]&&e[1]===t[0]}function l(t,e,r,n,i,a,o,l){var u=l.dtype,c=l.shape.slice();if(c.length<2||c.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var f=0,h=0,d=s(c,l.stride.slice());"float32"===u?f=t.FLOAT:"float64"===u?(f=t.FLOAT,d=!1,u="float32"):"uint8"===u?f=t.UNSIGNED_BYTE:(f=t.UNSIGNED_BYTE,d=!1,u="uint8");if(2===c.length)h=t.LUMINANCE,c=[c[0],c[1],1],l=p(l.data,c,[l.stride[0],l.stride[1],1],l.offset);else{if(3!==c.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===c[2])h=t.ALPHA;else if(2===c[2])h=t.LUMINANCE_ALPHA;else if(3===c[2])h=t.RGB;else{if(4!==c[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");h=t.RGBA}c[2]}if(h!==t.LUMINANCE&&h!==t.ALPHA||i!==t.LUMINANCE&&i!==t.ALPHA||(h=i),h!==i)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var m=l.size,y=o.indexOf(n)<0;if(y&&o.push(n),f===a&&d)0===l.offset&&l.data.length===m?y?t.texImage2D(t.TEXTURE_2D,n,i,c[0],c[1],0,i,a,l.data):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],i,a,l.data):y?t.texImage2D(t.TEXTURE_2D,n,i,c[0],c[1],0,i,a,l.data.subarray(l.offset,l.offset+m)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],i,a,l.data.subarray(l.offset,l.offset+m));else{var b;b=a===t.FLOAT?v.mallocFloat32(m):v.mallocUint8(m);var _=p(b,c,[c[2],c[2]*c[0],1]);f===t.FLOAT&&a===t.UNSIGNED_BYTE?x(_,l):g.assign(_,l),y?t.texImage2D(t.TEXTURE_2D,n,i,c[0],c[1],0,i,a,b.subarray(0,m)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],i,a,b.subarray(0,m)),a===t.FLOAT?v.freeFloat32(b):v.freeUint8(b)}}function u(t){var e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e}function c(t,e,r,n,i){var a=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>a||r<0||r>a)throw new Error("gl-texture2d: Invalid texture shape");if(i===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var s=u(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new o(t,s,e,r,n,i)}function f(t,e,r,n,i,a){var s=u(t);return t.texImage2D(t.TEXTURE_2D,0,i,i,a,e),new o(t,s,r,n,i,a)}function h(t,e){var r=e.dtype,n=e.shape.slice(),i=t.getParameter(t.MAX_TEXTURE_SIZE);if(n[0]<0||n[0]>i||n[1]<0||n[1]>i)throw new Error("gl-texture2d: Invalid texture size");var a=s(n,e.stride.slice()),l=0;"float32"===r?l=t.FLOAT:"float64"===r?(l=t.FLOAT,a=!1,r="float32"):"uint8"===r?l=t.UNSIGNED_BYTE:(l=t.UNSIGNED_BYTE,a=!1,r="uint8");var c=0;if(2===n.length)c=t.LUMINANCE,n=[n[0],n[1],1],e=p(e.data,n,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==n.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===n[2])c=t.ALPHA;else if(2===n[2])c=t.LUMINANCE_ALPHA;else if(3===n[2])c=t.RGB;else{if(4!==n[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");c=t.RGBA}}l!==t.FLOAT||t.getExtension("OES_texture_float")||(l=t.UNSIGNED_BYTE,a=!1);var f,h,d=e.size;if(a)f=0===e.offset&&e.data.length===d?e.data:e.data.subarray(e.offset,e.offset+d);else{var m=[n[2],n[2]*n[0],1];h=v.malloc(d,r);var y=p(h,n,m,0);"float32"!==r&&"float64"!==r||l!==t.UNSIGNED_BYTE?g.assign(y,e):x(y,e),f=h.subarray(0,d)}var b=u(t);return t.texImage2D(t.TEXTURE_2D,0,c,n[0],n[1],0,c,l,f),a||v.free(h),new o(t,b,n[0],n[1],c,l)}function d(t){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(m||n(t),"number"==typeof arguments[1])return c(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return c(t,0|arguments[1][0],0|arguments[1][1],arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if("object"==typeof arguments[1]){var e=arguments[1],r=i(e)?e:e.raw;if(r)return f(t,r,0|e.width,0|e.height,arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return h(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}var p=t("ndarray"),g=t("ndarray-ops"),v=t("typedarray-pool");e.exports=d;var m=null,y=null,b=null,x=function(t,e){g.muls(t,e,255)},_=o.prototype;Object.defineProperties(_,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&m.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),y.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),this._minFilter=t}},magFilter:{get:function(){return this._magFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&m.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),y.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var e=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),e!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),b.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,t),this._wrapS=t}},wrapT:{get:function(){return this._wrapT},set:function(t){if(this.bind(),b.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,t),this._wrapT=t}},wrap:{get:function(){return this._wrapVector},set:function(t){if(Array.isArray(t)||(t=[t,t]),2!==t.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var e=0;e<2;++e)if(b.indexOf(t[e])<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);this._wrapS=t[0],this._wrapT=t[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),t}},shape:{get:function(){return this._shapeVector},set:function(t){if(Array.isArray(t)){if(2!==t.length)throw new Error("gl-texture2d: Invalid texture shape") }else t=[0|t,0|t];return a(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return t|=0,a(this,t,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,a(this,this._shape[0],t),t}}}),_.bind=function(t){var e=this.gl;return void 0!==t&&e.activeTexture(e.TEXTURE0+(0|t)),e.bindTexture(e.TEXTURE_2D,this.handle),void 0!==t?0|t:e.getParameter(e.ACTIVE_TEXTURE)-e.TEXTURE0},_.dispose=function(){this.gl.deleteTexture(this.handle)},_.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var t=Math.min(this._shape[0],this._shape[1]),e=0;t>0;++e,t>>>=1)this._mipLevels.indexOf(e)<0&&this._mipLevels.push(e)},_.setPixels=function(t,e,r,n){var a=this.gl;this.bind(),Array.isArray(e)?(n=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),n=n||0;var o=i(t)?t:t.raw;if(o){this._mipLevels.indexOf(n)<0?(a.texImage2D(a.TEXTURE_2D,0,this.format,this.format,this.type,o),this._mipLevels.push(n)):a.texSubImage2D(a.TEXTURE_2D,n,e,r,this.format,this.type,o)}else{if(!(t.shape&&t.stride&&t.data))throw new Error("gl-texture2d: Unsupported data type");if(t.shape.length<2||e+t.shape[1]>this._shape[1]>>>n||r+t.shape[0]>this._shape[0]>>>n||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");l(a,e,r,n,this.format,this.type,this._mipLevels,t)}}},{ndarray:203,"ndarray-ops":197,"typedarray-pool":258}],152:[function(t,e,r){"use strict";function n(t,e,r){e?e.bind():t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null);var n=0|t.getParameter(t.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var i=0;i0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}e.exports=n},{}],161:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}e.exports=n},{}],162:[function(t,e,r){function n(t,e,r,n){return i[0]=n,i[1]=r,i[2]=e,i[3]=t,a[0]}e.exports=n;var i=new Uint8Array(4),a=new Float32Array(i.buffer)},{}],163:[function(t,e,r){function n(t){for(var e=Array.isArray(t)?t:i(t),r=0;r0)continue;n=t.slice(0,1).join("")}return e(n),G+=n.length,U=U.slice(n.length),U.length}}function P(){return/[^a-fA-F0-9]/.test(N)?(e(U.join("")),B=u,j):(U.push(N),D=N,j+1)}function R(){return"."===N?(U.push(N),B=v,D=N,j+1):/[eE]/.test(N)?(U.push(N),B=v,D=N,j+1):"x"===N&&1===U.length&&"0"===U[0]?(B=w,U.push(N),D=N,j+1):/[^\d]/.test(N)?(e(U.join("")),B=u,j):(U.push(N),D=N,j+1)}function I(){return"f"===N&&(U.push(N),D=N,j+=1),/[eE]/.test(N)?(U.push(N),D=N,j+1):"-"===N&&/[eE]/.test(D)?(U.push(N),D=N,j+1):/[^\d]/.test(N)?(e(U.join("")),B=u,j):(U.push(N),D=N,j+1)}function O(){if(/[^\d\w_]/.test(N)){var t=U.join("");return B=Q.indexOf(t)>-1?b:Z.indexOf(t)>-1?y:m,e(U.join("")),B=u,j}return U.push(N),D=N,j+1}var N,D,z,j=0,F=0,B=u,U=[],V=[],H=1,q=0,G=0,X=!1,W=!1,Y="";t=t||{};var Z=o,Q=i;return"300 es"===t.version&&(Z=l,Q=s),function(t){return V=[],null!==t?r(t.replace?t.replace(/\r\n/g,"\n"):t):n()}}e.exports=n;var i=t("./lib/literals"),a=t("./lib/operators"),o=t("./lib/builtins"),s=t("./lib/literals-300es"),l=t("./lib/builtins-300es"),u=999,c=9999,f=0,h=1,d=2,p=3,g=4,v=5,m=6,y=7,b=8,x=9,_=10,w=11,M=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":166,"./lib/builtins-300es":165,"./lib/literals":168,"./lib/literals-300es":167,"./lib/operators":169}],165:[function(t,e,r){var n=t("./builtins");n=n.slice().filter(function(t){return!/^(gl\_|texture)/.test(t)}),e.exports=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},{"./builtins":166}],166:[function(t,e,r){e.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},{}],167:[function(t,e,r){var n=t("./literals");e.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},{"./literals":168}],168:[function(t,e,r){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},{}],169:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],170:[function(t,e,r){function n(t,e){var r=i(e),n=[];return n=n.concat(r(t)),n=n.concat(r(null))}var i=t("./index");e.exports=n},{"./index":164}],171:[function(t,e,r){(function(r){"use strict";var n,i=t("is-browser");n="function"==typeof r.matchMedia?!r.matchMedia("(hover: none)").matches:i,e.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"is-browser":177}],172:[function(t,e,r){r.read=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<>1,c=-7,f=r?i-1:0,h=r?-1:1,d=t[e+f];for(f+=h,a=d&(1<<-c)-1,d>>=-c,c+=s;c>0;a=256*a+t[e+f],f+=h,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+t[e+f],f+=h,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=u}return(d?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),e+=o+f>=1?h/l:h*Math.pow(2,1-f),e*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(e*l-1)*Math.pow(2,i),o+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<0;t[r+d]=255&o,d+=p,o/=256,u-=8);t[r+d-p]|=128*g}},{}],173:[function(t,e,r){"use strict";function n(t,e,r){this.vertices=t,this.adjacent=e,this.boundary=r,this.lastVisited=-1}function i(t,e,r){this.vertices=t,this.cell=e,this.index=r}function a(t,e){return c(t.vertices,e.vertices)}function o(t){for(var e=["function orient(){var tuple=this.tuple;return test("],r=0;r<=t;++r)r>0&&e.push(","),e.push("tuple[",r,"]");e.push(")}return orient");var n=new Function("test",e.join("")),i=u[t+1];return i||(i=u),n(i)}function s(t,e,r){this.dimension=t,this.vertices=e,this.simplices=r,this.interior=r.filter(function(t){return!t.boundary}),this.tuple=new Array(t+1);for(var n=0;n<=t;++n)this.tuple[n]=this.vertices[n];var i=f[t];i||(i=f[t]=o(t)),this.orient=i}function l(t,e){var r=t.length;if(0===r)throw new Error("Must have at least d+1 points");var i=t[0].length;if(r<=i)throw new Error("Must input at least d+1 points");var a=t.slice(0,i+1),o=u.apply(void 0,a);if(0===o)throw new Error("Input not in general position");for(var l=new Array(i+1),c=0;c<=i;++c)l[c]=c;o<0&&(l[0]=1,l[1]=0);for(var f=new n(l,new Array(i+1),!1),h=f.adjacent,d=new Array(i+2),c=0;c<=i;++c){for(var p=l.slice(),g=0;g<=i;++g)g===c&&(p[g]=-1);var v=p[0];p[0]=p[1],p[1]=v;var m=new n(p,new Array(i+1),!0);h[c]=m,d[c]=m}d[i+1]=f;for(var c=0;c<=i;++c)for(var p=h[c].vertices,y=h[c].adjacent,g=0;g<=i;++g){var b=p[g];if(b<0)y[g]=f;else for(var x=0;x<=i;++x)h[x].vertices.indexOf(b)<0&&(y[g]=h[x])}for(var _=new s(i,a,d),w=!!e,c=i+1;c0;){t=o.pop();for(var s=(t.vertices,t.adjacent),l=0;l<=r;++l){var u=s[l];if(u.boundary&&!(u.lastVisited<=-n)){for(var c=u.vertices,f=0;f<=r;++f){var h=c[f];i[f]=h<0?e:a[h]}var d=this.orient();if(d>0)return u;u.lastVisited=-n,0===d&&o.push(u)}}}return null},h.walk=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,a=this.tuple,o=e?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];t:for(;!s.boundary;){for(var l=s.vertices,u=s.adjacent,c=0;c<=n;++c)a[c]=i[l[c]];s.lastVisited=r;for(var c=0;c<=n;++c){var f=u[c];if(!(f.lastVisited>=r)){var h=a[c];a[c]=t;var d=this.orient();if(a[c]=h,d<0){s=f;continue t}f.boundary?f.lastVisited=-r:f.lastVisited=r}}return}return s},h.addPeaks=function(t,e){var r=this.vertices.length-1,o=this.dimension,s=this.vertices,l=this.tuple,u=this.interior,c=this.simplices,f=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,u.push(e);for(var h=[];f.length>0;){var e=f.pop(),d=e.vertices,p=e.adjacent,g=d.indexOf(r);if(!(g<0))for(var v=0;v<=o;++v)if(v!==g){var m=p[v];if(m.boundary&&!(m.lastVisited>=r)){var y=m.vertices;if(m.lastVisited!==-r){for(var b=0,x=0;x<=o;++x)y[x]<0?(b=x,l[x]=t):l[x]=s[y[x]];var _=this.orient();if(_>0){y[b]=r,m.boundary=!1,u.push(m),f.push(m),m.lastVisited=r;continue}m.lastVisited=-r}var w=m.adjacent,M=d.slice(),A=p.slice(),k=new n(M,A,!0);c.push(k);var T=w.indexOf(e);if(!(T<0)){w[T]=k,A[g]=m,M[v]=-1,A[v]=e,p[v]=k,k.flip();for(var x=0;x<=o;++x){var E=M[x];if(!(E<0||E===r)){for(var L=new Array(o-1),C=0,S=0;S<=o;++S){var P=M[S];P<0||S===x||(L[C++]=P)}h.push(new i(L,k,x))}}}}}}h.sort(a);for(var v=0;v+1=0?o[l++]=s[c]:u=1&c;if(u===(1&t)){var f=o[0];o[0]=o[1],o[1]=f}e.push(o)}}return e}},{"robust-orientation":231,"simplicial-complex":241}],174:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(e?e.count:0)+(r?r.count:0)+n.length}function i(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function a(t,e){var r=p(e);t.mid=r.mid,t.left=r.left,t.right=r.right,t.leftPoints=r.leftPoints,t.rightPoints=r.rightPoints,t.count=r.count}function o(t,e){var r=t.intervals([]);r.push(e),a(t,r)}function s(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?y:(r.splice(n,1),a(t,r),b)}function l(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function c(t,e){for(var r=0;r>1],a=[],o=[],s=[],r=0;r3*(e+1)?o(this,t):this.left.insert(t):this.left=p([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?o(this,t):this.right.insert(t):this.right=p([t]);else{var r=m.ge(this.leftPoints,t,h),n=m.ge(this.rightPoints,t,d);this.leftPoints.splice(r,0,t),this.rightPoints.splice(n,0,t)}},x.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1))return s(this,t);var r=this.left.remove(t);return 2===r?(this.left=null,this.count-=1,b):(r===b&&(this.count-=1),r)}if(t[0]>this.mid){if(!this.right)return y;if(4*(this.left?this.left.count:0)>3*(e-1))return s(this,t);var r=this.right.remove(t);return 2===r?(this.right=null,this.count-=1,b):(r===b&&(this.count-=1),r)}if(1===this.count)return this.leftPoints[0]===t?2:y;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var n=this,a=this.left;a.right;)n=a,a=a.right;if(n===this)a.right=this.right;else{var o=this.left,r=this.right;n.count-=a.count,n.right=a.left,a.left=o,a.right=r}i(this,a),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?i(this,this.left):i(this,this.right);return b}for(var o=m.ge(this.leftPoints,t,h);othis.mid){if(this.right){var r=this.right.queryPoint(t,e);if(r)return r}return u(this.rightPoints,t,e)}return c(this.leftPoints,e)},x.queryInterval=function(t,e,r){if(tthis.mid&&this.right){var n=this.right.queryInterval(t,e,r);if(n)return n}return ethis.mid?u(this.rightPoints,t,r):c(this.leftPoints,r)};var _=g.prototype;_.insert=function(t){this.root?this.root.insert(t):this.root=new n(t[0],null,null,[t],[t])},_.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),e!==y}return!1},_.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},_.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(_,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(_,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":34}],175:[function(t,e,r){"use strict";function n(t,e){e=e||new Array(t.length);for(var r=0;rv[1][2]&&(b[0]=-b[0]),v[0][2]>v[2][0]&&(b[1]=-b[1]),v[1][0]>v[0][1]&&(b[2]=-b[2]),!0}},{"./normalize":183,"gl-mat4/clone":112,"gl-mat4/create":113,"gl-mat4/determinant":114,"gl-mat4/invert":118,"gl-mat4/transpose":128,"gl-vec3/cross":156,"gl-vec3/dot":157,"gl-vec3/length":158,"gl-vec3/normalize":160}],183:[function(t,e,r){e.exports=function(t,e){var r=e[15];if(0===r)return!1;for(var n=1/r,i=0;i<16;i++)t[i]=e[i]*n;return!0}},{}],184:[function(t,e,r){function n(t,e,r,n){if(0===c(e)||0===c(r))return!1;var i=u(e,h.translate,h.scale,h.skew,h.perspective,h.quaternion),a=u(r,d.translate,d.scale,d.skew,d.perspective,d.quaternion);return!(!i||!a)&&(s(p.translate,h.translate,d.translate,n),s(p.skew,h.skew,d.skew,n),s(p.scale,h.scale,d.scale,n),s(p.perspective,h.perspective,d.perspective,n),f(p.quaternion,h.quaternion,d.quaternion,n),l(t,p.translate,p.scale,p.skew,p.perspective,p.quaternion),!0)}function i(){return{translate:a(),scale:a(1),skew:a(),perspective:o(),quaternion:o()}}function a(t){return[t||0,t||0,t||0]}function o(){return[0,0,0,1]}var s=t("gl-vec3/lerp"),l=t("mat4-recompose"),u=t("mat4-decompose"),c=t("gl-mat4/determinant"),f=t("quat-slerp"),h=i(),d=i(),p=i();e.exports=n},{"gl-mat4/determinant":114,"gl-vec3/lerp":159,"mat4-decompose":182,"mat4-recompose":185,"quat-slerp":218}],185:[function(t,e,r){var n={identity:t("gl-mat4/identity"),translate:t("gl-mat4/translate"),multiply:t("gl-mat4/multiply"),create:t("gl-mat4/create"),scale:t("gl-mat4/scale"),fromRotationTranslation:t("gl-mat4/fromRotationTranslation")},i=(n.create(), n.create());e.exports=function(t,e,r,a,o,s){return n.identity(t),n.fromRotationTranslation(t,s,e),t[3]=o[0],t[7]=o[1],t[11]=o[2],t[15]=o[3],n.identity(i),0!==a[2]&&(i[9]=a[2],n.multiply(t,t,i)),0!==a[1]&&(i[9]=0,i[8]=a[1],n.multiply(t,t,i)),0!==a[0]&&(i[8]=0,i[4]=a[0],n.multiply(t,t,i)),n.scale(t,t,r),t}},{"gl-mat4/create":113,"gl-mat4/fromRotationTranslation":116,"gl-mat4/identity":117,"gl-mat4/multiply":120,"gl-mat4/scale":126,"gl-mat4/translate":127}],186:[function(t,e,r){"use strict";function n(t){this._components=t.slice(),this._time=[0],this.prevMatrix=t.slice(),this.nextMatrix=t.slice(),this.computedMatrix=t.slice(),this.computedInverse=t.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}function i(t){return t=t||{},new n(t.matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}var a=t("binary-search-bounds"),o=t("mat4-interpolate"),s=t("gl-mat4/invert"),l=t("gl-mat4/rotateX"),u=t("gl-mat4/rotateY"),c=t("gl-mat4/rotateZ"),f=t("gl-mat4/lookAt"),h=t("gl-mat4/translate"),d=(t("gl-mat4/scale"),t("gl-vec3/normalize")),p=[0,0,0];e.exports=i;var g=n.prototype;g.recalcMatrix=function(t){var e=this._time,r=a.le(e,t),n=this.computedMatrix;if(!(r<0)){var i=this._components;if(r===e.length-1)for(var l=16*r,u=0;u<16;++u)n[u]=i[l++];else{for(var c=e[r+1]-e[r],l=16*r,f=this.prevMatrix,h=!0,u=0;u<16;++u)f[u]=i[l++];for(var p=this.nextMatrix,u=0;u<16;++u)p[u]=i[l++],h=h&&f[u]===p[u];if(c<1e-6||h)for(var u=0;u<16;++u)n[u]=f[u];else o(n,f,p,(t-e[r])/c)}var g=this.computedUp;g[0]=n[1],g[1]=n[5],g[2]=n[9],d(g,g);var v=this.computedInverse;s(v,n);var m=this.computedEye,y=v[15];m[0]=v[12]/y,m[1]=v[13]/y,m[2]=v[14]/y;for(var b=this.computedCenter,x=Math.exp(this.computedRadius[0]),u=0;u<3;++u)b[u]=m[u]-n[2+4*u]*x}},g.idle=function(t){if(!(t1&&i(t[o[c-2]],t[o[c-1]],u)<=0;)c-=1,o.pop();for(o.push(l),c=s.length;c>1&&i(t[s[c-2]],t[s[c-1]],u)>=0;)c-=1,s.pop();s.push(l)}for(var r=new Array(s.length+o.length-2),f=0,n=0,h=o.length;n0;--d)r[f++]=s[d];return r}e.exports=n;var i=t("robust-orientation")[3]},{"robust-orientation":231}],188:[function(t,e,r){"use strict";function n(t,e){function r(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==v.alt,v.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==v.shift,v.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==v.control,v.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==v.meta,v.meta=!!t.metaKey),e}function n(t,n){var a=i.x(n),o=i.y(n);"buttons"in n&&(t=0|n.buttons),(t!==d||a!==p||o!==g||r(n))&&(d=0|t,p=a||0,g=o||0,e&&e(d,p,g,v))}function a(t){n(0,t)}function o(){(d||p||g||v.shift||v.alt||v.meta||v.control)&&(p=g=0,d=0,v.shift=v.alt=v.control=v.meta=!1,e&&e(0,0,0,v))}function s(t){r(t)&&e&&e(d,p,g,v)}function l(t){0===i.buttons(t)?n(0,t):n(d,t)}function u(t){n(d|i.buttons(t),t)}function c(t){n(d&~i.buttons(t),t)}function f(){m||(m=!0,t.addEventListener("mousemove",l),t.addEventListener("mousedown",u),t.addEventListener("mouseup",c),t.addEventListener("mouseleave",a),t.addEventListener("mouseenter",a),t.addEventListener("mouseout",a),t.addEventListener("mouseover",a),t.addEventListener("blur",o),t.addEventListener("keyup",s),t.addEventListener("keydown",s),t.addEventListener("keypress",s),t!==window&&(window.addEventListener("blur",o),window.addEventListener("keyup",s),window.addEventListener("keydown",s),window.addEventListener("keypress",s)))}function h(){m&&(m=!1,t.removeEventListener("mousemove",l),t.removeEventListener("mousedown",u),t.removeEventListener("mouseup",c),t.removeEventListener("mouseleave",a),t.removeEventListener("mouseenter",a),t.removeEventListener("mouseout",a),t.removeEventListener("mouseover",a),t.removeEventListener("blur",o),t.removeEventListener("keyup",s),t.removeEventListener("keydown",s),t.removeEventListener("keypress",s),t!==window&&(window.removeEventListener("blur",o),window.removeEventListener("keyup",s),window.removeEventListener("keydown",s),window.removeEventListener("keypress",s)))}e||(e=t,t=window);var d=0,p=0,g=0,v={shift:!1,alt:!1,control:!1,meta:!1},m=!1;f();var y={element:t};return Object.defineProperties(y,{enabled:{get:function(){return m},set:function(t){t?f():h()},enumerable:!0},buttons:{get:function(){return d},enumerable:!0},x:{get:function(){return p},enumerable:!0},y:{get:function(){return g},enumerable:!0},mods:{get:function(){return v},enumerable:!0}}),y}e.exports=n;var i=t("mouse-event")},{"mouse-event":190}],189:[function(t,e,r){function n(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var n=t.clientX||0,a=t.clientY||0,o=i(e);return r[0]=n-o.left,r[1]=a-o.top,r}function i(t){return t===window||t===document||t===document.body?a:t.getBoundingClientRect()}var a={left:0,top:0};e.exports=n},{}],190:[function(t,e,r){"use strict";function n(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){var e=t.which;if(2===e)return 4;if(3===e)return 2;if(e>0)return 1<=0)return 1<=0;--e)C(e,0);for(var r=[],e=0;e0;_=_-1&g)x.push(w+"["+T+"+"+v(_)+"]");x.push(m(0));for(var _=0;_0){",h(x[t]),"=1;"),O(t-1,e|1<0&&G.push(s(U,x[V-1])+"*"+o(x[V-1])),F.push(d(U,x[V])+"=("+G.join("-")+")|0")}for(var U=0;U=0;--U)X.push(o(x[U]));F.push(k+"=("+X.join("*")+")|0",M+"=mallocUint32("+k+")",w+"=mallocUint32("+k+")",T+"=0"),F.push(p(0)+"=0");for(var V=1;V<1< 0"),"function"!=typeof t.vertex&&e("Must specify vertex creation function"),"function"!=typeof t.cell&&e("Must specify cell creation function"),"function"!=typeof t.phase&&e("Must specify phase function");for(var a=t.getters||[],o=new Array(n),s=0;s=0?o[s]=!0:o[s]=!1;return b(t.vertex,t.cell,t.phase,i,r,o)}var _=t("typedarray-pool");e.exports=x;var w="V",M="P",A="N",k="Q",T="X",E="T"},{"typedarray-pool":258}],193:[function(t,e,r){"use strict";var n=t("cwise/lib/wrapper")({args:["index","array","scalar"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{_inline_7_arg1_=_inline_7_arg2_.apply(void 0,_inline_7_arg0_)}",args:[{name:"_inline_7_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_7_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_7_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"cwise",blockSize:64});e.exports=function(t,e){return n(t,e),t}},{"cwise/lib/wrapper":78}],194:[function(t,e,r){"use strict";function n(t){if(t in l)return l[t];for(var e=[],r=0;r=0?s.push("0"):e.indexOf(-(l+1))>=0?s.push("s["+l+"]-1"):(s.push("-1"),n.push("1"),o.push("s["+l+"]-2"));var u=".lo("+n.join()+").hi("+o.join()+")";if(0===n.length&&(u=""),r>0){a.push("if(1");for(var l=0;l=0||e.indexOf(-(l+1))>=0||a.push("&&s[",l,"]>2");a.push("){grad",r,"(src.pick(",s.join(),")",u);for(var l=0;l=0||e.indexOf(-(l+1))>=0||a.push(",dst.pick(",s.join(),",",l,")",u);a.push(");")}for(var l=0;l1){dst.set(",s.join(),",",c,",0.5*(src.get(",h.join(),")-src.get(",d.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):a.push("if(s[",c,"]>1){diff(",f,",src.pick(",h.join(),")",u,",src.pick(",d.join(),")",u,");}else{zero(",f,");};");break;case"mirror":0===r?a.push("dst.set(",s.join(),",",c,",0);"):a.push("zero(",f,");");break;case"wrap":var p=s.slice(),g=s.slice();e[l]<0?(p[c]="s["+c+"]-2",g[c]="0"):(p[c]="s["+c+"]-1",g[c]="1"),0===r?a.push("if(s[",c,"]>2){dst.set(",s.join(),",",c,",0.5*(src.get(",p.join(),")-src.get(",g.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):a.push("if(s[",c,"]>2){diff(",f,",src.pick(",p.join(),")",u,",src.pick(",g.join(),")",u,");}else{zero(",f,");};");break;default:throw new Error("ndarray-gradient: Invalid boundary condition")}}r>0&&a.push("};")}(p)}}a.push("return dst;};return gradient");for(var g=["diff","zero"],v=[f,h],o=1;o<=i;++o)g.push("grad"+o),v.push(n(o));g.push(a.join(""));var m=Function.apply(void 0,g),r=m.apply(void 0,v);return l[e]=r,r}function a(t,e,r){if(Array.isArray(r)){if(r.length!==e.dimension)throw new Error("ndarray-gradient: invalid boundary conditions")}else r="string"==typeof r?o(e.dimension,r):o(e.dimension,"clamp");if(t.dimension!==e.dimension+1)throw new Error("ndarray-gradient: output dimension must be +1 input dimension");if(t.shape[e.dimension]!==e.dimension)throw new Error("ndarray-gradient: output shape must match input shape");for(var n=0;n>",rrshift:">>>"};!function(){for(var t in l){var e=l[t];r[t]=a({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"eq"]=a({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),r[t+"s"]=a({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"seq"]=a({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var u={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in u){var e=u[t];r[t]=a({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),r[t+"eq"]=a({args:["array"],body:{args:["a"],body:"a="+e+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var c={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in c){var e=c[t];r[t]=a({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"s"]=a({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"eq"]=a({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=a({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var f=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;tthis_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=o({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=o({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=o({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=a({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=a({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=a({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=o({args:["array","array"],pre:s,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{"cwise-compiler":75}],198:[function(t,e,r){"use strict";var n=t("ndarray"),i=t("./doConvert.js");e.exports=function(t,e){for(var r=[],a=t,o=1;Array.isArray(a);)r.push(a.length),o*=a.length,a=a[0];return 0===r.length?n():(e||(e=n(new Float64Array(o),r)),i(e,t),e)}},{"./doConvert.js":199,ndarray:203}],199:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}",args:[{name:"_inline_1_arg0_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":75}],200:[function(t,e,r){"use strict";function n(t){switch(t){case"uint8":return[l.mallocUint8,l.freeUint8];case"uint16":return[l.mallocUint16,l.freeUint16];case"uint32":return[l.mallocUint32,l.freeUint32];case"int8":return[l.mallocInt8,l.freeInt8];case"int16":return[l.mallocInt16,l.freeInt16];case"int32":return[l.mallocInt32,l.freeInt32];case"float32":return[l.mallocFloat,l.freeFloat];case"float64":return[l.mallocDouble,l.freeDouble];default:return null}}function i(t){for(var e=[],r=0;r1){for(var f=[],h=1;h1){o.push("dptr=0;sptr=ptr");for(var h=t.length-1;h>=0;--h){var d=t[h];0!==d&&o.push(["for(i",d,"=0;i",d,"b){break __l}"].join(""));for(var h=t.length-1;h>=1;--h)o.push("sptr+=e"+h,"dptr+=f"+h,"}");o.push("dptr=cptr;sptr=cptr-s0");for(var h=t.length-1;h>=0;--h){var d=t[h];0!==d&&o.push(["for(i",d,"=0;i",d,"=0;--h){var d=t[h];0!==d&&o.push(["for(i",d,"=0;i",d,"scratch)){",a("cptr",r("cptr-s0")),"cptr-=s0","}",a("cptr","scratch"));if(o.push("}"),t.length>1&&u&&o.push("free(scratch)"),o.push("} return "+s),u){var p=new Function("malloc","free",o.join("\n"));return p(u[0],u[1])}var p=new Function(o.join("\n"));return p()}function o(t,e,r){function a(t){return["(offset+",t,"*s0)"].join("")}function o(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function s(t,r){ @@ -30,14 +30,14 @@ if(!e)return void t.attr("clip-path",null);var r="#"+e,n=o.select("base");n.size r.loneHover=function(t,e){var r={color:t.color||y.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,trace:{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0},n=c.select(e.container),a=e.outerContainer?c.select(e.outerContainer):n,s={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||y.background,container:n,outerContainer:a},l=i([r],s,e.gd);return o(l,s.rotateLabels),l.node()}},{"../../lib":406,"../../lib/events":397,"../../lib/override_cursor":416,"../../lib/svg_text_utils":428,"../../plots/cartesian/axes":448,"../../registry":496,"../color":287,"../dragelement":308,"../drawing":311,"./constants":323,"./helpers":325,d3:79,"fast-isnumeric":87,tinycolor2:252}],327:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,i){i=i||{},r("hoverlabel.bgcolor",i.bgcolor),r("hoverlabel.bordercolor",i.bordercolor),r("hoverlabel.namelength",i.namelength),n.coerceFont(r,"hoverlabel.font",i.font)}},{"../../lib":406}],328:[function(t,e,r){"use strict";function n(t){var e=s.isD3Selection(t)?t:o.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()}function i(t,e,r){return s.castOption(t,e,"hoverlabel."+r)}function a(t,e,r){function n(r){return s.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}return s.castOption(t,r,"hoverinfo",n)}var o=t("d3"),s=t("../../lib"),l=t("../dragelement"),u=t("./helpers"),c=t("./layout_attributes");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:c},attributes:t("./attributes"),layoutAttributes:c,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:u.getDistanceFunction,getClosest:u.getClosest,inbox:u.inbox,appendArrayPointValue:u.appendArrayPointValue,castHoverOption:i,castHoverinfo:a,hover:t("./hover").hover,unhover:l.unhover,loneHover:t("./hover").loneHover,loneUnhover:n,click:t("./click")}},{"../../lib":406,"../dragelement":308,"./attributes":320,"./calc":321,"./click":322,"./constants":323,"./defaults":324,"./helpers":325,"./hover":326,"./layout_attributes":329,"./layout_defaults":330,"./layout_global_defaults":331,d3:79}],329:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../plots/font_attributes")({editType:"none"});i.family.dflt=n.HOVERFONT,i.size.dflt=n.HOVERFONTSIZE,e.exports={dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1],editType:"modebar"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:i,namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"}}},{"../../plots/font_attributes":472,"./constants":323}],330:[function(t,e,r){"use strict";function n(t){for(var e=!0,r=0;r=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}},{}],338:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes");e.exports={bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:i.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:n({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},x:{valType:"number",min:-2,max:3,dflt:1.02,editType:"legend"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",min:-2,max:3,dflt:1,editType:"legend"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"legend"},editType:"legend"}},{"../../plots/font_attributes":472,"../color/attributes":286}],339:[function(t,e,r){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],340:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("./attributes"),o=t("../../plots/layout_attributes"),s=t("./helpers");e.exports=function(t,e,r){function l(t,e){return i.coerce(d,p,a,t,e)}for(var u,c,f,h,d=t.legend||{},p=e.legend={},g=0,v="normal",m=0;m1)){if(l("bgcolor",e.paper_bgcolor),l("bordercolor"),l("borderwidth"),i.coerceFont(l,"font",e.font),l("orientation"),"h"===p.orientation){var b=t.xaxis;b&&b.rangeslider&&b.rangeslider.visible?(u=0,f="left",c=1.1,h="bottom"):(u=0,f="left",c=-.1,h="top")}l("traceorder",v),s.isGrouped(e.legend)&&l("tracegroupgap"),l("x",u),l("xanchor",f),l("y",c),l("yanchor",h),i.noneOrAll(d,p,["x","y"])}}},{"../../lib":406,"../../plots/layout_attributes":486,"../../registry":496,"./attributes":338,"./helpers":344}],341:[function(t,e,r){"use strict";function n(t,e){function r(r){m.convertToTspans(r,e,function(){a(t,e)})}var n=t.data()[0][0],i=e._fullLayout,o=n.trace,s=d.traceIs(o,"pie"),l=o.index,u=s?n.label:o.name,h=t.selectAll("text.legendtext").data([0]);h.enter().append("text").classed("legendtext",!0),h.attr("text-anchor","start").classed("user-select-none",!0).call(g.font,i.legend.font).text(u),e._context.edits.legendText&&!s?h.call(m.makeEditable,{gd:e}).call(r).on("edit",function(t){this.text(t).call(r);var i=t;this.text()||(t=" ");var a,o,s=n.trace._fullInput||{},u={};if(-1!==["ohlc","candlestick"].indexOf(s.type))a=n.trace.transforms,o=a[a.length-1].direction,u[o+".name"]=t;else if(d.hasTransform(s,"groupby")){var h=d.getTransformIndices(s,"groupby"),p=h[h.length-1],g=f.keyedContainer(s,"transforms["+p+"].styles","target","value.name");""===i?g.remove(n.trace._group):g.set(n.trace._group,t),u=g.constructUpdate()}else u.name=t;return c.restyle(e,u,l)}):h.call(r)}function i(t,e){var r,n=1,i=t.selectAll("rect").data([0]);i.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(v.fill,"rgba(0,0,0,0)"),i.on("mousedown",function(){r=(new Date).getTime(),r-e._legendMouseDownTimeT&&(n=Math.max(n-1,1)),1===n?r._clickTimeout=setTimeout(function(){y(t,e,n)},T):2===n&&(r._clickTimeout&&clearTimeout(r._clickTimeout),e._legendMouseDownTime=0,y(t,e,n))}})}function a(t,e){var r=t.data()[0][0];if(!r.trace.showlegend)return void t.remove();var n,i,a=t.select("g[class*=math-group]"),o=a.node(),s=e._fullLayout.legend,l=s.font.size*_;if(o){var u=g.bBox(o);n=u.height,i=u.width,g.setTranslate(a,0,n/4)}else{var c=t.select(".legendtext"),f=m.lineCount(c),h=c.node();n=l*f,i=h?g.bBox(h).width:0;var d=l*(.3+(1-f)/2);m.positionText(c,40,d)}n=Math.max(n,16)+3,r.height=n,r.width=i}function o(t,e,r){var n=t._fullLayout,i=n.legend,a=i.borderwidth,o=A.isGrouped(i),s=0;if(i.width=0,i.height=0,A.isVertical(i))o&&e.each(function(t,e){g.setTranslate(this,0,e*i.tracegroupgap)}),r.each(function(t){var e=t[0],r=e.height,n=e.width;g.setTranslate(this,a,5+a+i.height+r/2),i.height+=r,i.width=Math.max(i.width,n)}),i.width+=45+2*a,i.height+=10+2*a,o&&(i.height+=(i._lgroupsLength-1)*i.tracegroupgap),s=40;else if(o){for(var l=[i.width],c=e.data(),f=0,h=c.length;fn.width-(n.margin.r+n.margin.l)&&(b=0,v+=m,i.height=i.height+m,m=0),g.setTranslate(this,a+b,5+a+e.height/2+v),i.width+=o+r,i.height=Math.max(i.height,e.height),b+=o+r,m=Math.max(e.height,m)}),i.width+=2*a,i.height+=10+2*a}i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),r.each(function(e){var r=e[0];u.select(this).select(".legendtoggle").call(g.setRect,0,-r.height/2,(t._context.edits.legendText?0:i.width)+s,r.height)})}function s(t){var e=t._fullLayout,r=e.legend,n="left";k.isRightAnchor(r)?n="right":k.isCenterAnchor(r)&&(n="center");var i="top";k.isBottomAnchor(r)?i="bottom":k.isMiddleAnchor(r)&&(i="middle"),h.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}[i]||0),t:r.height*({bottom:1,middle:.5}[i]||0)})}function l(t){var e=t._fullLayout,r=e.legend,n="left";k.isRightAnchor(r)?n="right":k.isCenterAnchor(r)&&(n="center"),h.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 u=t("d3"),c=t("../../plotly"),f=t("../../lib"),h=t("../../plots/plots"),d=t("../../registry"),p=t("../dragelement"),g=t("../drawing"),v=t("../color"),m=t("../../lib/svg_text_utils"),y=t("./handle_click"),b=t("./constants"),x=t("../../constants/interactions"),_=t("../../constants/alignment").LINE_SPACING,w=t("./get_legend_data"),M=t("./style"),A=t("./helpers"),k=t("./anchor_utils"),T=x.DBLCLICKDELAY;e.exports=function(t){function e(t,e){C.attr("data-scroll",e).call(g.setTranslate,0,e),S.call(g.setRect,F,t,b.scrollBarWidth,b.scrollBarHeight),E.select("rect").attr({y:m.borderwidth-e})}var r=t._fullLayout,a="legend"+r._uid;if(r._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var m=r.legend,x=r.showlegend&&w(t.calcdata,m),_=r.hiddenlabels||[];if(!r.showlegend||!x.length)return r._infolayer.selectAll(".legend").remove(),r._topdefs.select("#"+a).remove(),void h.autoMargin(t,"legend");var A=r._infolayer.selectAll("g.legend").data([0]);A.enter().append("g").attr({class:"legend","pointer-events":"all"});var E=r._topdefs.selectAll("#"+a).data([0]);E.enter().append("clipPath").attr("id",a).append("rect");var L=A.selectAll("rect.bg").data([0]);L.enter().append("rect").attr({class:"bg","shape-rendering":"crispEdges"}),L.call(v.stroke,m.bordercolor),L.call(v.fill,m.bgcolor),L.style("stroke-width",m.borderwidth+"px");var C=A.selectAll("g.scrollbox").data([0]);C.enter().append("g").attr("class","scrollbox");var S=A.selectAll("rect.scrollbar").data([0]);S.enter().append("rect").attr({class:"scrollbar",rx:20,ry:2,width:0,height:0}).call(v.fill,"#808BA4");var P=C.selectAll("g.groups").data(x);P.enter().append("g").attr("class","groups"),P.exit().remove();var R=P.selectAll("g.traces").data(f.identity);R.enter().append("g").attr("class","traces"),R.exit().remove(),R.call(M,t).style("opacity",function(t){var e=t[0].trace;return d.traceIs(e,"pie")?-1!==_.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){u.select(this).call(n,t).call(i,t)});var I=0!==A.enter().size();I&&(o(t,P,R),s(t));var O=r.width,N=r.height;o(t,P,R),m.height>N?l(t):s(t);var D=r._size,z=D.l+D.w*m.x,j=D.t+D.h*(1-m.y);k.isRightAnchor(m)?z-=m.width:k.isCenterAnchor(m)&&(z-=m.width/2),k.isBottomAnchor(m)?j-=m.height:k.isMiddleAnchor(m)&&(j-=m.height/2);var F=m.width,B=D.w;F>B?(z=D.l,F=B):(z+F>O&&(z=O-F),z<0&&(z=0),F=Math.min(O-z,m.width));var U=m.height,V=D.h;U>V?(j=D.t,U=V):(j+U>N&&(j=N-U),j<0&&(j=0),U=Math.min(N-j,m.height)),g.setTranslate(A,z,j);var H,q,G=U-b.scrollBarHeight-2*b.scrollBarMargin,X=m.height-U;if(m.height<=U||t._context.staticPlot)L.attr({width:F-m.borderwidth,height:U-m.borderwidth,x:m.borderwidth/2,y:m.borderwidth/2}),g.setTranslate(C,0,0),E.select("rect").attr({width:F-2*m.borderwidth,height:U-2*m.borderwidth,x:m.borderwidth,y:m.borderwidth}),C.call(g.setClipUrl,a);else{H=b.scrollBarMargin,q=C.attr("data-scroll")||0,L.attr({width:F-2*m.borderwidth+b.scrollBarWidth+b.scrollBarMargin,height:U-m.borderwidth,x:m.borderwidth/2,y:m.borderwidth/2}),E.select("rect").attr({width:F-2*m.borderwidth+b.scrollBarWidth+b.scrollBarMargin,height:U-2*m.borderwidth,x:m.borderwidth,y:m.borderwidth-q}),C.call(g.setClipUrl,a),I&&e(H,q),A.on("wheel",null),A.on("wheel",function(){q=f.constrain(C.attr("data-scroll")-u.event.deltaY/G*X,-X,0),H=b.scrollBarMargin-q/X*G,e(H,q),0!==q&&q!==-X&&u.event.preventDefault()}),S.on(".drag",null),C.on(".drag",null);var W=u.behavior.drag().on("drag",function(){H=f.constrain(u.event.y-b.scrollBarHeight/2,b.scrollBarMargin,b.scrollBarMargin+G),q=-(H-b.scrollBarMargin)/G*X,e(H,q)});S.call(W),C.call(W)}if(t._context.edits.legendPosition){var Y,Z,Q,$;A.classed("cursor-move",!0),p.init({element:A.node(),gd:t,prepFn:function(){var t=g.getTranslate(A);Q=t.x,$=t.y},moveFn:function(t,e){var r=Q+t,n=$+e;g.setTranslate(A,r,n),Y=p.align(r,0,D.l,D.l+D.w,m.xanchor),Z=p.align(n,0,D.t+D.h,D.t,m.yanchor)},doneFn:function(e,n,i){if(e&&void 0!==Y&&void 0!==Z)c.relayout(t,{"legend.x":Y,"legend.y":Z});else{var a=r._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return i.clientX>=t.left&&i.clientX<=t.right&&i.clientY>=t.top&&i.clientY<=t.bottom});a.size()>0&&(1===n?A._clickTimeout=setTimeout(function(){y(a,t,n)},T):2===n&&(A._clickTimeout&&clearTimeout(A._clickTimeout),y(a,t,n)))}}})}}}},{"../../constants/alignment":384,"../../constants/interactions":387,"../../lib":406,"../../lib/svg_text_utils":428,"../../plotly":443,"../../plots/plots":488,"../../registry":496,"../color":287,"../dragelement":308,"../drawing":311,"./anchor_utils":337,"./constants":339,"./get_legend_data":342,"./handle_click":343,"./helpers":344,"./style":346,d3:79}],342:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){function r(t,r){if(""!==t&&i.isGrouped(e))-1===l.indexOf(t)?(l.push(t),u=!0,s[t]=[[r]]):s[t].push([r]);else{var n="~~i"+f;l.push(n),s[n]=[[r]],f++}}var a,o,s={},l=[],u=!1,c={},f=0;for(a=0;ar[1])return r[1]}return i}function i(t){return t[0]}var s,u,c=t[0],f=c.trace,h=l.hasMarkers(f),d=l.hasText(f),p=l.hasLines(f);if(h||d||p){var g={},v={};h&&(g.mc=r("marker.color",i),g.mo=r("marker.opacity",a.mean,[.2,1]),g.ms=r("marker.size",a.mean,[2,16]),g.mlc=r("marker.line.color",i),g.mlw=r("marker.line.width",a.mean,[0,5]),v.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),p&&(v.line={width:r("line.width",i,[0,10])}),d&&(g.tx="Aa",g.tp=r("textposition",i),g.ts=10,g.tc=r("textfont.color",i),g.tf=r("textfont.family",i)),s=[a.minExtend(c,g)],u=a.minExtend(f,v)}var m=n.select(this).select("g.legendpoints"),y=m.selectAll("path.scatterpts").data(h?s:[]);y.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),y.exit().remove(),y.call(o.pointStyle,u,e),h&&(s[0].mrc=3);var b=m.selectAll("g.pointtext").data(d?s:[]);b.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),b.exit().remove(),b.selectAll("text").call(o.textPointStyle,u,e)}function f(t){var e=t[0].trace,r=e.marker||{},a=r.line||{},o=n.select(this).select("g.legendpoints").selectAll("path.legendbar").data(i.traceIs(e,"bar")?[t]:[]);o.enter().append("path").classed("legendbar",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),o.exit().remove(),o.each(function(t){var e=n.select(this),i=t[0],o=(i.mlw+1||a.width+1)-1;e.style("stroke-width",o+"px").call(s.fill,i.mc||r.color),o&&e.call(s.stroke,i.mlc||a.color)})}function h(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(i.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(){var t=e.line.width,r=n.select(this);r.style("stroke-width",t+"px").call(s.fill,e.fillcolor),t&&r.call(s.stroke,e.line.color)})}function d(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendpie").data(i.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(u,t[0],e)}t.each(function(t){var e=n.select(this),r=e.selectAll("g.layers").data([0]);r.enter().append("g").classed("layers",!0),r.style("opacity",t[0].trace.opacity),r.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),r.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var i=r.selectAll("g.legendsymbols").data([t]);i.enter().append("g").classed("legendsymbols",!0),i.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(f).each(h).each(d).each(r).each(c)}},{"../../lib":406,"../../registry":496,"../../traces/pie/style_one":511,"../../traces/scatter/subtypes":534,"../color":287,"../drawing":311,d3:79}],347:[function(t,e,r){"use strict";function n(t,e){var r,n,i=e.currentTarget,a=i.getAttribute("data-attr"),o=i.getAttribute("data-val")||!0,s=t._fullLayout,l={},u=d.list(t,null,!0),c="on";if("zoom"===a){var h,p="in"===o?.5:2,g=(1+p)/2,v=(1-p)/2;for(n=0;n1)return n(["resetViews","toggleHover"]),o(m,r);c&&(n(["zoom3d","pan3d","orbitRotation","tableRotation"]),n(["resetCameraDefault3d","resetCameraLastSave3d"]),n(["hoverClosest3d"]));var y=i(s),b=[];return((u||p)&&!y||g)&&(b=["zoom2d","pan2d"]),(v||f)&&(b=["pan2d"]),a(l)&&(b.push("select2d"),b.push("lasso2d")),b.length&&n(b),!u&&!p||y||g||n(["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"]),u&&d?n(["toggleHover"]):p?n(["hoverClosestGl2d"]):u?n(["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]):d?n(["hoverClosestPie"]):v?n(["resetViewMapbox","toggleHover"]):f&&(n(["zoomInGeo","zoomOutGeo","resetGeo"]),n(["hoverClosestGeo"])),o(m,r)}function i(t){for(var e=l.list({_fullLayout:t},null,!0),r=!0,n=0;n0)){var p=i(e,r,l);f("x",p[0]),f("y",p[1]),a.noneOrAll(t,e,["x","y"]),f("xanchor"),f("yanchor"),a.coerceFont(f,"font",r.font);var g=f("bgcolor");f("activecolor",o.contrast(g,u.lightAmount,u.darkAmount)),f("bordercolor"),f("borderwidth")}}},{"../../lib":406,"../color":287,"./attributes":351,"./button_attributes":352,"./constants":353}],355:[function(t,e,r){"use strict";function n(t){for(var e=m.list(t,"x",!0),r=[],n=0;np&&(p=h)));return p>=d?[d,p]:void 0}}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./constants"),s=t("./helpers");e.exports=function(t){var e=t._fullLayout,r=i.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var s=0;sX&&n>W&&!t.shiftKey?p.getCursor(i/r,1-a/n):"move";g(e,o),G=o.split("-")[0]}function a(e){F=f.getFromId(t,r.xref),B=f.getFromId(t,r.yref),U=m.getDataToPixel(t,F),V=m.getDataToPixel(t,B,!0),H=m.getPixelToData(t,F),q=m.getPixelToData(t,B,!0);var a="shapes["+n+"]";"path"===r.type?(z=r.path,j=a+".path"):(v=U(r.x0),y=V(r.y0),b=U(r.x1),x=V(r.y1),_=a+".x0",w=a+".y0",M=a+".x1",A=a+".y1"),vW&&(d[C]=r[I]=q(u),d[S]=r[O]=q(c)),h-f>X&&(d[P]=r[N]=H(f),d[R]=r[D]=H(h))}e.attr("d",o(t,r))}var d,v,y,b,x,_,w,M,A,k,T,E,L,C,S,P,R,I,O,N,D,z,j,F,B,U,V,H,q,G,X=10,W=10,Y={element:e.node(),gd:t,prepFn:a,doneFn:s},Z=Y.element.getBoundingClientRect();p.init(Y),e.node().onmousemove=i}function o(t,e){var r,n,i,a,o=e.type,l=f.getFromId(t,e.xref),u=f.getFromId(t,e.yref),c=t._fullLayout._size;if(l?(r=m.shapePositionToRange(l),n=function(t){ return l._offset+l.r2p(r(t,!0))}):n=function(t){return c.l+c.w*t},u?(i=m.shapePositionToRange(u),a=function(t){return u._offset+u.r2p(i(t,!0))}):a=function(t){return c.t+c.h*(1-t)},"path"===o)return l&&"date"===l.type&&(n=m.decodeDate(n)),u&&"date"===u.type&&(a=m.decodeDate(a)),s(e.path,n,a);var h=n(e.x0),d=n(e.x1),p=a(e.y0),g=a(e.y1);if("line"===o)return"M"+h+","+p+"L"+d+","+g;if("rect"===o)return"M"+h+","+p+"H"+d+"V"+g+"H"+h+"Z";var v=(h+d)/2,y=(p+g)/2,b=Math.abs(v-h),x=Math.abs(y-p),_="A"+b+","+x,w=v+b+","+y;return"M"+w+_+" 0 1,1 "+v+","+(y-x)+_+" 0 0,1 "+w+"Z"}function s(t,e,r){return t.replace(v.segmentRE,function(t){var n=0,i=t.charAt(0),a=v.paramIsX[i],o=v.paramIsY[i],s=v.numParams[i],l=t.substr(1).replace(v.paramRE,function(t){return a[n]?t=e(t):o[n]&&(t=r(t)),n++,n>s&&(t="X"),t});return n>s&&(l=l.replace(/[\s,]*X.*/,""),c.log("Ignoring extra params in segment "+t)),i+l})}function l(t,e,r){return t.replace(v.segmentRE,function(t){var n=0,i=t.charAt(0),a=v.paramIsX[i],o=v.paramIsY[i],s=v.numParams[i];return i+t.substr(1).replace(v.paramRE,function(t){return n>=s?t:(a[n]?t=e(t):o[n]&&(t=r(t)),n++,t)})})}var u=t("../../plotly"),c=t("../../lib"),f=t("../../plots/cartesian/axes"),h=t("../color"),d=t("../drawing"),p=t("../dragelement"),g=t("../../lib/setcursor"),v=t("./constants"),m=t("./helpers");e.exports={draw:n,drawOne:i}},{"../../lib":406,"../../lib/setcursor":424,"../../plotly":443,"../../plots/cartesian/axes":448,"../color":287,"../dragelement":308,"../drawing":311,"./constants":366,"./helpers":369}],369:[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 i,a=t._fullLayout._size;if(e){var o=r.shapePositionToRange(e);i=function(t){return e._offset+e.r2p(o(t,!0))},"date"===e.type&&(i=r.decodeDate(i))}else i=n?function(t){return a.t+a.h*(1-t)}:function(t){return a.l+a.w*t};return i},r.getPixelToData=function(t,e,n){var i,a=t._fullLayout._size;if(e){var o=r.rangeToShapePosition(e);i=function(t){return o(e.p2r(t-e._offset))}}else i=n?function(t){return 1-(t-a.t)/a.h}:function(t){return(t-a.l)/a.w};return i}},{}],370:[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":364,"./calc_autorange":365,"./defaults":367,"./draw":368}],371:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./attributes"),o=t("./helpers");e.exports=function(t,e,r,s,l){function u(r,i){return n.coerce(t,e,a,r,i)}if(s=s||{},l=l||{},!u("visible",!l.itemIsNotPlainObject))return e;u("layer"),u("opacity"),u("fillcolor"),u("line.color"),u("line.width"),u("line.dash");for(var c=t.path?"path":"rect",f=u("type",c),h=["x","y"],d=0;d<2;d++){var p=h[d],g={_fullLayout:r},v=i.coerceRef(t,e,g,p,"","paper");if("path"!==f){var m,y,b;"paper"!==v?(m=i.getFromId(g,v),b=o.rangeToShapePosition(m),y=o.shapePositionToRange(m)):y=b=n.identity;var x=p+"0",_=p+"1",w=t[x],M=t[_];t[x]=y(t[x],!0),t[_]=y(t[_],!0),i.coercePosition(e,g,u,v,x,.25),i.coercePosition(e,g,u,v,_,.75),e[x]=b(e[x]),e[_]=b(e[_]),t[x]=w,t[_]=M}}return"path"===f?u("path"):n.noneOrAll(t,e,["x0","x1","y0","y1"]),e}},{"../../lib":406,"../../plots/cartesian/axes":448,"./attributes":364,"./helpers":369}],372:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/pad_attributes"),a=t("../../lib/extend").extendDeepAll,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/animation_attributes"),l=t("./constants"),u={_isLinkedToArray:"step",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}};e.exports=o({_isLinkedToArray:"slider",visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:u,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:a({},i,{},{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:s.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:n({})},font:n({}),activebgcolor:{valType:"color",dflt:l.gripBgActiveColor},bgcolor:{valType:"color",dflt:l.railBgColor},bordercolor:{valType:"color",dflt:l.railBorderColor},borderwidth:{valType:"number",min:0,dflt:l.railBorderWidth},ticklen:{valType:"number",min:0,dflt:l.tickLength},tickcolor:{valType:"color",dflt:l.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:l.minorTickLength}},"arraydraw","from-root")},{"../../lib/extend":398,"../../plot_api/edit_types":432,"../../plots/animation_attributes":444,"../../plots/font_attributes":472,"../../plots/pad_attributes":487,"./constants":373}],373:[function(t,e,r){"use strict";e.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],374:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return a.coerce(t,e,s,r,n)}n("visible",i(t,e).length>0)&&(n("active"),n("x"),n("y"),a.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"),a.coerceFont(n,"font",r.font),n("currentvalue.visible")&&(n("currentvalue.xanchor"),n("currentvalue.prefix"),n("currentvalue.suffix"),n("currentvalue.offset"),a.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 i(t,e){function r(t,e){return a.coerce(n,i,c,t,e)}for(var n,i,o=t.steps||[],s=e.steps=[],l=0;l=r.steps.length&&(r.active=0),e.call(s,r).call(x,r).call(c,r).call(p,r).call(b,t,r).call(l,t,r),k.setTranslate(e,r.lx+r.pad.l,r.ly+r.pad.t),e.call(v,r,r.active/(r.steps.length-1),!1),e.call(s,r)}function s(t,e,r){if(e.currentvalue.visible){var n,i,a=t.selectAll("text").data([0]);switch(e.currentvalue.xanchor){case"right":n=e.inputAreaLength-L.currentValueInset-e.currentValueMaxWidth,i="left";break;case"center":n=.5*e.inputAreaLength,i="middle";break;default:n=L.currentValueInset,i="left"}a.enter().append("text").classed(L.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":i,"data-notex":1});var o=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)o+=r;else{o+=e.steps[e.active].label}e.currentvalue.suffix&&(o+=e.currentvalue.suffix),a.call(k.font,e.currentvalue.font).text(o).call(T.convertToTspans,e.gd);var s=T.lineCount(a),l=(e.currentValueMaxLines+1-s)*e.currentvalue.font.size*C;return T.positionText(a,n,l),a}}function l(t,e,r){var n=t.selectAll("rect."+L.gripRectClass).data([0]);n.enter().append("rect").classed(L.gripRectClass,!0).call(d,e,t,r).style("pointer-events","all"),n.attr({width:L.gripWidth,height:L.gripHeight,rx:L.gripRadius,ry:L.gripRadius}).call(A.stroke,r.bordercolor).call(A.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function u(t,e,r){var n=t.selectAll("text").data([0]);return n.enter().append("text").classed(L.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1}),n.call(k.font,r.font).text(e.step.label).call(T.convertToTspans,r.gd),n}function c(t,e){var r=t.selectAll("g."+L.labelsClass).data([0]);r.enter().append("g").classed(L.labelsClass,!0);var n=r.selectAll("g."+L.labelGroupClass).data(e.labelSteps);n.enter().append("g").classed(L.labelGroupClass,!0),n.exit().remove(),n.each(function(t){var r=w.select(this);r.call(u,t,e),k.setTranslate(r,m(e,t.fraction),L.tickOffset+e.ticklen+e.font.size*C+L.labelOffset+e.currentValueTotalHeight)})}function f(t,e,r,n,i){var a=Math.round(n*(r.steps.length-1));a!==r.active&&h(t,e,r,a,!0,i)}function h(t,e,r,n,i,a){var o=r.active;r._input.active=r.active=n;var l=r.steps[r.active];e.call(v,r,r.active/(r.steps.length-1),a),e.call(s,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:i,previousActive:o}),l&&l.method&&i&&(e._nextMethod?(e._nextMethod.step=l,e._nextMethod.doCallback=i,e._nextMethod.doTransition=a):(e._nextMethod={step:l,doCallback:i,doTransition:a},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(r.execute&&M.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function d(t,e,r){function n(){return r.data()[0]}var i=r.node(),a=w.select(e);t.on("mousedown",function(){var t=n();e.emit("plotly_sliderstart",{slider:t});var o=r.select("."+L.gripRectClass);w.event.stopPropagation(),w.event.preventDefault(),o.call(A.fill,t.activebgcolor);var s=y(t,w.mouse(i)[0]);f(e,r,t,s,!0),t._dragging=!0,a.on("mousemove",function(){var t=n(),a=y(t,w.mouse(i)[0]);f(e,r,t,a,!1)}),a.on("mouseup",function(){var t=n();t._dragging=!1,o.call(A.fill,t.bgcolor),a.on("mouseup",null),a.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function p(t,e){var r=t.selectAll("rect."+L.tickRectClass).data(e.steps);r.enter().append("rect").classed(L.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each(function(t,r){var n=r%e.labelStride==0,i=w.select(this);i.attr({height:n?e.ticklen:e.minorticklen}).call(A.fill,e.tickcolor),k.setTranslate(i,m(e,r/(e.steps.length-1))-.5*e.tickwidth,(n?L.tickOffset:L.minorTickOffset)+e.currentValueTotalHeight)})}function g(t){t.labelSteps=[];for(var e=t.steps.length,r=0;r0&&(o=o.transition().duration(e.transition.duration).ease(e.transition.easing)),o.attr("transform","translate("+(a-.5*L.gripWidth)+","+e.currentValueTotalHeight+")")}}function m(t,e){return t.inputAreaStart+L.stepInset+(t.inputAreaLength-2*L.stepInset)*Math.min(1,Math.max(0,e))}function y(t,e){return Math.min(1,Math.max(0,(e-L.stepInset-t.inputAreaStart)/(t.inputAreaLength-2*L.stepInset-2*t.inputAreaStart)))}function b(t,e,r){var n=t.selectAll("rect."+L.railTouchRectClass).data([0]);n.enter().append("rect").classed(L.railTouchRectClass,!0).call(d,e,t,r).style("pointer-events","all"),n.attr({width:r.inputAreaLength,height:Math.max(r.inputAreaWidth,L.tickOffset+r.ticklen+r.labelHeight)}).call(A.fill,r.bgcolor).attr("opacity",0),k.setTranslate(n,0,r.currentValueTotalHeight)}function x(t,e){var r=t.selectAll("rect."+L.railRectClass).data([0]);r.enter().append("rect").classed(L.railRectClass,!0);var n=e.inputAreaLength-2*L.railInset;r.attr({width:n,height:L.railWidth,rx:L.railRadius,ry:L.railRadius,"shape-rendering":"crispEdges"}).call(A.stroke,e.bordercolor).call(A.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),k.setTranslate(r,L.railInset,.5*(e.inputAreaWidth-L.railWidth)+e.currentValueTotalHeight)}function _(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n0?[0]:[]);if(s.enter().append("g").classed(L.containerClassName,!0).style("cursor","ew-resize"),s.exit().remove(),s.exit().size()&&_(t),0!==r.length){var l=s.selectAll("g."+L.groupClassName).data(r,i);l.enter().append("g").classed(L.groupClassName,!0),l.exit().each(function(e){w.select(this).remove(),e._commandObserver.remove(),delete e._commandObserver,M.autoMargin(t,L.autoMarginIdRoot+e._index)});for(var u=0;u0||h<0){var g={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[_.side];e.attr("transform","translate("+g+")")}}}var v,m=r.propContainer,y=r.propName,b=r.traceIndex,x=r.dfltName,_=r.avoid||{},w=r.attributes,M=r.transform,A=r.containerGroup,k=t._fullLayout,T=m.titlefont.family,E=m.titlefont.size,L=m.titlefont.color,C=1,S=!1,P=m.title.trim();"title"===y?v="titleText":-1!==y.indexOf("axis")?v="axisTitleText":y.indexOf(!0)&&(v="colorbarTitleText");var R=t._context.edits[v];""===P&&(C=0),P.match(h)&&(C=.2,S=!0,R||(P=""));var I=P||R;A||(A=k._infolayer.selectAll(".g-"+e).data([0]),A.enter().append("g").classed("g-"+e,!0));var O=A.selectAll("text").data(I?[0]:[]);if(O.enter().append("text"),O.text(P).attr("class",e),O.exit().remove(),I){O.call(d);var N="Click to enter "+x+" title";R&&(P?O.on(".opacity",null):function(){C=0,S=!0,P=N,O.text(P).on("mouseover.opacity",function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)})}(),O.call(c.makeEditable,{gd:t}).on("edit",function(e){void 0!==b?a.restyle(t,y,e,b):a.relayout(t,y,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(d)}).on("input",function(t){this.text(t||" ").call(c.positionText,w.x,w.y)})),O.classed("js-placeholder",S)}}},{"../../constants/interactions":387,"../../lib":406,"../../lib/svg_text_utils":428,"../../plotly":443,"../../plots/plots":488,"../color":287,"../drawing":311,d3:79,"fast-isnumeric":87}],378:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l={_isLinkedToArray:"button",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}};e.exports=o({_isLinkedToArray:"updatemenu",_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons: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:a({},s,{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}},"arraydraw","from-root")},{"../../lib/extend":398,"../../plot_api/edit_types":432,"../../plots/font_attributes":472,"../../plots/pad_attributes":487,"../color/attributes":286}],379:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],380:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return a.coerce(t,e,s,r,n)}n("visible",i(t,e).length>0)&&(n("active"),n("direction"),n("type"),n("showactive"),n("x"),n("y"),a.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),a.coerceFont(n,"font",r.font),n("bgcolor",r.paper_bgcolor),n("bordercolor"),n("borderwidth"))}function i(t,e){function r(t,e){return a.coerce(n,i,c,t,e)}for(var n,i,o=t.buttons||[],s=e.buttons=[],l=0;l0?[0]:[]);if(a.enter().append("g").classed(C.containerClassName,!0).style("cursor","pointer"),a.exit().remove(),a.exit().size()&&_(t),0!==r.length){var c=a.selectAll("g."+C.headerGroupClassName).data(r,i);c.enter().append("g").classed(C.headerGroupClassName,!0);var f=a.selectAll("g."+C.dropdownButtonGroupClassName).data([0]);f.enter().append("g").classed(C.dropdownButtonGroupClassName,!0).style("pointer-events","all");for(var h=0;hM,T=n.barLength+2*n.barPad,E=n.barWidth+2*n.barPad,L=p,C=v+m;C+E>u&&(C=u-E);var S=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);S.exit().on(".drag",null).remove(),S.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,n.barColor),k?(this.hbar=S.attr({rx:n.barRadius,ry:n.barRadius,x:L,y:C,width:T,height:E}),this._hbarXMin=L+T/2,this._hbarTranslateMax=M-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var P=m>A,R=n.barWidth+2*n.barPad,I=n.barLength+2*n.barPad,O=p+g,N=v;O+R>l&&(O=l-R);var D=this.container.selectAll("rect.scrollbar-vertical").data(P?[0]:[]);D.exit().on(".drag",null).remove(),D.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,n.barColor),P?(this.vbar=D.attr({rx:n.barRadius,ry:n.barRadius,x:O,y:N,width:R,height:I}),this._vbarYMin=N+I/2,this._vbarTranslateMax=A-I):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var z=this.id,j=c-.5,F=P?f+R+.5:f+.5,B=h-.5,U=k?d+E+.5:d+.5,V=s._topdefs.selectAll("#"+z).data(k||P?[0]:[]);if(V.exit().remove(),V.enter().append("clipPath").attr("id",z).append("rect"),k||P?(this._clipRect=V.select("rect").attr({x:Math.floor(j),y:Math.floor(B),width:Math.ceil(F)-Math.floor(j),height:Math.ceil(U)-Math.floor(B)}),this.container.call(o.setClipUrl,z),this.bg.attr({x:p,y:v,width:g,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),k||P){var H=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(H);var q=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault(),i.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(q),P&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,r)},n.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},n.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=i.event.dx),this.vbar&&(e-=i.event.dy),this.setTranslate(t,e)},n.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=i.event.deltaY),this.vbar&&(e+=i.event.deltaY),this.setTranslate(t,e)},n.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,n=r+this._hbarTranslateMax;t=(s.constrain(i.event.x,r,n)-r)/(n-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,o=a+this._vbarTranslateMax;e=(s.constrain(i.event.y,a,o)-a)/(o-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},n.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=s.constrain(t||0,0,r),e=s.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(o.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/r;this.hbar.call(o.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var a=e/n;this.vbar.call(o.setTranslate,t,e+a*this._vbarTranslateMax)}}},{"../../lib":406,"../color":287,"../drawing":311,d3:79}],384:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},LINE_SPACING:1.3,MID_SHIFT:.35}},{}],385:[function(t,e,r){"use strict";e.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}},{}],386:[function(t,e,r){"use strict";e.exports={circle:"\u25cf","circle-open":"\u25cb",square:"\u25a0","square-open":"\u25a1",diamond:"\u25c6","diamond-open":"\u25c7",cross:"+",x:"\u274c"}},{}],387:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300,DESELECTDIM:.2}},{}],388:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,MINUS_SIGN:"\u2212"}},{}],389:[function(t,e,r){"use strict";e.exports={entityToUnicode:{mu:"\u03bc","#956":"\u03bc",amp:"&","#28":"&",lt:"<","#60":"<",gt:">","#62":">",nbsp:"\xa0","#160":"\xa0",times:"\xd7","#215":"\xd7",plusmn:"\xb1","#177":"\xb1",deg:"\xb0","#176":"\xb0"}}},{}],390:[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}},{}],391:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.31.1",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/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":280,"./components/annotations3d":285,"./components/fx":328,"./components/images":336,"./components/legend":345,"./components/rangeselector":357,"./components/rangeslider":363,"./components/shapes":370,"./components/sliders":376,"./components/updatemenus":382,"./fonts/mathjax_config":392,"./lib/queue":419,"./plot_api/plot_schema":437,"./plot_api/register":438,"./plot_api/set_plot_config":439,"./plot_api/to_image":441,"./plot_api/validate":442,"./plotly":443,"./snapshot":501,"./snapshot/download":498,"./traces/scatter":524,d3:79,"es6-promise":84}],392:[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},{}],393:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../constants/numerical").BADNUM,a=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(a,"")),n(t)?Number(t):i}},{"../constants/numerical":388,"fast-isnumeric":87}],394:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("../plots/attributes"),o=t("../components/colorscale/get_scale"),s=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),l=t("./regex").counter;r.valObjectMeta={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),-1===n.values.indexOf(t)?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;ni.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},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){if("string"==typeof t&&l(r).test(t))return void e.set(t);e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!l(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"!=typeof t)return void e.set(r);if(-1!==(n.extras||[]).indexOf(t))return void e.set(t);for(var i=t.split("+"),a=0;a0&&(o=o.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+o}return n}function l(t){return t.formatDate("yyyy")}function u(t){return t.formatDate("M yyyy")}function c(t){return t.formatDate("M d")}function f(t){return t.formatDate("M d, yyyy")}var h=t("d3"),d=t("fast-isnumeric"),p=t("./loggers").error,g=t("./mod"),v=t("../constants/numerical"),m=v.BADNUM,y=v.ONEDAY,b=v.ONEHOUR,x=v.ONEMIN,_=v.ONESEC,w=v.EPOCHJD,M=t("../registry"),A=h.time.format.utc,k=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,T=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,E=(new Date).getFullYear()-70;r.dateTick0=function(t,e){return n(t)?e?M.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:M.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},r.dfltRange=function(t){return n(t)?M.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},r.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime};var L,C;r.dateTime2ms=function(t,e){if(r.isJSDate(t))return t=Number(t)-t.getTimezoneOffset()*x,t>=L&&t<=C?t:m;if("string"!=typeof t&&"number"!=typeof t)return m;t=String(t);var i=n(e),a=t.charAt(0);!i||"G"!==a&&"g"!==a||(t=t.substr(1),e="");var o=i&&"chinese"===e.substr(0,7),s=t.match(o?T:k);if(!s)return m;var l=s[1],u=s[3]||"1",c=Number(s[5]||1),f=Number(s[7]||0),h=Number(s[9]||0),d=Number(s[11]||0);if(i){if(2===l.length)return m;l=Number(l);var p;try{var g=M.getComponentMethod("calendars","getCal")(e);if(o){var v="i"===u.charAt(u.length-1);u=parseInt(u,10),p=g.newDate(l,g.toMonthIndex(l,u,v),c)}else p=g.newDate(l,Number(u),c)}catch(t){return m}return p?(p.toJD()-w)*y+f*b+h*x+d*_:m}l=2===l.length?(Number(l)+2e3-E)%100+E:Number(l),u-=1;var A=new Date(Date.UTC(2e3,u,c,f,h));return A.setUTCFullYear(l),A.getUTCMonth()!==u?m:A.getUTCDate()!==c?m:A.getTime()+d*_},L=r.MIN_MS=r.dateTime2ms("-9999"),C=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==m};var S=90*y,P=3*b,R=5*x;r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=L&&t<=C))return m;e||(e=0);var i,o,s,l,u,c,f=Math.floor(10*g(t+.05,1)),h=Math.round(t-f/10);if(n(r)){var d=Math.floor(h/y)+w,p=Math.floor(g(t,y));try{i=M.getComponentMethod("calendars","getCal")(r).fromJD(d).formatDate("yyyy-mm-dd")}catch(t){i=A("G%Y-%m-%d")(new Date(h))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e=L+y&&t<=C-y))return m;var e=Math.floor(10*g(t+.05,1)),r=new Date(Math.round(t-e/10));return a(h.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,i){if(r.isJSDate(t)||"number"==typeof t){if(n(i))return p("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,i))return p("unrecognized date",t),e;return t};var I=/%\d?f/g,O=[59,59.9,59.99,59.999,59.9999],N=A("%Y"),D=A("%b %Y"),z=A("%b %-d"),j=A("%b %-d, %Y");r.formatDate=function(t,e,r,i){var a,h;if(i=n(i)&&i,e)return o(e,t,i);if(i)try{var d=Math.floor((t+.05)/y)+w,p=M.getComponentMethod("calendars","getCal")(i).fromJD(d);"y"===r?h=l(p):"m"===r?h=u(p):"d"===r?(a=l(p),h=c(p)):(a=f(p),h=s(t,r))}catch(t){return"Invalid"}else{var g=new Date(Math.floor(t+.05));"y"===r?h=N(g):"m"===r?h=D(g):"d"===r?(a=N(g),h=z(g)):(a=j(g),h=s(t,r))}return h+(a?"\n"+a:"")};var F=3*y;r.incrementMonth=function(t,e,r){r=n(r)&&r;var i=g(t,y);if(t=Math.round(t-i),r)try{var a=Math.round(t/y)+w,o=M.getComponentMethod("calendars","getCal")(r),s=o.fromJD(a);return e%12?o.add(s,e,"m"):o.add(s,e/12,"y"),(s.toJD()-w)*y+i}catch(e){p("invalid ms "+t+" in calendar "+r)}var l=new Date(t+F);return l.setUTCMonth(l.getUTCMonth()+e)+i-F},r.findExactDates=function(t,e){for(var r,i,a=0,o=0,s=0,l=0,u=n(e)&&M.getComponentMethod("calendars","getCal")(e),c=0;c1||g<0||g>1?null:{x:t+l*g,y:e+f*g}}function i(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}var a=t("./mod");r.segmentsIntersect=n,r.segmentDistance=function(t,e,r,a,o,s,l,u){if(n(t,e,r,a,o,s,l,u))return 0;var c=r-t,f=a-e,h=l-o,d=u-s,p=c*c+f*f,g=h*h+d*d,v=Math.min(i(c,f,p,o-t,s-e),i(c,f,p,l-t,u-e),i(h,d,g,t-o,e-s),i(h,d,g,r-o,a-s));return Math.sqrt(v)};var o,s,l;r.getTextLocation=function(t,e,r,n){if(t===s&&n===l||(o={},s=t,l=n),o[r])return o[r];var i=t.getPointAtLength(a(r-n/2,e)),u=t.getPointAtLength(a(r+n/2,e)),c=Math.atan((u.y-i.y)/(u.x-i.x)),f=t.getPointAtLength(a(r,e)),h=(4*f.x+i.x+u.x)/6,d=(4*f.y+i.y+u.y)/6,p={x:h,y:d,theta:c};return o[r]=p,p},r.clearLocationCache=function(){s=null},r.getVisibleSegment=function(t,e,r){function n(e){var r=t.getPointAtLength(e);0===e?i=r:e===f&&(a=r);var n=r.xs?r.x-s:0,c=r.yu?r.y-u:0;return Math.sqrt(n*n+c*c)}for(var i,a,o=e.left,s=e.right,l=e.top,u=e.bottom,c=0,f=t.getTotalLength(),h=f,d=n(c);d;){if((c+=d+r)>h)return;d=n(c)}for(d=n(h);d;){if(h-=d+r,c>h)return;d=n(h)}return{min:c,max:h,len:h-c,total:f,isClosed:0===c&&h===f&&Math.abs(i.x-a.x)<.1&&Math.abs(i.y-a.y)<.1}}},{"./mod":412}],402:[function(t,e,r){"use strict";e.exports=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t}},{}],403:[function(t,e,r){"use strict";function n(t,e){var r=t;return r[3]*=e,r}function i(t){if(s(t))return f;var e=l(t);return e.length?e:f}function a(t){return s(t)?t:h}function o(t,e,r){var o,s,c,d,p,g=t.color,v=Array.isArray(g),m=Array.isArray(e),y=[];if(o=void 0!==t.colorscale?u.makeColorScaleFunc(u.extractScale(t.colorscale,t.cmin,t.cmax)):i,s=v?function(t,e){return void 0===t[e]?f:l(o(t[e]))}:i,c=m?function(t,e){return void 0===t[e]?h:a(t[e])}:a,v||m)for(var b=0;b",e))>=0;){var r=t.indexOf("",e);if(r/g,"\n")}function a(t){return t.replace(/\<.*\>/g,"")}function o(t){for(var e=u.entityToUnicode,r=0;(r=t.indexOf("&",r))>=0;){var n=t.indexOf(";",r);if(no?s:i(t)?Number(t):s):s},l.noop=t("./noop"),l.identity=t("./identity"),l.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var i=0;ir?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},l.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},l.simpleMap=function(t,e,r,n){for(var i=t.length,a=new Array(i),o=0;o-1||c!==1/0&&c>=Math.pow(2,r)?t(e,r,n):l},l.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},l.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(r=0;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*u[n];c[r]=a}return c},l.syncOrAsync=function(t,e,r){function n(){return l.syncOrAsync(t,e,r)}for(var i,a;t.length;)if(a=t.splice(0,1)[0],(i=a(e))&&i.then)return i.then(n).then(void 0,l.promiseError);return r&&r(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,r){if(t){var n,i,a=!1,o=!0;for(n=0;n1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l};var _=/%{([^\s%{}]*)}/g,w=/^\w*$/;l.templateString=function(t,e){var r={};return t.replace(_,function(t,n){return w.test(n)?e[n]||"":(r[n]=r[n]||l.nestedProperty(e,n).get,r[n]()||"")})}},{"../constants/numerical":388,"./clean_number":393,"./coerce":394,"./dates":395,"./ensure_array":396,"./extend":398,"./filter_unique":399,"./filter_visible":400,"./geometry2d":401,"./get_graph_div":402,"./identity":405,"./is_array":407,"./is_plain_object":408,"./keyed_container":409,"./loggers":410,"./matrix":411,"./mod":412,"./nested_property":413,"./noop":414,"./notifier":415,"./push_unique":418,"./regex":420,"./relative_attr":421,"./relink_private":422,"./search":423,"./stats":426,"./throttle":429,"./to_log_range":430,d3:79,"fast-isnumeric":87}],407:[function(t,e,r){"use strict";var n="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}};e.exports=function(t){return Array.isArray(t)||n.isView(t)}},{}],408:[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}},{}],409:[function(t,e,r){"use strict";var n=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,r,a){r=r||"name",a=a||"value";var o,s,l={};s=e&&e.length?n(t,e).get():t,e=e||"",s=s||[];var u={};for(o=0;oM,T=n.barLength+2*n.barPad,E=n.barWidth+2*n.barPad,L=p,C=v+m;C+E>u&&(C=u-E);var S=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);S.exit().on(".drag",null).remove(),S.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,n.barColor),k?(this.hbar=S.attr({rx:n.barRadius,ry:n.barRadius,x:L,y:C,width:T,height:E}),this._hbarXMin=L+T/2,this._hbarTranslateMax=M-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var P=m>A,R=n.barWidth+2*n.barPad,I=n.barLength+2*n.barPad,O=p+g,N=v;O+R>l&&(O=l-R);var D=this.container.selectAll("rect.scrollbar-vertical").data(P?[0]:[]);D.exit().on(".drag",null).remove(),D.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,n.barColor),P?(this.vbar=D.attr({rx:n.barRadius,ry:n.barRadius,x:O,y:N,width:R,height:I}),this._vbarYMin=N+I/2,this._vbarTranslateMax=A-I):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var z=this.id,j=c-.5,F=P?f+R+.5:f+.5,B=h-.5,U=k?d+E+.5:d+.5,V=s._topdefs.selectAll("#"+z).data(k||P?[0]:[]);if(V.exit().remove(),V.enter().append("clipPath").attr("id",z).append("rect"),k||P?(this._clipRect=V.select("rect").attr({x:Math.floor(j),y:Math.floor(B),width:Math.ceil(F)-Math.floor(j),height:Math.ceil(U)-Math.floor(B)}),this.container.call(o.setClipUrl,z),this.bg.attr({x:p,y:v,width:g,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),k||P){var H=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(H);var q=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault(),i.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(q),P&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,r)},n.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},n.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=i.event.dx),this.vbar&&(e-=i.event.dy),this.setTranslate(t,e)},n.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=i.event.deltaY),this.vbar&&(e+=i.event.deltaY),this.setTranslate(t,e)},n.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,n=r+this._hbarTranslateMax;t=(s.constrain(i.event.x,r,n)-r)/(n-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,o=a+this._vbarTranslateMax;e=(s.constrain(i.event.y,a,o)-a)/(o-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},n.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=s.constrain(t||0,0,r),e=s.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(o.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/r;this.hbar.call(o.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var a=e/n;this.vbar.call(o.setTranslate,t,e+a*this._vbarTranslateMax)}}},{"../../lib":406,"../color":287,"../drawing":311,d3:79}],384:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},LINE_SPACING:1.3,MID_SHIFT:.35}},{}],385:[function(t,e,r){"use strict";e.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}},{}],386:[function(t,e,r){"use strict";e.exports={circle:"\u25cf","circle-open":"\u25cb",square:"\u25a0","square-open":"\u25a1",diamond:"\u25c6","diamond-open":"\u25c7",cross:"+",x:"\u274c"}},{}],387:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300,DESELECTDIM:.2}},{}],388:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,MINUS_SIGN:"\u2212"}},{}],389:[function(t,e,r){"use strict";e.exports={entityToUnicode:{mu:"\u03bc","#956":"\u03bc",amp:"&","#28":"&",lt:"<","#60":"<",gt:">","#62":">",nbsp:"\xa0","#160":"\xa0",times:"\xd7","#215":"\xd7",plusmn:"\xb1","#177":"\xb1",deg:"\xb0","#176":"\xb0"}}},{}],390:[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}},{}],391:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.31.2",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/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":280,"./components/annotations3d":285,"./components/fx":328,"./components/images":336,"./components/legend":345,"./components/rangeselector":357,"./components/rangeslider":363,"./components/shapes":370,"./components/sliders":376,"./components/updatemenus":382,"./fonts/mathjax_config":392,"./lib/queue":419,"./plot_api/plot_schema":437,"./plot_api/register":438,"./plot_api/set_plot_config":439,"./plot_api/to_image":441,"./plot_api/validate":442,"./plotly":443,"./snapshot":501,"./snapshot/download":498,"./traces/scatter":524,d3:79,"es6-promise":84}],392:[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},{}],393:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../constants/numerical").BADNUM,a=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(a,"")),n(t)?Number(t):i}},{"../constants/numerical":388,"fast-isnumeric":87}],394:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("../plots/attributes"),o=t("../components/colorscale/get_scale"),s=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),l=t("./regex").counter;r.valObjectMeta={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),-1===n.values.indexOf(t)?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;ni.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},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){if("string"==typeof t&&l(r).test(t))return void e.set(t);e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!l(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"!=typeof t)return void e.set(r);if(-1!==(n.extras||[]).indexOf(t))return void e.set(t);for(var i=t.split("+"),a=0;a0&&(o=o.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+o}return n}function l(t){return t.formatDate("yyyy")}function u(t){return t.formatDate("M yyyy")}function c(t){return t.formatDate("M d")}function f(t){return t.formatDate("M d, yyyy")}var h=t("d3"),d=t("fast-isnumeric"),p=t("./loggers").error,g=t("./mod"),v=t("../constants/numerical"),m=v.BADNUM,y=v.ONEDAY,b=v.ONEHOUR,x=v.ONEMIN,_=v.ONESEC,w=v.EPOCHJD,M=t("../registry"),A=h.time.format.utc,k=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,T=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,E=(new Date).getFullYear()-70;r.dateTick0=function(t,e){return n(t)?e?M.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:M.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},r.dfltRange=function(t){return n(t)?M.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},r.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime};var L,C;r.dateTime2ms=function(t,e){if(r.isJSDate(t))return t=Number(t)-t.getTimezoneOffset()*x,t>=L&&t<=C?t:m;if("string"!=typeof t&&"number"!=typeof t)return m;t=String(t);var i=n(e),a=t.charAt(0);!i||"G"!==a&&"g"!==a||(t=t.substr(1),e="");var o=i&&"chinese"===e.substr(0,7),s=t.match(o?T:k);if(!s)return m;var l=s[1],u=s[3]||"1",c=Number(s[5]||1),f=Number(s[7]||0),h=Number(s[9]||0),d=Number(s[11]||0);if(i){if(2===l.length)return m;l=Number(l);var p;try{var g=M.getComponentMethod("calendars","getCal")(e);if(o){var v="i"===u.charAt(u.length-1);u=parseInt(u,10),p=g.newDate(l,g.toMonthIndex(l,u,v),c)}else p=g.newDate(l,Number(u),c)}catch(t){return m}return p?(p.toJD()-w)*y+f*b+h*x+d*_:m}l=2===l.length?(Number(l)+2e3-E)%100+E:Number(l),u-=1;var A=new Date(Date.UTC(2e3,u,c,f,h));return A.setUTCFullYear(l),A.getUTCMonth()!==u?m:A.getUTCDate()!==c?m:A.getTime()+d*_},L=r.MIN_MS=r.dateTime2ms("-9999"),C=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==m};var S=90*y,P=3*b,R=5*x;r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=L&&t<=C))return m;e||(e=0);var i,o,s,l,u,c,f=Math.floor(10*g(t+.05,1)),h=Math.round(t-f/10);if(n(r)){var d=Math.floor(h/y)+w,p=Math.floor(g(t,y));try{i=M.getComponentMethod("calendars","getCal")(r).fromJD(d).formatDate("yyyy-mm-dd")}catch(t){i=A("G%Y-%m-%d")(new Date(h))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e=L+y&&t<=C-y))return m;var e=Math.floor(10*g(t+.05,1)),r=new Date(Math.round(t-e/10));return a(h.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,i){if(r.isJSDate(t)||"number"==typeof t){if(n(i))return p("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,i))return p("unrecognized date",t),e;return t};var I=/%\d?f/g,O=[59,59.9,59.99,59.999,59.9999],N=A("%Y"),D=A("%b %Y"),z=A("%b %-d"),j=A("%b %-d, %Y");r.formatDate=function(t,e,r,i){var a,h;if(i=n(i)&&i,e)return o(e,t,i);if(i)try{var d=Math.floor((t+.05)/y)+w,p=M.getComponentMethod("calendars","getCal")(i).fromJD(d);"y"===r?h=l(p):"m"===r?h=u(p):"d"===r?(a=l(p),h=c(p)):(a=f(p),h=s(t,r))}catch(t){return"Invalid"}else{var g=new Date(Math.floor(t+.05));"y"===r?h=N(g):"m"===r?h=D(g):"d"===r?(a=N(g),h=z(g)):(a=j(g),h=s(t,r))}return h+(a?"\n"+a:"")};var F=3*y;r.incrementMonth=function(t,e,r){r=n(r)&&r;var i=g(t,y);if(t=Math.round(t-i),r)try{var a=Math.round(t/y)+w,o=M.getComponentMethod("calendars","getCal")(r),s=o.fromJD(a);return e%12?o.add(s,e,"m"):o.add(s,e/12,"y"),(s.toJD()-w)*y+i}catch(e){p("invalid ms "+t+" in calendar "+r)}var l=new Date(t+F);return l.setUTCMonth(l.getUTCMonth()+e)+i-F},r.findExactDates=function(t,e){for(var r,i,a=0,o=0,s=0,l=0,u=n(e)&&M.getComponentMethod("calendars","getCal")(e),c=0;c1||g<0||g>1?null:{x:t+l*g,y:e+f*g}}function i(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}var a=t("./mod");r.segmentsIntersect=n,r.segmentDistance=function(t,e,r,a,o,s,l,u){if(n(t,e,r,a,o,s,l,u))return 0;var c=r-t,f=a-e,h=l-o,d=u-s,p=c*c+f*f,g=h*h+d*d,v=Math.min(i(c,f,p,o-t,s-e),i(c,f,p,l-t,u-e),i(h,d,g,t-o,e-s),i(h,d,g,r-o,a-s));return Math.sqrt(v)};var o,s,l;r.getTextLocation=function(t,e,r,n){if(t===s&&n===l||(o={},s=t,l=n),o[r])return o[r];var i=t.getPointAtLength(a(r-n/2,e)),u=t.getPointAtLength(a(r+n/2,e)),c=Math.atan((u.y-i.y)/(u.x-i.x)),f=t.getPointAtLength(a(r,e)),h=(4*f.x+i.x+u.x)/6,d=(4*f.y+i.y+u.y)/6,p={x:h,y:d,theta:c};return o[r]=p,p},r.clearLocationCache=function(){s=null},r.getVisibleSegment=function(t,e,r){function n(e){var r=t.getPointAtLength(e);0===e?i=r:e===f&&(a=r);var n=r.xs?r.x-s:0,c=r.yu?r.y-u:0;return Math.sqrt(n*n+c*c)}for(var i,a,o=e.left,s=e.right,l=e.top,u=e.bottom,c=0,f=t.getTotalLength(),h=f,d=n(c);d;){if((c+=d+r)>h)return;d=n(c)}for(d=n(h);d;){if(h-=d+r,c>h)return;d=n(h)}return{min:c,max:h,len:h-c,total:f,isClosed:0===c&&h===f&&Math.abs(i.x-a.x)<.1&&Math.abs(i.y-a.y)<.1}}},{"./mod":412}],402:[function(t,e,r){"use strict";e.exports=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t}},{}],403:[function(t,e,r){"use strict";function n(t,e){var r=t;return r[3]*=e,r}function i(t){if(s(t))return f;var e=l(t);return e.length?e:f}function a(t){return s(t)?t:h}function o(t,e,r){var o,s,c,d,p,g=t.color,v=Array.isArray(g),m=Array.isArray(e),y=[];if(o=void 0!==t.colorscale?u.makeColorScaleFunc(u.extractScale(t.colorscale,t.cmin,t.cmax)):i,s=v?function(t,e){return void 0===t[e]?f:l(o(t[e]))}:i,c=m?function(t,e){return void 0===t[e]?h:a(t[e])}:a,v||m)for(var b=0;b",e))>=0;){var r=t.indexOf("",e);if(r/g,"\n")}function a(t){return t.replace(/\<.*\>/g,"")}function o(t){for(var e=u.entityToUnicode,r=0;(r=t.indexOf("&",r))>=0;){var n=t.indexOf(";",r);if(no?s:i(t)?Number(t):s):s},l.noop=t("./noop"),l.identity=t("./identity"),l.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var i=0;ir?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},l.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},l.simpleMap=function(t,e,r,n){for(var i=t.length,a=new Array(i),o=0;o-1||c!==1/0&&c>=Math.pow(2,r)?t(e,r,n):l},l.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},l.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(r=0;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*u[n];c[r]=a}return c},l.syncOrAsync=function(t,e,r){function n(){return l.syncOrAsync(t,e,r)}for(var i,a;t.length;)if(a=t.splice(0,1)[0],(i=a(e))&&i.then)return i.then(n).then(void 0,l.promiseError);return r&&r(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,r){if(t){var n,i,a=!1,o=!0;for(n=0;n1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l};var _=/%{([^\s%{}]*)}/g,w=/^\w*$/;l.templateString=function(t,e){var r={};return t.replace(_,function(t,n){return w.test(n)?e[n]||"":(r[n]=r[n]||l.nestedProperty(e,n).get,r[n]()||"")})}},{"../constants/numerical":388,"./clean_number":393,"./coerce":394,"./dates":395,"./ensure_array":396,"./extend":398,"./filter_unique":399,"./filter_visible":400,"./geometry2d":401,"./get_graph_div":402,"./identity":405,"./is_array":407,"./is_plain_object":408,"./keyed_container":409,"./loggers":410,"./matrix":411,"./mod":412,"./nested_property":413,"./noop":414,"./notifier":415,"./push_unique":418,"./regex":420,"./relative_attr":421,"./relink_private":422,"./search":423,"./stats":426,"./throttle":429,"./to_log_range":430,d3:79,"fast-isnumeric":87}],407:[function(t,e,r){"use strict";var n="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}};e.exports=function(t){return Array.isArray(t)||n.isView(t)}},{}],408:[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}},{}],409:[function(t,e,r){"use strict";var n=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,r,a){r=r||"name",a=a||"value";var o,s,l={};s=e&&e.length?n(t,e).get():t,e=e||"",s=s||[];var u={};for(o=0;o2)return l[e]=2|l[e],f.set(t,null);if(c){for(o=e;o1){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][0],a=t[e][1],l=!1,d(n))for(r=n.length-1;r>=0;r--)i(n[r],o(a,r))?l?n[r]=void 0:n.pop():l=!0;else if("object"==typeof n&&null!==n)for(s=Object.keys(n),l=!1,r=s.length-1;r>=0;r--)i(n[s[r]],o(a,s[r]))?delete n[s[r]]:l=!0;if(l)return}}function c(t){return void 0===t||null===t||"object"==typeof t&&(d(t)?!t.length:!Object.keys(t).length)}function f(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}var h=t("fast-isnumeric"),d=t("./is_array"),p=t("./is_plain_object"),g=t("../plot_api/container_array_match");e.exports=function(t,e){if(h(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,i,o,s=0,l=e.split(".");s/g),s=0;so||n===i||nl)&&(!e||!c(t))}function r(t,e){var r=t[0],u=t[1];if(r===i||ro||u===i||ul)return!1;var c,f,h,d,p,g=n.length,v=n[0][0],m=n[0][1],y=0;for(c=1;cMath.max(f,v)||u>Math.max(h,m)))if(uc||Math.abs(n(o,h))>i)return!0;return!1};a.filter=function(t,e){function r(r){t.push(r);var s=n.length,l=i;n.splice(a+1);for(var u=l+1;u1){r(t.pop())}return{addPt:r,raw:t,filtered:n}}},{"../constants/numerical":388,"./matrix":411}],418:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){var r,n=e.toString();for(r=0;ra.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--)},o.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},o.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},o.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 o(t,e){return t>=e}var s=t("fast-isnumeric"),l=t("./loggers");r.findBin=function(t,e,r){if(s(e.start))return r?Math.ceil((t-e.start)/e.size)-1:Math.floor((t-e.start)/e.size);var u,c,f=0,h=e.length,d=0;for(c=e[e.length-1]>=e[0]?r?n:i:r?o:a;f90&&l.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,i=e[n]-e[0]||1,a=i/(n||1)/1e4,o=[e[0]],s=0;se[s]+a&&(i=Math.min(i,e[s+1]-e[s]),o.push(e[s+1]));return{vals:o,minDiff:i}},r.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;it.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":87}],427:[function(t,e,r){"use strict";function n(t){var e=i(t);return e.length?e:[0,0,0,1]}var i=t("color-rgba");e.exports=n},{"color-rgba":62}],428:[function(t,e,r){"use strict";function n(t,e){return t.node().getBoundingClientRect()[e]}function i(t){return t.replace(m,"\\lt ").replace(y,"\\gt ")}function a(t,e,r){var n="math-output-"+h.randstr([],64),a=f.select("body").append("div").attr({id:n}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(i(t));MathJax.Hub.Queue(["Typeset",MathJax.Hub,a.node()],function(){var e=f.select("body").select("#MathJax_SVG_glyphs");if(a.select(".MathJax_SVG").empty()||!a.select("svg").node())h.log("There was an error in the tex syntax.",t),r();else{var n=a.select("svg").node().getBoundingClientRect();r(a.select(".MathJax_SVG"),e,n)}a.remove()})}function o(t,e){if(!t)return null;var r=t.match(e);return r&&(r[3]||r[4])}function s(t,e){if(!t)return"";for(var r=0;r1)for(var i=1;i.",e);var r=u.pop();t!==r.type&&h.log("Start tag <"+r.type+"> doesnt match end tag <"+t+">. Pretending it did match.",e),a=u[u.length-1].node}(A);else{var N=y[4],D={type:A},z=o(N,S);if(z?(z=z.replace(O,"$1 fill:"),k&&(z+=";"+k)):k&&(z=k),z&&(D.style=z),"a"===A){s=!0;var j=o(N,P);if(j){var F=document.createElement("a");F.href=j,-1!==M.indexOf(F.protocol)&&(D.href=encodeURI(j),D.target=o(N,R)||"_blank",D.popup=o(N,I))}}n(D)}}return s}function c(t,e,r){var n,i,a,o=r.horizontalAlign,s=r.verticalAlign||"top",l=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return i="bottom"===s?function(){return l.bottom-n.height}:"middle"===s?function(){return l.top+(l.height-n.height)/2}:function(){return l.top},a="right"===o?function(){return l.right-n.width}:"center"===o?function(){return l.left+(l.width-n.width)/2}:function(){return l.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:i()-u.top+"px",left:a()-u.left+"px","z-index":1e3}),this}}var f=t("d3"),h=t("../lib"),d=t("../constants/xmlns_namespaces"),p=t("../constants/string_mappings"),g=t("../constants/alignment").LINE_SPACING,v=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,i){function o(){c.empty()||(h=t.attr("class")+"-math",c.select("svg."+h).remove()),t.text("").style("white-space","pre"),u(t.node(),s)&&t.style("pointer-events","all"),r.positionText(t),i&&i.call(t)}var s=t.text(),l=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&s.match(v),c=f.select(t.node().parentNode);if(!c.empty()){var h=t.attr("class")?t.attr("class").split(" ")[0]:"text";return h+="-math",c.selectAll("svg."+h).remove(),c.selectAll("g."+h+"-group").remove(),t.style("display",null).attr({"data-unformatted":s,"data-math":"N"}),l?(e&&e._promises||[]).push(new Promise(function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10);a(l[2],{fontSize:r},function(a,l,u){c.selectAll("svg."+h).remove(),c.selectAll("g."+h+"-group").remove();var f=a&&a.select("svg");if(!f||!f.node())return o(),void e();var d=c.append("g").classed(h+"-group",!0).attr({"pointer-events":"none","data-unformatted":s,"data-math":"Y"});d.node().appendChild(f.node()),l&&l.node()&&f.node().insertBefore(l.node().cloneNode(!0),f.node().firstChild),f.attr({class:h,height:u.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var p=t.node().style.fill||"black";f.select("g").attr({fill:p,stroke:p});var g=n(f,"width"),v=n(f,"height"),m=+t.attr("x")-g*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],y=r||n(t,"height"),b=-y/4;"y"===h[0]?(d.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-g/2,b-v/2]+")"}),f.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===h[0]?f.attr({x:t.attr("x"),y:b-v/2}):"a"===h[0]?f.attr({x:0,y:b}):f.attr({x:m,y:+t.attr("y")+b-v/2}),i&&i.call(t,d),e(d)})})):o(),t}};var m=/(<|<|<)/g,y=/(>|>|>)/g,b={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},x={sub:"0.3em",sup:"-0.6em"},_={sub:"-0.21em",sup:"0.42em"},w="\u200b",M=["http:","https:","mailto:","",void 0,":"],A=new RegExp("]*)?/?>","g"),k=Object.keys(p.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:p.entityToUnicode[t]}}),T=/(\r\n?|\n)/g,E=/(<[^<>]*>)/,L=/<(\/?)([^ >]*)(\s+(.*))?>/i,C=//i,S=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,P=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,R=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,I=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i,O=/(^|;)\s*color:/;r.plainText=function(t){return(t||"").replace(A," ")},r.lineCount=function(t){return t.selectAll("tspan.line").size()||1},r.positionText=function(t,e,r){return t.each(function(){function t(t,e){return void 0===e?null===(e=n.attr(t))&&(n.attr(t,0),e=0):n.attr(t,e),e}var n=f.select(this),i=t("x",e),a=t("y",r);"text"===this.nodeName&&n.selectAll("tspan.line").attr({x:i,y:a})})},r.makeEditable=function(t,e){function r(){i(),t.style({opacity:0});var e,r=l.attr("class");(e=r?"."+r.split(" ")[0]+"-math-group":"[class*=-math-group]")&&f.select(t.node().parentNode).select(e).style({opacity:0})}function n(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}function i(){var r=f.select(a),i=r.select(".svg-container"),o=i.append("div"),l=t.node().style,u=parseFloat(l.fontSize||12);o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":l.fontFamily||"Arial","font-size":u,color:e.fill||l.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-u/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(e.text||t.attr("data-unformatted")).call(c(t,i,e)).on("blur",function(){a._editing=!1,t.text(this.textContent).style({opacity:1});var e,r=f.select(this).attr("class");(e=r?"."+r.split(" ")[0]+"-math-group":"[class*=-math-group]")&&f.select(t.node().parentNode).select(e).style({opacity:0});var n=this.textContent;f.select(this).transition().duration(0).remove(),f.select(document).on("mouseup",null),s.edit.call(t,n)}).on("focus",function(){var t=this;a._editing=!0,f.select(document).on("mouseup",function(){if(f.event.target===t)return!1;document.activeElement===o.node()&&o.node().blur()})}).on("keyup",function(){27===f.event.which?(a._editing=!1,t.style({opacity:1}),f.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),s.cancel.call(t,this.textContent)):(s.input.call(t,this.textContent),f.select(this).call(c(t,i,e)))}).on("keydown",function(){13===f.event.which&&this.blur()}).call(n)}var a=e.gd,o=e.delegate,s=f.dispatch("edit","input","cancel"),l=o||t;if(t.style({"pointer-events":o?"none":"all"}),1!==t.size())throw new Error("boo");return e.immediate?r():l.on("click",r),f.rebind(t,s,"on")}},{"../constants/alignment":384,"../constants/string_mappings":389,"../constants/xmlns_namespaces":390,"../lib":406,d3:79}],429:[function(t,e,r){"use strict";function n(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}var i={};r.throttle=function(t,e,r){function a(){r(),o.ts=Date.now(),o.onDone&&(o.onDone(),o.onDone=null)}var o=i[t],s=Date.now();if(!o){for(var l in i)i[l].tso.ts+e)return void a();o.timer=setTimeout(function(){a(),o.timer=null},e)},r.done=function(t){var e=i[t];return e&&e.timer?new Promise(function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}}):Promise.resolve()},r.clear=function(t){if(t)n(i[t]),delete i[t];else for(var e in i)r.clear(e)}},{}],430:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},{"fast-isnumeric":87}],431:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,i=n.layoutArrayContainers,a=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0)return t.substr(0,e)}var s=t("fast-isnumeric"),l=t("gl-mat4/fromQuat"),u=t("../registry"),c=t("../lib"),f=t("../plots/plots"),h=t("../plots/cartesian/axes"),d=t("../components/color");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 i=h.list({_fullLayout:t});for(e=0;e3?(v.x=1.02,v.xanchor="left"):v.x<-2&&(v.x=-.02,v.xanchor="right"),v.y>3?(v.y=1.02,v.yanchor="bottom"):v.y<-2&&(v.y=-.02,v.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var m=f.getSubplotIds(t,"gl3d");for(e=0;e1&&o.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(c(y))e.set(null);else{if(!Array.isArray(y))return o.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!g&&(h(v,m),d(t),!0)} var b,x,_,w,M,A,k,T=Object.keys(r).map(Number).sort(s),E=e.get(),L=E||[],C=n(m,f).get(),S=[],P=-1,R=L.length;for(b=0;bL.length-(k?0:1))o.warn("index out of range",f,_);else if(void 0!==A)M.length>1&&o.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(A)?S.push(_):k?("add"===A&&(A={}),L.splice(_,0,A),C&&C.splice(_,0,{})):o.warn("Unrecognized full object edit value",f,_,A),-1===P&&(P=_);else for(x=0;x=0;b--)L.splice(S[b],1),C&&C.splice(S[b],1);if(L.length?E||e.set(L):e.set(null),g)return!1;if(h(v,m),p!==a){var I;if(-1===P)I=T;else{for(R=Math.max(L.length,R),I=[],b=0;b=P);b++)I.push(_);for(b=P;b=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function u(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),l(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&l(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function c(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&lX.range[0]?[1,2]:[2,1]);else{var Z=X.range[0],Q=X.range[1];W?(Z<=0&&Q<=0&&r(O+".autorange",!0),Z<=0?Z=Q/1e6:Q<=0&&(Q=Z/1e6),r(O+".range[0]",Math.log(Z)/Math.LN10),r(O+".range[1]",Math.log(Q)/Math.LN10)):(r(O+".range[0]",Math.pow(10,Z)),r(O+".range[1]",Math.pow(10,Q)))}else r(O+".autorange",!0);k.getComponentMethod("annotations","convertCoords")(t,B,C,r),k.getComponentMethod("images","convertCoords")(t,B,C,r)}else r(O+".autorange",!0),r(O+".range",null);w.nestedProperty(u,O+"._inputRange").set(null)}else if(R.match(F.AX_NAME_PATTERN)){var $=w.nestedProperty(u,A).get(),K=(C||{}).type;K&&"-"!==K||(K="linear"),k.getComponentMethod("annotations","convertCoords")(t,$,K,r),k.getComponentMethod("images","convertCoords")(t,$,K,r)}var J=N.containerArrayMatch(A);if(J){a=J.array,o=J.index;var tt=J.property,et=w.nestedProperty(l,a),rt=(et||[])[o]||{},nt=rt,it=V||{editType:"calc"},at=-1!==it.editType.indexOf("calcIfAutorange");""===o?(at?y.calc=!0:j.update(y,it),at=!1):""===tt&&(nt=C,N.isAddVal(C)?x[A]=null:N.isRemoveVal(C)?(x[A]=rt,nt=rt):w.warn("unrecognized full object value",e)),at&&(n(nt,"x")||n(nt,"y"))?y.calc=!0:j.update(y,it),h[a]||(h[a]={});var ot=h[a][o];ot||(ot=h[a][o]={}),ot[tt]=C,delete e[A]}else"reverse"===R?(z.range?z.range.reverse():(r(O+".autorange",!0),z.range=[1,0]),B.autorange?y.calc=!0:y.plot=!0):((!u._has("gl2d")||"dragmode"!==A||"lasso"!==C&&"select"!==C||"lasso"===U||"select"===U)&&V?j.update(y,V):y.calc=!0,L.set(C))}}for(a in h){N.applyContainerArrayChanges(t,w.nestedProperty(l,a),h[a],y)||(y.plot=!0)}var st=u._axisConstraintGroups;for(m in M)for(o=0;o=s.length?s[0]:s[t]:s}function i(t){return Array.isArray(l)?t>=l.length?l[0]:l[t]:l}function a(t,e){var r=0;return function(){if(t&&++r===e)return t()}}if(t=w.getGraphDiv(t),!w.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 o=t._transitionData;o._frameQueue||(o._frameQueue=[]),r=E.supplyAnimationDefaults(r);var s=r.transition,l=r.frame;return void 0===o._frameWaitingCnt&&(o._frameWaitingCnt=0),new Promise(function(l,u){function c(){t.emit("plotly_animated"),window.cancelAnimationFrame(o._animationRaf),o._animationRaf=null}function f(){o._currentFrame&&o._currentFrame.onComplete&&o._currentFrame.onComplete();var e=o._currentFrame=o._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,o._lastFrameAt=Date.now(),o._timeToNext=e.frameOpts.duration,E.transition(t,e.frame.data,e.frame.layout,D.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then(function(){e.onComplete&&e.onComplete()}),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else c()}function h(){t.emit("plotly_animating"),o._lastFrameAt=-1/0,o._timeToNext=0,o._runningTransitions=0,o._currentFrame=null;var e=function(){o._animationRaf=window.requestAnimationFrame(e),Date.now()-o._lastFrameAt>o._timeToNext&&f()};e()}function d(t){return Array.isArray(s)?v>=s.length?t.transitionOpts=s[v]:t.transitionOpts=s[0]:t.transitionOpts=s,v++,t}var p,g,v=0,m=[],y=void 0===e||null===e,b=Array.isArray(e);if(y||b||!w.isPlainObject(e)){if(y||-1!==["string","number"].indexOf(typeof e))for(p=0;p0&&MM)&&A.push(g);m=A}}m.length>0?function(e){if(0!==e.length){for(var s=0;s=0;i--)if(w.isPlainObject(e[i])){var h=(u[e[i].name]||{}).name,d=e[i].name;h&&d&&"number"==typeof d&&u[h]&&(n++,w.warn('addFrames: overwriting frame "'+u[h].name+'" with a frame whose name of type "number" also equates to "'+h+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),n>5&&w.warn("addFrames: This API call has yielded too many warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),f.push({frame:E.supplyFrameDefaults(e[i]),index:r&&void 0!==r[i]&&null!==r[i]?r[i]:c+i})}f.sort(function(t,e){return t.index>e.index?-1:t.index=0;i--){if(a=f[i].frame,"number"==typeof a.name&&w.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+t._transitionData._counter++];);if(u[a.name]){for(o=0;o=0;r--)n=e[r],a.push({type:"delete",index:n}),o.unshift({type:"insert",index:n,value:i[n]});var s=E.modifyFrames,l=E.modifyFrames,u=[t,o],c=[t,a];return A&&A.add(t,s,u,l,c),E.modifyFrames(t,a)},_.purge=function(t){t=w.getGraphDiv(t);var e=t._fullLayout||{},r=t._fullData||[];return E.cleanPlot([],{},r,e),E.purge(t),M.purge(t),e._container&&e._container.remove(),delete t._context,t}},{"../components/color":287,"../components/drawing":311,"../components/errorbars":317,"../constants/xmlns_namespaces":390,"../lib":406,"../lib/events":397,"../lib/queue":419,"../lib/svg_text_utils":428,"../plotly":443,"../plots/cartesian/axis_ids":451,"../plots/cartesian/constants":453,"../plots/cartesian/constraints":455,"../plots/cartesian/graph_interact":457,"../plots/plots":488,"../plots/polar":491,"../registry":496,"./edit_types":432,"./helpers":433,"./manage_arrays":434,"./plot_schema":437,"./subroutines":440,d3:79,"fast-isnumeric":87,"has-hover":171}],436:[function(t,e,r){"use strict";e.exports={staticPlot:!1,editable:!1,edits:{annotationPosition:!1,annotationTail:!1,annotationText:!1,axisTitleText:!1,colorbarPosition:!1,colorbarTitleText:!1,legendPosition:!1,legendText:!1,shapePosition:!1,titleText:!1},autosizable:!1,queueLength:0,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showAxisDragHandles:!0,showAxisRangeEntryBoxes:!0,showLink:!1,sendData:!0, linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:"transparent",topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:!1,globalTransforms:[]}},{}],437:[function(t,e,r){"use strict";function n(t,e){var r,n,i,a,o=t._basePlotModules;if(o){var s;for(r=0;r=t.items.length)return!1;t=t.items[i]}}return t}function a(t){return t===Math.round(t)&&t>=0}function o(t){var e,r;"area"===t?(e={attributes:w},r={}):(e=v.modules[t]._module,r=e.basePlotModule);var n={};n.type=null,T(n,y),T(n,e.attributes),r.attributes&&T(n,r.attributes),n.type=t;var i={meta:e.meta||{},attributes:c(n)};if(e.layoutAttributes){var a={};T(a,e.layoutAttributes),i.layoutAttributes=c(a)}return i}function s(){var t,e,r={};T(r,b);for(t in v.subplotsRegistry)if(e=v.subplotsRegistry[t],e.layoutAttributes)if("cartesian"===e.name)p(r,e,"xaxis"),p(r,e,"yaxis");else{var n="subplot"===e.attr?e.name:e.attr;p(r,e,n)}r=d(r);for(t in v.componentsRegistry){e=v.componentsRegistry[t];var i=e.schema;if(i&&(i.subplots||i.layout)){var a=i.subplots;if(a&&a.xaxis&&!a.yaxis)for(var o in a.xaxis)delete r.yaxis[o]}else e.layoutAttributes&&g(r,e.layoutAttributes,e.name)}return{layoutAttributes:c(r)}}function l(t){var e=v.transformsRegistry[t],r=T({},e.attributes);return Object.keys(v.componentsRegistry).forEach(function(e){var n=v.componentsRegistry[e];n.schema&&n.schema.transforms&&n.schema.transforms[t]&&Object.keys(n.schema.transforms[t]).forEach(function(e){g(r,n.schema.transforms[t][e],e)})}),{attributes:c(r)}}function u(){var t={frames:m.extendDeepAll({},x)};return c(t),t.frames}function c(t){return f(t),h(t),t}function f(t){function e(t){return{valType:"string",editType:"none"}}function n(t,n,i){r.isValObject(t)?"data_array"===t.valType?(t.role="data",i[n+"src"]=e(n)):!0===t.arrayOk&&(i[n+"src"]=e(n)):m.isPlainObject(t)&&(t.role="object")}r.crawl(t,n)}function h(t){function e(t,e,r){if(t){var n=t[L];n&&(delete t[L],r[e]={items:{}},r[e].items[n]=t,r[e].role="object")}}r.crawl(t,e)}function d(t){return k(t,{radialaxis:M.radialaxis,angularaxis:M.angularaxis}),k(t,M.layout),t}function p(t,e,r){var n=m.nestedProperty(t,r),i=T({},e.layoutAttributes);i[E]=!0,n.set(i)}function g(t,e,r){var n=m.nestedProperty(t,r);n.set(T(n.get()||{},e))}var v=t("../registry"),m=t("../lib"),y=t("../plots/attributes"),b=t("../plots/layout_attributes"),x=t("../plots/frame_attributes"),_=t("../plots/animation_attributes"),w=t("../plots/polar/area_attributes"),M=t("../plots/polar/axis_attributes"),A=t("./edit_types"),k=m.extendFlat,T=m.extendDeepAll,E="_isSubplotObj",L="_isLinkedToArray",C=[E,L,"_arrayAttrRegexps","_deprecated"];r.IS_SUBPLOT_OBJ=E,r.IS_LINKED_TO_ARRAY=L,r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=C,r.get=function(){var t={};v.allTypes.concat("area").forEach(function(e){t[e]=o(e)});var e={};return Object.keys(v.transformsRegistry).forEach(function(t){e[t]=l(t)}),{defs:{valObjects:m.valObjectMeta,metaKeys:C.concat(["description","role","editType","impliedEdits"]),editType:{traces:A.traces,layout:A.layout},impliedEdits:{}},traces:t,layout:s(),transforms:e,frames:u(),animation:c(_)}},r.crawl=function(t,e,n,i){var a=n||0;i=i||"",Object.keys(t).forEach(function(n){var o=t[n];if(-1===C.indexOf(n)){var s=(i?i+".":"")+n;e(o,n,t,a,s),r.isValObject(o)||m.isPlainObject(o)&&"impliedEdits"!==n&&r.crawl(o,e,a+1,s)}})},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){function e(e,r,o,s){if(a=a.slice(0,s).concat([r]),e&&("data_array"===e.valType||!0===e.arrayOk)&&!("colorbar"===a[s-1]&&("ticktext"===r||"tickvals"===r))){var l=n(a),u=m.nestedProperty(t,l).get();Array.isArray(u)&&i.push(l)}}function n(t){return t.join(".")}var i=[],a=[];if(r.crawl(y,e),t._module&&t._module.attributes&&r.crawl(t._module.attributes,e),t.transforms)for(var o=t.transforms,s=0;s=t.transforms.length)return!1;r=(v.transformsRegistry[t.transforms[l].type]||{}).attributes,n=r&&r[e[2]],s=3}else if("area"===t.type)n=w[o];else{var u=t._module;if(u||(u=(v.modules[t.type||y.type.dflt]||{})._module),!u)return!1;if(r=u.attributes,!(n=r&&r[o])){var c=u.basePlotModule;c&&c.attributes&&(n=c.attributes[o])}n||(n=y[o])}return i(n,e,s)},r.getLayoutValObject=function(t,e){return i(n(t,e[0]),e,1)}},{"../lib":406,"../plots/animation_attributes":444,"../plots/attributes":446,"../plots/frame_attributes":473,"../plots/layout_attributes":486,"../plots/polar/area_attributes":489,"../plots/polar/axis_attributes":490,"../registry":496,"./edit_types":432}],438:[function(t,e,r){"use strict";function n(t){o.register(t,t.name,t.categories,t.meta),o.subplotsRegistry[t.basePlotModule.name]||o.registerSubplot(t.basePlotModule)}function i(t){if("string"!=typeof t.name)throw new Error("Transform module *name* must be a string.");var e="Transform module "+t.name,r="function"==typeof t.transform,n="function"==typeof t.calcTransform;if(!r&&!n)throw new Error(e+" is missing a *transform* or *calcTransform* method.");r&&n&&s.log([e+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),s.isPlainObject(t.attributes)||s.log(e+" registered without an *attributes* object."),"function"!=typeof t.supplyDefaults&&s.log(e+" registered without a *supplyDefaults* method."),o.registerTransform(t)}function a(t){if("string"!=typeof t.name)throw new Error("Component module *name* must be a string.");o.registerComponent(t)}var o=t("../registry"),s=t("../lib");e.exports=function(t){if(!t)throw new Error("No argument passed to Plotly.register.");t&&!Array.isArray(t)&&(t=[t]);for(var e=0;e=t[1]||i[1]<=t[0])&&(a[0]e[0]))return!0}return!1}function i(t,e,r){return t._anchorAxis===e&&(t.mirror||t.side===r)||"all"===t.mirror||"allticks"===t.mirror||t.mirrors&&t.mirrors[e._id+r]}function a(t,e,r){var n=[],i=e._anchorAxis;if(i){var a=i._mainAxis;if(-1===n.indexOf(a)){n.push(a);for(var o=0;o1&&l.push(o("object","layout"))),h.supplyDefaults(u);for(var c=u._fullData,v=r.length,m=0;m.3*f||a(n)||a(i))){var h=r.dtick/2;t+=t+h.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=B.tickIncrement(t,"M6","reverse")+1.5*O:a.exactMonths>.8?t=B.tickIncrement(t,"M1","reverse")+15.5*O:t-=O/2;var s=B.tickIncrement(t,r);if(s<=n)return s}return t}function s(t){var e,r,n=t.tickvals,i=t.ticktext,a=new Array(n.length),o=k.simpleMap(t.range,t.r2l),s=1.0001*o[0]-1e-4*o[1],l=1.0001*o[1]-1e-4*o[0],u=Math.min(s,l),f=Math.max(s,l),h=0;Array.isArray(i)||(i=[]);var d="category"===t.type?t.d2l_noadd:t.d2l;for("log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1)),r=0;ru&&e10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=O&&i<=10||e>=15*O)t._tickround="d";else if(e>=D&&i<=16||e>=N)t._tickround="M";else if(e>=z&&i<=19||e>=D)t._tickround="S";else{var a=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,a)-20}}else if(M(e)||"L"===e.charAt(0)){var o=t.range.map(t.r2d||Number);M(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var s=Math.max(Math.abs(o[0]),Math.abs(o[1])),l=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(l)>3&&(g(t.exponentformat)&&!v(l)?t._tickexponent=3*Math.round((l-1)/3):t._tickexponent=l)}else t._tickround=null}function c(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}function f(t,e,r,n){var i=t._tickround,a=r&&t.hoverformat||t.tickformat;n&&(i=M(i)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[i]);var o,s=k.formatDate(e.x,a,i,t.calendar),l=s.indexOf("\n");-1!==l&&(o=s.substr(l+1),s=s.substr(0,l)),n&&("00:00:00"===s||"00:00"===s?(s=o,o=""):8===s.length&&(s=s.replace(/:00$/,""))),o&&(r?"d"===i?s+=", "+o:s=o+(s?", "+s:""):t._inCalcTicks&&o===t._prevDateHead||(s+="
"+o,t._prevDateHead=o)),e.text=s}function h(t,e,r,n,i){var a=t.dtick,o=e.x;if("never"===i&&(i=""),!n||"string"==typeof a&&"L"===a.charAt(0)||(a="L3"),t.tickformat||"string"==typeof a&&"L"===a.charAt(0))e.text=m(Math.pow(10,o),t,i,n);else if(M(a)||"D"===a.charAt(0)&&k.mod(o+.01,1)<.1){var s=Math.round(o);-1!==["e","E","power"].indexOf(t.exponentformat)||g(t.exponentformat)&&v(s)?(e.text=0===s?1:1===s?"10":s>1?"10"+s+"":"10"+j+-s+"",e.fontSize*=1.25):(e.text=m(Math.pow(10,o),t,"","fakehover"),"D1"===a&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==a.charAt(0))throw"unrecognized dtick "+String(a);e.text=String(Math.round(Math.pow(10,k.mod(o,1)))),e.fontSize*=.75}if("D1"===t.dtick){var l=String(e.text).charAt(0);"0"!==l&&"1"!==l||("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*(o<0?.5:.25)))}}function d(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}function p(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=m(e.x,t,i,n)}function g(t){return"SI"===t||"B"===t}function v(t){return t>14||t<-15}function m(t,e,r,n){var i=t<0,a=e._tickround,o=r||e.exponentformat||"B",s=e._tickexponent,l=e.tickformat,c=e.separatethousands;if(n){var f={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:M(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};u(f),a=(Number(f._tickround)||0)+4,s=f._tickexponent,e.hoverformat&&(l=e.hoverformat)}if(l)return w.format(l)(t).replace(/-/g,j);var h=Math.pow(10,-a)/2;if("none"===o&&(s=0),(t=Math.abs(t))"+m+"":"B"===o&&9===s?t+="B":g(o)&&(t+=Q[s/3+5])}return i?j+t:t}function y(t,e){var r,n,i=[];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},B.getAutoRange=function(t){var e,r=[],n=t._min[0].val,i=t._max[0].val;for(e=1;e0&&c>0&&f/c>h&&(l=o,u=s,h=f/c);if(n===i){var g=n-1,v=n+1;r="tozero"===t.rangemode?n<0?[g,0]:[0,v]:"nonnegative"===t.rangemode?[Math.max(0,g),Math.max(0,v)]:[g,v]}else h&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(l.val>=0&&(l={val:0,pad:0}),u.val<=0&&(u={val:0,pad:0})):"nonnegative"===t.rangemode&&(l.val-h*l.pad<0&&(l={val:0,pad:0}),u.val<0&&(u={val:1,pad:0})),h=(u.val-l.val)/(t._length-l.pad-u.pad)),r=[l.val-h*l.pad,u.val+h*u.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])))),d&&r.reverse(),k.simpleMap(r,t.l2r||Number)},B.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=B.getAutoRange(t),t._r=t.range.slice(),t._rl=k.simpleMap(t._r,t.r2l);var r=t._input;r.range=t.range.slice(),r.autorange=t.autorange}},B.saveRangeInitial=function(t,e){for(var r=B.list(t,"",!0),n=!1,i=0;i=h?d=!1:s.val>=u&&s.pad<=h&&(t._min.splice(o,1),o--);d&&t._min.push({val:u,pad:y&&0===u?0:h})}if(n(c)){for(d=!0,o=0;o=c&&s.pad>=f?d=!1:s.val<=c&&s.pad<=f&&(t._max.splice(o,1),o--);d&&t._max.push({val:c,pad:y&&0===c?0:f})}}}if((t.autorange||!!k.nestedProperty(t,"rangeslider.autorange").get())&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var a,o,s,l,u,c,f,h,d,p,g,v=e.length,m=r.padded?.05*t._length:0,y=r.tozero&&("linear"===t.type||"-"===t.type);m&&"domain"===t.constrain&&t._inputDomain&&(m*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0]));var b=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),x=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),_=n(r.vpadplus||r.vpad),w=n(r.vpadminus||r.vpad);for(a=0;a<6;a++)i(a);for(a=v-1;a>5;a--)i(a)}},B.autoBin=function(t,e,r,n,i){var s=k.aggNums(Math.min,null,t),l=k.aggNums(Math.max,null,t);if(i||(i=e.calendar),"category"===e.type)return{start:s-.5,end:l+.5,size:1,_count:l-s+1};var u;if(r)u=(l-s)/r;else{var c=k.distinctVals(t),f=Math.pow(10,Math.floor(Math.log(c.minDiff)/Math.LN10)),h=f*k.roundUp(c.minDiff/f,[.9,1.9,4.9,9.9],!0);u=Math.max(h,2*k.stdev(t)/Math.pow(t.length,n?.25:.4)),M(u)||(u=1)}var d;d="log"===e.type?{type:"linear",range:[s,l]}:{type:e.type,range:k.simpleMap([s,l],e.c2r,0,i),calendar:i},B.setConvert(d),B.autoTicks(d,u);var p,g,v=B.tickIncrement(B.tickFirst(d),d.dtick,"reverse",i);if("number"==typeof d.dtick)v=a(v,t,d,s,l),g=1+Math.floor((l-v)/d.dtick),p=v+g*d.dtick;else for("M"===d.dtick.charAt(0)&&(v=o(v,t,d.dtick,s,i)),p=v,g=0;p<=l;)p=B.tickIncrement(p,d.dtick,!1,i),g++;return{start:e.c2r(v,0,i),end:e.c2r(p,0,i),size:d.dtick,_count:g}},B.calcTicks=function(t){var e=k.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var r,n=t.nticks;n||("category"===t.type?(r=t.tickfont?1.2*(t.tickfont.size||12):15,n=t._length/r):(r="y"===t._id.charAt(0)?40:80,n=k.constrain(t._length/r,4,9)+1)),"array"===t.tickmode&&(n*=100),B.autoTicks(t,Math.abs(e[1]-e[0])/n),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}if(t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),u(t),"array"===t.tickmode)return s(t);t._tmin=B.tickFirst(t);var i=e[1]=o:f<=o)&&!(a.length>c||f===l);f=B.tickIncrement(f,t.dtick,i,t.calendar))l=f,a.push(f);t._tmax=a[a.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var h=new Array(a.length),d=0;dR?(e/=R,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*l(e,r,q)):n>I?(e/=I,t.dtick="M"+l(e,1,G)):n>O?(t.dtick=l(e,O,W),t.tick0=k.dateTick0(t.calendar,!0)):n>N?t.dtick=l(e,N,G):n>D?t.dtick=l(e,D,X):n>z?t.dtick=l(e,z,X):(r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=l(e,r,q))}else if("log"===t.type){t.tick0=0;var i=k.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(i[1]-i[0])<1){var a=1.5*Math.abs((i[1]-i[0])/e);e=Math.abs(Math.pow(10,i[1])-Math.pow(10,i[0]))/a,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+l(e,r,q)}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=l(e,r,q));if(0===t.dtick&&(t.dtick=1),!M(t.dtick)&&"string"!=typeof t.dtick){var o=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(o)}},B.tickIncrement=function(t,e,r,n){var i=r?-1:1;if(M(e))return t+i*e;var a=e.charAt(0),o=i*Number(e.substr(1));if("M"===a)return k.incrementMonth(t,o,n);if("L"===a)return Math.log(Math.pow(10,t)+o)/Math.LN10;if("D"===a){var s="D2"===e?Z:Y,l=t+.01*i,u=k.roundUp(k.mod(l,1),s,r);return Math.floor(l)+Math.log(w.round(Math.pow(10,u),1))/Math.LN10}throw"unrecognized dtick "+String(e)},B.tickFirst=function(t){var e=t.r2l||Number,r=k.simpleMap(t.range,e),n=r[1]1&&e2*i}function a(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,i=0,a=0;a2*n}var o=t("fast-isnumeric"),s=t("../../lib"),l=t("../../constants/numerical").BADNUM;e.exports=function(t,e){return i(t,e)?"date":a(t)?"category":n(t)?"linear":"-"}},{"../../constants/numerical":388,"../../lib":406,"fast-isnumeric":87}],450:[function(t,e,r){"use strict";var n=t("tinycolor2").mix,i=t("../../registry"),a=t("../../lib"),o=t("../../components/color/attributes").lightFraction,s=t("./layout_attributes"),l=t("./tick_value_defaults"),u=t("./tick_mark_defaults"),c=t("./tick_label_defaults"),f=t("./category_order_defaults"),h=t("./set_convert"),d=t("./ordered_categories");e.exports=function(t,e,r,p,g){function v(r,n){return a.coerce2(t,e,s,r,n)}var m=p.letter,y=p.font||{},b="Click to enter "+(p.title||m.toUpperCase()+" axis")+" title",x=r("visible",!p.cheateronly),_=e.type;if("date"===_){i.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",p.calendar)}if(h(e,g),r("autorange",!e.isValidRange(t.range))&&r("rangemode"),r("range"),e.cleanRange(),f(t,e,r),e._initialCategories="category"===_?d(m,e.categoryorder,e.categoryarray,p.data):[],!x)return e;var w=r("color"),M=w===t.color?w:y.color;r("title",b),a.coerceFont(r,"titlefont",{family:y.family,size:Math.round(1.2*y.size),color:M}),l(t,e,r,_),c(t,e,r,_,p),u(t,e,r,p);var A=v("linecolor",w),k=v("linewidth"),T=r("showline",!!A||!!k);T||(delete e.linecolor,delete e.linewidth),(T||e.ticks)&&r("mirror");var E=v("gridcolor",n(w,p.bgColor,o).toRgbString()),L=v("gridwidth");r("showgrid",p.showGrid||!!E||!!L)||(delete e.gridcolor,delete e.gridwidth);var C=v("zerolinecolor",w),S=v("zerolinewidth");return r("zeroline",p.showGrid||!!C||!!S)||(delete e.zerolinecolor,delete e.zerolinewidth),e}},{"../../components/color/attributes":286,"../../lib":406,"../../registry":496,"./category_order_defaults":452,"./layout_attributes":459,"./ordered_categories":461,"./set_convert":465,"./tick_label_defaults":466,"./tick_mark_defaults":467,"./tick_value_defaults":468,tinycolor2:252}],451:[function(t,e,r){"use strict";function n(t,e,r){function n(t,r){for(var n=Object.keys(t),i=/^[xyz]axis[0-9]*/,a=[],o=0;o0;a&&(n="array");var o=r("categoryorder",n);"array"===o&&r("categoryarray"),a||"array"!==o||(e.categoryorder="trace")}}},{}],453:[function(t,e,r){"use strict";var n=t("../../lib").counterRegex;e.exports={idRegex:{x:n("x"),y:n("y")},attrRegex:n("[xy]axis"),xAxisMatch:n("xaxis"),yAxisMatch:n("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,SELECTDELAY:100,SELECTID:"-select",DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","maplayer","barlayer","carpetlayer","boxlayer","scatterlayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},{"../../lib":406}],454:[function(t,e,r){"use strict";function n(t,e,r,n){var i,a,s,l,u=n[o(e)].type,c=[];for(a=0;ao*m)||_)for(r=0;rP&&IC&&(C=I);var D=(C-L)/(2*S);f/=D,L=l.l2r(L),C=l.l2r(C),l.range=l._input.range=k=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function u(t,e){return t?"nsew"===t?"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}function c(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",i+"Z")}function f(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:T.background,stroke:T.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function h(t){t.selectAll(".select-outline").remove()}function d(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),i||(t.transition().style("fill",a>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function p(t){x.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function g(t){return-1!==["lasso","select"].indexOf(t)}function v(t,e){return"M"+(t.l-.5)+","+(e-j-.5)+"h-3v"+(2*j+1)+"h3ZM"+(t.r+.5)+","+(e-j-.5)+"h3v"+(2*j+1)+"h-3Z"}function m(t,e){return"M"+(e-j-.5)+","+(t.t-.5)+"v-3h"+(2*j+1)+"v3ZM"+(e-j-.5)+","+(t.b+.5)+"v3h"+(2*j+1)+"v-3Z"}function y(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,j)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function b(t,e,r){var n,i,a,o,s,l,u=!1,c={},f={};for(n=0;nj||s>j?(At="xy",o/at>s/ot?(s=o*ot/at,bt>a?xt.t=bt-s:xt.b=bt+s):(o=s*at/ot,yt>i?xt.l=yt-o:xt.r=yt+o),Tt.attr("d",y(xt))):n():!lt||szoom back out","long"),F=!1)}function W(e,r){var n=1===(U+V).length;if(e)K();else if(2!==r||n){if(1===r&&n){var i=U?rt[0]:et[0],o="s"===U||"w"===V?0:1,s=i._name+".range["+o+"]",l=a(i,o),u="left",c="middle";if(i.fixedrange)return;U?(c="n"===U?"top":"bottom","right"===i.side&&(u="right")):"e"===V&&(u="right"),t._context.showAxisRangeEntryBoxes&&x.select(vt).call(k.makeEditable,{gd:t,immediate:!0,background:dt.paper_bgcolor,text:String(l),fill:i.tickfont?i.tickfont.color:"#444",horizontalAlign:u,verticalAlign:c}).on("edit",function(e){var r=i.d2r(e);void 0!==r&&w.relayout(t,s,r)})}}else $()}function Y(e){function r(t,e,r){function n(e){return t.l2r(a+(e-a)*r)}if(!t.fixedrange){var i=A.simpleMap(t.range,t.r2l),a=i[0]+(i[1]-i[0])*e;t.range=i.map(n)}}if(t._context.scrollZoom||dt._enablescrollzoom){if(t._transitioningWithDuration)return A.pauseEvent(e);var n=t.querySelector(".plotly");if(H(),!(n.scrollHeight-n.clientHeight>10||n.scrollWidth-n.clientWidth>10)){clearTimeout(Ct);var i=-e.deltaY;if(isFinite(i)||(i=e.wheelDelta/10),!isFinite(i))return void A.log("Did not find wheel motion attributes: ",e);var a,o=Math.exp(-Math.min(Math.max(i,-20),20)/200),s=Pt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),l=(e.clientX-s.left)/s.width,u=(s.bottom-e.clientY)/s.height;if(V||ct){for(V||(l=.5),a=0;a rect").call(E.setTranslate,s,l).call(E.setScale,a,o);var w=g.plot.selectAll(".scatterlayer .points, .boxlayer .points");g.plot.call(E.setTranslate,x,_).call(E.setScale,1/a,1/o),w.selectAll(".point").call(E.setPointGroupScale,a,o).call(E.hideOutsideRangePoints,g),w.selectAll(".textpoint").call(E.setTextPointsScale,a,o).call(E.hideOutsideRangePoints,g)}}}var tt,et,rt,nt,it,at,ot,st,lt,ut,ct,ft,ht,dt=t._fullLayout,pt=t._fullLayout._zoomlayer,gt=U+V==="nsew";H();var vt=n(e,U+V+"drag",ut,r,T,L,B);if(!lt&&!st&&!g(dt.dragmode))return vt.onmousedown=null,vt.style.pointerEvents=gt?"all":"none",vt;var mt={element:vt,gd:t,plotinfo:e,prepFn:function(e,r,n){var i=t._fullLayout.dragmode;gt?e.shiftKey&&(i="pan"===i?"zoom":"pan"):i="pan",mt.minDrag="lasso"===i?1:void 0,"zoom"===i?(mt.moveFn=G,mt.doneFn=X,mt.minDrag=1,q(e,r,n)):"pan"===i?(mt.moveFn=Z,mt.doneFn=W,h(pt)):g(i)&&(mt.xaxes=et,mt.yaxes=rt,O(e,r,n,mt,i))}};C.init(mt);var yt,bt,xt,_t,wt,Mt,At,kt,Tt,Et={},Lt=[0,0,at,ot],Ct=null,St=D.REDRAWDELAY,Pt=e.mainplot?dt._plots[e.mainplot]:e;return U.length*V.length!=1&&(void 0!==vt.onwheel?vt.onwheel=Y:void 0!==vt.onmousewheel&&(vt.onmousewheel=Y)),vt}},{"../../components/color":287,"../../components/dragelement":308,"../../components/drawing":311,"../../constants/alignment":384,"../../lib":406,"../../lib/setcursor":424,"../../lib/svg_text_utils":428,"../../plotly":443,"../../registry":496,"../plots":488,"./axes":448,"./axis_ids":451,"./constants":453,"./scale_zoom":463,"./select":464,d3:79,tinycolor2:252}],457:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../components/fx"),a=t("../../components/dragelement"),o=t("./constants"),s=t("./dragbox");e.exports=function(t){var e=t._fullLayout;if((e._has("cartesian")||e._has("gl2d"))&&!t._context.staticPlot){Object.keys(e._plots||{}).sort(function(t,r){if((e._plots[t].mainplot&&!0)===(e._plots[r].mainplot&&!0)){var n=t.split("y"),i=r.split("y");return n[0]===i[0]?Number(n[1]||1)-Number(i[1]||1):Number(n[0]||1)-Number(i[0]||1)}return e._plots[t].mainplot?1:-1}).forEach(function(r){var l=e._plots[r],u=l.xaxis,c=l.yaxis,f=(u._linepositions[r]||[])[3],h=(c._linepositions[r]||[])[3],d=o.DRAGGERSIZE;if(n(f)&&"top"===u.side&&(f-=d),n(h)&&"right"!==c.side&&(h-=d),!l.mainplot){var p=s(t,l,0,0,u._length,c._length,"ns","ew");p.onmousemove=function(e){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===r&&i.hover(t,e,r)},i.hover(t,e,r),t._fullLayout._lasthover=p,t._fullLayout._hoversubplot=r},p.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,a.unhover(t,e))},p.onclick=function(e){i.click(t,e,r)},t._context.showAxisDragHandles&&(s(t,l,-d,-d,d,d,"n","w"),s(t,l,u._length,-d,d,d,"n","e"),s(t,l,-d,c._length,d,d,"s","w"),s(t,l,u._length,c._length,d,d,"s","e"))}t._context.showAxisDragHandles&&(n(f)&&("free"===u.anchor&&(f-=e._size.h*(1-c.domain[1])),s(t,l,.1*u._length,f,.8*u._length,d,"","ew"),s(t,l,0,f,.1*u._length,d,"","w"),s(t,l,.9*u._length,f,.1*u._length,d,"","e")),n(h)&&("free"===c.anchor&&(h-=e._size.w*u.domain[0]),s(t,l,h,.1*c._length,d,.8*c._length,"ns",""),s(t,l,h,.9*c._length,d,.1*c._length,"s",""),s(t,l,h,0,d,.1*c._length,"n","")))});var r=e._hoverlayer.node();r.onmousemove=function(r){r.target=e._lasthover,i.hover(t,r,e._hoversubplot)},r.onclick=function(r){r.target=e._lasthover,i.click(t,r)},r.onmousedown=function(t){e._lasthover.onmousedown(t)}}}},{"../../components/dragelement":308,"../../components/fx":328,"./constants":453,"./dragbox":456,"fast-isnumeric":87}],458:[function(t,e,r){"use strict";function n(t,e,r,n,i){var a=t._fullLayout,o=a._modules;e.plot&&e.plot.selectAll("g:not(.scatterlayer)").selectAll("g.trace").remove();for(var s=0;sc[1]-.01&&(e.domain=[0,1]),i.noneOrAll(t.domain,e.domain,[0,1])}return r("layer"),e}},{"../../lib":406,"fast-isnumeric":87}],463:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*r;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)]}},{"../../constants/alignment":384}],464:[function(t,e,r){"use strict";function n(t){return t._id}function i(t,e){if(Array.isArray(t))for(var r=e.cd[0].trace,n=0;n0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-3*M*Math.abs(n-i))}return d}function f(e,r,n){var i=u(e,n||t.calendar);if(i===d){if(!a(e))return d;i=u(new Date(+e))}return i}function v(e,r,n){return l(e,r,n||t.calendar)}function m(e){return t._categories[Math.round(e)]}function y(e){if(null!==e&&void 0!==e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return d}function b(e){if(t._categoriesMap){var r=t._categoriesMap[e];if(void 0!==r)return r}if(a(e))return+e}function x(e){return a(e)?i.round(t._b+t._m*e,2):d}function _(e){return(e-t._b)/t._m}e=e||{};var w=(t._id||"x").charAt(0),M=10;t.c2l="log"===t.type?r:c,t.l2c="log"===t.type?n:c,t.l2p=x,t.p2l=_,t.c2p="log"===t.type?function(t,e){return x(r(t,e))}:x,t.p2c="log"===t.type?function(t){return n(_(t))}:_,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=s,t.c2d=t.c2r=t.l2d=t.l2r=c,t.d2p=t.r2p=function(e){return t.l2p(s(e))},t.p2d=t.p2r=_,t.cleanPos=c):"log"===t.type?(t.d2r=t.d2l=function(t,e){return r(s(t),e)},t.r2d=t.r2c=function(t){return n(s(t))},t.d2c=t.r2l=s,t.c2d=t.l2r=c,t.c2r=r,t.l2d=n,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return n(_(t))},t.r2p=function(e){return t.l2p(s(e))},t.p2r=_,t.cleanPos=c):"date"===t.type?(t.d2r=t.r2d=o.identity,t.d2c=t.r2c=t.d2l=t.r2l=f,t.c2d=t.c2r=t.l2d=t.l2r=v,t.d2p=t.r2p=function(e,r,n){return t.l2p(f(e,0,n))},t.p2d=t.p2r=function(t,e,r){return v(_(t),e,r)},t.cleanPos=function(e){return o.cleanDate(e,d,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=y,t.r2d=t.c2d=t.l2d=m,t.d2r=t.d2l_noadd=b,t.r2c=function(e){var r=b(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=c,t.r2l=b,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return m(_(t))},t.r2p=t.d2p,t.p2r=_,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:c(t)}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e){e||(e="range");var r,n,i=o.nestedProperty(t,e).get();if(n="date"===t.type?o.dfltRange(t.calendar):"y"===w?p.DFLTRANGEY:p.DFLTRANGEX,n=n.slice(),!i||2!==i.length)return void o.nestedProperty(t,e).set(n);for("date"===t.type&&(i[0]=o.cleanDate(i[0],d,t.calendar),i[1]=o.cleanDate(i[1],d,t.calendar)),r=0;r<2;r++)if("date"===t.type){if(!o.isDateTime(i[r],t.calendar)){t[e]=n;break}if(t.r2l(i[0])===t.r2l(i[1])){var s=o.constrain(t.r2l(i[0]),o.MIN_MS+1e3,o.MAX_MS-1e3);i[0]=t.l2r(s-1e3),i[1]=t.l2r(s+1e3);break}}else{if(!a(i[r])){if(!a(i[1-r])){t[e]=n;break}i[r]=i[1-r]*(r?10:.1)}if(i[r]<-h?i[r]=-h:i[r]>h&&(i[r]=h),i[0]===i[1]){var l=Math.max(1,Math.abs(1e-6*i[0]));i[0]-=l,i[1]+=l}}},t.setScale=function(r){var n=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var i=g.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",s=t.calendar;t.cleanRange(a);var l=t.r2l(t[a][0],s),u=t.r2l(t[a][1],s);if("y"===w?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(l-u),t._b=-t._m*u):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(u-l),t._b=-t._m*l),!isFinite(t._m)||!isFinite(t._b))throw o.notifier("Something went wrong with axis scaling","long"),e._replotting=!1,new Error("axis scaling")},t.makeCalcdata=function(e,r){var n,i,a,o="date"===t.type&&e[r+"calendar"];if(r in e)for(n=e[r],i=new Array(n.length),a=0;a=t.range[0]&&r<=t.range[1]}:function(e){var r=e.y;return r>=t.range[0]&&r<=t.range[1]},t._min=[],t._max=[],t._separators=e.separators,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":388,"../../lib":406,"./axis_ids":451,"./constants":453,d3:79,"fast-isnumeric":87}],466:[function(t,e,r){"use strict";function n(t){var e=["showexponent","showtickprefix","showticksuffix"],r=e.filter(function(e){return void 0!==t[e]}),n=function(e){return t[e]===t[r[0]]};if(r.every(n)||1===r.length)return t[r[0]]}var i=t("../../lib");e.exports=function(t,e,r,a,o){var s=n(t);if(r("tickprefix")&&r("showtickprefix",s),r("ticksuffix")&&r("showticksuffix",s),r("showticklabels")){var l=o.font||{},u=e.color===t.color?e.color:l.color;i.coerceFont(r,"tickfont",{family:l.family,size:l.size,color:u}),r("tickangle"),"category"!==a&&(r("tickformat")||"date"===a||(r("showexponent",s),r("exponentformat"),r("separatethousands")))}"category"===a||o.noHover||r("hoverformat")}},{"../../lib":406}],467:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r,a){var o=n.coerce2(t,e,i,"ticklen"),s=n.coerce2(t,e,i,"tickwidth"),l=n.coerce2(t,e,i,"tickcolor",e.color);r("ticks",a.outerTicks||o||s||l?"outside":"")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":406,"./layout_attributes":459}],468:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../constants/numerical").ONEDAY;e.exports=function(t,e,r,o){var s="auto";"array"!==t.tickmode||"log"!==o&&"date"!==o||(t.tickmode="auto"),Array.isArray(t.tickvals)?s="array":t.dtick&&(s="linear");var l=r("tickmode",s);if("auto"===l)r("nticks");else if("linear"===l){var u="date"===o?a:1,c=r("dtick",u);if(n(c))e.dtick=c>0?Number(c):u;else if("string"!=typeof c)e.dtick=u;else{var f=c.charAt(0),h=c.substr(1);h=n(h)?Number(h):0,(h<=0||!("date"===o&&"M"===f&&h===Math.round(h)||"log"===o&&"L"===f||"log"===o&&"D"===f&&(1===h||2===h)))&&(e.dtick=u)}var d="date"===o?i.dateTick0(e.calendar):0,p=r("tick0",d);"date"===o?e.tick0=i.cleanDate(p,d):n(p)&&"D1"!==c&&"D2"!==c?e.tick0=Number(p):e.tick0=d}else{var g=r("tickvals");void 0===g?e.tickmode="auto":r("ticktext")}}},{"../../constants/numerical":388,"../../lib":406,"fast-isnumeric":87}],469:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plotly"),a=t("../../registry"),o=t("../../components/drawing"),s=t("./axes"),l=t("./constants").attrRegex;e.exports=function(t,e,r,u){function c(e,r){function n(e,r,n){for(i=0;i rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.select(".scatterlayer").selectAll(".points");n.selectAll(".point").call(o.setPointGroupScale,1,1).call(o.hideOutsideRangePoints,t),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1).call(o.hideOutsideRangePoints,t)}function h(e,r){var n,i,a,s=y[e.xaxis._id],l=y[e.yaxis._id],u=[];if(s){n=t._fullLayout[s.axisName],i=n._r,a=s.to,u[0]=(i[0]*(1-r)+r*a[0]-i[0])/(i[1]-i[0])*e.xaxis._length;var f=i[1]-i[0],h=a[1]-a[0];n.range[0]=i[0]*(1-r)+r*a[0],n.range[1]=i[1]*(1-r)+r*a[1],u[2]=e.xaxis._length*(1-r+r*h/f)}else u[0]=0,u[2]=e.xaxis._length;if(l){n=t._fullLayout[l.axisName],i=n._r,a=l.to,u[1]=(i[1]*(1-r)+r*a[1]-i[1])/(i[0]-i[1])*e.yaxis._length;var d=i[1]-i[0],p=a[1]-a[0];n.range[0]=i[0]*(1-r)+r*a[0], +;if(!s.fixedrange){n=s,i=s._rl[a]+(s._rl[e]-s._rl[a])/l(r/s._length);var u=s.l2r(i);!1!==u&&void 0!==u&&(s.range[e]=u)}}return n._length*(n._rl[e]-i)/(n._rl[e]-n._rl[a])}if(!t._transitioningWithDuration){if(H(),"ew"===st||"ns"===lt)return st&&s(et,e),lt&&s(rt,r),J([st?-e:0,lt?-r:0,at,ot]),void Q(lt,st);if(ct&&st&<){var i="w"===st==("n"===lt)?1:-1,a=(e/at+i*r/ot)/2;e=a*at,r=i*a*ot}"w"===st?e=n(et,0,e):"e"===st?e=n(et,1,-e):st||(e=0),"n"===lt?r=n(rt,1,r):"s"===lt?r=n(rt,0,-r):lt||(r=0);var o="w"===st?e:0,u="n"===lt?r:0;if(ct){var c;if(!st&&1===lt.length){for(c=0;c rect").call(E.setTranslate,s,l).call(E.setScale,a,o);var w=g.plot.selectAll(".scatterlayer .points, .boxlayer .points");g.plot.call(E.setTranslate,x,_).call(E.setScale,1/a,1/o),w.selectAll(".point").call(E.setPointGroupScale,a,o).call(E.hideOutsideRangePoints,g),w.selectAll(".textpoint").call(E.setTextPointsScale,a,o).call(E.hideOutsideRangePoints,g)}}}var tt,et,rt,nt,it,at,ot,st,lt,ut,ct,ft,ht,dt=t._fullLayout,pt=t._fullLayout._zoomlayer,gt=U+V==="nsew";H();var vt=n(e,U+V+"drag",ut,r,T,L,B);if(!lt&&!st&&!g(dt.dragmode))return vt.onmousedown=null,vt.style.pointerEvents=gt?"all":"none",vt;var mt={element:vt,gd:t,plotinfo:e,prepFn:function(e,r,n){var i=t._fullLayout.dragmode;gt?e.shiftKey&&(i="pan"===i?"zoom":"pan"):i="pan",mt.minDrag="lasso"===i?1:void 0,"zoom"===i?(mt.moveFn=G,mt.doneFn=X,mt.minDrag=1,q(e,r,n)):"pan"===i?(mt.moveFn=Z,mt.doneFn=W,h(pt)):g(i)&&(mt.xaxes=et,mt.yaxes=rt,O(e,r,n,mt,i))}};C.init(mt);var yt,bt,xt,_t,wt,Mt,At,kt,Tt,Et={},Lt=[0,0,at,ot],Ct=null,St=D.REDRAWDELAY,Pt=e.mainplot?dt._plots[e.mainplot]:e;return U.length*V.length!=1&&(void 0!==vt.onwheel?vt.onwheel=Y:void 0!==vt.onmousewheel&&(vt.onmousewheel=Y)),vt}},{"../../components/color":287,"../../components/dragelement":308,"../../components/drawing":311,"../../constants/alignment":384,"../../lib":406,"../../lib/setcursor":424,"../../lib/svg_text_utils":428,"../../plotly":443,"../../registry":496,"../plots":488,"./axes":448,"./axis_ids":451,"./constants":453,"./scale_zoom":463,"./select":464,d3:79,tinycolor2:252}],457:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../components/fx"),a=t("../../components/dragelement"),o=t("./constants"),s=t("./dragbox");e.exports=function(t){var e=t._fullLayout;if((e._has("cartesian")||e._has("gl2d"))&&!t._context.staticPlot){Object.keys(e._plots||{}).sort(function(t,r){if((e._plots[t].mainplot&&!0)===(e._plots[r].mainplot&&!0)){var n=t.split("y"),i=r.split("y");return n[0]===i[0]?Number(n[1]||1)-Number(i[1]||1):Number(n[0]||1)-Number(i[0]||1)}return e._plots[t].mainplot?1:-1}).forEach(function(r){var l=e._plots[r],u=l.xaxis,c=l.yaxis,f=(u._linepositions[r]||[])[3],h=(c._linepositions[r]||[])[3],d=o.DRAGGERSIZE;if(n(f)&&"top"===u.side&&(f-=d),n(h)&&"right"!==c.side&&(h-=d),!l.mainplot){var p=s(t,l,0,0,u._length,c._length,"ns","ew");p.onmousemove=function(e){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===r&&i.hover(t,e,r)},i.hover(t,e,r),t._fullLayout._lasthover=p,t._fullLayout._hoversubplot=r},p.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,a.unhover(t,e))},p.onclick=function(e){i.click(t,e,r)},t._context.showAxisDragHandles&&(s(t,l,-d,-d,d,d,"n","w"),s(t,l,u._length,-d,d,d,"n","e"),s(t,l,-d,c._length,d,d,"s","w"),s(t,l,u._length,c._length,d,d,"s","e"))}t._context.showAxisDragHandles&&(n(f)&&("free"===u.anchor&&(f-=e._size.h*(1-c.domain[1])),s(t,l,.1*u._length,f,.8*u._length,d,"","ew"),s(t,l,0,f,.1*u._length,d,"","w"),s(t,l,.9*u._length,f,.1*u._length,d,"","e")),n(h)&&("free"===c.anchor&&(h-=e._size.w*u.domain[0]),s(t,l,h,.1*c._length,d,.8*c._length,"ns",""),s(t,l,h,.9*c._length,d,.1*c._length,"s",""),s(t,l,h,0,d,.1*c._length,"n","")))});var r=e._hoverlayer.node();r.onmousemove=function(r){r.target=e._lasthover,i.hover(t,r,e._hoversubplot)},r.onclick=function(r){r.target=e._lasthover,i.click(t,r)},r.onmousedown=function(t){e._lasthover.onmousedown(t)}}}},{"../../components/dragelement":308,"../../components/fx":328,"./constants":453,"./dragbox":456,"fast-isnumeric":87}],458:[function(t,e,r){"use strict";function n(t,e,r,n,i){var a=t._fullLayout,o=a._modules;e.plot&&e.plot.selectAll("g:not(.scatterlayer)").selectAll("g.trace").remove();for(var s=0;sc[1]-.01&&(e.domain=[0,1]),i.noneOrAll(t.domain,e.domain,[0,1])}return r("layer"),e}},{"../../lib":406,"fast-isnumeric":87}],463:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*r;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)]}},{"../../constants/alignment":384}],464:[function(t,e,r){"use strict";function n(t){return t._id}function i(t,e){if(Array.isArray(t))for(var r=e.cd[0].trace,n=0;n0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-3*M*Math.abs(n-i))}return d}function f(e,r,n){var i=u(e,n||t.calendar);if(i===d){if(!a(e))return d;i=u(new Date(+e))}return i}function v(e,r,n){return l(e,r,n||t.calendar)}function m(e){return t._categories[Math.round(e)]}function y(e){if(null!==e&&void 0!==e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return d}function b(e){if(t._categoriesMap){var r=t._categoriesMap[e];if(void 0!==r)return r}if(a(e))return+e}function x(e){return a(e)?i.round(t._b+t._m*e,2):d}function _(e){return(e-t._b)/t._m}e=e||{};var w=(t._id||"x").charAt(0),M=10;t.c2l="log"===t.type?r:c,t.l2c="log"===t.type?n:c,t.l2p=x,t.p2l=_,t.c2p="log"===t.type?function(t,e){return x(r(t,e))}:x,t.p2c="log"===t.type?function(t){return n(_(t))}:_,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=s,t.c2d=t.c2r=t.l2d=t.l2r=c,t.d2p=t.r2p=function(e){return t.l2p(s(e))},t.p2d=t.p2r=_,t.cleanPos=c):"log"===t.type?(t.d2r=t.d2l=function(t,e){return r(s(t),e)},t.r2d=t.r2c=function(t){return n(s(t))},t.d2c=t.r2l=s,t.c2d=t.l2r=c,t.c2r=r,t.l2d=n,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return n(_(t))},t.r2p=function(e){return t.l2p(s(e))},t.p2r=_,t.cleanPos=c):"date"===t.type?(t.d2r=t.r2d=o.identity,t.d2c=t.r2c=t.d2l=t.r2l=f,t.c2d=t.c2r=t.l2d=t.l2r=v,t.d2p=t.r2p=function(e,r,n){return t.l2p(f(e,0,n))},t.p2d=t.p2r=function(t,e,r){return v(_(t),e,r)},t.cleanPos=function(e){return o.cleanDate(e,d,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=y,t.r2d=t.c2d=t.l2d=m,t.d2r=t.d2l_noadd=b,t.r2c=function(e){var r=b(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=c,t.r2l=b,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return m(_(t))},t.r2p=t.d2p,t.p2r=_,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:c(t)}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e){e||(e="range");var r,n,i=o.nestedProperty(t,e).get();if(n="date"===t.type?o.dfltRange(t.calendar):"y"===w?p.DFLTRANGEY:p.DFLTRANGEX,n=n.slice(),!i||2!==i.length)return void o.nestedProperty(t,e).set(n);for("date"===t.type&&(i[0]=o.cleanDate(i[0],d,t.calendar),i[1]=o.cleanDate(i[1],d,t.calendar)),r=0;r<2;r++)if("date"===t.type){if(!o.isDateTime(i[r],t.calendar)){t[e]=n;break}if(t.r2l(i[0])===t.r2l(i[1])){var s=o.constrain(t.r2l(i[0]),o.MIN_MS+1e3,o.MAX_MS-1e3);i[0]=t.l2r(s-1e3),i[1]=t.l2r(s+1e3);break}}else{if(!a(i[r])){if(!a(i[1-r])){t[e]=n;break}i[r]=i[1-r]*(r?10:.1)}if(i[r]<-h?i[r]=-h:i[r]>h&&(i[r]=h),i[0]===i[1]){var l=Math.max(1,Math.abs(1e-6*i[0]));i[0]-=l,i[1]+=l}}},t.setScale=function(r){var n=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var i=g.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",s=t.calendar;t.cleanRange(a);var l=t.r2l(t[a][0],s),u=t.r2l(t[a][1],s);if("y"===w?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(l-u),t._b=-t._m*u):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(u-l),t._b=-t._m*l),!isFinite(t._m)||!isFinite(t._b))throw o.notifier("Something went wrong with axis scaling","long"),e._replotting=!1,new Error("axis scaling")},t.makeCalcdata=function(e,r){var n,i,a,o="date"===t.type&&e[r+"calendar"];if(r in e)for(n=e[r],i=new Array(n.length),a=0;a=t.range[0]&&r<=t.range[1]}:function(e){var r=e.y;return r>=t.range[0]&&r<=t.range[1]},t._min=[],t._max=[],t._separators=e.separators,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":388,"../../lib":406,"./axis_ids":451,"./constants":453,d3:79,"fast-isnumeric":87}],466:[function(t,e,r){"use strict";function n(t){var e=["showexponent","showtickprefix","showticksuffix"],r=e.filter(function(e){return void 0!==t[e]}),n=function(e){return t[e]===t[r[0]]};if(r.every(n)||1===r.length)return t[r[0]]}var i=t("../../lib");e.exports=function(t,e,r,a,o){var s=n(t);if(r("tickprefix")&&r("showtickprefix",s),r("ticksuffix")&&r("showticksuffix",s),r("showticklabels")){var l=o.font||{},u=e.color===t.color?e.color:l.color;i.coerceFont(r,"tickfont",{family:l.family,size:l.size,color:u}),r("tickangle"),"category"!==a&&(r("tickformat")||"date"===a||(r("showexponent",s),r("exponentformat"),r("separatethousands")))}"category"===a||o.noHover||r("hoverformat")}},{"../../lib":406}],467:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r,a){var o=n.coerce2(t,e,i,"ticklen"),s=n.coerce2(t,e,i,"tickwidth"),l=n.coerce2(t,e,i,"tickcolor",e.color);r("ticks",a.outerTicks||o||s||l?"outside":"")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":406,"./layout_attributes":459}],468:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../constants/numerical").ONEDAY;e.exports=function(t,e,r,o){var s="auto";"array"!==t.tickmode||"log"!==o&&"date"!==o||(t.tickmode="auto"),Array.isArray(t.tickvals)?s="array":t.dtick&&(s="linear");var l=r("tickmode",s);if("auto"===l)r("nticks");else if("linear"===l){var u="date"===o?a:1,c=r("dtick",u);if(n(c))e.dtick=c>0?Number(c):u;else if("string"!=typeof c)e.dtick=u;else{var f=c.charAt(0),h=c.substr(1);h=n(h)?Number(h):0,(h<=0||!("date"===o&&"M"===f&&h===Math.round(h)||"log"===o&&"L"===f||"log"===o&&"D"===f&&(1===h||2===h)))&&(e.dtick=u)}var d="date"===o?i.dateTick0(e.calendar):0,p=r("tick0",d);"date"===o?e.tick0=i.cleanDate(p,d):n(p)&&"D1"!==c&&"D2"!==c?e.tick0=Number(p):e.tick0=d}else{var g=r("tickvals");void 0===g?e.tickmode="auto":r("ticktext")}}},{"../../constants/numerical":388,"../../lib":406,"fast-isnumeric":87}],469:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plotly"),a=t("../../registry"),o=t("../../components/drawing"),s=t("./axes"),l=t("./constants").attrRegex;e.exports=function(t,e,r,u){function c(e,r){function n(e,r,n){for(i=0;i rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.select(".scatterlayer").selectAll(".points");n.selectAll(".point").call(o.setPointGroupScale,1,1).call(o.hideOutsideRangePoints,t),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1).call(o.hideOutsideRangePoints,t)}function h(e,r){var n,i,a,s=y[e.xaxis._id],l=y[e.yaxis._id],u=[];if(s){n=t._fullLayout[s.axisName],i=n._r,a=s.to,u[0]=(i[0]*(1-r)+r*a[0]-i[0])/(i[1]-i[0])*e.xaxis._length;var f=i[1]-i[0],h=a[1]-a[0];n.range[0]=i[0]*(1-r)+r*a[0],n.range[1]=i[1]*(1-r)+r*a[1],u[2]=e.xaxis._length*(1-r+r*h/f)}else u[0]=0,u[2]=e.xaxis._length;if(l){n=t._fullLayout[l.axisName],i=n._r,a=l.to,u[1]=(i[1]*(1-r)+r*a[1]-i[1])/(i[0]-i[1])*e.yaxis._length;var d=i[1]-i[0],p=a[1]-a[0];n.range[0]=i[0]*(1-r)+r*a[0], n.range[1]=i[1]*(1-r)+r*a[1],u[3]=e.yaxis._length*(1-r+r*p/d)}else u[1]=0,u[3]=e.yaxis._length;c(e.xaxis,e.yaxis);var g=e.xaxis,m=e.yaxis,b=!!s,x=!!l,_=b?g._length/u[2]:1,w=x?m._length/u[3]:1,M=b?u[0]:0,A=x?u[1]:0,k=b?u[0]/u[2]*g._length:0,T=x?u[1]/u[3]*m._length:0,E=g._offset-k,L=m._offset-T;v._defs.select("#"+e.clipId+"> rect").call(o.setTranslate,M,A).call(o.setScale,1/_,1/w),e.plot.call(o.setTranslate,E,L).call(o.setScale,_,w).selectAll(".points").selectAll(".point").call(o.setPointGroupScale,1/_,1/w),e.plot.selectAll(".points").selectAll(".textpoint").call(o.setTextPointsScale,1/_,1/w)}function d(){for(var e={},r=0;rr.duration?(d(),A=window.cancelAnimationFrame(g)):A=window.requestAnimationFrame(g)}var v=t._fullLayout,m=[],y=function(t){var e,r,n,i,a={};for(e in t)if(r=e.split("."),r[0].match(l)){var o=e.charAt(0),s=r[0];if(n=v[s],i={},Array.isArray(t[e])?i.to=t[e].slice(0):Array.isArray(t[e].range)&&(i.to=t[e].range.slice(0)),!i.to)continue;i.axisName=s,i.length=n._length,m.push(o),a[o]=i}return a}(e),b=Object.keys(y),x=function(t,e,r){var n,i,a,o=t._plots,s=[];for(n in o){var l=o[n];if(-1===s.indexOf(l)){var u=l.xaxis._id,c=l.yaxis._id,f=l.xaxis.range,h=l.yaxis.range;l.xaxis._r=l.xaxis.range.slice(),l.yaxis._r=l.yaxis.range.slice(),i=r[u]?r[u].to:f,a=r[c]?r[c].to:h,f[0]===i[0]&&f[1]===i[1]&&h[0]===a[0]&&h[1]===a[1]||-1===e.indexOf(u)&&-1===e.indexOf(c)||s.push(l)}}return s}(v,b,y);if(!x.length)return function(){function e(e,r,n){for(var i=0;i0?".":"")+i;u.isPlainObject(a)?s(a,e,o,n+1):e(o,i,a)}})}var l=t("../plotly"),u=t("../lib");r.manageCommandObserver=function(t,e,i,a){var o={},s=!0;e&&e._commandObserver&&(o=e._commandObserver),o.cache||(o.cache={}),o.lookupTable={};var l=r.hasSimpleAPICommandBindings(t,i,o.lookupTable);if(e&&e._commandObserver){if(l)return o;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,o}if(l){n(t,l,o.cache),o.check=function(){if(s){var e=n(t,l,o.cache);return e.changed&&a&&void 0!==o.lookupTable[e.value]&&(o.disable(),Promise.resolve(a({value:e.value,type:l.type,prop:l.prop,traces:l.traces,index:o.lookupTable[e.value]})).then(o.enable,o.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;fMath.abs(e))u.rotate(a,0,0,-t*r*Math.PI*p.rotateSpeed/window.innerWidth);else{var o=-p.zoomSpeed*n*e/window.innerHeight*(a-u.lastT())/20;u.pan(a,0,0,f*(Math.exp(o)-1))}}},!0),p}e.exports=n;var i=t("right-now"),a=t("3d-view"),o=t("mouse-change"),s=t("mouse-wheel"),l=t("mouse-event-offset")},{"3d-view":9,"mouse-change":188,"mouse-event-offset":189,"mouse-wheel":191,"right-now":225}],475:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../components/fx/layout_attributes"),a=t("./scene"),o=t("../plots"),s=t("../../lib"),l=t("../../constants/xmlns_namespaces");r.name="gl3d",r.attr="scene",r.idRoot="scene",r.idRegex=r.attrRegex=s.counterRegex("scene"),r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.baseLayoutAttrOverrides=n({hoverlabel:i.hoverlabel},"plot","nested"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,n=o.getSubplotIds(e,"gl3d"),i=0;i1;s(t,e,r,{type:"gl3d",attributes:u,handleDefaults:n,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:a,paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":287,"../../../lib":406,"../../../registry":496,"../../subplot_defaults":495,"./axis_defaults":478,"./layout_attributes":481}],481:[function(t,e,r){"use strict";function n(t,e,r){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:e,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}var i=t("./axis_attributes"),a=t("../../../lib/extend").extendFlat,o=t("../../../lib").counterRegex;e.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:a(n(0,0,1),{}),center:a(n(0,0,0),{}),eye:a(n(1.25,1.25,1.25),{}),editType:"camera"},domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot"},y:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot"},editType:"plot"},aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:i,yaxis:i,zaxis:i,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],dflt:"turntable",editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":406,"../../../lib/extend":398,"./axis_attributes":477}],482:[function(t,e,r){"use strict";function n(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}function i(t){var e=new n;return e.merge(t),e}var a=t("../../../lib/str2rgbarray"),o=["xaxis","yaxis","zaxis"];n.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[o[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=a(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=i},{"../../../lib/str2rgbarray":427}],483:[function(t,e,r){"use strict";function n(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],i=new Array(n.length),a=0;ah[1][o]?d[o]=1:h[1][o]===h[0][o]?d[o]=1:d[o]=1/(h[1][o]-h[0][o]);for(this.dataScale=d,this.convertAnnotations(this),a=0;ag[1][a])g[0][a]=-1,g[1][a]=1;else{var k=g[1][a]-g[0][a];g[0][a]-=k/32,g[1][a]+=k/32}}else{var E=l.range;g[0][a]=l.r2l(E[0]),g[1][a]=l.r2l(E[1])}g[0][a]===g[1][a]&&(g[0][a]-=1,g[1][a]+=1),v[a]=g[1][a]-g[0][a],this.glplot.bounds[0][a]=g[0][a]*d[a],this.glplot.bounds[1][a]=g[1][a]*d[a]}var L=[1,1,1];for(a=0;a<3;++a){l=c[T[a]],u=l.type;var C=m[u] ;L[a]=Math.pow(C.acc,1/C.count)/d[a]}var S;if("auto"===c.aspectmode)S=Math.max.apply(null,L)/Math.min.apply(null,L)<=4?L:[1,1,1];else if("cube"===c.aspectmode)S=[1,1,1];else if("data"===c.aspectmode)S=L;else{if("manual"!==c.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var P=c.aspectratio;S=[P.x,P.y,P.z]}c.aspectratio.x=f.aspectratio.x=S[0],c.aspectratio.y=f.aspectratio.y=S[1],c.aspectratio.z=f.aspectratio.z=S[2],this.glplot.aspect=S;var R=c.domain||null,I=e._size||null;if(R&&I){var O=this.container.style;O.position="absolute",O.left=I.l+R.x[0]*I.w+"px",O.top=I.t+(1-R.y[1])*I.h+"px",O.width=I.w*(R.x[1]-R.x[0])+"px",O.height=I.h*(R.y[1]-R.y[0])+"px"}this.glplot.redraw()}},k.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=this.glplot.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},k.getCamera=function(){return this.glplot.camera.view.recalcMatrix(this.camera.view.lastT()),u(this.glplot.camera)},k.setCamera=function(t){this.glplot.camera.lookAt.apply(this,l(t))},k.saveCamera=function(t){var e=this.getCamera(),r=g.nestedProperty(t,this.id+".camera"),n=r.get(),i=!1;if(void 0===n)i=!0;else for(var a=0;a<3;a++)for(var o=0;o<3;o++)if(!function(t,e,r,n){var i=["up","center","eye"],a=["x","y","z"];return e[i[r]]&&t[i[r]][a[n]]===e[i[r]][a[n]]}(e,n,a,o)){i=!0;break}return i&&r.set(e),i},k.updateFx=function(t,e){var r=this.camera;r&&("orbit"===t?(r.mode="orbit",r.keyBindingMode="rotate"):"turntable"===t?(r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate"):r.keyBindingMode=t),this.fullSceneLayout.hovermode=e},k.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(c),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,n=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*n*4);e.readPixels(0,0,r,n,e.RGBA,e.UNSIGNED_BYTE,i);for(var a=0,o=n-1;a=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),r.attr(a);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),u=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&n(t,o),s.text(o.text()&&u.text()?" - ":"")}},v.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=l.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return n.append("input").attr({type:"text",name:"data"}).node().value=v.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},v.supplyDefaults=function(t){var e,r=t._fullLayout||{},n=t._fullLayout={},a=t.layout||{},o=t._fullData||[],s=t._fullData=[],l=t.data||[];if(t._transitionData||v.createTransitionData(t),r._initialAutoSizeIsDone){var u=r.width,f=r.height;v.supplyLayoutGlobalDefaults(a,n),a.width||(n.width=u),a.height||(n.height=f)}else{v.supplyLayoutGlobalDefaults(a,n);var h=!a.width||!a.height,d=n.autosize,p=t._context&&t._context.autosizable;h&&(d||p)?v.plotAutoSize(t,a,n):h&&v.sanitizeMargins(t),!d&&h&&(a.width=n.width,a.height=n.height)}n._initialAutoSizeIsDone=!0,n._dataLength=l.length,n._globalTransforms=(t._context||{}).globalTransforms,v.supplyDataDefaults(l,s,a,n),n._has=v._hasPlotType.bind(n);var g=n._modules;for(e=0;e0){var c=o(t._boundingBoxMargins),f=c.left+c.right,h=c.bottom+c.top,p=1-2*s,g=r._container&&r._container.node?r._container.node().getBoundingClientRect():{width:r.width,height:r.height};n=Math.round(p*(g.width-f)),i=Math.round(p*(g.height-h))}else{var m=l?window.getComputedStyle(t):{};n=parseFloat(m.width)||r.width,i=parseFloat(m.height)||r.height}var y=v.layoutAttributes.width.min,b=v.layoutAttributes.height.min;n1,_=!e.height&&Math.abs(r.height-i)>1;(_||x)&&(x&&(r.width=n),_&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),v.sanitizeMargins(r)},v.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a;c.Axes.supplyLayoutDefaults(t,e,r);var o=e._basePlotModules;for(i=0;i.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+i},r:{val:r.x,size:r.r+i},b:{val:r.y,size:r.b+i},t:{val:r.y,size:r.t+i}}}else delete n._pushmargin[e];n._replotting||v.doAutoMargin(t)}},v.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),i=Math.max(e.margin.l||0,0),a=Math.max(e.margin.r||0,0),o=Math.max(e.margin.t||0,0),s=Math.max(e.margin.b||0,0),l=e._pushmargin;if(!1!==e.margin.autoexpand){l.base={l:{val:0,size:i},r:{val:1,size:a},t:{val:1,size:o},b:{val:0,size:s}};for(var f=Object.keys(l),h=0;hv){var A=(m*w+(M-e.width)*v)/(w-v),k=(M*(1-v)+(m-e.width)*(1-w))/(w-v);A>=0&&k>=0&&A+k>i+a&&(i=A,a=k)}}if(u(b)&&l[_].t){var T=l[_].t.val,E=l[_].t.size;if(T>y){var L=(b*T+(E-e.height)*y)/(T-y),C=(E*(1-y)+(b-e.height)*(1-T))/(T-y);L>=0&&C>=0&&L+C>s+o&&(s=L,o=C)}}}}if(r.l=Math.round(i),r.r=Math.round(a),r.t=Math.round(o),r.b=Math.round(s),r.p=Math.round(e.margin.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,!e._replotting&&"{}"!==n&&n!==JSON.stringify(e._size))return c.plot(t)},v.graphJson=function(t,e,r,n,i){function a(t){if("function"==typeof t)return null;if(d.isPlainObject(t)){var e,n,i={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0&&!d.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;i[e]=a(t[e])}return i}return Array.isArray(t)?t.map(a):d.isJSDate(t)?d.ms2DateTimeLocal(+t):t}(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&v.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l=(t._transitionData||{})._frames,u={data:(o||[]).map(function(t){var r=a(t);return e&&delete r.fit,r})};return e||(u.layout=a(s)),t.framework&&t.framework.isPolar&&(u=t.framework.getConfig()),l&&(u.frames=a(l)),"object"===n?u:JSON.stringify(u)},v.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){x=!0}),i.redraw&&t._transitionData._interruptCallbacks.push(function(){return c.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var o,s,l=0,u=0,h=t._fullLayout._basePlotModules,p=!1;if(r)for(s=0;s=0,C=L?h.angularAxis.domain:n.extent(A),S=Math.abs(A[1]-A[0]);T&&!k&&(S=0);var P=C.slice();E&&k&&(P[1]+=S);var R=h.angularAxis.ticksCount||4;R>8&&(R=R/(R/8)+R%8),h.angularAxis.ticksStep&&(R=(P[1]-P[0])/R);var I=h.angularAxis.ticksStep||(P[1]-P[0])/(R*(h.minorTicks+1));M&&(I=Math.max(Math.round(I),1)),P[2]||(P[2]=I);var O=n.range.apply(this,P);if(O=O.map(function(t,e){return parseFloat(t.toPrecision(12))}),l=n.scale.linear().domain(P.slice(0,2)).range("clockwise"===h.direction?[0,360]:[360,0]),f.layout.angularAxis.domain=l.domain(),f.layout.angularAxis.endPadding=E?S:0,void 0===(e=n.select(this).select("svg.chart-root"))||e.empty()){var N=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),D=this.appendChild(this.ownerDocument.importNode(N.documentElement,!0));e=n.select(D)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var z,j=e.select(".chart-group"),F={fill:"none",stroke:h.tickColor},B={"font-size":h.font.size,"font-family":h.font.family,fill:h.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+h.font.outlineColor}).join(",")};if(h.showLegend){z=e.select(".legend-group").attr({transform:"translate("+[x,h.margin.top]+")"}).style({display:"block"});var U=p.map(function(t,e){var r=s.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});s.Legend().config({data:p.map(function(t,e){return t.name||"Element"+e}),legendConfig:a({},s.Legend.defaultConfig().legendConfig,{container:z,elements:U,reverseOrder:h.legend.reverseOrder})})();var V=z.node().getBBox();x=Math.min(h.width-V.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2,x=Math.max(10,x),w=[h.margin.left+x,h.margin.top+x],i.range([0,x]),f.layout.radialAxis.domain=i.domain(),z.attr("transform","translate("+[w[0]+x,w[1]-x]+")")}else z=e.select(".legend-group").style({display:"none"});e.attr({width:h.width,height:h.height}).style({opacity:h.opacity}),j.attr("transform","translate("+w+")").style({cursor:"crosshair"});var H=[(h.width-(h.margin.left+h.margin.right+2*x+(V?V.width:0)))/2,(h.height-(h.margin.top+h.margin.bottom+2*x))/2];if(H[0]=Math.max(0,H[0]),H[1]=Math.max(0,H[1]),e.select(".outer-group").attr("transform","translate("+H+")"),h.title){var q=e.select("g.title-group text").style(B).text(h.title),G=q.node().getBBox();q.attr({x:w[0]-G.width/2,y:w[1]-x-20})}var X=e.select(".radial.axis-group");if(h.radialAxis.gridLinesVisible){var W=X.selectAll("circle.grid-circle").data(i.ticks(5));W.enter().append("circle").attr({class:"grid-circle"}).style(F),W.attr("r",i),W.exit().remove()}X.select("circle.outside-circle").attr({r:x}).style(F);var Y=e.select("circle.background-circle").attr({r:x}).style({fill:h.backgroundColor,stroke:h.stroke});if(h.radialAxis.visible){var Z=n.svg.axis().scale(i).ticks(5).tickSize(5);X.call(Z).attr({transform:"rotate("+h.radialAxis.orientation+")"}),X.selectAll(".domain").style(F),X.selectAll("g>text").text(function(t,e){return this.textContent+h.radialAxis.ticksSuffix}).style(B).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===h.radialAxis.tickOrientation?"rotate("+-h.radialAxis.orientation+") translate("+[0,B["font-size"]]+")":"translate("+[0,B["font-size"]]+")"}}),X.selectAll("g>line").style({stroke:"black"})}var Q=e.select(".angular.axis-group").selectAll("g.angular-tick").data(O),$=Q.enter().append("g").classed("angular-tick",!0);Q.attr({transform:function(t,e){return"rotate("+u(t,e)+")"}}).style({display:h.angularAxis.visible?"block":"none"}),Q.exit().remove(),$.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(h.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(h.minorTicks+1)==0)}).style(F),$.selectAll(".minor").style({stroke:h.minorTickColor}),Q.select("line.grid-line").attr({x1:h.tickLength?x-h.tickLength:0,x2:x}).style({display:h.angularAxis.gridLinesVisible?"block":"none"}),$.append("text").classed("axis-text",!0).style(B);var K=Q.select("text.axis-text").attr({x:x+h.labelOffset,dy:o+"em",transform:function(t,e){var r=u(t,e),n=x+h.labelOffset,i=h.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:h.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(h.minorTicks+1)!=0?"":M?M[t]+h.angularAxis.ticksSuffix:t+h.angularAxis.ticksSuffix}).style(B);h.angularAxis.rewriteTicks&&K.text(function(t,e){return e%(h.minorTicks+1)!=0?"":h.angularAxis.rewriteTicks(this.textContent,e)});var J=n.max(j.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));z.attr({transform:"translate("+[x+J,h.margin.top]+")"});var tt=e.select("g.geometry-group").selectAll("g").size()>0,et=e.select("g.geometry-group").selectAll("g.geometry").data(p);if(et.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),et.exit().remove(),p[0]||tt){var rt=[];p.forEach(function(t,e){var r={};r.radialScale=i,r.angularScale=l,r.container=et.filter(function(t,r){return r==e}),r.geometry=t.geometry,r.orientation=h.orientation,r.direction=h.direction,r.index=e,rt.push({data:t,geometryConfig:r})});var nt=n.nest().key(function(t,e){return void 0!==t.data.groupId||"unstacked"}).entries(rt),it=[];nt.forEach(function(t,e){"unstacked"===t.key?it=it.concat(t.values.map(function(t,e){return[t]})):it.push(t.values)}),it.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return a(s[r].defaultConfig(),t)});s[r]().config(n)()})}var at,ot,st=e.select(".guides-group"),lt=e.select(".tooltips-group"),ut=s.tooltipPanel().config({container:lt,fontSize:8})(),ct=s.tooltipPanel().config({container:lt,fontSize:8})(),ft=s.tooltipPanel().config({container:lt,hasTick:!0})();if(!k){var ht=st.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});j.on("mousemove.angular-guide",function(t,e){var r=s.util.getMousePos(Y).angle;ht.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-h.orientation)%360;at=l.invert(n);var i=s.util.convertToCartesian(x+12,r+180);ut.text(s.util.round(at)).move([i[0]+w[0],i[1]+w[1]])}).on("mouseout.angular-guide",function(t,e){st.select("line").style({opacity:0})})}var dt=st.select("circle").style({stroke:"grey",fill:"none"});j.on("mousemove.radial-guide",function(t,e){var r=s.util.getMousePos(Y).radius;dt.attr({r:r}).style({opacity:.5}),ot=i.invert(s.util.getMousePos(Y).radius);var n=s.util.convertToCartesian(r,h.radialAxis.orientation);ct.text(s.util.round(ot)).move([n[0]+w[0],n[1]+w[1]])}).on("mouseout.radial-guide",function(t,e){dt.style({opacity:0}),ft.hide(),ut.hide(),ct.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,r){var i=n.select(this),a=this.style.fill,o="black",l=this.style.opacity||1;if(i.attr({"data-opacity":l}),a&&"none"!==a){i.attr({"data-fill":a}),o=n.hsl(a).darker().toString(),i.style({fill:o,opacity:1});var u={t:s.util.round(t[0]),r:s.util.round(t[1])};k&&(u.t=M[t[0]]);var c="t: "+u.t+", r: "+u.r,f=this.getBoundingClientRect(),h=e.node().getBoundingClientRect(),d=[f.left+f.width/2-H[0]-h.left,f.top+f.height/2-H[1]-h.top];ft.config({color:o}).text(c),ft.move(d)}else a=this.style.stroke||"black",i.attr({"data-stroke":a}),o=n.hsl(a).darker().toString(),i.style({stroke:o,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ft.show()}).on("mouseout.tooltip",function(t,e){ft.hide();var r=n.select(this),i=r.attr("data-fill");i?r.style({fill:i,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})}),d}var e,r,i,l,u={data:[],layout:{}},c={},f={},h=n.dispatch("hover"),d={};return d.render=function(e){return t(e),this},d.config=function(t){if(!arguments.length)return u;var e=s.util.cloneJson(t);return e.data.forEach(function(t,e){u.data[e]||(u.data[e]={}),a(u.data[e],s.Axis.defaultConfig().data[0]),a(u.data[e],t)}),a(u.layout,s.Axis.defaultConfig().layout),a(u.layout,e.layout),this},d.getLiveConfig=function(){return f},d.getinputConfig=function(){return c},d.radialScale=function(t){return i},d.angularScale=function(t){return l},d.svg=function(){return e},n.rebind(d,h,"on"),d},s.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},s.util={},s.DATAEXTENT="dataExtent",s.AREA="AreaChart",s.LINE="LinePlot",s.DOT="DotPlot",s.BAR="BarChart",s.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},s.util._extend=function(t,e){for(var r in t)e[r]=t[r]},s.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},s.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180;return[e,t(n)]})},s.util.dataFromEquation=function(t,e,r){var i=e||6,a=[],o=[];n.range(0,360+i,i).forEach(function(e,r){var n=e*Math.PI/180,i=t(n);a.push(e),o.push(i)});var s={t:a,r:o};return r&&(s.name=r),s},s.util.ensureArray=function(t,e){if(void 0===t)return null;var r=[].concat(t);return n.range(e).map(function(t,e){return r[e]||r[0]})},s.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=s.util.ensureArray(t[e],r)}),t},s.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},s.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},s.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},s.util.arrayLast=function(t){return t[t.length-1]},s.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},s.util.flattenArray=function(t){for(var e=[];!s.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},s.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},s.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},s.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},s.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],i=e[1],a={};return a.x=r,a.y=i,a.pos=e,a.angle=180*(Math.atan2(i,r)+Math.PI)/Math.PI,a.radius=Math.sqrt(r*r+i*i),a},s.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,a=t.length;i0)){var s=n.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({class:"line",d:h(o),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return v.fill(r,i,a)},"fill-opacity":0,stroke:function(t,e){return v.stroke(r,i,a)},"stroke-width":function(t,e){return v["stroke-width"](r,i,a)},"stroke-dasharray":function(t,e){return v["stroke-dasharray"](r,i,a)},opacity:function(t,e){return v.opacity(r,i,a)},display:function(t,e){return v.display(r,i,a)}})}};var d=t.angularScale.range(),p=Math.abs(d[1]-d[0])/l[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(c+(e[2]||0))}).outerRadius(function(e){return t.radialScale(c+(e[2]||0))+t.radialScale(e[1])});f.arc=function(e,r,i){n.select(this).attr({class:"mark arc",d:g,transform:function(e,r){return"rotate("+(t.orientation+u(e[0])+90)+")"}})};var v={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 i[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return void 0===e[n].data.visible||e[n].data.visible?"block":"none"}},m=n.select(this).selectAll("g.layer").data(l);m.enter().append("g").attr({class:"layer"});var y=m.selectAll("path.mark").data(function(t,e){return t});y.enter().append("path").attr({class:"mark"}),y.style(v).each(f[t.geometryType]),y.exit().remove(),m.exit().remove()})}var e=[s.PolyChart.defaultConfig()],r=n.dispatch("hover"),i={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,r){e[r]||(e[r]={}),a(e[r],s.PolyChart.defaultConfig()),a(e[r],t)}),this):e},t.getColorScale=function(){},n.rebind(t,r,"on"),t},s.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},s.BarChart=function(){return s.PolyChart()},s.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},s.AreaChart=function(){return s.PolyChart()},s.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},s.DotPlot=function(){return s.PolyChart()},s.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},s.LinePlot=function(){return s.PolyChart()},s.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},s.Legend=function(){function t(){var r=e.legendConfig,i=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var i=a({},r.elements[e]);return i.name=t,i.color=[].concat(r.elements[e].color)[n],i})}),o=n.merge(i);o=o.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||void 0===r.elements[e].visibleInLegend)}),r.reverseOrder&&(o=o.reverse());var s=r.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map(function(t,e){return t.color}),u=r.fontSize,c=null==r.isContinuous?"number"==typeof o[0]:r.isContinuous,f=c?r.height:u*o.length,h=s.classed("legend-group",!0),d=h.selectAll("svg").data([0]),p=d.enter().append("svg").attr({width:300,height:f+u,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var g=n.range(o.length),v=n.scale[c?"linear":"ordinal"]().domain(g).range(l),m=n.scale[c?"linear":"ordinal"]().domain(g)[c?"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":-1!=n.svg.symbolTypes.indexOf(t)?n.svg.symbol().type(t).size(r)():n.svg.symbol().type("square").size(r)()};if(c){var b=d.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);b.enter().append("stop"),b.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),d.append("rect").classed("legend-mark",!0).attr({height:r.height,width:r.colorBandWidth,fill:"url(#grad1)"})}else{var x=d.select(".legend-marks").selectAll("path.legend-mark").data(o);x.enter().append("path").classed("legend-mark",!0),x.attr({transform:function(t,e){return"translate("+[u/2,m(e)+u/2]+")"},d:function(t,e){var r=t.symbol;return y(r,u)},fill:function(t,e){return v(e)}}),x.exit().remove()}var _=n.svg.axis().scale(m).orient("right"),w=d.select("g.legend-axis").attr({transform:"translate("+[c?r.colorBandWidth:u,u/2]+")"}).call(_);return w.selectAll(".domain").style({fill:"none",stroke:"none"}),w.selectAll("line").style({fill:"none",stroke:c?r.textColor:"none"}),w.selectAll("text").style({fill:r.textColor,"font-size":r.fontSize}).text(function(t,e){return o[e].name}),t}var e=s.Legend.defaultConfig(),r=n.dispatch("hover");return t.config=function(t){return arguments.length?(a(e,t),this):e},n.rebind(t,r,"on"),t},s.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},s.tooltipPanel=function(){var t,e,r,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},o="tooltip-"+s.tooltipPanel.uid++,l=function(){t=i.container.selectAll("g."+o).data([0]);var n=t.enter().append("g").classed(o,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:i.padding+10,dy:.3*+i.fontSize}),l};return l.text=function(a){var o=n.hsl(i.color).l,s=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",c=a||"";e.style({fill:u,"font-size":i.fontSize+"px"}).text(c);var f=i.padding,h=e.node().getBBox(),d={fill:i.color,stroke:s,"stroke-width":"2px"},p=h.width+2*f+10,g=h.height+2*f;return r.attr({d:"M"+[[10,-g/2],[10,-g/4],[i.hasTick?0:10,0],[10,g/4],[10,g/2],[p,g/2],[p,-g/2]].join("L")+"Z"}).style(d),t.attr({transform:"translate("+[10,-g/2+2*f]+")"}),t.style({display:"block"}),l},l.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),l},l.hide=function(){if(t)return t.style({display:"none"}),l},l.show=function(){if(t)return t.style({display:"block"}),l},l.config=function(t){return a(i,t),l},l},s.tooltipPanel.uid=1,s.adapter={},s.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=a({},t);return[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]].forEach(function(t,r){s.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var i=s.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=i.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)})}if(t.layout){var o=a({},t.layout);if([[o,["plot_bgcolor"],["backgroundColor"]],[o,["showlegend"],["showLegend"]],[o,["radialaxis"],["radialAxis"]],[o,["angularaxis"],["angularAxis"]],[o.angularaxis,["showline"],["gridLinesVisible"]],[o.angularaxis,["showticklabels"],["labelsVisible"]],[o.angularaxis,["nticks"],["ticksCount"]],[o.angularaxis,["tickorientation"],["tickOrientation"]],[o.angularaxis,["ticksuffix"],["ticksSuffix"]],[o.angularaxis,["range"],["domain"]],[o.angularaxis,["endpadding"],["endPadding"]],[o.radialaxis,["showline"],["gridLinesVisible"]],[o.radialaxis,["tickorientation"],["tickOrientation"]],[o.radialaxis,["ticksuffix"],["ticksSuffix"]],[o.radialaxis,["range"],["domain"]],[o.angularAxis,["showline"],["gridLinesVisible"]],[o.angularAxis,["showticklabels"],["labelsVisible"]],[o.angularAxis,["nticks"],["ticksCount"]],[o.angularAxis,["tickorientation"],["tickOrientation"]],[o.angularAxis,["ticksuffix"],["ticksSuffix"]],[o.angularAxis,["range"],["domain"]],[o.angularAxis,["endpadding"],["endPadding"]],[o.radialAxis,["showline"],["gridLinesVisible"]],[o.radialAxis,["tickorientation"],["tickOrientation"]],[o.radialAxis,["ticksuffix"],["ticksSuffix"]],[o.radialAxis,["range"],["domain"]],[o.font,["outlinecolor"],["outlineColor"]],[o.legend,["traceorder"],["reverseOrder"]],[o,["labeloffset"],["labelOffset"]],[o,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(t,r){s.util.translator.apply(null,t.concat(e))}),e?(void 0!==o.tickLength&&(o.angularaxis.ticklen=o.tickLength,delete o.tickLength),o.tickColor&&(o.angularaxis.tickcolor=o.tickColor,delete o.tickColor)):(o.angularAxis&&void 0!==o.angularAxis.ticklen&&(o.tickLength=o.angularAxis.ticklen),o.angularAxis&&void 0!==o.angularAxis.tickcolor&&(o.tickColor=o.angularAxis.tickcolor)),o.legend&&"boolean"!=typeof o.legend.reverseOrder&&(o.legend.reverseOrder="normal"!=o.legend.reverseOrder),o.legend&&"boolean"==typeof o.legend.traceorder&&(o.legend.traceorder=o.legend.traceorder?"reversed":"normal",delete o.legend.reverseOrder),o.margin&&void 0!==o.margin.t){var l=["t","r","b","l","pad"],u=["top","right","bottom","left","pad"],c={};n.entries(o.margin).forEach(function(t,e){c[u[l.indexOf(t.key)]]=t.value}),o.margin=c}e&&(delete o.needsEndSpacing,delete o.minorTickColor,delete o.minorTicks,delete o.angularaxis.ticksCount,delete o.angularaxis.ticksCount,delete o.angularaxis.ticksStep,delete o.angularaxis.rewriteTicks,delete o.angularaxis.nticks,delete o.radialaxis.ticksCount,delete o.radialaxis.ticksCount,delete o.radialaxis.ticksStep,delete o.radialaxis.rewriteTicks,delete o.radialaxis.nticks),r.layout=o}return r},t}},{"../../constants/alignment":384,"../../lib":406,d3:79}],493:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=i.extendDeepAll,u=e.exports={};u.framework=function(t){function e(e,i){return i&&(f=i),n.select(n.select(f).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),r=r?l(r,e):e,a||(a=o.Axis()),c=o.adapter.plotly().convert(r),a.config(c).render(f),t.data=r.data,t.layout=r.layout,u.fillLayout(t),r}var r,i,a,c,f,h=new s;return e.isPolar=!0,e.svg=function(){return a.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},e.setUndoPoint=function(){var t=this,e=o.util.cloneJson(r);!function(e,r){h.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,i),i=o.util.cloneJson(e)},e.undo=function(){h.undo()},e.redo=function(){h.redo()},e},u.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),i=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:a.background,_container:e,_paperdiv:r,_paper:i};t._fullLayout=l(o,t.layout)}},{"../../components/color":287,"../../lib":406,"./micropolar":492,"./undo_manager":494,d3:79}],494:[function(t,e,r){"use strict";e.exports=function(){function t(t,e){return t?(i=!0,t[e](),i=!1,this):this}var e,r=[],n=-1,i=!1;return{add:function(t){return i?this:(r.splice(n+1,r.length-n),r.push(t),n=r.length-1,this)},setCallback:function(t){e=t},undo:function(){var i=r[n];return i?(t(i,"undo"),n-=1,e&&e(i.undo),this):this},redo:function(){var i=r[n+1];return i?(t(i,"redo"),n+=1,e&&e(i.redo),this):this},clear:function(){r=[],n=-1},hasUndo:function(){return-1!==n},hasRedo:function(){return n-1}var a=t("../lib"),o=t("../plots/plots"),s=a.extendFlat,l=a.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,a=t.data,u=t.layout,c=l([],a),f=l({},u,n(e.tileClass)),h=t._context||{};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")?"":e.html(t).text()});return e.remove(),r}function i(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}var a=t("d3"),o=t("../lib"),s=t("../components/drawing"),l=t("../components/color"),u=t("../constants/xmlns_namespaces"),c=/"/g,f=new RegExp('("TOBESTRIPPED)|(TOBESTRIPPED")',"g");e.exports=function(t,e,r){var h,d=t._fullLayout,p=d._paper,g=d._toppaper,v=d.width,m=d.height;p.insert("rect",":first-child").call(s.setRect,0,0,v,m).call(l.fill,d.paper_bgcolor);var y=d._basePlotModules||[];for(h=0;h0)s=f(t.alphahull,l);else{var u=["x","y","z"].indexOf(t.delaunayaxis);s=c(l.map(function(t){return[t[(u+1)%3],t[(u+2)%3]]}))}var p={positions:l,cells:s,lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,contourEnable:t.contour.show,contourColor:d(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading};t.intensity?(this.color="#fff",p.vertexIntensity=t.intensity,p.vertexIntensityBounds=[t.cmin,t.cmax],p.colormap=i(t.colorscale)):t.vertexcolor?(this.color=t.vertexcolor[0],p.vertexColors=a(t.vertexcolor)):t.facecolor?(this.color=t.facecolor[0],p.cellColors=a(t.facecolor)):(this.color=t.color,p.meshColor=d(t.color)),this.mesh.update(p)},p.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=s},{"../../lib/str2rgbarray":427,"alpha-shape":14,"convex-hull":70,"delaunay-triangulate":80,"gl-mesh3d":132,tinycolor2:252}],509:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/colorscale/defaults"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,n){return i.coerce(t,e,o,r,n)}function u(t){var e=t.map(function(t){var e=l(t);return e&&Array.isArray(e)?e:null});return e.every(function(t){return t&&t.length===e[0].length})&&e}var c=u(["x","y","z"]),f=u(["i","j","k"]);if(!c)return void(e.visible=!1);f&&f.forEach(function(t){for(var e=0;eg&&d.splice(g,d.length-g),p.length>g&&p.splice(g,p.length-g);var v={padded:!0},m={padded:!0};if(o.hasMarkers(e)){if(r=e.marker,u=r.size,Array.isArray(u)){var y={type:"linear"};i.setConvert(y),u=y.makeCalcdata(e.marker,"size"),u.length>g&&u.splice(g,u.length-g)}var b,x=1.6*(e.marker.sizeref||1);b="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/x),3)}:function(t){return Math.max((t||0)/x,3)},v.ppad=m.ppad=Array.isArray(u)?u.map(b):b(u)}s(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||d[0]===d[g-1]&&p[0]===p[g-1]?e.error_y.visible||-1===["tonexty","tozeroy"].indexOf(e.fill)&&(o.hasMarkers(e)||o.hasText(e))||(v.padded=!1,v.ppad=0):v.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||d[0]===d[g-1]&&p[0]===p[g-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(m.padded=!1):m.tozero=!0,i.expand(f,d,v),i.expand(h,p,m);var _=new Array(g);for(c=0;c=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],516:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l=r.marker,u="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+u).remove(),void 0===l||!l.showscale)return void a.autoMargin(t,u);var c=l.color,f=l.cmin,h=l.cmax;n(f)||(f=i.aggNums(Math.min,null,c)),n(h)||(h=i.aggNums(Math.max,null,c));var d=e[0].t.cb=s(t,u),p=o.makeColorScaleFunc(o.extractScale(l.colorscale,f,h),{noNumericCheck:!0});d.fillcolor(p).filllevels({start:f,end:h,size:(h-f)/254}).options(l.colorbar)()}},{"../../components/colorbar/draw":290,"../../components/colorscale":301,"../../lib":406,"../../plots/plots":488,"fast-isnumeric":87}],517:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),a=t("./subtypes");e.exports=function(t){a.hasLines(t)&&n(t,"line")&&i(t,t.line.color,"line","c"),a.hasMarkers(t)&&(n(t,"marker")&&i(t,t.marker.color,"marker","c"),n(t,"marker.line")&&i(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":293,"../../components/colorscale/has_colorscale":300,"./subtypes":534}],518:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20}},{}],519:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("./constants"),o=t("./subtypes"),s=t("./xy_defaults"),l=t("./marker_defaults"),u=t("./line_defaults"),c=t("./line_shape_defaults"),f=t("./text_defaults"),h=t("./fillcolor_defaults"),d=t("../../components/errorbars/defaults");e.exports=function(t,e,r,p){function g(r,a){return n.coerce(t,e,i,r,a)}var v=s(t,e,p,g),m=vH!=N>=H&&(R=S[L-1][0],I=S[L][0],P=R+(I-R)*(H-O)/(N-O),F=Math.min(F,P),B=Math.max(B,P));F=Math.max(F,0),B=Math.min(B,d._length);var q=s.defaultLine;return s.opacity(h.fillcolor)?q=h.fillcolor:s.opacity((h.line||{}).color)&&(q=h.line.color),n.extendFlat(t,{distance:u+10,x0:F,x1:B,y0:H,y1:H,color:q}),delete t.index,h.text&&!Array.isArray(h.text)?t.text=String(h.text):t.text=h.name,[t]}}}},{"../../components/color":287,"../../components/errorbars":317,"../../components/fx":328,"../../lib":406,"./fill_hover_text":520,"./get_trace_color":522}],524:[function(t,e,r){"use strict";var n={},i=t("./subtypes");n.hasLines=i.hasLines,n.hasMarkers=i.hasMarkers,n.hasText=i.hasText,n.isBubble=i.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","scatter-like"],n.meta={},e.exports=n},{"../../plots/cartesian":458,"./arrays_to_calcdata":512,"./attributes":513,"./calc":514,"./clean_data":515,"./colorbar":516,"./defaults":519,"./hover":523,"./plot":531,"./select":532,"./style":533,"./subtypes":534}],525:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,a,o,s){var l=(t.marker||{}).color;if(o("line.color",r),n(t,"line"))i(t,e,a,o,{prefix:"line.",cLetter:"c"});else{o("line.color",!Array.isArray(l)&&l||r)}o("line.width"),(s||{}).noDash||o("line.dash")}},{"../../components/colorscale/defaults":296,"../../components/colorscale/has_colorscale":300}],526:[function(t,e,r){"use strict";var n=t("../../constants/numerical").BADNUM,i=t("../../lib"),a=i.segmentsIntersect,o=i.constrain,s=t("./constants");e.exports=function(t,e){function r(e){var r=N.c2p(t[e].x),i=D.c2p(t[e].y);return r!==n&&i!==n&&[r,i]}function l(t){var e=t[0]/N._length,r=t[1]/D._length;return(1+s.toleranceGrowth*Math.max(0,-e,e-1,-r,r-1))*F}function u(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function c(t,e){for(var r=[],n=0,i=0;i<4;i++){var o=it[i],s=a(t[0],t[1],e[0],e[1],o[0],o[1],o[2],o[3]);s&&(!n||Math.abs(s.x-r[0][0])>1||Math.abs(s.y-r[0][1])>1)&&(s=[s.x,s.y],n&&u(s,t)et||t[1]nt)return[o(t[0],tt,et),o(t[1],rt,nt)]}function h(t,e){return t[0]===e[0]&&(t[0]===tt||t[0]===et)||(t[1]===e[1]&&(t[1]===rt||t[1]===nt)||void 0)}function d(t,e){var r=[],n=f(t),i=f(e);return n&&i&&h(n,i)?r:(n&&r.push(n),i&&r.push(i),r)}function p(t,e,r){return function(n,a){var o=f(n),s=f(a),l=[];if(o&&s&&h(o,s))return l;o&&l.push(o),s&&l.push(s);var u=2*i.constrain((n[t]+a[t])/2,e,r)-((o||n)[t]+(s||a)[t]);if(u){var c;c=o&&s?u>0==o[t]>s[t]?o:s:o||s,c[t]+=u}return l}}function g(t,e){var r=e[0]-t[0],n=(e[1]-t[1])/r;return(t[1]*e[0]-e[1]*t[0])/r>0?[n>0?tt:et,nt]:[n>0?et:tt,rt]}function v(t){var e=t[0],r=t[1],n=e===q[G-1][0],i=r===q[G-1][1];if(!n||!i)if(G>1){var a=e===q[G-2][0],o=r===q[G-2][1];n&&(e===tt||e===et)&&a?o?G--:q[G-1]=t:i&&(r===rt||r===nt)&&o?a?G--:q[G-1]=t:q[G++]=t}else q[G++]=t}function m(t){q[G-1][0]!==t[0]&&q[G-1][1]!==t[1]&&v([Y,Z]),v(t),Q=null,Y=Z=0}function y(t){if(X=t[0]et?et:0,W=t[1]nt?nt:0,X||W){if(G)if(Q){var e=K(Q,t);e.length>1&&(m(e[0]),q[G++]=e[1])}else $=K(q[G-1],t)[0],q[G++]=$;else q[G++]=[X||t[0],W||t[1]];var r=q[G-1];X&&W&&(r[0]!==X||r[1]!==W)?(Q&&(Y!==X&&Z!==W?v(Y&&Z?g(Q,t):[Y||X,Z||W]):Y&&Z&&v([Y,Z])),v([X,W])):Y-X&&Z-W&&v([X||Y,W||Z]),Q=t,Y=X,Z=W}else Q&&m(K(Q,t)[0]),q[G++]=t}var b,x,_,w,M,A,k,T,E,L,C,S,P,R,I,O,N=e.xaxis,D=e.yaxis,z=e.simplify,j=e.connectGaps,F=e.baseTolerance,B=e.shape,U="linear"===B,V=[],H=s.minTolerance,q=new Array(t.length),G=0;z||(F=H=-1);var X,W,Y,Z,Q,$,K,J=s.maxScreensAway,tt=-N._length*J,et=N._length*(1+J),rt=-D._length*J,nt=D._length*(1+J),it=[[tt,rt,et,rt],[et,rt,et,nt],[et,nt,tt,nt],[tt,nt,tt,rt]];for("linear"===B||"spline"===B?K=c:"hv"===B||"vh"===B?K=d:"hvh"===B?K=p(0,tt,et):"vhv"===B&&(K=p(1,rt,nt)),b=0;bl(A))break;_=A,P=E[0]*T[0]+E[1]*T[1],P>C?(C=P,w=A,k=!1):P=t.length||!A)break;y(A),x=A}}else y(w)}Q&&v([Y||Q[0],Z||Q[1]]),V.push(q.slice(0,G))}return V}},{"../../constants/numerical":388,"../../lib":406,"./constants":518}],527:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],528:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n,i,a=null,o=0;o0?Math.max(e,i):0}}},{"fast-isnumeric":87}],530:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,u){var c,f=o.isBubble(t),h=(t.line||{}).color;if(u=u||{},h&&(r=h),l("marker.symbol"),l("marker.opacity",f?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noLine||(c=h&&!Array.isArray(h)&&e.marker.color!==h?h:f?n.background:n.defaultLine,l("marker.line.color",c),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",f?1:0)),f&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),u.gradient){"none"!==l("marker.gradient.type")&&l("marker.gradient.color")}}},{"../../components/color":287,"../../components/colorscale/defaults":296,"../../components/colorscale/has_colorscale":300,"./subtypes":534}],531:[function(t,e,r){"use strict";function n(t,e,r){var n;e.selectAll("g.trace").each(function(t){var e=o.select(this);if(n=t[0].trace,n._nexttrace){if(n._nextFill=e.select(".js-fill.js-tonext"),!n._nextFill.size()){var i=":first-child";e.select(".js-fill.js-tozero").size()&&(i+=" + *"),n._nextFill=e.insert("path",i).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),n._nextFill=null;n.fill&&("tozero"===n.fill.substr(0,6)||"toself"===n.fill||"to"===n.fill.substr(0,2)&&!n._prevtrace)?(n._ownFill=e.select(".js-fill.js-tozero"),n._ownFill.size()||(n._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),n._ownFill=null),e.selectAll(".js-fill").call(l.setClipUrl,r.layerClipId)})}function i(t,e,r,n,i,h,p){function g(t){return M?t.transition():t}function v(t){return t.filter(function(t){return t.vis})}function m(t){return t.id}function y(t){if(t.ids)return m}function b(){return!1}function x(e){var n,i,a,u=e[0].trace,f=o.select(this),h=c.hasMarkers(u),d=c.hasText(u),p=y(u),m=b,x=b;h&&(m=u.marker.maxdisplayed||u._needsCull?v:s.identity),d&&(x=u.marker.maxdisplayed||u._needsCull?v:s.identity),i=f.selectAll("path.point"),n=i.data(m,p);var _=n.enter().append("path").classed("point",!0) -;M&&_.call(l.pointStyle,u,t).call(l.translatePoints,A,k).style("opacity",0).transition().style("opacity",1);var w=h&&l.tryColorscale(u.marker,""),T=h&&l.tryColorscale(u.marker,"line");n.order(),n.each(function(e){var n=o.select(this),i=g(n);a=l.translatePoint(e,i,A,k),a?(l.singlePointStyle(e,i,u,w,T,t),r.layerClipId&&l.hideOutsideRangePoint(e,i,A,k),u.customdata&&n.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):i.remove()}),M?n.exit().transition().style("opacity",0).remove():n.exit().remove(),i=f.selectAll("g"),n=i.data(x,p),n.enter().append("g").classed("textpoint",!0).append("text"),n.order(),n.each(function(t){var e=o.select(this),n=g(e.select("text"));a=l.translatePoint(t,n,A,k),a?r.layerClipId&&l.hideOutsideRangePoint(t,e,A,k):e.remove()}),n.selectAll("text").call(l.textPointStyle,u,t).each(function(t){var e=A.c2p(t.x),r=k.c2p(t.y);o.select(this).selectAll("tspan.line").each(function(){g(o.select(this)).attr({x:e,y:r})})}),n.exit().remove()}var _,w;a(t,e,r,n,i);var M=!!p&&p.duration>0,A=r.xaxis,k=r.yaxis,T=n[0].trace,E=T.line,L=o.select(h);if(L.call(u.plot,r,p),!0===T.visible){g(L).style("opacity",T.opacity);var C,S,P=T.fill.charAt(T.fill.length-1);"x"!==P&&"y"!==P&&(P=""),n[0].node3=L;var R="",I=[],O=T._prevtrace;O&&(R=O._prevRevpath||"",S=O._nextFill,I=O._polygons);var N,D,z,j,F,B,U,V,H,q="",G="",X=[],W=s.noop;if(C=T._ownFill,c.hasLines(T)||"none"!==T.fill){for(S&&S.datum(n),-1!==["hv","vh","hvh","vhv"].indexOf(E.shape)?(z=l.steps(E.shape),j=l.steps(E.shape.split("").reverse().join(""))):z=j="spline"===E.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),E.smoothing):l.smoothopen(t,E.smoothing)}:function(t){return"M"+t.join("L")},F=function(t){return j(t.reverse())},X=f(n,{xaxis:A,yaxis:k,connectGaps:T.connectgaps,baseTolerance:Math.max(E.width||1,3)/4,shape:E.shape,simplify:E.simplify}),H=T._polygons=new Array(X.length),w=0;w1){var r=o.select(this);if(r.datum(n),t)g(r.style("opacity",0).attr("d",N).call(l.lineGroupStyle)).style("opacity",1);else{var i=g(r);i.attr("d",N),l.singleLineStyle(n,i)}}}}}var Y=L.selectAll(".js-line").data(X);g(Y.exit()).style("opacity",0).remove(),Y.each(W(!1)),Y.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(W(!0)),l.setClipUrl(Y,r.layerClipId),X.length&&(C?B&&V&&(P?("y"===P?B[1]=V[1]=k.c2p(0,!0):"x"===P&&(B[0]=V[0]=A.c2p(0,!0)),g(C).attr("d","M"+V+"L"+B+"L"+q.substr(1)).call(l.singleFillStyle)):g(C).attr("d",q+"Z").call(l.singleFillStyle)):"tonext"===T.fill.substr(0,6)&&q&&R&&("tonext"===T.fill?g(S).attr("d",q+"Z"+R+"Z").call(l.singleFillStyle):g(S).attr("d",q+"L"+R.substr(1)+"Z").call(l.singleFillStyle),T._polygons=T._polygons.concat(I)),T._prevRevpath=G,T._prevPolygons=H);var Z=L.selectAll(".points");_=Z.data([n]),Z.each(x),_.enter().append("g").classed("points",!0).each(x),_.exit().remove(),_.each(function(t){var e=!1===t[0].trace.cliponaxis;l.setClipUrl(o.select(this),e?null:r.layerClipId)})}}function a(t,e,r,n,i){var a=r.xaxis,l=r.yaxis,u=o.extent(s.simpleMap(a.range,a.r2c)),f=o.extent(s.simpleMap(l.range,l.r2c)),h=n[0].trace;if(c.hasMarkers(h)){var d=h.marker.maxdisplayed;if(0!==d){var p=n.filter(function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=f[0]&&t.y<=f[1]}),g=Math.ceil(p.length/d),v=0;i.forEach(function(t,r){var n=t[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;for(c=p.selectAll("g.trace"),f=c.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,e),l=0,u={};lu[e[0].trace.uid]?1:-1}),v){s&&(d=s());o.transition().duration(a.duration).ease(a.easing).each("end",function(){d&&d()}).each("interrupt",function(){d&&d()}).each(function(){p.selectAll("g.trace").each(function(n,o){i(t,o,e,n,r,this,a)})})}else p.selectAll("g.trace").each(function(n,o){i(t,o,e,n,r,this,a)});g&&f.exit().remove(),p.selectAll("path:not([d])").remove()}},{"../../components/drawing":311,"../../components/errorbars":317,"../../lib":406,"../../lib/polygon":417,"./line_points":526,"./link_traces":528,"./subtypes":534,d3:79}],532:[function(t,e,r){"use strict";var n=t("./subtypes"),i=t("../../constants/interactions").DESELECTDIM;e.exports=function(t,e){var r,a,o,s,l=t.cd,u=t.xaxis,c=t.yaxis,f=[],h=l[0].trace,d=h.marker,p=!n.hasMarkers(h)&&!n.hasText(h);if(!0!==h.visible||p)return[];var g=Array.isArray(d.opacity)?1:d.opacity;if(!1===e)for(r=0;r=0&&(e[1]+=1),t.indexOf("top")>=0&&(e[1]-=1),t.indexOf("left")>=0&&(e[0]-=1),t.indexOf("right")>=0&&(e[0]+=1),e)}function s(t,e){return e(4*t)}function l(t){return M[t]}function u(t,e,r,n,i){var a=null;if(Array.isArray(t)){a=[];for(var o=0;o=0){var h=i(l.position,l.delaunayColor,l.delaunayAxis);h.opacity=t.opacity,this.delaunayMesh?this.delaunayMesh.update(h):(h.gl=o,this.delaunayMesh=v(h),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},k.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())},e.exports=h},{"../../constants/gl3d_dashes":385,"../../constants/gl3d_markers":386,"../../lib":406,"../../lib/gl_format_color":403,"../../lib/str2rgbarray":427,"../scatter/make_bubble_size_func":529,"./calc_errors":539,"delaunay-triangulate":80,"gl-error3d":103,"gl-line3d":109,"gl-mesh3d":132,"gl-scatter3d":138}],541:[function(t,e,r){"use strict";function n(t,e,r,n){var a=0,o=r("x"),s=r("y"),l=r("z");return i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],n),o&&s&&l&&(a=Math.min(o.length,s.length,l.length),a=0&&h("surfacecolor",d||p);for(var g=["x","y","z"],v=0;v<3;++v){var m="projection."+g[v];h(m+".show")&&(h(m+".opacity"),h(m+".scale"))}c(t,e,r,{axis:"z"}),c(t,e,r,{axis:"y",inherit:"z"}),c(t,e,r,{axis:"x",inherit:"z"})}},{"../../components/errorbars/defaults":316,"../../lib":406,"../../registry":496,"../scatter/line_defaults":525,"../scatter/marker_defaults":530,"../scatter/subtypes":534,"../scatter/text_defaults":535,"./attributes":537}],542:[function(t,e,r){"use strict";var n={};n.plot=t("./convert"),n.attributes=t("./attributes"),n.markerSymbols=t("../../constants/gl3d_markers"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.moduleType="trace",n.name="scatter3d",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../constants/gl3d_markers":386,"../../plots/gl3d":475,"../scatter/colorbar":516,"./attributes":537,"./calc":538,"./convert":540,"./defaults":541}],543:[function(t,e,r){"use strict";function n(t){return{valType:"boolean",dflt:!1}}function i(t){return{show:{valType:"boolean",dflt:!1},project:{x:n("x"),y:n("y"),z:n("z")},color:{valType:"color",dflt:a.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:a.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var a=t("../../components/color"),o=t("../../components/colorscale/attributes"),s=t("../../components/colorbar/attributes"),l=t("../../lib/extend").extendFlat,u=t("../../plot_api/edit_types").overrideAll,c=e.exports=u({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"data_array"},surfacecolor:{valType:"data_array"},cauto:o.zauto,cmin:o.zmin,cmax:o.zmax,colorscale:o.colorscale,autocolorscale:l({},o.autocolorscale,{dflt:!1}),reversescale:o.reversescale,showscale:o.showscale,colorbar:s,contours:{x:i("x"),y:i("y"),z:i("z")},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},_deprecated:{zauto:l({},o.zauto,{}),zmin:l({},o.zmin,{}),zmax:l({},o.zmax,{})}},"calc","nested");c.x.editType=c.y.editType=c.z.editType="calc+clearAxisTypes"},{"../../components/color":287,"../../components/colorbar/attributes":288,"../../components/colorscale/attributes":292,"../../lib/extend":398,"../../plot_api/edit_types":432}],544:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.surfacecolor?n(e,e.surfacecolor,"","c"):n(e,e.z,"","c")}},{"../../components/colorscale/calc":293}],545:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l="cb"+r.uid,u=r.cmin,c=r.cmax,f=r.surfacecolor||r.z;if(n(u)||(u=i.aggNums(Math.min,null,f)),n(c)||(c=i.aggNums(Math.max,null,f)),t._fullLayout._infolayer.selectAll("."+l).remove(),!r.showscale)return void a.autoMargin(t,l);var h=e[0].t.cb=s(t,l),d=o.makeColorScaleFunc(o.extractScale(r.colorscale,u,c),{noNumericCheck:!0});h.fillcolor(d).filllevels({start:u,end:c,size:(c-u)/254}).options(r.colorbar)()}},{"../../components/colorbar/draw":290,"../../components/colorscale":301,"../../lib":406,"../../plots/plots":488,"fast-isnumeric":87}],546:[function(t,e,r){"use strict";function n(t,e,r){this.scene=t,this.uid=r,this.surface=e,this.data=null,this.showContour=[!1,!1,!1],this.dataScale=1}function i(t,e){return void 0===e&&(e=1),t.map(function(t){var r=t[0],n=p(t[1]),i=n.toRgb();return{index:r,rgb:[i.r,i.g,i.b,e]}})}function a(t){var e=t[0].rgb,r=t[t.length-1].rgb;return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]}function o(t){var e=t.shape,r=[e[0]+2,e[1]+2],n=c(new Float32Array(r[0]*r[1]),r);return d.assign(n.lo(1,1).hi(e[0],e[1]),t),d.assign(n.lo(1).hi(e[0],1),t.hi(e[0],1)),d.assign(n.lo(1,r[1]-1).hi(e[0],1),t.lo(0,e[1]-1).hi(e[0],1)),d.assign(n.lo(0,1).hi(1,e[1]),t.hi(1)),d.assign(n.lo(r[0]-1,1).hi(1,e[1]),t.lo(e[0]-1)),n.set(0,0,t.get(0,0)),n.set(0,r[1]-1,t.get(0,e[1]-1)),n.set(r[0]-1,0,t.get(e[0]-1,0)),n.set(r[0]-1,r[1]-1,t.get(e[0]-1,e[1]-1)),n}function s(t){var e=Math.max(t[0].shape[0],t[0].shape[1]);if(e0,A=r.xaxis,k=r.yaxis,T=n[0].trace,E=T.line,L=o.select(h);if(L.call(u.plot,r,p),!0===T.visible){g(L).style("opacity",T.opacity);var C,S,P=T.fill.charAt(T.fill.length-1);"x"!==P&&"y"!==P&&(P=""),n[0].node3=L;var R="",I=[],O=T._prevtrace;O&&(R=O._prevRevpath||"",S=O._nextFill,I=O._polygons);var N,D,z,j,F,B,U,V,H,q="",G="",X=[],W=s.noop;if(C=T._ownFill,c.hasLines(T)||"none"!==T.fill){for(S&&S.datum(n),-1!==["hv","vh","hvh","vhv"].indexOf(E.shape)?(z=l.steps(E.shape),j=l.steps(E.shape.split("").reverse().join(""))):z=j="spline"===E.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),E.smoothing):l.smoothopen(t,E.smoothing)}:function(t){return"M"+t.join("L")},F=function(t){return j(t.reverse())},X=f(n,{xaxis:A,yaxis:k,connectGaps:T.connectgaps,baseTolerance:Math.max(E.width||1,3)/4,shape:E.shape,simplify:E.simplify}),H=T._polygons=new Array(X.length),w=0;w1){var r=o.select(this);if(r.datum(n),t)g(r.style("opacity",0).attr("d",N).call(l.lineGroupStyle)).style("opacity",1);else{var i=g(r);i.attr("d",N),l.singleLineStyle(n,i)}}}}}var Y=L.selectAll(".js-line").data(X);g(Y.exit()).style("opacity",0).remove(),Y.each(W(!1)),Y.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(W(!0)),l.setClipUrl(Y,r.layerClipId),X.length&&(C?B&&V&&(P?("y"===P?B[1]=V[1]=k.c2p(0,!0):"x"===P&&(B[0]=V[0]=A.c2p(0,!0)),g(C).attr("d","M"+V+"L"+B+"L"+q.substr(1)).call(l.singleFillStyle)):g(C).attr("d",q+"Z").call(l.singleFillStyle)):"tonext"===T.fill.substr(0,6)&&q&&R&&("tonext"===T.fill?g(S).attr("d",q+"Z"+R+"Z").call(l.singleFillStyle):g(S).attr("d",q+"L"+R.substr(1)+"Z").call(l.singleFillStyle),T._polygons=T._polygons.concat(I)),T._prevRevpath=G,T._prevPolygons=H);var Z=L.selectAll(".points");_=Z.data([n]),Z.each(x),_.enter().append("g").classed("points",!0).each(x),_.exit().remove(),_.each(function(t){var e=!1===t[0].trace.cliponaxis;l.setClipUrl(o.select(this),e?null:r.layerClipId)})}}function a(t,e,r,n,i){var a=r.xaxis,l=r.yaxis,u=o.extent(s.simpleMap(a.range,a.r2c)),f=o.extent(s.simpleMap(l.range,l.r2c)),h=n[0].trace;if(c.hasMarkers(h)){var d=h.marker.maxdisplayed;if(0!==d){var p=n.filter(function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=f[0]&&t.y<=f[1]}),g=Math.ceil(p.length/d),v=0;i.forEach(function(t,r){var n=t[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;for(c=p.selectAll("g.trace"),f=c.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,e),l=0,u={};lu[e[0].trace.uid]?1:-1}),v){s&&(d=s());o.transition().duration(a.duration).ease(a.easing).each("end",function(){d&&d()}).each("interrupt",function(){d&&d()}).each(function(){p.selectAll("g.trace").each(function(n,o){i(t,o,e,n,r,this,a)})})}else p.selectAll("g.trace").each(function(n,o){i(t,o,e,n,r,this,a)});g&&f.exit().remove(),p.selectAll("path:not([d])").remove()}},{"../../components/drawing":311,"../../components/errorbars":317,"../../lib":406,"../../lib/polygon":417,"./line_points":526,"./link_traces":528,"./subtypes":534,d3:79}],532:[function(t,e,r){"use strict";var n=t("./subtypes"),i=t("../../constants/interactions").DESELECTDIM;e.exports=function(t,e){var r,a,o,s,l=t.cd,u=t.xaxis,c=t.yaxis,f=[],h=l[0].trace,d=h.marker;if(!n.hasMarkers(h)&&!n.hasText(h))return[];var p=Array.isArray(d.opacity)?1:d.opacity;if(!1===e)for(r=0;r=0&&(e[1]+=1),t.indexOf("top")>=0&&(e[1]-=1),t.indexOf("left")>=0&&(e[0]-=1),t.indexOf("right")>=0&&(e[0]+=1),e)}function s(t,e){return e(4*t)}function l(t){return M[t]}function u(t,e,r,n,i){var a=null;if(Array.isArray(t)){a=[];for(var o=0;o=0){var h=i(l.position,l.delaunayColor,l.delaunayAxis);h.opacity=t.opacity,this.delaunayMesh?this.delaunayMesh.update(h):(h.gl=o,this.delaunayMesh=v(h),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},k.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())},e.exports=h},{"../../constants/gl3d_dashes":385,"../../constants/gl3d_markers":386,"../../lib":406,"../../lib/gl_format_color":403,"../../lib/str2rgbarray":427,"../scatter/make_bubble_size_func":529,"./calc_errors":539,"delaunay-triangulate":80,"gl-error3d":103,"gl-line3d":109,"gl-mesh3d":132,"gl-scatter3d":138}],541:[function(t,e,r){"use strict";function n(t,e,r,n){var a=0,o=r("x"),s=r("y"),l=r("z");return i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],n),o&&s&&l&&(a=Math.min(o.length,s.length,l.length),a=0&&h("surfacecolor",d||p);for(var g=["x","y","z"],v=0;v<3;++v){var m="projection."+g[v];h(m+".show")&&(h(m+".opacity"),h(m+".scale"))}c(t,e,r,{axis:"z"}),c(t,e,r,{axis:"y",inherit:"z"}),c(t,e,r,{axis:"x",inherit:"z"})}},{"../../components/errorbars/defaults":316,"../../lib":406,"../../registry":496,"../scatter/line_defaults":525,"../scatter/marker_defaults":530,"../scatter/subtypes":534,"../scatter/text_defaults":535,"./attributes":537}],542:[function(t,e,r){"use strict";var n={};n.plot=t("./convert"),n.attributes=t("./attributes"),n.markerSymbols=t("../../constants/gl3d_markers"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.moduleType="trace",n.name="scatter3d",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../constants/gl3d_markers":386,"../../plots/gl3d":475,"../scatter/colorbar":516,"./attributes":537,"./calc":538,"./convert":540,"./defaults":541}],543:[function(t,e,r){"use strict";function n(t){return{valType:"boolean",dflt:!1}}function i(t){return{show:{valType:"boolean",dflt:!1},project:{x:n("x"),y:n("y"),z:n("z")},color:{valType:"color",dflt:a.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:a.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var a=t("../../components/color"),o=t("../../components/colorscale/attributes"),s=t("../../components/colorbar/attributes"),l=t("../../lib/extend").extendFlat,u=t("../../plot_api/edit_types").overrideAll,c=e.exports=u({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"data_array"},surfacecolor:{valType:"data_array"},cauto:o.zauto,cmin:o.zmin,cmax:o.zmax,colorscale:o.colorscale,autocolorscale:l({},o.autocolorscale,{dflt:!1}),reversescale:o.reversescale,showscale:o.showscale,colorbar:s,contours:{x:i("x"),y:i("y"),z:i("z")},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},_deprecated:{zauto:l({},o.zauto,{}),zmin:l({},o.zmin,{}),zmax:l({},o.zmax,{})}},"calc","nested");c.x.editType=c.y.editType=c.z.editType="calc+clearAxisTypes"},{"../../components/color":287,"../../components/colorbar/attributes":288,"../../components/colorscale/attributes":292,"../../lib/extend":398,"../../plot_api/edit_types":432}],544:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.surfacecolor?n(e,e.surfacecolor,"","c"):n(e,e.z,"","c")}},{"../../components/colorscale/calc":293}],545:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l="cb"+r.uid,u=r.cmin,c=r.cmax,f=r.surfacecolor||r.z;if(n(u)||(u=i.aggNums(Math.min,null,f)),n(c)||(c=i.aggNums(Math.max,null,f)),t._fullLayout._infolayer.selectAll("."+l).remove(),!r.showscale)return void a.autoMargin(t,l);var h=e[0].t.cb=s(t,l),d=o.makeColorScaleFunc(o.extractScale(r.colorscale,u,c),{noNumericCheck:!0});h.fillcolor(d).filllevels({start:u,end:c,size:(c-u)/254}).options(r.colorbar)()}},{"../../components/colorbar/draw":290,"../../components/colorscale":301,"../../lib":406,"../../plots/plots":488,"fast-isnumeric":87}],546:[function(t,e,r){"use strict";function n(t,e,r){this.scene=t,this.uid=r,this.surface=e,this.data=null,this.showContour=[!1,!1,!1],this.dataScale=1}function i(t,e){return void 0===e&&(e=1),t.map(function(t){var r=t[0],n=p(t[1]),i=n.toRgb();return{index:r,rgb:[i.r,i.g,i.b,e]}})}function a(t){var e=t[0].rgb,r=t[t.length-1].rgb;return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]}function o(t){var e=t.shape,r=[e[0]+2,e[1]+2],n=c(new Float32Array(r[0]*r[1]),r);return d.assign(n.lo(1,1).hi(e[0],e[1]),t),d.assign(n.lo(1).hi(e[0],1),t.hi(e[0],1)),d.assign(n.lo(1,r[1]-1).hi(e[0],1),t.lo(0,e[1]-1).hi(e[0],1)),d.assign(n.lo(0,1).hi(1,e[1]),t.hi(1)),d.assign(n.lo(r[0]-1,1).hi(1,e[1]),t.lo(e[0]-1)),n.set(0,0,t.get(0,0)),n.set(0,r[1]-1,t.get(0,e[1]-1)),n.set(r[0]-1,0,t.get(e[0]-1,0)),n.set(r[0]-1,r[1]-1,t.get(e[0]-1,e[1]-1)),n}function s(t){var e=Math.max(t[0].shape[0],t[0].shape[1]);if(e=2/3},n.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},n.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3},n.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3}},{}],285:[function(t,e,n){"use strict";var r=t("../../plots/font_attributes"),i=t("../color/attributes");e.exports={bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:i.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:r({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},x:{valType:"number",min:-2,max:3,dflt:1.02,editType:"legend"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",min:-2,max:3,dflt:1,editType:"legend"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"legend"},editType:"legend"}},{"../../plots/font_attributes":414,"../color/attributes":233}],286:[function(t,e,n){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],287:[function(t,e,n){"use strict";var r=t("../../registry"),i=t("../../lib"),a=t("./attributes"),o=t("../../plots/layout_attributes"),s=t("./helpers");e.exports=function(t,e,n){function l(t,e){return i.coerce(d,p,a,t,e)}for(var u,c,f,h,d=t.legend||{},p=e.legend={},m=0,g="normal",y=0;y1)){if(l("bgcolor",e.paper_bgcolor),l("bordercolor"),l("borderwidth"),i.coerceFont(l,"font",e.font),l("orientation"),"h"===p.orientation){var x=t.xaxis;x&&x.rangeslider&&x.rangeslider.visible?(u=0,f="left",c=1.1,h="bottom"):(u=0,f="left",c=-.1,h="top")}l("traceorder",g),s.isGrouped(e.legend)&&l("tracegroupgap"),l("x",u),l("xanchor",f),l("y",c),l("yanchor",h),i.noneOrAll(d,p,["x","y"])}}},{"../../lib":350,"../../plots/layout_attributes":417,"../../registry":434,"./attributes":285,"./helpers":291}],288:[function(t,e,n){"use strict";function r(t,e){function n(n){y.convertToTspans(n,e,function(){a(t,e)})}var r=t.data()[0][0],i=e._fullLayout,o=r.trace,s=d.traceIs(o,"pie"),l=o.index,u=s?r.label:o.name,h=t.selectAll("text.legendtext").data([0]);h.enter().append("text").classed("legendtext",!0),h.attr("text-anchor","start").classed("user-select-none",!0).call(m.font,i.legend.font).text(u),e._context.edits.legendText&&!s?h.call(y.makeEditable,{gd:e}).call(n).on("edit",function(t){this.text(t).call(n);var i=t;this.text()||(t=" ");var a,o,s=r.trace._fullInput||{},u={};if(-1!==["ohlc","candlestick"].indexOf(s.type))a=r.trace.transforms,o=a[a.length-1].direction,u[o+".name"]=t;else if(d.hasTransform(s,"groupby")){var h=d.getTransformIndices(s,"groupby"),p=h[h.length-1],m=f.keyedContainer(s,"transforms["+p+"].styles","target","value.name");""===i?m.remove(r.trace._group):m.set(r.trace._group,t),u=m.constructUpdate()}else u.name=t;return c.restyle(e,u,l)}):h.call(n)}function i(t,e){var n,r=1,i=t.selectAll("rect").data([0]);i.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(g.fill,"rgba(0,0,0,0)"),i.on("mousedown",function(){n=(new Date).getTime(),n-e._legendMouseDownTimeA&&(r=Math.max(r-1,1)),1===r?n._clickTimeout=setTimeout(function(){v(t,e,r)},A):2===r&&(n._clickTimeout&&clearTimeout(n._clickTimeout),e._legendMouseDownTime=0,v(t,e,r))}})}function a(t,e){var n=t.data()[0][0];if(!n.trace.showlegend)return void t.remove();var r,i,a=t.select("g[class*=math-group]"),o=a.node(),s=e._fullLayout.legend,l=s.font.size*b;if(o){var u=m.bBox(o);r=u.height,i=u.width,m.setTranslate(a,0,r/4)}else{var c=t.select(".legendtext"),f=y.lineCount(c),h=c.node();r=l*f,i=h?m.bBox(h).width:0;var d=l*(.3+(1-f)/2);y.positionText(c,40,d)}r=Math.max(r,16)+3,n.height=r,n.width=i}function o(t,e,n){var r=t._fullLayout,i=r.legend,a=i.borderwidth,o=T.isGrouped(i),s=0;if(i.width=0,i.height=0,T.isVertical(i))o&&e.each(function(t,e){m.setTranslate(this,0,e*i.tracegroupgap)}),n.each(function(t){var e=t[0],n=e.height,r=e.width;m.setTranslate(this,a,5+a+i.height+n/2),i.height+=n,i.width=Math.max(i.width,r)}),i.width+=45+2*a,i.height+=10+2*a,o&&(i.height+=(i._lgroupsLength-1)*i.tracegroupgap),s=40;else if(o){for(var l=[i.width],c=e.data(),f=0,h=c.length;fr.width-(r.margin.r+r.margin.l)&&(x=0,g+=y,i.height=i.height+y,y=0),m.setTranslate(this,a+x,5+a+e.height/2+g),i.width+=o+n,i.height=Math.max(i.height,e.height),x+=o+n,y=Math.max(e.height,y)}),i.width+=2*a,i.height+=10+2*a}i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),n.each(function(e){var n=e[0];u.select(this).select(".legendtoggle").call(m.setRect,0,-n.height/2,(t._context.edits.legendText?0:i.width)+s,n.height)})}function s(t){var e=t._fullLayout,n=e.legend,r="left";k.isRightAnchor(n)?r="right":k.isCenterAnchor(n)&&(r="center");var i="top";k.isBottomAnchor(n)?i="bottom":k.isMiddleAnchor(n)&&(i="middle"),h.autoMargin(t,"legend",{x:n.x,y:n.y,l:n.width*({right:1,center:.5}[r]||0),r:n.width*({left:1,center:.5}[r]||0),b:n.height*({top:1,middle:.5}[i]||0),t:n.height*({bottom:1,middle:.5}[i]||0)})}function l(t){var e=t._fullLayout,n=e.legend,r="left";k.isRightAnchor(n)?r="right":k.isCenterAnchor(n)&&(r="center"),h.autoMargin(t,"legend",{x:n.x,y:.5,l:n.width*({right:1,center:.5}[r]||0),r:n.width*({left:1,center:.5}[r]||0),b:0,t:0})}var u=t("d3"),c=t("../../plotly"),f=t("../../lib"),h=t("../../plots/plots"),d=t("../../registry"),p=t("../dragelement"),m=t("../drawing"),g=t("../color"),y=t("../../lib/svg_text_utils"),v=t("./handle_click"),x=t("./constants"),_=t("../../constants/interactions"),b=t("../../constants/alignment").LINE_SPACING,w=t("./get_legend_data"),M=t("./style"),T=t("./helpers"),k=t("./anchor_utils"),A=_.DBLCLICKDELAY;e.exports=function(t){function e(t,e){L.attr("data-scroll",e).call(m.setTranslate,0,e),z.call(m.setRect,N,t,x.scrollBarWidth,x.scrollBarHeight),S.select("rect").attr({y:y.borderwidth-e})}var n=t._fullLayout,a="legend"+n._uid;if(n._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var y=n.legend,_=n.showlegend&&w(t.calcdata,y),b=n.hiddenlabels||[];if(!n.showlegend||!_.length)return n._infolayer.selectAll(".legend").remove(),n._topdefs.select("#"+a).remove(),void h.autoMargin(t,"legend");var T=n._infolayer.selectAll("g.legend").data([0]);T.enter().append("g").attr({class:"legend","pointer-events":"all"});var S=n._topdefs.selectAll("#"+a).data([0]);S.enter().append("clipPath").attr("id",a).append("rect");var E=T.selectAll("rect.bg").data([0]);E.enter().append("rect").attr({class:"bg","shape-rendering":"crispEdges"}),E.call(g.stroke,y.bordercolor),E.call(g.fill,y.bgcolor),E.style("stroke-width",y.borderwidth+"px");var L=T.selectAll("g.scrollbox").data([0]);L.enter().append("g").attr("class","scrollbox");var z=T.selectAll("rect.scrollbar").data([0]);z.enter().append("rect").attr({class:"scrollbar",rx:20,ry:2,width:0,height:0}).call(g.fill,"#808BA4");var I=L.selectAll("g.groups").data(_);I.enter().append("g").attr("class","groups"),I.exit().remove();var D=I.selectAll("g.traces").data(f.identity);D.enter().append("g").attr("class","traces"),D.exit().remove(),D.call(M,t).style("opacity",function(t){var e=t[0].trace;return d.traceIs(e,"pie")?-1!==b.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){u.select(this).call(r,t).call(i,t)});var C=0!==T.enter().size();C&&(o(t,I,D),s(t));var P=n.width,O=n.height;o(t,I,D),y.height>O?l(t):s(t);var F=n._size,R=F.l+F.w*y.x,j=F.t+F.h*(1-y.y);k.isRightAnchor(y)?R-=y.width:k.isCenterAnchor(y)&&(R-=y.width/2),k.isBottomAnchor(y)?j-=y.height:k.isMiddleAnchor(y)&&(j-=y.height/2);var N=y.width,B=F.w;N>B?(R=F.l,N=B):(R+N>P&&(R=P-N),R<0&&(R=0),N=Math.min(P-R,y.width));var V=y.height,q=F.h;V>q?(j=F.t,V=q):(j+V>O&&(j=O-V),j<0&&(j=0),V=Math.min(O-j,y.height)),m.setTranslate(T,R,j);var U,G,H=V-x.scrollBarHeight-2*x.scrollBarMargin,Z=y.height-V;if(y.height<=V||t._context.staticPlot)E.attr({width:N-y.borderwidth,height:V-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),m.setTranslate(L,0,0),S.select("rect").attr({width:N-2*y.borderwidth,height:V-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth}),L.call(m.setClipUrl,a);else{U=x.scrollBarMargin,G=L.attr("data-scroll")||0,E.attr({width:N-2*y.borderwidth+x.scrollBarWidth+x.scrollBarMargin,height:V-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),S.select("rect").attr({width:N-2*y.borderwidth+x.scrollBarWidth+x.scrollBarMargin,height:V-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth-G}),L.call(m.setClipUrl,a),C&&e(U,G),T.on("wheel",null),T.on("wheel",function(){G=f.constrain(L.attr("data-scroll")-u.event.deltaY/H*Z,-Z,0),U=x.scrollBarMargin-G/Z*H,e(U,G),0!==G&&G!==-Z&&u.event.preventDefault()}),z.on(".drag",null),L.on(".drag",null);var X=u.behavior.drag().on("drag",function(){U=f.constrain(u.event.y-x.scrollBarHeight/2,x.scrollBarMargin,x.scrollBarMargin+H),G=-(U-x.scrollBarMargin)/H*Z,e(U,G)});z.call(X),L.call(X)}if(t._context.edits.legendPosition){var Y,W,Q,J;T.classed("cursor-move",!0),p.init({element:T.node(),gd:t,prepFn:function(){var t=m.getTranslate(T);Q=t.x,J=t.y},moveFn:function(t,e){var n=Q+t,r=J+e;m.setTranslate(T,n,r),Y=p.align(n,0,F.l,F.l+F.w,y.xanchor),W=p.align(r,0,F.t+F.h,F.t,y.yanchor)},doneFn:function(e,r,i){if(e&&void 0!==Y&&void 0!==W)c.relayout(t,{"legend.x":Y,"legend.y":W});else{var a=n._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return i.clientX>=t.left&&i.clientX<=t.right&&i.clientY>=t.top&&i.clientY<=t.bottom});a.size()>0&&(1===r?T._clickTimeout=setTimeout(function(){v(a,t,r)},A):2===r&&(T._clickTimeout&&clearTimeout(T._clickTimeout),v(a,t,r)))}}})}}}},{"../../constants/alignment":331,"../../constants/interactions":332,"../../lib":350,"../../lib/svg_text_utils":370,"../../plotly":385,"../../plots/plots":426,"../../registry":434,"../color":234,"../dragelement":255,"../drawing":258,"./anchor_utils":284,"./constants":286,"./get_legend_data":289,"./handle_click":290,"./helpers":291,"./style":293,d3:8}],289:[function(t,e,n){"use strict";var r=t("../../registry"),i=t("./helpers");e.exports=function(t,e){function n(t,n){if(""!==t&&i.isGrouped(e))-1===l.indexOf(t)?(l.push(t),u=!0,s[t]=[[n]]):s[t].push([n]);else{var r="~~i"+f;l.push(r),s[r]=[[n]],f++}}var a,o,s={},l=[],u=!1,c={},f=0;for(a=0;an[1])return n[1]}return i}function i(t){return t[0]}var s,u,c=t[0],f=c.trace,h=l.hasMarkers(f),d=l.hasText(f),p=l.hasLines(f);if(h||d||p){var m={},g={};h&&(m.mc=n("marker.color",i),m.mo=n("marker.opacity",a.mean,[.2,1]),m.ms=n("marker.size",a.mean,[2,16]),m.mlc=n("marker.line.color",i),m.mlw=n("marker.line.width",a.mean,[0,5]),g.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),p&&(g.line={width:n("line.width",i,[0,10])}),d&&(m.tx="Aa",m.tp=n("textposition",i),m.ts=10,m.tc=n("textfont.color",i),m.tf=n("textfont.family",i)),s=[a.minExtend(c,m)],u=a.minExtend(f,g)}var y=r.select(this).select("g.legendpoints"),v=y.selectAll("path.scatterpts").data(h?s:[]);v.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),v.exit().remove(),v.call(o.pointStyle,u,e),h&&(s[0].mrc=3);var x=y.selectAll("g.pointtext").data(d?s:[]);x.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),x.exit().remove(),x.selectAll("text").call(o.textPointStyle,u,e)}function f(t){var e=t[0].trace,n=e.marker||{},a=n.line||{},o=r.select(this).select("g.legendpoints").selectAll("path.legendbar").data(i.traceIs(e,"bar")?[t]:[]);o.enter().append("path").classed("legendbar",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),o.exit().remove(),o.each(function(t){var e=r.select(this),i=t[0],o=(i.mlw+1||a.width+1)-1;e.style("stroke-width",o+"px").call(s.fill,i.mc||n.color),o&&e.call(s.stroke,i.mlc||a.color)})}function h(t){var e=t[0].trace,n=r.select(this).select("g.legendpoints").selectAll("path.legendbox").data(i.traceIs(e,"box")&&e.visible?[t]:[]);n.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),n.exit().remove(),n.each(function(){var t=e.line.width,n=r.select(this);n.style("stroke-width",t+"px").call(s.fill,e.fillcolor),t&&n.call(s.stroke,e.line.color)})}function d(t){var e=t[0].trace,n=r.select(this).select("g.legendpoints").selectAll("path.legendpie").data(i.traceIs(e,"pie")&&e.visible?[t]:[]);n.enter().append("path").classed("legendpie",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),n.exit().remove(),n.size()&&n.call(u,t[0],e)}t.each(function(t){var e=r.select(this),n=e.selectAll("g.layers").data([0]);n.enter().append("g").classed("layers",!0),n.style("opacity",t[0].trace.opacity),n.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),n.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var i=n.selectAll("g.legendsymbols").data([t]);i.enter().append("g").classed("legendsymbols",!0),i.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(f).each(h).each(d).each(n).each(c)}},{"../../lib":350,"../../registry":434,"../../traces/pie/style_one":443,"../../traces/scatter/subtypes":466,"../color":234,"../drawing":258,d3:8}],294:[function(t,e,n){"use strict";function r(t,e){var n,r,i=e.currentTarget,a=i.getAttribute("data-attr"),o=i.getAttribute("data-val")||!0,s=t._fullLayout,l={},u=d.list(t,null,!0),c="on";if("zoom"===a){var h,p="in"===o?.5:2,m=(1+p)/2,g=(1-p)/2;for(r=0;r1)return r(["resetViews","toggleHover"]),o(y,n);c&&(r(["zoom3d","pan3d","orbitRotation","tableRotation"]),r(["resetCameraDefault3d","resetCameraLastSave3d"]),r(["hoverClosest3d"]));var v=i(s),x=[];return((u||p)&&!v||m)&&(x=["zoom2d","pan2d"]),(g||f)&&(x=["pan2d"]),a(l)&&(x.push("select2d"),x.push("lasso2d")),x.length&&r(x),!u&&!p||v||m||r(["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"]),u&&d?r(["toggleHover"]):p?r(["hoverClosestGl2d"]):u?r(["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]):d?r(["hoverClosestPie"]):g?r(["resetViewMapbox","toggleHover"]):f&&(r(["zoomInGeo","zoomOutGeo","resetGeo"]),r(["hoverClosestGeo"])),o(y,n)}function i(t){for(var e=l.list({_fullLayout:t},null,!0),n=!0,r=0;r0)){var p=i(e,n,l);f("x",p[0]),f("y",p[1]),a.noneOrAll(t,e,["x","y"]),f("xanchor"),f("yanchor"),a.coerceFont(f,"font",n.font);var m=f("bgcolor");f("activecolor",o.contrast(m,u.lightAmount,u.darkAmount)),f("bordercolor"),f("borderwidth")}}},{"../../lib":350,"../color":234,"./attributes":298,"./button_attributes":299,"./constants":300}],302:[function(t,e,n){"use strict";function r(t){for(var e=y.list(t,"x",!0),n=[],r=0;rp&&(p=h)));return p>=d?[d,p]:void 0}}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./constants"),s=t("./helpers");e.exports=function(t){var e=t._fullLayout,n=i.filterVisible(e.shapes);if(n.length&&t._fullData.length)for(var s=0;sZ&&r>X&&!t.shiftKey?p.getCursor(i/n,1-a/r):"move";m(e,o),H=o.split("-")[0]}function a(e){N=f.getFromId(t,n.xref),B=f.getFromId(t,n.yref),V=y.getDataToPixel(t,N),q=y.getDataToPixel(t,B,!0),U=y.getPixelToData(t,N),G=y.getPixelToData(t,B,!0);var a="shapes["+r+"]";"path"===n.type?(R=n.path,j=a+".path"):(g=V(n.x0),v=q(n.y0),x=V(n.x1),_=q(n.y1),b=a+".x0",w=a+".y0",M=a+".x1",T=a+".y1"),gX&&(d[L]=n[C]=G(u),d[z]=n[P]=G(c)),h-f>Z&&(d[I]=n[O]=U(f),d[D]=n[F]=U(h))}e.attr("d",o(t,n))}var d,g,v,x,_,b,w,M,T,k,A,S,E,L,z,I,D,C,P,O,F,R,j,N,B,V,q,U,G,H,Z=10,X=10,Y={element:e.node(),gd:t,prepFn:a,doneFn:s},W=Y.element.getBoundingClientRect();p.init(Y),e.node().onmousemove=i}function o(t,e){var n,r,i,a,o=e.type,l=f.getFromId(t,e.xref),u=f.getFromId(t,e.yref),c=t._fullLayout._size;if(l?(n=y.shapePositionToRange(l),r=function(t){return l._offset+l.r2p(n(t,!0))}):r=function(t){return c.l+c.w*t},u?(i=y.shapePositionToRange(u),a=function(t){return u._offset+u.r2p(i(t,!0))}):a=function(t){return c.t+c.h*(1-t)},"path"===o)return l&&"date"===l.type&&(r=y.decodeDate(r)),u&&"date"===u.type&&(a=y.decodeDate(a)),s(e.path,r,a);var h=r(e.x0),d=r(e.x1),p=a(e.y0),m=a(e.y1);if("line"===o)return"M"+h+","+p+"L"+d+","+m;if("rect"===o)return"M"+h+","+p+"H"+d+"V"+m+"H"+h+"Z";var g=(h+d)/2,v=(p+m)/2,x=Math.abs(g-h),_=Math.abs(v-p),b="A"+x+","+_,w=g+x+","+v;return"M"+w+b+" 0 1,1 "+g+","+(v-_)+b+" 0 0,1 "+w+"Z"}function s(t,e,n){return t.replace(g.segmentRE,function(t){var r=0,i=t.charAt(0),a=g.paramIsX[i],o=g.paramIsY[i],s=g.numParams[i],l=t.substr(1).replace(g.paramRE,function(t){return a[r]?t=e(t):o[r]&&(t=n(t)),r++,r>s&&(t="X"),t});return r>s&&(l=l.replace(/[\s,]*X.*/,""),c.log("Ignoring extra params in segment "+t)),i+l})}function l(t,e,n){return t.replace(g.segmentRE,function(t){var r=0,i=t.charAt(0),a=g.paramIsX[i],o=g.paramIsY[i],s=g.numParams[i];return i+t.substr(1).replace(g.paramRE,function(t){return r>=s?t:(a[r]?t=e(t):o[r]&&(t=n(t)),r++,t)})})}var u=t("../../plotly"),c=t("../../lib"),f=t("../../plots/cartesian/axes"),h=t("../color"),d=t("../drawing"),p=t("../dragelement"),m=t("../../lib/setcursor"),g=t("./constants"),y=t("./helpers");e.exports={draw:r,drawOne:i}},{"../../lib":350,"../../lib/setcursor":368,"../../plotly":385,"../../plots/cartesian/axes":390,"../color":234,"../dragelement":255,"../drawing":258,"./constants":313,"./helpers":316}],316:[function(t,e,n){"use strict";n.rangeToShapePosition=function(t){return"log"===t.type?t.r2d:function(t){return t}},n.shapePositionToRange=function(t){return"log"===t.type?t.d2r:function(t){return t}},n.decodeDate=function(t){return function(e){return e.replace&&(e=e.replace("_"," ")),t(e)}},n.encodeDate=function(t){return function(e){return t(e).replace(" ","_")}},n.getDataToPixel=function(t,e,r){var i,a=t._fullLayout._size;if(e){var o=n.shapePositionToRange(e);i=function(t){return e._offset+e.r2p(o(t,!0))},"date"===e.type&&(i=n.decodeDate(i))}else i=r?function(t){return a.t+a.h*(1-t)}:function(t){return a.l+a.w*t};return i},n.getPixelToData=function(t,e,r){var i,a=t._fullLayout._size;if(e){var o=n.rangeToShapePosition(e);i=function(t){return o(e.p2r(t-e._offset))}}else i=r?function(t){return 1-(t-a.t)/a.h}:function(t){return(t-a.l)/a.w};return i}},{}],317:[function(t,e,n){"use strict";var r=t("./draw");e.exports={moduleType:"component",name:"shapes",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:r.draw,drawOne:r.drawOne}},{"./attributes":311,"./calc_autorange":312,"./defaults":314,"./draw":315}],318:[function(t,e,n){"use strict";var r=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./attributes"),o=t("./helpers");e.exports=function(t,e,n,s,l){function u(n,i){return r.coerce(t,e,a,n,i)}if(s=s||{},l=l||{},!u("visible",!l.itemIsNotPlainObject))return e;u("layer"),u("opacity"),u("fillcolor"),u("line.color"),u("line.width"),u("line.dash");for(var c=t.path?"path":"rect",f=u("type",c),h=["x","y"],d=0;d<2;d++){var p=h[d],m={_fullLayout:n},g=i.coerceRef(t,e,m,p,"","paper");if("path"!==f){var y,v,x ;"paper"!==g?(y=i.getFromId(m,g),x=o.rangeToShapePosition(y),v=o.shapePositionToRange(y)):v=x=r.identity;var _=p+"0",b=p+"1",w=t[_],M=t[b];t[_]=v(t[_],!0),t[b]=v(t[b],!0),i.coercePosition(e,m,u,g,_,.25),i.coercePosition(e,m,u,g,b,.75),e[_]=x(e[_]),e[b]=x(e[b]),t[_]=w,t[b]=M}}return"path"===f?u("path"):r.noneOrAll(t,e,["x0","x1","y0","y1"]),e}},{"../../lib":350,"../../plots/cartesian/axes":390,"./attributes":311,"./helpers":316}],319:[function(t,e,n){"use strict";var r=t("../../plots/font_attributes"),i=t("../../plots/pad_attributes"),a=t("../../lib/extend").extendDeepAll,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/animation_attributes"),l=t("./constants"),u={_isLinkedToArray:"step",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}};e.exports=o({_isLinkedToArray:"slider",visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:u,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:a({},i,{},{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:s.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:r({})},font:r({}),activebgcolor:{valType:"color",dflt:l.gripBgActiveColor},bgcolor:{valType:"color",dflt:l.railBgColor},bordercolor:{valType:"color",dflt:l.railBorderColor},borderwidth:{valType:"number",min:0,dflt:l.railBorderWidth},ticklen:{valType:"number",min:0,dflt:l.tickLength},tickcolor:{valType:"color",dflt:l.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:l.minorTickLength}},"arraydraw","from-root")},{"../../lib/extend":343,"../../plot_api/edit_types":374,"../../plots/animation_attributes":386,"../../plots/font_attributes":414,"../../plots/pad_attributes":425,"./constants":320}],320:[function(t,e,n){"use strict";e.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],321:[function(t,e,n){"use strict";function r(t,e,n){function r(n,r){return a.coerce(t,e,s,n,r)}r("visible",i(t,e).length>0)&&(r("active"),r("x"),r("y"),a.noneOrAll(t,e,["x","y"]),r("xanchor"),r("yanchor"),r("len"),r("lenmode"),r("pad.t"),r("pad.r"),r("pad.b"),r("pad.l"),a.coerceFont(r,"font",n.font),r("currentvalue.visible")&&(r("currentvalue.xanchor"),r("currentvalue.prefix"),r("currentvalue.suffix"),r("currentvalue.offset"),a.coerceFont(r,"currentvalue.font",e.font)),r("transition.duration"),r("transition.easing"),r("bgcolor"),r("activebgcolor"),r("bordercolor"),r("borderwidth"),r("ticklen"),r("tickwidth"),r("tickcolor"),r("minorticklen"))}function i(t,e){function n(t,e){return a.coerce(r,i,c,t,e)}for(var r,i,o=t.steps||[],s=e.steps=[],l=0;l=n.steps.length&&(n.active=0),e.call(s,n).call(_,n).call(c,n).call(p,n).call(x,t,n).call(l,t,n),k.setTranslate(e,n.lx+n.pad.l,n.ly+n.pad.t),e.call(g,n,n.active/(n.steps.length-1),!1),e.call(s,n)}function s(t,e,n){if(e.currentvalue.visible){var r,i,a=t.selectAll("text").data([0]);switch(e.currentvalue.xanchor){case"right":r=e.inputAreaLength-E.currentValueInset-e.currentValueMaxWidth,i="left";break;case"center":r=.5*e.inputAreaLength,i="middle";break;default:r=E.currentValueInset,i="left"}a.enter().append("text").classed(E.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":i,"data-notex":1});var o=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof n)o+=n;else{o+=e.steps[e.active].label}e.currentvalue.suffix&&(o+=e.currentvalue.suffix),a.call(k.font,e.currentvalue.font).text(o).call(A.convertToTspans,e.gd);var s=A.lineCount(a),l=(e.currentValueMaxLines+1-s)*e.currentvalue.font.size*L;return A.positionText(a,r,l),a}}function l(t,e,n){var r=t.selectAll("rect."+E.gripRectClass).data([0]);r.enter().append("rect").classed(E.gripRectClass,!0).call(d,e,t,n).style("pointer-events","all"),r.attr({width:E.gripWidth,height:E.gripHeight,rx:E.gripRadius,ry:E.gripRadius}).call(T.stroke,n.bordercolor).call(T.fill,n.bgcolor).style("stroke-width",n.borderwidth+"px")}function u(t,e,n){var r=t.selectAll("text").data([0]);return r.enter().append("text").classed(E.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1}),r.call(k.font,n.font).text(e.step.label).call(A.convertToTspans,n.gd),r}function c(t,e){var n=t.selectAll("g."+E.labelsClass).data([0]);n.enter().append("g").classed(E.labelsClass,!0);var r=n.selectAll("g."+E.labelGroupClass).data(e.labelSteps);r.enter().append("g").classed(E.labelGroupClass,!0),r.exit().remove(),r.each(function(t){var n=w.select(this);n.call(u,t,e),k.setTranslate(n,y(e,t.fraction),E.tickOffset+e.ticklen+e.font.size*L+E.labelOffset+e.currentValueTotalHeight)})}function f(t,e,n,r,i){var a=Math.round(r*(n.steps.length-1));a!==n.active&&h(t,e,n,a,!0,i)}function h(t,e,n,r,i,a){var o=n.active;n._input.active=n.active=r;var l=n.steps[n.active];e.call(g,n,n.active/(n.steps.length-1),a),e.call(s,n),t.emit("plotly_sliderchange",{slider:n,step:n.steps[n.active],interaction:i,previousActive:o}),l&&l.method&&i&&(e._nextMethod?(e._nextMethod.step=l,e._nextMethod.doCallback=i,e._nextMethod.doTransition=a):(e._nextMethod={step:l,doCallback:i,doTransition:a},e._nextMethodRaf=window.requestAnimationFrame(function(){var n=e._nextMethod.step;n.method&&(n.execute&&M.executeAPICommand(t,n.method,n.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function d(t,e,n){function r(){return n.data()[0]}var i=n.node(),a=w.select(e);t.on("mousedown",function(){var t=r();e.emit("plotly_sliderstart",{slider:t});var o=n.select("."+E.gripRectClass);w.event.stopPropagation(),w.event.preventDefault(),o.call(T.fill,t.activebgcolor);var s=v(t,w.mouse(i)[0]);f(e,n,t,s,!0),t._dragging=!0,a.on("mousemove",function(){var t=r(),a=v(t,w.mouse(i)[0]);f(e,n,t,a,!1)}),a.on("mouseup",function(){var t=r();t._dragging=!1,o.call(T.fill,t.bgcolor),a.on("mouseup",null),a.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function p(t,e){var n=t.selectAll("rect."+E.tickRectClass).data(e.steps);n.enter().append("rect").classed(E.tickRectClass,!0),n.exit().remove(),n.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),n.each(function(t,n){var r=n%e.labelStride==0,i=w.select(this);i.attr({height:r?e.ticklen:e.minorticklen}).call(T.fill,e.tickcolor),k.setTranslate(i,y(e,n/(e.steps.length-1))-.5*e.tickwidth,(r?E.tickOffset:E.minorTickOffset)+e.currentValueTotalHeight)})}function m(t){t.labelSteps=[];for(var e=t.steps.length,n=0;n0&&(o=o.transition().duration(e.transition.duration).ease(e.transition.easing)),o.attr("transform","translate("+(a-.5*E.gripWidth)+","+e.currentValueTotalHeight+")")}}function y(t,e){return t.inputAreaStart+E.stepInset+(t.inputAreaLength-2*E.stepInset)*Math.min(1,Math.max(0,e))}function v(t,e){return Math.min(1,Math.max(0,(e-E.stepInset-t.inputAreaStart)/(t.inputAreaLength-2*E.stepInset-2*t.inputAreaStart)))}function x(t,e,n){var r=t.selectAll("rect."+E.railTouchRectClass).data([0]);r.enter().append("rect").classed(E.railTouchRectClass,!0).call(d,e,t,n).style("pointer-events","all"),r.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,E.tickOffset+n.ticklen+n.labelHeight)}).call(T.fill,n.bgcolor).attr("opacity",0),k.setTranslate(r,0,n.currentValueTotalHeight)}function _(t,e){var n=t.selectAll("rect."+E.railRectClass).data([0]);n.enter().append("rect").classed(E.railRectClass,!0);var r=e.inputAreaLength-2*E.railInset;n.attr({width:r,height:E.railWidth,rx:E.railRadius,ry:E.railRadius,"shape-rendering":"crispEdges"}).call(T.stroke,e.bordercolor).call(T.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),k.setTranslate(n,E.railInset,.5*(e.inputAreaWidth-E.railWidth)+e.currentValueTotalHeight)}function b(t){for(var e=t._fullLayout._pushmargin||{},n=Object.keys(e),r=0;r0?[0]:[]);if(s.enter().append("g").classed(E.containerClassName,!0).style("cursor","ew-resize"),s.exit().remove(),s.exit().size()&&b(t),0!==n.length){var l=s.selectAll("g."+E.groupClassName).data(n,i);l.enter().append("g").classed(E.groupClassName,!0),l.exit().each(function(e){w.select(this).remove(),e._commandObserver.remove(),delete e._commandObserver,M.autoMargin(t,E.autoMarginIdRoot+e._index)});for(var u=0;u0||h<0){var m={left:[-n,0],right:[n,0],top:[0,-n],bottom:[0,n]}[b.side];e.attr("transform","translate("+m+")")}}}var g,y=n.propContainer,v=n.propName,x=n.traceIndex,_=n.dfltName,b=n.avoid||{},w=n.attributes,M=n.transform,T=n.containerGroup,k=t._fullLayout,A=y.titlefont.family,S=y.titlefont.size,E=y.titlefont.color,L=1,z=!1,I=y.title.trim();"title"===v?g="titleText":-1!==v.indexOf("axis")?g="axisTitleText":v.indexOf(!0)&&(g="colorbarTitleText");var D=t._context.edits[g];""===I&&(L=0),I.match(h)&&(L=.2,z=!0,D||(I=""));var C=I||D;T||(T=k._infolayer.selectAll(".g-"+e).data([0]),T.enter().append("g").classed("g-"+e,!0));var P=T.selectAll("text").data(C?[0]:[]);if(P.enter().append("text"),P.text(I).attr("class",e),P.exit().remove(),C){P.call(d);var O="Click to enter "+_+" title";D&&(I?P.on(".opacity",null):function(){L=0,z=!0,I=O,P.text(I).on("mouseover.opacity",function(){r.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){r.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)})}(),P.call(c.makeEditable,{gd:t}).on("edit",function(e){void 0!==x?a.restyle(t,v,e,x):a.relayout(t,v,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(d)}).on("input",function(t){this.text(t||" ").call(c.positionText,w.x,w.y)})),P.classed("js-placeholder",z)}}},{"../../constants/interactions":332,"../../lib":350,"../../lib/svg_text_utils":370,"../../plotly":385,"../../plots/plots":426,"../color":234,"../drawing":258,d3:8,"fast-isnumeric":12}],325:[function(t,e,n){"use strict";var r=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l={_isLinkedToArray:"button",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}};e.exports=o({_isLinkedToArray:"updatemenu",_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons: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:a({},s,{}),font:r({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}},"arraydraw","from-root")},{"../../lib/extend":343,"../../plot_api/edit_types":374,"../../plots/font_attributes":414,"../../plots/pad_attributes":425,"../color/attributes":233}],326:[function(t,e,n){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],327:[function(t,e,n){"use strict";function r(t,e,n){function r(n,r){return a.coerce(t,e,s,n,r)}r("visible",i(t,e).length>0)&&(r("active"),r("direction"),r("type"),r("showactive"),r("x"),r("y"),a.noneOrAll(t,e,["x","y"]),r("xanchor"),r("yanchor"),r("pad.t"),r("pad.r"),r("pad.b"),r("pad.l"),a.coerceFont(r,"font",n.font),r("bgcolor",n.paper_bgcolor),r("bordercolor"),r("borderwidth"))}function i(t,e){function n(t,e){return a.coerce(r,i,c,t,e)}for(var r,i,o=t.buttons||[],s=e.buttons=[],l=0;l0?[0]:[]);if(a.enter().append("g").classed(L.containerClassName,!0).style("cursor","pointer"),a.exit().remove(),a.exit().size()&&b(t),0!==n.length){var c=a.selectAll("g."+L.headerGroupClassName).data(n,i);c.enter().append("g").classed(L.headerGroupClassName,!0);var f=a.selectAll("g."+L.dropdownButtonGroupClassName).data([0]);f.enter().append("g").classed(L.dropdownButtonGroupClassName,!0).style("pointer-events","all");for(var h=0;hM,A=r.barLength+2*r.barPad,S=r.barWidth+2*r.barPad,E=p,L=g+y;L+S>u&&(L=u-S);var z=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);z.exit().on(".drag",null).remove(),z.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,r.barColor),k?(this.hbar=z.attr({rx:r.barRadius,ry:r.barRadius,x:E,y:L,width:A,height:S}),this._hbarXMin=E+A/2,this._hbarTranslateMax=M-A):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var I=y>T,D=r.barWidth+2*r.barPad,C=r.barLength+2*r.barPad,P=p+m,O=g;P+D>l&&(P=l-D);var F=this.container.selectAll("rect.scrollbar-vertical").data(I?[0]:[]);F.exit().on(".drag",null).remove(),F.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,r.barColor),I?(this.vbar=F.attr({rx:r.barRadius,ry:r.barRadius,x:P,y:O,width:D,height:C}),this._vbarYMin=O+C/2,this._vbarTranslateMax=T-C):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,j=c-.5,N=I?f+D+.5:f+.5,B=h-.5,V=k?d+S+.5:d+.5,q=s._topdefs.selectAll("#"+R).data(k||I?[0]:[]);if(q.exit().remove(),q.enter().append("clipPath").attr("id",R).append("rect"),k||I?(this._clipRect=q.select("rect").attr({x:Math.floor(j),y:Math.floor(B),width:Math.ceil(N)-Math.floor(j),height:Math.ceil(V)-Math.floor(B)}),this.container.call(o.setClipUrl,R),this.bg.attr({x:p,y:g,width:m,height:y})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),k||I){var U=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(U);var G=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault(),i.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(G),I&&this.vbar.on(".drag",null).call(G)}this.setTranslate(e,n)},r.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},r.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=i.event.dx),this.vbar&&(e-=i.event.dy),this.setTranslate(t,e)},r.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=i.event.deltaY),this.vbar&&(e+=i.event.deltaY),this.setTranslate(t,e)},r.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var n=t+this._hbarXMin,r=n+this._hbarTranslateMax -;t=(s.constrain(i.event.x,n,r)-n)/(r-n)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,o=a+this._vbarTranslateMax;e=(s.constrain(i.event.y,a,o)-a)/(o-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},r.prototype.setTranslate=function(t,e){var n=this.position.w-this._box.w,r=this.position.h-this._box.h;if(t=s.constrain(t||0,0,n),e=s.constrain(e||0,0,r),this.translateX=t,this.translateY=e,this.container.call(o.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/n;this.hbar.call(o.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var a=e/r;this.vbar.call(o.setTranslate,t,e+a*this._vbarTranslateMax)}}},{"../../lib":350,"../color":234,"../drawing":258,d3:8}],331:[function(t,e,n){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},LINE_SPACING:1.3,MID_SHIFT:.35}},{}],332:[function(t,e,n){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300,DESELECTDIM:.2}},{}],333:[function(t,e,n){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,MINUS_SIGN:"\u2212"}},{}],334:[function(t,e,n){"use strict";e.exports={entityToUnicode:{mu:"\u03bc","#956":"\u03bc",amp:"&","#28":"&",lt:"<","#60":"<",gt:">","#62":">",nbsp:"\xa0","#160":"\xa0",times:"\xd7","#215":"\xd7",plusmn:"\xb1","#177":"\xb1",deg:"\xb0","#176":"\xb0"}}},{}],335:[function(t,e,n){"use strict";n.xmlns="http://www.w3.org/2000/xmlns/",n.svg="http://www.w3.org/2000/svg",n.xlink="http://www.w3.org/1999/xlink",n.svgAttrs={xmlns:n.svg,"xmlns:xlink":n.xlink}},{}],336:[function(t,e,n){"use strict";var r=t("./plotly");n.version="1.31.1",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config"),n.plot=r.plot,n.newPlot=r.newPlot,n.restyle=r.restyle,n.relayout=r.relayout,n.redraw=r.redraw,n.update=r.update,n.extendTraces=r.extendTraces,n.prependTraces=r.prependTraces,n.addTraces=r.addTraces,n.deleteTraces=r.deleteTraces,n.moveTraces=r.moveTraces,n.purge=r.purge,n.setPlotConfig=t("./plot_api/set_plot_config"),n.register=t("./plot_api/register"),n.toImage=t("./plot_api/to_image"),n.downloadImage=t("./snapshot/download"),n.validate=t("./plot_api/validate"),n.addFrames=r.addFrames,n.deleteFrames=r.deleteFrames,n.animate=r.animate,n.register(t("./traces/scatter")),n.register([t("./components/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),n.Icons=t("../build/ploticon"),n.Plots=r.Plots,n.Fx=t("./components/fx"),n.Snapshot=t("./snapshot"),n.PlotSchema=t("./plot_api/plot_schema"),n.Queue=t("./lib/queue"),n.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":227,"./components/annotations3d":232,"./components/fx":275,"./components/images":283,"./components/legend":292,"./components/rangeselector":304,"./components/rangeslider":310,"./components/shapes":317,"./components/sliders":323,"./components/updatemenus":329,"./fonts/mathjax_config":337,"./lib/queue":363,"./plot_api/plot_schema":379,"./plot_api/register":380,"./plot_api/set_plot_config":381,"./plot_api/to_image":383,"./plot_api/validate":384,"./plotly":385,"./snapshot":439,"./snapshot/download":436,"./traces/scatter":456,d3:8,"es6-promise":10}],337:[function(t,e,n){"use strict";"undefined"!=typeof MathJax?(n.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):n.MathJax=!1},{}],338:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),i=t("../constants/numerical").BADNUM,a=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(a,"")),r(t)?Number(t):i}},{"../constants/numerical":333,"fast-isnumeric":12}],339:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),i=t("tinycolor2"),a=t("../plots/attributes"),o=t("../components/colorscale/get_scale"),s=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),l=t("./regex").counter;n.valObjectMeta={data_array:{coerceFunction:function(t,e,n){Array.isArray(t)?e.set(t):void 0!==n&&e.set(n)}},enumerated:{coerceFunction:function(t,e,n,r){r.coerceNumber&&(t=+t),-1===r.values.indexOf(t)?e.set(n):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var n=e.values,r=0;ri.max?e.set(n):e.set(+t)}},integer:{coerceFunction:function(t,e,n,i){t%1||!r(t)||void 0!==i.min&&ti.max?e.set(n):e.set(+t)}},string:{coerceFunction:function(t,e,n,r){if("string"!=typeof t){var i="number"==typeof t;!0!==r.strict&&i?e.set(String(t)):e.set(n)}else r.noBlank&&!t?e.set(n):e.set(t)}},color:{coerceFunction:function(t,e,n){i(t).isValid()?e.set(t):e.set(n)}},colorscale:{coerceFunction:function(t,e,n){e.set(o(t,n))}},angle:{coerceFunction:function(t,e,n){"auto"===t?e.set("auto"):r(t)?(Math.abs(t)>180&&(t-=360*Math.round(t/360)),e.set(+t)):e.set(n)}},subplotid:{coerceFunction:function(t,e,n){if("string"==typeof t&&l(n).test(t))return void e.set(t);e.set(n)},validateFunction:function(t,e){var n=e.dflt;return t===n||"string"==typeof t&&!!l(n).test(t)}},flaglist:{coerceFunction:function(t,e,n,r){if("string"!=typeof t)return void e.set(n);if(-1!==(r.extras||[]).indexOf(t))return void e.set(t);for(var i=t.split("+"),a=0;a0&&(o=o.replace(/0+$/,"").replace(/[\.]$/,"")),r+=":"+o}return r}function l(t){return t.formatDate("yyyy")}function u(t){return t.formatDate("M yyyy")}function c(t){return t.formatDate("M d")}function f(t){return t.formatDate("M d, yyyy")}var h=t("d3"),d=t("fast-isnumeric"),p=t("./loggers").error,m=t("./mod"),g=t("../constants/numerical"),y=g.BADNUM,v=g.ONEDAY,x=g.ONEHOUR,_=g.ONEMIN,b=g.ONESEC,w=g.EPOCHJD,M=t("../registry"),T=h.time.format.utc,k=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,A=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,S=(new Date).getFullYear()-70;n.dateTick0=function(t,e){return r(t)?e?M.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:M.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},n.dfltRange=function(t){return r(t)?M.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},n.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime};var E,L;n.dateTime2ms=function(t,e){if(n.isJSDate(t))return t=Number(t)-t.getTimezoneOffset()*_,t>=E&&t<=L?t:y;if("string"!=typeof t&&"number"!=typeof t)return y;t=String(t);var i=r(e),a=t.charAt(0);!i||"G"!==a&&"g"!==a||(t=t.substr(1),e="");var o=i&&"chinese"===e.substr(0,7),s=t.match(o?A:k);if(!s)return y;var l=s[1],u=s[3]||"1",c=Number(s[5]||1),f=Number(s[7]||0),h=Number(s[9]||0),d=Number(s[11]||0);if(i){if(2===l.length)return y;l=Number(l);var p;try{var m=M.getComponentMethod("calendars","getCal")(e);if(o){var g="i"===u.charAt(u.length-1);u=parseInt(u,10),p=m.newDate(l,m.toMonthIndex(l,u,g),c)}else p=m.newDate(l,Number(u),c)}catch(t){return y}return p?(p.toJD()-w)*v+f*x+h*_+d*b:y}l=2===l.length?(Number(l)+2e3-S)%100+S:Number(l),u-=1;var T=new Date(Date.UTC(2e3,u,c,f,h));return T.setUTCFullYear(l),T.getUTCMonth()!==u?y:T.getUTCDate()!==c?y:T.getTime()+d*b},E=n.MIN_MS=n.dateTime2ms("-9999"),L=n.MAX_MS=n.dateTime2ms("9999-12-31 23:59:59.9999"),n.isDateTime=function(t,e){return n.dateTime2ms(t,e)!==y};var z=90*v,I=3*x,D=5*_;n.ms2DateTime=function(t,e,n){if("number"!=typeof t||!(t>=E&&t<=L))return y;e||(e=0);var i,o,s,l,u,c,f=Math.floor(10*m(t+.05,1)),h=Math.round(t-f/10);if(r(n)){var d=Math.floor(h/v)+w,p=Math.floor(m(t,v));try{i=M.getComponentMethod("calendars","getCal")(n).fromJD(d).formatDate("yyyy-mm-dd")}catch(t){i=T("G%Y-%m-%d")(new Date(h))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e=E+v&&t<=L-v))return y;var e=Math.floor(10*m(t+.05,1)),n=new Date(Math.round(t-e/10));return a(h.time.format("%Y-%m-%d")(n),n.getHours(),n.getMinutes(),n.getSeconds(),10*n.getUTCMilliseconds()+e)},n.cleanDate=function(t,e,i){if(n.isJSDate(t)||"number"==typeof t){if(r(i))return p("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=n.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!n.isDateTime(t,i))return p("unrecognized date",t),e;return t};var C=/%\d?f/g,P=[59,59.9,59.99,59.999,59.9999],O=T("%Y"),F=T("%b %Y"),R=T("%b %-d"),j=T("%b %-d, %Y");n.formatDate=function(t,e,n,i){var a,h;if(i=r(i)&&i,e)return o(e,t,i);if(i)try{var d=Math.floor((t+.05)/v)+w,p=M.getComponentMethod("calendars","getCal")(i).fromJD(d);"y"===n?h=l(p):"m"===n?h=u(p):"d"===n?(a=l(p),h=c(p)):(a=f(p),h=s(t,n))}catch(t){return"Invalid"}else{var m=new Date(Math.floor(t+.05));"y"===n?h=O(m):"m"===n?h=F(m):"d"===n?(a=O(m),h=R(m)):(a=j(m),h=s(t,n))}return h+(a?"\n"+a:"")};var N=3*v;n.incrementMonth=function(t,e,n){n=r(n)&&n;var i=m(t,v);if(t=Math.round(t-i),n)try{var a=Math.round(t/v)+w,o=M.getComponentMethod("calendars","getCal")(n),s=o.fromJD(a);return e%12?o.add(s,e,"m"):o.add(s,e/12,"y"),(s.toJD()-w)*v+i}catch(e){p("invalid ms "+t+" in calendar "+n)}var l=new Date(t+N);return l.setUTCMonth(l.getUTCMonth()+e)+i-N},n.findExactDates=function(t,e){for(var n,i,a=0,o=0,s=0,l=0,u=r(e)&&M.getComponentMethod("calendars","getCal")(e),c=0;c0&&(i.push(a),a=[])}return a.length>0&&i.push(a),i},n.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},n.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),n=0;n1||m<0||m>1?null:{x:t+l*m,y:e+f*m}}function i(t,e,n,r,i){var a=r*t+i*e;if(a<0)return r*r+i*i;if(a>n){var o=r-t,s=i-e;return o*o+s*s}var l=r*e-i*t;return l*l/n}var a=t("./mod");n.segmentsIntersect=r,n.segmentDistance=function(t,e,n,a,o,s,l,u){if(r(t,e,n,a,o,s,l,u))return 0;var c=n-t,f=a-e,h=l-o,d=u-s,p=c*c+f*f,m=h*h+d*d,g=Math.min(i(c,f,p,o-t,s-e),i(c,f,p,l-t,u-e),i(h,d,m,t-o,e-s),i(h,d,m,n-o,a-s));return Math.sqrt(g)};var o,s,l;n.getTextLocation=function(t,e,n,r){if(t===s&&r===l||(o={},s=t,l=r),o[n])return o[n];var i=t.getPointAtLength(a(n-r/2,e)),u=t.getPointAtLength(a(n+r/2,e)),c=Math.atan((u.y-i.y)/(u.x-i.x)),f=t.getPointAtLength(a(n,e)),h=(4*f.x+i.x+u.x)/6,d=(4*f.y+i.y+u.y)/6,p={x:h,y:d,theta:c};return o[n]=p,p},n.clearLocationCache=function(){s=null},n.getVisibleSegment=function(t,e,n){function r(e){var n=t.getPointAtLength(e);0===e?i=n:e===f&&(a=n);var r=n.xs?n.x-s:0,c=n.yu?n.y-u:0;return Math.sqrt(r*r+c*c)}for(var i,a,o=e.left,s=e.right,l=e.top,u=e.bottom,c=0,f=t.getTotalLength(),h=f,d=r(c);d;){if((c+=d+n)>h)return;d=r(c)}for(d=r(h);d;){if(h-=d+n,c>h)return;d=r(h)}return{min:c,max:h,len:h-c,total:f,isClosed:0===c&&h===f&&Math.abs(i.x-a.x)<.1&&Math.abs(i.y-a.y)<.1}}},{"./mod":356}],348:[function(t,e,n){"use strict";e.exports=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t}},{}],349:[function(t,e,n){"use strict";e.exports=function(t){return t}},{}],350:[function(t,e,n){"use strict";var r=t("d3"),i=t("fast-isnumeric"),a=t("../constants/numerical"),o=a.FP_SAFE,s=a.BADNUM,l=e.exports={};l.nestedProperty=t("./nested_property"),l.keyedContainer=t("./keyed_container"),l.relativeAttr=t("./relative_attr"),l.isPlainObject=t("./is_plain_object"),l.isArray=t("./is_array"),l.mod=t("./mod"),l.toLogRange=t("./to_log_range"),l.relinkPrivateKeys=t("./relink_private"),l.ensureArray=t("./ensure_array");var u=t("./coerce");l.valObjectMeta=u.valObjectMeta,l.coerce=u.coerce,l.coerce2=u.coerce2,l.coerceFont=u.coerceFont,l.coerceHoverinfo=u.coerceHoverinfo,l.validate=u.validate;var c=t("./dates");l.dateTime2ms=c.dateTime2ms,l.isDateTime=c.isDateTime,l.ms2DateTime=c.ms2DateTime,l.ms2DateTimeLocal=c.ms2DateTimeLocal,l.cleanDate=c.cleanDate,l.isJSDate=c.isJSDate,l.formatDate=c.formatDate,l.incrementMonth=c.incrementMonth,l.dateTick0=c.dateTick0,l.dfltRange=c.dfltRange,l.findExactDates=c.findExactDates,l.MIN_MS=c.MIN_MS,l.MAX_MS=c.MAX_MS;var f=t("./search");l.findBin=f.findBin,l.sorterAsc=f.sorterAsc,l.sorterDes=f.sorterDes,l.distinctVals=f.distinctVals,l.roundUp=f.roundUp;var h=t("./stats");l.aggNums=h.aggNums,l.len=h.len,l.mean=h.mean,l.variance=h.variance,l.stdev=h.stdev,l.interp=h.interp;var d=t("./matrix");l.init2dArray=d.init2dArray,l.transposeRagged=d.transposeRagged,l.dot=d.dot,l.translationMatrix=d.translationMatrix,l.rotationMatrix=d.rotationMatrix,l.rotationXYMatrix=d.rotationXYMatrix,l.apply2DTransform=d.apply2DTransform,l.apply2DTransform2=d.apply2DTransform2;var p=t("./geometry2d");l.segmentsIntersect=p.segmentsIntersect,l.segmentDistance=p.segmentDistance,l.getTextLocation=p.getTextLocation,l.clearLocationCache=p.clearLocationCache,l.getVisibleSegment=p.getVisibleSegment;var m=t("./extend");l.extendFlat=m.extendFlat,l.extendDeep=m.extendDeep,l.extendDeepAll=m.extendDeepAll,l.extendDeepNoArrays=m.extendDeepNoArrays;var g=t("./loggers");l.log=g.log,l.warn=g.warn,l.error=g.error;var y=t("./regex");l.counterRegex=y.counter;var v=t("./throttle");l.throttle=v.throttle,l.throttleDone=v.done,l.clearThrottle=v.clear,l.getGraphDiv=t("./get_graph_div"),l.notifier=t("./notifier"),l.filterUnique=t("./filter_unique"),l.filterVisible=t("./filter_visible"),l.pushUnique=t("./push_unique"),l.cleanNumber=t("./clean_number"),l.ensureNumber=function(t){return i(t)?(t=Number(t),t<-o||t>o?s:i(t)?Number(t):s):s},l.noop=t("./noop"),l.identity=t("./identity"),l.swapAttrs=function(t,e,n,r){n||(n="x"),r||(r="y");for(var i=0;in?Math.max(n,Math.min(e,t)):Math.max(e,Math.min(n,t))},l.bBoxIntersect=function(t,e,n){return n=n||0,t.left<=e.right+n&&e.left<=t.right+n&&t.top<=e.bottom+n&&e.top<=t.bottom+n},l.simpleMap=function(t,e,n,r){for(var i=t.length,a=new Array(i),o=0;o-1||c!==1/0&&c>=Math.pow(2,n)?t(e,n,r):l},l.OptionControl=function(t,e){t||(t={}),e||(e="opt");var n={};return n.optionList=[],n._newoption=function(r){r[e]=t,n[r.name]=r,n.optionList.push(r)},n["_"+e]=t,n},l.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var n,r,i,a,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(n=0;n=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*u[r];c[n]=a}return c},l.syncOrAsync=function(t,e,n){function r(){return l.syncOrAsync(t,e,n)}for(var i,a;t.length;)if(a=t.splice(0,1)[0],(i=a(e))&&i.then)return i.then(r).then(void 0,l.promiseError);return n&&n(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,n){if(t){var r,i,a=!1,o=!0;for(r=0;r1?i+o[1]:"";if(a&&(o.length>1||s.length>4||n))for(;r.test(s);)s=s.replace(r,"$1"+a+"$2");return s+l};var b=/%{([^\s%{}]*)}/g,w=/^\w*$/;l.templateString=function(t,e){var n={};return t.replace(b,function(t,r){return w.test(r)?e[r]||"":(n[r]=n[r]||l.nestedProperty(e,r).get,n[r]()||"")})}},{"../constants/numerical":333,"./clean_number":338,"./coerce":339,"./dates":340,"./ensure_array":341,"./extend":343,"./filter_unique":344,"./filter_visible":345,"./geometry2d":347,"./get_graph_div":348,"./identity":349,"./is_array":351,"./is_plain_object":352,"./keyed_container":353,"./loggers":354,"./matrix":355,"./mod":356,"./nested_property":357,"./noop":358,"./notifier":359,"./push_unique":362,"./regex":364,"./relative_attr":365,"./relink_private":366,"./search":367,"./stats":369,"./throttle":371,"./to_log_range":372,d3:8,"fast-isnumeric":12}],351:[function(t,e,n){"use strict";var r="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}};e.exports=function(t){return Array.isArray(t)||r.isView(t)}},{}],352:[function(t,e,n){"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}},{}],353:[function(t,e,n){"use strict";var r=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,n,a){n=n||"name",a=a||"value";var o,s,l={};s=e&&e.length?r(t,e).get():t,e=e||"",s=s||[];var u={};for(o=0;o2)return l[e]=2|l[e],f.set(t,null);if(c){for(o=e;o1){for(var t=["LOG:"],e=0;e0){for(var t=["WARN:"],e=0;e0){for(var t=["ERROR:"],e=0;e=0;e--){if(r=t[e][0],a=t[e][1],l=!1,d(r))for(n=r.length-1;n>=0;n--)i(r[n],o(a,n))?l?r[n]=void 0:r.pop():l=!0;else if("object"==typeof r&&null!==r)for(s=Object.keys(r),l=!1,n=s.length-1;n>=0;n--)i(r[s[n]],o(a,s[n]))?delete r[s[n]]:l=!0;if(l)return}}function c(t){return void 0===t||null===t||"object"==typeof t&&(d(t)?!t.length:!Object.keys(t).length)}function f(t,e,n){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:n,obj:t}}var h=t("fast-isnumeric"),d=t("./is_array"),p=t("./is_plain_object"),m=t("../plot_api/container_array_match") +;t=(s.constrain(i.event.x,n,r)-n)/(r-n)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,o=a+this._vbarTranslateMax;e=(s.constrain(i.event.y,a,o)-a)/(o-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},r.prototype.setTranslate=function(t,e){var n=this.position.w-this._box.w,r=this.position.h-this._box.h;if(t=s.constrain(t||0,0,n),e=s.constrain(e||0,0,r),this.translateX=t,this.translateY=e,this.container.call(o.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/n;this.hbar.call(o.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var a=e/r;this.vbar.call(o.setTranslate,t,e+a*this._vbarTranslateMax)}}},{"../../lib":350,"../color":234,"../drawing":258,d3:8}],331:[function(t,e,n){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},LINE_SPACING:1.3,MID_SHIFT:.35}},{}],332:[function(t,e,n){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300,DESELECTDIM:.2}},{}],333:[function(t,e,n){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,MINUS_SIGN:"\u2212"}},{}],334:[function(t,e,n){"use strict";e.exports={entityToUnicode:{mu:"\u03bc","#956":"\u03bc",amp:"&","#28":"&",lt:"<","#60":"<",gt:">","#62":">",nbsp:"\xa0","#160":"\xa0",times:"\xd7","#215":"\xd7",plusmn:"\xb1","#177":"\xb1",deg:"\xb0","#176":"\xb0"}}},{}],335:[function(t,e,n){"use strict";n.xmlns="http://www.w3.org/2000/xmlns/",n.svg="http://www.w3.org/2000/svg",n.xlink="http://www.w3.org/1999/xlink",n.svgAttrs={xmlns:n.svg,"xmlns:xlink":n.xlink}},{}],336:[function(t,e,n){"use strict";var r=t("./plotly");n.version="1.31.2",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config"),n.plot=r.plot,n.newPlot=r.newPlot,n.restyle=r.restyle,n.relayout=r.relayout,n.redraw=r.redraw,n.update=r.update,n.extendTraces=r.extendTraces,n.prependTraces=r.prependTraces,n.addTraces=r.addTraces,n.deleteTraces=r.deleteTraces,n.moveTraces=r.moveTraces,n.purge=r.purge,n.setPlotConfig=t("./plot_api/set_plot_config"),n.register=t("./plot_api/register"),n.toImage=t("./plot_api/to_image"),n.downloadImage=t("./snapshot/download"),n.validate=t("./plot_api/validate"),n.addFrames=r.addFrames,n.deleteFrames=r.deleteFrames,n.animate=r.animate,n.register(t("./traces/scatter")),n.register([t("./components/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),n.Icons=t("../build/ploticon"),n.Plots=r.Plots,n.Fx=t("./components/fx"),n.Snapshot=t("./snapshot"),n.PlotSchema=t("./plot_api/plot_schema"),n.Queue=t("./lib/queue"),n.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":227,"./components/annotations3d":232,"./components/fx":275,"./components/images":283,"./components/legend":292,"./components/rangeselector":304,"./components/rangeslider":310,"./components/shapes":317,"./components/sliders":323,"./components/updatemenus":329,"./fonts/mathjax_config":337,"./lib/queue":363,"./plot_api/plot_schema":379,"./plot_api/register":380,"./plot_api/set_plot_config":381,"./plot_api/to_image":383,"./plot_api/validate":384,"./plotly":385,"./snapshot":439,"./snapshot/download":436,"./traces/scatter":456,d3:8,"es6-promise":10}],337:[function(t,e,n){"use strict";"undefined"!=typeof MathJax?(n.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):n.MathJax=!1},{}],338:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),i=t("../constants/numerical").BADNUM,a=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(a,"")),r(t)?Number(t):i}},{"../constants/numerical":333,"fast-isnumeric":12}],339:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),i=t("tinycolor2"),a=t("../plots/attributes"),o=t("../components/colorscale/get_scale"),s=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),l=t("./regex").counter;n.valObjectMeta={data_array:{coerceFunction:function(t,e,n){Array.isArray(t)?e.set(t):void 0!==n&&e.set(n)}},enumerated:{coerceFunction:function(t,e,n,r){r.coerceNumber&&(t=+t),-1===r.values.indexOf(t)?e.set(n):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var n=e.values,r=0;ri.max?e.set(n):e.set(+t)}},integer:{coerceFunction:function(t,e,n,i){t%1||!r(t)||void 0!==i.min&&ti.max?e.set(n):e.set(+t)}},string:{coerceFunction:function(t,e,n,r){if("string"!=typeof t){var i="number"==typeof t;!0!==r.strict&&i?e.set(String(t)):e.set(n)}else r.noBlank&&!t?e.set(n):e.set(t)}},color:{coerceFunction:function(t,e,n){i(t).isValid()?e.set(t):e.set(n)}},colorscale:{coerceFunction:function(t,e,n){e.set(o(t,n))}},angle:{coerceFunction:function(t,e,n){"auto"===t?e.set("auto"):r(t)?(Math.abs(t)>180&&(t-=360*Math.round(t/360)),e.set(+t)):e.set(n)}},subplotid:{coerceFunction:function(t,e,n){if("string"==typeof t&&l(n).test(t))return void e.set(t);e.set(n)},validateFunction:function(t,e){var n=e.dflt;return t===n||"string"==typeof t&&!!l(n).test(t)}},flaglist:{coerceFunction:function(t,e,n,r){if("string"!=typeof t)return void e.set(n);if(-1!==(r.extras||[]).indexOf(t))return void e.set(t);for(var i=t.split("+"),a=0;a0&&(o=o.replace(/0+$/,"").replace(/[\.]$/,"")),r+=":"+o}return r}function l(t){return t.formatDate("yyyy")}function u(t){return t.formatDate("M yyyy")}function c(t){return t.formatDate("M d")}function f(t){return t.formatDate("M d, yyyy")}var h=t("d3"),d=t("fast-isnumeric"),p=t("./loggers").error,m=t("./mod"),g=t("../constants/numerical"),y=g.BADNUM,v=g.ONEDAY,x=g.ONEHOUR,_=g.ONEMIN,b=g.ONESEC,w=g.EPOCHJD,M=t("../registry"),T=h.time.format.utc,k=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,A=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,S=(new Date).getFullYear()-70;n.dateTick0=function(t,e){return r(t)?e?M.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:M.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},n.dfltRange=function(t){return r(t)?M.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},n.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime};var E,L;n.dateTime2ms=function(t,e){if(n.isJSDate(t))return t=Number(t)-t.getTimezoneOffset()*_,t>=E&&t<=L?t:y;if("string"!=typeof t&&"number"!=typeof t)return y;t=String(t);var i=r(e),a=t.charAt(0);!i||"G"!==a&&"g"!==a||(t=t.substr(1),e="");var o=i&&"chinese"===e.substr(0,7),s=t.match(o?A:k);if(!s)return y;var l=s[1],u=s[3]||"1",c=Number(s[5]||1),f=Number(s[7]||0),h=Number(s[9]||0),d=Number(s[11]||0);if(i){if(2===l.length)return y;l=Number(l);var p;try{var m=M.getComponentMethod("calendars","getCal")(e);if(o){var g="i"===u.charAt(u.length-1);u=parseInt(u,10),p=m.newDate(l,m.toMonthIndex(l,u,g),c)}else p=m.newDate(l,Number(u),c)}catch(t){return y}return p?(p.toJD()-w)*v+f*x+h*_+d*b:y}l=2===l.length?(Number(l)+2e3-S)%100+S:Number(l),u-=1;var T=new Date(Date.UTC(2e3,u,c,f,h));return T.setUTCFullYear(l),T.getUTCMonth()!==u?y:T.getUTCDate()!==c?y:T.getTime()+d*b},E=n.MIN_MS=n.dateTime2ms("-9999"),L=n.MAX_MS=n.dateTime2ms("9999-12-31 23:59:59.9999"),n.isDateTime=function(t,e){return n.dateTime2ms(t,e)!==y};var z=90*v,I=3*x,D=5*_;n.ms2DateTime=function(t,e,n){if("number"!=typeof t||!(t>=E&&t<=L))return y;e||(e=0);var i,o,s,l,u,c,f=Math.floor(10*m(t+.05,1)),h=Math.round(t-f/10);if(r(n)){var d=Math.floor(h/v)+w,p=Math.floor(m(t,v));try{i=M.getComponentMethod("calendars","getCal")(n).fromJD(d).formatDate("yyyy-mm-dd")}catch(t){i=T("G%Y-%m-%d")(new Date(h))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e=E+v&&t<=L-v))return y;var e=Math.floor(10*m(t+.05,1)),n=new Date(Math.round(t-e/10));return a(h.time.format("%Y-%m-%d")(n),n.getHours(),n.getMinutes(),n.getSeconds(),10*n.getUTCMilliseconds()+e)},n.cleanDate=function(t,e,i){if(n.isJSDate(t)||"number"==typeof t){if(r(i))return p("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=n.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!n.isDateTime(t,i))return p("unrecognized date",t),e;return t};var C=/%\d?f/g,P=[59,59.9,59.99,59.999,59.9999],O=T("%Y"),F=T("%b %Y"),R=T("%b %-d"),j=T("%b %-d, %Y");n.formatDate=function(t,e,n,i){var a,h;if(i=r(i)&&i,e)return o(e,t,i);if(i)try{var d=Math.floor((t+.05)/v)+w,p=M.getComponentMethod("calendars","getCal")(i).fromJD(d);"y"===n?h=l(p):"m"===n?h=u(p):"d"===n?(a=l(p),h=c(p)):(a=f(p),h=s(t,n))}catch(t){return"Invalid"}else{var m=new Date(Math.floor(t+.05));"y"===n?h=O(m):"m"===n?h=F(m):"d"===n?(a=O(m),h=R(m)):(a=j(m),h=s(t,n))}return h+(a?"\n"+a:"")};var N=3*v;n.incrementMonth=function(t,e,n){n=r(n)&&n;var i=m(t,v);if(t=Math.round(t-i),n)try{var a=Math.round(t/v)+w,o=M.getComponentMethod("calendars","getCal")(n),s=o.fromJD(a);return e%12?o.add(s,e,"m"):o.add(s,e/12,"y"),(s.toJD()-w)*v+i}catch(e){p("invalid ms "+t+" in calendar "+n)}var l=new Date(t+N);return l.setUTCMonth(l.getUTCMonth()+e)+i-N},n.findExactDates=function(t,e){for(var n,i,a=0,o=0,s=0,l=0,u=r(e)&&M.getComponentMethod("calendars","getCal")(e),c=0;c0&&(i.push(a),a=[])}return a.length>0&&i.push(a),i},n.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},n.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),n=0;n1||m<0||m>1?null:{x:t+l*m,y:e+f*m}}function i(t,e,n,r,i){var a=r*t+i*e;if(a<0)return r*r+i*i;if(a>n){var o=r-t,s=i-e;return o*o+s*s}var l=r*e-i*t;return l*l/n}var a=t("./mod");n.segmentsIntersect=r,n.segmentDistance=function(t,e,n,a,o,s,l,u){if(r(t,e,n,a,o,s,l,u))return 0;var c=n-t,f=a-e,h=l-o,d=u-s,p=c*c+f*f,m=h*h+d*d,g=Math.min(i(c,f,p,o-t,s-e),i(c,f,p,l-t,u-e),i(h,d,m,t-o,e-s),i(h,d,m,n-o,a-s));return Math.sqrt(g)};var o,s,l;n.getTextLocation=function(t,e,n,r){if(t===s&&r===l||(o={},s=t,l=r),o[n])return o[n];var i=t.getPointAtLength(a(n-r/2,e)),u=t.getPointAtLength(a(n+r/2,e)),c=Math.atan((u.y-i.y)/(u.x-i.x)),f=t.getPointAtLength(a(n,e)),h=(4*f.x+i.x+u.x)/6,d=(4*f.y+i.y+u.y)/6,p={x:h,y:d,theta:c};return o[n]=p,p},n.clearLocationCache=function(){s=null},n.getVisibleSegment=function(t,e,n){function r(e){var n=t.getPointAtLength(e);0===e?i=n:e===f&&(a=n);var r=n.xs?n.x-s:0,c=n.yu?n.y-u:0;return Math.sqrt(r*r+c*c)}for(var i,a,o=e.left,s=e.right,l=e.top,u=e.bottom,c=0,f=t.getTotalLength(),h=f,d=r(c);d;){if((c+=d+n)>h)return;d=r(c)}for(d=r(h);d;){if(h-=d+n,c>h)return;d=r(h)}return{min:c,max:h,len:h-c,total:f,isClosed:0===c&&h===f&&Math.abs(i.x-a.x)<.1&&Math.abs(i.y-a.y)<.1}}},{"./mod":356}],348:[function(t,e,n){"use strict";e.exports=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t}},{}],349:[function(t,e,n){"use strict";e.exports=function(t){return t}},{}],350:[function(t,e,n){"use strict";var r=t("d3"),i=t("fast-isnumeric"),a=t("../constants/numerical"),o=a.FP_SAFE,s=a.BADNUM,l=e.exports={};l.nestedProperty=t("./nested_property"),l.keyedContainer=t("./keyed_container"),l.relativeAttr=t("./relative_attr"),l.isPlainObject=t("./is_plain_object"),l.isArray=t("./is_array"),l.mod=t("./mod"),l.toLogRange=t("./to_log_range"),l.relinkPrivateKeys=t("./relink_private"),l.ensureArray=t("./ensure_array");var u=t("./coerce");l.valObjectMeta=u.valObjectMeta,l.coerce=u.coerce,l.coerce2=u.coerce2,l.coerceFont=u.coerceFont,l.coerceHoverinfo=u.coerceHoverinfo,l.validate=u.validate;var c=t("./dates");l.dateTime2ms=c.dateTime2ms,l.isDateTime=c.isDateTime,l.ms2DateTime=c.ms2DateTime,l.ms2DateTimeLocal=c.ms2DateTimeLocal,l.cleanDate=c.cleanDate,l.isJSDate=c.isJSDate,l.formatDate=c.formatDate,l.incrementMonth=c.incrementMonth,l.dateTick0=c.dateTick0,l.dfltRange=c.dfltRange,l.findExactDates=c.findExactDates,l.MIN_MS=c.MIN_MS,l.MAX_MS=c.MAX_MS;var f=t("./search");l.findBin=f.findBin,l.sorterAsc=f.sorterAsc,l.sorterDes=f.sorterDes,l.distinctVals=f.distinctVals,l.roundUp=f.roundUp;var h=t("./stats");l.aggNums=h.aggNums,l.len=h.len,l.mean=h.mean,l.variance=h.variance,l.stdev=h.stdev,l.interp=h.interp;var d=t("./matrix");l.init2dArray=d.init2dArray,l.transposeRagged=d.transposeRagged,l.dot=d.dot,l.translationMatrix=d.translationMatrix,l.rotationMatrix=d.rotationMatrix,l.rotationXYMatrix=d.rotationXYMatrix,l.apply2DTransform=d.apply2DTransform,l.apply2DTransform2=d.apply2DTransform2;var p=t("./geometry2d");l.segmentsIntersect=p.segmentsIntersect,l.segmentDistance=p.segmentDistance,l.getTextLocation=p.getTextLocation,l.clearLocationCache=p.clearLocationCache,l.getVisibleSegment=p.getVisibleSegment;var m=t("./extend");l.extendFlat=m.extendFlat,l.extendDeep=m.extendDeep,l.extendDeepAll=m.extendDeepAll,l.extendDeepNoArrays=m.extendDeepNoArrays;var g=t("./loggers");l.log=g.log,l.warn=g.warn,l.error=g.error;var y=t("./regex");l.counterRegex=y.counter;var v=t("./throttle");l.throttle=v.throttle,l.throttleDone=v.done,l.clearThrottle=v.clear,l.getGraphDiv=t("./get_graph_div"),l.notifier=t("./notifier"),l.filterUnique=t("./filter_unique"),l.filterVisible=t("./filter_visible"),l.pushUnique=t("./push_unique"),l.cleanNumber=t("./clean_number"),l.ensureNumber=function(t){return i(t)?(t=Number(t),t<-o||t>o?s:i(t)?Number(t):s):s},l.noop=t("./noop"),l.identity=t("./identity"),l.swapAttrs=function(t,e,n,r){n||(n="x"),r||(r="y");for(var i=0;in?Math.max(n,Math.min(e,t)):Math.max(e,Math.min(n,t))},l.bBoxIntersect=function(t,e,n){return n=n||0,t.left<=e.right+n&&e.left<=t.right+n&&t.top<=e.bottom+n&&e.top<=t.bottom+n},l.simpleMap=function(t,e,n,r){for(var i=t.length,a=new Array(i),o=0;o-1||c!==1/0&&c>=Math.pow(2,n)?t(e,n,r):l},l.OptionControl=function(t,e){t||(t={}),e||(e="opt");var n={};return n.optionList=[],n._newoption=function(r){r[e]=t,n[r.name]=r,n.optionList.push(r)},n["_"+e]=t,n},l.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var n,r,i,a,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(n=0;n=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*u[r];c[n]=a}return c},l.syncOrAsync=function(t,e,n){function r(){return l.syncOrAsync(t,e,n)}for(var i,a;t.length;)if(a=t.splice(0,1)[0],(i=a(e))&&i.then)return i.then(r).then(void 0,l.promiseError);return n&&n(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,n){if(t){var r,i,a=!1,o=!0;for(r=0;r1?i+o[1]:"";if(a&&(o.length>1||s.length>4||n))for(;r.test(s);)s=s.replace(r,"$1"+a+"$2");return s+l};var b=/%{([^\s%{}]*)}/g,w=/^\w*$/;l.templateString=function(t,e){var n={};return t.replace(b,function(t,r){return w.test(r)?e[r]||"":(n[r]=n[r]||l.nestedProperty(e,r).get,n[r]()||"")})}},{"../constants/numerical":333,"./clean_number":338,"./coerce":339,"./dates":340,"./ensure_array":341,"./extend":343,"./filter_unique":344,"./filter_visible":345,"./geometry2d":347,"./get_graph_div":348,"./identity":349,"./is_array":351,"./is_plain_object":352,"./keyed_container":353,"./loggers":354,"./matrix":355,"./mod":356,"./nested_property":357,"./noop":358,"./notifier":359,"./push_unique":362,"./regex":364,"./relative_attr":365,"./relink_private":366,"./search":367,"./stats":369,"./throttle":371,"./to_log_range":372,d3:8,"fast-isnumeric":12}],351:[function(t,e,n){"use strict";var r="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}};e.exports=function(t){return Array.isArray(t)||r.isView(t)}},{}],352:[function(t,e,n){"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}},{}],353:[function(t,e,n){"use strict";var r=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,n,a){n=n||"name",a=a||"value";var o,s,l={};s=e&&e.length?r(t,e).get():t,e=e||"",s=s||[];var u={};for(o=0;o2)return l[e]=2|l[e],f.set(t,null);if(c){for(o=e;o1){for(var t=["LOG:"],e=0;e0){for(var t=["WARN:"],e=0;e0){for(var t=["ERROR:"],e=0;e=0;e--){if(r=t[e][0],a=t[e][1],l=!1,d(r))for(n=r.length-1;n>=0;n--)i(r[n],o(a,n))?l?r[n]=void 0:r.pop():l=!0;else if("object"==typeof r&&null!==r)for(s=Object.keys(r),l=!1,n=s.length-1;n>=0;n--)i(r[s[n]],o(a,s[n]))?delete r[s[n]]:l=!0;if(l)return}}function c(t){return void 0===t||null===t||"object"==typeof t&&(d(t)?!t.length:!Object.keys(t).length)}function f(t,e,n){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:n,obj:t}}var h=t("fast-isnumeric"),d=t("./is_array"),p=t("./is_plain_object"),m=t("../plot_api/container_array_match") ;e.exports=function(t,e){if(h(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var n,i,o,s=0,l=e.split(".");s/g),s=0;so||r===i||rl)&&(!e||!c(t))}function n(t,e){var n=t[0],u=t[1];if(n===i||no||u===i||ul)return!1;var c,f,h,d,p,m=r.length,g=r[0][0],y=r[0][1],v=0;for(c=1;cMath.max(f,g)||u>Math.max(h,y)))if(uc||Math.abs(r(o,h))>i)return!0;return!1};a.filter=function(t,e){function n(n){t.push(n);var s=r.length,l=i;r.splice(a+1);for(var u=l+1;u1){n(t.pop())}return{addPt:n,raw:t,filtered:r}}},{"../constants/numerical":333,"./matrix":355}],362:[function(t,e,n){"use strict";e.exports=function(t,e){if(e instanceof RegExp){var n,r=e.toString();for(n=0;na.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--)},o.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},o.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},o.undo=function(t){var e,n;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,n=0;n=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,n=0;ne}function o(t,e){return t>=e}var s=t("fast-isnumeric"),l=t("./loggers");n.findBin=function(t,e,n){if(s(e.start))return n?Math.ceil((t-e.start)/e.size)-1:Math.floor((t-e.start)/e.size);var u,c,f=0,h=e.length,d=0;for(c=e[e.length-1]>=e[0]?n?r:i:n?o:a;f90&&l.log("Long binary search..."),f-1},n.sorterAsc=function(t,e){return t-e},n.sorterDes=function(t,e){return e-t},n.distinctVals=function(t){var e=t.slice();e.sort(n.sorterAsc);for(var r=e.length-1,i=e[r]-e[0]||1,a=i/(r||1)/1e4,o=[e[0]],s=0;se[s]+a&&(i=Math.min(i,e[s+1]-e[s]),o.push(e[s+1]));return{vals:o,minDiff:i}},n.roundUp=function(t,e,n){for(var r,i=0,a=e.length-1,o=0,s=n?0:1,l=n?1:0,u=n?Math.ceil:Math.floor;it.length-1)return t[t.length-1];var n=e%1;return n*t[Math.ceil(e)]+(1-n)*t[Math.floor(e)]}},{"fast-isnumeric":12}],370:[function(t,e,n){"use strict";function r(t,e){return t.node().getBoundingClientRect()[e]}function i(t){return t.replace(y,"\\lt ").replace(v,"\\gt ")}function a(t,e,n){var r="math-output-"+h.randstr([],64),a=f.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(i(t));MathJax.Hub.Queue(["Typeset",MathJax.Hub,a.node()],function(){var e=f.select("body").select("#MathJax_SVG_glyphs");if(a.select(".MathJax_SVG").empty()||!a.select("svg").node())h.log("There was an error in the tex syntax.",t),n();else{var r=a.select("svg").node().getBoundingClientRect();n(a.select(".MathJax_SVG"),e,r)}a.remove()})}function o(t,e){if(!t)return null;var n=t.match(e);return n&&(n[3]||n[4])}function s(t,e){if(!t)return"";for(var n=0;n1)for(var i=1;i.",e);var n=u.pop();t!==n.type&&h.log("Start tag <"+n.type+"> doesnt match end tag <"+t+">. Pretending it did match.",e),a=u[u.length-1].node}(T);else{var O=v[4],F={type:T},R=o(O,z);if(R?(R=R.replace(P,"$1 fill:"),k&&(R+=";"+k)):k&&(R=k),R&&(F.style=R),"a"===T){s=!0;var j=o(O,I);if(j){var N=document.createElement("a");N.href=j,-1!==M.indexOf(N.protocol)&&(F.href=encodeURI(j),F.target=o(O,D)||"_blank",F.popup=o(O,C))}}r(F)}}return s}function c(t,e,n){var r,i,a,o=n.horizontalAlign,s=n.verticalAlign||"top",l=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return i="bottom"===s?function(){return l.bottom-r.height}:"middle"===s?function(){return l.top+(l.height-r.height)/2}:function(){return l.top},a="right"===o?function(){return l.right-r.width}:"center"===o?function(){return l.left+(l.width-r.width)/2}:function(){return l.left},function(){return r=this.node().getBoundingClientRect(),this.style({top:i()-u.top+"px",left:a()-u.left+"px","z-index":1e3}),this}}var f=t("d3"),h=t("../lib"),d=t("../constants/xmlns_namespaces"),p=t("../constants/string_mappings"),m=t("../constants/alignment").LINE_SPACING,g=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;n.convertToTspans=function(t,e,i){function o(){c.empty()||(h=t.attr("class")+"-math",c.select("svg."+h).remove()),t.text("").style("white-space","pre"),u(t.node(),s)&&t.style("pointer-events","all"),n.positionText(t),i&&i.call(t)}var s=t.text(),l=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&s.match(g),c=f.select(t.node().parentNode);if(!c.empty()){var h=t.attr("class")?t.attr("class").split(" ")[0]:"text";return h+="-math",c.selectAll("svg."+h).remove(),c.selectAll("g."+h+"-group").remove(),t.style("display",null).attr({"data-unformatted":s,"data-math":"N"}),l?(e&&e._promises||[]).push(new Promise(function(e){t.style("display","none");var n=parseInt(t.node().style.fontSize,10);a(l[2],{fontSize:n},function(a,l,u){c.selectAll("svg."+h).remove(),c.selectAll("g."+h+"-group").remove();var f=a&&a.select("svg");if(!f||!f.node())return o(),void e();var d=c.append("g").classed(h+"-group",!0).attr({"pointer-events":"none","data-unformatted":s,"data-math":"Y"});d.node().appendChild(f.node()),l&&l.node()&&f.node().insertBefore(l.node().cloneNode(!0),f.node().firstChild),f.attr({class:h,height:u.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var p=t.node().style.fill||"black";f.select("g").attr({fill:p,stroke:p});var m=r(f,"width"),g=r(f,"height"),y=+t.attr("x")-m*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],v=n||r(t,"height"),x=-v/4;"y"===h[0]?(d.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-m/2,x-g/2]+")"}),f.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===h[0]?f.attr({x:t.attr("x"),y:x-g/2}):"a"===h[0]?f.attr({x:0,y:x}):f.attr({x:y,y:+t.attr("y")+x-g/2}),i&&i.call(t,d),e(d)})})):o(),t}};var y=/(<|<|<)/g,v=/(>|>|>)/g,x={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},_={sub:"0.3em",sup:"-0.6em"},b={sub:"-0.21em",sup:"0.42em"},w="\u200b",M=["http:","https:","mailto:","",void 0,":"],T=new RegExp("]*)?/?>","g"),k=Object.keys(p.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:p.entityToUnicode[t]}}),A=/(\r\n?|\n)/g,S=/(<[^<>]*>)/,E=/<(\/?)([^ >]*)(\s+(.*))?>/i,L=//i,z=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,I=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,D=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,C=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i,P=/(^|;)\s*color:/;n.plainText=function(t){return(t||"").replace(T," ")},n.lineCount=function(t){return t.selectAll("tspan.line").size()||1},n.positionText=function(t,e,n){return t.each(function(){function t(t,e){return void 0===e?null===(e=r.attr(t))&&(r.attr(t,0),e=0):r.attr(t,e),e}var r=f.select(this),i=t("x",e),a=t("y",n);"text"===this.nodeName&&r.selectAll("tspan.line").attr({x:i,y:a})})},n.makeEditable=function(t,e){function n(){i(),t.style({opacity:0});var e,n=l.attr("class");(e=n?"."+n.split(" ")[0]+"-math-group":"[class*=-math-group]")&&f.select(t.node().parentNode).select(e).style({opacity:0})}function r(t){var e=t.node(),n=document.createRange();n.selectNodeContents(e);var r=window.getSelection();r.removeAllRanges(),r.addRange(n),e.focus()}function i(){var n=f.select(a),i=n.select(".svg-container"),o=i.append("div"),l=t.node().style,u=parseFloat(l.fontSize||12);o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":l.fontFamily||"Arial","font-size":u,color:e.fill||l.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-u/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(e.text||t.attr("data-unformatted")).call(c(t,i,e)).on("blur",function(){a._editing=!1,t.text(this.textContent).style({opacity:1});var e,n=f.select(this).attr("class");(e=n?"."+n.split(" ")[0]+"-math-group":"[class*=-math-group]")&&f.select(t.node().parentNode).select(e).style({opacity:0});var r=this.textContent;f.select(this).transition().duration(0).remove(),f.select(document).on("mouseup",null),s.edit.call(t,r)}).on("focus",function(){var t=this;a._editing=!0,f.select(document).on("mouseup",function(){if(f.event.target===t)return!1;document.activeElement===o.node()&&o.node().blur()})}).on("keyup",function(){27===f.event.which?(a._editing=!1,t.style({opacity:1}),f.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),s.cancel.call(t,this.textContent)):(s.input.call(t,this.textContent),f.select(this).call(c(t,i,e)))}).on("keydown",function(){13===f.event.which&&this.blur()}).call(r)}var a=e.gd,o=e.delegate,s=f.dispatch("edit","input","cancel"),l=o||t;if(t.style({"pointer-events":o?"none":"all"}),1!==t.size())throw new Error("boo");return e.immediate?n():l.on("click",n),f.rebind(t,s,"on")}},{"../constants/alignment":331,"../constants/string_mappings":334,"../constants/xmlns_namespaces":335,"../lib":350,d3:8}],371:[function(t,e,n){"use strict";function r(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}var i={};n.throttle=function(t,e,n){function a(){n(),o.ts=Date.now(),o.onDone&&(o.onDone(),o.onDone=null)}var o=i[t],s=Date.now();if(!o){for(var l in i)i[l].tso.ts+e)return void a();o.timer=setTimeout(function(){a(),o.timer=null},e)},n.done=function(t){var e=i[t];return e&&e.timer?new Promise(function(t){var n=e.onDone;e.onDone=function(){n&&n(),t(),e.onDone=null}}):Promise.resolve()},n.clear=function(t){if(t)r(i[t]),delete i[t];else for(var e in i)n.clear(e)}},{}],372:[function(t,e,n){"use strict";var r=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var n=Math.log(Math.min(e[0],e[1]))/Math.LN10;return r(n)||(n=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),n}},{"fast-isnumeric":12}],373:[function(t,e,n){"use strict";var r=t("../registry");e.exports=function(t){for(var e,n,i=r.layoutArrayContainers,a=r.layoutArrayRegexes,o=t.split("[")[0],s=0;s0)return t.substr(0,e)}var s=t("fast-isnumeric"),l=t("gl-mat4/fromQuat"),u=t("../registry"),c=t("../lib"),f=t("../plots/plots"),h=t("../plots/cartesian/axes"),d=t("../components/color");n.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&c.log("Clearing previous rejected promises from queue."),t._promises=[]},n.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1);var i=h.list({_fullLayout:t});for(e=0;e3?(g.x=1.02,g.xanchor="left"):g.x<-2&&(g.x=-.02,g.xanchor="right"),g.y>3?(g.y=1.02,g.yanchor="bottom"):g.y<-2&&(g.y=-.02,g.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var y=f.getSubplotIds(t,"gl3d");for(e=0;e1&&o.warn("Full array edits are incompatible with other edits",f);var v=n[""][""];if(c(v))e.set(null);else{if(!Array.isArray(v))return o.warn("Unrecognized full array edit value",f,v),!0;e.set(v)}return!m&&(h(g,y),d(t),!0)}var x,_,b,w,M,T,k,A=Object.keys(n).map(Number).sort(s),S=e.get(),E=S||[],L=r(y,f).get(),z=[],I=-1,D=E.length;for(x=0;xE.length-(k?0:1))o.warn("index out of range",f,b);else if(void 0!==T)M.length>1&&o.warn("Insertion & removal are incompatible with edits to the same index.",f,b),c(T)?z.push(b):k?("add"===T&&(T={}),E.splice(b,0,T),L&&L.splice(b,0,{})):o.warn("Unrecognized full object edit value",f,b,T),-1===I&&(I=b);else for(_=0;_=0;x--)E.splice(z[x],1),L&&L.splice(z[x],1);if(E.length?S||e.set(E):e.set(null),m)return!1;if(h(g,y),p!==a){var C;if(-1===I)C=A;else{for(D=Math.max(E.length,D),C=[],x=0;x=I);x++)C.push(b);for(x=I;x=t.data.length||i<-t.data.length)throw new Error(n+" must be valid indices for gd.data.");if(e.indexOf(i,r+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+n+" must be unique.")}}function u(t,e,n){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),l(t,e,"currentIndices"),void 0===n||Array.isArray(n)||(n=[n]),void 0!==n&&l(t,n,"newIndices"),void 0!==n&&e.length!==n.length)throw new Error("current and new indices must be of equal length.")}function c(t,e,n){var r,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),r=0;r=0&&lZ.range[0]?[1,2]:[2,1]);else{var W=Z.range[0],Q=Z.range[1];X?(W<=0&&Q<=0&&n(P+".autorange",!0),W<=0?W=Q/1e6:Q<=0&&(Q=W/1e6),n(P+".range[0]",Math.log(W)/Math.LN10),n(P+".range[1]",Math.log(Q)/Math.LN10)):(n(P+".range[0]",Math.pow(10,W)),n(P+".range[1]",Math.pow(10,Q)))}else n(P+".autorange",!0);k.getComponentMethod("annotations","convertCoords")(t,B,L,n),k.getComponentMethod("images","convertCoords")(t,B,L,n)}else n(P+".autorange",!0),n(P+".range",null);w.nestedProperty(u,P+"._inputRange").set(null)}else if(D.match(N.AX_NAME_PATTERN)){var J=w.nestedProperty(u,T).get(),$=(L||{}).type;$&&"-"!==$||($="linear"),k.getComponentMethod("annotations","convertCoords")(t,J,$,n),k.getComponentMethod("images","convertCoords")(t,J,$,n)}var K=O.containerArrayMatch(T);if(K){a=K.array,o=K.index;var tt=K.property,et=w.nestedProperty(l,a),nt=(et||[])[o]||{},rt=nt,it=q||{editType:"calc"},at=-1!==it.editType.indexOf("calcIfAutorange");""===o?(at?v.calc=!0:j.update(v,it),at=!1):""===tt&&(rt=L,O.isAddVal(L)?_[T]=null:O.isRemoveVal(L)?(_[T]=nt,rt=nt):w.warn("unrecognized full object value",e)),at&&(r(rt,"x")||r(rt,"y"))?v.calc=!0:j.update(v,it),h[a]||(h[a]={});var ot=h[a][o];ot||(ot=h[a][o]={}),ot[tt]=L,delete e[T]}else"reverse"===D?(R.range?R.range.reverse():(n(P+".autorange",!0),R.range=[1,0]),B.autorange?v.calc=!0:v.plot=!0):((!u._has("gl2d")||"dragmode"!==T||"lasso"!==L&&"select"!==L||"lasso"===V||"select"===V)&&q?j.update(v,q):v.calc=!0,E.set(L))}}for(a in h){O.applyContainerArrayChanges(t,w.nestedProperty(l,a),h[a],v)||(v.plot=!0)}var st=u._axisConstraintGroups;for(y in M)for(o=0;o=s.length?s[0]:s[t]:s}function i(t){return Array.isArray(l)?t>=l.length?l[0]:l[t]:l}function a(t,e){var n=0;return function(){if(t&&++n===e)return t()}}if(t=w.getGraphDiv(t),!w.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 o=t._transitionData;o._frameQueue||(o._frameQueue=[]),n=S.supplyAnimationDefaults(n);var s=n.transition,l=n.frame;return void 0===o._frameWaitingCnt&&(o._frameWaitingCnt=0),new Promise(function(l,u){function c(){t.emit("plotly_animated"),window.cancelAnimationFrame(o._animationRaf),o._animationRaf=null}function f(){o._currentFrame&&o._currentFrame.onComplete&&o._currentFrame.onComplete();var e=o._currentFrame=o._frameQueue.shift();if(e){var n=e.name?e.name.toString():null;t._fullLayout._currentFrame=n,o._lastFrameAt=Date.now(),o._timeToNext=e.frameOpts.duration,S.transition(t,e.frame.data,e.frame.layout,F.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then(function(){e.onComplete&&e.onComplete()}),t.emit("plotly_animatingframe",{name:n,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else c()}function h(){t.emit("plotly_animating"),o._lastFrameAt=-1/0,o._timeToNext=0,o._runningTransitions=0,o._currentFrame=null;var e=function(){o._animationRaf=window.requestAnimationFrame(e),Date.now()-o._lastFrameAt>o._timeToNext&&f()};e()}function d(t){return Array.isArray(s)?g>=s.length?t.transitionOpts=s[g]:t.transitionOpts=s[0]:t.transitionOpts=s,g++,t}var p,m,g=0,y=[],v=void 0===e||null===e,x=Array.isArray(e);if(v||x||!w.isPlainObject(e)){if(v||-1!==["string","number"].indexOf(typeof e))for(p=0;p0&&MM)&&T.push(m);y=T}}y.length>0?function(e){if(0!==e.length){for(var s=0;s=0;i--)if(w.isPlainObject(e[i])){var h=(u[e[i].name]||{}).name,d=e[i].name;h&&d&&"number"==typeof d&&u[h]&&(r++,w.warn('addFrames: overwriting frame "'+u[h].name+'" with a frame whose name of type "number" also equates to "'+h+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),r>5&&w.warn("addFrames: This API call has yielded too many warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),f.push({frame:S.supplyFrameDefaults(e[i]),index:n&&void 0!==n[i]&&null!==n[i]?n[i]:c+i})}f.sort(function(t,e){return t.index>e.index?-1:t.index=0;i--){if(a=f[i].frame,"number"==typeof a.name&&w.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+t._transitionData._counter++];);if(u[a.name]){for(o=0;o=0;n--)r=e[n],a.push({type:"delete",index:r}),o.unshift({type:"insert",index:r,value:i[r]});var s=S.modifyFrames,l=S.modifyFrames,u=[t,o],c=[t,a];return T&&T.add(t,s,u,l,c),S.modifyFrames(t,a)},b.purge=function(t){t=w.getGraphDiv(t);var e=t._fullLayout||{},n=t._fullData||[];return S.cleanPlot([],{},n,e),S.purge(t),M.purge(t),e._container&&e._container.remove(),delete t._context,t}},{"../components/color":234,"../components/drawing":258,"../components/errorbars":264,"../constants/xmlns_namespaces":335,"../lib":350,"../lib/events":342,"../lib/queue":363,"../lib/svg_text_utils":370,"../plotly":385,"../plots/cartesian/axis_ids":393,"../plots/cartesian/constants":395,"../plots/cartesian/constraints":397,"../plots/cartesian/graph_interact":399,"../plots/plots":426,"../plots/polar":429,"../registry":434,"./edit_types":374,"./helpers":375,"./manage_arrays":376,"./plot_schema":379,"./subroutines":382,d3:8,"fast-isnumeric":12,"has-hover":36}],378:[function(t,e,n){"use strict";e.exports={staticPlot:!1,editable:!1,edits:{annotationPosition:!1,annotationTail:!1,annotationText:!1,axisTitleText:!1,colorbarPosition:!1,colorbarTitleText:!1,legendPosition:!1,legendText:!1,shapePosition:!1,titleText:!1},autosizable:!1,queueLength:0,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showAxisDragHandles:!0,showAxisRangeEntryBoxes:!0,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:"transparent",topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:!1,globalTransforms:[]}},{}],379:[function(t,e,n){"use strict";function r(t,e){var n,r,i,a,o=t._basePlotModules;if(o){var s;for(n=0;n=t.items.length)return!1;t=t.items[i]}}return t}function a(t){return t===Math.round(t)&&t>=0}function o(t){var e,n;"area"===t?(e={attributes:w},n={}):(e=g.modules[t]._module,n=e.basePlotModule);var r={};r.type=null,A(r,v),A(r,e.attributes),n.attributes&&A(r,n.attributes),r.type=t;var i={meta:e.meta||{},attributes:c(r)};if(e.layoutAttributes){var a={};A(a,e.layoutAttributes),i.layoutAttributes=c(a)}return i}function s(){var t,e,n={};A(n,x);for(t in g.subplotsRegistry)if(e=g.subplotsRegistry[t],e.layoutAttributes)if("cartesian"===e.name)p(n,e,"xaxis"),p(n,e,"yaxis");else{var r="subplot"===e.attr?e.name:e.attr;p(n,e,r)}n=d(n);for(t in g.componentsRegistry){e=g.componentsRegistry[t];var i=e.schema;if(i&&(i.subplots||i.layout)){var a=i.subplots;if(a&&a.xaxis&&!a.yaxis)for(var o in a.xaxis)delete n.yaxis[o]}else e.layoutAttributes&&m(n,e.layoutAttributes,e.name)}return{layoutAttributes:c(n)}}function l(t){var e=g.transformsRegistry[t],n=A({},e.attributes);return Object.keys(g.componentsRegistry).forEach(function(e){var r=g.componentsRegistry[e];r.schema&&r.schema.transforms&&r.schema.transforms[t]&&Object.keys(r.schema.transforms[t]).forEach(function(e){m(n,r.schema.transforms[t][e],e)})}),{attributes:c(n)}}function u(){var t={frames:y.extendDeepAll({},_)};return c(t),t.frames}function c(t){return f(t),h(t),t}function f(t){function e(t){return{valType:"string",editType:"none"}}function r(t,r,i){n.isValObject(t)?"data_array"===t.valType?(t.role="data",i[r+"src"]=e(r)):!0===t.arrayOk&&(i[r+"src"]=e(r)):y.isPlainObject(t)&&(t.role="object")}n.crawl(t,r)}function h(t){function e(t,e,n){if(t){var r=t[E];r&&(delete t[E],n[e]={items:{}},n[e].items[r]=t,n[e].role="object")}}n.crawl(t,e)}function d(t){return k(t,{radialaxis:M.radialaxis,angularaxis:M.angularaxis}),k(t,M.layout),t}function p(t,e,n){var r=y.nestedProperty(t,n),i=A({},e.layoutAttributes);i[S]=!0,r.set(i)}function m(t,e,n){var r=y.nestedProperty(t,n);r.set(A(r.get()||{},e))}var g=t("../registry"),y=t("../lib"),v=t("../plots/attributes"),x=t("../plots/layout_attributes"),_=t("../plots/frame_attributes"),b=t("../plots/animation_attributes"),w=t("../plots/polar/area_attributes"),M=t("../plots/polar/axis_attributes"),T=t("./edit_types"),k=y.extendFlat,A=y.extendDeepAll,S="_isSubplotObj",E="_isLinkedToArray",L=[S,E,"_arrayAttrRegexps","_deprecated"];n.IS_SUBPLOT_OBJ=S,n.IS_LINKED_TO_ARRAY=E,n.DEPRECATED="_deprecated",n.UNDERSCORE_ATTRS=L,n.get=function(){var t={};g.allTypes.concat("area").forEach(function(e){t[e]=o(e)});var e={};return Object.keys(g.transformsRegistry).forEach(function(t){e[t]=l(t)}),{defs:{valObjects:y.valObjectMeta,metaKeys:L.concat(["description","role","editType","impliedEdits"]),editType:{traces:T.traces,layout:T.layout},impliedEdits:{}},traces:t,layout:s(),transforms:e,frames:u(),animation:c(b)}},n.crawl=function(t,e,r,i){var a=r||0;i=i||"",Object.keys(t).forEach(function(r){var o=t[r];if(-1===L.indexOf(r)){var s=(i?i+".":"")+r;e(o,r,t,a,s),n.isValObject(o)||y.isPlainObject(o)&&"impliedEdits"!==r&&n.crawl(o,e,a+1,s)}})},n.isValObject=function(t){return t&&void 0!==t.valType},n.findArrayAttributes=function(t){function e(e,n,o,s){if(a=a.slice(0,s).concat([n]),e&&("data_array"===e.valType||!0===e.arrayOk)&&!("colorbar"===a[s-1]&&("ticktext"===n||"tickvals"===n))){var l=r(a),u=y.nestedProperty(t,l).get();Array.isArray(u)&&i.push(l)}}function r(t){return t.join(".")}var i=[],a=[];if(n.crawl(v,e),t._module&&t._module.attributes&&n.crawl(t._module.attributes,e),t.transforms)for(var o=t.transforms,s=0;s=t.transforms.length)return!1 ;n=(g.transformsRegistry[t.transforms[l].type]||{}).attributes,r=n&&n[e[2]],s=3}else if("area"===t.type)r=w[o];else{var u=t._module;if(u||(u=(g.modules[t.type||v.type.dflt]||{})._module),!u)return!1;if(n=u.attributes,!(r=n&&n[o])){var c=u.basePlotModule;c&&c.attributes&&(r=c.attributes[o])}r||(r=v[o])}return i(r,e,s)},n.getLayoutValObject=function(t,e){return i(r(t,e[0]),e,1)}},{"../lib":350,"../plots/animation_attributes":386,"../plots/attributes":388,"../plots/frame_attributes":415,"../plots/layout_attributes":417,"../plots/polar/area_attributes":427,"../plots/polar/axis_attributes":428,"../registry":434,"./edit_types":374}],380:[function(t,e,n){"use strict";function r(t){o.register(t,t.name,t.categories,t.meta),o.subplotsRegistry[t.basePlotModule.name]||o.registerSubplot(t.basePlotModule)}function i(t){if("string"!=typeof t.name)throw new Error("Transform module *name* must be a string.");var e="Transform module "+t.name,n="function"==typeof t.transform,r="function"==typeof t.calcTransform;if(!n&&!r)throw new Error(e+" is missing a *transform* or *calcTransform* method.");n&&r&&s.log([e+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),s.isPlainObject(t.attributes)||s.log(e+" registered without an *attributes* object."),"function"!=typeof t.supplyDefaults&&s.log(e+" registered without a *supplyDefaults* method."),o.registerTransform(t)}function a(t){if("string"!=typeof t.name)throw new Error("Component module *name* must be a string.");o.registerComponent(t)}var o=t("../registry"),s=t("../lib");e.exports=function(t){if(!t)throw new Error("No argument passed to Plotly.register.");t&&!Array.isArray(t)&&(t=[t]);for(var e=0;e=t[1]||i[1]<=t[0])&&(a[0]e[0]))return!0}return!1}function i(t,e,n){return t._anchorAxis===e&&(t.mirror||t.side===n)||"all"===t.mirror||"allticks"===t.mirror||t.mirrors&&t.mirrors[e._id+n]}function a(t,e,n){var r=[],i=e._anchorAxis;if(i){var a=i._mainAxis;if(-1===r.indexOf(a)){r.push(a);for(var o=0;o1&&l.push(o("object","layout"))),h.supplyDefaults(u);for(var c=u._fullData,g=n.length,y=0;y.3*f||a(r)||a(i))){var h=n.dtick/2;t+=t+h.8){var o=Number(n.substr(1));a.exactYears>.8&&o%12==0?t=B.tickIncrement(t,"M6","reverse")+1.5*P:a.exactMonths>.8?t=B.tickIncrement(t,"M1","reverse")+15.5*P:t-=P/2;var s=B.tickIncrement(t,n);if(s<=r)return s}return t}function s(t){var e,n,r=t.tickvals,i=t.ticktext,a=new Array(r.length),o=k.simpleMap(t.range,t.r2l),s=1.0001*o[0]-1e-4*o[1],l=1.0001*o[1]-1e-4*o[0],u=Math.min(s,l),f=Math.max(s,l),h=0;Array.isArray(i)||(i=[]);var d="category"===t.type?t.d2l_noadd:t.d2l;for("log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1)),n=0;nu&&e10||"01-01"!==r.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=P&&i<=10||e>=15*P)t._tickround="d";else if(e>=F&&i<=16||e>=O)t._tickround="M";else if(e>=R&&i<=19||e>=F)t._tickround="S";else{var a=t.l2r(n+e).replace(/^-/,"").length;t._tickround=Math.max(i,a)-20}}else if(M(e)||"L"===e.charAt(0)){var o=t.range.map(t.r2d||Number);M(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var s=Math.max(Math.abs(o[0]),Math.abs(o[1])),l=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(l)>3&&(m(t.exponentformat)&&!g(l)?t._tickexponent=3*Math.round((l-1)/3):t._tickexponent=l)}else t._tickround=null}function c(t,e,n){var r=t.tickfont||{};return{x:e,dx:0,dy:0,text:n||"",fontSize:r.size,font:r.family,fontColor:r.color}}function f(t,e,n,r){var i=t._tickround,a=n&&t.hoverformat||t.tickformat;r&&(i=M(i)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[i]);var o,s=k.formatDate(e.x,a,i,t.calendar),l=s.indexOf("\n");-1!==l&&(o=s.substr(l+1),s=s.substr(0,l)),r&&("00:00:00"===s||"00:00"===s?(s=o,o=""):8===s.length&&(s=s.replace(/:00$/,""))),o&&(n?"d"===i?s+=", "+o:s=o+(s?", "+s:""):t._inCalcTicks&&o===t._prevDateHead||(s+="
"+o,t._prevDateHead=o)),e.text=s}function h(t,e,n,r,i){var a=t.dtick,o=e.x;if("never"===i&&(i=""),!r||"string"==typeof a&&"L"===a.charAt(0)||(a="L3"),t.tickformat||"string"==typeof a&&"L"===a.charAt(0))e.text=y(Math.pow(10,o),t,i,r);else if(M(a)||"D"===a.charAt(0)&&k.mod(o+.01,1)<.1){var s=Math.round(o);-1!==["e","E","power"].indexOf(t.exponentformat)||m(t.exponentformat)&&g(s)?(e.text=0===s?1:1===s?"10":s>1?"10"+s+"":"10"+j+-s+"",e.fontSize*=1.25):(e.text=y(Math.pow(10,o),t,"","fakehover"),"D1"===a&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==a.charAt(0))throw"unrecognized dtick "+String(a);e.text=String(Math.round(Math.pow(10,k.mod(o,1)))),e.fontSize*=.75}if("D1"===t.dtick){var l=String(e.text).charAt(0);"0"!==l&&"1"!==l||("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*(o<0?.5:.25)))}}function d(t,e){var n=t._categories[Math.round(e.x)];void 0===n&&(n=""),e.text=String(n)}function p(t,e,n,r,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=y(e.x,t,i,r)}function m(t){return"SI"===t||"B"===t}function g(t){return t>14||t<-15}function y(t,e,n,r){var i=t<0,a=e._tickround,o=n||e.exponentformat||"B",s=e._tickexponent,l=e.tickformat,c=e.separatethousands;if(r){var f={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:M(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};u(f),a=(Number(f._tickround)||0)+4,s=f._tickexponent,e.hoverformat&&(l=e.hoverformat)}if(l)return w.format(l)(t).replace(/-/g,j);var h=Math.pow(10,-a)/2;if("none"===o&&(s=0),(t=Math.abs(t))"+y+"":"B"===o&&9===s?t+="B":m(o)&&(t+=Q[s/3+5])}return i?j+t:t}function v(t,e){var n,r,i=[];for(n=0;n1)for(r=1;r2e-6||((n-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},B.getAutoRange=function(t){var e,n=[],r=t._min[0].val,i=t._max[0].val;for(e=1;e0&&c>0&&f/c>h&&(l=o,u=s,h=f/c);if(r===i){var m=r-1,g=r+1;n="tozero"===t.rangemode?r<0?[m,0]:[0,g]:"nonnegative"===t.rangemode?[Math.max(0,m),Math.max(0,g)]:[m,g]}else h&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(l.val>=0&&(l={val:0,pad:0}),u.val<=0&&(u={val:0,pad:0})):"nonnegative"===t.rangemode&&(l.val-h*l.pad<0&&(l={val:0,pad:0}),u.val<0&&(u={val:1,pad:0})),h=(u.val-l.val)/(t._length-l.pad-u.pad)),n=[l.val-h*l.pad,u.val+h*u.pad]);return n[0]===n[1]&&("tozero"===t.rangemode?n=n[0]<0?[n[0],0]:n[0]>0?[0,n[0]]:[0,1]:(n=[n[0]-1,n[0]+1],"nonnegative"===t.rangemode&&(n[0]=Math.max(0,n[0])))),d&&n.reverse(),k.simpleMap(n,t.l2r||Number)},B.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=B.getAutoRange(t),t._r=t.range.slice(),t._rl=k.simpleMap(t._r,t.r2l);var n=t._input;n.range=t.range.slice(),n.autorange=t.autorange}},B.saveRangeInitial=function(t,e){for(var n=B.list(t,"",!0),r=!1,i=0;i=h?d=!1:s.val>=u&&s.pad<=h&&(t._min.splice(o,1),o--);d&&t._min.push({val:u,pad:v&&0===u?0:h})}if(r(c)){for(d=!0,o=0;o=c&&s.pad>=f?d=!1:s.val<=c&&s.pad<=f&&(t._max.splice(o,1),o--);d&&t._max.push({val:c,pad:v&&0===c?0:f})}}}if((t.autorange||!!k.nestedProperty(t,"rangeslider.autorange").get())&&e){t._min||(t._min=[]),t._max||(t._max=[]),n||(n={}),t._m||t.setScale();var a,o,s,l,u,c,f,h,d,p,m,g=e.length,y=n.padded?.05*t._length:0,v=n.tozero&&("linear"===t.type||"-"===t.type);y&&"domain"===t.constrain&&t._inputDomain&&(y*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0]));var x=r((t._m>0?n.ppadplus:n.ppadminus)||n.ppad||0),_=r((t._m>0?n.ppadminus:n.ppadplus)||n.ppad||0),b=r(n.vpadplus||n.vpad),w=r(n.vpadminus||n.vpad);for(a=0;a<6;a++)i(a);for(a=g-1;a>5;a--)i(a)}},B.autoBin=function(t,e,n,r,i){var s=k.aggNums(Math.min,null,t),l=k.aggNums(Math.max,null,t);if(i||(i=e.calendar),"category"===e.type)return{start:s-.5,end:l+.5,size:1,_count:l-s+1};var u;if(n)u=(l-s)/n;else{var c=k.distinctVals(t),f=Math.pow(10,Math.floor(Math.log(c.minDiff)/Math.LN10)),h=f*k.roundUp(c.minDiff/f,[.9,1.9,4.9,9.9],!0);u=Math.max(h,2*k.stdev(t)/Math.pow(t.length,r?.25:.4)),M(u)||(u=1)}var d;d="log"===e.type?{type:"linear",range:[s,l]}:{type:e.type,range:k.simpleMap([s,l],e.c2r,0,i),calendar:i},B.setConvert(d),B.autoTicks(d,u);var p,m,g=B.tickIncrement(B.tickFirst(d),d.dtick,"reverse",i);if("number"==typeof d.dtick)g=a(g,t,d,s,l),m=1+Math.floor((l-g)/d.dtick),p=g+m*d.dtick;else for("M"===d.dtick.charAt(0)&&(g=o(g,t,d.dtick,s,i)),p=g,m=0;p<=l;)p=B.tickIncrement(p,d.dtick,!1,i),m++;return{start:e.c2r(g,0,i),end:e.c2r(p,0,i),size:d.dtick,_count:m}},B.calcTicks=function(t){var e=k.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var n,r=t.nticks;r||("category"===t.type?(n=t.tickfont?1.2*(t.tickfont.size||12):15,r=t._length/n):(n="y"===t._id.charAt(0)?40:80,r=k.constrain(t._length/n,4,9)+1)),"array"===t.tickmode&&(r*=100),B.autoTicks(t,Math.abs(e[1]-e[0])/r),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}if(t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),u(t),"array"===t.tickmode)return s(t);t._tmin=B.tickFirst(t);var i=e[1]=o:f<=o)&&!(a.length>c||f===l);f=B.tickIncrement(f,t.dtick,i,t.calendar))l=f,a.push(f);t._tmax=a[a.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var h=new Array(a.length),d=0;dD?(e/=D,n=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*l(e,n,G)):r>C?(e/=C,t.dtick="M"+l(e,1,H)):r>P?(t.dtick=l(e,P,X),t.tick0=k.dateTick0(t.calendar,!0)):r>O?t.dtick=l(e,O,H):r>F?t.dtick=l(e,F,Z):r>R?t.dtick=l(e,R,Z):(n=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=l(e,n,G))}else if("log"===t.type){t.tick0=0;var i=k.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(i[1]-i[0])<1){var a=1.5*Math.abs((i[1]-i[0])/e);e=Math.abs(Math.pow(10,i[1])-Math.pow(10,i[0]))/a,n=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+l(e,n,G)}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,n=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=l(e,n,G));if(0===t.dtick&&(t.dtick=1),!M(t.dtick)&&"string"!=typeof t.dtick){var o=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(o)}},B.tickIncrement=function(t,e,n,r){var i=n?-1:1;if(M(e))return t+i*e;var a=e.charAt(0),o=i*Number(e.substr(1));if("M"===a)return k.incrementMonth(t,o,r);if("L"===a)return Math.log(Math.pow(10,t)+o)/Math.LN10;if("D"===a){var s="D2"===e?W:Y,l=t+.01*i,u=k.roundUp(k.mod(l,1),s,n);return Math.floor(l)+Math.log(w.round(Math.pow(10,u),1))/Math.LN10}throw"unrecognized dtick "+String(e)},B.tickFirst=function(t){var e=t.r2l||Number,n=k.simpleMap(t.range,e),r=n[1]1&&e2*i}function a(t){for(var e,n=Math.max(1,(t.length-1)/1e3),r=0,i=0,a=0;a2*r}var o=t("fast-isnumeric"),s=t("../../lib"),l=t("../../constants/numerical").BADNUM;e.exports=function(t,e){return i(t,e)?"date":a(t)?"category":r(t)?"linear":"-"}},{"../../constants/numerical":333,"../../lib":350,"fast-isnumeric":12}],392:[function(t,e,n){"use strict";var r=t("tinycolor2").mix,i=t("../../registry"),a=t("../../lib"),o=t("../../components/color/attributes").lightFraction,s=t("./layout_attributes"),l=t("./tick_value_defaults"),u=t("./tick_mark_defaults"),c=t("./tick_label_defaults"),f=t("./category_order_defaults"),h=t("./set_convert"),d=t("./ordered_categories");e.exports=function(t,e,n,p,m){function g(n,r){return a.coerce2(t,e,s,n,r)}var y=p.letter,v=p.font||{},x="Click to enter "+(p.title||y.toUpperCase()+" axis")+" title",_=n("visible",!p.cheateronly),b=e.type;if("date"===b){i.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",p.calendar)}if(h(e,m),n("autorange",!e.isValidRange(t.range))&&n("rangemode"),n("range"),e.cleanRange(),f(t,e,n),e._initialCategories="category"===b?d(y,e.categoryorder,e.categoryarray,p.data):[],!_)return e;var w=n("color"),M=w===t.color?w:v.color;n("title",x),a.coerceFont(n,"titlefont",{family:v.family,size:Math.round(1.2*v.size),color:M}),l(t,e,n,b),c(t,e,n,b,p),u(t,e,n,p);var T=g("linecolor",w),k=g("linewidth"),A=n("showline",!!T||!!k);A||(delete e.linecolor,delete e.linewidth),(A||e.ticks)&&n("mirror");var S=g("gridcolor",r(w,p.bgColor,o).toRgbString()),E=g("gridwidth");n("showgrid",p.showGrid||!!S||!!E)||(delete e.gridcolor,delete e.gridwidth);var L=g("zerolinecolor",w),z=g("zerolinewidth");return n("zeroline",p.showGrid||!!L||!!z)||(delete e.zerolinecolor,delete e.zerolinewidth),e}},{"../../components/color/attributes":233,"../../lib":350,"../../registry":434,"./category_order_defaults":394,"./layout_attributes":401,"./ordered_categories":403,"./set_convert":407,"./tick_label_defaults":408,"./tick_mark_defaults":409,"./tick_value_defaults":410,tinycolor2:200}],393:[function(t,e,n){"use strict";function r(t,e,n){function r(t,n){for(var r=Object.keys(t),i=/^[xyz]axis[0-9]*/,a=[],o=0;o0;a&&(r="array");var o=n("categoryorder",r);"array"===o&&n("categoryarray"),a||"array"!==o||(e.categoryorder="trace")}}},{}],395:[function(t,e,n){"use strict";var r=t("../../lib").counterRegex;e.exports={idRegex:{x:r("x"),y:r("y")},attrRegex:r("[xy]axis"),xAxisMatch:r("xaxis"),yAxisMatch:r("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,SELECTDELAY:100,SELECTID:"-select",DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","maplayer","barlayer","carpetlayer","boxlayer","scatterlayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},{"../../lib":350}],396:[function(t,e,n){"use strict";function r(t,e,n,r){var i,a,s,l,u=r[o(e)].type,c=[];for(a=0;ao*y)||b)for(n=0;nI&&CL&&(L=C);var F=(L-E)/(2*z);f/=F,E=l.l2r(E),L=l.l2r(L),l.range=l._input.range=k=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function u(t,e){return t?"nsew"===t?"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}function c(t,e,n,r,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+n+", "+r+")").attr("d",i+"Z")}function f(t,e,n){return t.append("path").attr("class","zoombox-corners").style({fill:A.background,stroke:A.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+n+")").attr("d","M0,0Z")}function h(t){t.selectAll(".select-outline").remove()}function d(t,e,n,r,i,a){t.attr("d",r+"M"+n.l+","+n.t+"v"+n.h+"h"+n.w+"v-"+n.h+"h-"+n.w+"Z"),i||(t.transition().style("fill",a>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function p(t){_.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function m(t){return-1!==["lasso","select"].indexOf(t)}function g(t,e){return"M"+(t.l-.5)+","+(e-j-.5)+"h-3v"+(2*j+1)+"h3ZM"+(t.r+.5)+","+(e-j-.5)+"h3v"+(2*j+1)+"h-3Z"}function y(t,e){return"M"+(e-j-.5)+","+(t.t-.5)+"v-3h"+(2*j+1)+"v3ZM"+(e-j-.5)+","+(t.b+.5)+"v3h"+(2*j+1)+"v-3Z"}function v(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,j)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function x(t,e,n){var r,i,a,o,s,l,u=!1,c={},f={};for(r=0;rj||s>j?(Tt="xy",o/at>s/ot?(s=o*ot/at,xt>a?_t.t=xt-s:_t.b=xt+s):(o=s*at/ot,vt>i?_t.l=vt-o:_t.r=vt+o),At.attr("d",v(_t))):r():!lt||szoom back out","long"),N=!1)}function X(e,n){var r=1===(V+q).length;if(e)$();else if(2!==n||r){if(1===n&&r){var i=V?nt[0]:et[0],o="s"===V||"w"===q?0:1,s=i._name+".range["+o+"]",l=a(i,o),u="left",c="middle";if(i.fixedrange)return;V?(c="n"===V?"top":"bottom","right"===i.side&&(u="right")):"e"===q&&(u="right"),t._context.showAxisRangeEntryBoxes&&_.select(gt).call(k.makeEditable,{gd:t,immediate:!0,background:dt.paper_bgcolor,text:String(l),fill:i.tickfont?i.tickfont.color:"#444",horizontalAlign:u,verticalAlign:c}).on("edit",function(e){var n=i.d2r(e);void 0!==n&&w.relayout(t,s,n)})}}else J()}function Y(e){function n(t,e,n){function r(e){return t.l2r(a+(e-a)*n)}if(!t.fixedrange){var i=T.simpleMap(t.range,t.r2l),a=i[0]+(i[1]-i[0])*e;t.range=i.map(r)}}if(t._context.scrollZoom||dt._enablescrollzoom){if(t._transitioningWithDuration)return T.pauseEvent(e);var r=t.querySelector(".plotly");if(U(),!(r.scrollHeight-r.clientHeight>10||r.scrollWidth-r.clientWidth>10)){clearTimeout(Lt);var i=-e.deltaY;if(isFinite(i)||(i=e.wheelDelta/10),!isFinite(i))return void T.log("Did not find wheel motion attributes: ",e);var a,o=Math.exp(-Math.min(Math.max(i,-20),20)/200),s=It.draglayer.select(".nsewdrag").node().getBoundingClientRect(),l=(e.clientX-s.left)/s.width,u=(s.bottom-e.clientY)/s.height;if(q||ct){for(q||(l=.5),a=0;a rect").call(S.setTranslate,s,l).call(S.setScale,a,o);var w=m.plot.selectAll(".scatterlayer .points, .boxlayer .points");m.plot.call(S.setTranslate,_,b).call(S.setScale,1/a,1/o),w.selectAll(".point").call(S.setPointGroupScale,a,o).call(S.hideOutsideRangePoints,m),w.selectAll(".textpoint").call(S.setTextPointsScale,a,o).call(S.hideOutsideRangePoints,m)}}}var tt,et,nt,rt,it,at,ot,st,lt,ut,ct,ft,ht,dt=t._fullLayout,pt=t._fullLayout._zoomlayer,mt=V+q==="nsew";U();var gt=r(e,V+q+"drag",ut,n,A,E,B);if(!lt&&!st&&!m(dt.dragmode))return gt.onmousedown=null,gt.style.pointerEvents=mt?"all":"none",gt;var yt={element:gt,gd:t,plotinfo:e,prepFn:function(e,n,r){var i=t._fullLayout.dragmode;mt?e.shiftKey&&(i="pan"===i?"zoom":"pan"):i="pan",yt.minDrag="lasso"===i?1:void 0,"zoom"===i?(yt.moveFn=H,yt.doneFn=Z,yt.minDrag=1,G(e,n,r)):"pan"===i?(yt.moveFn=W,yt.doneFn=X,h(pt)):m(i)&&(yt.xaxes=et,yt.yaxes=nt,P(e,n,r,yt,i))}};L.init(yt);var vt,xt,_t,bt,wt,Mt,Tt,kt,At,St={},Et=[0,0,at,ot],Lt=null,zt=F.REDRAWDELAY,It=e.mainplot?dt._plots[e.mainplot]:e;return V.length*q.length!=1&&(void 0!==gt.onwheel?gt.onwheel=Y:void 0!==gt.onmousewheel&&(gt.onmousewheel=Y)),gt}},{"../../components/color":234,"../../components/dragelement":255,"../../components/drawing":258,"../../constants/alignment":331,"../../lib":350,"../../lib/setcursor":368,"../../lib/svg_text_utils":370,"../../plotly":385,"../../registry":434,"../plots":426,"./axes":390,"./axis_ids":393,"./constants":395,"./scale_zoom":405,"./select":406,d3:8,tinycolor2:200}],399:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),i=t("../../components/fx"),a=t("../../components/dragelement"),o=t("./constants"),s=t("./dragbox");e.exports=function(t){var e=t._fullLayout;if((e._has("cartesian")||e._has("gl2d"))&&!t._context.staticPlot){Object.keys(e._plots||{}).sort(function(t,n){if((e._plots[t].mainplot&&!0)===(e._plots[n].mainplot&&!0)){var r=t.split("y"),i=n.split("y");return r[0]===i[0]?Number(r[1]||1)-Number(i[1]||1):Number(r[0]||1)-Number(i[0]||1)}return e._plots[t].mainplot?1:-1}).forEach(function(n){var l=e._plots[n],u=l.xaxis,c=l.yaxis,f=(u._linepositions[n]||[])[3],h=(c._linepositions[n]||[])[3],d=o.DRAGGERSIZE;if(r(f)&&"top"===u.side&&(f-=d), -r(h)&&"right"!==c.side&&(h-=d),!l.mainplot){var p=s(t,l,0,0,u._length,c._length,"ns","ew");p.onmousemove=function(e){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===n&&i.hover(t,e,n)},i.hover(t,e,n),t._fullLayout._lasthover=p,t._fullLayout._hoversubplot=n},p.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,a.unhover(t,e))},p.onclick=function(e){i.click(t,e,n)},t._context.showAxisDragHandles&&(s(t,l,-d,-d,d,d,"n","w"),s(t,l,u._length,-d,d,d,"n","e"),s(t,l,-d,c._length,d,d,"s","w"),s(t,l,u._length,c._length,d,d,"s","e"))}t._context.showAxisDragHandles&&(r(f)&&("free"===u.anchor&&(f-=e._size.h*(1-c.domain[1])),s(t,l,.1*u._length,f,.8*u._length,d,"","ew"),s(t,l,0,f,.1*u._length,d,"","w"),s(t,l,.9*u._length,f,.1*u._length,d,"","e")),r(h)&&("free"===c.anchor&&(h-=e._size.w*u.domain[0]),s(t,l,h,.1*c._length,d,.8*c._length,"ns",""),s(t,l,h,.9*c._length,d,.1*c._length,"s",""),s(t,l,h,0,d,.1*c._length,"n","")))});var n=e._hoverlayer.node();n.onmousemove=function(n){n.target=e._lasthover,i.hover(t,n,e._hoversubplot)},n.onclick=function(n){n.target=e._lasthover,i.click(t,n)},n.onmousedown=function(t){e._lasthover.onmousedown(t)}}}},{"../../components/dragelement":255,"../../components/fx":275,"./constants":395,"./dragbox":398,"fast-isnumeric":12}],400:[function(t,e,n){"use strict";function r(t,e,n,r,i){var a=t._fullLayout,o=a._modules;e.plot&&e.plot.selectAll("g:not(.scatterlayer)").selectAll("g.trace").remove();for(var s=0;sc[1]-.01&&(e.domain=[0,1]),i.noneOrAll(t.domain,e.domain,[0,1])}return n("layer"),e}},{"../../lib":350,"fast-isnumeric":12}],405:[function(t,e,n){"use strict";var r=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,n){void 0===n&&(n=r[t.constraintoward||"center"]);var i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*n;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)]}},{"../../constants/alignment":331}],406:[function(t,e,n){"use strict";function r(t){return t._id}function i(t,e){if(Array.isArray(t))for(var n=e.cd[0].trace,r=0;r0)return Math.log(e)/Math.LN10;if(e<=0&&n&&t.range&&2===t.range.length){var r=t.range[0],i=t.range[1];return.5*(r+i-3*M*Math.abs(r-i))}return d}function f(e,n,r){var i=u(e,r||t.calendar);if(i===d){if(!a(e))return d;i=u(new Date(+e))}return i}function g(e,n,r){return l(e,n,r||t.calendar)}function y(e){return t._categories[Math.round(e)]}function v(e){if(null!==e&&void 0!==e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var n=t._categories.length-1;return t._categoriesMap[e]=n,n}return d}function x(e){if(t._categoriesMap){var n=t._categoriesMap[e];if(void 0!==n)return n}if(a(e))return+e}function _(e){return a(e)?i.round(t._b+t._m*e,2):d}function b(e){return(e-t._b)/t._m}e=e||{};var w=(t._id||"x").charAt(0),M=10;t.c2l="log"===t.type?n:c,t.l2c="log"===t.type?r:c,t.l2p=_,t.p2l=b,t.c2p="log"===t.type?function(t,e){return _(n(t,e))}:_,t.p2c="log"===t.type?function(t){return r(b(t))}:b,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=s,t.c2d=t.c2r=t.l2d=t.l2r=c,t.d2p=t.r2p=function(e){return t.l2p(s(e))},t.p2d=t.p2r=b,t.cleanPos=c):"log"===t.type?(t.d2r=t.d2l=function(t,e){return n(s(t),e)},t.r2d=t.r2c=function(t){return r(s(t))},t.d2c=t.r2l=s,t.c2d=t.l2r=c,t.c2r=n,t.l2d=r,t.d2p=function(e,n){return t.l2p(t.d2r(e,n))},t.p2d=function(t){return r(b(t))},t.r2p=function(e){return t.l2p(s(e))},t.p2r=b,t.cleanPos=c):"date"===t.type?(t.d2r=t.r2d=o.identity,t.d2c=t.r2c=t.d2l=t.r2l=f,t.c2d=t.c2r=t.l2d=t.l2r=g,t.d2p=t.r2p=function(e,n,r){return t.l2p(f(e,0,r))},t.p2d=t.p2r=function(t,e,n){return g(b(t),e,n)},t.cleanPos=function(e){return o.cleanDate(e,d,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=v,t.r2d=t.c2d=t.l2d=y,t.d2r=t.d2l_noadd=x,t.r2c=function(e){var n=x(e);return void 0!==n?n:t.fraction2r(.5)},t.l2r=t.c2r=c,t.r2l=x,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return y(b(t))},t.r2p=t.d2p,t.p2r=b,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:c(t)}),t.fraction2r=function(e){var n=t.r2l(t.range[0]),r=t.r2l(t.range[1]);return t.l2r(n+e*(r-n))},t.r2fraction=function(e){var n=t.r2l(t.range[0]),r=t.r2l(t.range[1]);return(t.r2l(e)-n)/(r-n)},t.cleanRange=function(e){e||(e="range");var n,r,i=o.nestedProperty(t,e).get();if(r="date"===t.type?o.dfltRange(t.calendar):"y"===w?p.DFLTRANGEY:p.DFLTRANGEX,r=r.slice(),!i||2!==i.length)return void o.nestedProperty(t,e).set(r);for("date"===t.type&&(i[0]=o.cleanDate(i[0],d,t.calendar),i[1]=o.cleanDate(i[1],d,t.calendar)),n=0;n<2;n++)if("date"===t.type){if(!o.isDateTime(i[n],t.calendar)){t[e]=r;break}if(t.r2l(i[0])===t.r2l(i[1])){var s=o.constrain(t.r2l(i[0]),o.MIN_MS+1e3,o.MAX_MS-1e3);i[0]=t.l2r(s-1e3),i[1]=t.l2r(s+1e3);break}}else{if(!a(i[n])){if(!a(i[1-n])){t[e]=r;break}i[n]=i[1-n]*(n?10:.1)}if(i[n]<-h?i[n]=-h:i[n]>h&&(i[n]=h),i[0]===i[1]){var l=Math.max(1,Math.abs(1e-6*i[0]));i[0]-=l,i[1]+=l}}},t.setScale=function(n){var r=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var i=m.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=n&&t._r?"_r":"range",s=t.calendar;t.cleanRange(a);var l=t.r2l(t[a][0],s),u=t.r2l(t[a][1],s);if("y"===w?(t._offset=r.t+(1-t.domain[1])*r.h,t._length=r.h*(t.domain[1]-t.domain[0]),t._m=t._length/(l-u),t._b=-t._m*u):(t._offset=r.l+t.domain[0]*r.w,t._length=r.w*(t.domain[1]-t.domain[0]),t._m=t._length/(u-l),t._b=-t._m*l),!isFinite(t._m)||!isFinite(t._b))throw o.notifier("Something went wrong with axis scaling","long"),e._replotting=!1,new Error("axis scaling")},t.makeCalcdata=function(e,n){var r,i,a,o="date"===t.type&&e[n+"calendar"];if(n in e)for(r=e[n],i=new Array(r.length),a=0;a=t.range[0]&&n<=t.range[1]}:function(e){var n=e.y;return n>=t.range[0]&&n<=t.range[1]},t._min=[],t._max=[],t._separators=e.separators,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":333,"../../lib":350,"./axis_ids":393,"./constants":395,d3:8,"fast-isnumeric":12}],408:[function(t,e,n){"use strict";function r(t){var e=["showexponent","showtickprefix","showticksuffix"],n=e.filter(function(e){return void 0!==t[e]}),r=function(e){return t[e]===t[n[0]]};if(n.every(r)||1===n.length)return t[n[0]]}var i=t("../../lib");e.exports=function(t,e,n,a,o){var s=r(t);if(n("tickprefix")&&n("showtickprefix",s),n("ticksuffix")&&n("showticksuffix",s),n("showticklabels")){var l=o.font||{},u=e.color===t.color?e.color:l.color;i.coerceFont(n,"tickfont",{family:l.family,size:l.size,color:u}),n("tickangle"),"category"!==a&&(n("tickformat")||"date"===a||(n("showexponent",s),n("exponentformat"),n("separatethousands")))}"category"===a||o.noHover||n("hoverformat")}},{"../../lib":350}],409:[function(t,e,n){"use strict";var r=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,n,a){var o=r.coerce2(t,e,i,"ticklen"),s=r.coerce2(t,e,i,"tickwidth"),l=r.coerce2(t,e,i,"tickcolor",e.color);n("ticks",a.outerTicks||o||s||l?"outside":"")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":350,"./layout_attributes":401}],410:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),i=t("../../lib"),a=t("../../constants/numerical").ONEDAY;e.exports=function(t,e,n,o){var s="auto";"array"!==t.tickmode||"log"!==o&&"date"!==o||(t.tickmode="auto"),Array.isArray(t.tickvals)?s="array":t.dtick&&(s="linear");var l=n("tickmode",s);if("auto"===l)n("nticks");else if("linear"===l){var u="date"===o?a:1,c=n("dtick",u);if(r(c))e.dtick=c>0?Number(c):u;else if("string"!=typeof c)e.dtick=u;else{var f=c.charAt(0),h=c.substr(1);h=r(h)?Number(h):0,(h<=0||!("date"===o&&"M"===f&&h===Math.round(h)||"log"===o&&"L"===f||"log"===o&&"D"===f&&(1===h||2===h)))&&(e.dtick=u)}var d="date"===o?i.dateTick0(e.calendar):0,p=n("tick0",d);"date"===o?e.tick0=i.cleanDate(p,d):r(p)&&"D1"!==c&&"D2"!==c?e.tick0=Number(p):e.tick0=d}else{var m=n("tickvals");void 0===m?e.tickmode="auto":n("ticktext")}}},{"../../constants/numerical":333,"../../lib":350,"fast-isnumeric":12}],411:[function(t,e,n){"use strict";var r=t("d3"),i=t("../../plotly"),a=t("../../registry"),o=t("../../components/drawing"),s=t("./axes"),l=t("./constants").attrRegex;e.exports=function(t,e,n,u){function c(e,n){function r(e,n,r){for(i=0;i rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,n._offset).call(o.setScale,1,1);var r=t.plot.select(".scatterlayer").selectAll(".points");r.selectAll(".point").call(o.setPointGroupScale,1,1).call(o.hideOutsideRangePoints,t),r.selectAll(".textpoint").call(o.setTextPointsScale,1,1).call(o.hideOutsideRangePoints,t)}function h(e,n){var r,i,a,s=v[e.xaxis._id],l=v[e.yaxis._id],u=[];if(s){r=t._fullLayout[s.axisName],i=r._r,a=s.to,u[0]=(i[0]*(1-n)+n*a[0]-i[0])/(i[1]-i[0])*e.xaxis._length;var f=i[1]-i[0],h=a[1]-a[0];r.range[0]=i[0]*(1-n)+n*a[0],r.range[1]=i[1]*(1-n)+n*a[1],u[2]=e.xaxis._length*(1-n+n*h/f)}else u[0]=0,u[2]=e.xaxis._length;if(l){r=t._fullLayout[l.axisName],i=r._r,a=l.to,u[1]=(i[1]*(1-n)+n*a[1]-i[1])/(i[0]-i[1])*e.yaxis._length;var d=i[1]-i[0],p=a[1]-a[0];r.range[0]=i[0]*(1-n)+n*a[0],r.range[1]=i[1]*(1-n)+n*a[1],u[3]=e.yaxis._length*(1-n+n*p/d)}else u[1]=0,u[3]=e.yaxis._length;c(e.xaxis,e.yaxis);var m=e.xaxis,y=e.yaxis,x=!!s,_=!!l,b=x?m._length/u[2]:1,w=_?y._length/u[3]:1,M=x?u[0]:0,T=_?u[1]:0,k=x?u[0]/u[2]*m._length:0,A=_?u[1]/u[3]*y._length:0,S=m._offset-k,E=y._offset-A;g._defs.select("#"+e.clipId+"> rect").call(o.setTranslate,M,T).call(o.setScale,1/b,1/w),e.plot.call(o.setTranslate,S,E).call(o.setScale,b,w).selectAll(".points").selectAll(".point").call(o.setPointGroupScale,1/b,1/w),e.plot.selectAll(".points").selectAll(".textpoint").call(o.setTextPointsScale,1/b,1/w)}function d(){for(var e={},n=0;nn.duration?(d(),T=window.cancelAnimationFrame(m)):T=window.requestAnimationFrame(m)}var g=t._fullLayout,y=[],v=function(t){var e,n,r,i,a={};for(e in t)if(n=e.split("."),n[0].match(l)){var o=e.charAt(0),s=n[0];if(r=g[s],i={},Array.isArray(t[e])?i.to=t[e].slice(0):Array.isArray(t[e].range)&&(i.to=t[e].range.slice(0)),!i.to)continue;i.axisName=s,i.length=r._length,y.push(o),a[o]=i}return a}(e),x=Object.keys(v),_=function(t,e,n){var r,i,a,o=t._plots,s=[];for(r in o){var l=o[r];if(-1===s.indexOf(l)){var u=l.xaxis._id,c=l.yaxis._id,f=l.xaxis.range,h=l.yaxis.range;l.xaxis._r=l.xaxis.range.slice(),l.yaxis._r=l.yaxis.range.slice(),i=n[u]?n[u].to:f,a=n[c]?n[c].to:h,f[0]===i[0]&&f[1]===i[1]&&h[0]===a[0]&&h[1]===a[1]||-1===e.indexOf(u)&&-1===e.indexOf(c)||s.push(l)}}return s}(g,x,v);if(!_.length)return function(){function e(e,n,r){for(var i=0;i0?".":"")+i +r(h)&&"right"!==c.side&&(h-=d),!l.mainplot){var p=s(t,l,0,0,u._length,c._length,"ns","ew");p.onmousemove=function(e){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===n&&i.hover(t,e,n)},i.hover(t,e,n),t._fullLayout._lasthover=p,t._fullLayout._hoversubplot=n},p.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,a.unhover(t,e))},p.onclick=function(e){i.click(t,e,n)},t._context.showAxisDragHandles&&(s(t,l,-d,-d,d,d,"n","w"),s(t,l,u._length,-d,d,d,"n","e"),s(t,l,-d,c._length,d,d,"s","w"),s(t,l,u._length,c._length,d,d,"s","e"))}t._context.showAxisDragHandles&&(r(f)&&("free"===u.anchor&&(f-=e._size.h*(1-c.domain[1])),s(t,l,.1*u._length,f,.8*u._length,d,"","ew"),s(t,l,0,f,.1*u._length,d,"","w"),s(t,l,.9*u._length,f,.1*u._length,d,"","e")),r(h)&&("free"===c.anchor&&(h-=e._size.w*u.domain[0]),s(t,l,h,.1*c._length,d,.8*c._length,"ns",""),s(t,l,h,.9*c._length,d,.1*c._length,"s",""),s(t,l,h,0,d,.1*c._length,"n","")))});var n=e._hoverlayer.node();n.onmousemove=function(n){n.target=e._lasthover,i.hover(t,n,e._hoversubplot)},n.onclick=function(n){n.target=e._lasthover,i.click(t,n)},n.onmousedown=function(t){e._lasthover.onmousedown(t)}}}},{"../../components/dragelement":255,"../../components/fx":275,"./constants":395,"./dragbox":398,"fast-isnumeric":12}],400:[function(t,e,n){"use strict";function r(t,e,n,r,i){var a=t._fullLayout,o=a._modules;e.plot&&e.plot.selectAll("g:not(.scatterlayer)").selectAll("g.trace").remove();for(var s=0;sc[1]-.01&&(e.domain=[0,1]),i.noneOrAll(t.domain,e.domain,[0,1])}return n("layer"),e}},{"../../lib":350,"fast-isnumeric":12}],405:[function(t,e,n){"use strict";var r=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,n){void 0===n&&(n=r[t.constraintoward||"center"]);var i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*n;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)]}},{"../../constants/alignment":331}],406:[function(t,e,n){"use strict";function r(t){return t._id}function i(t,e){if(Array.isArray(t))for(var n=e.cd[0].trace,r=0;r0)return Math.log(e)/Math.LN10;if(e<=0&&n&&t.range&&2===t.range.length){var r=t.range[0],i=t.range[1];return.5*(r+i-3*M*Math.abs(r-i))}return d}function f(e,n,r){var i=u(e,r||t.calendar);if(i===d){if(!a(e))return d;i=u(new Date(+e))}return i}function g(e,n,r){return l(e,n,r||t.calendar)}function y(e){return t._categories[Math.round(e)]}function v(e){if(null!==e&&void 0!==e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var n=t._categories.length-1;return t._categoriesMap[e]=n,n}return d}function x(e){if(t._categoriesMap){var n=t._categoriesMap[e];if(void 0!==n)return n}if(a(e))return+e}function _(e){return a(e)?i.round(t._b+t._m*e,2):d}function b(e){return(e-t._b)/t._m}e=e||{};var w=(t._id||"x").charAt(0),M=10;t.c2l="log"===t.type?n:c,t.l2c="log"===t.type?r:c,t.l2p=_,t.p2l=b,t.c2p="log"===t.type?function(t,e){return _(n(t,e))}:_,t.p2c="log"===t.type?function(t){return r(b(t))}:b,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=s,t.c2d=t.c2r=t.l2d=t.l2r=c,t.d2p=t.r2p=function(e){return t.l2p(s(e))},t.p2d=t.p2r=b,t.cleanPos=c):"log"===t.type?(t.d2r=t.d2l=function(t,e){return n(s(t),e)},t.r2d=t.r2c=function(t){return r(s(t))},t.d2c=t.r2l=s,t.c2d=t.l2r=c,t.c2r=n,t.l2d=r,t.d2p=function(e,n){return t.l2p(t.d2r(e,n))},t.p2d=function(t){return r(b(t))},t.r2p=function(e){return t.l2p(s(e))},t.p2r=b,t.cleanPos=c):"date"===t.type?(t.d2r=t.r2d=o.identity,t.d2c=t.r2c=t.d2l=t.r2l=f,t.c2d=t.c2r=t.l2d=t.l2r=g,t.d2p=t.r2p=function(e,n,r){return t.l2p(f(e,0,r))},t.p2d=t.p2r=function(t,e,n){return g(b(t),e,n)},t.cleanPos=function(e){return o.cleanDate(e,d,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=v,t.r2d=t.c2d=t.l2d=y,t.d2r=t.d2l_noadd=x,t.r2c=function(e){var n=x(e);return void 0!==n?n:t.fraction2r(.5)},t.l2r=t.c2r=c,t.r2l=x,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return y(b(t))},t.r2p=t.d2p,t.p2r=b,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:c(t)}),t.fraction2r=function(e){var n=t.r2l(t.range[0]),r=t.r2l(t.range[1]);return t.l2r(n+e*(r-n))},t.r2fraction=function(e){var n=t.r2l(t.range[0]),r=t.r2l(t.range[1]);return(t.r2l(e)-n)/(r-n)},t.cleanRange=function(e){e||(e="range");var n,r,i=o.nestedProperty(t,e).get();if(r="date"===t.type?o.dfltRange(t.calendar):"y"===w?p.DFLTRANGEY:p.DFLTRANGEX,r=r.slice(),!i||2!==i.length)return void o.nestedProperty(t,e).set(r);for("date"===t.type&&(i[0]=o.cleanDate(i[0],d,t.calendar),i[1]=o.cleanDate(i[1],d,t.calendar)),n=0;n<2;n++)if("date"===t.type){if(!o.isDateTime(i[n],t.calendar)){t[e]=r;break}if(t.r2l(i[0])===t.r2l(i[1])){var s=o.constrain(t.r2l(i[0]),o.MIN_MS+1e3,o.MAX_MS-1e3);i[0]=t.l2r(s-1e3),i[1]=t.l2r(s+1e3);break}}else{if(!a(i[n])){if(!a(i[1-n])){t[e]=r;break}i[n]=i[1-n]*(n?10:.1)}if(i[n]<-h?i[n]=-h:i[n]>h&&(i[n]=h),i[0]===i[1]){var l=Math.max(1,Math.abs(1e-6*i[0]));i[0]-=l,i[1]+=l}}},t.setScale=function(n){var r=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var i=m.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=n&&t._r?"_r":"range",s=t.calendar;t.cleanRange(a);var l=t.r2l(t[a][0],s),u=t.r2l(t[a][1],s);if("y"===w?(t._offset=r.t+(1-t.domain[1])*r.h,t._length=r.h*(t.domain[1]-t.domain[0]),t._m=t._length/(l-u),t._b=-t._m*u):(t._offset=r.l+t.domain[0]*r.w,t._length=r.w*(t.domain[1]-t.domain[0]),t._m=t._length/(u-l),t._b=-t._m*l),!isFinite(t._m)||!isFinite(t._b))throw o.notifier("Something went wrong with axis scaling","long"),e._replotting=!1,new Error("axis scaling")},t.makeCalcdata=function(e,n){var r,i,a,o="date"===t.type&&e[n+"calendar"];if(n in e)for(r=e[n],i=new Array(r.length),a=0;a=t.range[0]&&n<=t.range[1]}:function(e){var n=e.y;return n>=t.range[0]&&n<=t.range[1]},t._min=[],t._max=[],t._separators=e.separators,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":333,"../../lib":350,"./axis_ids":393,"./constants":395,d3:8,"fast-isnumeric":12}],408:[function(t,e,n){"use strict";function r(t){var e=["showexponent","showtickprefix","showticksuffix"],n=e.filter(function(e){return void 0!==t[e]}),r=function(e){return t[e]===t[n[0]]};if(n.every(r)||1===n.length)return t[n[0]]}var i=t("../../lib");e.exports=function(t,e,n,a,o){var s=r(t);if(n("tickprefix")&&n("showtickprefix",s),n("ticksuffix")&&n("showticksuffix",s),n("showticklabels")){var l=o.font||{},u=e.color===t.color?e.color:l.color;i.coerceFont(n,"tickfont",{family:l.family,size:l.size,color:u}),n("tickangle"),"category"!==a&&(n("tickformat")||"date"===a||(n("showexponent",s),n("exponentformat"),n("separatethousands")))}"category"===a||o.noHover||n("hoverformat")}},{"../../lib":350}],409:[function(t,e,n){"use strict";var r=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,n,a){var o=r.coerce2(t,e,i,"ticklen"),s=r.coerce2(t,e,i,"tickwidth"),l=r.coerce2(t,e,i,"tickcolor",e.color);n("ticks",a.outerTicks||o||s||l?"outside":"")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":350,"./layout_attributes":401}],410:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),i=t("../../lib"),a=t("../../constants/numerical").ONEDAY;e.exports=function(t,e,n,o){var s="auto";"array"!==t.tickmode||"log"!==o&&"date"!==o||(t.tickmode="auto"),Array.isArray(t.tickvals)?s="array":t.dtick&&(s="linear");var l=n("tickmode",s);if("auto"===l)n("nticks");else if("linear"===l){var u="date"===o?a:1,c=n("dtick",u);if(r(c))e.dtick=c>0?Number(c):u;else if("string"!=typeof c)e.dtick=u;else{var f=c.charAt(0),h=c.substr(1);h=r(h)?Number(h):0,(h<=0||!("date"===o&&"M"===f&&h===Math.round(h)||"log"===o&&"L"===f||"log"===o&&"D"===f&&(1===h||2===h)))&&(e.dtick=u)}var d="date"===o?i.dateTick0(e.calendar):0,p=n("tick0",d);"date"===o?e.tick0=i.cleanDate(p,d):r(p)&&"D1"!==c&&"D2"!==c?e.tick0=Number(p):e.tick0=d}else{var m=n("tickvals");void 0===m?e.tickmode="auto":n("ticktext")}}},{"../../constants/numerical":333,"../../lib":350,"fast-isnumeric":12}],411:[function(t,e,n){"use strict";var r=t("d3"),i=t("../../plotly"),a=t("../../registry"),o=t("../../components/drawing"),s=t("./axes"),l=t("./constants").attrRegex;e.exports=function(t,e,n,u){function c(e,n){function r(e,n,r){for(i=0;i rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,n._offset).call(o.setScale,1,1);var r=t.plot.select(".scatterlayer").selectAll(".points");r.selectAll(".point").call(o.setPointGroupScale,1,1).call(o.hideOutsideRangePoints,t),r.selectAll(".textpoint").call(o.setTextPointsScale,1,1).call(o.hideOutsideRangePoints,t)}function h(e,n){var r,i,a,s=v[e.xaxis._id],l=v[e.yaxis._id],u=[];if(s){r=t._fullLayout[s.axisName],i=r._r,a=s.to,u[0]=(i[0]*(1-n)+n*a[0]-i[0])/(i[1]-i[0])*e.xaxis._length;var f=i[1]-i[0],h=a[1]-a[0];r.range[0]=i[0]*(1-n)+n*a[0],r.range[1]=i[1]*(1-n)+n*a[1],u[2]=e.xaxis._length*(1-n+n*h/f)}else u[0]=0,u[2]=e.xaxis._length;if(l){r=t._fullLayout[l.axisName],i=r._r,a=l.to,u[1]=(i[1]*(1-n)+n*a[1]-i[1])/(i[0]-i[1])*e.yaxis._length;var d=i[1]-i[0],p=a[1]-a[0];r.range[0]=i[0]*(1-n)+n*a[0],r.range[1]=i[1]*(1-n)+n*a[1],u[3]=e.yaxis._length*(1-n+n*p/d)}else u[1]=0,u[3]=e.yaxis._length;c(e.xaxis,e.yaxis);var m=e.xaxis,y=e.yaxis,x=!!s,_=!!l,b=x?m._length/u[2]:1,w=_?y._length/u[3]:1,M=x?u[0]:0,T=_?u[1]:0,k=x?u[0]/u[2]*m._length:0,A=_?u[1]/u[3]*y._length:0,S=m._offset-k,E=y._offset-A;g._defs.select("#"+e.clipId+"> rect").call(o.setTranslate,M,T).call(o.setScale,1/b,1/w),e.plot.call(o.setTranslate,S,E).call(o.setScale,b,w).selectAll(".points").selectAll(".point").call(o.setPointGroupScale,1/b,1/w),e.plot.selectAll(".points").selectAll(".textpoint").call(o.setTextPointsScale,1/b,1/w)}function d(){for(var e={},n=0;nn.duration?(d(),T=window.cancelAnimationFrame(m)):T=window.requestAnimationFrame(m)}var g=t._fullLayout,y=[],v=function(t){var e,n,r,i,a={};for(e in t)if(n=e.split("."),n[0].match(l)){var o=e.charAt(0),s=n[0];if(r=g[s],i={},Array.isArray(t[e])?i.to=t[e].slice(0):Array.isArray(t[e].range)&&(i.to=t[e].range.slice(0)),!i.to)continue;i.axisName=s,i.length=r._length,y.push(o),a[o]=i}return a}(e),x=Object.keys(v),_=function(t,e,n){var r,i,a,o=t._plots,s=[];for(r in o){var l=o[r];if(-1===s.indexOf(l)){var u=l.xaxis._id,c=l.yaxis._id,f=l.xaxis.range,h=l.yaxis.range;l.xaxis._r=l.xaxis.range.slice(),l.yaxis._r=l.yaxis.range.slice(),i=n[u]?n[u].to:f,a=n[c]?n[c].to:h,f[0]===i[0]&&f[1]===i[1]&&h[0]===a[0]&&h[1]===a[1]||-1===e.indexOf(u)&&-1===e.indexOf(c)||s.push(l)}}return s}(g,x,v);if(!_.length)return function(){function e(e,n,r){for(var i=0;i0?".":"")+i ;u.isPlainObject(a)?s(a,e,o,r+1):e(o,i,a)}})}var l=t("../plotly"),u=t("../lib");n.manageCommandObserver=function(t,e,i,a){var o={},s=!0;e&&e._commandObserver&&(o=e._commandObserver),o.cache||(o.cache={}),o.lookupTable={};var l=n.hasSimpleAPICommandBindings(t,i,o.lookupTable);if(e&&e._commandObserver){if(l)return o;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,o}if(l){r(t,l,o.cache),o.check=function(){if(s){var e=r(t,l,o.cache);return e.changed&&a&&void 0!==o.lookupTable[e.value]&&(o.disable(),Promise.resolve(a({value:e.value,type:l.type,prop:l.prop,traces:l.traces,index:o.lookupTable[e.value]})).then(o.enable,o.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f0}function a(t){var e={},n={};switch(t.type){case"circle":s.extendFlat(n,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":s.extendFlat(n,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity});break;case"fill":s.extendFlat(n,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var r=t.symbol,i=l(r.textposition,r.iconsize);s.extendFlat(e,{"icon-image":r.icon+"-15","icon-size":r.iconsize/10,"text-field":r.text,"text-size":r.textfont.size,"text-anchor":i.anchor,"text-offset":i.offset}),s.extendFlat(n,{"icon-color":t.color,"text-color":r.textfont.color,"text-opacity":t.opacity})}return{layout:e,paint:n}}function o(t){var e,n=t.sourcetype,r=t.source,i={type:n},a="string"==typeof r;return"geojson"===n?e="data":"vector"===n&&(e=a?"url":"tiles"),i[e]=r,i}var s=t("../../lib"),l=t("./convert_text_opts"),u=r.prototype;u.update=function(t){this.visible?this.needsNewSource(t)?(this.updateLayer(t),this.updateSource(t)):this.needsNewLayer(t)&&this.updateLayer(t):(this.updateSource(t),this.updateLayer(t)),this.updateStyle(t),this.visible=i(t)},u.needsNewSource=function(t){return this.sourceType!==t.sourcetype||this.source!==t.source||this.layerType!==t.type},u.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==t.below},u.updateSource=function(t){var e=this.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,i(t)){var n=o(t);e.addSource(this.idSource,n)}},u.updateLayer=function(t){var e=this.map;if(e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer),this.layerType=t.type,i(t)){e.addLayer({id:this.idLayer,source:this.idSource,"source-layer":t.sourcelayer||"",type:t.type},t.below);var n={visibility:"visible"};this.mapbox.setOptions(this.idLayer,"setLayoutProperty",n)}},u.updateStyle=function(t){var e=a(t);i(t)&&(this.mapbox.setOptions(this.idLayer,"setLayoutProperty",e.layout),this.mapbox.setOptions(this.idLayer,"setPaintProperty",e.paint))},u.dispose=function(){var t=this.map;t.removeLayer(this.idLayer),t.removeSource(this.idSource)},e.exports=function(t,e,n){var i=new r(t,e);return i.update(n),i}},{"../../lib":350,"./convert_text_opts":419}],422:[function(t,e,n){"use strict";var r=t("../../lib"),i=t("../../components/color").defaultLine,a=t("../font_attributes"),o=t("../../traces/scatter/attributes").textposition,s=t("../../plot_api/edit_types").overrideAll,l=a({});l.family.dflt="Open Sans Regular, Arial Unicode MS Regular",e.exports=s({_arrayAttrRegexps:[r.counterRegex("mapbox",".layers",!0)],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]}},accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],dflt:"basic"},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},layers:{_isLinkedToArray:"layer",sourcetype:{valType:"enumerated",values:["geojson","vector"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},type:{valType:"enumerated",values:["circle","line","fill","symbol"],dflt:"circle"},below:{valType:"string",dflt:""},color:{valType:"color",dflt:i},opacity:{valType:"number",min:0,max:1,dflt:1},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2}},fill:{outlinecolor:{valType:"color",dflt:i}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},textfont:l,textposition:r.extendFlat({},o,{arrayOk:!1})}}},"plot","from-root")},{"../../components/color":234,"../../lib":350,"../../plot_api/edit_types":374,"../../traces/scatter/attributes":445,"../font_attributes":414}],423:[function(t,e,n){"use strict";function r(t,e,n){n("accesstoken"),n("style"),n("center.lon"),n("center.lat"),n("zoom"),n("bearing"),n("pitch"),i(t,e),e._input=t}function i(t,e){function n(t,e){return a.coerce(r,i,s.layers,t,e)}for(var r,i,o=t.layers||[],l=e.layers=[],u=0;u=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),n.attr(a);var o=n.select(".js-link-to-tool"),s=n.select(".js-link-spacer"),u=n.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&r(t,o),s.text(o.text()&&u.text()?" - ":"")}},g.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",n=l.select(t).append("div").attr("id","hiddenform").style("display","none"),r=n.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return r.append("input").attr({type:"text",name:"data"}).node().value=g.graphJson(t,!1,"keepdata"),r.node().submit(),n.remove(),t.emit("plotly_afterexport"),!1},g.supplyDefaults=function(t){var e,n=t._fullLayout||{},r=t._fullLayout={},a=t.layout||{},o=t._fullData||[],s=t._fullData=[],l=t.data||[];if(t._transitionData||g.createTransitionData(t),n._initialAutoSizeIsDone){var u=n.width,f=n.height;g.supplyLayoutGlobalDefaults(a,r),a.width||(r.width=u),a.height||(r.height=f)}else{g.supplyLayoutGlobalDefaults(a,r);var h=!a.width||!a.height,d=r.autosize,p=t._context&&t._context.autosizable;h&&(d||p)?g.plotAutoSize(t,a,r):h&&g.sanitizeMargins(t),!d&&h&&(a.width=r.width,a.height=r.height)}r._initialAutoSizeIsDone=!0,r._dataLength=l.length,r._globalTransforms=(t._context||{}).globalTransforms,g.supplyDataDefaults(l,s,a,r),r._has=g._hasPlotType.bind(r);var m=r._modules;for(e=0;e0){var c=o(t._boundingBoxMargins),f=c.left+c.right,h=c.bottom+c.top,p=1-2*s,m=n._container&&n._container.node?n._container.node().getBoundingClientRect():{width:n.width,height:n.height};r=Math.round(p*(m.width-f)),i=Math.round(p*(m.height-h))}else{var y=l?window.getComputedStyle(t):{};r=parseFloat(y.width)||n.width,i=parseFloat(y.height)||n.height}var v=g.layoutAttributes.width.min,x=g.layoutAttributes.height.min;r1,b=!e.height&&Math.abs(n.height-i)>1;(b||_)&&(_&&(n.width=r),b&&(n.height=i)),t._initialAutoSize||(t._initialAutoSize={width:r,height:i}),g.sanitizeMargins(n)},g.supplyLayoutModuleDefaults=function(t,e,n,r){var i,a;c.Axes.supplyLayoutDefaults(t,e,n);var o=e._basePlotModules;for(i=0;i.5*r.width&&(n.l=n.r=0),n.b+n.t>.5*r.height&&(n.b=n.t=0),r._pushmargin[e]={l:{val:n.x,size:n.l+i},r:{val:n.x,size:n.r+i},b:{val:n.y,size:n.b+i},t:{val:n.y,size:n.t+i}}}else delete r._pushmargin[e];r._replotting||g.doAutoMargin(t)}},g.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var n=e._size,r=JSON.stringify(n),i=Math.max(e.margin.l||0,0),a=Math.max(e.margin.r||0,0),o=Math.max(e.margin.t||0,0),s=Math.max(e.margin.b||0,0),l=e._pushmargin;if(!1!==e.margin.autoexpand){l.base={l:{val:0,size:i},r:{val:1,size:a},t:{val:1,size:o},b:{val:0,size:s}};for(var f=Object.keys(l),h=0;hg){var T=(y*w+(M-e.width)*g)/(w-g),k=(M*(1-g)+(y-e.width)*(1-w))/(w-g);T>=0&&k>=0&&T+k>i+a&&(i=T,a=k)}}if(u(x)&&l[b].t){var A=l[b].t.val,S=l[b].t.size;if(A>v){var E=(x*A+(S-e.height)*v)/(A-v),L=(S*(1-v)+(x-e.height)*(1-A))/(A-v);E>=0&&L>=0&&E+L>s+o&&(s=E,o=L)}}}}if(n.l=Math.round(i),n.r=Math.round(a),n.t=Math.round(o),n.b=Math.round(s),n.p=Math.round(e.margin.pad),n.w=Math.round(e.width)-n.l-n.r,n.h=Math.round(e.height)-n.t-n.b,!e._replotting&&"{}"!==r&&r!==JSON.stringify(e._size))return c.plot(t)},g.graphJson=function(t,e,n,r,i){function a(t){if("function"==typeof t)return null;if(d.isPlainObject(t)){var e,r,i={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===n){if("src"===e.substr(e.length-3))continue}else if("keepstream"===n){if("string"==typeof(r=t[e+"src"])&&r.indexOf(":")>0&&!d.isPlainObject(t.stream))continue}else if("keepall"!==n&&"string"==typeof(r=t[e+"src"])&&r.indexOf(":")>0)continue;i[e]=a(t[e])}return i}return Array.isArray(t)?t.map(a):d.isJSDate(t)?d.ms2DateTimeLocal(+t):t}(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&g.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l=(t._transitionData||{})._frames,u={data:(o||[]).map(function(t){var n=a(t);return e&&delete n.fit,n})};return e||(u.layout=a(s)),t.framework&&t.framework.isPolar&&(u=t.framework.getConfig()),l&&(u.frames=a(l)),"object"===r?u:JSON.stringify(u)},g.modifyFrames=function(t,e){var n,r,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(n=0;n0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){_=!0}),i.redraw&&t._transitionData._interruptCallbacks.push(function(){return c.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var o,s,l=0,u=0,h=t._fullLayout._basePlotModules,p=!1;if(n)for(s=0;s=0,L=E?h.angularAxis.domain:r.extent(T),z=Math.abs(T[1]-T[0]);A&&!k&&(z=0);var I=L.slice();S&&k&&(I[1]+=z);var D=h.angularAxis.ticksCount||4;D>8&&(D=D/(D/8)+D%8),h.angularAxis.ticksStep&&(D=(I[1]-I[0])/D);var C=h.angularAxis.ticksStep||(I[1]-I[0])/(D*(h.minorTicks+1));M&&(C=Math.max(Math.round(C),1)),I[2]||(I[2]=C);var P=r.range.apply(this,I);if(P=P.map(function(t,e){return parseFloat(t.toPrecision(12))}),l=r.scale.linear().domain(I.slice(0,2)).range("clockwise"===h.direction?[0,360]:[360,0]),f.layout.angularAxis.domain=l.domain(),f.layout.angularAxis.endPadding=S?z:0,void 0===(e=r.select(this).select("svg.chart-root"))||e.empty()){var O=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),F=this.appendChild(this.ownerDocument.importNode(O.documentElement,!0));e=r.select(F)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var R,j=e.select(".chart-group"),N={fill:"none",stroke:h.tickColor},B={"font-size":h.font.size,"font-family":h.font.family,fill:h.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+h.font.outlineColor}).join(",")};if(h.showLegend){R=e.select(".legend-group").attr({transform:"translate("+[_,h.margin.top]+")"}).style({display:"block"});var V=p.map(function(t,e){var n=s.util.cloneJson(t);return n.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",n.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,n.color="LinePlot"===t.geometry?t.strokeColor:t.color,n});s.Legend().config({data:p.map(function(t,e){return t.name||"Element"+e}),legendConfig:a({},s.Legend.defaultConfig().legendConfig,{container:R,elements:V,reverseOrder:h.legend.reverseOrder})})();var q=R.node().getBBox();_=Math.min(h.width-q.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2,_=Math.max(10,_),w=[h.margin.left+_,h.margin.top+_],i.range([0,_]),f.layout.radialAxis.domain=i.domain(),R.attr("transform","translate("+[w[0]+_,w[1]-_]+")")}else R=e.select(".legend-group").style({display:"none"});e.attr({width:h.width,height:h.height}).style({opacity:h.opacity}),j.attr("transform","translate("+w+")").style({cursor:"crosshair"});var U=[(h.width-(h.margin.left+h.margin.right+2*_+(q?q.width:0)))/2,(h.height-(h.margin.top+h.margin.bottom+2*_))/2];if(U[0]=Math.max(0,U[0]),U[1]=Math.max(0,U[1]),e.select(".outer-group").attr("transform","translate("+U+")"),h.title){var G=e.select("g.title-group text").style(B).text(h.title),H=G.node().getBBox();G.attr({x:w[0]-H.width/2,y:w[1]-_-20})}var Z=e.select(".radial.axis-group");if(h.radialAxis.gridLinesVisible){var X=Z.selectAll("circle.grid-circle").data(i.ticks(5));X.enter().append("circle").attr({class:"grid-circle"}).style(N),X.attr("r",i),X.exit().remove()}Z.select("circle.outside-circle").attr({r:_}).style(N);var Y=e.select("circle.background-circle").attr({r:_}).style({fill:h.backgroundColor,stroke:h.stroke});if(h.radialAxis.visible){var W=r.svg.axis().scale(i).ticks(5).tickSize(5);Z.call(W).attr({transform:"rotate("+h.radialAxis.orientation+")"}),Z.selectAll(".domain").style(N),Z.selectAll("g>text").text(function(t,e){return this.textContent+h.radialAxis.ticksSuffix}).style(B).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===h.radialAxis.tickOrientation?"rotate("+-h.radialAxis.orientation+") translate("+[0,B["font-size"]]+")":"translate("+[0,B["font-size"]]+")"}}),Z.selectAll("g>line").style({stroke:"black"})}var Q=e.select(".angular.axis-group").selectAll("g.angular-tick").data(P),J=Q.enter().append("g").classed("angular-tick",!0);Q.attr({transform:function(t,e){return"rotate("+u(t,e)+")"}}).style({display:h.angularAxis.visible?"block":"none"}),Q.exit().remove(),J.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(h.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(h.minorTicks+1)==0)}).style(N),J.selectAll(".minor").style({stroke:h.minorTickColor}),Q.select("line.grid-line").attr({x1:h.tickLength?_-h.tickLength:0,x2:_}).style({display:h.angularAxis.gridLinesVisible?"block":"none"}),J.append("text").classed("axis-text",!0).style(B);var $=Q.select("text.axis-text").attr({x:_+h.labelOffset,dy:o+"em",transform:function(t,e){var n=u(t,e),r=_+h.labelOffset,i=h.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-n+" "+r+" 0)":"radial"==i?n<270&&n>90?"rotate(180 "+r+" 0)":null:"rotate("+(n<=180&&n>0?-90:90)+" "+r+" 0)"}}).style({"text-anchor":"middle",display:h.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(h.minorTicks+1)!=0?"":M?M[t]+h.angularAxis.ticksSuffix:t+h.angularAxis.ticksSuffix}).style(B);h.angularAxis.rewriteTicks&&$.text(function(t,e){return e%(h.minorTicks+1)!=0?"":h.angularAxis.rewriteTicks(this.textContent,e)});var K=r.max(j.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));R.attr({transform:"translate("+[_+K,h.margin.top]+")"});var tt=e.select("g.geometry-group").selectAll("g").size()>0,et=e.select("g.geometry-group").selectAll("g.geometry").data(p);if(et.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),et.exit().remove(),p[0]||tt){var nt=[];p.forEach(function(t,e){var n={};n.radialScale=i,n.angularScale=l,n.container=et.filter(function(t,n){return n==e}),n.geometry=t.geometry,n.orientation=h.orientation,n.direction=h.direction,n.index=e,nt.push({data:t,geometryConfig:n})});var rt=r.nest().key(function(t,e){return void 0!==t.data.groupId||"unstacked"}).entries(nt),it=[];rt.forEach(function(t,e){"unstacked"===t.key?it=it.concat(t.values.map(function(t,e){return[t]})):it.push(t.values)}),it.forEach(function(t,e){var n;n=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var r=t.map(function(t,e){return a(s[n].defaultConfig(),t)});s[n]().config(r)()})}var at,ot,st=e.select(".guides-group"),lt=e.select(".tooltips-group"),ut=s.tooltipPanel().config({container:lt,fontSize:8})(),ct=s.tooltipPanel().config({container:lt,fontSize:8})(),ft=s.tooltipPanel().config({container:lt,hasTick:!0})();if(!k){var ht=st.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});j.on("mousemove.angular-guide",function(t,e){var n=s.util.getMousePos(Y).angle;ht.attr({x2:-_,transform:"rotate("+n+")"}).style({opacity:.5});var r=(n+180+360-h.orientation)%360;at=l.invert(r);var i=s.util.convertToCartesian(_+12,n+180);ut.text(s.util.round(at)).move([i[0]+w[0],i[1]+w[1]])}).on("mouseout.angular-guide",function(t,e){st.select("line").style({opacity:0})})}var dt=st.select("circle").style({stroke:"grey",fill:"none"});j.on("mousemove.radial-guide",function(t,e){var n=s.util.getMousePos(Y).radius;dt.attr({r:n}).style({opacity:.5}),ot=i.invert(s.util.getMousePos(Y).radius);var r=s.util.convertToCartesian(n,h.radialAxis.orientation);ct.text(s.util.round(ot)).move([r[0]+w[0],r[1]+w[1]])}).on("mouseout.radial-guide",function(t,e){dt.style({opacity:0}),ft.hide(),ut.hide(),ct.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,n){var i=r.select(this),a=this.style.fill,o="black",l=this.style.opacity||1;if(i.attr({"data-opacity":l}),a&&"none"!==a){i.attr({"data-fill":a}),o=r.hsl(a).darker().toString(),i.style({fill:o,opacity:1});var u={t:s.util.round(t[0]),r:s.util.round(t[1])};k&&(u.t=M[t[0]]);var c="t: "+u.t+", r: "+u.r,f=this.getBoundingClientRect(),h=e.node().getBoundingClientRect(),d=[f.left+f.width/2-U[0]-h.left,f.top+f.height/2-U[1]-h.top];ft.config({color:o}).text(c),ft.move(d)}else a=this.style.stroke||"black",i.attr({"data-stroke":a}),o=r.hsl(a).darker().toString(),i.style({stroke:o,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=r.event.which)return!1;r.select(this).attr("data-fill")&&ft.show()}).on("mouseout.tooltip",function(t,e){ft.hide();var n=r.select(this),i=n.attr("data-fill");i?n.style({fill:i,opacity:n.attr("data-opacity")}):n.style({stroke:n.attr("data-stroke"),opacity:n.attr("data-opacity")})})}),d}var e,n,i,l,u={data:[],layout:{}},c={},f={},h=r.dispatch("hover"),d={};return d.render=function(e){return t(e),this},d.config=function(t){if(!arguments.length)return u;var e=s.util.cloneJson(t);return e.data.forEach(function(t,e){u.data[e]||(u.data[e]={}),a(u.data[e],s.Axis.defaultConfig().data[0]),a(u.data[e],t)}),a(u.layout,s.Axis.defaultConfig().layout),a(u.layout,e.layout),this},d.getLiveConfig=function(){return f},d.getinputConfig=function(){return c},d.radialScale=function(t){return i},d.angularScale=function(t){return l},d.svg=function(){return e},r.rebind(d,h,"on"),d},s.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:r.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},s.util={},s.DATAEXTENT="dataExtent",s.AREA="AreaChart",s.LINE="LinePlot",s.DOT="DotPlot",s.BAR="BarChart",s.util._override=function(t,e){for(var n in t)n in e&&(e[n]=t[n])},s.util._extend=function(t,e){for(var n in t)e[n]=t[n]},s.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},s.util.dataFromEquation2=function(t,e){var n=e||6;return r.range(0,360+n,n).map(function(e,n){var r=e*Math.PI/180;return[e,t(r)]})},s.util.dataFromEquation=function(t,e,n){var i=e||6,a=[],o=[];r.range(0,360+i,i).forEach(function(e,n){var r=e*Math.PI/180,i=t(r);a.push(e),o.push(i)});var s={t:a,r:o};return n&&(s.name=n),s},s.util.ensureArray=function(t,e){if(void 0===t)return null;var n=[].concat(t);return r.range(e).map(function(t,e){return n[e]||n[0]})},s.util.fillArrays=function(t,e,n){return e.forEach(function(e,r){t[e]=s.util.ensureArray(t[e],n)}),t},s.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},s.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var n=e.shift();return t[n]&&(!e.length||objHasKeys(t[n],e))},s.util.sumArrays=function(t,e){return r.zip(t,e).map(function(t,e){return r.sum(t)})},s.util.arrayLast=function(t){return t[t.length-1]},s.util.arrayEqual=function(t,e){for(var n=Math.max(t.length,e.length,1);n-- >=0&&t[n]===e[n];);return-2===n},s.util.flattenArray=function(t){for(var e=[];!s.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},s.util.deduplicate=function(t){return t.filter(function(t,e,n){return n.indexOf(t)==e})},s.util.convertToCartesian=function(t,e){var n=e*Math.PI/180;return[t*Math.cos(n),t*Math.sin(n)]},s.util.round=function(t,e){var n=e||2,r=Math.pow(10,n);return Math.round(t*r)/r},s.util.getMousePos=function(t){var e=r.mouse(t.node()),n=e[0],i=e[1],a={};return a.x=n,a.y=i,a.pos=e,a.angle=180*(Math.atan2(i,n)+Math.PI)/Math.PI,a.radius=Math.sqrt(n*n+i*i),a},s.util.duplicatesCount=function(t){for(var e,n={},r={},i=0,a=t.length;i0)){var s=r.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({class:"line",d:h(o),transform:function(e,n){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return g.fill(n,i,a)},"fill-opacity":0,stroke:function(t,e){return g.stroke(n,i,a)},"stroke-width":function(t,e){return g["stroke-width"](n,i,a)},"stroke-dasharray":function(t,e){return g["stroke-dasharray"](n,i,a)},opacity:function(t,e){return g.opacity(n,i,a)},display:function(t,e){return g.display(n,i,a)}})}};var d=t.angularScale.range(),p=Math.abs(d[1]-d[0])/l[0].length*Math.PI/180,m=r.svg.arc().startAngle(function(t){return-p/2}).endAngle(function(t){return p/2}).innerRadius(function(e){return t.radialScale(c+(e[2]||0))}).outerRadius(function(e){return t.radialScale(c+(e[2]||0))+t.radialScale(e[1])});f.arc=function(e,n,i){r.select(this).attr({class:"mark arc",d:m,transform:function(e,n){return"rotate("+(t.orientation+u(e[0])+90)+")"}})};var g={fill:function(t,n,r){return e[r].data.color},stroke:function(t,n,r){return e[r].data.strokeColor},"stroke-width":function(t,n,r){return e[r].data.strokeSize+"px"},"stroke-dasharray":function(t,n,r){return i[e[r].data.strokeDash]},opacity:function(t,n,r){return e[r].data.opacity},display:function(t,n,r){return void 0===e[r].data.visible||e[r].data.visible?"block":"none"}},y=r.select(this).selectAll("g.layer").data(l);y.enter().append("g").attr({class:"layer"});var v=y.selectAll("path.mark").data(function(t,e){return t});v.enter().append("path").attr({class:"mark"}),v.style(g).each(f[t.geometryType]),v.exit().remove(),y.exit().remove()})}var e=[s.PolyChart.defaultConfig()],n=r.dispatch("hover"),i={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,n){e[n]||(e[n]={}),a(e[n],s.PolyChart.defaultConfig()),a(e[n],t)}),this):e},t.getColorScale=function(){},r.rebind(t,n,"on"),t},s.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:r.scale.category20()}}},s.BarChart=function(){return s.PolyChart()},s.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},s.AreaChart=function(){return s.PolyChart()},s.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},s.DotPlot=function(){return s.PolyChart()},s.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},s.LinePlot=function(){return s.PolyChart()},s.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},s.Legend=function(){function t(){var n=e.legendConfig,i=e.data.map(function(t,e){return[].concat(t).map(function(t,r){var i=a({},n.elements[e]);return i.name=t, i.color=[].concat(n.elements[e].color)[r],i})}),o=r.merge(i);o=o.filter(function(t,e){return n.elements[e]&&(n.elements[e].visibleInLegend||void 0===n.elements[e].visibleInLegend)}),n.reverseOrder&&(o=o.reverse());var s=n.container;("string"==typeof s||s.nodeName)&&(s=r.select(s));var l=o.map(function(t,e){return t.color}),u=n.fontSize,c=null==n.isContinuous?"number"==typeof o[0]:n.isContinuous,f=c?n.height:u*o.length,h=s.classed("legend-group",!0),d=h.selectAll("svg").data([0]),p=d.enter().append("svg").attr({width:300,height:f+u,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var m=r.range(o.length),g=r.scale[c?"linear":"ordinal"]().domain(m).range(l),y=r.scale[c?"linear":"ordinal"]().domain(m)[c?"range":"rangePoints"]([0,f]),v=function(t,e){var n=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":-1!=r.svg.symbolTypes.indexOf(t)?r.svg.symbol().type(t).size(n)():r.svg.symbol().type("square").size(n)()};if(c){var x=d.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);x.enter().append("stop"),x.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),d.append("rect").classed("legend-mark",!0).attr({height:n.height,width:n.colorBandWidth,fill:"url(#grad1)"})}else{var _=d.select(".legend-marks").selectAll("path.legend-mark").data(o);_.enter().append("path").classed("legend-mark",!0),_.attr({transform:function(t,e){return"translate("+[u/2,y(e)+u/2]+")"},d:function(t,e){var n=t.symbol;return v(n,u)},fill:function(t,e){return g(e)}}),_.exit().remove()}var b=r.svg.axis().scale(y).orient("right"),w=d.select("g.legend-axis").attr({transform:"translate("+[c?n.colorBandWidth:u,u/2]+")"}).call(b);return w.selectAll(".domain").style({fill:"none",stroke:"none"}),w.selectAll("line").style({fill:"none",stroke:c?n.textColor:"none"}),w.selectAll("text").style({fill:n.textColor,"font-size":n.fontSize}).text(function(t,e){return o[e].name}),t}var e=s.Legend.defaultConfig(),n=r.dispatch("hover");return t.config=function(t){return arguments.length?(a(e,t),this):e},r.rebind(t,n,"on"),t},s.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},s.tooltipPanel=function(){var t,e,n,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},o="tooltip-"+s.tooltipPanel.uid++,l=function(){t=i.container.selectAll("g."+o).data([0]);var r=t.enter().append("g").classed(o,!0).style({"pointer-events":"none",display:"none"});return n=r.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=r.append("text").attr({dx:i.padding+10,dy:.3*+i.fontSize}),l};return l.text=function(a){var o=r.hsl(i.color).l,s=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",c=a||"";e.style({fill:u,"font-size":i.fontSize+"px"}).text(c);var f=i.padding,h=e.node().getBBox(),d={fill:i.color,stroke:s,"stroke-width":"2px"},p=h.width+2*f+10,m=h.height+2*f;return n.attr({d:"M"+[[10,-m/2],[10,-m/4],[i.hasTick?0:10,0],[10,m/4],[10,m/2],[p,m/2],[p,-m/2]].join("L")+"Z"}).style(d),t.attr({transform:"translate("+[10,-m/2+2*f]+")"}),t.style({display:"block"}),l},l.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),l},l.hide=function(){if(t)return t.style({display:"none"}),l},l.show=function(){if(t)return t.style({display:"block"}),l},l.config=function(t){return a(i,t),l},l},s.tooltipPanel.uid=1,s.adapter={},s.adapter.plotly=function(){var t={};return t.convert=function(t,e){var n={};if(t.data&&(n.data=t.data.map(function(t,n){var r=a({},t);return[[r,["marker","color"],["color"]],[r,["marker","opacity"],["opacity"]],[r,["marker","line","color"],["strokeColor"]],[r,["marker","line","dash"],["strokeDash"]],[r,["marker","line","width"],["strokeSize"]],[r,["marker","symbol"],["dotType"]],[r,["marker","size"],["dotSize"]],[r,["marker","barWidth"],["barWidth"]],[r,["line","interpolation"],["lineInterpolation"]],[r,["showlegend"],["visibleInLegend"]]].forEach(function(t,n){s.util.translator.apply(null,t.concat(e))}),e||delete r.marker,e&&delete r.groupId,e?("LinePlot"===r.geometry?(r.type="scatter",!0===r.dotVisible?(delete r.dotVisible,r.mode="lines+markers"):r.mode="lines"):"DotPlot"===r.geometry?(r.type="scatter",r.mode="markers"):"AreaChart"===r.geometry?r.type="area":"BarChart"===r.geometry&&(r.type="bar"),delete r.geometry):("scatter"===r.type?"lines"===r.mode?r.geometry="LinePlot":"markers"===r.mode?r.geometry="DotPlot":"lines+markers"===r.mode&&(r.geometry="LinePlot",r.dotVisible=!0):"area"===r.type?r.geometry="AreaChart":"bar"===r.type&&(r.geometry="BarChart"),delete r.mode,delete r.type),r}),!e&&t.layout&&"stack"===t.layout.barmode)){var i=s.util.duplicates(n.data.map(function(t,e){return t.geometry}));n.data.forEach(function(t,e){var r=i.indexOf(t.geometry);-1!=r&&(n.data[e].groupId=r)})}if(t.layout){var o=a({},t.layout);if([[o,["plot_bgcolor"],["backgroundColor"]],[o,["showlegend"],["showLegend"]],[o,["radialaxis"],["radialAxis"]],[o,["angularaxis"],["angularAxis"]],[o.angularaxis,["showline"],["gridLinesVisible"]],[o.angularaxis,["showticklabels"],["labelsVisible"]],[o.angularaxis,["nticks"],["ticksCount"]],[o.angularaxis,["tickorientation"],["tickOrientation"]],[o.angularaxis,["ticksuffix"],["ticksSuffix"]],[o.angularaxis,["range"],["domain"]],[o.angularaxis,["endpadding"],["endPadding"]],[o.radialaxis,["showline"],["gridLinesVisible"]],[o.radialaxis,["tickorientation"],["tickOrientation"]],[o.radialaxis,["ticksuffix"],["ticksSuffix"]],[o.radialaxis,["range"],["domain"]],[o.angularAxis,["showline"],["gridLinesVisible"]],[o.angularAxis,["showticklabels"],["labelsVisible"]],[o.angularAxis,["nticks"],["ticksCount"]],[o.angularAxis,["tickorientation"],["tickOrientation"]],[o.angularAxis,["ticksuffix"],["ticksSuffix"]],[o.angularAxis,["range"],["domain"]],[o.angularAxis,["endpadding"],["endPadding"]],[o.radialAxis,["showline"],["gridLinesVisible"]],[o.radialAxis,["tickorientation"],["tickOrientation"]],[o.radialAxis,["ticksuffix"],["ticksSuffix"]],[o.radialAxis,["range"],["domain"]],[o.font,["outlinecolor"],["outlineColor"]],[o.legend,["traceorder"],["reverseOrder"]],[o,["labeloffset"],["labelOffset"]],[o,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(t,n){s.util.translator.apply(null,t.concat(e))}),e?(void 0!==o.tickLength&&(o.angularaxis.ticklen=o.tickLength,delete o.tickLength),o.tickColor&&(o.angularaxis.tickcolor=o.tickColor,delete o.tickColor)):(o.angularAxis&&void 0!==o.angularAxis.ticklen&&(o.tickLength=o.angularAxis.ticklen),o.angularAxis&&void 0!==o.angularAxis.tickcolor&&(o.tickColor=o.angularAxis.tickcolor)),o.legend&&"boolean"!=typeof o.legend.reverseOrder&&(o.legend.reverseOrder="normal"!=o.legend.reverseOrder),o.legend&&"boolean"==typeof o.legend.traceorder&&(o.legend.traceorder=o.legend.traceorder?"reversed":"normal",delete o.legend.reverseOrder),o.margin&&void 0!==o.margin.t){var l=["t","r","b","l","pad"],u=["top","right","bottom","left","pad"],c={};r.entries(o.margin).forEach(function(t,e){c[u[l.indexOf(t.key)]]=t.value}),o.margin=c}e&&(delete o.needsEndSpacing,delete o.minorTickColor,delete o.minorTicks,delete o.angularaxis.ticksCount,delete o.angularaxis.ticksCount,delete o.angularaxis.ticksStep,delete o.angularaxis.rewriteTicks,delete o.angularaxis.nticks,delete o.radialaxis.ticksCount,delete o.radialaxis.ticksCount,delete o.radialaxis.ticksStep,delete o.radialaxis.rewriteTicks,delete o.radialaxis.nticks),n.layout=o}return n},t}},{"../../constants/alignment":331,"../../lib":350,d3:8}],431:[function(t,e,n){"use strict";var r=t("d3"),i=t("../../lib"),a=t("../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=i.extendDeepAll,u=e.exports={};u.framework=function(t){function e(e,i){return i&&(f=i),r.select(r.select(f).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),n=n?l(n,e):e,a||(a=o.Axis()),c=o.adapter.plotly().convert(n),a.config(c).render(f),t.data=n.data,t.layout=n.layout,u.fillLayout(t),n}var n,i,a,c,f,h=new s;return e.isPolar=!0,e.svg=function(){return a.svg()},e.getConfig=function(){return n},e.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},e.setUndoPoint=function(){var t=this,e=o.util.cloneJson(n);!function(e,n){h.add({undo:function(){n&&t(n)},redo:function(){t(e)}})}(e,i),i=o.util.cloneJson(e)},e.undo=function(){h.undo()},e.redo=function(){h.redo()},e},u.fillLayout=function(t){var e=r.select(t).selectAll(".plot-container"),n=e.selectAll(".svg-container"),i=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:a.background,_container:e,_paperdiv:n,_paper:i};t._fullLayout=l(o,t.layout)}},{"../../components/color":234,"../../lib":350,"./micropolar":430,"./undo_manager":432,d3:8}],432:[function(t,e,n){"use strict";e.exports=function(){function t(t,e){return t?(i=!0,t[e](),i=!1,this):this}var e,n=[],r=-1,i=!1;return{add:function(t){return i?this:(n.splice(r+1,n.length-r),n.push(t),r=n.length-1,this)},setCallback:function(t){e=t},undo:function(){var i=n[r];return i?(t(i,"undo"),r-=1,e&&e(i.undo),this):this},redo:function(){var i=n[r+1];return i?(t(i,"redo"),r+=1,e&&e(i.redo),this):this},clear:function(){n=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r-1}var a=t("../lib"),o=t("../plots/plots"),s=a.extendFlat,l=a.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var n,a=t.data,u=t.layout,c=l([],a),f=l({},u,r(e.tileClass)),h=t._context||{};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(n=0;n")?"":e.html(t).text()});return e.remove(),n}function i(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}var a=t("d3"),o=t("../lib"),s=t("../components/drawing"),l=t("../components/color"),u=t("../constants/xmlns_namespaces"),c=/"/g,f=new RegExp('("TOBESTRIPPED)|(TOBESTRIPPED")',"g");e.exports=function(t,e,n){var h,d=t._fullLayout,p=d._paper,m=d._toppaper,g=d.width,y=d.height;p.insert("rect",":first-child").call(s.setRect,0,0,g,y).call(l.fill,d.paper_bgcolor);var v=d._basePlotModules||[];for(h=0;hm&&d.splice(m,d.length-m),p.length>m&&p.splice(m,p.length-m);var g={padded:!0},y={padded:!0};if(o.hasMarkers(e)){if(n=e.marker,u=n.size,Array.isArray(u)){var v={type:"linear"};i.setConvert(v),u=v.makeCalcdata(e.marker,"size"),u.length>m&&u.splice(m,u.length-m)}var x,_=1.6*(e.marker.sizeref||1);x="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/_),3)}:function(t){return Math.max((t||0)/_,3)},g.ppad=y.ppad=Array.isArray(u)?u.map(x):x(u)}s(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||d[0]===d[m-1]&&p[0]===p[m-1]?e.error_y.visible||-1===["tonexty","tozeroy"].indexOf(e.fill)&&(o.hasMarkers(e)||o.hasText(e))||(g.padded=!1,g.ppad=0):g.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||d[0]===d[m-1]&&p[0]===p[m-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(y.padded=!1):y.tozero=!0,i.expand(f,d,g),i.expand(h,p,y);var b=new Array(m);for(c=0;c=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===n.xaxis&&a.yaxis===n.yaxis){a.opacity=void 0;break}}}}}},{}],448:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var n=e[0].trace,l=n.marker,u="cb"+n.uid;if(t._fullLayout._infolayer.selectAll("."+u).remove(),void 0===l||!l.showscale)return void a.autoMargin(t,u);var c=l.color,f=l.cmin,h=l.cmax;r(f)||(f=i.aggNums(Math.min,null,c)),r(h)||(h=i.aggNums(Math.max,null,c));var d=e[0].t.cb=s(t,u),p=o.makeColorScaleFunc(o.extractScale(l.colorscale,f,h),{noNumericCheck:!0});d.fillcolor(p).filllevels({start:f,end:h,size:(h-f)/254}).options(l.colorbar)()}},{"../../components/colorbar/draw":237,"../../components/colorscale":248,"../../lib":350,"../../plots/plots":426,"fast-isnumeric":12}],449:[function(t,e,n){"use strict";var r=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),a=t("./subtypes");e.exports=function(t){a.hasLines(t)&&r(t,"line")&&i(t,t.line.color,"line","c"),a.hasMarkers(t)&&(r(t,"marker")&&i(t,t.marker.color,"marker","c"),r(t,"marker.line")&&i(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":240,"../../components/colorscale/has_colorscale":247,"./subtypes":466}],450:[function(t,e,n){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20}},{}],451:[function(t,e,n){"use strict";var r=t("../../lib"),i=t("./attributes"),a=t("./constants"),o=t("./subtypes"),s=t("./xy_defaults"),l=t("./marker_defaults"),u=t("./line_defaults"),c=t("./line_shape_defaults"),f=t("./text_defaults"),h=t("./fillcolor_defaults"),d=t("../../components/errorbars/defaults");e.exports=function(t,e,n,p){function m(n,a){return r.coerce(t,e,i,n,a)}var g=s(t,e,p,m),y=gU!=O>=U&&(D=z[E-1][0],C=z[E][0],I=D+(C-D)*(U-P)/(O-P),N=Math.min(N,I),B=Math.max(B,I));N=Math.max(N,0),B=Math.min(B,d._length);var G=s.defaultLine;return s.opacity(h.fillcolor)?G=h.fillcolor:s.opacity((h.line||{}).color)&&(G=h.line.color),r.extendFlat(t,{distance:u+10,x0:N,x1:B,y0:U,y1:U,color:G}),delete t.index,h.text&&!Array.isArray(h.text)?t.text=String(h.text):t.text=h.name,[t]}}}},{"../../components/color":234,"../../components/errorbars":264,"../../components/fx":275,"../../lib":350,"./fill_hover_text":452,"./get_trace_color":454}],456:[function(t,e,n){"use strict";var r={},i=t("./subtypes");r.hasLines=i.hasLines,r.hasMarkers=i.hasMarkers,r.hasText=i.hasText,r.isBubble=i.isBubble,r.attributes=t("./attributes"),r.supplyDefaults=t("./defaults"),r.cleanData=t("./clean_data"),r.calc=t("./calc"),r.arraysToCalcdata=t("./arrays_to_calcdata"),r.plot=t("./plot"),r.colorbar=t("./colorbar"),r.style=t("./style"),r.hoverPoints=t("./hover"),r.selectPoints=t("./select"),r.animatable=!0,r.moduleType="trace",r.name="scatter",r.basePlotModule=t("../../plots/cartesian"),r.categories=["cartesian","symbols","markerColorscale","errorBarsOK","showLegend","scatter-like"],r.meta={},e.exports=r},{"../../plots/cartesian":400,"./arrays_to_calcdata":444,"./attributes":445,"./calc":446,"./clean_data":447,"./colorbar":448,"./defaults":451,"./hover":455,"./plot":463,"./select":464,"./style":465,"./subtypes":466}],457:[function(t,e,n){"use strict";var r=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults");e.exports=function(t,e,n,a,o,s){var l=(t.marker||{}).color;if(o("line.color",n),r(t,"line"))i(t,e,a,o,{prefix:"line.",cLetter:"c"});else{o("line.color",!Array.isArray(l)&&l||n)}o("line.width"),(s||{}).noDash||o("line.dash")}},{"../../components/colorscale/defaults":243,"../../components/colorscale/has_colorscale":247}],458:[function(t,e,n){"use strict";var r=t("../../constants/numerical").BADNUM,i=t("../../lib"),a=i.segmentsIntersect,o=i.constrain,s=t("./constants");e.exports=function(t,e){function n(e){var n=O.c2p(t[e].x),i=F.c2p(t[e].y);return n!==r&&i!==r&&[n,i]}function l(t){var e=t[0]/O._length,n=t[1]/F._length;return(1+s.toleranceGrowth*Math.max(0,-e,e-1,-n,n-1))*N}function u(t,e){var n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}function c(t,e){for(var n=[],r=0,i=0;i<4;i++){var o=it[i],s=a(t[0],t[1],e[0],e[1],o[0],o[1],o[2],o[3]);s&&(!r||Math.abs(s.x-n[0][0])>1||Math.abs(s.y-n[0][1])>1)&&(s=[s.x,s.y],r&&u(s,t)et||t[1]rt)return[o(t[0],tt,et),o(t[1],nt,rt)]}function h(t,e){return t[0]===e[0]&&(t[0]===tt||t[0]===et)||(t[1]===e[1]&&(t[1]===nt||t[1]===rt)||void 0)}function d(t,e){var n=[],r=f(t),i=f(e);return r&&i&&h(r,i)?n:(r&&n.push(r),i&&n.push(i),n)}function p(t,e,n){return function(r,a){var o=f(r),s=f(a),l=[];if(o&&s&&h(o,s))return l;o&&l.push(o),s&&l.push(s);var u=2*i.constrain((r[t]+a[t])/2,e,n)-((o||r)[t]+(s||a)[t]);if(u){var c;c=o&&s?u>0==o[t]>s[t]?o:s:o||s,c[t]+=u}return l}}function m(t,e){var n=e[0]-t[0],r=(e[1]-t[1])/n;return(t[1]*e[0]-e[1]*t[0])/n>0?[r>0?tt:et,rt]:[r>0?et:tt,nt]}function g(t){var e=t[0],n=t[1],r=e===G[H-1][0],i=n===G[H-1][1];if(!r||!i)if(H>1){var a=e===G[H-2][0],o=n===G[H-2][1];r&&(e===tt||e===et)&&a?o?H--:G[H-1]=t:i&&(n===nt||n===rt)&&o?a?H--:G[H-1]=t:G[H++]=t}else G[H++]=t}function y(t){G[H-1][0]!==t[0]&&G[H-1][1]!==t[1]&&g([Y,W]),g(t),Q=null,Y=W=0}function v(t){if(Z=t[0]et?et:0,X=t[1]rt?rt:0,Z||X){if(H)if(Q){var e=$(Q,t);e.length>1&&(y(e[0]),G[H++]=e[1])}else J=$(G[H-1],t)[0],G[H++]=J;else G[H++]=[Z||t[0],X||t[1]];var n=G[H-1];Z&&X&&(n[0]!==Z||n[1]!==X)?(Q&&(Y!==Z&&W!==X?g(Y&&W?m(Q,t):[Y||Z,W||X]):Y&&W&&g([Y,W])),g([Z,X])):Y-Z&&W-X&&g([Z||Y,X||W]),Q=t,Y=Z,W=X}else Q&&y($(Q,t)[0]),G[H++]=t}var x,_,b,w,M,T,k,A,S,E,L,z,I,D,C,P,O=e.xaxis,F=e.yaxis,R=e.simplify,j=e.connectGaps,N=e.baseTolerance,B=e.shape,V="linear"===B,q=[],U=s.minTolerance,G=new Array(t.length),H=0;R||(N=U=-1);var Z,X,Y,W,Q,J,$,K=s.maxScreensAway,tt=-O._length*K,et=O._length*(1+K),nt=-F._length*K,rt=F._length*(1+K),it=[[tt,nt,et,nt],[et,nt,et,rt],[et,rt,tt,rt],[tt,rt,tt,nt]];for("linear"===B||"spline"===B?$=c:"hv"===B||"vh"===B?$=d:"hvh"===B?$=p(0,tt,et):"vhv"===B&&($=p(1,nt,rt)),x=0;xl(T))break;b=T,I=S[0]*A[0]+S[1]*A[1],I>L?(L=I,w=T,k=!1):I=t.length||!T)break;v(T),_=T}}else v(w)}Q&&g([Y||Q[0],W||Q[1]]),q.push(G.slice(0,H))}return q}},{"../../constants/numerical":333,"../../lib":350,"./constants":450}],459:[function(t,e,n){"use strict";e.exports=function(t,e,n){"spline"===n("line.shape")&&n("line.smoothing")}},{}],460:[function(t,e,n){"use strict";e.exports=function(t,e,n){for(var r,i,a=null,o=0;o0?Math.max(e,i):0}}},{"fast-isnumeric":12}],462:[function(t,e,n){"use strict";var r=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,n,s,l,u){var c,f=o.isBubble(t),h=(t.line||{}).color;if(u=u||{},h&&(n=h),l("marker.symbol"),l("marker.opacity",f?.7:1),l("marker.size"),l("marker.color",n),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noLine||(c=h&&!Array.isArray(h)&&e.marker.color!==h?h:f?r.background:r.defaultLine,l("marker.line.color",c),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",f?1:0)),f&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),u.gradient){"none"!==l("marker.gradient.type")&&l("marker.gradient.color")}}},{"../../components/color":234,"../../components/colorscale/defaults":243,"../../components/colorscale/has_colorscale":247,"./subtypes":466}],463:[function(t,e,n){"use strict";function r(t,e,n){var r;e.selectAll("g.trace").each(function(t){var e=o.select(this);if(r=t[0].trace,r._nexttrace){if(r._nextFill=e.select(".js-fill.js-tonext"),!r._nextFill.size()){var i=":first-child";e.select(".js-fill.js-tozero").size()&&(i+=" + *"),r._nextFill=e.insert("path",i).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),e.selectAll(".js-fill").call(l.setClipUrl,n.layerClipId)})}function i(t,e,n,r,i,h,p){function m(t){return M?t.transition():t}function g(t){return t.filter(function(t){return t.vis})}function y(t){return t.id}function v(t){if(t.ids)return y}function x(){return!1}function _(e){var r,i,a,u=e[0].trace,f=o.select(this),h=c.hasMarkers(u),d=c.hasText(u),p=v(u),y=x,_=x;h&&(y=u.marker.maxdisplayed||u._needsCull?g:s.identity),d&&(_=u.marker.maxdisplayed||u._needsCull?g:s.identity),i=f.selectAll("path.point"),r=i.data(y,p);var b=r.enter().append("path").classed("point",!0);M&&b.call(l.pointStyle,u,t).call(l.translatePoints,T,k).style("opacity",0).transition().style("opacity",1);var w=h&&l.tryColorscale(u.marker,""),A=h&&l.tryColorscale(u.marker,"line");r.order(),r.each(function(e){var r=o.select(this),i=m(r);a=l.translatePoint(e,i,T,k),a?(l.singlePointStyle(e,i,u,w,A,t),n.layerClipId&&l.hideOutsideRangePoint(e,i,T,k),u.customdata&&r.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):i.remove()}),M?r.exit().transition().style("opacity",0).remove():r.exit().remove(),i=f.selectAll("g"),r=i.data(_,p),r.enter().append("g").classed("textpoint",!0).append("text"),r.order(),r.each(function(t){var e=o.select(this),r=m(e.select("text"));a=l.translatePoint(t,r,T,k),a?n.layerClipId&&l.hideOutsideRangePoint(t,e,T,k):e.remove()}),r.selectAll("text").call(l.textPointStyle,u,t).each(function(t){var e=T.c2p(t.x),n=k.c2p(t.y);o.select(this).selectAll("tspan.line").each(function(){m(o.select(this)).attr({x:e,y:n})})}),r.exit().remove()}var b,w;a(t,e,n,r,i);var M=!!p&&p.duration>0,T=n.xaxis,k=n.yaxis,A=r[0].trace,S=A.line,E=o.select(h);if(E.call(u.plot,n,p),!0===A.visible){m(E).style("opacity",A.opacity);var L,z,I=A.fill.charAt(A.fill.length-1);"x"!==I&&"y"!==I&&(I=""),r[0].node3=E;var D="",C=[],P=A._prevtrace;P&&(D=P._prevRevpath||"",z=P._nextFill,C=P._polygons);var O,F,R,j,N,B,V,q,U,G="",H="",Z=[],X=s.noop;if(L=A._ownFill,c.hasLines(A)||"none"!==A.fill){for(z&&z.datum(r),-1!==["hv","vh","hvh","vhv"].indexOf(S.shape)?(R=l.steps(S.shape),j=l.steps(S.shape.split("").reverse().join(""))):R=j="spline"===S.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),S.smoothing):l.smoothopen(t,S.smoothing)}:function(t){return"M"+t.join("L")},N=function(t){return j(t.reverse())},Z=f(r,{xaxis:T,yaxis:k,connectGaps:A.connectgaps,baseTolerance:Math.max(S.width||1,3)/4,shape:S.shape,simplify:S.simplify}),U=A._polygons=new Array(Z.length),w=0;w1){var n=o.select(this);if(n.datum(r),t)m(n.style("opacity",0).attr("d",O).call(l.lineGroupStyle)).style("opacity",1);else{var i=m(n);i.attr("d",O),l.singleLineStyle(r,i)}}}}}var Y=E.selectAll(".js-line").data(Z);m(Y.exit()).style("opacity",0).remove(),Y.each(X(!1)),Y.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(X(!0)),l.setClipUrl(Y,n.layerClipId),Z.length&&(L?B&&q&&(I?("y"===I?B[1]=q[1]=k.c2p(0,!0):"x"===I&&(B[0]=q[0]=T.c2p(0,!0)),m(L).attr("d","M"+q+"L"+B+"L"+G.substr(1)).call(l.singleFillStyle)):m(L).attr("d",G+"Z").call(l.singleFillStyle)):"tonext"===A.fill.substr(0,6)&&G&&D&&("tonext"===A.fill?m(z).attr("d",G+"Z"+D+"Z").call(l.singleFillStyle):m(z).attr("d",G+"L"+D.substr(1)+"Z").call(l.singleFillStyle),A._polygons=A._polygons.concat(C)),A._prevRevpath=H,A._prevPolygons=U);var W=E.selectAll(".points");b=W.data([r]),W.each(_),b.enter().append("g").classed("points",!0).each(_),b.exit().remove(),b.each(function(t){var e=!1===t[0].trace.cliponaxis;l.setClipUrl(o.select(this),e?null:n.layerClipId)})}}function a(t,e,n,r,i){var a=n.xaxis,l=n.yaxis,u=o.extent(s.simpleMap(a.range,a.r2c)),f=o.extent(s.simpleMap(l.range,l.r2c)),h=r[0].trace;if(c.hasMarkers(h)){var d=h.marker.maxdisplayed;if(0!==d){var p=r.filter(function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=f[0]&&t.y<=f[1]}),m=Math.ceil(p.length/d),g=0;i.forEach(function(t,n){var r=t[0].trace;c.hasMarkers(r)&&r.marker.maxdisplayed>0&&n0;for(c=p.selectAll("g.trace"),f=c.data(n,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,n),r(t,p,e),l=0,u={};lu[e[0].trace.uid]?1:-1}),g){s&&(d=s());o.transition().duration(a.duration).ease(a.easing).each("end",function(){d&&d()}).each("interrupt",function(){d&&d()}).each(function(){p.selectAll("g.trace").each(function(r,o){i(t,o,e,r,n,this,a)})})}else p.selectAll("g.trace").each(function(r,o){i(t,o,e,r,n,this,a)});m&&f.exit().remove(),p.selectAll("path:not([d])").remove()}},{"../../components/drawing":258,"../../components/errorbars":264,"../../lib":350,"../../lib/polygon":361,"./line_points":458,"./link_traces":460,"./subtypes":466,d3:8}],464:[function(t,e,n){"use strict";var r=t("./subtypes"),i=t("../../constants/interactions").DESELECTDIM;e.exports=function(t,e){var n,a,o,s,l=t.cd,u=t.xaxis,c=t.yaxis,f=[],h=l[0].trace,d=h.marker,p=!r.hasMarkers(h)&&!r.hasText(h);if(!0!==h.visible||p)return[];var m=Array.isArray(d.opacity)?1:d.opacity;if(!1===e)for(n=0;n")}var i=t("../../components/fx"),a=t("../scatter/get_trace_color"),o=t("../scatter/fill_hover_text"),s=t("../../constants/numerical").BADNUM;e.exports=function(t,e,n){function o(t){var e=t.lonlat;if(e[0]===s)return 1/0;var r=Math.abs(c.c2p(e)-c.c2p([p,e[1]])),i=Math.abs(f.c2p(e)-f.c2p([e[0],n])),a=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(r*r+i*i)-a,1-3/a)}var l=t.cd,u=l[0].trace,c=t.xa,f=t.ya,h=e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360),d=360*h,p=e-d;if(i.getClosest(l,o,t),!1!==t.index){var m=l[t.index],g=m.lonlat,y=[g[0]+d,g[1]],v=c.c2p(y),x=f.c2p(y),_=m.mrc||1;return t.x0=v-_,t.x1=v+_,t.y0=x-_,t.y1=x+_,t.color=a(u,m),t.extraText=r(u,m),[t]}}},{"../../components/fx":275,"../../constants/numerical":333,"../scatter/fill_hover_text":452,"../scatter/get_trace_color":454}],476:[function(t,e,n){"use strict";var r={};r.attributes=t("./attributes"),r.supplyDefaults=t("./defaults"),r.colorbar=t("../scatter/colorbar"),r.calc=t("../scattergeo/calc"),r.plot=t("./plot"),r.hoverPoints=t("./hover"),r.eventData=t("./event_data"),r.selectPoints=t("./select"),r.moduleType="trace",r.name="scattermapbox",r.basePlotModule=t("../../plots/mapbox"),r.categories=["mapbox","gl","symbols","markerColorscale","showLegend","scatterlike"],r.meta={},e.exports=r},{"../../plots/mapbox":420,"../scatter/colorbar":448,"../scattergeo/calc":470,"./attributes":471,"./defaults":473,"./event_data":474,"./hover":475,"./plot":477,"./select":478}],477:[function(t,e,n){"use strict";function r(t,e){this.mapbox=t,this.map=t.map,this.uid=e,this.idSourceFill=e+"-source-fill",this.idSourceLine=e+"-source-line",this.idSourceCircle=e+"-source-circle",this.idSourceSymbol=e+"-source-symbol",this.idLayerFill=e+"-layer-fill",this.idLayerLine=e+"-layer-line",this.idLayerCircle=e+"-layer-circle",this.idLayerSymbol=e+"-layer-symbol",this.mapbox.initSource(this.idSourceFill),this.mapbox.initSource(this.idSourceLine),this.mapbox.initSource(this.idSourceCircle),this.mapbox.initSource(this.idSourceSymbol),this.map.addLayer({id:this.idLayerFill,source:this.idSourceFill,type:"fill"}),this.map.addLayer({id:this.idLayerLine,source:this.idSourceLine,type:"line"}),this.map.addLayer({id:this.idLayerCircle,source:this.idSourceCircle,type:"circle"}),this.map.addLayer({id:this.idLayerSymbol,source:this.idSourceSymbol,type:"symbol"})}function i(t){return"visible"===t.layout.visibility}var a=t("./convert"),o=r.prototype;o.update=function(t){var e=this.mapbox,n=a(t);e.setOptions(this.idLayerFill,"setLayoutProperty",n.fill.layout),e.setOptions(this.idLayerLine,"setLayoutProperty",n.line.layout),e.setOptions(this.idLayerCircle,"setLayoutProperty",n.circle.layout),e.setOptions(this.idLayerSymbol,"setLayoutProperty",n.symbol.layout),i(n.fill)&&(e.setSourceData(this.idSourceFill,n.fill.geojson),e.setOptions(this.idLayerFill,"setPaintProperty",n.fill.paint)),i(n.line)&&(e.setSourceData(this.idSourceLine,n.line.geojson),e.setOptions(this.idLayerLine,"setPaintProperty",n.line.paint)),i(n.circle)&&(e.setSourceData(this.idSourceCircle,n.circle.geojson),e.setOptions(this.idLayerCircle,"setPaintProperty",n.circle.paint)),i(n.symbol)&&(e.setSourceData(this.idSourceSymbol,n.symbol.geojson),e.setOptions(this.idLayerSymbol,"setPaintProperty",n.symbol.paint)),t[0].trace._glTrace=this},o.dispose=function(){var t=this.map;t.removeLayer(this.idLayerFill),t.removeLayer(this.idLayerLine),t.removeLayer(this.idLayerCircle),t.removeLayer(this.idLayerSymbol),t.removeSource(this.idSourceFill),t.removeSource(this.idSourceLine),t.removeSource(this.idSourceCircle),t.removeSource(this.idSourceSymbol)},e.exports=function(t,e){var n=e[0].trace,i=new r(t,n.uid);return i.update(e),i}},{"./convert":472}],478:[function(t,e,n){"use strict";var r=t("../scatter/subtypes");e.exports=function(t,e){var n,i,a,o,s,l=t.cd,u=t.xaxis,c=t.yaxis,f=[],h=l[0].trace;if(h._hasDimmedPts=!1,!0!==h.visible||!r.hasMarkers(h))return[];if(!1===e)for(s=0;sU!=O>=U&&(D=z[E-1][0],C=z[E][0],I=D+(C-D)*(U-P)/(O-P),N=Math.min(N,I),B=Math.max(B,I));N=Math.max(N,0),B=Math.min(B,d._length);var G=s.defaultLine;return s.opacity(h.fillcolor)?G=h.fillcolor:s.opacity((h.line||{}).color)&&(G=h.line.color),r.extendFlat(t,{distance:u+10,x0:N,x1:B,y0:U,y1:U,color:G}),delete t.index,h.text&&!Array.isArray(h.text)?t.text=String(h.text):t.text=h.name,[t]}}}},{"../../components/color":234,"../../components/errorbars":264,"../../components/fx":275,"../../lib":350,"./fill_hover_text":452,"./get_trace_color":454}],456:[function(t,e,n){"use strict";var r={},i=t("./subtypes");r.hasLines=i.hasLines,r.hasMarkers=i.hasMarkers,r.hasText=i.hasText,r.isBubble=i.isBubble,r.attributes=t("./attributes"),r.supplyDefaults=t("./defaults"),r.cleanData=t("./clean_data"),r.calc=t("./calc"),r.arraysToCalcdata=t("./arrays_to_calcdata"),r.plot=t("./plot"),r.colorbar=t("./colorbar"),r.style=t("./style"),r.hoverPoints=t("./hover"),r.selectPoints=t("./select"),r.animatable=!0,r.moduleType="trace",r.name="scatter",r.basePlotModule=t("../../plots/cartesian"),r.categories=["cartesian","symbols","markerColorscale","errorBarsOK","showLegend","scatter-like"],r.meta={},e.exports=r},{"../../plots/cartesian":400,"./arrays_to_calcdata":444,"./attributes":445,"./calc":446,"./clean_data":447,"./colorbar":448,"./defaults":451,"./hover":455,"./plot":463,"./select":464,"./style":465,"./subtypes":466}],457:[function(t,e,n){"use strict";var r=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults");e.exports=function(t,e,n,a,o,s){var l=(t.marker||{}).color;if(o("line.color",n),r(t,"line"))i(t,e,a,o,{prefix:"line.",cLetter:"c"});else{o("line.color",!Array.isArray(l)&&l||n)}o("line.width"),(s||{}).noDash||o("line.dash")}},{"../../components/colorscale/defaults":243,"../../components/colorscale/has_colorscale":247}],458:[function(t,e,n){"use strict";var r=t("../../constants/numerical").BADNUM,i=t("../../lib"),a=i.segmentsIntersect,o=i.constrain,s=t("./constants");e.exports=function(t,e){function n(e){var n=O.c2p(t[e].x),i=F.c2p(t[e].y);return n!==r&&i!==r&&[n,i]}function l(t){var e=t[0]/O._length,n=t[1]/F._length;return(1+s.toleranceGrowth*Math.max(0,-e,e-1,-n,n-1))*N}function u(t,e){var n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}function c(t,e){for(var n=[],r=0,i=0;i<4;i++){var o=it[i],s=a(t[0],t[1],e[0],e[1],o[0],o[1],o[2],o[3]);s&&(!r||Math.abs(s.x-n[0][0])>1||Math.abs(s.y-n[0][1])>1)&&(s=[s.x,s.y],r&&u(s,t)et||t[1]rt)return[o(t[0],tt,et),o(t[1],nt,rt)]}function h(t,e){return t[0]===e[0]&&(t[0]===tt||t[0]===et)||(t[1]===e[1]&&(t[1]===nt||t[1]===rt)||void 0)}function d(t,e){var n=[],r=f(t),i=f(e);return r&&i&&h(r,i)?n:(r&&n.push(r),i&&n.push(i),n)}function p(t,e,n){return function(r,a){var o=f(r),s=f(a),l=[];if(o&&s&&h(o,s))return l;o&&l.push(o),s&&l.push(s);var u=2*i.constrain((r[t]+a[t])/2,e,n)-((o||r)[t]+(s||a)[t]);if(u){var c;c=o&&s?u>0==o[t]>s[t]?o:s:o||s,c[t]+=u}return l}}function m(t,e){var n=e[0]-t[0],r=(e[1]-t[1])/n;return(t[1]*e[0]-e[1]*t[0])/n>0?[r>0?tt:et,rt]:[r>0?et:tt,nt]}function g(t){var e=t[0],n=t[1],r=e===G[H-1][0],i=n===G[H-1][1];if(!r||!i)if(H>1){var a=e===G[H-2][0],o=n===G[H-2][1];r&&(e===tt||e===et)&&a?o?H--:G[H-1]=t:i&&(n===nt||n===rt)&&o?a?H--:G[H-1]=t:G[H++]=t}else G[H++]=t}function y(t){G[H-1][0]!==t[0]&&G[H-1][1]!==t[1]&&g([Y,W]),g(t),Q=null,Y=W=0}function v(t){if(Z=t[0]et?et:0,X=t[1]rt?rt:0,Z||X){if(H)if(Q){var e=$(Q,t);e.length>1&&(y(e[0]),G[H++]=e[1])}else J=$(G[H-1],t)[0],G[H++]=J;else G[H++]=[Z||t[0],X||t[1]];var n=G[H-1];Z&&X&&(n[0]!==Z||n[1]!==X)?(Q&&(Y!==Z&&W!==X?g(Y&&W?m(Q,t):[Y||Z,W||X]):Y&&W&&g([Y,W])),g([Z,X])):Y-Z&&W-X&&g([Z||Y,X||W]),Q=t,Y=Z,W=X}else Q&&y($(Q,t)[0]),G[H++]=t}var x,_,b,w,M,T,k,A,S,E,L,z,I,D,C,P,O=e.xaxis,F=e.yaxis,R=e.simplify,j=e.connectGaps,N=e.baseTolerance,B=e.shape,V="linear"===B,q=[],U=s.minTolerance,G=new Array(t.length),H=0;R||(N=U=-1);var Z,X,Y,W,Q,J,$,K=s.maxScreensAway,tt=-O._length*K,et=O._length*(1+K),nt=-F._length*K,rt=F._length*(1+K),it=[[tt,nt,et,nt],[et,nt,et,rt],[et,rt,tt,rt],[tt,rt,tt,nt]];for("linear"===B||"spline"===B?$=c:"hv"===B||"vh"===B?$=d:"hvh"===B?$=p(0,tt,et):"vhv"===B&&($=p(1,nt,rt)),x=0;xl(T))break;b=T,I=S[0]*A[0]+S[1]*A[1],I>L?(L=I,w=T,k=!1):I=t.length||!T)break;v(T),_=T}}else v(w)}Q&&g([Y||Q[0],W||Q[1]]),q.push(G.slice(0,H))}return q}},{"../../constants/numerical":333,"../../lib":350,"./constants":450}],459:[function(t,e,n){"use strict";e.exports=function(t,e,n){"spline"===n("line.shape")&&n("line.smoothing")}},{}],460:[function(t,e,n){"use strict";e.exports=function(t,e,n){for(var r,i,a=null,o=0;o0?Math.max(e,i):0}}},{"fast-isnumeric":12}],462:[function(t,e,n){"use strict";var r=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,n,s,l,u){var c,f=o.isBubble(t),h=(t.line||{}).color;if(u=u||{},h&&(n=h),l("marker.symbol"),l("marker.opacity",f?.7:1),l("marker.size"),l("marker.color",n),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noLine||(c=h&&!Array.isArray(h)&&e.marker.color!==h?h:f?r.background:r.defaultLine,l("marker.line.color",c),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",f?1:0)),f&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),u.gradient){"none"!==l("marker.gradient.type")&&l("marker.gradient.color")}}},{"../../components/color":234,"../../components/colorscale/defaults":243,"../../components/colorscale/has_colorscale":247,"./subtypes":466}],463:[function(t,e,n){"use strict";function r(t,e,n){var r;e.selectAll("g.trace").each(function(t){var e=o.select(this);if(r=t[0].trace,r._nexttrace){if(r._nextFill=e.select(".js-fill.js-tonext"),!r._nextFill.size()){var i=":first-child";e.select(".js-fill.js-tozero").size()&&(i+=" + *"),r._nextFill=e.insert("path",i).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),e.selectAll(".js-fill").call(l.setClipUrl,n.layerClipId)})}function i(t,e,n,r,i,h,p){function m(t){return M?t.transition():t}function g(t){return t.filter(function(t){return t.vis})}function y(t){return t.id}function v(t){if(t.ids)return y}function x(){return!1}function _(e){var r,i,a,u=e[0].trace,f=o.select(this),h=c.hasMarkers(u),d=c.hasText(u),p=v(u),y=x,_=x;h&&(y=u.marker.maxdisplayed||u._needsCull?g:s.identity),d&&(_=u.marker.maxdisplayed||u._needsCull?g:s.identity),i=f.selectAll("path.point"),r=i.data(y,p);var b=r.enter().append("path").classed("point",!0);M&&b.call(l.pointStyle,u,t).call(l.translatePoints,T,k).style("opacity",0).transition().style("opacity",1);var w=h&&l.tryColorscale(u.marker,""),A=h&&l.tryColorscale(u.marker,"line");r.order(),r.each(function(e){var r=o.select(this),i=m(r);a=l.translatePoint(e,i,T,k),a?(l.singlePointStyle(e,i,u,w,A,t),n.layerClipId&&l.hideOutsideRangePoint(e,i,T,k),u.customdata&&r.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):i.remove()}),M?r.exit().transition().style("opacity",0).remove():r.exit().remove(),i=f.selectAll("g"),r=i.data(_,p),r.enter().append("g").classed("textpoint",!0).append("text"),r.order(),r.each(function(t){var e=o.select(this),r=m(e.select("text"));a=l.translatePoint(t,r,T,k),a?n.layerClipId&&l.hideOutsideRangePoint(t,e,T,k):e.remove()}),r.selectAll("text").call(l.textPointStyle,u,t).each(function(t){var e=T.c2p(t.x),n=k.c2p(t.y);o.select(this).selectAll("tspan.line").each(function(){m(o.select(this)).attr({x:e,y:n})})}),r.exit().remove()}var b,w;a(t,e,n,r,i);var M=!!p&&p.duration>0,T=n.xaxis,k=n.yaxis,A=r[0].trace,S=A.line,E=o.select(h);if(E.call(u.plot,n,p),!0===A.visible){m(E).style("opacity",A.opacity);var L,z,I=A.fill.charAt(A.fill.length-1);"x"!==I&&"y"!==I&&(I=""),r[0].node3=E;var D="",C=[],P=A._prevtrace;P&&(D=P._prevRevpath||"",z=P._nextFill,C=P._polygons);var O,F,R,j,N,B,V,q,U,G="",H="",Z=[],X=s.noop;if(L=A._ownFill,c.hasLines(A)||"none"!==A.fill){for(z&&z.datum(r),-1!==["hv","vh","hvh","vhv"].indexOf(S.shape)?(R=l.steps(S.shape),j=l.steps(S.shape.split("").reverse().join(""))):R=j="spline"===S.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),S.smoothing):l.smoothopen(t,S.smoothing)}:function(t){return"M"+t.join("L")},N=function(t){return j(t.reverse())},Z=f(r,{xaxis:T,yaxis:k,connectGaps:A.connectgaps,baseTolerance:Math.max(S.width||1,3)/4,shape:S.shape,simplify:S.simplify}),U=A._polygons=new Array(Z.length),w=0;w1){var n=o.select(this);if(n.datum(r),t)m(n.style("opacity",0).attr("d",O).call(l.lineGroupStyle)).style("opacity",1);else{var i=m(n);i.attr("d",O),l.singleLineStyle(r,i)}}}}}var Y=E.selectAll(".js-line").data(Z);m(Y.exit()).style("opacity",0).remove(),Y.each(X(!1)),Y.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(X(!0)),l.setClipUrl(Y,n.layerClipId),Z.length&&(L?B&&q&&(I?("y"===I?B[1]=q[1]=k.c2p(0,!0):"x"===I&&(B[0]=q[0]=T.c2p(0,!0)),m(L).attr("d","M"+q+"L"+B+"L"+G.substr(1)).call(l.singleFillStyle)):m(L).attr("d",G+"Z").call(l.singleFillStyle)):"tonext"===A.fill.substr(0,6)&&G&&D&&("tonext"===A.fill?m(z).attr("d",G+"Z"+D+"Z").call(l.singleFillStyle):m(z).attr("d",G+"L"+D.substr(1)+"Z").call(l.singleFillStyle),A._polygons=A._polygons.concat(C)),A._prevRevpath=H,A._prevPolygons=U);var W=E.selectAll(".points");b=W.data([r]),W.each(_),b.enter().append("g").classed("points",!0).each(_),b.exit().remove(),b.each(function(t){var e=!1===t[0].trace.cliponaxis;l.setClipUrl(o.select(this),e?null:n.layerClipId)})}}function a(t,e,n,r,i){var a=n.xaxis,l=n.yaxis,u=o.extent(s.simpleMap(a.range,a.r2c)),f=o.extent(s.simpleMap(l.range,l.r2c)),h=r[0].trace;if(c.hasMarkers(h)){var d=h.marker.maxdisplayed;if(0!==d){var p=r.filter(function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=f[0]&&t.y<=f[1]}),m=Math.ceil(p.length/d),g=0;i.forEach(function(t,n){var r=t[0].trace;c.hasMarkers(r)&&r.marker.maxdisplayed>0&&n0;for(c=p.selectAll("g.trace"),f=c.data(n,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,n),r(t,p,e),l=0,u={};lu[e[0].trace.uid]?1:-1}),g){s&&(d=s());o.transition().duration(a.duration).ease(a.easing).each("end",function(){d&&d()}).each("interrupt",function(){d&&d()}).each(function(){p.selectAll("g.trace").each(function(r,o){i(t,o,e,r,n,this,a)})})}else p.selectAll("g.trace").each(function(r,o){i(t,o,e,r,n,this,a)});m&&f.exit().remove(),p.selectAll("path:not([d])").remove()}},{"../../components/drawing":258,"../../components/errorbars":264,"../../lib":350,"../../lib/polygon":361,"./line_points":458,"./link_traces":460,"./subtypes":466,d3:8}],464:[function(t,e,n){"use strict";var r=t("./subtypes"),i=t("../../constants/interactions").DESELECTDIM;e.exports=function(t,e){var n,a,o,s,l=t.cd,u=t.xaxis,c=t.yaxis,f=[],h=l[0].trace,d=h.marker;if(!r.hasMarkers(h)&&!r.hasText(h))return[];var p=Array.isArray(d.opacity)?1:d.opacity;if(!1===e)for(n=0;n")}var i=t("../../components/fx"),a=t("../scatter/get_trace_color"),o=t("../scatter/fill_hover_text"),s=t("../../constants/numerical").BADNUM;e.exports=function(t,e,n){function o(t){var e=t.lonlat;if(e[0]===s)return 1/0;var r=Math.abs(c.c2p(e)-c.c2p([p,e[1]])),i=Math.abs(f.c2p(e)-f.c2p([e[0],n])),a=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(r*r+i*i)-a,1-3/a)}var l=t.cd,u=l[0].trace,c=t.xa,f=t.ya,h=e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360),d=360*h,p=e-d;if(i.getClosest(l,o,t),!1!==t.index){var m=l[t.index],g=m.lonlat,y=[g[0]+d,g[1]],v=c.c2p(y),x=f.c2p(y),_=m.mrc||1;return t.x0=v-_,t.x1=v+_,t.y0=x-_,t.y1=x+_,t.color=a(u,m),t.extraText=r(u,m),[t]}}},{"../../components/fx":275,"../../constants/numerical":333,"../scatter/fill_hover_text":452,"../scatter/get_trace_color":454}],476:[function(t,e,n){"use strict";var r={};r.attributes=t("./attributes"),r.supplyDefaults=t("./defaults"),r.colorbar=t("../scatter/colorbar"),r.calc=t("../scattergeo/calc"),r.plot=t("./plot"),r.hoverPoints=t("./hover"),r.eventData=t("./event_data"),r.selectPoints=t("./select"),r.moduleType="trace",r.name="scattermapbox",r.basePlotModule=t("../../plots/mapbox"),r.categories=["mapbox","gl","symbols","markerColorscale","showLegend","scatterlike"],r.meta={},e.exports=r},{"../../plots/mapbox":420,"../scatter/colorbar":448,"../scattergeo/calc":470,"./attributes":471,"./defaults":473,"./event_data":474,"./hover":475,"./plot":477,"./select":478}],477:[function(t,e,n){"use strict";function r(t,e){this.mapbox=t,this.map=t.map,this.uid=e,this.idSourceFill=e+"-source-fill",this.idSourceLine=e+"-source-line",this.idSourceCircle=e+"-source-circle",this.idSourceSymbol=e+"-source-symbol",this.idLayerFill=e+"-layer-fill",this.idLayerLine=e+"-layer-line",this.idLayerCircle=e+"-layer-circle",this.idLayerSymbol=e+"-layer-symbol",this.mapbox.initSource(this.idSourceFill),this.mapbox.initSource(this.idSourceLine),this.mapbox.initSource(this.idSourceCircle),this.mapbox.initSource(this.idSourceSymbol),this.map.addLayer({id:this.idLayerFill,source:this.idSourceFill,type:"fill"}),this.map.addLayer({id:this.idLayerLine,source:this.idSourceLine,type:"line"}),this.map.addLayer({id:this.idLayerCircle,source:this.idSourceCircle,type:"circle"}),this.map.addLayer({id:this.idLayerSymbol,source:this.idSourceSymbol,type:"symbol"})}function i(t){return"visible"===t.layout.visibility}var a=t("./convert"),o=r.prototype;o.update=function(t){var e=this.mapbox,n=a(t);e.setOptions(this.idLayerFill,"setLayoutProperty",n.fill.layout),e.setOptions(this.idLayerLine,"setLayoutProperty",n.line.layout),e.setOptions(this.idLayerCircle,"setLayoutProperty",n.circle.layout),e.setOptions(this.idLayerSymbol,"setLayoutProperty",n.symbol.layout),i(n.fill)&&(e.setSourceData(this.idSourceFill,n.fill.geojson),e.setOptions(this.idLayerFill,"setPaintProperty",n.fill.paint)),i(n.line)&&(e.setSourceData(this.idSourceLine,n.line.geojson),e.setOptions(this.idLayerLine,"setPaintProperty",n.line.paint)),i(n.circle)&&(e.setSourceData(this.idSourceCircle,n.circle.geojson),e.setOptions(this.idLayerCircle,"setPaintProperty",n.circle.paint)),i(n.symbol)&&(e.setSourceData(this.idSourceSymbol,n.symbol.geojson),e.setOptions(this.idLayerSymbol,"setPaintProperty",n.symbol.paint)),t[0].trace._glTrace=this},o.dispose=function(){var t=this.map;t.removeLayer(this.idLayerFill),t.removeLayer(this.idLayerLine),t.removeLayer(this.idLayerCircle),t.removeLayer(this.idLayerSymbol),t.removeSource(this.idSourceFill),t.removeSource(this.idSourceLine),t.removeSource(this.idSourceCircle),t.removeSource(this.idSourceSymbol)},e.exports=function(t,e){var n=e[0].trace,i=new r(t,n.uid);return i.update(e),i}},{"./convert":472}],478:[function(t,e,n){"use strict";var r=t("../scatter/subtypes");e.exports=function(t,e){var n,i,a,o,s,l=t.cd,u=t.xaxis,c=t.yaxis,f=[],h=l[0].trace;if(h._hasDimmedPts=!1,!r.hasMarkers(h))return[];if(!1===e)for(s=0;s i) j--; + pi.edgepaths[j] = edgepathj.concat(pts, edgepathi); } + break; } - }); + } if(!doublemerged) { - pi.edgepaths[edgei] = pts.concat(edgepath); + pi.edgepaths[i] = pts.concat(edgepathi); } } - }); - pi.edgepaths.forEach(function(edgepath, edgei) { - if(!merged && equalPts(edgepath[edgepath.length - 1], pts[0], xtol, ytol)) { - pts.splice(0, 1); - pi.edgepaths[edgei] = edgepath.concat(pts); + } + for(i = 0; i < pi.edgepaths.length; i++) { + if(merged) break; + edgepathi = pi.edgepaths[i]; + if(equalPts(edgepathi[edgepathi.length - 1], pts[0], xtol, ytol)) { + pts.shift(); + pi.edgepaths[i] = edgepathi.concat(pts); merged = true; } - }); + } if(!merged) pi.edgepaths.push(pts); } @@ -181574,7 +181570,7 @@ module.exports = function selectPoints(searchInfo, polygon) { // TODO: include lines? that would require per-segment line properties var hasOnlyLines = (!subtypes.hasMarkers(trace) && !subtypes.hasText(trace)); - if(trace.visible !== true || hasOnlyLines) return []; + if(hasOnlyLines) return []; var opacity = Array.isArray(marker.opacity) ? 1 : marker.opacity; @@ -183737,7 +183733,7 @@ module.exports = function selectPoints(searchInfo, polygon) { var di, lonlat, x, y, i; var hasOnlyLines = (!subtypes.hasMarkers(trace) && !subtypes.hasText(trace)); - if(trace.visible !== true || hasOnlyLines) return []; + if(hasOnlyLines) return []; var marker = trace.marker; var opacity = Array.isArray(marker.opacity) ? 1 : marker.opacity; @@ -184808,7 +184804,7 @@ module.exports = function selectPoints(searchInfo, polygon) { var scene = glTrace.scene; var hasOnlyLines = (!subtypes.hasMarkers(trace) && !subtypes.hasText(trace)); - if(trace.visible !== true || hasOnlyLines) return []; + if(hasOnlyLines) return []; // filter out points by visible scatter ones if(polygon === false) { @@ -185735,7 +185731,7 @@ module.exports = function selectPoints(searchInfo, polygon) { // to not insert data-driven 'circle-opacity' when we don't need to trace._hasDimmedPts = false; - if(trace.visible !== true || !subtypes.hasMarkers(trace)) return []; + if(!subtypes.hasMarkers(trace)) return []; if(polygon === false) { for(i = 0; i < cd.length; i++) { @@ -187187,7 +187183,10 @@ module.exports = overrideAll({ arrayOk: true, dflt: null, role: 'style', - description: 'The width of cells.' + description: [ + 'The width of columns expressed as a ratio. Columns fill the available width', + 'in proportion of their specified column widths.' + ].join(' ') }, columnorder: { @@ -187488,11 +187487,12 @@ module.exports = function calc(gd, trace) { var headerValues = trace.header.values.map(function(c) { return Array.isArray(c) ? c : [c]; }); + var cellsValues = trace.cells.values; var domain = trace.domain; var groupWidth = Math.floor(gd._fullLayout._size.w * (domain.x[1] - domain.x[0])); var groupHeight = Math.floor(gd._fullLayout._size.h * (domain.y[1] - domain.y[0])); - var headerRowHeights = headerValues[0].map(function() {return trace.header.height;}); - var rowHeights = trace.cells.values[0].map(function() {return trace.cells.height;}); + var headerRowHeights = headerValues.length ? headerValues[0].map(function() {return trace.header.height;}) : []; + var rowHeights = cellsValues.length ? cellsValues[0].map(function() {return trace.cells.height;}) : []; var headerHeight = headerRowHeights.reduce(function(a, b) {return a + b;}, 0); var scrollHeight = groupHeight - headerHeight; var minimumFillHeight = scrollHeight + c.uplift; @@ -187702,9 +187702,9 @@ function rowFromTo(d) { var Lib = require('../../lib'); var attributes = require('./attributes'); -function defaultColumnOrder(traceIn, coerce) { - var specifiedColumnOrder = traceIn.columnorder || []; - var commonLength = traceIn.header.values.length; +function defaultColumnOrder(traceOut, coerce) { + var specifiedColumnOrder = traceOut.columnorder || []; + var commonLength = traceOut.header.values.length; var truncated = specifiedColumnOrder.slice(0, commonLength); var sorted = truncated.slice().sort(function(a, b) {return a - b;}); var oneStepped = truncated.map(function(d) {return sorted.indexOf(d);}); @@ -187719,28 +187719,10 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout return Lib.coerce(traceIn, traceOut, attributes, attr, dflt); } - var fontDflt = { - family: layout.font.family, - size: layout.font.size, - color: layout.font.color - }; - coerce('domain.x'); coerce('domain.y'); coerce('columnwidth'); - defaultColumnOrder(traceIn, coerce); - - coerce('cells.values'); - coerce('cells.format'); - coerce('cells.align'); - coerce('cells.prefix'); - coerce('cells.suffix'); - coerce('cells.height'); - coerce('cells.line.width'); - coerce('cells.line.color'); - coerce('cells.fill.color'); - Lib.coerceFont(coerce, 'cells.font', fontDflt); coerce('header.values'); coerce('header.format'); @@ -187752,7 +187734,20 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout coerce('header.line.width'); coerce('header.line.color'); coerce('header.fill.color'); - Lib.coerceFont(coerce, 'header.font', fontDflt); + Lib.coerceFont(coerce, 'header.font', Lib.extendFlat({}, layout.font)); + + defaultColumnOrder(traceOut, coerce); + + coerce('cells.values'); + coerce('cells.format'); + coerce('cells.align'); + coerce('cells.prefix'); + coerce('cells.suffix'); + coerce('cells.height'); + coerce('cells.line.width'); + coerce('cells.line.color'); + coerce('cells.fill.color'); + Lib.coerceFont(coerce, 'cells.font', Lib.extendFlat({}, layout.font)); }; },{"../../lib":728,"./attributes":1105}],1112:[function(require,module,exports){ @@ -187776,7 +187771,7 @@ Table.plot = require('./plot'); Table.moduleType = 'trace'; Table.name = 'table'; Table.basePlotModule = require('./base_plot'); -Table.categories = []; +Table.categories = ['noOpacity']; Table.meta = { description: [ 'Table view for detailed data viewing.', @@ -187884,6 +187879,8 @@ module.exports = function plot(gd, wrappedTraceHolders) { .append('g') .classed(c.cn.yColumn, true); + yColumn.exit().remove(); + yColumn .attr('transform', function(d) {return 'translate(' + d.x + ' 0)';}) .call(d3.behavior.drag() @@ -188033,7 +188030,7 @@ function renderScrollbarKit(tableControlView, gd, bypassVisibleBar) { function calcTotalHeight(d) { var blocks = d.rowBlocks; - return firstRowAnchor(blocks, blocks.length - 1) + rowsHeight(blocks[blocks.length - 1], Infinity); + return firstRowAnchor(blocks, blocks.length - 1) + (blocks.length ? rowsHeight(blocks[blocks.length - 1], Infinity) : 1); } var scrollbarKit = tableControlView.selectAll('.' + c.cn.scrollbarKit) @@ -188079,7 +188076,7 @@ function renderScrollbarKit(tableControlView, gd, bypassVisibleBar) { scrollbarSlider .attr('transform', function(d) { - return 'translate(0 ' + d.scrollbarState.topY + ')'; + return 'translate(0 ' + (d.scrollbarState.topY || 0) + ')'; }); var scrollbarGlyph = scrollbarSlider.selectAll('.' + c.cn.scrollbarGlyph) @@ -188394,7 +188391,7 @@ function headerBlock(d) {return d.type === 'header';} */ function headerHeight(d) { - var headerBlocks = d.rowBlocks[0].auxiliaryBlocks; + var headerBlocks = d.rowBlocks.length ? d.rowBlocks[0].auxiliaryBlocks : []; return headerBlocks.reduce(function(p, n) {return p + rowsHeight(n, Infinity);}, 0); } @@ -188434,6 +188431,7 @@ function findPagesAndCacheHeights(blocks, scrollY, scrollHeight) { function updateBlockYPosition(gd, cellsColumnBlock, tableControlView) { var d = flatData(cellsColumnBlock)[0]; + if(d === undefined) return; var blocks = d.rowBlocks; var calcdata = d.calcdata; diff --git a/dist/plotly.js b/dist/plotly.js index bbbcb94064c..2dcc92809c4 100644 --- a/dist/plotly.js +++ b/dist/plotly.js @@ -1,5 +1,5 @@ /** -* plotly.js v1.31.1 +* plotly.js v1.31.2 * Copyright 2012-2017, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -49618,7 +49618,7 @@ var ndarray = require('ndarray') var nextPow2 = require('bit-twiddle').nextPow2 -var selectRange = require('cwise/lib/wrapper')({"args":["array",{"offset":[0,0,1],"array":0},{"offset":[0,0,2],"array":0},{"offset":[0,0,3],"array":0},"scalar","scalar","index"],"pre":{"body":"{this_closestD2=1e8,this_closestX=-1,this_closestY=-1}","args":[],"thisVars":["this_closestD2","this_closestX","this_closestY"],"localVars":[]},"body":{"body":"{if(_inline_46_arg0_<255||_inline_46_arg1_<255||_inline_46_arg2_<255||_inline_46_arg3_<255){var _inline_46_l=_inline_46_arg4_-_inline_46_arg6_[0],_inline_46_a=_inline_46_arg5_-_inline_46_arg6_[1],_inline_46_f=_inline_46_l*_inline_46_l+_inline_46_a*_inline_46_a;_inline_46_f i) j--; + pi.edgepaths[j] = edgepathj.concat(pts, edgepathi); } + break; } - }); + } if(!doublemerged) { - pi.edgepaths[edgei] = pts.concat(edgepath); + pi.edgepaths[i] = pts.concat(edgepathi); } } - }); - pi.edgepaths.forEach(function(edgepath, edgei) { - if(!merged && equalPts(edgepath[edgepath.length - 1], pts[0], xtol, ytol)) { - pts.splice(0, 1); - pi.edgepaths[edgei] = edgepath.concat(pts); + } + for(i = 0; i < pi.edgepaths.length; i++) { + if(merged) break; + edgepathi = pi.edgepaths[i]; + if(equalPts(edgepathi[edgepathi.length - 1], pts[0], xtol, ytol)) { + pts.shift(); + pi.edgepaths[i] = edgepathi.concat(pts); merged = true; } - }); + } if(!merged) pi.edgepaths.push(pts); } @@ -179191,7 +179187,7 @@ module.exports = function selectPoints(searchInfo, polygon) { // TODO: include lines? that would require per-segment line properties var hasOnlyLines = (!subtypes.hasMarkers(trace) && !subtypes.hasText(trace)); - if(trace.visible !== true || hasOnlyLines) return []; + if(hasOnlyLines) return []; var opacity = Array.isArray(marker.opacity) ? 1 : marker.opacity; @@ -181244,7 +181240,7 @@ module.exports = function selectPoints(searchInfo, polygon) { var di, lonlat, x, y, i; var hasOnlyLines = (!subtypes.hasMarkers(trace) && !subtypes.hasText(trace)); - if(trace.visible !== true || hasOnlyLines) return []; + if(hasOnlyLines) return []; var marker = trace.marker; var opacity = Array.isArray(marker.opacity) ? 1 : marker.opacity; @@ -182302,7 +182298,7 @@ module.exports = function selectPoints(searchInfo, polygon) { var scene = glTrace.scene; var hasOnlyLines = (!subtypes.hasMarkers(trace) && !subtypes.hasText(trace)); - if(trace.visible !== true || hasOnlyLines) return []; + if(hasOnlyLines) return []; // filter out points by visible scatter ones if(polygon === false) { @@ -183200,7 +183196,7 @@ module.exports = function selectPoints(searchInfo, polygon) { // to not insert data-driven 'circle-opacity' when we don't need to trace._hasDimmedPts = false; - if(trace.visible !== true || !subtypes.hasMarkers(trace)) return []; + if(!subtypes.hasMarkers(trace)) return []; if(polygon === false) { for(i = 0; i < cd.length; i++) { @@ -184828,11 +184824,12 @@ module.exports = function calc(gd, trace) { var headerValues = trace.header.values.map(function(c) { return Array.isArray(c) ? c : [c]; }); + var cellsValues = trace.cells.values; var domain = trace.domain; var groupWidth = Math.floor(gd._fullLayout._size.w * (domain.x[1] - domain.x[0])); var groupHeight = Math.floor(gd._fullLayout._size.h * (domain.y[1] - domain.y[0])); - var headerRowHeights = headerValues[0].map(function() {return trace.header.height;}); - var rowHeights = trace.cells.values[0].map(function() {return trace.cells.height;}); + var headerRowHeights = headerValues.length ? headerValues[0].map(function() {return trace.header.height;}) : []; + var rowHeights = cellsValues.length ? cellsValues[0].map(function() {return trace.cells.height;}) : []; var headerHeight = headerRowHeights.reduce(function(a, b) {return a + b;}, 0); var scrollHeight = groupHeight - headerHeight; var minimumFillHeight = scrollHeight + c.uplift; @@ -185042,9 +185039,9 @@ function rowFromTo(d) { var Lib = require('../../lib'); var attributes = require('./attributes'); -function defaultColumnOrder(traceIn, coerce) { - var specifiedColumnOrder = traceIn.columnorder || []; - var commonLength = traceIn.header.values.length; +function defaultColumnOrder(traceOut, coerce) { + var specifiedColumnOrder = traceOut.columnorder || []; + var commonLength = traceOut.header.values.length; var truncated = specifiedColumnOrder.slice(0, commonLength); var sorted = truncated.slice().sort(function(a, b) {return a - b;}); var oneStepped = truncated.map(function(d) {return sorted.indexOf(d);}); @@ -185059,28 +185056,10 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout return Lib.coerce(traceIn, traceOut, attributes, attr, dflt); } - var fontDflt = { - family: layout.font.family, - size: layout.font.size, - color: layout.font.color - }; - coerce('domain.x'); coerce('domain.y'); coerce('columnwidth'); - defaultColumnOrder(traceIn, coerce); - - coerce('cells.values'); - coerce('cells.format'); - coerce('cells.align'); - coerce('cells.prefix'); - coerce('cells.suffix'); - coerce('cells.height'); - coerce('cells.line.width'); - coerce('cells.line.color'); - coerce('cells.fill.color'); - Lib.coerceFont(coerce, 'cells.font', fontDflt); coerce('header.values'); coerce('header.format'); @@ -185092,7 +185071,20 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout coerce('header.line.width'); coerce('header.line.color'); coerce('header.fill.color'); - Lib.coerceFont(coerce, 'header.font', fontDflt); + Lib.coerceFont(coerce, 'header.font', Lib.extendFlat({}, layout.font)); + + defaultColumnOrder(traceOut, coerce); + + coerce('cells.values'); + coerce('cells.format'); + coerce('cells.align'); + coerce('cells.prefix'); + coerce('cells.suffix'); + coerce('cells.height'); + coerce('cells.line.width'); + coerce('cells.line.color'); + coerce('cells.fill.color'); + Lib.coerceFont(coerce, 'cells.font', Lib.extendFlat({}, layout.font)); }; },{"../../lib":728,"./attributes":1105}],1112:[function(require,module,exports){ @@ -185116,7 +185108,7 @@ Table.plot = require('./plot'); Table.moduleType = 'trace'; Table.name = 'table'; Table.basePlotModule = require('./base_plot'); -Table.categories = []; +Table.categories = ['noOpacity']; Table.meta = { }; @@ -185219,6 +185211,8 @@ module.exports = function plot(gd, wrappedTraceHolders) { .append('g') .classed(c.cn.yColumn, true); + yColumn.exit().remove(); + yColumn .attr('transform', function(d) {return 'translate(' + d.x + ' 0)';}) .call(d3.behavior.drag() @@ -185368,7 +185362,7 @@ function renderScrollbarKit(tableControlView, gd, bypassVisibleBar) { function calcTotalHeight(d) { var blocks = d.rowBlocks; - return firstRowAnchor(blocks, blocks.length - 1) + rowsHeight(blocks[blocks.length - 1], Infinity); + return firstRowAnchor(blocks, blocks.length - 1) + (blocks.length ? rowsHeight(blocks[blocks.length - 1], Infinity) : 1); } var scrollbarKit = tableControlView.selectAll('.' + c.cn.scrollbarKit) @@ -185414,7 +185408,7 @@ function renderScrollbarKit(tableControlView, gd, bypassVisibleBar) { scrollbarSlider .attr('transform', function(d) { - return 'translate(0 ' + d.scrollbarState.topY + ')'; + return 'translate(0 ' + (d.scrollbarState.topY || 0) + ')'; }); var scrollbarGlyph = scrollbarSlider.selectAll('.' + c.cn.scrollbarGlyph) @@ -185729,7 +185723,7 @@ function headerBlock(d) {return d.type === 'header';} */ function headerHeight(d) { - var headerBlocks = d.rowBlocks[0].auxiliaryBlocks; + var headerBlocks = d.rowBlocks.length ? d.rowBlocks[0].auxiliaryBlocks : []; return headerBlocks.reduce(function(p, n) {return p + rowsHeight(n, Infinity);}, 0); } @@ -185769,6 +185763,7 @@ function findPagesAndCacheHeights(blocks, scrollY, scrollHeight) { function updateBlockYPosition(gd, cellsColumnBlock, tableControlView) { var d = flatData(cellsColumnBlock)[0]; + if(d === undefined) return; var blocks = d.rowBlocks; var calcdata = d.calcdata; diff --git a/dist/plotly.min.js b/dist/plotly.min.js index 367a73d04ee..622425ef7f7 100644 --- a/dist/plotly.min.js +++ b/dist/plotly.min.js @@ -1,5 +1,5 @@ /** -* plotly.js v1.31.1 +* plotly.js v1.31.2 * Copyright 2012-2017, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -24,7 +24,7 @@ for(var e=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)e[0][r]=Math.max(t[0][r], t[3]=1/e[3],t},i.normalize=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},i.lerp=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t[3]=s+n*(r[3]-s),t},i.random=function(t,e){return e=e||1,t[0]=n.RANDOM(),t[1]=n.RANDOM(),t[2]=n.RANDOM(),t[3]=n.RANDOM(),i.normalize(t,t),i.scale(t,t,e),t},i.transformMat4=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t},i.transformQuat=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*a-l*i,h=u*i+l*n-o*a,f=u*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=c*u+d*-o+h*-l-f*-s,t[1]=h*u+d*-s+f*-o-c*-l,t[2]=f*u+d*-l+c*-s-h*-o,t[3]=e[3],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=4),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s1.0001)return null;g+=m[c]}return Math.abs(g-1)>.001?null:[h,o(t,m),m]}var l=t("barycentric"),u=t("polytope-closest-point/lib/closest_point_2d.js");e.exports=s},{barycentric:49,"polytope-closest-point/lib/closest_point_2d.js":486}],204:[function(t,e,r){var n="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if(any(lessThan(f_position, clipBounds[0])) || \n any(greaterThan(f_position, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = vec4(pickId, f_id.xyz);\n}";r.meshShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec4 m_position = model * vec4(position, 1.0);\n vec4 t_position = view * m_position;\n gl_Position = projection * t_position;\n f_color = color;\n f_normal = normal;\n f_data = position;\n f_eyeDirection = eyePosition - position;\n f_lightDirection = lightPosition - position;\n f_uv = uv;\n}",fragment:"precision mediump float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution_2_0(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\n\n\nfloat cookTorranceSpecular_1_1(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution_2_0(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\n\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular\n , opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if(any(lessThan(f_data, clipBounds[0])) || \n any(greaterThan(f_data, clipBounds[1]))) {\n discard;\n }\n\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n \n if(!gl_FrontFacing) {\n N = -N;\n }\n\n float specular = cookTorranceSpecular_1_1(L, V, N, roughness, fresnel);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}",attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.wireShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model, view, projection;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_color = color;\n f_data = position;\n f_uv = uv;\n}",fragment:"precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 clipBounds[2];\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n if(any(lessThan(f_data, clipBounds[0])) || \n any(greaterThan(f_data, clipBounds[1]))) {\n discard;\n }\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}",attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.pointShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\nattribute float pointSize;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(0,0,0,0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n }\n gl_PointSize = pointSize;\n f_color = color;\n f_uv = uv;\n}",fragment:"precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec2 pointR = gl_PointCoord.xy - vec2(0.5,0.5);\n if(dot(pointR, pointR) > 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}",attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_id = id;\n f_position = position;\n}",fragment:n,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute float pointSize;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(0,0,0,0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n gl_PointSize = pointSize;\n }\n f_id = id;\n f_position = position;\n}",fragment:n,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n}",fragment:"precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor,1);\n}\n",attributes:[{name:"position",type:"vec3"}]}},{}],205:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,u,c,h,f,d,p,m,g,v,y,b,x,_,w,M,k,A,T){this.gl=t,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=c,this.triangleNormals=f,this.triangleUVs=h,this.triangleIds=u,this.triangleVAO=d,this.triangleCount=0,this.lineWidth=1,this.edgePositions=p,this.edgeColors=g,this.edgeUVs=v,this.edgeIds=m,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=b,this.pointColors=_,this.pointUVs=w,this.pointSizes=M,this.pointIds=x,this.pointVAO=k,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=A,this.contourVAO=T,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this._model=D,this._view=D,this._projection=D,this._resolution=[1,1]}function i(t){for(var e=w({colormap:t,nshades:256,format:"rgba"}),r=new Uint8Array(1024),n=0;n<256;++n){for(var i=e[n],a=0;a<3;++a)r[4*n+a]=i[a];r[4*n+3]=255*i[3]}return _(r,[256,256,4],[4,0,1])}function a(t,e,r){for(var n=new Array(e),i=0;i=1},P.isTransparent=function(){return this.opacity<1},P.pickSlots=1,P.setPickBase=function(t){this.pickId=t},P.highlight=function(t){if(!t||!this.contourEnable)return void(this.contourCount=0);for(var e=M(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=k.mallocFloat32(6*a),s=0,l=0;l0){var f=this.triShader;f.bind(),f.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var f=this.lineShader;f.bind(),f.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()}if(this.pointCount>0){var f=this.pointShader;f.bind(),f.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var f=this.contourShader;f.bind(),f.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind()}},P.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||D,n=t.view||D,i=t.projection||D,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255},l=this.pickShader;if(l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0){var l=this.pointPickShader;l.bind(),l.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}},P.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;for(var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions,i=new Array(r.length),a=0;as[k]&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=g[n],a.uniforms.angle=v[n],u.drawArrays(u.TRIANGLES,s[k],s[A]-s[k]))),y[n]&&M&&(e[1^n]-=T*d*b[n],a.uniforms.dataAxis=r,a.uniforms.screenOffset=e,a.uniforms.color=x[n],a.uniforms.angle=_[n],u.drawArrays(u.TRIANGLES,w,M)),e[1^n]=T*c[2+(1^n)]-1,p[n+2]&&(e[1^n]+=T*d*m[n+2],ks[k]&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=g[n+2],a.uniforms.angle=v[n+2],u.drawArrays(u.TRIANGLES,s[k],s[A]-s[k]))),y[n+2]&&M&&(e[1^n]+=T*d*b[n+2],a.uniforms.dataAxis=r,a.uniforms.screenOffset=e,a.uniforms.color=x[n+2],a.uniforms.angle=_[n+2],u.drawArrays(u.TRIANGLES,w,M))}}(),c.drawTitle=function(){var t=[0,0],e=[0,0];return function(){var r=this.plot,n=this.shader,i=r.gl,a=r.screenBox,o=r.titleCenter,s=r.titleAngle,l=r.titleColor,u=r.pixelRatio;if(this.titleCount){for(var c=0;c<2;++c)e[c]=2*(o[c]*u-a[c])/(a[2+c]-a[c])-1;n.bind(),n.uniforms.dataAxis=t,n.uniforms.screenOffset=e,n.uniforms.angle=s,n.uniforms.color=l,i.drawArrays(i.TRIANGLES,this.titleOffset,this.titleCount)}}}(),c.bind=function(){var t=[0,0],e=[0,0],r=[0,0];return function(){var n=this.plot,i=this.shader,a=n._tickBounds,o=n.dataBox,s=n.screenBox,l=n.viewBox;i.bind();for(var u=0;u<2;++u){var c=a[u],h=a[u+2],f=h-c,d=.5*(o[u+2]+o[u]),p=o[u+2]-o[u],m=l[u],g=l[u+2],v=g-m,y=s[u],b=s[u+2],x=b-y;e[u]=2*f/p*v/x,t[u]=2*(c-d)/p*v/x}r[1]=2*n.pixelRatio/(s[3]-s[1]),r[0]=r[1]*(s[3]-s[1])/(s[2]-s[0]),i.uniforms.dataScale=e,i.uniforms.dataShift=t,i.uniforms.textScale=r,this.vbo.bind(),i.attributes.textCoordinate.pointer()}}(),c.update=function(t){var e,r,n,i,a,o=[],l=t.ticks,u=t.bounds;for(a=0;a<2;++a){var c=[Math.floor(o.length/3)],h=[-1/0],f=l[a];for(e=0;er)for(t=r;te)for(t=e;t=0){for(var k=0|M.type.charAt(M.type.length-1),A=new Array(k),T=0;T=0;)S+=1;w[b]=S}var E=new Array(r.length);a(),d._relink=a,d.types={uniforms:l(r),attributes:l(n)},d.attributes=s(p,d,x,w),Object.defineProperty(d,"uniforms",o(p,d,r,E))},e.exports=a},{"./lib/GLError":213,"./lib/create-attributes":214,"./lib/create-uniforms":215,"./lib/reflect":216,"./lib/runtime-reflect":217,"./lib/shader-cache":218}],213:[function(t,e,r){function n(t,e,r){this.shortMessage=e||"",this.longMessage=r||"",this.rawError=t||"",this.message="gl-shader: "+(e||t||"")+(r?"\n"+r:""),this.stack=(new Error).stack}n.prototype=new Error,n.prototype.name="GLError",n.prototype.constructor=n,e.exports=n},{}],214:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}function i(t,e,r,i,a,o,s){for(var l=["gl","v"],u=[],c=0;c=0){var p=f.charCodeAt(f.length-1)-48;if(p<2||p>4)throw new s("","Invalid data type for attribute "+h+": "+f);i(t,e,d[0],n,p,o,h)}else{if(!(f.indexOf("mat")>=0))throw new s("","Unknown data type for attribute "+h+": "+f);var p=f.charCodeAt(f.length-1)-48;if(p<2||p>4)throw new s("","Invalid data type for attribute "+h+": "+f);a(t,e,d,n,p,o,h)}}}return o}e.exports=o;var s=t("./GLError"),l=n.prototype;l.pointer=function(t,e,r,n){var i=this,a=i._gl,o=i._locations[i._index];a.vertexAttribPointer(o,i._dimension,t||a.FLOAT,!!e,r||0,n||0),a.enableVertexAttribArray(o)},l.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(l,"location",{get:function(){return this._locations[this._index]},set:function(t){return t!==this._locations[this._index]&&(this._locations[this._index]=0|t,this._wrapper.program=null),0|t}})},{"./GLError":213}],215:[function(t,e,r){"use strict";function n(t){return new Function("y","return function(){return y}")(t)}function i(t,e){for(var r=new Array(t),n=0;n4)throw new s("","Invalid uniform dimension type for matrix "+name+": "+r);return"gl.uniformMatrix"+i+"fv(locations["+e+"],false,obj"+t+")"}throw new s("","Unknown uniform data type for "+name+": "+r)}var i=r.charCodeAt(r.length-1)-48;if(i<2||i>4)throw new s("","Invalid data type");switch(r.charAt(0)){case"b":case"i":return"gl.uniform"+i+"iv(locations["+e+"],obj"+t+")";case"v":return"gl.uniform"+i+"fv(locations["+e+"],obj"+t+")";default:throw new s("","Unrecognized data type for vector "+name+": "+r)}}}function c(t,e){if("object"!=typeof e)return[[t,e]];var r=[];for(var n in e){var i=e[n],a=t;parseInt(n)+""===n?a+="["+n+"]":a+="."+n,"object"==typeof i?r.push.apply(r,c(a,i)):r.push([a,i])}return r}function h(e){for(var n=["return function updateProperty(obj){"],i=c("",e),o=0;o4)throw new s("","Invalid data type");return"b"===t.charAt(0)?i(r,!1):i(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r=t.charCodeAt(t.length-1)-48;if(r<2||r>4)throw new s("","Invalid uniform dimension type for matrix "+name+": "+t);return i(r*r,0)}throw new s("","Unknown uniform data type for "+name+": "+t)}}function d(t,e,i){if("object"==typeof i){var o=p(i);Object.defineProperty(t,e,{get:n(o),set:h(i),enumerable:!0,configurable:!1})}else a[i]?Object.defineProperty(t,e,{get:l(i),set:h(i),enumerable:!0,configurable:!1}):t[e]=f(r[i].type)}function p(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r1){l[0]in o||(o[l[0]]=[]),o=o[l[0]];for(var u=1;u1)for(var l=0;l=0){var m=e[p]-n[p]*(e[p+2]-e[p])/(n[p+2]-n[p]);0===p?o.drawLine(m,e[1],m,e[3],d[p],f[p]):o.drawLine(e[0],m,e[2],m,d[p],f[p])}}for(var p=0;p=0;--t)this.objects[t].dispose();this.objects.length=0;for(var t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},f.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},f.removeObject=function(t){for(var e=this.objects,r=0;r0){var r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function o(t){return"boolean"!=typeof t||t}function s(t){function e(){if(!w&&G.autoResize){var t=M.parentNode,e=1,r=1;t&&t!==document.body?(e=t.clientWidth,r=t.clientHeight):(e=window.innerWidth,r=window.innerHeight);var n=0|Math.ceil(e*G.pixelRatio),i=0|Math.ceil(r*G.pixelRatio);if(n!==M.width||i!==M.height){M.width=n,M.height=i;var a=M.style;a.position=a.position||"absolute",a.left="0px",a.top="0px",a.width=e+"px",a.height=r+"px",N=!0}}}function r(){for(var t=O.length,e=j.length,r=0;r0&&0===F[e-1];)F.pop(),j.pop().dispose()}function s(){if(G.contextLost)return!0;A.isContextLost()&&(G.contextLost=!0,G.mouseListener.enabled=!1,G.selection.object=null,G.oncontextloss&&G.oncontextloss())}function b(){if(!s()){A.colorMask(!0,!0,!0,!0),A.depthMask(!0),A.disable(A.BLEND),A.enable(A.DEPTH_TEST);for(var t=O.length,e=j.length,r=0;rS.distance)continue;for(var u=0;u>>1;for(r=0;r=e[0]&&a<=e[2]&&o>=e[1]&&o<=e[3]&&n++}return n}function a(t,e){var r=t.gl,i=s(r),a=s(r),l=o(r,u.pointVertex,u.pointFragment),c=o(r,u.pickVertex,u.pickFragment),h=new n(t,i,a,l,c);return h.update(e),t.addObject(h),h}var o=t("gl-shader"),s=t("gl-buffer"),l=t("typedarray-pool"),u=t("./lib/shader");e.exports=a;var c=n.prototype;c.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},c.update=function(t){function e(e,r){return e in t?t[e]:r}var r;t=t||{},this.sizeMin=e("sizeMin",.5),this.sizeMax=e("sizeMax",20),this.color=e("color",[1,0,0,1]).slice(),this.areaRatio=e("areaRatio",1),this.borderColor=e("borderColor",[0,0,0,1]).slice(),this.blend=e("blend",!1);var n=t.positions.length>>>1,i=t.positions instanceof Float32Array,a=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,o=t.positions,s=i?o:l.mallocFloat32(o.length),u=a?t.idToIndex:l.mallocInt32(n);if(i||s.set(o),!a)for(s.set(o),r=0;r>8&255,e[2]=r>>16&255,e[3]=r>>24&255,this.pickBuffer.bind(),a.attributes.pickId.pointer(o.UNSIGNED_BYTE),a.uniforms.pickOffset=e,this.pickOffset=r);var f=o.getParameter(o.BLEND),d=o.getParameter(o.DITHER);return f&&!this.blend&&o.disable(o.BLEND),d&&o.disable(o.DITHER),o.drawArrays(o.POINTS,0,this.pointCount),f&&!this.blend&&o.enable(o.BLEND),d&&o.enable(o.DITHER),r+this.pointCount}}(),c.draw=c.unifiedDraw,c.drawPick=c.unifiedDraw,c.pick=function(t,e,r){var n=this.pickOffset,i=this.pointCount;if(r=n+i)return null;var a=r-n,o=this.points;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}}},{"./lib/shader":222,"gl-buffer":156,"gl-shader":223,"typedarray-pool":541}],231:[function(t,e,r){function n(t,e,r,n){var i,a,o,s,l,u=e[0],c=e[1],h=e[2],f=e[3],d=r[0],p=r[1],m=r[2],g=r[3];return a=u*d+c*p+h*m+f*g,a<0&&(a=-a,d=-d,p=-p,m=-m,g=-g),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),t[0]=s*u+l*d,t[1]=s*c+l*p,t[2]=s*h+l*m,t[3]=s*f+l*g,t}e.exports=n},{}],232:[function(t,e,r){"use strict";e.exports={vertex:"precision highp float;\n#define GLSLIFY 1\n\n\nvec4 computePosition_1_0(vec2 posHi, vec2 posLo, vec2 scHi, vec2 scLo, vec2 trHi, vec2 trLo) {\n return vec4((posHi + trHi) * scHi\n \t\t\t//FIXME: this thingy does not give noticeable precision gain, need test\n + (posLo + trLo) * scHi\n + (posHi + trHi) * scLo\n + (posLo + trLo) * scLo\n , 0, 1);\n}\n\n\nattribute vec2 positionHi, positionLo;\nattribute float size, border;\nattribute vec2 char, color;\n\n//this is 64-bit form of scale and translate\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo;\nuniform float pixelRatio;\nuniform vec4 viewBox;\nuniform sampler2D palette;\n\nvarying vec4 charColor, borderColor;\nvarying vec2 charId;\nvarying vec2 pointCoord;\nvarying float pointSize;\nvarying float borderWidth;\n\n\nvoid main() {\n charColor = texture2D(palette, vec2(color.x / 255., 0));\n borderColor = texture2D(palette, vec2(color.y / 255., 0));\n\n gl_PointSize = size * pixelRatio;\n pointSize = size * pixelRatio;\n\n charId = char;\n borderWidth = border;\n\n gl_Position = computePosition_1_0(\n positionHi, positionLo,\n scaleHi, scaleLo,\n translateHi, translateLo);\n\n pointCoord = viewBox.xy + (viewBox.zw - viewBox.xy) * (gl_Position.xy * .5 + .5);\n}\n",fragment:"precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D chars;\nuniform vec2 charsShape;\nuniform float charsStep, pixelRatio, charOffset;\n\nvarying vec4 borderColor;\nvarying vec4 charColor;\nvarying vec2 charId;\nvarying vec2 pointCoord;\nvarying float pointSize;\nvarying float borderWidth;\n\nvoid main() {\n\tvec2 pointUV = (pointCoord - gl_FragCoord.xy + pointSize * .5) / pointSize;\n\tpointUV.x = 1. - pointUV.x;\n\tvec2 texCoord = ((charId + pointUV) * charsStep) / charsShape;\n\tfloat dist = texture2D(chars, texCoord).r;\n\n\t//max-distance alpha\n\tif (dist < 1e-2)\n\t\tdiscard;\n\n\tfloat gamma = .0045 * charsStep / pointSize;\n\n //null-border case\n \tif (borderWidth * borderColor.a == 0.) {\n\t\tfloat charAmt = smoothstep(.748 - gamma, .748 + gamma, dist);\n\t\tgl_FragColor = vec4(charColor.rgb, charAmt*charColor.a);\n\t\treturn;\n\t}\n\n\tfloat dif = 5. * pixelRatio * borderWidth / pointSize;\n\tfloat borderLevel = .748 - dif * .5;\n\tfloat charLevel = .748 + dif * .5;\n\n\tfloat borderAmt = smoothstep(borderLevel - gamma, borderLevel + gamma, dist);\n\tfloat charAmt = smoothstep(charLevel - gamma, charLevel + gamma, dist);\n\n\tvec4 color = borderColor;\n\tcolor.a *= borderAmt;\n\n\tgl_FragColor = mix(color, charColor, charAmt);\n}\n",pickVertex:"precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 positionHi, positionLo;\nattribute vec4 id;\nattribute float size;\n\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo;\nuniform vec4 pickOffset;\nuniform float pixelRatio;\n\nvarying vec4 fragColor;\n\n\nvec4 computePosition_1_0(vec2 posHi, vec2 posLo, vec2 scHi, vec2 scLo, vec2 trHi, vec2 trLo) {\n return vec4((posHi + trHi) * scHi\n \t\t\t//FIXME: this thingy does not give noticeable precision gain, need test\n + (posLo + trLo) * scHi\n + (posHi + trHi) * scLo\n + (posLo + trLo) * scLo\n , 0, 1);\n}\n\n\nvoid main() {\n vec4 fragId = id + pickOffset;\n\n fragId.y += floor(fragId.x / 256.0);\n fragId.x -= floor(fragId.x / 256.0) * 256.0;\n\n fragId.z += floor(fragId.y / 256.0);\n fragId.y -= floor(fragId.y / 256.0) * 256.0;\n\n fragId.w += floor(fragId.z / 256.0);\n fragId.z -= floor(fragId.z / 256.0) * 256.0;\n\n fragColor = fragId / 255.0;\n\n gl_PointSize = size * .25 * pixelRatio;\n\n gl_Position = computePosition_1_0(\n positionHi, positionLo,\n scaleHi, scaleLo,\n translateHi, translateLo);\n}\n",pickFragment:"precision lowp float;\n#define GLSLIFY 1\nvarying vec4 fragColor;\nvoid main() {\n gl_FragColor = fragColor;\n}\n"}},{}],233:[function(t,e,r){arguments[4][84][0].apply(r,arguments)},{dup:84}],234:[function(t,e,r){arguments[4][212][0].apply(r,arguments)},{"./lib/GLError":235,"./lib/create-attributes":236,"./lib/create-uniforms":237,"./lib/reflect":238,"./lib/runtime-reflect":239,"./lib/shader-cache":240,dup:212}],235:[function(t,e,r){arguments[4][213][0].apply(r,arguments)},{dup:213}],236:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{"./GLError":235,dup:214}],237:[function(t,e,r){arguments[4][215][0].apply(r,arguments)},{"./GLError":235,"./reflect":238,dup:215}],238:[function(t,e,r){arguments[4][216][0].apply(r,arguments)},{dup:216}],239:[function(t,e,r){arguments[4][217][0].apply(r,arguments)},{dup:217}],240:[function(t,e,r){arguments[4][218][0].apply(r,arguments)},{"./GLError":235,dup:218,"gl-format-compiler-error":165,"weakmap-shim":562}],241:[function(t,e,r){"use strict";function n(t,e,r,n,a){a<=4*f?i(0,a-1,t,e,r,n):h(0,a-1,t,e,r,n)}function i(t,e,r,n,i,a){for(var o=t+1;o<=e;++o){for(var s=r[o],l=n[2*o],u=n[2*o+1],c=i[o],h=a[o],f=o;f>t;){var d=r[f-1],p=n[2*(f-1)];if((d-s||l-p)>=0)break;r[f]=d,n[2*f]=p,n[2*f+1]=n[2*f-1],i[f]=i[f-1],a[f]=a[f-1],f-=1}r[f]=s,n[2*f]=l,n[2*f+1]=u,i[f]=c,a[f]=h}}function a(t,e,r,n,i,a){var o=r[t],s=n[2*t],l=n[2*t+1],u=i[t],c=a[t];r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],i[t]=i[e],a[t]=a[e],r[e]=o,n[2*e]=s,n[2*e+1]=l,i[e]=u,a[e]=c}function o(t,e,r,n,i,a){r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],i[t]=i[e],a[t]=a[e]}function s(t,e,r,n,i,a,o){var s=n[t],l=i[2*t],u=i[2*t+1],c=a[t],h=o[t];n[t]=n[e],i[2*t]=i[2*e],i[2*t+1]=i[2*e+1],a[t]=a[e],o[t]=o[e],n[e]=n[r],i[2*e]=i[2*r],i[2*e+1]=i[2*r+1],a[e]=a[r],o[e]=o[r],n[r]=s,i[2*r]=l,i[2*r+1]=u,a[r]=c,o[r]=h}function l(t,e,r,n,i,a,o,s,l,u,c){s[t]=s[e],l[2*t]=l[2*e],l[2*t+1]=l[2*e+1],u[t]=u[e],c[t]=c[e],s[e]=r,l[2*e]=n,l[2*e+1]=i,u[e]=a,c[e]=o}function u(t,e,r,n,i){return(r[t]-r[e]||n[2*e]-n[2*t]||i[t]-i[e])<0}function c(t,e,r,n,i,a,o,s){return(e-a[t]||o[2*t]-r||i-s[t])<0}function h(t,e,r,n,d,p){var m=(e-t+1)/6|0,g=t+m,v=e-m,y=t+e>>1,b=y-m,x=y+m,_=g,w=b,M=y,k=x,A=v,T=t+1,S=e-1,E=0;u(_,w,r,n,d,p)&&(E=_,_=w,w=E),u(k,A,r,n,d,p)&&(E=k,k=A,A=E),u(_,M,r,n,d,p)&&(E=_,_=M,M=E),u(w,M,r,n,d,p)&&(E=w,w=M,M=E),u(_,k,r,n,d,p)&&(E=_,_=k,k=E),u(M,k,r,n,d,p)&&(E=M,M=k,k=E),u(w,A,r,n,d,p)&&(E=w,w=A,A=E),u(w,M,r,n,d,p)&&(E=w,w=M,M=E),u(k,A,r,n,d,p)&&(E=k,k=A,A=E);var L=r[w],C=n[2*w],I=n[2*w+1],z=d[w],D=p[w],P=r[k],O=n[2*k],R=n[2*k+1],F=d[k],j=p[k],N=_,B=M,U=A,V=g,H=y,q=v,G=r[N],Y=r[B],W=r[U];r[V]=G,r[H]=Y,r[q]=W;for(var X=0;X<2;++X){var Z=n[2*N+X],J=n[2*B+X],K=n[2*U+X];n[2*V+X]=Z,n[2*H+X]=J,n[2*q+X]=K}var Q=d[N],$=d[B],tt=d[U];d[V]=Q,d[H]=$,d[q]=tt;var et=p[N],rt=p[B],nt=p[U];p[V]=et,p[H]=rt,p[q]=nt,o(b,t,r,n,d,p),o(x,e,r,n,d,p);for(var it=T;it<=S;++it)if(c(it,L,C,I,z,r,n,d))it!==T&&a(it,T,r,n,d,p),++T;else if(!c(it,P,O,R,F,r,n,d))for(;;){if(c(S,P,O,R,F,r,n,d)){c(S,L,C,I,z,r,n,d)?(s(it,T,S,r,n,d,p),++T,--S):(a(it,S,r,n,d,p),--S);break}if(--S=Math.max(.9*d,32)){var b=u+s>>>1;l(g,v,h,f,b,c+1),f=b}l(g,v,h,f,y,c+1),f=y}}}var u=t.length>>>1;if(u<1)return[];for(var c=1/0,h=1/0,f=-1/0,d=-1/0,p=0;p=0;--_){t[2*_]=(t[2*_]-c)*v,t[2*_+1]=(t[2*_+1]-h)*y;var A=x[_];A!==M&&(w.push(new i(b*Math.pow(.5,A),_+1,k-(_+1))),k=_+1,M=A)}return w.push(new i(b*Math.pow(.5,A+1),0,k)),o.free(x),w}var o=t("typedarray-pool"),s=t("./lib/sort");e.exports=a},{"./lib/sort":241,"typedarray-pool":541}],243:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s){this.plot=t,this.shader=e,this.pickShader=r,this.positionBuffer=n,this.sizeBuffer=i,this.colorBuffer=a,this.idBuffer=o,this.charBuffer=s,this.pointCount=0,this.pickOffset=0,this.points=null,this.scales=[],this.xCoords=[],this.charCanvas=document.createElement("canvas"),this.charTexture=m(this.plot.gl,this.charCanvas),this.charStep=400,this.charFit=.255,this.snapThreshold=1e4,this.paletteTexture=m(this.plot.gl,[256,1])}function i(){var t=this.plot,e=t.viewBox,r=t.dataBox,n=t.pixelRatio,i=r[2]-r[0],a=r[3]-r[1],u=2/i,c=2/a,h=-r[0]-.5*i,f=-r[1]-.5*a;_[0]=u,w[0]=u-_[0],_[1]=c,w[1]=c-_[1],M[0]=h,k[0]=h-M[0],M[1]=f,k[1]=f-M[1];var d=e[2]-e[0],p=e[3]-e[1];o=Math.min(i/d,a/p),A[0]=2*n/d,A[1]=2*n/p,s=r[0],l=r[2]}function a(t,e){var r=t.gl,i=u(r,f.vertex,f.fragment),a=u(r,f.pickVertex,f.pickFragment),o=c(r),s=c(r),l=c(r),h=c(r),d=c(r),p=new n(t,i,a,o,s,l,h,d);return p.update(e),t.addObject(p),p}e.exports=a;var o,s,l,u=t("gl-shader"),c=t("gl-buffer"),h=t("typedarray-pool"),f=t("./lib/shaders"),d=t("snap-points-2d"),p=t("font-atlas-sdf"),m=t("gl-texture2d"),g=t("color-id"),v=t("ndarray"),y=t("clamp"),b=t("binary-search-bounds"),x=n.prototype,_=new Float32Array([0,0]),w=new Float32Array([0,0]),M=new Float32Array([0,0]),k=new Float32Array([0,0]),A=[0,0],T=[0,0,0,0];x.drawPick=function(t){var e=void 0!==t,r=this.plot,n=this.pointCount,a=n>this.snapThreshold;if(!n)return t;i.call(this);var u=r.gl,c=e?this.pickShader:this.shader,h=u.isEnabled(u.BLEND);if(c.bind(),e){this.pickOffset=t;for(var f=0;f<4;++f)T[f]=t>>8*f&255;c.uniforms.pickOffset=T,this.idBuffer.bind(),c.attributes.id.pointer(u.UNSIGNED_BYTE,!1)}else u.blendFuncSeparate(u.SRC_ALPHA,u.ONE_MINUS_SRC_ALPHA,u.ONE,u.ONE_MINUS_SRC_ALPHA),u.blendColor(0,0,0,1),h||u.enable(u.BLEND),this.colorBuffer.bind(),c.attributes.color.pointer(u.UNSIGNED_BYTE,!1),this.charBuffer.bind(),c.attributes.char.pointer(u.UNSIGNED_BYTE,!1),c.uniforms.chars=this.charTexture.bind(0),c.uniforms.charsShape=[this.charCanvas.width,this.charCanvas.height],c.uniforms.charsStep=this.charStep,c.uniforms.palette=this.paletteTexture.bind(1);this.sizeBuffer.bind(),c.attributes.size.pointer(u.FLOAT,!1,8,0),e||c.attributes.border.pointer(u.FLOAT,!1,8,4),this.positionBuffer.bind(),c.attributes.positionHi.pointer(u.FLOAT,!1,16,0),c.attributes.positionLo.pointer(u.FLOAT,!1,16,8),c.uniforms.pixelRatio=r.pixelRatio,c.uniforms.scaleHi=_,c.uniforms.scaleLo=w,c.uniforms.translateHi=M,c.uniforms.translateLo=k,c.uniforms.viewBox=r.viewBox;var d=this.scales;if(a)for(var p=d.length-1;p>=0;p--){var m=d[p];if(!(m.pixelSize&&m.pixelSize<1.25*o&&p>1)){var g=m.offset,v=m.count+g,y=b.ge(this.xCoords,s,g,v-1),x=b.lt(this.xCoords,l,y,v-1)+1;x>y&&u.drawArrays(u.POINTS,y,x-y)}}else u.drawArrays(u.POINTS,0,n);if(e)return t+n;h?u.blendFunc(u.ONE,u.ONE_MINUS_SRC_ALPHA):u.disable(u.BLEND)},x.draw=x.drawPick,x.pick=function(t,e,r){var n=this.pickOffset,i=this.pointCount;if(r=n+i)return null;var a=r-n,o=this.points;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}},x.update=function(t){t=t||{};var e=t.positions||[],r=t.colors||[],n=t.glyphs||[],i=t.sizes||[],a=t.borderWidths||[],o=t.borderColors||[],s=this.plot.gl,l=this.pointCount,u=l>this.snapThreshold;if(null!=t.positions){this.points=e,l=this.points.length/2,u=l>this.snapThreshold;var c=h.mallocFloat32(2*l),f=h.mallocFloat64(2*l),m=h.mallocUint32(l),b=h.mallocFloat32(4*l);f.set(this.points),u&&(this.i2idx&&h.free(this.i2idx),this.i2idx=h.mallocInt32(l),this.scales=d(f,this.i2idx,c)),this.pointCount=l;for(var x=0;xF&&(F=i[x]);var j=this.charStep;this.charStep=y(Math.ceil(4*F),128,768);var N=Object.keys(O),B=this.charStep,U=Math.floor(B/2),V=s.getParameter(s.MAX_TEXTURE_SIZE),H=V/B*(V/B),q=Math.min(V,B*N.length),G=Math.min(V,B*Math.ceil(B*N.length/V)),Y=Math.floor(q/B);N.length>H&&console.warn("gl-scatter2d-fancy: number of characters is more than maximum texture size. Try reducing it."),this.chars&&this.chars+""==N+""&&this.charStep==j||(this.charCanvas=p({canvas:this.charCanvas,family:"sans-serif",size:U,shape:[q,G],step:[B,B],chars:N,align:!0,fit:this.charFit}),this.chars=N);for(var x=0;x>>1,n=u.mallocInt32(r),i=u.mallocFloat32(r),a=u.mallocFloat64(2*r);if(a.set(this.points),this.snapPoints)this.scales=l(a,n,i,this.bounds);else{this.bounds=f(a,2),h(a,2,this.bounds);for(var o=0;o>8&255,y[2]=t>>16&255,y[3]=t>>24&255,n.uniforms.pickOffset=y,s.bind(),n.attributes.pickId.pointer(h.UNSIGNED_BYTE)):(n.uniforms.useWeight=1,this.weightBuffer.bind(),n.attributes.weight.pointer());var I=!0;if(this.snapPoints)for(var z=i.length-1;z>=0;z--){var D=i[z];if(!(D.pixelSize1)){var P=this.getVisibleRange(D),O=P[0],R=P[1];R>O&&h.drawArrays(h.POINTS,O,R-O),!e&&I&&(I=!1,n.uniforms.useWeight=0)}}else h.drawArrays(h.POINTS,0,this.pointCount);return t+this.pointCount},d.getVisibleRange=function(t){var e=this.plot.dataBox,r=this.bounds,n=this.pixelSize,i=this.size,a=this.plot.pixelRatio,o=r[2]-r[0];r[3],r[1];if(!t)for(var t,l=this.scales.length-1;l>=0&&(t=this.scales[l],t.pixelSize1);l--);var u=this.xCoords,c=(e[0]-r[0]-n*i*a)/o,h=(e[2]-r[0]+n*i*a)/o,f=t.offset,d=t.count+f,p=s.ge(u,c,f,d-1);return[p,s.lt(u,h,p,d-1)+1]},d.drawPick=d.draw,d.pick=function(t,e,r){var n=r-this.pickOffset;return n<0||n>=this.pointCount?null:{object:this,pointId:n,dataCoord:[this.points[2*n],this.points[2*n+1]]}}},{"./lib/shader":244,"array-bounds":44,"array-normalize":45,"binary-search-bounds":245,"gl-buffer":156,"gl-shader":255,"snap-points-2d":247,"typedarray-pool":541}],249:[function(t,e,r){"use strict";function n(t,e){var r=a[e];if(r||(r=a[e]={}),t in r)return r[t];for(var n=i(t,{textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),o=i(t,{triangles:!0,textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),s=[[1/0,1/0],[-1/0,-1/0]],l=0;lMath.abs(R[1])){var F=O;O=R,R=F,F=D,D=P,P=F;var j=I;I=z,z=j}O[0]<0&&(D[I]=-1),R[1]>0&&(P[z]=-1);for(var N=0,B=0,C=0;C<4;++C)N+=Math.pow(p[4*I+C],2),B+=Math.pow(p[4*z+C],2);D[I]/=Math.sqrt(N),P[z]/=Math.sqrt(B),d.axes[0]=D,d.axes[1]=P,d.fragClipBounds[0]=u(E,b[0],_,-1e8),d.fragClipBounds[1]=u(E,b[1],_,1e8),e.vao.draw(f.TRIANGLES,e.vertexCount),e.lineWidth>0&&(f.lineWidth(e.lineWidth),e.vao.draw(f.LINES,e.lineVertexCount,e.vertexCount))}}function f(t,e,r,n,i,a){var o=r.gl;if(r.vao.bind(),i===r.opacity<1||a){t.bind();var s=t.uniforms;s.model=n.model||x,s.view=n.view||x,s.projection=n.projection||x,w[0]=2/o.drawingBufferWidth,w[1]=2/o.drawingBufferHeight,s.screenSize=w,s.highlightId=r.highlightId,s.highlightScale=r.highlightScale,s.fragClipBounds=z,s.clipBounds=r.axes.bounds,s.opacity=r.opacity,s.pickGroup=r.pickId/255,s.pixelRatio=r.pixelRatio,r.vao.draw(o.TRIANGLES,r.vertexCount),r.lineWidth>0&&(o.lineWidth(r.lineWidth),r.vao.draw(o.LINES,r.lineVertexCount,r.vertexCount))}h(e,r,n,i,a),r.vao.unbind()}function d(t){var e=t.gl,r=y.createPerspective(e),n=y.createOrtho(e),i=y.createProject(e),a=y.createPickPerspective(e),s=y.createPickOrtho(e),l=y.createPickProject(e),u=p(e),c=p(e),h=p(e),f=p(e),d=m(e,[{buffer:u,size:3,type:e.FLOAT},{buffer:c,size:4,type:e.FLOAT},{buffer:h,size:2,type:e.FLOAT},{buffer:f,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),g=new o(e,r,n,i,u,c,h,f,d,a,s,l);return g.update(t),g}var p=t("gl-buffer"),m=t("gl-vao"),g=t("typedarray-pool"),v=t("gl-mat4/multiply"),y=t("./lib/shaders"),b=t("./lib/glyphs"),x=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];e.exports=d;var _=o.prototype;_.pickSlots=1,_.setPickBase=function(t){this.pickId=t},_.isTransparent=function(){if(this.opacity<1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]<1)return!0;return!1},_.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]>=1)return!0;return!1};var w=[0,0],M=[0,0,0],k=[0,0,0],A=[0,0,0,1],T=[0,0,0,1],S=x.slice(),E=[0,0,0],L=[[0,0,0],[0,0,0]],C=[-1e8,-1e8,-1e8],I=[1e8,1e8,1e8],z=[C,I];_.draw=function(t){f(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!1,!1)},_.drawTransparent=function(t){f(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!0,!1)},_.drawPick=function(t){f(this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader,this.pickProjectShader,this,t,!1,!0)},_.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[2]+(t.value[1]<<8)+(t.value[0]<<16);if(e>=this.pointCount||e<0)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},_.highlight=function(t){if(t){var e=t.index,r=255&e,n=e>>8&255,i=e>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},_.update=function(t){if(t=t||{},"perspective"in t&&(this.useOrtho=!t.perspective),"orthographic"in t&&(this.useOrtho=!!t.orthographic),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"project"in t)if(Array.isArray(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(Array.isArray(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if("projectOpacity"in t)if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{var r=+t.projectOpacity;this.projectOpacity=[r,r,r]}"opacity"in t&&(this.opacity=t.opacity),this.dirty=!0;var n=t.position;if(n){var i=t.font||"normal",a=t.alignment||[0,0],o=[1/0,1/0,1/0],s=[-1/0,-1/0,-1/0],l=t.glyph,u=t.color,c=t.size,h=t.angle,f=t.lineColor,d=0,p=0,m=0,v=n.length;t:for(var y=0;y0&&(I[0]=-a[0]*(1+A[0][0]));for(var H=M.cells,q=M.positions,_=0;_0){var v=r*c;o.drawBox(h-v,f-v,d+v,f+v,a),o.drawBox(h-v,p-v,d+v,p+v,a),o.drawBox(h-v,f-v,h+v,p+v,a),o.drawBox(d-v,f-v,d+v,p+v,a)}}}},l.update=function(t){t=t||{},this.innerFill=!!t.innerFill,this.outerFill=!!t.outerFill,this.innerColor=(t.innerColor||[0,0,0,.5]).slice(),this.outerColor=(t.outerColor||[0,0,0,.5]).slice(),this.borderColor=(t.borderColor||[0,0,0,1]).slice(),this.borderWidth=t.borderWidth||0,this.selectBox=(t.selectBox||this.selectBox).slice()},l.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{"./lib/shaders":252,"gl-buffer":156,"gl-shader":255}],254:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.coord=[t,e],this.id=r,this.value=n,this.distance=i}function i(t,e,r){this.gl=t,this.fbo=e,this.buffer=r,this._readTimeout=null;var n=this;this._readCallback=function(){n.gl&&(e.bind(),t.readPixels(0,0,e.shape[0],e.shape[1],t.RGBA,t.UNSIGNED_BYTE,n.buffer),n._readTimeout=null)}}function a(t,e){return new i(t,o(t,e),s.mallocUint8(e[0]*e[1]*4))}e.exports=a;var o=t("gl-fbo"),s=t("typedarray-pool"),l=t("ndarray"),u=t("bit-twiddle").nextPow2,c=t("cwise/lib/wrapper")({args:["array",{offset:[0,0,1],array:0},{offset:[0,0,2],array:0},{offset:[0,0,3],array:0},"scalar","scalar","index"],pre:{body:"{this_closestD2=1e8,this_closestX=-1,this_closestY=-1}",args:[],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:[]},body:{body:"{if(_inline_46_arg0_<255||_inline_46_arg1_<255||_inline_46_arg2_<255||_inline_46_arg3_<255){var _inline_46_l=_inline_46_arg4_-_inline_46_arg6_[0],_inline_46_a=_inline_46_arg5_-_inline_46_arg6_[1],_inline_46_f=_inline_46_l*_inline_46_l+_inline_46_a*_inline_46_a;_inline_46_fthis.buffer.length){s.free(this.buffer);for(var n=this.buffer=s.mallocUint8(u(r*e*4)),i=0;i=0){for(var k=0|M.type.charAt(M.type.length-1),A=new Array(k),T=0;T=0;)S+=1;_[w]=S}var E=new Array(r.length);a(),d._relink=a,d.types={uniforms:l(r),attributes:l(n)},d.attributes=s(p,d,b,_),Object.defineProperty(d,"uniforms",o(p,d,r,E))},e.exports=a},{"./lib/GLError":256,"./lib/create-attributes":257,"./lib/create-uniforms":258,"./lib/reflect":259,"./lib/runtime-reflect":260,"./lib/shader-cache":261}],256:[function(t,e,r){arguments[4][213][0].apply(r,arguments)},{dup:213}],257:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{"./GLError":256,dup:214}],258:[function(t,e,r){arguments[4][215][0].apply(r,arguments)},{"./GLError":256,"./reflect":259,dup:215}],259:[function(t,e,r){arguments[4][216][0].apply(r,arguments)},{dup:216}],260:[function(t,e,r){arguments[4][217][0].apply(r,arguments)},{dup:217}],261:[function(t,e,r){arguments[4][218][0].apply(r,arguments)},{"./GLError":256,dup:218,"gl-format-compiler-error":165,"weakmap-shim":562}],262:[function(t,e,r){"use strict";function n(t){this.plot=t,this.enable=[!0,!0,!1,!1],this.width=[1,1,1,1],this.color=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.center=[1/0,1/0]}function i(t,e){var r=new n(t);return r.update(e),t.addOverlay(r),r}e.exports=i;var a=n.prototype;a.update=function(t){t=t||{},this.enable=(t.enable||[!0,!0,!1,!1]).slice(),this.width=(t.width||[1,1,1,1]).slice(),this.color=(t.color||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]).map(function(t){return t.slice()}),this.center=(t.center||[1/0,1/0]).slice(),this.plot.setOverlayDirty()},a.draw=function(){var t=this.enable,e=this.width,r=this.color,n=this.center,i=this.plot,a=i.line,o=i.dataBox,s=i.viewBox;if(a.bind(),o[0]<=n[0]&&n[0]<=o[2]&&o[1]<=n[1]&&n[1]<=o[3]){var l=s[0]+(n[0]-o[0])/(o[2]-o[0])*(s[2]-s[0]),u=s[1]+(n[1]-o[1])/(o[3]-o[1])*(s[3]-s[1]);t[0]&&a.drawLine(l,u,s[0],u,e[0],r[0]),t[1]&&a.drawLine(l,u,l,s[1],e[1],r[1]),t[2]&&a.drawLine(l,u,s[2],u,e[2],r[2]),t[3]&&a.drawLine(l,u,l,s[3],e[3],r[3])}},a.dispose=function(){this.plot.removeOverlay(this)}},{}],263:[function(t,e,r){"use strict";var n=t("gl-shader");e.exports=function(t){return n(t,"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, color;\nattribute float weight;\n\nuniform mat4 model, view, projection;\nuniform vec3 coordinates[3];\nuniform vec4 colors[3];\nuniform vec2 screenShape;\nuniform float lineWidth;\n\nvarying vec4 fragColor;\n\nvoid main() {\n vec3 vertexPosition = mix(coordinates[0],\n mix(coordinates[2], coordinates[1], 0.5 * (position + 1.0)), abs(position));\n\n vec4 clipPos = projection * view * model * vec4(vertexPosition, 1.0);\n vec2 clipOffset = (projection * view * model * vec4(color, 0.0)).xy;\n vec2 delta = weight * clipOffset * screenShape;\n vec2 lineOffset = normalize(vec2(delta.y, -delta.x)) / screenShape;\n\n gl_Position = vec4(clipPos.xy + clipPos.w * 0.5 * lineWidth * lineOffset, clipPos.z, clipPos.w);\n fragColor = color.x * colors[0] + color.y * colors[1] + color.z * colors[2];\n}\n","precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}",null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},{"gl-shader":255}],264:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}function i(t,e){function r(t,e,r,n,a,o){var s=[t,e,r,0,0,0,1];s[n+3]=1,s[n]=a,i.push.apply(i,s),s[6]=-1,i.push.apply(i,s),s[n]=o,i.push.apply(i,s),i.push.apply(i,s),s[6]=1,i.push.apply(i,s),s[n]=a,i.push.apply(i,s)}var i=[];r(0,0,0,0,0,1),r(0,0,0,1,0,1),r(0,0,0,2,0,1),r(1,0,0,1,-1,1),r(1,0,0,2,-1,1),r(0,1,0,0,-1,1),r(0,1,0,2,-1,1),r(0,0,1,0,-1,1),r(0,0,1,1,-1,1);var l=a(t,i),u=o(t,[{type:t.FLOAT,buffer:l,size:3,offset:0,stride:28},{type:t.FLOAT,buffer:l,size:3,offset:12,stride:28},{type:t.FLOAT,buffer:l,size:1,offset:24,stride:28}]),c=s(t);c.attributes.position.location=0,c.attributes.color.location=1,c.attributes.weight.location=2;var h=new n(t,l,u,c);return h.update(e),h}var a=t("gl-buffer"),o=t("gl-vao"),s=t("./shaders/index");e.exports=i;var l=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],u=n.prototype,c=[0,0,0],h=[0,0,0],f=[0,0];u.isTransparent=function(){return!1},u.drawTransparent=function(t){},u.draw=function(t){var e=this.gl,r=this.vao,n=this.shader;r.bind(),n.bind();var i,a=t.model||l,o=t.view||l,s=t.projection||l;this.axes&&(i=this.axes.lastCubeProps.axis);for(var u=c,d=h,p=0;p<3;++p)i&&i[p]<0?(u[p]=this.bounds[0][p],d[p]=this.bounds[1][p]):(u[p]=this.bounds[1][p],d[p]=this.bounds[0][p]);f[0]=e.drawingBufferWidth,f[1]=e.drawingBufferHeight,n.uniforms.model=a,n.uniforms.view=o,n.uniforms.projection=s,n.uniforms.coordinates=[this.position,u,d],n.uniforms.colors=this.colors,n.uniforms.screenShape=f;for(var p=0;p<3;++p)n.uniforms.lineWidth=this.lineWidth[p]*this.pixelRatio,this.enabled[p]&&(r.draw(e.TRIANGLES,6,6*p),this.drawSides[p]&&r.draw(e.TRIANGLES,12,18+12*p));r.unbind()},u.update=function(t){t&&("bounds"in t&&(this.bounds=t.bounds),"position"in t&&(this.position=t.position),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"colors"in t&&(this.colors=t.colors),"enabled"in t&&(this.enabled=t.enabled),"drawSides"in t&&(this.drawSides=t.drawSides))},u.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders/index":263,"gl-buffer":156,"gl-vao":271}],265:[function(t,e,r){var n=t("gl-shader"),i="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 lightPosition, eyePosition;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n worldCoordinate = vec3(uv.zw, f.x);\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n vec4 clipPosition = projection * view * worldPosition;\n gl_Position = clipPosition;\n kill = f.y;\n value = f.z;\n planeCoordinate = uv.xy;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * worldPosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n lightDirection = lightPosition - cameraCoordinate.xyz;\n eyeDirection = eyePosition - cameraCoordinate.xyz;\n surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);\n}\n",a="precision mediump float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution_2_0(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\n\n\nfloat beckmannSpecular_1_1(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution_2_0(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\n\n\nuniform vec3 lowerBound, upperBound;\nuniform float contourTint;\nuniform vec4 contourColor;\nuniform sampler2D colormap;\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform float vertexColor;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n if (kill > 0.0 ||\n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n discard;\n }\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = max(beckmannSpecular_1_1(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color \u2014 in vertex or in fragment\n vec4 surfaceColor = step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) + step(.5, vertexColor) * vColor;\n\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n",o="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n vec4 worldPosition = model * vec4(dataCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z = clipPosition.z + zOffset;\n\n gl_Position = clipPosition;\n value = f;\n kill = -1.0;\n worldCoordinate = dataCoordinate;\n planeCoordinate = uv.zw;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Don't do lighting for contours\n surfaceNormal = vec3(1,0,0);\n eyeDirection = vec3(0,1,0);\n lightDirection = vec3(0,0,1);\n}\n",s="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec2 shape;\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 surfaceNormal;\n\nvec2 splitFloat(float v) {\n float vh = 255.0 * v;\n float upper = floor(vh);\n float lower = fract(vh);\n return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\n}\n\nvoid main() {\n if(kill > 0.0 ||\n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n discard;\n }\n vec2 ux = splitFloat(planeCoordinate.x / shape.x);\n vec2 uy = splitFloat(planeCoordinate.y / shape.y);\n gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\n}\n";r.createShader=function(t){var e=n(t,i,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createPickShader=function(t){var e=n(t,i,s,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createContourShader=function(t){var e=n(t,o,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},r.createPickContourShader=function(t){var e=n(t,o,s,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{"gl-shader":255}],266:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}function i(t){var e=x([y({colormap:t,nshades:R,format:"rgba"}).map(function(t){return[t[0],t[1],t[2],255*t[3]]})]);return b.divseq(e,255),e}function a(t,e,r,i,a,o,s,l,u,c,h,f,d,p){this.gl=t,this.shape=e,this.bounds=r,this.intensityBounds=[],this._shader=i,this._pickShader=a,this._coordinateBuffer=o,this._vao=s,this._colorMap=l,this._contourShader=u,this._contourPickShader=c,this._contourBuffer=h,this._contourVAO=f,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new n([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=d,this._dynamicVAO=p,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[_(v.mallocFloat(1024),[0,0]),_(v.mallocFloat(1024),[0,0]),_(v.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}function o(t,e){var r,n,i,a=e.axes&&e.axes.lastCubeProps.axis||j,o=e.showSurface,s=e.showContour;for(r=0;r<3;++r)for(o=o||e.surfaceProject[r],n=0;n<3;++n)s=s||e.contourProject[r][n];for(r=0;r<3;++r){var l=N.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=e.axesBounds[+(a[r]>0)][r],M(l,t.model,l);var u=N.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)u[i][n]=t.clipBounds[i][n];u[0][r]=-1e8,u[1][r]=1e8}return N.showSurface=o,N.showContour=s,N}function s(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=B;n.model=t.model||D,n.view=t.view||D,n.projection=t.projection||D,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.contourColor=this.contourColor[0],n.inverseModel=k(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],s=0;s<3;++s)a[s]=Math.min(Math.max(this.clipBounds[i][s],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=V,n.vertexColor=this.vertexColor;var l=U;for(M(l,n.view,n.model),M(l,n.projection,l),k(l,l),i=0;i<3;++i)n.eyePosition[i]=l[12+i]/l[15];var u=l[15];for(i=0;i<3;++i)u+=this.lightPosition[i]*l[4*i+3];for(i=0;i<3;++i){var c=l[12+i];for(s=0;s<3;++s)c+=l[4*s+i]*this.lightPosition[s];n.lightPosition[i]=c/u}var h=o(n,this);if(h.showSurface&&e===this.opacity<1){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;i<3;++i)this.surfaceProject[i]&&this.vertexCount&&(this._shader.uniforms.model=h.projections[i],this._shader.uniforms.clipBounds=h.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(h.showContour&&!e){var f=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,f.bind(),f.uniforms=n;var d=this._contourVAO;for(d.bind(),i=0;i<3;++i)for(f.uniforms.permutation=O[i],r.lineWidth(this.contourWidth[i]),s=0;sMath.abs(R[1])){var F=O;O=R,R=F,F=D,D=P,P=F;var j=I;I=z,z=j}O[0]<0&&(D[I]=-1),R[1]>0&&(P[z]=-1);for(var N=0,B=0,C=0;C<4;++C)N+=Math.pow(p[4*I+C],2),B+=Math.pow(p[4*z+C],2);D[I]/=Math.sqrt(N),P[z]/=Math.sqrt(B),d.axes[0]=D,d.axes[1]=P,d.fragClipBounds[0]=u(E,b[0],_,-1e8),d.fragClipBounds[1]=u(E,b[1],_,1e8),e.vao.draw(f.TRIANGLES,e.vertexCount),e.lineWidth>0&&(f.lineWidth(e.lineWidth),e.vao.draw(f.LINES,e.lineVertexCount,e.vertexCount))}}function f(t,e,r,n,i,a){var o=r.gl;if(r.vao.bind(),i===r.opacity<1||a){t.bind();var s=t.uniforms;s.model=n.model||x,s.view=n.view||x,s.projection=n.projection||x,w[0]=2/o.drawingBufferWidth,w[1]=2/o.drawingBufferHeight,s.screenSize=w,s.highlightId=r.highlightId,s.highlightScale=r.highlightScale,s.fragClipBounds=z,s.clipBounds=r.axes.bounds,s.opacity=r.opacity,s.pickGroup=r.pickId/255,s.pixelRatio=r.pixelRatio,r.vao.draw(o.TRIANGLES,r.vertexCount),r.lineWidth>0&&(o.lineWidth(r.lineWidth),r.vao.draw(o.LINES,r.lineVertexCount,r.vertexCount))}h(e,r,n,i,a),r.vao.unbind()}function d(t){var e=t.gl,r=y.createPerspective(e),n=y.createOrtho(e),i=y.createProject(e),a=y.createPickPerspective(e),s=y.createPickOrtho(e),l=y.createPickProject(e),u=p(e),c=p(e),h=p(e),f=p(e),d=m(e,[{buffer:u,size:3,type:e.FLOAT},{buffer:c,size:4,type:e.FLOAT},{buffer:h,size:2,type:e.FLOAT},{buffer:f,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),g=new o(e,r,n,i,u,c,h,f,d,a,s,l);return g.update(t),g}var p=t("gl-buffer"),m=t("gl-vao"),g=t("typedarray-pool"),v=t("gl-mat4/multiply"),y=t("./lib/shaders"),b=t("./lib/glyphs"),x=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];e.exports=d;var _=o.prototype;_.pickSlots=1,_.setPickBase=function(t){this.pickId=t},_.isTransparent=function(){if(this.opacity<1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]<1)return!0;return!1},_.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]>=1)return!0;return!1};var w=[0,0],M=[0,0,0],k=[0,0,0],A=[0,0,0,1],T=[0,0,0,1],S=x.slice(),E=[0,0,0],L=[[0,0,0],[0,0,0]],C=[-1e8,-1e8,-1e8],I=[1e8,1e8,1e8],z=[C,I];_.draw=function(t){f(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!1,!1)},_.drawTransparent=function(t){f(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!0,!1)},_.drawPick=function(t){f(this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader,this.pickProjectShader,this,t,!1,!0)},_.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[2]+(t.value[1]<<8)+(t.value[0]<<16);if(e>=this.pointCount||e<0)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},_.highlight=function(t){if(t){var e=t.index,r=255&e,n=e>>8&255,i=e>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},_.update=function(t){if(t=t||{},"perspective"in t&&(this.useOrtho=!t.perspective),"orthographic"in t&&(this.useOrtho=!!t.orthographic),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"project"in t)if(Array.isArray(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(Array.isArray(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if("projectOpacity"in t)if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{var r=+t.projectOpacity;this.projectOpacity=[r,r,r]}"opacity"in t&&(this.opacity=t.opacity),this.dirty=!0;var n=t.position;if(n){var i=t.font||"normal",a=t.alignment||[0,0],o=[1/0,1/0,1/0],s=[-1/0,-1/0,-1/0],l=t.glyph,u=t.color,c=t.size,h=t.angle,f=t.lineColor,d=0,p=0,m=0,v=n.length;t:for(var y=0;y0&&(I[0]=-a[0]*(1+A[0][0]));for(var H=M.cells,q=M.positions,_=0;_0){var v=r*c;o.drawBox(h-v,f-v,d+v,f+v,a),o.drawBox(h-v,p-v,d+v,p+v,a),o.drawBox(h-v,f-v,h+v,p+v,a),o.drawBox(d-v,f-v,d+v,p+v,a)}}}},l.update=function(t){t=t||{},this.innerFill=!!t.innerFill,this.outerFill=!!t.outerFill,this.innerColor=(t.innerColor||[0,0,0,.5]).slice(),this.outerColor=(t.outerColor||[0,0,0,.5]).slice(),this.borderColor=(t.borderColor||[0,0,0,1]).slice(),this.borderWidth=t.borderWidth||0,this.selectBox=(t.selectBox||this.selectBox).slice()},l.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{"./lib/shaders":252,"gl-buffer":156,"gl-shader":255}],254:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.coord=[t,e],this.id=r,this.value=n,this.distance=i}function i(t,e,r){this.gl=t,this.fbo=e,this.buffer=r,this._readTimeout=null;var n=this;this._readCallback=function(){n.gl&&(e.bind(),t.readPixels(0,0,e.shape[0],e.shape[1],t.RGBA,t.UNSIGNED_BYTE,n.buffer),n._readTimeout=null)}}function a(t,e){return new i(t,o(t,e),s.mallocUint8(e[0]*e[1]*4))}e.exports=a;var o=t("gl-fbo"),s=t("typedarray-pool"),l=t("ndarray"),u=t("bit-twiddle").nextPow2,c=t("cwise/lib/wrapper")({args:["array",{offset:[0,0,1],array:0},{offset:[0,0,2],array:0},{offset:[0,0,3],array:0},"scalar","scalar","index"],pre:{body:"{this_closestD2=1e8,this_closestX=-1,this_closestY=-1}",args:[],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:[]},body:{body:"{if(_inline_49_arg0_<255||_inline_49_arg1_<255||_inline_49_arg2_<255||_inline_49_arg3_<255){var _inline_49_l=_inline_49_arg4_-_inline_49_arg6_[0],_inline_49_a=_inline_49_arg5_-_inline_49_arg6_[1],_inline_49_f=_inline_49_l*_inline_49_l+_inline_49_a*_inline_49_a;_inline_49_fthis.buffer.length){s.free(this.buffer);for(var n=this.buffer=s.mallocUint8(u(r*e*4)),i=0;i=0){for(var k=0|M.type.charAt(M.type.length-1),A=new Array(k),T=0;T=0;)S+=1;_[w]=S}var E=new Array(r.length);a(),d._relink=a,d.types={uniforms:l(r),attributes:l(n)},d.attributes=s(p,d,b,_),Object.defineProperty(d,"uniforms",o(p,d,r,E))},e.exports=a},{"./lib/GLError":256,"./lib/create-attributes":257,"./lib/create-uniforms":258,"./lib/reflect":259,"./lib/runtime-reflect":260,"./lib/shader-cache":261}],256:[function(t,e,r){arguments[4][213][0].apply(r,arguments)},{dup:213}],257:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{"./GLError":256,dup:214}],258:[function(t,e,r){arguments[4][215][0].apply(r,arguments)},{"./GLError":256,"./reflect":259,dup:215}],259:[function(t,e,r){arguments[4][216][0].apply(r,arguments)},{dup:216}],260:[function(t,e,r){arguments[4][217][0].apply(r,arguments)},{dup:217}],261:[function(t,e,r){arguments[4][218][0].apply(r,arguments)},{"./GLError":256,dup:218,"gl-format-compiler-error":165,"weakmap-shim":562}],262:[function(t,e,r){"use strict";function n(t){this.plot=t,this.enable=[!0,!0,!1,!1],this.width=[1,1,1,1],this.color=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.center=[1/0,1/0]}function i(t,e){var r=new n(t);return r.update(e),t.addOverlay(r),r}e.exports=i;var a=n.prototype;a.update=function(t){t=t||{},this.enable=(t.enable||[!0,!0,!1,!1]).slice(),this.width=(t.width||[1,1,1,1]).slice(),this.color=(t.color||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]).map(function(t){return t.slice()}),this.center=(t.center||[1/0,1/0]).slice(),this.plot.setOverlayDirty()},a.draw=function(){var t=this.enable,e=this.width,r=this.color,n=this.center,i=this.plot,a=i.line,o=i.dataBox,s=i.viewBox;if(a.bind(),o[0]<=n[0]&&n[0]<=o[2]&&o[1]<=n[1]&&n[1]<=o[3]){var l=s[0]+(n[0]-o[0])/(o[2]-o[0])*(s[2]-s[0]),u=s[1]+(n[1]-o[1])/(o[3]-o[1])*(s[3]-s[1]);t[0]&&a.drawLine(l,u,s[0],u,e[0],r[0]),t[1]&&a.drawLine(l,u,l,s[1],e[1],r[1]),t[2]&&a.drawLine(l,u,s[2],u,e[2],r[2]),t[3]&&a.drawLine(l,u,l,s[3],e[3],r[3])}},a.dispose=function(){this.plot.removeOverlay(this)}},{}],263:[function(t,e,r){"use strict";var n=t("gl-shader");e.exports=function(t){return n(t,"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, color;\nattribute float weight;\n\nuniform mat4 model, view, projection;\nuniform vec3 coordinates[3];\nuniform vec4 colors[3];\nuniform vec2 screenShape;\nuniform float lineWidth;\n\nvarying vec4 fragColor;\n\nvoid main() {\n vec3 vertexPosition = mix(coordinates[0],\n mix(coordinates[2], coordinates[1], 0.5 * (position + 1.0)), abs(position));\n\n vec4 clipPos = projection * view * model * vec4(vertexPosition, 1.0);\n vec2 clipOffset = (projection * view * model * vec4(color, 0.0)).xy;\n vec2 delta = weight * clipOffset * screenShape;\n vec2 lineOffset = normalize(vec2(delta.y, -delta.x)) / screenShape;\n\n gl_Position = vec4(clipPos.xy + clipPos.w * 0.5 * lineWidth * lineOffset, clipPos.z, clipPos.w);\n fragColor = color.x * colors[0] + color.y * colors[1] + color.z * colors[2];\n}\n","precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}",null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},{"gl-shader":255}],264:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}function i(t,e){function r(t,e,r,n,a,o){var s=[t,e,r,0,0,0,1];s[n+3]=1,s[n]=a,i.push.apply(i,s),s[6]=-1,i.push.apply(i,s),s[n]=o,i.push.apply(i,s),i.push.apply(i,s),s[6]=1,i.push.apply(i,s),s[n]=a,i.push.apply(i,s)}var i=[];r(0,0,0,0,0,1),r(0,0,0,1,0,1),r(0,0,0,2,0,1),r(1,0,0,1,-1,1),r(1,0,0,2,-1,1),r(0,1,0,0,-1,1),r(0,1,0,2,-1,1),r(0,0,1,0,-1,1),r(0,0,1,1,-1,1);var l=a(t,i),u=o(t,[{type:t.FLOAT,buffer:l,size:3,offset:0,stride:28},{type:t.FLOAT,buffer:l,size:3,offset:12,stride:28},{type:t.FLOAT,buffer:l,size:1,offset:24,stride:28}]),c=s(t);c.attributes.position.location=0,c.attributes.color.location=1,c.attributes.weight.location=2;var h=new n(t,l,u,c);return h.update(e),h}var a=t("gl-buffer"),o=t("gl-vao"),s=t("./shaders/index");e.exports=i;var l=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],u=n.prototype,c=[0,0,0],h=[0,0,0],f=[0,0];u.isTransparent=function(){return!1},u.drawTransparent=function(t){},u.draw=function(t){var e=this.gl,r=this.vao,n=this.shader;r.bind(),n.bind();var i,a=t.model||l,o=t.view||l,s=t.projection||l;this.axes&&(i=this.axes.lastCubeProps.axis);for(var u=c,d=h,p=0;p<3;++p)i&&i[p]<0?(u[p]=this.bounds[0][p],d[p]=this.bounds[1][p]):(u[p]=this.bounds[1][p],d[p]=this.bounds[0][p]);f[0]=e.drawingBufferWidth,f[1]=e.drawingBufferHeight,n.uniforms.model=a,n.uniforms.view=o,n.uniforms.projection=s,n.uniforms.coordinates=[this.position,u,d],n.uniforms.colors=this.colors,n.uniforms.screenShape=f;for(var p=0;p<3;++p)n.uniforms.lineWidth=this.lineWidth[p]*this.pixelRatio,this.enabled[p]&&(r.draw(e.TRIANGLES,6,6*p),this.drawSides[p]&&r.draw(e.TRIANGLES,12,18+12*p));r.unbind()},u.update=function(t){t&&("bounds"in t&&(this.bounds=t.bounds),"position"in t&&(this.position=t.position),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"colors"in t&&(this.colors=t.colors),"enabled"in t&&(this.enabled=t.enabled),"drawSides"in t&&(this.drawSides=t.drawSides))},u.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders/index":263,"gl-buffer":156,"gl-vao":271}],265:[function(t,e,r){var n=t("gl-shader"),i="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 lightPosition, eyePosition;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n worldCoordinate = vec3(uv.zw, f.x);\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n vec4 clipPosition = projection * view * worldPosition;\n gl_Position = clipPosition;\n kill = f.y;\n value = f.z;\n planeCoordinate = uv.xy;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * worldPosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n lightDirection = lightPosition - cameraCoordinate.xyz;\n eyeDirection = eyePosition - cameraCoordinate.xyz;\n surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);\n}\n",a="precision mediump float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution_2_0(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\n\n\nfloat beckmannSpecular_1_1(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution_2_0(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\n\n\nuniform vec3 lowerBound, upperBound;\nuniform float contourTint;\nuniform vec4 contourColor;\nuniform sampler2D colormap;\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform float vertexColor;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n if (kill > 0.0 ||\n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n discard;\n }\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = max(beckmannSpecular_1_1(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color \u2014 in vertex or in fragment\n vec4 surfaceColor = step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) + step(.5, vertexColor) * vColor;\n\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n",o="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n vec4 worldPosition = model * vec4(dataCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z = clipPosition.z + zOffset;\n\n gl_Position = clipPosition;\n value = f;\n kill = -1.0;\n worldCoordinate = dataCoordinate;\n planeCoordinate = uv.zw;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Don't do lighting for contours\n surfaceNormal = vec3(1,0,0);\n eyeDirection = vec3(0,1,0);\n lightDirection = vec3(0,0,1);\n}\n",s="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec2 shape;\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 surfaceNormal;\n\nvec2 splitFloat(float v) {\n float vh = 255.0 * v;\n float upper = floor(vh);\n float lower = fract(vh);\n return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\n}\n\nvoid main() {\n if(kill > 0.0 ||\n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n discard;\n }\n vec2 ux = splitFloat(planeCoordinate.x / shape.x);\n vec2 uy = splitFloat(planeCoordinate.y / shape.y);\n gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\n}\n";r.createShader=function(t){var e=n(t,i,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createPickShader=function(t){var e=n(t,i,s,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createContourShader=function(t){var e=n(t,o,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},r.createPickContourShader=function(t){var e=n(t,o,s,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{"gl-shader":255}],266:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}function i(t){var e=x([y({colormap:t,nshades:R,format:"rgba"}).map(function(t){return[t[0],t[1],t[2],255*t[3]]})]);return b.divseq(e,255),e}function a(t,e,r,i,a,o,s,l,u,c,h,f,d,p){this.gl=t,this.shape=e,this.bounds=r,this.intensityBounds=[],this._shader=i,this._pickShader=a,this._coordinateBuffer=o,this._vao=s,this._colorMap=l,this._contourShader=u,this._contourPickShader=c,this._contourBuffer=h,this._contourVAO=f,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new n([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=d,this._dynamicVAO=p,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[_(v.mallocFloat(1024),[0,0]),_(v.mallocFloat(1024),[0,0]),_(v.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}function o(t,e){var r,n,i,a=e.axes&&e.axes.lastCubeProps.axis||j,o=e.showSurface,s=e.showContour;for(r=0;r<3;++r)for(o=o||e.surfaceProject[r],n=0;n<3;++n)s=s||e.contourProject[r][n];for(r=0;r<3;++r){var l=N.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=e.axesBounds[+(a[r]>0)][r],M(l,t.model,l);var u=N.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)u[i][n]=t.clipBounds[i][n];u[0][r]=-1e8,u[1][r]=1e8}return N.showSurface=o,N.showContour=s,N}function s(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=B;n.model=t.model||D,n.view=t.view||D,n.projection=t.projection||D,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.contourColor=this.contourColor[0],n.inverseModel=k(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],s=0;s<3;++s)a[s]=Math.min(Math.max(this.clipBounds[i][s],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=V,n.vertexColor=this.vertexColor;var l=U;for(M(l,n.view,n.model),M(l,n.projection,l),k(l,l),i=0;i<3;++i)n.eyePosition[i]=l[12+i]/l[15];var u=l[15];for(i=0;i<3;++i)u+=this.lightPosition[i]*l[4*i+3];for(i=0;i<3;++i){var c=l[12+i];for(s=0;s<3;++s)c+=l[4*s+i]*this.lightPosition[s];n.lightPosition[i]=c/u}var h=o(n,this);if(h.showSurface&&e===this.opacity<1){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;i<3;++i)this.surfaceProject[i]&&this.vertexCount&&(this._shader.uniforms.model=h.projections[i],this._shader.uniforms.clipBounds=h.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(h.showContour&&!e){var f=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,f.bind(),f.uniforms=n;var d=this._contourVAO;for(d.bind(),i=0;i<3;++i)for(f.uniforms.permutation=O[i],r.lineWidth(this.contourWidth[i]),s=0;s=1)return!0;for(var t=0;t<3;++t)if(this._contourCounts[t].length>0||this._dynamicCounts[t]>0)return!0;return!1},F.pickSlots=1,F.setPickBase=function(t){this.pickId=t};var j=[0,0,0],N={showSurface:!1,showContour:!1,projections:[D.slice(),D.slice(),D.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]},B={model:D,view:D,projection:D,inverseModel:D.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},U=D.slice(),V=[1,0,0,0,1,0,0,0,1];F.draw=function(t){return s.call(this,t,!1)},F.drawTransparent=function(t){return s.call(this,t,!0)};var H={model:D,view:D,projection:D,inverseModel:D,clipBounds:[[0,0,0],[0,0,0]],height:0,shape:[0,0],pickId:0,lowerBound:[0,0,0],upperBound:[0,0,0],zOffset:0,permutation:[1,0,0,0,1,0,0,0,1],lightPosition:[0,0,0],eyePosition:[0,0,0]};F.drawPick=function(t){t=t||{};var e=this.gl;e.disable(e.CULL_FACE);var r=H;r.model=t.model||D,r.view=t.view||D,r.projection=t.projection||D,r.shape=this._field[2].shape,r.pickId=this.pickId/255,r.lowerBound=this.bounds[0],r.upperBound=this.bounds[1],r.permutation=V;for(var n=0;n<2;++n)for(var i=r.clipBounds[n],a=0;a<3;++a)i[a]=Math.min(Math.max(this.clipBounds[n][a],-1e8),1e8);var s=o(r,this);if(s.showSurface){for(this._pickShader.bind(),this._pickShader.uniforms=r,this._vao.bind(),this._vao.draw(e.TRIANGLES,this._vertexCount),n=0;n<3;++n)this.surfaceProject[n]&&(this._pickShader.uniforms.model=s.projections[n],this._pickShader.uniforms.clipBounds=s.clipBounds[n],this._vao.draw(e.TRIANGLES,this._vertexCount));this._vao.unbind()}if(s.showContour){var l=this._contourPickShader;l.bind(),l.uniforms=r;var u=this._contourVAO;for(u.bind(),a=0;a<3;++a)for(e.lineWidth(this.contourWidth[a]),l.uniforms.permutation=O[a],n=0;n>4)/16)/255,i=Math.floor(n),a=n-i,o=e[1]*(t.value[1]+(15&t.value[2])/16)/255,s=Math.floor(o),l=o-s;i+=1,s+=1;var u=r.position;u[0]=u[1]=u[2]=0;for(var c=0;c<2;++c)for(var h=c?a:1-a,f=0;f<2;++f)for(var d=f?l:1-l,p=i+c,m=s+f,g=h*d,v=0;v<3;++v)u[v]+=this._field[v].get(p,m)*g;for(var y=this._pickResult.level,b=0;b<3;++b)if(y[b]=A.le(this.contourLevels[b],u[b]),y[b]<0)this.contourLevels[b].length>0&&(y[b]=0);else if(y[b]Math.abs(_-u[b])&&(y[b]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],v=0;v<3;++v)r.dataCoordinate[v]=this._field[v].get(r.index[0],r.index[1]);return r},F.update=function(t){t=t||{},this.dirty=!0,"contourWidth"in t&&(this.contourWidth=u(t.contourWidth,Number)),"showContour"in t&&(this.showContour=u(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=u(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=h(t.contourColor)),"contourProject"in t&&(this.contourProject=u(t.contourProject,function(t){return u(t,Boolean)})),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=h(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=u(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=u(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0);var e=t.field||t.coords&&t.coords[2]||null,r=!1;if(e||(e=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in t||"coords"in t){var n=(e.shape[0]+2)*(e.shape[1]+2);n>this._field[2].data.length&&(v.freeFloat(this._field[2].data),this._field[2].data=v.mallocFloat(d.nextPow2(n))),this._field[2]=_(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),l(this._field[2],e),this.shape=e.shape.slice();for(var a=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(v.freeFloat(this._field[o].data),this._field[o].data=v.mallocFloat(this._field[2].size)),this._field[o]=_(this._field[o].data,[a[0]+2,a[1]+2]);if(t.coords){var s=t.coords;if(!Array.isArray(s)||3!==s.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var c=s[o];for(y=0;y<2;++y)if(c.shape[y]!==a[y])throw new Error("gl-surface: coords have incorrect shape");l(this._field[o],c)}}else if(t.ticks){var f=t.ticks;if(!Array.isArray(f)||2!==f.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var p=f[o];if((Array.isArray(p)||p.length)&&(p=_(p)),p.shape[0]!==a[o])throw new Error("gl-surface: invalid tick length");var m=_(p.data,a);m.stride[o]=p.stride[0],m.stride[1^o]=0,l(this._field[o],m)}}else{for(o=0;o<2;++o){var g=[0,0];g[o]=1,this._field[o]=_(this._field[o].data,[a[0]+2,a[1]+2],g,0)}this._field[0].set(0,0,0);for(var y=0;y0){for(var xt=0;xt<5;++xt)tt.pop();H-=1}continue t}tt.push(it[0],it[1],st[0],st[1],it[2]),H+=1}}nt.push(H)}this._contourOffsets[et]=rt,this._contourCounts[et]=nt}var _t=v.mallocFloat(tt.length);for(o=0;oi||r<0||r>i)throw new Error("gl-texture2d: Invalid texture size");return t._shape=[e,r],t.bind(),n.texImage2D(n.TEXTURE_2D,0,t.format,e,r,0,t.format,t.type,null),t._mipLevels=[0],t}function o(t,e,r,n,i,a){this.gl=t,this.handle=e,this.format=i,this.type=a,this._shape=[r,n],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(t){return o.wrapS=t}},{get:function(){return o._wrapT},set:function(t){return o.wrapT=t}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(t){return o.width=t}},{get:function(){return o._shape[1]},set:function(t){return o.height=t}}]),this._shapeVector=l}function s(t,e){return 3===t.length?1===e[2]&&e[1]===t[0]*t[2]&&e[0]===t[2]:1===e[0]&&e[1]===t[0]}function l(t,e,r,n,i,a,o,l){var u=l.dtype,c=l.shape.slice();if(c.length<2||c.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var h=0,f=0,d=s(c,l.stride.slice());"float32"===u?h=t.FLOAT:"float64"===u?(h=t.FLOAT,d=!1,u="float32"):"uint8"===u?h=t.UNSIGNED_BYTE:(h=t.UNSIGNED_BYTE,d=!1,u="uint8");if(2===c.length)f=t.LUMINANCE,c=[c[0],c[1],1],l=p(l.data,c,[l.stride[0],l.stride[1],1],l.offset);else{if(3!==c.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===c[2])f=t.ALPHA;else if(2===c[2])f=t.LUMINANCE_ALPHA;else if(3===c[2])f=t.RGB;else{if(4!==c[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");f=t.RGBA}c[2]}if(f!==t.LUMINANCE&&f!==t.ALPHA||i!==t.LUMINANCE&&i!==t.ALPHA||(f=i),f!==i)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var v=l.size,y=o.indexOf(n)<0;if(y&&o.push(n),h===a&&d)0===l.offset&&l.data.length===v?y?t.texImage2D(t.TEXTURE_2D,n,i,c[0],c[1],0,i,a,l.data):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],i,a,l.data):y?t.texImage2D(t.TEXTURE_2D,n,i,c[0],c[1],0,i,a,l.data.subarray(l.offset,l.offset+v)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],i,a,l.data.subarray(l.offset,l.offset+v));else{var b;b=a===t.FLOAT?g.mallocFloat32(v):g.mallocUint8(v);var _=p(b,c,[c[2],c[2]*c[0],1]);h===t.FLOAT&&a===t.UNSIGNED_BYTE?x(_,l):m.assign(_,l),y?t.texImage2D(t.TEXTURE_2D,n,i,c[0],c[1],0,i,a,b.subarray(0,v)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],i,a,b.subarray(0,v)),a===t.FLOAT?g.freeFloat32(b):g.freeUint8(b)}}function u(t){var e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e}function c(t,e,r,n,i){var a=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>a||r<0||r>a)throw new Error("gl-texture2d: Invalid texture shape");if(i===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var s=u(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new o(t,s,e,r,n,i)}function h(t,e,r,n,i,a){var s=u(t);return t.texImage2D(t.TEXTURE_2D,0,i,i,a,e),new o(t,s,r,n,i,a)}function f(t,e){var r=e.dtype,n=e.shape.slice(),i=t.getParameter(t.MAX_TEXTURE_SIZE);if(n[0]<0||n[0]>i||n[1]<0||n[1]>i)throw new Error("gl-texture2d: Invalid texture size");var a=s(n,e.stride.slice()),l=0;"float32"===r?l=t.FLOAT:"float64"===r?(l=t.FLOAT,a=!1,r="float32"):"uint8"===r?l=t.UNSIGNED_BYTE:(l=t.UNSIGNED_BYTE,a=!1,r="uint8");var c=0;if(2===n.length)c=t.LUMINANCE,n=[n[0],n[1],1],e=p(e.data,n,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==n.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===n[2])c=t.ALPHA;else if(2===n[2])c=t.LUMINANCE_ALPHA;else if(3===n[2])c=t.RGB;else{if(4!==n[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");c=t.RGBA}}l!==t.FLOAT||t.getExtension("OES_texture_float")||(l=t.UNSIGNED_BYTE,a=!1);var h,f,d=e.size;if(a)h=0===e.offset&&e.data.length===d?e.data:e.data.subarray(e.offset,e.offset+d);else{var v=[n[2],n[2]*n[0],1];f=g.malloc(d,r);var y=p(f,n,v,0);"float32"!==r&&"float64"!==r||l!==t.UNSIGNED_BYTE?m.assign(y,e):x(y,e),h=f.subarray(0,d)}var b=u(t);return t.texImage2D(t.TEXTURE_2D,0,c,n[0],n[1],0,c,l,h),a||g.free(f),new o(t,b,n[0],n[1],c,l)}function d(t){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(v||n(t),"number"==typeof arguments[1])return c(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return c(t,0|arguments[1][0],0|arguments[1][1],arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if("object"==typeof arguments[1]){var e=arguments[1],r=i(e)?e:e.raw;if(r)return h(t,r,0|e.width,0|e.height,arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return f(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}var p=t("ndarray"),m=t("ndarray-ops"),g=t("typedarray-pool");e.exports=d;var v=null,y=null,b=null,x=function(t,e){m.muls(t,e,255)},_=o.prototype;Object.defineProperties(_,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&v.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),y.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),this._minFilter=t}},magFilter:{get:function(){return this._magFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&v.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),y.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var e=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),e!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),b.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,t),this._wrapS=t}},wrapT:{get:function(){return this._wrapT},set:function(t){if(this.bind(),b.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,t),this._wrapT=t}},wrap:{get:function(){return this._wrapVector},set:function(t){if(Array.isArray(t)||(t=[t,t]),2!==t.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var e=0;e<2;++e)if(b.indexOf(t[e])<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);this._wrapS=t[0],this._wrapT=t[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),t}},shape:{get:function(){return this._shapeVector},set:function(t){if(Array.isArray(t)){if(2!==t.length)throw new Error("gl-texture2d: Invalid texture shape")}else t=[0|t,0|t];return a(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return t|=0,a(this,t,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,a(this,this._shape[0],t),t}}}),_.bind=function(t){var e=this.gl;return void 0!==t&&e.activeTexture(e.TEXTURE0+(0|t)),e.bindTexture(e.TEXTURE_2D,this.handle),void 0!==t?0|t:e.getParameter(e.ACTIVE_TEXTURE)-e.TEXTURE0},_.dispose=function(){this.gl.deleteTexture(this.handle)},_.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var t=Math.min(this._shape[0],this._shape[1]),e=0;t>0;++e,t>>>=1)this._mipLevels.indexOf(e)<0&&this._mipLevels.push(e)},_.setPixels=function(t,e,r,n){var a=this.gl;this.bind(),Array.isArray(e)?(n=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),n=n||0;var o=i(t)?t:t.raw;if(o){this._mipLevels.indexOf(n)<0?(a.texImage2D(a.TEXTURE_2D,0,this.format,this.format,this.type,o),this._mipLevels.push(n)):a.texSubImage2D(a.TEXTURE_2D,n,e,r,this.format,this.type,o)}else{if(!(t.shape&&t.stride&&t.data))throw new Error("gl-texture2d: Unsupported data type");if(t.shape.length<2||e+t.shape[1]>this._shape[1]>>>n||r+t.shape[0]>this._shape[0]>>>n||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");l(a,e,r,n,this.format,this.type,this._mipLevels,t)}}},{ndarray:467,"ndarray-ops":461,"typedarray-pool":541}],268:[function(t,e,r){"use strict";function n(t,e,r){e?e.bind():t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null);var n=0|t.getParameter(t.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var i=0;i0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}e.exports=n},{}],277:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}e.exports=n},{}],278:[function(t,e,r){function n(t,e,r,n){return i[0]=n,i[1]=r,i[2]=e,i[3]=t,a[0]}e.exports=n;var i=new Uint8Array(4),a=new Float32Array(i.buffer)},{}],279:[function(t,e,r){function n(t){for(var e=Array.isArray(t)?t:i(t),r=0;r0)continue;n=t.slice(0,1).join("")}return e(n),G+=n.length,U=U.slice(n.length),U.length}}function I(){return/[^a-fA-F0-9]/.test(O)?(e(U.join("")),B=u,j):(U.push(O),R=O,j+1)}function z(){return"."===O?(U.push(O),B=g,R=O,j+1):/[eE]/.test(O)?(U.push(O),B=g,R=O,j+1):"x"===O&&1===U.length&&"0"===U[0]?(B=w,U.push(O),R=O,j+1):/[^\d]/.test(O)?(e(U.join("")),B=u,j):(U.push(O),R=O,j+1)}function D(){return"f"===O&&(U.push(O),R=O,j+=1),/[eE]/.test(O)?(U.push(O),R=O,j+1):"-"===O&&/[eE]/.test(R)?(U.push(O),R=O,j+1):/[^\d]/.test(O)?(e(U.join("")),B=u,j):(U.push(O),R=O,j+1)}function P(){if(/[^\d\w_]/.test(O)){var t=U.join("");return B=J.indexOf(t)>-1?b:Z.indexOf(t)>-1?y:v,e(U.join("")),B=u,j}return U.push(O),R=O,j+1}var O,R,F,j=0,N=0,B=u,U=[],V=[],H=1,q=0,G=0,Y=!1,W=!1,X="";t=t||{};var Z=o,J=i;return"300 es"===t.version&&(Z=l,J=s),function(t){return V=[],null!==t?r(t.replace?t.replace(/\r\n/g,"\n"):t):n()}}e.exports=n;var i=t("./lib/literals"),a=t("./lib/operators"),o=t("./lib/builtins"),s=t("./lib/literals-300es"),l=t("./lib/builtins-300es"),u=999,c=9999,h=0,f=1,d=2,p=3,m=4,g=5,v=6,y=7,b=8,x=9,_=10,w=11,M=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":282,"./lib/builtins-300es":281,"./lib/literals":284,"./lib/literals-300es":283,"./lib/operators":285}],281:[function(t,e,r){var n=t("./builtins");n=n.slice().filter(function(t){return!/^(gl\_|texture)/.test(t)}),e.exports=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},{"./builtins":282}],282:[function(t,e,r){ e.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},{}],283:[function(t,e,r){var n=t("./literals");e.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},{"./literals":284}],284:[function(t,e,r){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},{}],285:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],286:[function(t,e,r){function n(t,e){var r=i(e),n=[];return n=n.concat(r(t)),n=n.concat(r(null))}var i=t("./index");e.exports=n},{"./index":280}],287:[function(t,e,r){"use strict";function n(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var a=new Int32Array(this.arrayBuffer);t=a[0],e=a[1],r=a[2],this.d=e+2*r;for(var o=0;o=u[f+0]&&n>=u[f+1]?(o[h]=!0,a.push(l[h])):o[h]=!1}}},n.prototype._forEachCell=function(t,e,r,n,i,a,o){for(var s=this._convertToCellCoord(t),l=this._convertToCellCoord(e),u=this._convertToCellCoord(r),c=this._convertToCellCoord(n),h=s;h<=u;h++)for(var f=l;f<=c;f++){var d=this.d*f+h;if(i.call(this,t,e,r,n,d,a,o))return}},n.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},n.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=i+this.cells.length+1+1,r=0,n=0;n>1,c=-7,h=r?i-1:0,f=r?-1:1,d=t[e+h];for(h+=f,a=d&(1<<-c)-1,d>>=-c,c+=s;c>0;a=256*a+t[e+h],h+=f,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+t[e+h],h+=f,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=u}return(d?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),e+=o+h>=1?f/l:f*Math.pow(2,1-h),e*l>=2&&(o++,l/=2),o+h>=c?(s=0,o=c):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<0;t[r+d]=255&o,d+=p,o/=256,u-=8);t[r+d-p]|=128*m}},{}],290:[function(t,e,r){"use strict";function n(t,e,r){this.vertices=t,this.adjacent=e,this.boundary=r,this.lastVisited=-1}function i(t,e,r){this.vertices=t,this.cell=e,this.index=r}function a(t,e){return c(t.vertices,e.vertices)}function o(t){for(var e=["function orient(){var tuple=this.tuple;return test("],r=0;r<=t;++r)r>0&&e.push(","),e.push("tuple[",r,"]");e.push(")}return orient");var n=new Function("test",e.join("")),i=u[t+1];return i||(i=u),n(i)}function s(t,e,r){this.dimension=t,this.vertices=e,this.simplices=r,this.interior=r.filter(function(t){return!t.boundary}),this.tuple=new Array(t+1);for(var n=0;n<=t;++n)this.tuple[n]=this.vertices[n];var i=h[t];i||(i=h[t]=o(t)),this.orient=i}function l(t,e){var r=t.length;if(0===r)throw new Error("Must have at least d+1 points");var i=t[0].length;if(r<=i)throw new Error("Must input at least d+1 points");var a=t.slice(0,i+1),o=u.apply(void 0,a);if(0===o)throw new Error("Input not in general position");for(var l=new Array(i+1),c=0;c<=i;++c)l[c]=c;o<0&&(l[0]=1,l[1]=0);for(var h=new n(l,new Array(i+1),!1),f=h.adjacent,d=new Array(i+2),c=0;c<=i;++c){for(var p=l.slice(),m=0;m<=i;++m)m===c&&(p[m]=-1);var g=p[0];p[0]=p[1],p[1]=g;var v=new n(p,new Array(i+1),!0);f[c]=v,d[c]=v}d[i+1]=h;for(var c=0;c<=i;++c)for(var p=f[c].vertices,y=f[c].adjacent,m=0;m<=i;++m){var b=p[m];if(b<0)y[m]=h;else for(var x=0;x<=i;++x)f[x].vertices.indexOf(b)<0&&(y[m]=f[x])}for(var _=new s(i,a,d),w=!!e,c=i+1;c0;){t=o.pop();for(var s=(t.vertices,t.adjacent),l=0;l<=r;++l){var u=s[l];if(u.boundary&&!(u.lastVisited<=-n)){for(var c=u.vertices,h=0;h<=r;++h){var f=c[h];i[h]=f<0?e:a[f]}var d=this.orient();if(d>0)return u;u.lastVisited=-n,0===d&&o.push(u)}}}return null},f.walk=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,a=this.tuple,o=e?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];t:for(;!s.boundary;){for(var l=s.vertices,u=s.adjacent,c=0;c<=n;++c)a[c]=i[l[c]];s.lastVisited=r;for(var c=0;c<=n;++c){var h=u[c];if(!(h.lastVisited>=r)){var f=a[c];a[c]=t;var d=this.orient();if(a[c]=f,d<0){s=h;continue t}h.boundary?h.lastVisited=-r:h.lastVisited=r}}return}return s},f.addPeaks=function(t,e){var r=this.vertices.length-1,o=this.dimension,s=this.vertices,l=this.tuple,u=this.interior,c=this.simplices,h=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,u.push(e);for(var f=[];h.length>0;){var e=h.pop(),d=e.vertices,p=e.adjacent,m=d.indexOf(r);if(!(m<0))for(var g=0;g<=o;++g)if(g!==m){var v=p[g];if(v.boundary&&!(v.lastVisited>=r)){var y=v.vertices;if(v.lastVisited!==-r){for(var b=0,x=0;x<=o;++x)y[x]<0?(b=x,l[x]=t):l[x]=s[y[x]];var _=this.orient();if(_>0){y[b]=r,v.boundary=!1,u.push(v),h.push(v),v.lastVisited=r;continue}v.lastVisited=-r}var w=v.adjacent,M=d.slice(),k=p.slice(),A=new n(M,k,!0);c.push(A);var T=w.indexOf(e);if(!(T<0)){w[T]=A,k[m]=v,M[g]=-1,k[g]=e,p[g]=A,A.flip();for(var x=0;x<=o;++x){var S=M[x];if(!(S<0||S===r)){for(var E=new Array(o-1),L=0,C=0;C<=o;++C){var I=M[C];I<0||C===x||(E[L++]=I)}f.push(new i(E,A,x))}}}}}}f.sort(a);for(var g=0;g+1=0?o[l++]=s[c]:u=1&c;if(u===(1&t)){var h=o[0];o[0]=o[1],o[1]=h}e.push(o)}}return e}},{"robust-orientation":508,"simplicial-complex":519}],291:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(e?e.count:0)+(r?r.count:0)+n.length}function i(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function a(t,e){var r=p(e);t.mid=r.mid,t.left=r.left,t.right=r.right,t.leftPoints=r.leftPoints,t.rightPoints=r.rightPoints,t.count=r.count}function o(t,e){var r=t.intervals([]);r.push(e),a(t,r)}function s(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?y:(r.splice(n,1),a(t,r),b)}function l(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function c(t,e){for(var r=0;r>1],a=[],o=[],s=[],r=0;r3*(e+1)?o(this,t):this.left.insert(t):this.left=p([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?o(this,t):this.right.insert(t):this.right=p([t]);else{var r=v.ge(this.leftPoints,t,f),n=v.ge(this.rightPoints,t,d);this.leftPoints.splice(r,0,t),this.rightPoints.splice(n,0,t)}},x.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1))return s(this,t);var r=this.left.remove(t);return 2===r?(this.left=null,this.count-=1,b):(r===b&&(this.count-=1),r)}if(t[0]>this.mid){if(!this.right)return y;if(4*(this.left?this.left.count:0)>3*(e-1))return s(this,t);var r=this.right.remove(t);return 2===r?(this.right=null,this.count-=1,b):(r===b&&(this.count-=1),r)}if(1===this.count)return this.leftPoints[0]===t?2:y;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var n=this,a=this.left;a.right;)n=a,a=a.right;if(n===this)a.right=this.right;else{var o=this.left,r=this.right;n.count-=a.count,n.right=a.left,a.left=o,a.right=r}i(this,a),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?i(this,this.left):i(this,this.right);return b}for(var o=v.ge(this.leftPoints,t,f);othis.mid){if(this.right){var r=this.right.queryPoint(t,e);if(r)return r}return u(this.rightPoints,t,e)}return c(this.leftPoints,e)},x.queryInterval=function(t,e,r){if(tthis.mid&&this.right){var n=this.right.queryInterval(t,e,r);if(n)return n}return ethis.mid?u(this.rightPoints,t,r):c(this.leftPoints,r)};var _=m.prototype;_.insert=function(t){this.root?this.root.insert(t):this.root=new n(t[0],null,null,[t],[t])},_.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),e!==y}return!1},_.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},_.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(_,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(_,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":66}],292:[function(t,e,r){"use strict";function n(t,e){e=e||new Array(t.length);for(var r=0;r=r&&s<=i&&l>=n&&l<=a&&c.push(t[p]);else{var m=Math.floor((d+f)/2);s=e[2*m],l=e[2*m+1],s>=r&&s<=i&&l>=n&&l<=a&&c.push(t[m]);var g=(h+1)%2;(0===h?r<=s:n<=l)&&(u.push(d),u.push(m-1),u.push(g)),(0===h?i>=s:a>=l)&&(u.push(m+1),u.push(f),u.push(g))}}return c}e.exports=n},{}],300:[function(t,e,r){"use strict";function n(t,e,r,a,o,s){if(!(o-a<=r)){var l=Math.floor((a+o)/2);i(t,e,l,a,o,s%2),n(t,e,r,a,l-1,s+1),n(t,e,r,l+1,o,s+1)}}function i(t,e,r,n,o,s){for(;o>n;){if(o-n>600){var l=o-n+1,u=r-n+1,c=Math.log(l),h=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*h*(l-h)/l)*(u-l/2<0?-1:1);i(t,e,r,Math.max(n,Math.floor(r-u*h/l+f)),Math.min(o,Math.floor(r+(l-u)*h/l+f)),s)}var d=e[2*r+s],p=n,m=o;for(a(t,e,n,r),e[2*o+s]>d&&a(t,e,n,o);pd;)m--}e[2*n+s]===d?a(t,e,n,m):(m++,a(t,e,m,o)),m<=r&&(n=m+1),r<=m&&(o=m-1)}}function a(t,e,r,n){o(t,r,n),o(e,2*r,2*n),o(e,2*r+1,2*n+1)}function o(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n},{}],301:[function(t,e,r){"use strict";function n(t,e,r,n,a,o){for(var s=[0,t.length-1,0],l=[],u=a*a;s.length;){var c=s.pop(),h=s.pop(),f=s.pop();if(h-f<=o)for(var d=f;d<=h;d++)i(e[2*d],e[2*d+1],r,n)<=u&&l.push(t[d]);else{var p=Math.floor((f+h)/2),m=e[2*p],g=e[2*p+1];i(m,g,r,n)<=u&&l.push(t[p]);var v=(c+1)%2;(0===c?r-a<=m:n-a<=g)&&(s.push(f),s.push(p-1),s.push(v)),(0===c?r+a>=m:n+a>=g)&&(s.push(p+1),s.push(h),s.push(v))}}return l}function i(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}e.exports=n},{}],302:[function(t,e,r){"use strict";function n(t,e){var r;if(h(t)){var l,u=t.stops&&"object"==typeof t.stops[0][0],c=u||void 0!==t.property,f=u||!c,d=t.type||e||"exponential";if("exponential"===d)l=o;else if("interval"===d)l=a;else if("categorical"===d)l=i;else{if("identity"!==d)throw new Error('Unknown function type "'+d+'"');l=s}if(u){for(var p={},m=[],g=0;g=t.stops.length)break;if(e<=t.stops[n][0])break;n++}return 0===n?t.stops[n][1]:n===t.stops.length?t.stops[n-1][1]:l(e,r,t.stops[n-1][0],t.stops[n][0],t.stops[n-1][1],t.stops[n][1])}function s(t,e){return e}function l(t,e,r,n,i,a){return"function"==typeof i?function(){var o=i.apply(void 0,arguments),s=a.apply(void 0,arguments);return l(t,e,r,n,o,s)}:i.length?c(t,e,r,n,i,a):u(t,e,r,n,i,a)}function u(t,e,r,n,i,a){var o,s=n-r,l=t-r;return o=1===e?l/s:(Math.pow(e,l)-1)/(Math.pow(e,s)-1),i*(1-o)+a*o}function c(t,e,r,n,i,a){for(var o=[],s=0;s -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},linepattern:{ fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_blur;\n\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_fade;\nuniform float u_opacity;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\nvoid main() {\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_linewidth.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_linewidth.t) or when fading out\n // (v_linewidth.s)\n float blur = u_blur * v_gamma_scale;\n float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\n\n float x_a = mod(v_linesofar / u_pattern_size_a.x, 1.0);\n float x_b = mod(v_linesofar / u_pattern_size_b.x, 1.0);\n float y_a = 0.5 + (v_normal.y * v_linewidth.s / u_pattern_size_a.y);\n float y_b = 0.5 + (v_normal.y * v_linewidth.s / u_pattern_size_b.y);\n vec2 pos_a = mix(u_pattern_tl_a, u_pattern_br_a, vec2(x_a, y_a));\n vec2 pos_b = mix(u_pattern_tl_b, u_pattern_br_b, vec2(x_b, y_b));\n\n vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade);\n\n alpha *= u_opacity;\n\n gl_FragColor = color * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_linewidth;\nuniform mediump float u_gapwidth;\nuniform mediump float u_antialiasing;\nuniform mediump float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n v_linesofar = a_linesofar;\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},linesdfpattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\n\nuniform float u_blur;\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\nvoid main() {\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_linewidth.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_linewidth.t) or when fading out\n // (v_linewidth.s)\n float blur = u_blur * v_gamma_scale;\n float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\n\n float sdfdist_a = texture2D(u_image, v_tex_a).a;\n float sdfdist_b = texture2D(u_image, v_tex_b).a;\n float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix);\n alpha *= smoothstep(0.5 - u_sdfgamma, 0.5 + u_sdfgamma, sdfdist);\n\n gl_FragColor = u_color * (alpha * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_linewidth;\nuniform mediump float u_gapwidth;\nuniform mediump float u_antialiasing;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n\n v_tex_a = vec2(a_linesofar * u_patternscale_a.x, normal.y * u_patternscale_a.y + u_tex_y_a);\n v_tex_b = vec2(a_linesofar * u_patternscale_b.x, normal.y * u_patternscale_b.y + u_tex_y_b);\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},outline:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n#pragma mapbox: define lowp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_pos;\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = smoothstep(1.0, 0.0, dist);\n gl_FragColor = outline_color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},outlinepattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\nvoid main() {\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n // find distance to outline for alpha interpolation\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = smoothstep(1.0, 0.0, dist);\n \n\n gl_FragColor = mix(color1, color2, u_mix) * alpha * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n vec2 scaled_size_a = u_scale_a * u_pattern_size_a;\n vec2 scaled_size_b = u_scale_b * u_pattern_size_b;\n\n // the correct offset needs to be calculated.\n //\n // The offset depends on how many pixels are between the world origin and\n // the edge of the tile:\n // vec2 offset = mod(pixel_coord, size)\n //\n // At high zoom levels there are a ton of pixels between the world origin\n // and the edge of the tile. The glsl spec only guarantees 16 bits of\n // precision for highp floats. We need more than that.\n //\n // The pixel_coord is passed in as two 16 bit values:\n // pixel_coord_upper = floor(pixel_coord / 2^16)\n // pixel_coord_lower = mod(pixel_coord, 2^16)\n //\n // The offset is calculated in a series of steps that should preserve this precision:\n vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a);\n vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b);\n\n v_pos_a = (u_tile_units_to_pixels * a_pos + offset_a) / scaled_size_a;\n v_pos_b = (u_tile_units_to_pixels * a_pos + offset_b) / scaled_size_b;\n\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},pattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n gl_FragColor = mix(color1, color2, u_mix) * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n vec2 scaled_size_a = u_scale_a * u_pattern_size_a;\n vec2 scaled_size_b = u_scale_b * u_pattern_size_b;\n\n // the correct offset needs to be calculated.\n //\n // The offset depends on how many pixels are between the world origin and\n // the edge of the tile:\n // vec2 offset = mod(pixel_coord, size)\n //\n // At high zoom levels there are a ton of pixels between the world origin\n // and the edge of the tile. The glsl spec only guarantees 16 bits of\n // precision for highp floats. We need more than that.\n //\n // The pixel_coord is passed in as two 16 bit values:\n // pixel_coord_upper = floor(pixel_coord / 2^16)\n // pixel_coord_lower = mod(pixel_coord, 2^16)\n //\n // The offset is calculated in a series of steps that should preserve this precision:\n vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a);\n vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b);\n\n v_pos_a = (u_tile_units_to_pixels * a_pos + offset_a) / scaled_size_a;\n v_pos_b = (u_tile_units_to_pixels * a_pos + offset_b) / scaled_size_b;\n}\n"},raster:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity0;\nuniform float u_opacity1;\nuniform sampler2D u_image0;\nuniform sampler2D u_image1;\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nuniform float u_brightness_low;\nuniform float u_brightness_high;\n\nuniform float u_saturation_factor;\nuniform float u_contrast_factor;\nuniform vec3 u_spin_weights;\n\nvoid main() {\n\n // read and cross-fade colors from the main and parent tiles\n vec4 color0 = texture2D(u_image0, v_pos0);\n vec4 color1 = texture2D(u_image1, v_pos1);\n vec4 color = color0 * u_opacity0 + color1 * u_opacity1;\n vec3 rgb = color.rgb;\n\n // spin\n rgb = vec3(\n dot(rgb, u_spin_weights.xyz),\n dot(rgb, u_spin_weights.zxy),\n dot(rgb, u_spin_weights.yzx));\n\n // saturation\n float average = (color.r + color.g + color.b) / 3.0;\n rgb += (average - rgb) * u_saturation_factor;\n\n // contrast\n rgb = (rgb - 0.5) * u_contrast_factor + 0.5;\n\n // brightness\n vec3 u_high_vec = vec3(u_brightness_low, u_brightness_low, u_brightness_low);\n vec3 u_low_vec = vec3(u_brightness_high, u_brightness_high, u_brightness_high);\n\n gl_FragColor = vec4(mix(u_high_vec, u_low_vec, rgb), color.a);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform mat4 u_matrix;\nuniform vec2 u_tl_parent;\nuniform float u_scale_parent;\nuniform float u_buffer_scale;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos0 = (((a_texture_pos / 32767.0) - 0.5) / u_buffer_scale ) + 0.5;\n v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent;\n}\n"},icon:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform lowp float u_opacity;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n lowp float alpha = texture2D(u_fadetexture, v_fade_tex).a * u_opacity;\n gl_FragColor = texture2D(u_texture, v_tex) * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_texture_pos;\nattribute vec4 a_data;\n\n\n// matrix is for the vertex position.\nuniform mat4 u_matrix;\n\nuniform mediump float u_zoom;\nuniform bool u_rotate_with_map;\nuniform vec2 u_extrude_scale;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n vec2 a_tex = a_texture_pos.xy;\n mediump float a_labelminzoom = a_data[0];\n mediump vec2 a_zoom = a_data.pq;\n mediump float a_minzoom = a_zoom[0];\n mediump float a_maxzoom = a_zoom[1];\n\n // u_zoom is the current zoom level adjusted for the change in font size\n mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\n\n vec2 extrude = u_extrude_scale * (a_offset / 64.0);\n if (u_rotate_with_map) {\n gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\n gl_Position.z += z * gl_Position.w;\n } else {\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n }\n\n v_tex = a_tex / u_texsize;\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"},sdf:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\nuniform lowp float u_buffer;\nuniform lowp float u_gamma;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\nvarying float v_gamma_scale;\n\nvoid main() {\n lowp float dist = texture2D(u_texture, v_tex).a;\n lowp float fade_alpha = texture2D(u_fadetexture, v_fade_tex).a;\n lowp float gamma = u_gamma * v_gamma_scale;\n lowp float alpha = smoothstep(u_buffer - gamma, u_buffer + gamma, dist) * fade_alpha;\n\n gl_FragColor = u_color * (alpha * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nconst float PI = 3.141592653589793;\n\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_texture_pos;\nattribute vec4 a_data;\n\n\n// matrix is for the vertex position.\nuniform mat4 u_matrix;\n\nuniform mediump float u_zoom;\nuniform bool u_rotate_with_map;\nuniform bool u_pitch_with_map;\nuniform mediump float u_pitch;\nuniform mediump float u_bearing;\nuniform mediump float u_aspect_ratio;\nuniform vec2 u_extrude_scale;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_tex = a_texture_pos.xy;\n mediump float a_labelminzoom = a_data[0];\n mediump vec2 a_zoom = a_data.pq;\n mediump float a_minzoom = a_zoom[0];\n mediump float a_maxzoom = a_zoom[1];\n\n // u_zoom is the current zoom level adjusted for the change in font size\n mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\n\n // pitch-alignment: map\n // rotation-alignment: map | viewport\n if (u_pitch_with_map) {\n lowp float angle = u_rotate_with_map ? (a_data[1] / 256.0 * 2.0 * PI) : u_bearing;\n lowp float asin = sin(angle);\n lowp float acos = cos(angle);\n mat2 RotationMatrix = mat2(acos, asin, -1.0 * asin, acos);\n vec2 offset = RotationMatrix * a_offset;\n vec2 extrude = u_extrude_scale * (offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\n gl_Position.z += z * gl_Position.w;\n // pitch-alignment: viewport\n // rotation-alignment: map\n } else if (u_rotate_with_map) {\n // foreshortening factor to apply on pitched maps\n // as a label goes from horizontal <=> vertical in angle\n // it goes from 0% foreshortening to up to around 70% foreshortening\n lowp float pitchfactor = 1.0 - cos(u_pitch * sin(u_pitch * 0.75));\n\n lowp float lineangle = a_data[1] / 256.0 * 2.0 * PI;\n\n // use the lineangle to position points a,b along the line\n // project the points and calculate the label angle in projected space\n // this calculation allows labels to be rendered unskewed on pitched maps\n vec4 a = u_matrix * vec4(a_pos, 0, 1);\n vec4 b = u_matrix * vec4(a_pos + vec2(cos(lineangle),sin(lineangle)), 0, 1);\n lowp float angle = atan((b[1]/b[3] - a[1]/a[3])/u_aspect_ratio, b[0]/b[3] - a[0]/a[3]);\n lowp float asin = sin(angle);\n lowp float acos = cos(angle);\n mat2 RotationMatrix = mat2(acos, -1.0 * asin, asin, acos);\n\n vec2 offset = RotationMatrix * (vec2((1.0-pitchfactor)+(pitchfactor*cos(angle*2.0)), 1.0) * a_offset);\n vec2 extrude = u_extrude_scale * (offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n gl_Position.z += z * gl_Position.w;\n // pitch-alignment: viewport\n // rotation-alignment: viewport\n } else {\n vec2 extrude = u_extrude_scale * (a_offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n }\n\n v_gamma_scale = (gl_Position.w - 0.5);\n\n v_tex = a_tex / u_texsize;\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"},collisionbox:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_zoom;\nuniform float u_maxzoom;\n\nvarying float v_max_zoom;\nvarying float v_placement_zoom;\n\nvoid main() {\n\n float alpha = 0.5;\n\n gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0) * alpha;\n\n if (v_placement_zoom > u_zoom) {\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\n }\n\n if (u_zoom >= v_max_zoom) {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0) * alpha * 0.25;\n }\n\n if (v_placement_zoom >= u_maxzoom) {\n gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0) * alpha * 0.2;\n }\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_data;\n\nuniform mat4 u_matrix;\nuniform float u_scale;\n\nvarying float v_max_zoom;\nvarying float v_placement_zoom;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos + a_extrude / u_scale, 0.0, 1.0);\n\n v_max_zoom = a_data.x;\n v_placement_zoom = a_data.y;\n}\n"}},e.exports.util="float evaluate_zoom_function_1(const vec4 values, const float t) {\n if (t < 1.0) {\n return mix(values[0], values[1], t);\n } else if (t < 2.0) {\n return mix(values[1], values[2], t - 1.0);\n } else {\n return mix(values[2], values[3], t - 2.0);\n }\n}\nvec4 evaluate_zoom_function_4(const vec4 value0, const vec4 value1, const vec4 value2, const vec4 value3, const float t) {\n if (t < 1.0) {\n return mix(value0, value1, t);\n } else if (t < 2.0) {\n return mix(value1, value2, t - 1.0);\n } else {\n return mix(value2, value3, t - 2.0);\n }\n}\n"},{path:476}],304:[function(t,e,r){"use strict";function n(t,e){this.message=(t?t+": ":"")+i.apply(i,Array.prototype.slice.call(arguments,2)),null!==e&&void 0!==e&&e.__line__&&(this.line=e.__line__)}var i=t("util").format;e.exports=n},{util:549}],305:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1;e7)return[new n(c,l,"constants have been deprecated as of v8")];if(!(l in f.constants))return[new n(c,l,'constant "%s" not found',l)];e=a({},e,{value:f.constants[l]})}return u.function&&"object"===i(l)?r(e):u.type&&s[u.type]?s[u.type](e):o(a({},e,{valueSpec:u.type?h[u.type]:u}))}},{"../error/validation_error":304,"../util/extend":305,"../util/get_type":306,"./validate_array":309,"./validate_boolean":310,"./validate_color":311,"./validate_constants":312,"./validate_enum":313,"./validate_filter":314,"./validate_function":315,"./validate_layer":317,"./validate_number":319,"./validate_object":320,"./validate_source":322,"./validate_string":323}],309:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("./validate"),a=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.valueSpec,o=t.style,s=t.styleSpec,l=t.key,u=t.arrayElementValidator||i;if("array"!==n(e))return[new a(l,e,"array expected, %s found",n(e))];if(r.length&&e.length!==r.length)return[new a(l,e,"array length %d expected, length %d found",r.length,e.length)];if(r["min-length"]&&e.length7)return r?[new n(e,r,"constants have been deprecated as of v8")]:[];var a=i(r);if("object"!==a)return[new n(e,r,"object expected, %s found",a)];var o=[];for(var s in r)"@"!==s[0]&&o.push(new n(e+"."+s,r[s],'constants must start with "@"'));return o}},{"../error/validation_error":304,"../util/get_type":306}],313:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint");e.exports=function(t){var e=t.key,r=t.value,a=t.valueSpec,o=[];return-1===a.values.indexOf(i(r))&&o.push(new n(e,r,"expected one of [%s], %s found",a.values.join(", "),r)),o}},{"../error/validation_error":304,"../util/unbundle_jsonlint":307}],314:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_enum"),a=t("../util/get_type"),o=t("../util/unbundle_jsonlint");e.exports=function t(e){var r,s=e.value,l=e.key,u=e.styleSpec,c=[];if("array"!==a(s))return[new n(l,s,"array expected, %s found",a(s))];if(s.length<1)return[new n(l,s,"filter array must have at least 1 element")];switch(c=c.concat(i({key:l+"[0]",value:s[0],valueSpec:u.filter_operator,style:e.style,styleSpec:e.styleSpec})),o(s[0])){case"<":case"<=":case">":case">=":s.length>=2&&"$type"==s[1]&&c.push(new n(l,s,'"$type" cannot be use with operator "%s"',s[0]));case"==":case"!=":3!=s.length&&c.push(new n(l,s,'filter array for operator "%s" must have 3 elements',s[0]));case"in":case"!in":s.length>=2&&(r=a(s[1]),"string"!==r?c.push(new n(l+"[1]",s[1],"string expected, %s found",r)):"@"===s[1][0]&&c.push(new n(l+"[1]",s[1],"filter key cannot be a constant")));for(var h=2;h1?2:1,this.canvas&&(this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio)),this.sprite=t},n.prototype.addIcons=function(t,e){for(var r=0;r1||(w?(clearTimeout(w),w=null,v("dblclick",e)):w=setTimeout(d,300))}function c(t){y("touchmove",t)}function h(t){y("touchend",t)}function f(t){y("touchcancel",t)}function d(){w=null}function p(t){n.mousePos(b,t).equals(_)&&v("click",t)}function m(t){v("dblclick",t),t.preventDefault()}function g(t){x=t,t.preventDefault()}function v(e,r){var i=n.mousePos(b,r);return t.fire(e,{lngLat:t.unproject(i),point:i,originalEvent:r})}function y(e,r){var a=n.touchPos(b,r),o=a.reduce(function(t,e,r,n){return t.add(e.div(n.length))},new i(0,0));return t.fire(e,{lngLat:t.unproject(o),point:o,lngLats:a.map(function(e){return t.unproject(e)},this),points:a,originalEvent:r})}var b=t.getCanvasContainer(),x=null,_=null,w=null;for(var M in a)t[M]=new a[M](t,e),e.interactive&&e[M]&&t[M].enable();b.addEventListener("mouseout",r,!1),b.addEventListener("mousedown",o,!1),b.addEventListener("mouseup",s,!1),b.addEventListener("mousemove",l,!1),b.addEventListener("touchstart",u,!1),b.addEventListener("touchend",h,!1),b.addEventListener("touchmove",c,!1),b.addEventListener("touchcancel",f,!1),b.addEventListener("click",p,!1),b.addEventListener("dblclick",m,!1),b.addEventListener("contextmenu",g,!1)}},{"../util/dom":428,"./handler/box_zoom":413,"./handler/dblclick_zoom":414,"./handler/drag_pan":415,"./handler/drag_rotate":416,"./handler/keyboard":417,"./handler/scroll_zoom":418,"./handler/touch_zoom_rotate":419,"point-geometry":484}],408:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../util/interpolate"),a=t("../util/browser"),o=t("../geo/lng_lat"),s=t("../geo/lng_lat_bounds"),l=t("point-geometry"),u=e.exports=function(){};n.extend(u.prototype,{getCenter:function(){return this.transform.center},setCenter:function(t,e){return this.jumpTo({center:t},e),this},panBy:function(t,e,r){return this.panTo(this.transform.center,n.extend({offset:l.convert(t).mult(-1)},e),r),this},panTo:function(t,e,r){return this.easeTo(n.extend({center:t},e),r)},getZoom:function(){return this.transform.zoom},setZoom:function(t,e){return this.jumpTo({zoom:t},e),this},zoomTo:function(t,e,r){return this.easeTo(n.extend({zoom:t},e),r)},zoomIn:function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},zoomOut:function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},getBearing:function(){return this.transform.bearing},setBearing:function(t,e){return this.jumpTo({bearing:t},e),this},rotateTo:function(t,e,r){return this.easeTo(n.extend({bearing:t},e),r)},resetNorth:function(t,e){return this.rotateTo(0,n.extend({duration:1e3},t),e),this},snapToNorth:function(t,e){return Math.abs(this.getBearing())180&&(c.center.lng>0&&m.lng<0?m.lng+=360:c.center.lng<0&&m.lng>0&&(m.lng-=360));var b=c.zoomScale(g-f),x=c.point,_="center"in t?c.project(m).sub(h.div(b)):x,w=c.worldSize,M=t.curve,k=Math.max(c.width,c.height),A=k/b,T=_.sub(x).mag();if("minZoom"in t){var S=n.clamp(Math.min(t.minZoom,f,g),c.minZoom,c.maxZoom),E=k/c.zoomScale(S-f);M=Math.sqrt(E/T*2)}var L=M*M,C=r(0),I=function(t){return s(C)/s(C+M*t)},z=function(t){return k*((s(C)*u(C+M*t)-a(C))/L)/T},D=(r(1)-C)/M;if(Math.abs(T)<1e-6){if(Math.abs(k-A)<1e-6)return this.easeTo(t);var P=A=0)return!1;return!0}),e.join(" | ")},n.prototype=o.inherit(i,{options:{position:"bottom-right"},onAdd:function(t){var e=this._container=a.create("div","mapboxgl-ctrl-attrib",t.getContainer());return this._update(),t.on("source.load",this._update.bind(this)),t.on("source.change",this._update.bind(this)),t.on("source.remove",this._update.bind(this)),t.on("moveend",this._updateEditLink.bind(this)),e},_update:function(){this._map.style&&(this._container.innerHTML=n.createAttributionString(this._map.style.sources)),this._editLink=this._container.getElementsByClassName("mapbox-improve-map")[0],this._updateEditLink()},_updateEditLink:function(){if(this._editLink){var t=this._map.getCenter();this._editLink.href="https://www.mapbox.com/map-feedback/#/"+t.lng+"/"+t.lat+"/"+Math.round(this._map.getZoom()+1)}}})},{"../../util/dom":428,"../../util/util":442,"./control":410}],410:[function(t,e,r){"use strict";function n(){}var i=t("../../util/util"),a=t("../../util/evented");e.exports=n,n.prototype={addTo:function(t){this._map=t;var e=this._container=this.onAdd(t);if(this.options&&this.options.position){var r=this.options.position,n=t._controlCorners[r];e.className+=" mapboxgl-ctrl",-1!==r.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e)}return this},remove:function(){return this._container.parentNode.removeChild(this._container),this.onRemove&&this.onRemove(this._map),this._map=null,this}},i.extend(n.prototype,a)},{"../../util/evented":434,"../../util/util":442}],411:[function(t,e,r){"use strict";function n(t){s.setOptions(this,t)}var i=t("./control"),a=t("../../util/browser"),o=t("../../util/dom"),s=t("../../util/util");e.exports=n;var l={enableHighAccuracy:!1,timeout:6e3};n.prototype=s.inherit(i,{options:{position:"top-right"},onAdd:function(t){var e=this._container=o.create("div","mapboxgl-ctrl-group",t.getContainer());return a.supportsGeolocation?(this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._geolocateButton=o.create("button","mapboxgl-ctrl-icon mapboxgl-ctrl-geolocate",this._container),this._geolocateButton.type="button",this._geolocateButton.addEventListener("click",this._onClickGeolocate.bind(this)),e):e},_onContextMenu:function(t){t.preventDefault()},_onClickGeolocate:function(){navigator.geolocation.getCurrentPosition(this._success.bind(this),this._error.bind(this),l),this._timeoutId=setTimeout(this._finish.bind(this),1e4)},_success:function(t){this._map.jumpTo({center:[t.coords.longitude,t.coords.latitude],zoom:17,bearing:0,pitch:0}),this.fire("geolocate",t),this._finish()},_error:function(t){this.fire("error",t),this._finish()},_finish:function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}})},{"../../util/browser":426,"../../util/dom":428,"../../util/util":442,"./control":410}],412:[function(t,e,r){"use strict";function n(t){s.setOptions(this,t)}function i(t){return new MouseEvent(t.type,{button:2,buttons:2,bubbles:!0,cancelable:!0,detail:t.detail,view:t.view,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY,movementX:t.movementX,movementY:t.movementY,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey})}var a=t("./control"),o=t("../../util/dom"),s=t("../../util/util");e.exports=n,n.prototype=s.inherit(a,{options:{position:"top-right"},onAdd:function(t){var e="mapboxgl-ctrl",r=this._container=o.create("div",e+"-group",t.getContainer());return this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._zoomInButton=this._createButton(e+"-icon "+e+"-zoom-in",t.zoomIn.bind(t)),this._zoomOutButton=this._createButton(e+"-icon "+e+"-zoom-out",t.zoomOut.bind(t)),this._compass=this._createButton(e+"-icon "+e+"-compass",t.resetNorth.bind(t)),this._compassArrow=o.create("div","arrow",this._compass),this._compass.addEventListener("mousedown",this._onCompassDown.bind(this)),this._onCompassMove=this._onCompassMove.bind(this),this._onCompassUp=this._onCompassUp.bind(this),t.on("rotate",this._rotateCompassArrow.bind(this)),this._rotateCompassArrow(),this._el=t.getCanvasContainer(),r},_onContextMenu:function(t){t.preventDefault()},_onCompassDown:function(t){0===t.button&&(o.disableDrag(),document.addEventListener("mousemove",this._onCompassMove),document.addEventListener("mouseup",this._onCompassUp),this._el.dispatchEvent(i(t)),t.stopPropagation())},_onCompassMove:function(t){0===t.button&&(this._el.dispatchEvent(i(t)),t.stopPropagation())},_onCompassUp:function(t){0===t.button&&(document.removeEventListener("mousemove",this._onCompassMove),document.removeEventListener("mouseup",this._onCompassUp),o.enableDrag(),this._el.dispatchEvent(i(t)),t.stopPropagation())},_createButton:function(t,e){var r=o.create("button",t,this._container);return r.type="button",r.addEventListener("click",function(){e()}),r},_rotateCompassArrow:function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t}})},{"../../util/dom":428,"../../util/util":442,"./control":410}],413:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),o.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../geo/lng_lat_bounds"),o=t("../../util/util");e.exports=n,n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onMouseDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onMouseDown),this._enabled=!1)},_onMouseDown:function(t){t.shiftKey&&0===t.button&&(document.addEventListener("mousemove",this._onMouseMove,!1),document.addEventListener("keydown",this._onKeyDown,!1),document.addEventListener("mouseup",this._onMouseUp,!1),i.disableDrag(),this._startPos=i.mousePos(this._el,t),this._active=!0)},_onMouseMove:function(t){var e=this._startPos,r=i.mousePos(this._el,t);this._box||(this._box=i.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var n=Math.min(e.x,r.x),a=Math.max(e.x,r.x),o=Math.min(e.y,r.y),s=Math.max(e.y,r.y);i.setTransform(this._box,"translate("+n+"px,"+o+"px)"),this._box.style.width=a-n+"px",this._box.style.height=s-o+"px"},_onMouseUp:function(t){if(0===t.button){var e=this._startPos,r=i.mousePos(this._el,t),n=new a(this._map.unproject(e),this._map.unproject(r));this._finish(),e.x===r.x&&e.y===r.y?this._fireEvent("boxzoomcancel",t):this._map.fitBounds(n,{linear:!0}).fire("boxzoomend",{originalEvent:t,boxZoomBounds:n})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},_finish:function(){this._active=!1,document.removeEventListener("mousemove",this._onMouseMove,!1),document.removeEventListener("keydown",this._onKeyDown,!1),document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.parentNode.removeChild(this._box),this._box=null),i.enableDrag()},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})}}},{"../../geo/lng_lat_bounds":340,"../../util/dom":428,"../../util/util":442}],414:[function(t,e,r){"use strict";function n(t){this._map=t,this._onDblClick=this._onDblClick.bind(this)}e.exports=n,n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._map.on("dblclick",this._onDblClick),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._map.off("dblclick",this._onDblClick),this._enabled=!1)},_onDblClick:function(t){this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)}}},{}],415:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/util");e.exports=n;var o=a.bezier(0,0,.3,1);n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._el.addEventListener("touchstart",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._el.removeEventListener("touchstart",this._onDown),this._enabled=!1)},_onDown:function(t){this._ignoreEvent(t)||this.isActive()||(t.touches?(document.addEventListener("touchmove",this._onMove),document.addEventListener("touchend",this._onTouchEnd)):(document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onMouseUp)),this._active=!1,this._startPos=this._pos=i.mousePos(this._el,t),this._inertia=[[Date.now(),this._pos]])},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("dragstart",t),this._fireEvent("movestart",t));var e=i.mousePos(this._el,t),r=this._map;r.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),e]),r.transform.setLocationAtPoint(r.transform.pointLocation(this._pos),e),this._fireEvent("drag",t),this._fireEvent("move",t),this._pos=e,t.preventDefault()}},_onUp:function(t){if(this.isActive()){this._active=!1,this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=function(){this._fireEvent("moveend",t)}.bind(this),r=this._inertia;if(r.length<2)return void e();var n=r[r.length-1],i=r[0],a=n[1].sub(i[1]),s=(n[0]-i[0])/1e3;if(0===s||n[1].equals(i[1]))return void e();var l=a.mult(.3/s),u=l.mag();u>1400&&(u=1400,l._unit()._mult(u));var c=u/750,h=l.mult(-c/2);this._map.panBy(h,{duration:1e3*c,easing:o,noMoveStart:!0},{originalEvent:t})}},_onMouseUp:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onMouseUp))},_onTouchEnd:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onTouchEnd))},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})},_ignoreEvent:function(t){var e=this._map;if(e.boxZoom&&e.boxZoom.isActive())return!0;if(e.dragRotate&&e.dragRotate.isActive())return!0;if(t.touches)return t.touches.length>1;if(t.ctrlKey)return!0;return"mousemove"===t.type?!1&t.buttons:0!==t.button},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>0&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":428,"../../util/util":442}],416:[function(t,e,r){"use strict";function n(t,e){this._map=t,this._el=t.getCanvasContainer(),this._bearingSnap=e.bearingSnap,o.bindHandlers(this)}var i=t("../../util/dom"),a=t("point-geometry"),o=t("../../util/util");e.exports=n;var s=o.bezier(0,0,.25,1);n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._enabled=!1)},_onDown:function(t){if(!this._ignoreEvent(t)&&!this.isActive()){document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onUp),this._active=!1,this._inertia=[[Date.now(),this._map.getBearing()]],this._startPos=this._pos=i.mousePos(this._el,t),this._center=this._map.transform.centerPoint;var e=this._startPos.sub(this._center);e.mag()<200&&(this._center=this._startPos.add(new a(-200,0)._rotate(e.angle()))),t.preventDefault()}},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("rotatestart",t),this._fireEvent("movestart",t));var e=this._map;e.stop();var r=this._pos,n=i.mousePos(this._el,t),a=this._center,o=r.sub(a).angleWith(n.sub(a))/Math.PI*180,s=e.getBearing()-o,l=this._inertia,u=l[l.length-1];this._drainInertiaBuffer(),l.push([Date.now(),e._normalizeBearing(s,u[1])]),e.transform.bearing=s,this._fireEvent("rotate",t),this._fireEvent("move",t),this._pos=n}},_onUp:function(t){if(!this._ignoreEvent(t)&&(document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onUp),this.isActive())){this._active=!1,this._fireEvent("rotateend",t),this._drainInertiaBuffer();var e=this._map,r=e.getBearing(),n=this._inertia,i=function(){Math.abs(r)180&&(d=180);var p=d/180;u+=h*d*(p/2),Math.abs(e._normalizeBearing(u,0))1;var r=t.ctrlKey?1:2,n=t.ctrlKey?0:2;return"mousemove"===t.type?t.buttons&0===r:t.button!==n},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>0&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":428,"../../util/util":442,"point-geometry":484}],417:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),this._onKeyDown=this._onKeyDown.bind(this)}e.exports=n;n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=this._map,r={originalEvent:t};if(!e.isEasing())switch(t.keyCode){case 61:case 107:case 171:case 187:e.zoomTo(Math.round(e.getZoom())+(t.shiftKey?2:1),r);break;case 189:case 109:case 173:e.zoomTo(Math.round(e.getZoom())-(t.shiftKey?2:1),r);break;case 37:t.shiftKey?e.easeTo({bearing:e.getBearing()-2},r):(t.preventDefault(),e.panBy([-80,0],r));break;case 39:t.shiftKey?e.easeTo({bearing:e.getBearing()+2},r):(t.preventDefault(),e.panBy([80,0],r));break;case 38:t.shiftKey?e.easeTo({pitch:e.getPitch()+5},r):(t.preventDefault(),e.panBy([0,-80],r));break;case 40:t.shiftKey?e.easeTo({pitch:Math.max(e.getPitch()-5,0)},r):(t.preventDefault(),e.panBy([0,80],r))}}}}},{}],418:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),o.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/browser"),o=t("../../util/util");e.exports=n;var s="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",l=-1!==s.indexOf("firefox"),u=-1!==s.indexOf("safari")&&-1===s.indexOf("chrom");n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("wheel",this._onWheel,!1),this._el.addEventListener("mousewheel",this._onWheel,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("wheel",this._onWheel),this._el.removeEventListener("mousewheel",this._onWheel),this._enabled=!1)},_onWheel:function(t){var e;"wheel"===t.type?(e=t.deltaY,l&&t.deltaMode===window.WheelEvent.DOM_DELTA_PIXEL&&(e/=a.devicePixelRatio),t.deltaMode===window.WheelEvent.DOM_DELTA_LINE&&(e*=40)):"mousewheel"===t.type&&(e=-t.wheelDeltaY,u&&(e/=3));var r=a.now(),n=r-(this._time||0);this._pos=i.mousePos(this._el,t),this._time=r,0!==e&&e%4.000244140625==0?(this._type="wheel",e=Math.floor(e/4)):0!==e&&Math.abs(e)<4?this._type="trackpad":n>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40)):this._type||(this._type=Math.abs(n*e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&this._zoom(-e,t),t.preventDefault()},_onTimeout:function(){this._type="wheel",this._zoom(-this._lastValue)},_zoom:function(t,e){if(0!==t){var r=this._map,n=2/(1+Math.exp(-Math.abs(t/100)));t<0&&0!==n&&(n=1/n);var i=r.ease?r.ease.to:r.transform.scale,a=r.transform.scaleZoom(i*n);r.zoomTo(a,{duration:0,around:r.unproject(this._pos),delayEndEvents:200},{originalEvent:e})}}}},{"../../util/browser":426,"../../util/dom":428,"../../util/util":442}],419:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/util");e.exports=n;var o=a.bezier(0,0,.15,1);n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("touchstart",this._onStart,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("touchstart",this._onStart),this._enabled=!1)},disableRotation:function(){this._rotationDisabled=!0},enableRotation:function(){this._rotationDisabled=!1},_onStart:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]);this._startVec=e.sub(r),this._startScale=this._map.transform.scale,this._startBearing=this._map.transform.bearing,this._gestureIntent=void 0,this._inertia=[], document.addEventListener("touchmove",this._onMove,!1),document.addEventListener("touchend",this._onEnd,!1)}},_onMove:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]),n=e.add(r).div(2),a=e.sub(r),o=a.mag()/this._startVec.mag(),s=this._rotationDisabled?0:180*a.angleWith(this._startVec)/Math.PI,l=this._map;if(this._gestureIntent){var u={duration:0,around:l.unproject(n)};"rotate"===this._gestureIntent&&(u.bearing=this._startBearing+s),"zoom"!==this._gestureIntent&&"rotate"!==this._gestureIntent||(u.zoom=l.transform.scaleZoom(this._startScale*o)),l.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),o,n]),l.easeTo(u,{originalEvent:t})}else{var c=Math.abs(1-o)>.15;Math.abs(s)>4?this._gestureIntent="rotate":c&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._startVec=a,this._startScale=l.transform.scale,this._startBearing=l.transform.bearing)}t.preventDefault()}},_onEnd:function(t){document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onEnd),this._drainInertiaBuffer();var e=this._inertia,r=this._map;if(e.length<2)return void r.snapToNorth({},{originalEvent:t});var n=e[e.length-1],i=e[0],a=r.transform.scaleZoom(this._startScale*n[1]),s=r.transform.scaleZoom(this._startScale*i[1]),l=a-s,u=(n[0]-i[0])/1e3,c=n[2];if(0===u||a===s)return void r.snapToNorth({},{originalEvent:t});var h=.15*l/u;Math.abs(h)>2.5&&(h=h>0?2.5:-2.5);var f=1e3*Math.abs(h/(12*.15)),d=a+h*f/2e3;d<0&&(d=0),r.easeTo({zoom:d,duration:f,easing:o,around:r.unproject(c)},{originalEvent:t})},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>2&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":428,"../../util/util":442}],420:[function(t,e,r){"use strict";function n(){i.bindAll(["_onHashChange","_updateHash"],this)}e.exports=n;var i=t("../util/util");n.prototype={addTo:function(t){return this._map=t,window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},remove:function(){return window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),delete this._map,this},_onHashChange:function(){var t=location.hash.replace("#","").split("/");return t.length>=3&&(this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:+(t[3]||0)}),!0)},_updateHash:function(){var t=this._map.getCenter(),e=this._map.getZoom(),r=this._map.getBearing(),n=Math.max(0,Math.ceil(Math.log(e)/Math.LN2)),i="#"+Math.round(100*e)/100+"/"+t.lat.toFixed(n)+"/"+t.lng.toFixed(n)+(r?"/"+Math.round(10*r)/10:"");window.history.replaceState("","",i)}}},{"../util/util":442}],421:[function(t,e,r){"use strict";function n(t){t.parentNode&&t.parentNode.removeChild(t)}var i=t("../util/canvas"),a=t("../util/util"),o=t("../util/browser"),s=t("../util/browser").window,l=t("../util/evented"),u=t("../util/dom"),c=t("../style/style"),h=t("../style/animation_loop"),f=t("../render/painter"),d=t("../geo/transform"),p=t("./hash"),m=t("./bind_handlers"),g=t("./camera"),v=t("../geo/lng_lat"),y=t("../geo/lng_lat_bounds"),b=t("point-geometry"),x=t("./control/attribution"),_={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:0,maxZoom:20,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,workerCount:Math.max(o.hardwareConcurrency-1,1)},w=e.exports=function(t){if(t=a.extend({},_,t),t.workerCount<1)throw new Error("workerCount must an integer greater than or equal to 1.");this._interactive=t.interactive,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._trackResize=t.trackResize,this._workerCount=t.workerCount,this._bearingSnap=t.bearingSnap,"string"==typeof t.container?this._container=document.getElementById(t.container):this._container=t.container,this.animationLoop=new h,this.transform=new d(t.minZoom,t.maxZoom),t.maxBounds&&this.setMaxBounds(t.maxBounds),a.bindAll(["_forwardStyleEvent","_forwardSourceEvent","_forwardLayerEvent","_forwardTileEvent","_onStyleLoad","_onStyleChange","_onSourceAdd","_onSourceRemove","_onSourceUpdate","_onWindowOnline","_onWindowResize","_update","_render"],this),this._setupContainer(),this._setupPainter(),this.on("move",this._update.bind(this,!1)),this.on("zoom",this._update.bind(this,!0)),this.on("moveend",function(){this.animationLoop.set(300),this._rerender()}.bind(this)),void 0!==s&&(s.addEventListener("online",this._onWindowOnline,!1),s.addEventListener("resize",this._onWindowResize,!1)),m(this,t),this._hash=t.hash&&(new p).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),this.stacks={},this._classes=[],this.resize(),t.classes&&this.setClasses(t.classes),t.style&&this.setStyle(t.style),t.attributionControl&&this.addControl(new x(t.attributionControl));var e=this.fire.bind(this,"error");this.on("style.error",e),this.on("source.error",e),this.on("tile.error",e),this.on("layer.error",e)};a.extend(w.prototype,l),a.extend(w.prototype,g.prototype),a.extend(w.prototype,{addControl:function(t){return t.addTo(this),this},addClass:function(t,e){return this._classes.indexOf(t)>=0||""===t?this:(this._classes.push(t),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},removeClass:function(t,e){var r=this._classes.indexOf(t);return r<0||""===t?this:(this._classes.splice(r,1),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},setClasses:function(t,e){for(var r={},n=0;n=0},getClasses:function(){return this._classes},resize:function(){var t=0,e=0;return this._container&&(t=this._container.offsetWidth||400,e=this._container.offsetHeight||300),this._canvas.resize(t,e),this.transform.resize(t,e),this.painter.resize(t,e),this.fire("movestart").fire("move").fire("resize").fire("moveend")},getBounds:function(){var t=new y(this.transform.pointLocation(new b(0,0)),this.transform.pointLocation(this.transform.size));return(this.transform.angle||this.transform.pitch)&&(t.extend(this.transform.pointLocation(new b(this.transform.size.x,0))),t.extend(this.transform.pointLocation(new b(0,this.transform.size.y)))),t},setMaxBounds:function(t){if(t){var e=y.convert(t);this.transform.lngRange=[e.getWest(),e.getEast()],this.transform.latRange=[e.getSouth(),e.getNorth()],this.transform._constrain(),this._update()}else null!==t&&void 0!==t||(this.transform.lngRange=[],this.transform.latRange=[],this._update());return this},setMinZoom:function(t){if((t=null===t||void 0===t?0:t)>=0&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom&&t<=20)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be between the current minZoom and 20, inclusive")},project:function(t){return this.transform.locationPoint(v.convert(t))},unproject:function(t){return this.transform.pointLocation(b.convert(t))},queryRenderedFeatures:function(){var t,e={};return 2===arguments.length?(t=arguments[0],e=arguments[1]):1===arguments.length&&function(t){return t instanceof b||Array.isArray(t)}(arguments[0])?t=arguments[0]:1===arguments.length&&(e=arguments[0]),this.style.queryRenderedFeatures(this._makeQueryGeometry(t),e,this.transform.zoom,this.transform.angle)},_makeQueryGeometry:function(t){void 0===t&&(t=[b.convert([0,0]),b.convert([this.transform.width,this.transform.height])]);var e;if(t instanceof b||"number"==typeof t[0])e=[b.convert(t)];else{var r=[b.convert(t[0]),b.convert(t[1])];e=[r[0],new b(r[1].x,r[0].y),r[1],new b(r[0].x,r[1].y),r[0]]}return e=e.map(function(t){return this.transform.pointCoordinate(t)}.bind(this))},querySourceFeatures:function(t,e){return this.style.querySourceFeatures(t,e)},setStyle:function(t){return this.style&&(this.style.off("load",this._onStyleLoad).off("error",this._forwardStyleEvent).off("change",this._onStyleChange).off("source.add",this._onSourceAdd).off("source.remove",this._onSourceRemove).off("source.load",this._onSourceUpdate).off("source.error",this._forwardSourceEvent).off("source.change",this._onSourceUpdate).off("layer.add",this._forwardLayerEvent).off("layer.remove",this._forwardLayerEvent).off("layer.error",this._forwardLayerEvent).off("tile.add",this._forwardTileEvent).off("tile.remove",this._forwardTileEvent).off("tile.load",this._update).off("tile.error",this._forwardTileEvent).off("tile.stats",this._forwardTileEvent)._remove(),this.off("rotate",this.style._redoPlacement),this.off("pitch",this.style._redoPlacement)),t?(this.style=t instanceof c?t:new c(t,this.animationLoop,this._workerCount),this.style.on("load",this._onStyleLoad).on("error",this._forwardStyleEvent).on("change",this._onStyleChange).on("source.add",this._onSourceAdd).on("source.remove",this._onSourceRemove).on("source.load",this._onSourceUpdate).on("source.error",this._forwardSourceEvent).on("source.change",this._onSourceUpdate).on("layer.add",this._forwardLayerEvent).on("layer.remove",this._forwardLayerEvent).on("layer.error",this._forwardLayerEvent).on("tile.add",this._forwardTileEvent).on("tile.remove",this._forwardTileEvent).on("tile.load",this._update).on("tile.error",this._forwardTileEvent).on("tile.stats",this._forwardTileEvent),this.on("rotate",this.style._redoPlacement),this.on("pitch",this.style._redoPlacement),this):(this.style=null,this)},getStyle:function(){if(this.style)return this.style.serialize()},addSource:function(t,e){return this.style.addSource(t,e),this._update(!0),this},addSourceType:function(t,e,r){return this.style.addSourceType(t,e,r)},removeSource:function(t){return this.style.removeSource(t),this._update(!0),this},getSource:function(t){return this.style.getSource(t)},addLayer:function(t,e){return this.style.addLayer(t,e),this._update(!0),this},removeLayer:function(t){return this.style.removeLayer(t),this._update(!0),this},getLayer:function(t){return this.style.getLayer(t)},setFilter:function(t,e){return this.style.setFilter(t,e),this._update(!0),this},setLayerZoomRange:function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0),this},getFilter:function(t){return this.style.getFilter(t)},setPaintProperty:function(t,e,r,n){return this.style.setPaintProperty(t,e,r,n),this._update(!0),this},getPaintProperty:function(t,e,r){return this.style.getPaintProperty(t,e,r)},setLayoutProperty:function(t,e,r){return this.style.setLayoutProperty(t,e,r),this._update(!0),this},getLayoutProperty:function(t,e){return this.style.getLayoutProperty(t,e)},getContainer:function(){return this._container},getCanvasContainer:function(){return this._canvasContainer},getCanvas:function(){return this._canvas.getElement()},_setupContainer:function(){var t=this._container;t.classList.add("mapboxgl-map");var e=this._canvasContainer=u.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=new i(this,e);var r=this._controlContainer=u.create("div","mapboxgl-control-container",t),n=this._controlCorners={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(t){n[t]=u.create("div","mapboxgl-ctrl-"+t,r)})},_setupPainter:function(){var t=this._canvas.getWebGLContext({failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer});if(!t)return void this.fire("error",{error:new Error("Failed to initialize WebGL")});this.painter=new f(t,this.transform)},_contextLost:function(t){t.preventDefault(),this._frameId&&o.cancelFrame(this._frameId),this.fire("webglcontextlost",{originalEvent:t})},_contextRestored:function(t){this._setupPainter(),this.resize(),this._update(),this.fire("webglcontextrestored",{originalEvent:t})},loaded:function(){return!this._styleDirty&&!this._sourcesDirty&&!(!this.style||!this.style.loaded())},_update:function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this._rerender(),this):this},_render:function(){try{this.style&&this._styleDirty&&(this._styleDirty=!1,this.style.update(this._classes,this._classOptions),this._classOptions=null,this.style._recalculate(this.transform.zoom)),this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.painter.render(this.style,{debug:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,vertices:this.vertices,rotating:this.rotating,zooming:this.zooming}),this.fire("render"),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire("load")),this._frameId=null,this.animationLoop.stopped()||(this._styleDirty=!0),(this._sourcesDirty||this._repaint||this._styleDirty)&&this._rerender()}catch(t){this.fire("error",{error:t})}return this},remove:function(){this._hash&&this._hash.remove(),o.cancelFrame(this._frameId),this.setStyle(null),void 0!==s&&s.removeEventListener("resize",this._onWindowResize,!1);var t=this.painter.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),n(this._canvasContainer),n(this._controlContainer),this._container.classList.remove("mapboxgl-map")},_rerender:function(){this.style&&!this._frameId&&(this._frameId=o.frame(this._render))},_forwardStyleEvent:function(t){this.fire("style."+t.type,a.extend({style:t.target},t))},_forwardSourceEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_forwardLayerEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_forwardTileEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_onStyleLoad:function(t){this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this.style.update(this._classes,{transition:!1}),this._forwardStyleEvent(t)},_onStyleChange:function(t){this._update(!0),this._forwardStyleEvent(t)},_onSourceAdd:function(t){var e=t.source;e.onAdd&&e.onAdd(this),this._forwardSourceEvent(t)},_onSourceRemove:function(t){var e=t.source;e.onRemove&&e.onRemove(this),this._forwardSourceEvent(t)},_onSourceUpdate:function(t){this._update(),this._forwardSourceEvent(t)},_onWindowOnline:function(){this._update()},_onWindowResize:function(){this._trackResize&&this.stop().resize()._update()}}),a.extendAll(w.prototype,{_showTileBoundaries:!1,get showTileBoundaries(){return this._showTileBoundaries},set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},_showCollisionBoxes:!1,get showCollisionBoxes(){return this._showCollisionBoxes},set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,this.style._redoPlacement())},_showOverdrawInspector:!1,get showOverdrawInspector(){return this._showOverdrawInspector},set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},_repaint:!1,get repaint(){return this._repaint},set repaint(t){this._repaint=t,this._update()},_vertices:!1,get vertices(){return this._vertices},set vertices(t){this._vertices=t,this._update()}})},{"../geo/lng_lat":339,"../geo/lng_lat_bounds":340,"../geo/transform":341,"../render/painter":355,"../style/animation_loop":375,"../style/style":378,"../util/browser":426,"../util/canvas":427,"../util/dom":428,"../util/evented":434,"../util/util":442,"./bind_handlers":407,"./camera":408,"./control/attribution":409,"./hash":420,"point-geometry":484}],422:[function(t,e,r){"use strict";function n(t,e){t||(t=i.create("div")),t.classList.add("mapboxgl-marker"),this._el=t,this._offset=o.convert(e&&e.offset||[0,0]),this._update=this._update.bind(this)}e.exports=n;var i=t("../util/dom"),a=t("../geo/lng_lat"),o=t("point-geometry");n.prototype={addTo:function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._el),t.on("move",this._update),this._update(),this},remove:function(){this._map&&(this._map.off("move",this._update),this._map=null);var t=this._el.parentNode;return t&&t.removeChild(this._el),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=a.convert(t),this._update(),this},getElement:function(){return this._el},_update:function(){if(this._map){var t=this._map.project(this._lngLat)._add(this._offset);i.setTransform(this._el,"translate("+t.x+"px,"+t.y+"px)")}}}},{"../geo/lng_lat":339,"../util/dom":428,"point-geometry":484}],423:[function(t,e,r){"use strict";function n(t){i.setOptions(this,t),i.bindAll(["_update","_onClickClose"],this)}e.exports=n;var i=t("../util/util"),a=t("../util/evented"),o=t("../util/dom"),s=t("../geo/lng_lat");n.prototype=i.inherit(a,{options:{closeButton:!0,closeOnClick:!0},addTo:function(t){return this._map=t,this._map.on("move",this._update),this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._update(),this},remove:function(){return this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._container&&(this._container.parentNode.removeChild(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),delete this._map),this.fire("close"),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=s.convert(t),this._update(),this},setText:function(t){return this.setDOMContent(document.createTextNode(t))},setHTML:function(t){var e,r=document.createDocumentFragment(),n=document.createElement("body");for(n.innerHTML=t;;){if(!(e=n.firstChild))break;r.appendChild(e)}return this.setDOMContent(r)},setDOMContent:function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},_createContent:function(){this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._content=o.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=o.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClickClose))},_update:function(){if(this._map&&this._lngLat&&this._content){this._container||(this._container=o.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=o.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content));var t=this._map.project(this._lngLat).round(),e=this.options.anchor;if(!e){var r=this._container.offsetWidth,n=this._container.offsetHeight;e=t.ythis._map.transform.height-n?["bottom"]:[],t.xthis._map.transform.width-r/2&&e.push("right"),e=0===e.length?"bottom":e.join("-")}var i={top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"},a=this._container.classList;for(var s in i)a.remove("mapboxgl-popup-anchor-"+s);a.add("mapboxgl-popup-anchor-"+e),o.setTransform(this._container,i[e]+" translate("+t.x+"px,"+t.y+"px)")}},_onClickClose:function(){this.remove()}})},{"../geo/lng_lat":339,"../util/dom":428,"../util/evented":434,"../util/util":442}],424:[function(t,e,r){"use strict";function n(t,e){this.target=t,this.parent=e,this.callbacks={},this.callbackID=0,this.receive=this.receive.bind(this),this.target.addEventListener("message",this.receive,!1)}e.exports=n,n.prototype.receive=function(t){function e(t,e,r){this.postMessage({type:"",id:String(i),error:t?String(t):null,data:e},r)}var r,n=t.data,i=n.id;if(""===n.type)r=this.callbacks[n.id],delete this.callbacks[n.id],r&&r(n.error||null,n.data);else if(void 0!==n.id&&this.parent[n.type])this.parent[n.type](n.data,e.bind(this));else if(void 0!==n.id&&this.parent.workerSources){var a=n.type.split(".");this.parent.workerSources[a[0]][a[1]](n.data,e.bind(this))}else this.parent[n.type](n.data)},n.prototype.send=function(t,e,r,n){var i=null;r&&(this.callbacks[i=this.callbackID++]=r),this.postMessage({type:t,id:String(i),data:e},n)},n.prototype.postMessage=function(t,e){this.target.postMessage(t,e)}},{}],425:[function(t,e,r){"use strict";function n(t){var e=document.createElement("a");return e.href=t,e.protocol===document.location.protocol&&e.host===document.location.host}r.getJSON=function(t,e){var r=new XMLHttpRequest;return r.open("GET",t,!0),r.setRequestHeader("Accept","application/json"),r.onerror=function(t){e(t)},r.onload=function(){if(r.status>=200&&r.status<300&&r.response){var t;try{t=JSON.parse(r.response)}catch(t){return e(t)}e(null,t)}else e(new Error(r.statusText))},r.send(),r},r.getArrayBuffer=function(t,e){var r=new XMLHttpRequest;return r.open("GET",t,!0),r.responseType="arraybuffer",r.onerror=function(t){e(t)},r.onload=function(){r.status>=200&&r.status<300&&r.response?e(null,r.response):e(new Error(r.statusText))},r.send(),r},r.getImage=function(t,e){return r.getArrayBuffer(t,function(t,r){if(t)return e(t);var n=new Image;n.onload=function(){e(null,n),(window.URL||window.webkitURL).revokeObjectURL(n.src)};var i=new Blob([new Uint8Array(r)],{type:"image/png"});return n.src=(window.URL||window.webkitURL).createObjectURL(i),n.getData=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return t.width=n.width,t.height=n.height,e.drawImage(n,0,0),e.getImageData(0,0,n.width,n.height).data},n})},r.getVideo=function(t,e){var r=document.createElement("video");r.onloadstart=function(){e(null,r)};for(var i=0;i=s+n?t.call(i,1):(t.call(i,(l-s)/n),r.frame(a)))}if(!n)return t.call(i,1),null;var o=!1,s=e.exports.now();return r.frame(a),function(){o=!0}},r.supported=t("mapbox-gl-supported"),r.hardwareConcurrency=navigator.hardwareConcurrency||4,Object.defineProperty(r,"devicePixelRatio",{get:function(){return window.devicePixelRatio}}),r.supportsWebp=!1;var a=document.createElement("img");a.onload=function(){r.supportsWebp=!0},a.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=",r.supportsGeolocation=!!navigator.geolocation},{"mapbox-gl-supported":327}],427:[function(t,e,r){"use strict";function n(t,e){this.canvas=document.createElement("canvas"),t&&e&&(this.canvas.style.position="absolute",this.canvas.classList.add("mapboxgl-canvas"),this.canvas.addEventListener("webglcontextlost",t._contextLost.bind(t),!1),this.canvas.addEventListener("webglcontextrestored",t._contextRestored.bind(t),!1),this.canvas.setAttribute("tabindex",0),e.appendChild(this.canvas))}var i=t("../util"),a=t("mapbox-gl-supported");e.exports=n,n.prototype.resize=function(t,e){var r=window.devicePixelRatio||1;this.canvas.width=r*t,this.canvas.height=r*e,this.canvas.style.width=t+"px",this.canvas.style.height=e+"px"},n.prototype.getWebGLContext=function(t){return t=i.extend({},t,a.webGLContextAttributes),this.canvas.getContext("webgl",t)||this.canvas.getContext("experimental-webgl",t)},n.prototype.getElement=function(){return this.canvas}},{"../util":442,"mapbox-gl-supported":327}],428:[function(t,e,r){"use strict";function n(t){for(var e=0;e1)for(var h=0;h=0&&this._events[t].splice(r,1),this._events[t].length||delete this._events[t]}else delete this._events[t];return this},once:function(t,e){var r=function(n){this.off(t,r),e.call(this,n)}.bind(this);return this.on(t,r),this},fire:function(t,e){if(!this.listens(t))return n.endsWith(t,"error")&&console.error(e&&e.error||e||"Empty error event"),this;e=n.extend({},e),n.extend(e,{type:t,target:this});for(var r=this._events[t].slice(),i=0;i=3)for(var l=0;l1){if(s(t,e))return!0;for(var n=0;n(e.y-t.y)*(r.x-t.x)}function u(t,e,r,n){return l(t,r,n)!==l(e,r,n)&&l(t,e,r)!==l(t,e,n)}function c(t,e,r){var n=r*r;if(1===e.length)return t.distSqr(e[0])1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function f(t,e){for(var r,n,i,a=!1,o=0;oe.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(a=!a)}return a}function d(t,e){for(var r=!1,n=0,i=t.length-1;ne.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}e.exports={multiPolygonIntersectsBufferedMultiPoint:n,multiPolygonIntersectsMultiPolygon:i,multiPolygonIntersectsBufferedMultiLine:a}},{}],438:[function(t,e,r){"use strict";function n(t,e){this.max=t,this.onRemove=e,this.reset()}e.exports=n,n.prototype.reset=function(){for(var t in this.data)this.onRemove(this.data[t]);return this.data={},this.order=[],this},n.prototype.add=function(t,e){if(this.has(t))this.order.splice(this.order.indexOf(t),1),this.data[t]=e,this.order.push(t);else if(this.data[t]=e,this.order.push(t),this.order.length>this.max){var r=this.get(this.order[0]);r&&this.onRemove(r)}return this},n.prototype.has=function(t){return t in this.data},n.prototype.keys=function(){return this.order},n.prototype.get=function(t){if(!this.has(t))return null;var e=this.data[t];return delete this.data[t],this.order.splice(this.order.indexOf(t),1),e},n.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this.get(this.order[0]);e&&this.onRemove(e)}return this}},{}],439:[function(t,e,r){"use strict";function n(t,e,r){if(!(r=r||o.ACCESS_TOKEN)&&o.REQUIRE_ACCESS_TOKEN)throw new Error("An API access token is required to use Mapbox GL. See https://www.mapbox.com/developers/api/#access-tokens");if(t=t.replace(/^mapbox:\/\//,o.API_URL+e), t+=-1!==t.indexOf("?")?"&access_token=":"?access_token=",o.REQUIRE_ACCESS_TOKEN){if("s"===r[0])throw new Error("Use a public access token (pk.*) with Mapbox GL JS, not a secret access token (sk.*). See https://www.mapbox.com/developers/api/#access-tokens");t+=r}return t}function i(t){return t?"?"+t:""}function a(t){return t.access_token&&"tk."===t.access_token.slice(0,3)?u.extend({},t,{access_token:o.ACCESS_TOKEN}):t}var o=t("./config"),s=t("./browser"),l=t("url"),u=t("./util");e.exports.normalizeStyleURL=function(t,e){var r=l.parse(t);return"mapbox:"!==r.protocol?t:n("mapbox:/"+r.pathname+i(r.query),"/styles/v1/",e)},e.exports.normalizeSourceURL=function(t,e){return"mapbox:"!==l.parse(t).protocol?t:n(t+".json","/v4/",e)+"&secure"},e.exports.normalizeGlyphsURL=function(t,e){var r=l.parse(t);return"mapbox:"!==r.protocol?t:n("mapbox://"+r.pathname.split("/")[1]+"/{fontstack}/{range}.pbf"+i(r.query),"/fonts/v1/",e)},e.exports.normalizeSpriteURL=function(t,e,r,a){var o=l.parse(t);return"mapbox:"!==o.protocol?(o.pathname+=e+r,l.format(o)):n("mapbox:/"+o.pathname+"/sprite"+e+r+i(o.query),"/styles/v1/",a)},e.exports.normalizeTileURL=function(t,e,r){var n=l.parse(t,!0);if(!e)return t;if("mapbox:"!==l.parse(e).protocol)return t;var i=s.supportsWebp?".webp":"$1",o=s.devicePixelRatio>=2||512===r?"@2x":"";return l.format({protocol:n.protocol,hostname:n.hostname,pathname:n.pathname.replace(/(\.(?:png|jpg)\d*)/,o+i),query:a(n.query)})}},{"./browser":426,"./config":431,"./util":442,url:545}],440:[function(t,e,r){"use strict";function n(t){function e(){f.apply(this,arguments)}function r(){d.apply(this,arguments),this.members=e.prototype.members}var n=JSON.stringify(t);if(g[n])return g[n];void 0===t.alignment&&(t.alignment=1),e.prototype=Object.create(f.prototype);var s=0,u=0,v=["Uint8"];return e.prototype.members=t.members.map(function(r){r={name:r.name,type:r.type,components:r.components||1},p(r.name.length),p(r.type in m),v.indexOf(r.type)<0&&v.push(r.type);var n=o(r.type);u=Math.max(u,n),r.offset=s=a(s,Math.max(t.alignment,n));for(var i=0;ithis.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*this.RESIZE_MULTIPLIER),this.DEFAULT_CAPACITY),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},d.prototype._refreshViews=function(){for(var t=0;t=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)},r.bezier=function(t,e,r,i){var a=new n(t,e,r,i);return function(t){return a.solve(t)}},r.ease=r.bezier(.25,.1,.25,1),r.clamp=function(t,e,r){return Math.min(r,Math.max(e,t))},r.wrap=function(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i},r.coalesce=function(){for(var t=0;t=0)return!0;return!1};var o={};r.warnOnce=function(t){o[t]||("undefined"!=typeof console&&console.warn(t),o[t]=!0)}},{"../geo/coordinate":338,unitbezier:544}],443:[function(t,e,r){"use strict";function n(t,e,r,n){this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,null!=t.id&&(this.id=t.id)}e.exports=n,n.prototype={type:"Feature",get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},set geometry(t){this._geometry=t},toJSON:function(){var t={};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&"toJSON"!==e&&(t[e]=this[e]);return t}}},{}],444:[function(t,e,r){e.exports={_args:[[{raw:"mapbox-gl@^0.22.0",scope:null,escapedName:"mapbox-gl",name:"mapbox-gl",rawSpec:"^0.22.0",spec:">=0.22.0 <0.23.0",type:"range"},"/home/etienne/Documents/plotly/plotly.js"]],_from:"mapbox-gl@>=0.22.0 <0.23.0",_id:"mapbox-gl@0.22.1",_inCache:!0,_location:"/mapbox-gl",_nodeVersion:"4.4.5",_npmOperationalInternal:{host:"packages-12-west.internal.npmjs.com",tmp:"tmp/mapbox-gl-0.22.1.tgz_1471549891670_0.8762630566488951"},_npmUser:{name:"lucaswoj",email:"lucas@lucaswoj.com"},_npmVersion:"2.15.5",_phantomChildren:{},_requested:{raw:"mapbox-gl@^0.22.0",scope:null,escapedName:"mapbox-gl",name:"mapbox-gl",rawSpec:"^0.22.0",spec:">=0.22.0 <0.23.0",type:"range"},_requiredBy:["/"],_resolved:"https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-0.22.1.tgz",_shasum:"92a965547d4c2f24c22cbc487eeda48694cb627a",_shrinkwrap:null,_spec:"mapbox-gl@^0.22.0",_where:"/home/etienne/Documents/plotly/plotly.js",browser:{"./js/util/ajax.js":"./js/util/browser/ajax.js","./js/util/browser.js":"./js/util/browser/browser.js","./js/util/canvas.js":"./js/util/browser/canvas.js","./js/util/dom.js":"./js/util/browser/dom.js","./js/util/web_worker.js":"./js/util/browser/web_worker.js"},bugs:{url:"https://github.com/mapbox/mapbox-gl-js/issues"},dependencies:{csscolorparser:"^1.0.2",earcut:"^2.0.3","feature-filter":"^2.2.0","geojson-rewind":"^0.1.0","geojson-vt":"^2.4.0","gl-matrix":"^2.3.1","grid-index":"^1.0.0","mapbox-gl-function":"^1.2.1","mapbox-gl-shaders":"github:mapbox/mapbox-gl-shaders#de2ab007455aa2587c552694c68583f94c9f2747","mapbox-gl-style-spec":"github:mapbox/mapbox-gl-style-spec#83b1a3e5837d785af582efd5ed1a212f2df6a4ae","mapbox-gl-supported":"^1.2.0",pbf:"^1.3.2",pngjs:"^2.2.0","point-geometry":"^0.0.0",quickselect:"^1.0.0",request:"^2.39.0","resolve-url":"^0.2.1","shelf-pack":"^1.0.0",supercluster:"^2.0.1",unassertify:"^2.0.0",unitbezier:"^0.0.0","vector-tile":"^1.3.0","vt-pbf":"^2.0.2",webworkify:"^1.3.0","whoots-js":"^2.0.0"},description:"A WebGL interactive maps library",devDependencies:{"babel-preset-react":"^6.11.1",babelify:"^7.3.0",benchmark:"~2.1.0",browserify:"^13.0.0",clipboard:"^1.5.12","concat-stream":"1.5.1",coveralls:"^2.11.8",doctrine:"^1.2.1",documentation:"https://github.com/documentationjs/documentation/archive/bb41619c734e59ef3fbc3648610032efcfdaaace.tar.gz","documentation-theme-utils":"3.0.0",envify:"^3.4.0",eslint:"^2.5.3","eslint-config-mourner":"^2.0.0","eslint-plugin-html":"^1.5.1",gl:"^4.0.1",handlebars:"4.0.5","highlight.js":"9.3.0",istanbul:"^0.4.2","json-loader":"^0.5.4",lodash:"^4.13.1","mapbox-gl-test-suite":"github:mapbox/mapbox-gl-test-suite#7babab52fb02788ebbc38384139bf350e8e38552","memory-fs":"^0.3.0",minifyify:"^7.0.1","npm-run-all":"^3.0.0",nyc:"6.4.0",proxyquire:"^1.7.9",remark:"4.2.2","remark-html":"3.0.0",sinon:"^1.15.4",st:"^1.2.0",tap:"^5.7.0","transform-loader":"^0.2.3","unist-util-visit":"1.1.0",vinyl:"1.1.1","vinyl-fs":"2.4.3",watchify:"^3.7.0",webpack:"^1.13.1","webworkify-webpack":"^1.1.3"},directories:{},dist:{shasum:"92a965547d4c2f24c22cbc487eeda48694cb627a",tarball:"https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-0.22.1.tgz"},engines:{node:">=4.0.0"},gitHead:"13a9015341f0602ccb55c98c53079838ad4b70b5",homepage:"https://github.com/mapbox/mapbox-gl-js#readme",license:"BSD-3-Clause",main:"js/mapbox-gl.js",maintainers:[{name:"aaronlidman",email:"aaronlidman@gmail.com"},{name:"ajashton",email:"aj.ashton@gmail.com"},{name:"ansis",email:"ansis.brammanis@gmail.com"},{name:"bergwerkgis",email:"wb@bergwerk-gis.at"},{name:"bhousel",email:"bryan@mapbox.com"},{name:"bsudekum",email:"bobby@mapbox.com"},{name:"camilleanne",email:"camille@mapbox.com"},{name:"dnomadb",email:"damon@mapbox.com"},{name:"dthompson",email:"dthompson@gmail.com"},{name:"emilymcafee",email:"emily@mapbox.com"},{name:"flippmoke",email:"flippmoke@gmail.com"},{name:"freenerd",email:"spam@freenerd.de"},{name:"gretacb",email:"carol@mapbox.com"},{name:"ian29",email:"ian.villeda@gmail.com"},{name:"ianshward",email:"ian@mapbox.com"},{name:"ingalls",email:"nicholas.ingalls@gmail.com"},{name:"jfirebaugh",email:"john.firebaugh@gmail.com"},{name:"jrpruit1",email:"jake@jakepruitt.com"},{name:"karenzshea",email:"karen@mapbox.com"},{name:"kkaefer",email:"kkaefer@gmail.com"},{name:"lbud",email:"lauren@mapbox.com"},{name:"lucaswoj",email:"lucas@lucaswoj.com"},{name:"lxbarth",email:"alex@mapbox.com"},{name:"lyzidiamond",email:"lyzi@mapbox.com"},{name:"mapbox-admin",email:"accounts@mapbox.com"},{name:"mateov",email:"matt@mapbox.com"},{name:"mcwhittemore",email:"mcwhittemore@gmail.com"},{name:"miccolis",email:"jeff@miccolis.net"},{name:"mikemorris",email:"michael.patrick.morris@gmail.com"},{name:"morganherlocker",email:"morgan.herlocker@gmail.com"},{name:"mourner",email:"agafonkin@gmail.com"},{name:"nickidlugash",email:"nicki@mapbox.com"},{name:"rclark",email:"ryan.clark.j@gmail.com"},{name:"samanbb",email:"saman@mapbox.com"},{name:"sbma44",email:"tlee@mapbox.com"},{name:"scothis",email:"scothis@gmail.com"},{name:"sgillies",email:"sean@mapbox.com"},{name:"springmeyer",email:"dane@mapbox.com"},{name:"themarex",email:"patrick@mapbox.com"},{name:"tmcw",email:"tom@macwright.org"},{name:"tristen",email:"tristen.brown@gmail.com"},{name:"willwhite",email:"will@mapbox.com"},{name:"yhahn",email:"young@mapbox.com"}],name:"mapbox-gl",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git://github.com/mapbox/mapbox-gl-js.git"},scripts:{build:"npm run build-docs # invoked by publisher when publishing docs on the mb-pages branch","build-dev":"browserify js/mapbox-gl.js --debug --standalone mapboxgl > dist/mapbox-gl-dev.js && tap --no-coverage test/build/dev.test.js","build-docs":"documentation build --github --format html -c documentation.yml --theme ./docs/_theme --output docs/api/","build-min":"browserify js/mapbox-gl.js --debug -t unassertify --plugin [minifyify --map mapbox-gl.js.map --output dist/mapbox-gl.js.map] --standalone mapboxgl > dist/mapbox-gl.js && tap --no-coverage test/build/min.test.js","build-token":"browserify debug/access-token-src.js --debug -t envify > debug/access-token.js",lint:"eslint --ignore-path .gitignore js test bench docs/_posts/examples/*.html","open-changed-examples":"git diff --name-only mb-pages HEAD -- docs/_posts/examples/*.html | awk '{print \"http://127.0.0.1:4000/mapbox-gl-js/example/\" substr($0,33,length($0)-37)}' | xargs open",start:"run-p build-token watch-dev watch-bench start-server","start-bench":"run-p build-token watch-bench start-server","start-debug":"run-p build-token watch-dev start-server","start-docs":"npm run build-min && npm run build-docs && jekyll serve -w","start-server":"st --no-cache --localhost --port 9966 --index index.html .",test:"npm run lint && tap --reporter dot test/js/*/*.js test/build/webpack.test.js","test-suite":"node test/render.test.js && node test/query.test.js","watch-bench":"node bench/download-data.js && watchify bench/index.js --plugin [minifyify --no-map] -t [babelify --presets react] -t unassertify -t envify -o bench/bench.js -v","watch-dev":"watchify js/mapbox-gl.js --debug --standalone mapboxgl -o dist/mapbox-gl-dev.js -v"},version:"0.22.1"}},{}],445:[function(t,e,r){"use strict";function n(t,e,r){for(var n=new Array(t),i=0;ig[1][2]&&(b[0]=-b[0]),g[0][2]>g[2][0]&&(b[1]=-b[1]),g[1][0]>g[0][1]&&(b[2]=-b[2]),!0}},{"./normalize":447,"gl-mat4/clone":175,"gl-mat4/create":176,"gl-mat4/determinant":177,"gl-mat4/invert":181,"gl-mat4/transpose":191,"gl-vec3/cross":272,"gl-vec3/dot":273,"gl-vec3/length":274,"gl-vec3/normalize":276}],447:[function(t,e,r){e.exports=function(t,e){var r=e[15];if(0===r)return!1;for(var n=1/r,i=0;i<16;i++)t[i]=e[i]*n;return!0}},{}],448:[function(t,e,r){function n(t,e,r,n){if(0===c(e)||0===c(r))return!1;var i=u(e,f.translate,f.scale,f.skew,f.perspective,f.quaternion),a=u(r,d.translate,d.scale,d.skew,d.perspective,d.quaternion);return!(!i||!a)&&(s(p.translate,f.translate,d.translate,n),s(p.skew,f.skew,d.skew,n),s(p.scale,f.scale,d.scale,n),s(p.perspective,f.perspective,d.perspective,n),h(p.quaternion,f.quaternion,d.quaternion,n),l(t,p.translate,p.scale,p.skew,p.perspective,p.quaternion),!0)}function i(){return{translate:a(),scale:a(1),skew:a(),perspective:o(),quaternion:o()}}function a(t){return[t||0,t||0,t||0]}function o(){return[0,0,0,1]}var s=t("gl-vec3/lerp"),l=t("mat4-recompose"),u=t("mat4-decompose"),c=t("gl-mat4/determinant"),h=t("quat-slerp"),f=i(),d=i(),p=i();e.exports=n},{"gl-mat4/determinant":177,"gl-vec3/lerp":275,"mat4-decompose":446,"mat4-recompose":449,"quat-slerp":489}],449:[function(t,e,r){var n={identity:t("gl-mat4/identity"),translate:t("gl-mat4/translate"),multiply:t("gl-mat4/multiply"),create:t("gl-mat4/create"),scale:t("gl-mat4/scale"),fromRotationTranslation:t("gl-mat4/fromRotationTranslation")},i=(n.create(),n.create());e.exports=function(t,e,r,a,o,s){return n.identity(t),n.fromRotationTranslation(t,s,e),t[3]=o[0],t[7]=o[1],t[11]=o[2],t[15]=o[3],n.identity(i),0!==a[2]&&(i[9]=a[2],n.multiply(t,t,i)),0!==a[1]&&(i[9]=0,i[8]=a[1],n.multiply(t,t,i)),0!==a[0]&&(i[8]=0,i[4]=a[0],n.multiply(t,t,i)),n.scale(t,t,r),t}},{"gl-mat4/create":176,"gl-mat4/fromRotationTranslation":179,"gl-mat4/identity":180,"gl-mat4/multiply":183,"gl-mat4/scale":189,"gl-mat4/translate":190}],450:[function(t,e,r){"use strict";function n(t){this._components=t.slice(),this._time=[0],this.prevMatrix=t.slice(),this.nextMatrix=t.slice(),this.computedMatrix=t.slice(),this.computedInverse=t.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}function i(t){return t=t||{},new n(t.matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}var a=t("binary-search-bounds"),o=t("mat4-interpolate"),s=t("gl-mat4/invert"),l=t("gl-mat4/rotateX"),u=t("gl-mat4/rotateY"),c=t("gl-mat4/rotateZ"),h=t("gl-mat4/lookAt"),f=t("gl-mat4/translate"),d=(t("gl-mat4/scale"),t("gl-vec3/normalize")),p=[0,0,0];e.exports=i;var m=n.prototype;m.recalcMatrix=function(t){var e=this._time,r=a.le(e,t),n=this.computedMatrix;if(!(r<0)){var i=this._components;if(r===e.length-1)for(var l=16*r,u=0;u<16;++u)n[u]=i[l++];else{for(var c=e[r+1]-e[r],l=16*r,h=this.prevMatrix,f=!0,u=0;u<16;++u)h[u]=i[l++];for(var p=this.nextMatrix,u=0;u<16;++u)p[u]=i[l++],f=f&&h[u]===p[u];if(c<1e-6||f)for(var u=0;u<16;++u)n[u]=h[u];else o(n,h,p,(t-e[r])/c)}var m=this.computedUp;m[0]=n[1],m[1]=n[5],m[2]=n[9],d(m,m);var g=this.computedInverse;s(g,n);var v=this.computedEye,y=g[15];v[0]=g[12]/y,v[1]=g[13]/y,v[2]=g[14]/y;for(var b=this.computedCenter,x=Math.exp(this.computedRadius[0]),u=0;u<3;++u)b[u]=v[u]-n[2+4*u]*x}},m.idle=function(t){if(!(t1&&i(t[o[c-2]],t[o[c-1]],u)<=0;)c-=1,o.pop();for(o.push(l),c=s.length;c>1&&i(t[s[c-2]],t[s[c-1]],u)>=0;)c-=1,s.pop();s.push(l)}for(var r=new Array(s.length+o.length-2),h=0,n=0,f=o.length;n0;--d)r[h++]=s[d];return r}e.exports=n;var i=t("robust-orientation")[3]},{"robust-orientation":508}],452:[function(t,e,r){"use strict";function n(t,e){function r(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==g.alt,g.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==g.shift,g.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==g.control,g.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==g.meta,g.meta=!!t.metaKey),e}function n(t,n){var a=i.x(n),o=i.y(n);"buttons"in n&&(t=0|n.buttons),(t!==d||a!==p||o!==m||r(n))&&(d=0|t,p=a||0,m=o||0,e&&e(d,p,m,g))}function a(t){n(0,t)}function o(){(d||p||m||g.shift||g.alt||g.meta||g.control)&&(p=m=0,d=0,g.shift=g.alt=g.control=g.meta=!1,e&&e(0,0,0,g))}function s(t){r(t)&&e&&e(d,p,m,g)}function l(t){0===i.buttons(t)?n(0,t):n(d,t)}function u(t){n(d|i.buttons(t),t)}function c(t){n(d&~i.buttons(t),t)}function h(){v||(v=!0,t.addEventListener("mousemove",l),t.addEventListener("mousedown",u),t.addEventListener("mouseup",c),t.addEventListener("mouseleave",a),t.addEventListener("mouseenter",a),t.addEventListener("mouseout",a),t.addEventListener("mouseover",a),t.addEventListener("blur",o),t.addEventListener("keyup",s),t.addEventListener("keydown",s),t.addEventListener("keypress",s),t!==window&&(window.addEventListener("blur",o),window.addEventListener("keyup",s),window.addEventListener("keydown",s),window.addEventListener("keypress",s)))}function f(){v&&(v=!1,t.removeEventListener("mousemove",l),t.removeEventListener("mousedown",u),t.removeEventListener("mouseup",c),t.removeEventListener("mouseleave",a),t.removeEventListener("mouseenter",a),t.removeEventListener("mouseout",a),t.removeEventListener("mouseover",a),t.removeEventListener("blur",o),t.removeEventListener("keyup",s),t.removeEventListener("keydown",s),t.removeEventListener("keypress",s),t!==window&&(window.removeEventListener("blur",o),window.removeEventListener("keyup",s),window.removeEventListener("keydown",s),window.removeEventListener("keypress",s)))}e||(e=t,t=window);var d=0,p=0,m=0,g={shift:!1,alt:!1,control:!1,meta:!1},v=!1;h();var y={element:t};return Object.defineProperties(y,{enabled:{get:function(){return v},set:function(t){t?h():f()},enumerable:!0},buttons:{get:function(){return d},enumerable:!0},x:{get:function(){return p},enumerable:!0},y:{get:function(){return m},enumerable:!0},mods:{get:function(){return g},enumerable:!0}}),y}e.exports=n;var i=t("mouse-event")},{"mouse-event":454}],453:[function(t,e,r){function n(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var n=t.clientX||0,a=t.clientY||0,o=i(e);return r[0]=n-o.left,r[1]=a-o.top,r}function i(t){return t===window||t===document||t===document.body?a:t.getBoundingClientRect()}var a={left:0,top:0};e.exports=n},{}],454:[function(t,e,r){"use strict";function n(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){var e=t.which;if(2===e)return 4;if(3===e)return 2;if(e>0)return 1<=0)return 1<=0;--e)L(e,0);for(var r=[],e=0;e0;_=_-1&m)x.push(w+"["+T+"+"+g(_)+"]");x.push(v(0));for(var _=0;_0){",f(x[t]),"=1;"),P(t-1,e|1<0&&G.push(s(U,x[V-1])+"*"+o(x[V-1])),N.push(d(U,x[V])+"=("+G.join("-")+")|0")}for(var U=0;U=0;--U)Y.push(o(x[U]));N.push(A+"=("+Y.join("*")+")|0",M+"=mallocUint32("+A+")",w+"=mallocUint32("+A+")",T+"=0"),N.push(p(0)+"=0");for(var V=1;V<1< 0"), -"function"!=typeof t.vertex&&e("Must specify vertex creation function"),"function"!=typeof t.cell&&e("Must specify cell creation function"),"function"!=typeof t.phase&&e("Must specify phase function");for(var a=t.getters||[],o=new Array(n),s=0;s=0?o[s]=!0:o[s]=!1;return b(t.vertex,t.cell,t.phase,i,r,o)}var _=t("typedarray-pool");e.exports=x;var w="V",M="P",k="N",A="Q",T="X",S="T"},{"typedarray-pool":541}],457:[function(t,e,r){"use strict";var n=t("cwise/lib/wrapper")({args:["index","array","scalar"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{_inline_1_arg1_=_inline_1_arg2_.apply(void 0,_inline_1_arg0_)}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"cwise",blockSize:64});e.exports=function(t,e){return n(t,e),t}},{"cwise/lib/wrapper":113}],458:[function(t,e,r){"use strict";function n(t){if(t in l)return l[t];for(var e=[],r=0;r=0?s.push("0"):e.indexOf(-(l+1))>=0?s.push("s["+l+"]-1"):(s.push("-1"),n.push("1"),o.push("s["+l+"]-2"));var u=".lo("+n.join()+").hi("+o.join()+")";if(0===n.length&&(u=""),r>0){a.push("if(1");for(var l=0;l=0||e.indexOf(-(l+1))>=0||a.push("&&s[",l,"]>2");a.push("){grad",r,"(src.pick(",s.join(),")",u);for(var l=0;l=0||e.indexOf(-(l+1))>=0||a.push(",dst.pick(",s.join(),",",l,")",u);a.push(");")}for(var l=0;l1){dst.set(",s.join(),",",c,",0.5*(src.get(",f.join(),")-src.get(",d.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):a.push("if(s[",c,"]>1){diff(",h,",src.pick(",f.join(),")",u,",src.pick(",d.join(),")",u,");}else{zero(",h,");};");break;case"mirror":0===r?a.push("dst.set(",s.join(),",",c,",0);"):a.push("zero(",h,");");break;case"wrap":var p=s.slice(),m=s.slice();e[l]<0?(p[c]="s["+c+"]-2",m[c]="0"):(p[c]="s["+c+"]-1",m[c]="1"),0===r?a.push("if(s[",c,"]>2){dst.set(",s.join(),",",c,",0.5*(src.get(",p.join(),")-src.get(",m.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):a.push("if(s[",c,"]>2){diff(",h,",src.pick(",p.join(),")",u,",src.pick(",m.join(),")",u,");}else{zero(",h,");};");break;default:throw new Error("ndarray-gradient: Invalid boundary condition")}}r>0&&a.push("};")}(p)}}a.push("return dst;};return gradient");for(var m=["diff","zero"],g=[h,f],o=1;o<=i;++o)m.push("grad"+o),g.push(n(o));m.push(a.join(""));var v=Function.apply(void 0,m),r=v.apply(void 0,g);return l[e]=r,r}function a(t,e,r){if(Array.isArray(r)){if(r.length!==e.dimension)throw new Error("ndarray-gradient: invalid boundary conditions")}else r="string"==typeof r?o(e.dimension,r):o(e.dimension,"clamp");if(t.dimension!==e.dimension+1)throw new Error("ndarray-gradient: output dimension must be +1 input dimension");if(t.shape[e.dimension]!==e.dimension)throw new Error("ndarray-gradient: output shape must match input shape");for(var n=0;n>",rrshift:">>>"};!function(){for(var t in l){var e=l[t];r[t]=a({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"eq"]=a({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),r[t+"s"]=a({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"seq"]=a({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var u={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in u){var e=u[t];r[t]=a({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),r[t+"eq"]=a({args:["array"],body:{args:["a"],body:"a="+e+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var c={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in c){var e=c[t];r[t]=a({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"s"]=a({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"eq"]=a({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=a({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var h=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;tthis_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=o({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=o({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=o({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=a({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=a({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=a({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=o({args:["array","array"],pre:s,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{"cwise-compiler":110}],462:[function(t,e,r){"use strict";var n=t("ndarray"),i=t("./doConvert.js");e.exports=function(t,e){for(var r=[],a=t,o=1;Array.isArray(a);)r.push(a.length),o*=a.length,a=a[0];return 0===r.length?n():(e||(e=n(new Float64Array(o),r)),i(e,t),e)}},{"./doConvert.js":463,ndarray:467}],463:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}",args:[{name:"_inline_1_arg0_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":110}],464:[function(t,e,r){"use strict";function n(t){switch(t){case"uint8":return[l.mallocUint8,l.freeUint8];case"uint16":return[l.mallocUint16,l.freeUint16];case"uint32":return[l.mallocUint32,l.freeUint32];case"int8":return[l.mallocInt8,l.freeInt8];case"int16":return[l.mallocInt16,l.freeInt16];case"int32":return[l.mallocInt32,l.freeInt32];case"float32":return[l.mallocFloat,l.freeFloat];case"float64":return[l.mallocDouble,l.freeDouble];default:return null}}function i(t){for(var e=[],r=0;r1){for(var h=[],f=1;f1){o.push("dptr=0;sptr=ptr");for(var f=t.length-1;f>=0;--f){var d=t[f];0!==d&&o.push(["for(i",d,"=0;i",d,"b){break __l}"].join(""));for(var f=t.length-1;f>=1;--f)o.push("sptr+=e"+f,"dptr+=f"+f,"}");o.push("dptr=cptr;sptr=cptr-s0");for(var f=t.length-1;f>=0;--f){var d=t[f];0!==d&&o.push(["for(i",d,"=0;i",d,"=0;--f){var d=t[f];0!==d&&o.push(["for(i",d,"=0;i",d,"scratch)){",a("cptr",r("cptr-s0")),"cptr-=s0","}",a("cptr","scratch"));if(o.push("}"),t.length>1&&u&&o.push("free(scratch)"),o.push("} return "+s),u){var p=new Function("malloc","free",o.join("\n"));return p(u[0],u[1])}var p=new Function(o.join("\n"));return p()}function o(t,e,r){function a(t){return["(offset+",t,"*s0)"].join("")}function o(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function s(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}function l(e,r,n){if(1===e.length)_.push("ptr0="+a(e[0]));else for(var i=0;i=0;--i){var o=t[i];0!==o&&_.push(["for(i",o,"=0;i",o,"1)for(var i=0;i1?_.push("ptr_shift+=d"+o):_.push("ptr0+=d"+o),_.push("}"))}}function c(e,r,n,i){if(1===r.length)_.push("ptr0="+a(r[0]));else{for(var o=0;o1)for(var o=0;o=1;--o)n&&_.push("pivot_ptr+=f"+o),r.length>1?_.push("ptr_shift+=e"+o):_.push("ptr0+=e"+o),_.push("}")}function h(){t.length>1&&k&&_.push("free(pivot1)","free(pivot2)")}function f(e,r){var n="el"+e,i="el"+r;if(t.length>1){var s="__l"+ ++A;c(s,[n,i],!1,["comp=",o("ptr0"),"-",o("ptr1"),"\n","if(comp>0){tmp0=",n,";",n,"=",i,";",i,"=tmp0;break ",s,"}\n","if(comp<0){break ",s,"}"].join(""))}else _.push(["if(",o(a(n)),">",o(a(i)),"){tmp0=",n,";",n,"=",i,";",i,"=tmp0}"].join(""))}function d(e,r){t.length>1?l([e,r],!1,s("ptr0",o("ptr1"))):_.push(s(a(e),o(a(r))))}function p(e,r,n){if(t.length>1){var i="__l"+ ++A;c(i,[r],!0,[e,"=",o("ptr0"),"-pivot",n,"[pivot_ptr]\n","if(",e,"!==0){break ",i,"}"].join(""))}else _.push([e,"=",o(a(r)),"-pivot",n].join(""))}function m(e,r){t.length>1?l([e,r],!1,["tmp=",o("ptr0"),"\n",s("ptr0",o("ptr1")),"\n",s("ptr1","tmp")].join("")):_.push(["ptr0=",a(e),"\n","ptr1=",a(r),"\n","tmp=",o("ptr0"),"\n",s("ptr0",o("ptr1")),"\n",s("ptr1","tmp")].join(""))}function g(e,r,n){t.length>1?(l([e,r,n],!1,["tmp=",o("ptr0"),"\n",s("ptr0",o("ptr1")),"\n",s("ptr1",o("ptr2")),"\n",s("ptr2","tmp")].join("")),_.push("++"+r,"--"+n)):_.push(["ptr0=",a(e),"\n","ptr1=",a(r),"\n","ptr2=",a(n),"\n","++",r,"\n","--",n,"\n","tmp=",o("ptr0"),"\n",s("ptr0",o("ptr1")),"\n",s("ptr1",o("ptr2")),"\n",s("ptr2","tmp")].join(""))}function v(t,e){m(t,e),_.push("--"+e)}function y(e,r,n){t.length>1?l([e,r],!0,[s("ptr0",o("ptr1")),"\n",s("ptr1",["pivot",n,"[pivot_ptr]"].join(""))].join("")):_.push(s(a(e),o(a(r))),s(a(r),"pivot"+n))}function b(e,r){_.push(["if((",r,"-",e,")<=",u,"){\n","insertionSort(",e,",",r,",data,offset,",i(t.length).join(","),")\n","}else{\n",w,"(",e,",",r,",data,offset,",i(t.length).join(","),")\n","}"].join(""))}function x(e,r,n){t.length>1?(_.push(["__l",++A,":while(true){"].join("")),l([e],!0,["if(",o("ptr0"),"!==pivot",r,"[pivot_ptr]){break __l",A,"}"].join("")),_.push(n,"}")):_.push(["while(",o(a(e)),"===pivot",r,"){",n,"}"].join(""))}var _=["'use strict'"],w=["ndarrayQuickSort",t.join("d"),e].join(""),M=["left","right","data","offset"].concat(i(t.length)),k=n(e),A=0;_.push(["function ",w,"(",M.join(","),"){"].join(""));var T=["sixth=((right-left+1)/6)|0","index1=left+sixth","index5=right-sixth","index3=(left+right)>>1","index2=index3-sixth","index4=index3+sixth","el1=index1","el2=index2","el3=index3","el4=index4","el5=index5","less=left+1","great=right-1","pivots_are_equal=true","tmp","tmp0","x","y","z","k","ptr0","ptr1","ptr2","comp_pivot1=0","comp_pivot2=0","comp=0"];if(t.length>1){for(var S=[],E=1;E1?l(["el1","el2","el3","el4","el5","index1","index3","index5"],!0,["pivot1[pivot_ptr]=",o("ptr1"),"\n","pivot2[pivot_ptr]=",o("ptr3"),"\n","pivots_are_equal=pivots_are_equal&&(pivot1[pivot_ptr]===pivot2[pivot_ptr])\n","x=",o("ptr0"),"\n","y=",o("ptr2"),"\n","z=",o("ptr4"),"\n",s("ptr5","x"),"\n",s("ptr6","y"),"\n",s("ptr7","z")].join("")):_.push(["pivot1=",o(a("el2")),"\n","pivot2=",o(a("el4")),"\n","pivots_are_equal=pivot1===pivot2\n","x=",o(a("el1")),"\n","y=",o(a("el3")),"\n","z=",o(a("el5")),"\n",s(a("index1"),"x"),"\n",s(a("index3"),"y"),"\n",s(a("index5"),"z")].join("")),d("index2","left"),d("index4","right"),_.push("if(pivots_are_equal){"),_.push("for(k=less;k<=great;++k){"),p("comp","k",1),_.push("if(comp===0){continue}"),_.push("if(comp<0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),_.push("while(true){"),p("comp","great",1),_.push("if(comp>0){"),_.push("great--"),_.push("}else if(comp<0){"),g("k","less","great"),_.push("break"),_.push("}else{"),v("k","great"),_.push("break"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}else{"),_.push("for(k=less;k<=great;++k){"),p("comp_pivot1","k",1),_.push("if(comp_pivot1<0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),p("comp_pivot2","k",2),_.push("if(comp_pivot2>0){"),_.push("while(true){"),p("comp","great",2),_.push("if(comp>0){"),_.push("if(--greatindex5){"),x("less",1,"++less"),x("great",2,"--great"),_.push("for(k=less;k<=great;++k){"),p("comp_pivot1","k",1),_.push("if(comp_pivot1===0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),p("comp_pivot2","k",2),_.push("if(comp_pivot2===0){"),_.push("while(true){"),p("comp","great",2),_.push("if(comp===0){"),_.push("if(--great1&&k){var L=new Function("insertionSort","malloc","free",_.join("\n"));return L(r,k[0],k[1])}var L=new Function("insertionSort",_.join("\n"));return L(r)}function s(t,e){var r=["'use strict'"],n=["ndarraySortWrapper",t.join("d"),e].join(""),s=["array"];r.push(["function ",n,"(",s.join(","),"){"].join(""));for(var l=["data=array.data,offset=array.offset|0,shape=array.shape,stride=array.stride"],c=0;c0?l.push(["d",g,"=s",g,"-d",p,"*n",p].join("")):l.push(["d",g,"=s",g].join("")),p=g);var d=t.length-1-c;0!==d&&(m>0?l.push(["e",d,"=s",d,"-e",m,"*n",m,",f",d,"=",h[d],"-f",m,"*n",m].join("")):l.push(["e",d,"=s",d,",f",d,"=",h[d]].join("")),m=d)}r.push("var "+l.join(","));var v=["0","n0-1","data","offset"].concat(i(t.length));r.push(["if(n0<=",u,"){","insertionSort(",v.join(","),")}else{","quickSort(",v.join(","),")}"].join("")),r.push("}return "+n);var y=new Function("insertionSort","quickSort",r.join("\n")),b=a(t,e);return y(b,o(t,e,b))}var l=t("typedarray-pool"),u=32;e.exports=s},{"typedarray-pool":541}],465:[function(t,e,r){"use strict";function n(t){var e=t.order,r=t.dtype,n=[e,r],o=n.join(":"),s=a[o];return s||(a[o]=s=i(e,r)),s(t),t}var i=t("./lib/compile_sort.js"),a={};e.exports=n},{"./lib/compile_sort.js":464}],466:[function(t,e,r){"use strict";var n=t("ndarray-linear-interpolate"),i=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=new Array(_inline_9_arg4_)}",args:[{name:"_inline_9_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg2_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg3_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_10_arg2_(this_warped,_inline_10_arg0_),_inline_10_arg1_=_inline_10_arg3_.apply(void 0,this_warped)}",args:[{name:"_inline_10_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_10_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg4_",lvalue:!1,rvalue:!1,count:0}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warpND",blockSize:64}),a=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_13_arg2_(this_warped,_inline_13_arg0_),_inline_13_arg1_=_inline_13_arg3_(_inline_13_arg4_,this_warped[0])}",args:[{name:"_inline_13_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_13_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp1D",blockSize:64}),o=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_16_arg2_(this_warped,_inline_16_arg0_),_inline_16_arg1_=_inline_16_arg3_(_inline_16_arg4_,this_warped[0],this_warped[1])}",args:[{name:"_inline_16_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_16_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp2D",blockSize:64}),s=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_19_arg2_(this_warped,_inline_19_arg0_),_inline_19_arg1_=_inline_19_arg3_(_inline_19_arg4_,this_warped[0],this_warped[1],this_warped[2])}",args:[{name:"_inline_19_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_19_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp3D",blockSize:64});e.exports=function(t,e,r){switch(e.shape.length){case 1:a(t,r,n.d1,e);break;case 2:o(t,r,n.d2,e);break;case 3:s(t,r,n.d3,e);break;default:i(t,r,n.bind(void 0,e),e.shape.length)}return t}},{"cwise/lib/wrapper":113,"ndarray-linear-interpolate":460}],467:[function(t,e,r){function n(t,e){return t[0]-e[0]}function i(){var t,e=this.stride,r=new Array(e.length);for(t=0;t=0?o[s]=!0:o[s]=!1;return b(t.vertex,t.cell,t.phase,i,r,o)}var _=t("typedarray-pool");e.exports=x;var w="V",M="P",k="N",A="Q",T="X",S="T"},{"typedarray-pool":541}],457:[function(t,e,r){"use strict";var n=t("cwise/lib/wrapper")({args:["index","array","scalar"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{_inline_4_arg1_=_inline_4_arg2_.apply(void 0,_inline_4_arg0_)}",args:[{name:"_inline_4_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_4_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_4_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"cwise",blockSize:64});e.exports=function(t,e){return n(t,e),t}},{"cwise/lib/wrapper":113}],458:[function(t,e,r){"use strict";function n(t){if(t in l)return l[t];for(var e=[],r=0;r=0?s.push("0"):e.indexOf(-(l+1))>=0?s.push("s["+l+"]-1"):(s.push("-1"),n.push("1"),o.push("s["+l+"]-2"));var u=".lo("+n.join()+").hi("+o.join()+")";if(0===n.length&&(u=""),r>0){a.push("if(1");for(var l=0;l=0||e.indexOf(-(l+1))>=0||a.push("&&s[",l,"]>2");a.push("){grad",r,"(src.pick(",s.join(),")",u);for(var l=0;l=0||e.indexOf(-(l+1))>=0||a.push(",dst.pick(",s.join(),",",l,")",u);a.push(");")}for(var l=0;l1){dst.set(",s.join(),",",c,",0.5*(src.get(",f.join(),")-src.get(",d.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):a.push("if(s[",c,"]>1){diff(",h,",src.pick(",f.join(),")",u,",src.pick(",d.join(),")",u,");}else{zero(",h,");};");break;case"mirror":0===r?a.push("dst.set(",s.join(),",",c,",0);"):a.push("zero(",h,");");break;case"wrap":var p=s.slice(),m=s.slice();e[l]<0?(p[c]="s["+c+"]-2",m[c]="0"):(p[c]="s["+c+"]-1",m[c]="1"),0===r?a.push("if(s[",c,"]>2){dst.set(",s.join(),",",c,",0.5*(src.get(",p.join(),")-src.get(",m.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):a.push("if(s[",c,"]>2){diff(",h,",src.pick(",p.join(),")",u,",src.pick(",m.join(),")",u,");}else{zero(",h,");};");break;default:throw new Error("ndarray-gradient: Invalid boundary condition")}}r>0&&a.push("};")}(p)}}a.push("return dst;};return gradient");for(var m=["diff","zero"],g=[h,f],o=1;o<=i;++o)m.push("grad"+o),g.push(n(o));m.push(a.join(""));var v=Function.apply(void 0,m),r=v.apply(void 0,g);return l[e]=r,r}function a(t,e,r){if(Array.isArray(r)){if(r.length!==e.dimension)throw new Error("ndarray-gradient: invalid boundary conditions")}else r="string"==typeof r?o(e.dimension,r):o(e.dimension,"clamp");if(t.dimension!==e.dimension+1)throw new Error("ndarray-gradient: output dimension must be +1 input dimension");if(t.shape[e.dimension]!==e.dimension)throw new Error("ndarray-gradient: output shape must match input shape");for(var n=0;n>",rrshift:">>>"};!function(){for(var t in l){var e=l[t];r[t]=a({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"eq"]=a({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),r[t+"s"]=a({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"seq"]=a({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var u={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in u){var e=u[t];r[t]=a({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),r[t+"eq"]=a({args:["array"],body:{args:["a"],body:"a="+e+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var c={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in c){var e=c[t];r[t]=a({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"s"]=a({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"eq"]=a({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=a({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var h=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;tthis_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=o({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=o({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=o({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=a({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=a({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=a({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=o({args:["array","array"],pre:s,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{"cwise-compiler":110}],462:[function(t,e,r){"use strict";var n=t("ndarray"),i=t("./doConvert.js");e.exports=function(t,e){for(var r=[],a=t,o=1;Array.isArray(a);)r.push(a.length),o*=a.length,a=a[0];return 0===r.length?n():(e||(e=n(new Float64Array(o),r)),i(e,t),e)}},{"./doConvert.js":463,ndarray:467}],463:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}",args:[{name:"_inline_1_arg0_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":110}],464:[function(t,e,r){"use strict";function n(t){switch(t){case"uint8":return[l.mallocUint8,l.freeUint8];case"uint16":return[l.mallocUint16,l.freeUint16];case"uint32":return[l.mallocUint32,l.freeUint32];case"int8":return[l.mallocInt8,l.freeInt8];case"int16":return[l.mallocInt16,l.freeInt16];case"int32":return[l.mallocInt32,l.freeInt32];case"float32":return[l.mallocFloat,l.freeFloat];case"float64":return[l.mallocDouble,l.freeDouble];default:return null}}function i(t){for(var e=[],r=0;r1){for(var h=[],f=1;f1){o.push("dptr=0;sptr=ptr");for(var f=t.length-1;f>=0;--f){var d=t[f];0!==d&&o.push(["for(i",d,"=0;i",d,"b){break __l}"].join(""));for(var f=t.length-1;f>=1;--f)o.push("sptr+=e"+f,"dptr+=f"+f,"}");o.push("dptr=cptr;sptr=cptr-s0");for(var f=t.length-1;f>=0;--f){var d=t[f];0!==d&&o.push(["for(i",d,"=0;i",d,"=0;--f){var d=t[f];0!==d&&o.push(["for(i",d,"=0;i",d,"scratch)){",a("cptr",r("cptr-s0")),"cptr-=s0","}",a("cptr","scratch"));if(o.push("}"),t.length>1&&u&&o.push("free(scratch)"),o.push("} return "+s),u){var p=new Function("malloc","free",o.join("\n"));return p(u[0],u[1])}var p=new Function(o.join("\n"));return p()}function o(t,e,r){function a(t){return["(offset+",t,"*s0)"].join("")}function o(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function s(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}function l(e,r,n){if(1===e.length)_.push("ptr0="+a(e[0]));else for(var i=0;i=0;--i){var o=t[i];0!==o&&_.push(["for(i",o,"=0;i",o,"1)for(var i=0;i1?_.push("ptr_shift+=d"+o):_.push("ptr0+=d"+o),_.push("}"))}}function c(e,r,n,i){if(1===r.length)_.push("ptr0="+a(r[0]));else{for(var o=0;o1)for(var o=0;o=1;--o)n&&_.push("pivot_ptr+=f"+o),r.length>1?_.push("ptr_shift+=e"+o):_.push("ptr0+=e"+o),_.push("}")}function h(){t.length>1&&k&&_.push("free(pivot1)","free(pivot2)")}function f(e,r){var n="el"+e,i="el"+r;if(t.length>1){var s="__l"+ ++A;c(s,[n,i],!1,["comp=",o("ptr0"),"-",o("ptr1"),"\n","if(comp>0){tmp0=",n,";",n,"=",i,";",i,"=tmp0;break ",s,"}\n","if(comp<0){break ",s,"}"].join(""))}else _.push(["if(",o(a(n)),">",o(a(i)),"){tmp0=",n,";",n,"=",i,";",i,"=tmp0}"].join(""))}function d(e,r){t.length>1?l([e,r],!1,s("ptr0",o("ptr1"))):_.push(s(a(e),o(a(r))))}function p(e,r,n){if(t.length>1){var i="__l"+ ++A;c(i,[r],!0,[e,"=",o("ptr0"),"-pivot",n,"[pivot_ptr]\n","if(",e,"!==0){break ",i,"}"].join(""))}else _.push([e,"=",o(a(r)),"-pivot",n].join(""))}function m(e,r){t.length>1?l([e,r],!1,["tmp=",o("ptr0"),"\n",s("ptr0",o("ptr1")),"\n",s("ptr1","tmp")].join("")):_.push(["ptr0=",a(e),"\n","ptr1=",a(r),"\n","tmp=",o("ptr0"),"\n",s("ptr0",o("ptr1")),"\n",s("ptr1","tmp")].join(""))}function g(e,r,n){t.length>1?(l([e,r,n],!1,["tmp=",o("ptr0"),"\n",s("ptr0",o("ptr1")),"\n",s("ptr1",o("ptr2")),"\n",s("ptr2","tmp")].join("")),_.push("++"+r,"--"+n)):_.push(["ptr0=",a(e),"\n","ptr1=",a(r),"\n","ptr2=",a(n),"\n","++",r,"\n","--",n,"\n","tmp=",o("ptr0"),"\n",s("ptr0",o("ptr1")),"\n",s("ptr1",o("ptr2")),"\n",s("ptr2","tmp")].join(""))}function v(t,e){m(t,e),_.push("--"+e)}function y(e,r,n){t.length>1?l([e,r],!0,[s("ptr0",o("ptr1")),"\n",s("ptr1",["pivot",n,"[pivot_ptr]"].join(""))].join("")):_.push(s(a(e),o(a(r))),s(a(r),"pivot"+n))}function b(e,r){_.push(["if((",r,"-",e,")<=",u,"){\n","insertionSort(",e,",",r,",data,offset,",i(t.length).join(","),")\n","}else{\n",w,"(",e,",",r,",data,offset,",i(t.length).join(","),")\n","}"].join(""))}function x(e,r,n){t.length>1?(_.push(["__l",++A,":while(true){"].join("")),l([e],!0,["if(",o("ptr0"),"!==pivot",r,"[pivot_ptr]){break __l",A,"}"].join("")),_.push(n,"}")):_.push(["while(",o(a(e)),"===pivot",r,"){",n,"}"].join(""))}var _=["'use strict'"],w=["ndarrayQuickSort",t.join("d"),e].join(""),M=["left","right","data","offset"].concat(i(t.length)),k=n(e),A=0;_.push(["function ",w,"(",M.join(","),"){"].join(""));var T=["sixth=((right-left+1)/6)|0","index1=left+sixth","index5=right-sixth","index3=(left+right)>>1","index2=index3-sixth","index4=index3+sixth","el1=index1","el2=index2","el3=index3","el4=index4","el5=index5","less=left+1","great=right-1","pivots_are_equal=true","tmp","tmp0","x","y","z","k","ptr0","ptr1","ptr2","comp_pivot1=0","comp_pivot2=0","comp=0"];if(t.length>1){for(var S=[],E=1;E1?l(["el1","el2","el3","el4","el5","index1","index3","index5"],!0,["pivot1[pivot_ptr]=",o("ptr1"),"\n","pivot2[pivot_ptr]=",o("ptr3"),"\n","pivots_are_equal=pivots_are_equal&&(pivot1[pivot_ptr]===pivot2[pivot_ptr])\n","x=",o("ptr0"),"\n","y=",o("ptr2"),"\n","z=",o("ptr4"),"\n",s("ptr5","x"),"\n",s("ptr6","y"),"\n",s("ptr7","z")].join("")):_.push(["pivot1=",o(a("el2")),"\n","pivot2=",o(a("el4")),"\n","pivots_are_equal=pivot1===pivot2\n","x=",o(a("el1")),"\n","y=",o(a("el3")),"\n","z=",o(a("el5")),"\n",s(a("index1"),"x"),"\n",s(a("index3"),"y"),"\n",s(a("index5"),"z")].join("")),d("index2","left"),d("index4","right"),_.push("if(pivots_are_equal){"),_.push("for(k=less;k<=great;++k){"),p("comp","k",1),_.push("if(comp===0){continue}"),_.push("if(comp<0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),_.push("while(true){"),p("comp","great",1),_.push("if(comp>0){"),_.push("great--"),_.push("}else if(comp<0){"),g("k","less","great"),_.push("break"),_.push("}else{"),v("k","great"),_.push("break"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}else{"),_.push("for(k=less;k<=great;++k){"),p("comp_pivot1","k",1),_.push("if(comp_pivot1<0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),p("comp_pivot2","k",2),_.push("if(comp_pivot2>0){"),_.push("while(true){"),p("comp","great",2),_.push("if(comp>0){"),_.push("if(--greatindex5){"),x("less",1,"++less"),x("great",2,"--great"),_.push("for(k=less;k<=great;++k){"),p("comp_pivot1","k",1),_.push("if(comp_pivot1===0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),p("comp_pivot2","k",2),_.push("if(comp_pivot2===0){"),_.push("while(true){"),p("comp","great",2),_.push("if(comp===0){"),_.push("if(--great1&&k){var L=new Function("insertionSort","malloc","free",_.join("\n"));return L(r,k[0],k[1])}var L=new Function("insertionSort",_.join("\n"));return L(r)}function s(t,e){var r=["'use strict'"],n=["ndarraySortWrapper",t.join("d"),e].join(""),s=["array"];r.push(["function ",n,"(",s.join(","),"){"].join(""));for(var l=["data=array.data,offset=array.offset|0,shape=array.shape,stride=array.stride"],c=0;c0?l.push(["d",g,"=s",g,"-d",p,"*n",p].join("")):l.push(["d",g,"=s",g].join("")),p=g);var d=t.length-1-c;0!==d&&(m>0?l.push(["e",d,"=s",d,"-e",m,"*n",m,",f",d,"=",h[d],"-f",m,"*n",m].join("")):l.push(["e",d,"=s",d,",f",d,"=",h[d]].join("")),m=d)}r.push("var "+l.join(","));var v=["0","n0-1","data","offset"].concat(i(t.length));r.push(["if(n0<=",u,"){","insertionSort(",v.join(","),")}else{","quickSort(",v.join(","),")}"].join("")),r.push("}return "+n);var y=new Function("insertionSort","quickSort",r.join("\n")),b=a(t,e);return y(b,o(t,e,b))}var l=t("typedarray-pool"),u=32;e.exports=s},{"typedarray-pool":541}],465:[function(t,e,r){"use strict";function n(t){var e=t.order,r=t.dtype,n=[e,r],o=n.join(":"),s=a[o];return s||(a[o]=s=i(e,r)),s(t),t}var i=t("./lib/compile_sort.js"),a={};e.exports=n},{"./lib/compile_sort.js":464}],466:[function(t,e,r){"use strict";var n=t("ndarray-linear-interpolate"),i=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=new Array(_inline_21_arg4_)}",args:[{name:"_inline_21_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_21_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_21_arg2_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_21_arg3_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_21_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_22_arg2_(this_warped,_inline_22_arg0_),_inline_22_arg1_=_inline_22_arg3_.apply(void 0,this_warped)}",args:[{name:"_inline_22_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_22_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_22_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_22_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_22_arg4_",lvalue:!1,rvalue:!1,count:0}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warpND",blockSize:64}),a=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_25_arg2_(this_warped,_inline_25_arg0_),_inline_25_arg1_=_inline_25_arg3_(_inline_25_arg4_,this_warped[0])}",args:[{name:"_inline_25_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_25_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_25_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_25_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_25_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp1D",blockSize:64}),o=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_28_arg2_(this_warped,_inline_28_arg0_),_inline_28_arg1_=_inline_28_arg3_(_inline_28_arg4_,this_warped[0],this_warped[1])}",args:[{name:"_inline_28_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_28_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_28_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_28_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_28_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp2D",blockSize:64}),s=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_31_arg2_(this_warped,_inline_31_arg0_),_inline_31_arg1_=_inline_31_arg3_(_inline_31_arg4_,this_warped[0],this_warped[1],this_warped[2])}",args:[{name:"_inline_31_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_31_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_31_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_31_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_31_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp3D",blockSize:64});e.exports=function(t,e,r){switch(e.shape.length){case 1:a(t,r,n.d1,e);break;case 2:o(t,r,n.d2,e);break;case 3:s(t,r,n.d3,e);break;default:i(t,r,n.bind(void 0,e),e.shape.length)}return t}},{"cwise/lib/wrapper":113,"ndarray-linear-interpolate":460}],467:[function(t,e,r){function n(t,e){return t[0]-e[0]}function i(){var t,e=this.stride,r=new Array(e.length);for(t=0;tMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&a.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):a.push("ORDER})")),a.push("proto.set=function "+r+"_set("+u.join(",")+",v){"),n?a.push("return this.data.set("+c+",v)}"):a.push("return this.data["+c+"]=v}"),a.push("proto.get=function "+r+"_get("+u.join(",")+"){"),n?a.push("return this.data.get("+c+")}"):a.push("return this.data["+c+"]}"),a.push("proto.index=function "+r+"_index(",u.join(),"){return "+c+"}"),a.push("proto.hi=function "+r+"_hi("+u.join(",")+"){return new "+r+"(this.data,"+s.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+s.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var p=s.map(function(t){return"a"+t+"=this.shape["+t+"]"}),m=s.map(function(t){return"c"+t+"=this.stride["+t+"]"});a.push("proto.lo=function "+r+"_lo("+u.join(",")+"){var b=this.offset,d=0,"+p.join(",")+","+m.join(","));for(var g=0;g=0){d=i"+g+"|0;b+=c"+g+"*d;a"+g+"-=d}");a.push("return new "+r+"(this.data,"+s.map(function(t){return"a"+t}).join(",")+","+s.map(function(t){return"c"+t}).join(",")+",b)}"),a.push("proto.step=function "+r+"_step("+u.join(",")+"){var "+s.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+s.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(var g=0;g=0){c=(c+this.stride["+g+"]*i"+g+")|0}else{a.push(this.shape["+g+"]);b.push(this.stride["+g+"])}");a.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),a.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+s.map(function(t){return"shape["+t+"]"}).join(",")+","+s.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}");var o=new Function("CTOR_LIST","ORDER",a.join("\n"));return o(h[t],i)}function o(t){if(u(t))return"buffer";if(c)switch(Object.prototype.toString.call(t)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped"}return Array.isArray(t)?"array":"generic"}function s(t,e,r,n){if(void 0===t){var i=h.array[0];return i([])}"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var s=e.length;if(void 0===r){r=new Array(s);for(var l=s-1,u=1;l>=0;--l)r[l]=u,u*=e[l]}if(void 0===n){n=0;for(var l=0;lt==t>0?n===o?(r+=1,n=0):n+=1:0===n?(n=o,r-=1):n-=1,i.pack(n,r)}var i=t("double-bits"),a=Math.pow(2,-1074),o=-1>>>0;e.exports=n},{"double-bits":124}],469:[function(t,e,r){r.vertexNormals=function(t,e,r){for(var n=e.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa)for(var x=i[u],_=1/Math.sqrt(g*y),b=0;b<3;++b){var w=(b+1)%3,M=(b+2)%3;x[b]+=_*(v[w]*m[M]-v[M]*m[w])}}for(var o=0;oa)for(var _=1/Math.sqrt(k),b=0;b<3;++b)x[b]*=_;else for(var b=0;b<3;++b)x[b]=0}return i},r.faceNormals=function(t,e,r){for(var n=t.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa?1/Math.sqrt(d):0;for(var u=0;u<3;++u)f[u]*=d;i[o]=f}return i}},{}],470:[function(t,e,r){"use strict";function n(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}var i=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,s,l=n(t),u=1;uk&&(k=d[1]),T[r]=d}for(l=0,c=0,u=0,r=0;rA&&(A=m);return{center:[h,f],bounds:[M,_,k,w+1],radius:Math.sqrt(A)}}function o(t,e){var r=0,n=t.length,i=0;for(e||(e=4);!t[i]&&ir;)i-=e;return n=i,[r/e,n/e]}function s(t,e){return t*t+e*e}e.exports=n;var l=document.createElement("canvas"),u=l.getContext("2d");l.width=200,l.height=200,n.canvas=l},{}],472:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,u){var c=e+a+u;if(h>0){var h=Math.sqrt(c+1);t[0]=.5*(o-l)/h,t[1]=.5*(s-n)/h,t[2]=.5*(r-a)/h,t[3]=.5*h}else{var f=Math.max(e,a,u),h=Math.sqrt(2*f-c+1);e>=f?(t[0]=.5*h,t[1]=.5*(i+r)/h,t[2]=.5*(s+n)/h,t[3]=.5*(o-l)/h):a>=f?(t[0]=.5*(r+i)/h,t[1]=.5*h,t[2]=.5*(l+o)/h,t[3]=.5*(s-n)/h):(t[0]=.5*(n+s)/h,t[1]=.5*(o+l)/h,t[2]=.5*h,t[3]=.5*(r-i)/h)}return t}e.exports=n},{}],473:[function(t,e,r){"use strict";function n(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function i(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function a(t,e){var r=e[0],n=e[1],a=e[2],o=e[3],s=i(r,n,a,o);s>1e-6?(t[0]=r/s,t[1]=n/s,t[2]=a/s,t[3]=o/s):(t[0]=t[1]=t[2]=0,t[3]=1)}function o(t,e,r){this.radius=l([r]),this.center=l(e),this.rotation=l(t),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}function s(t){t=t||{};var e=t.center||[0,0,0],r=t.rotation||[0,0,0,1],n=t.radius||1;e=[].slice.call(e,0,3),r=[].slice.call(r,0,4),a(r,r);var i=new o(r,e,Math.log(n));return i.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&i.lookAt(0,t.eye,t.center,t.up),i}e.exports=s;var l=t("filtered-vector"),u=t("gl-mat4/lookAt"),c=t("gl-mat4/fromQuat"),h=t("gl-mat4/invert"),f=t("./lib/quatFromFrame"),d=o.prototype;d.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},d.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;a(e,e);var r=this.computedMatrix;c(r,e);var n=this.computedCenter,i=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);i[0]=n[0]+s*r[2],i[1]=n[1]+s*r[6],i[2]=n[2]+s*r[10],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;l<3;++l){for(var u=0,h=0;h<3;++h)u+=r[l+4*h]*i[h];r[12+l]=-u}},d.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r},d.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},d.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},d.pan=function(t,e,r,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=a[1],s=a[5],l=a[9],u=n(o,s,l);o/=u,s/=u,l/=u;var c=a[0],h=a[4],f=a[8],d=c*o+h*s+f*l;c-=o*d,h-=s*d,f-=l*d;var p=n(c,h,f);c/=p,h/=p,f/=p;var m=a[2],g=a[6],v=a[10],y=m*o+g*s+v*l,b=m*c+g*h+v*f;m-=y*o+b*c,g-=y*s+b*h,v-=y*l+b*f;var x=n(m,g,v);m/=x,g/=x,v/=x;var _=c*e+o*r,w=h*e+s*r,M=f*e+l*r;this.center.move(t,_,w,M);var k=Math.exp(this.computedRadius[0]);k=Math.max(1e-4,k+i),this.radius.set(t,Math.log(k))},d.rotate=function(t,e,r,a){this.recalcMatrix(t),e=e||0,r=r||0;var o=this.computedMatrix,s=o[0],l=o[4],u=o[8],c=o[1],h=o[5],f=o[9],d=o[2],p=o[6],m=o[10],g=e*s+r*c,v=e*l+r*h,y=e*u+r*f,b=-(p*y-m*v),x=-(m*g-d*y),_=-(d*v-p*g),w=Math.sqrt(Math.max(0,1-Math.pow(b,2)-Math.pow(x,2)-Math.pow(_,2))),M=i(b,x,_,w);M>1e-6?(b/=M,x/=M,_/=M,w/=M):(b=x=_=0,w=1);var k=this.computedRotation,A=k[0],T=k[1],S=k[2],E=k[3],L=A*w+E*b+T*_-S*x,C=T*w+E*x+S*b-A*_,I=S*w+E*_+A*x-T*b,z=E*w-A*b-T*x-S*_;if(a){b=d,x=p,_=m;var D=Math.sin(a)/n(b,x,_);b*=D,x*=D,_*=D,w=Math.cos(e),L=L*w+z*b+C*_-I*x,C=C*w+z*x+I*b-L*_,I=I*w+z*_+L*x-C*b,z=z*w-L*b-C*x-I*_}var P=i(L,C,I,z);P>1e-6?(L/=P,C/=P,I/=P,z/=P):(L=C=I=0,z=1),this.rotation.set(t,L,C,I,z)},d.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var i=this.computedMatrix;u(i,e,r,n);var o=this.computedRotation;f(o,i[0],i[1],i[2],i[4],i[5],i[6],i[8],i[9],i[10]),a(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var s=0,l=0;l<3;++l)s+=Math.pow(r[l]-e[l],2);this.radius.set(t,.5*Math.log(Math.max(s,1e-6))),this.center.set(t,r[0],r[1],r[2])},d.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},d.setMatrix=function(t,e){var r=this.computedRotation;f(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),a(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;h(n,e);var i=n[15];if(Math.abs(i)>1e-6){var o=n[12]/i,s=n[13]/i,l=n[14]/i;this.recalcMatrix(t);var u=Math.exp(this.computedRadius[0]);this.center.set(t,o-n[2]*u,s-n[6]*u,l-n[10]*u),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},d.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},d.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},d.getDistanceLimits=function(t){var e=this.radius.bounds;return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},d.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},d.fromJSON=function(t){var e=this.lastT(),r=t.center;r&&this.center.set(e,r[0],r[1],r[2]);var n=t.rotation;n&&this.rotation.set(e,n[0],n[1],n[2],n[3]);var i=t.distance;i&&i>0&&this.radius.set(e,Math.log(i)),this.setDistanceLimits(t.zoomMin,t.zoomMax)}},{"./lib/quatFromFrame":472,"filtered-vector":133,"gl-mat4/fromQuat":178,"gl-mat4/invert":181,"gl-mat4/lookAt":182}],474:[function(t,e,r){"use strict";var n=t("repeat-string");e.exports=function(t,e,r){return r=void 0!==r?r+"":" ",n(r,e)+t}},{"repeat-string":500}],475:[function(t,e,r){e.exports=function(t,e){e||(e=[0,""]),t=String(t);var r=parseFloat(t,10);return e[0]=r,e[1]=t.match(/[\d.\-\+]*\s*(.*)/)[1]||"",e}},{}],476:[function(t,e,r){(function(t){function e(t,e){for(var r=0,n=t.length-1;n>=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n=-1&&!i;a--){var o=a>=0?arguments[a]:t.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(r=o+"/"+r,i="/"===o.charAt(0))}return r=e(n(r.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(t){var i=r.isAbsolute(t),a="/"===o(t,-1);return t=e(n(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&a&&(t+="/"),(i?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(n(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function n(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var i=n(t.split("/")),a=n(e.split("/")),o=Math.min(i.length,a.length),s=o,l=0;l55295&&e<57344){if(!r){e>56319||a+1===n?i.push(239,191,189):r=e;continue}if(e<56320){i.push(239,191,189),r=e;continue}e=r-55296<<10|e-56320|65536,r=null}else r&&(i.push(239,191,189),r=null);e<128?i.push(e):e<2048?i.push(e>>6|192,63&e|128):e<65536?i.push(e>>12|224,e>>6&63|128,63&e|128):i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}return i}e.exports=n;var a,o,s,l=t("ieee754");a={readUInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},writeUInt32LE:function(t,e){this[e]=t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24},readInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+(this[t+3]<<24)},readFloatLE:function(t){return l.read(this,t,!0,23,4)},readDoubleLE:function(t){return l.read(this,t,!0,52,8)},writeFloatLE:function(t,e){return l.write(this,t,e,!0,23,4)},writeDoubleLE:function(t,e){return l.write(this,t,e,!0,52,8)},toString:function(t,e,r){var n="",i="";e=e||0,r=Math.min(this.length,r||this.length);for(var a=e;a=1;){if(e.pos>=r)throw new Error("Given varint doesn't fit into 10 bytes");var n=255&t;e.buf[e.pos++]=n|(t>=128?128:0),t/=128}}function o(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function s(t,e){for(var r=0;r>3,a=this.pos;t(i,e,this),this.pos===a&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=this.buf.readUInt32LE(this.pos);return this.pos+=4,t},readSFixed32:function(){var t=this.buf.readInt32LE(this.pos);return this.pos+=4,t},readFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+4294967296*this.buf.readUInt32LE(this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+4294967296*this.buf.readInt32LE(this.pos+4);return this.pos+=8,t},readFloat:function(){var t=this.buf.readFloatLE(this.pos);return this.pos+=4,t},readDouble:function(){var t=this.buf.readDoubleLE(this.pos);return this.pos+=8,t},readVarint:function(){var t,e,r=this.buf;return e=r[this.pos++],t=127&e,e<128?t:(e=r[this.pos++],t|=(127&e)<<7,e<128?t:(e=r[this.pos++],t|=(127&e)<<14,e<128?t:(e=r[this.pos++],t|=(127&e)<<21,e<128?t:i(t,this))))},readVarint64:function(){var t=this.pos,e=this.readVarint();if(e127;);else if(e===n.Bytes)this.pos=this.readVarint()+this.pos;else if(e===n.Fixed32)this.pos+=4;else{if(e!==n.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455)return void a(t,this);this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127)))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t);var e=g.byteLength(t);this.writeVarint(e),this.realloc(e),this.buf.write(t,this.pos),this.pos+=e},writeFloat:function(t){this.realloc(4),this.buf.writeFloatLE(t,this.pos),this.pos+=4},writeDouble:function(t){this.realloc(8),this.buf.writeDoubleLE(t,this.pos),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&o(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,n.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,s,e)},writePackedSVarint:function(t,e){this.writeMessage(t,l,e)},writePackedBoolean:function(t,e){this.writeMessage(t,h,e)},writePackedFloat:function(t,e){this.writeMessage(t,u,e)},writePackedDouble:function(t,e){this.writeMessage(t,c,e)},writePackedFixed32:function(t,e){this.writeMessage(t,f,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,d,e)},writePackedFixed64:function(t,e){this.writeMessage(t,p,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,m,e)},writeBytesField:function(t,e){this.writeTag(t,n.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,n.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,n.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,n.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./buffer":477}],479:[function(t,e,r){"use strict";function n(t){var e=t.length;if(e0;--i)n=l[i],r=s[i],s[i]=s[n],s[n]=r,l[i]=l[r],l[r]=n,u=(u+r)*i;return a.freeUint32(l),a.freeUint32(s),u}function i(t,e,r){switch(t){case 0:return r||[];case 1:return r?(r[0]=0,r):[0];case 2:return r?(e?(r[0]=0,r[1]=1):(r[0]=1,r[1]=0),r):e?[0,1]:[1,0]}r=r||new Array(t);var n,i,a,o=1;for(r[0]=0,a=1;a0;--a)n=e/o|0,e=e-n*o|0,o=o/a|0,i=0|r[a],r[a]=0|r[n],r[n]=0|i;return r}var a=t("typedarray-pool"),o=t("invert-permutation");r.rank=n,r.unrank=i},{"invert-permutation":292,"typedarray-pool":541}],481:[function(t,e,r){"use strict";function n(t,e){function r(t,e){var r=s[e][t[e]];r.splice(r.indexOf(t),1)}function n(t,n,a){for(var o,l,u,c=0;c<2;++c)if(s[c][n].length>0){o=s[c][n][0],u=c;break}l=o[1^u];for(var h=0;h<2;++h)for(var f=s[h][n],d=0;d0&&(o=p,l=m,u=h)}return a?l:(o&&r(o,u),l)}for(var a=0|e.length,o=t.length,s=[new Array(a),new Array(a)],l=0;l0;){var d=(s[0][l].length,function(t,a){var o=s[a][t][0],l=[t];r(o,a);for(var u=o[1^a];;){for(;u!==t;)l.push(u),u=n(l[l.length-2],u,!1);if(s[0][t].length+s[1][t].length===0)break;var c=l[l.length-1],h=t,f=l[1],d=n(c,h,!0);if(i(e[c],e[h],e[f],e[d])<0)break;l.push(t),u=n(c,h)}return l}(l,h));!function(t,e){return e[1]===e[e.length-1]}(f,d)?(f.length>0&&c.push(f),f=d):f.push.apply(f,d)}f.length>0&&c.push(f)}return c}e.exports=n;var i=t("compare-angle")},{"compare-angle":100}],482:[function(t,e,r){"use strict";function n(t,e){for(var r=i(t,e.length),n=new Array(e.length),a=new Array(e.length),o=[],s=0;s0;){var u=o.pop();n[u]=!1;for(var c=r[u],s=0;s0}function a(t){for(var e=t.length,r=0;r0;){var U=N.pop(),V=z[U];h(V,function(t,e){return t-e});var H,q=V.length,G=B[U];if(0===G){var T=v[U];H=[T]}for(var g=0;g=0)&&(B[Y]=1^G,N.push(Y),0===G)){var T=v[Y];a(T)||(T.reverse(),H.push(T))}}0===G&&d.push(H)}return d}e.exports=a ;var o=t("edges-to-adjacency-list"),s=t("planar-dual"),l=t("point-in-big-polygon"),u=t("two-product"),c=t("robust-sum"),h=t("uniq"),f=t("./lib/trim-leaves")},{"./lib/trim-leaves":482,"edges-to-adjacency-list":127,"planar-dual":481,"point-in-big-polygon":485,"robust-sum":513,"two-product":539,uniq:543}],484:[function(t,e,r){"use strict";function n(t,e){this.x=t,this.y=e}e.exports=n,n.prototype={clone:function(){return new n(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{}],485:[function(t,e,r){function n(){return!0}function i(t){return function(e,r){var i=t[e];return!!i&&!!i.queryPoint(r,n)}}function a(t){for(var e={},r=0;r0&&e[n]===r[0]))return 1;i=t[n-1]}for(var a=1;i;){var o=i.key,s=h(r,o[0],o[1]);if(o[0][0]0))return 0;a=-1,i=i.right}else if(s>0)i=i.left;else{if(!(s<0))return 0;a=1,i=i.right}}return a}}function s(t){return 1}function l(t){return function(e){return t(e[0],e[1])?0:1}}function u(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}function c(t){for(var e=t.length,r=[],n=[],i=0;i=u?(x=1,y=u+2*f+p):(x=-f/u,y=f*x+p)):(x=0,d>=0?(_=0,y=p):-d>=h?(_=1,y=h+2*d+p):(_=-d/h,y=d*_+p));else if(_<0)_=0,f>=0?(x=0,y=p):-f>=u?(x=1,y=u+2*f+p):(x=-f/u,y=f*x+p);else{var w=1/b;x*=w,_*=w,y=x*(u*x+c*_+2*f)+_*(c*x+h*_+2*d)+p}else{var M,k,A,T;x<0?(M=c+f,k=h+d,k>M?(A=k-M,T=u-2*c+h,A>=T?(x=1,_=0,y=u+2*f+p):(x=A/T,_=1-x,y=x*(u*x+c*_+2*f)+_*(c*x+h*_+2*d)+p)):(x=0,k<=0?(_=1,y=h+2*d+p):d>=0?(_=0,y=p):(_=-d/h,y=d*_+p))):_<0?(M=c+d,k=u+f,k>M?(A=k-M,T=u-2*c+h,A>=T?(_=1,x=0,y=h+2*d+p):(_=A/T,x=1-_,y=x*(u*x+c*_+2*f)+_*(c*x+h*_+2*d)+p)):(_=0,k<=0?(x=1,y=u+2*f+p):f>=0?(x=0,y=p):(x=-f/u,y=f*x+p))):(A=h+d-c-f,A<=0?(x=0,_=1,y=h+2*d+p):(T=u-2*c+h,A>=T?(x=1,_=0,y=u+2*f+p):(x=A/T,_=1-x,y=x*(u*x+c*_+2*f)+_*(c*x+h*_+2*d)+p)))}for(var S=1-x-_,l=0;l1)for(var r=1;r1&&(n=r[0]+"@",t=r[1]),t=t.replace(D,"."),n+o(t.split("."),e).join(".")}function l(t){for(var e,r,n=[],i=0,a=t.length;i=55296&&e<=56319&&i65535&&(t-=65536,e+=F(t>>>10&1023|55296),t=56320|1023&t),e+=F(t)}).join("")}function c(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:M}function h(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function f(t,e,r){var n=0;for(t=r?R(t/S):t>>1,t+=R(t/e);t>O*A>>1;n+=M)t=R(t/O);return R(n+(O+1)*t/(t+T))}function d(t){var e,r,n,i,o,s,l,h,d,p,m=[],g=t.length,v=0,y=L,b=E;for(r=t.lastIndexOf(C),r<0&&(r=0),n=0;n=128&&a("not-basic"),m.push(t.charCodeAt(n));for(i=r>0?r+1:0;i=g&&a("invalid-input"),h=c(t.charCodeAt(i++)),(h>=M||h>R((w-v)/s))&&a("overflow"),v+=h*s,d=l<=b?k:l>=b+A?A:l-b,!(hR(w/p)&&a("overflow"),s*=p;e=m.length+1,b=f(v-o,e,0==o),R(v/e)>w-y&&a("overflow"),y+=R(v/e),v%=e,m.splice(v++,0,y)}return u(m)}function p(t){var e,r,n,i,o,s,u,c,d,p,m,g,v,y,b,x=[];for(t=l(t),g=t.length,e=L,r=0,o=E,s=0;s=e&&mR((w-r)/v)&&a("overflow"),r+=(u-e)*v,e=u,s=0;sw&&a("overflow"),m==e){for(c=r,d=M;p=d<=o?k:d>=o+A?A:d-o,!(c= 0x80 (not a basic code point)","invalid-input":"Invalid input"},O=M-k,R=Math.floor,F=String.fromCharCode;if(x={version:"1.4.1",ucs2:{decode:l,encode:u},decode:d,encode:p,toASCII:g,toUnicode:m},"function"==typeof t&&"object"==typeof t.amd&&t.amd)t("punycode",function(){return x});else if(v&&y)if(r.exports==v)y.exports=x;else for(_ in x)x.hasOwnProperty(_)&&(v[_]=x[_]);else i.punycode=x}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],489:[function(t,e,r){e.exports=t("gl-quat/slerp")},{"gl-quat/slerp":231}],490:[function(t,e,r){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,r,a){e=e||"&",r=r||"=";var o={};if("string"!=typeof t||0===t.length)return o;var s=/\+/g;t=t.split(e);var l=1e3;a&&"number"==typeof a.maxKeys&&(l=a.maxKeys);var u=t.length;l>0&&u>l&&(u=l);for(var c=0;c=0?(h=m.substr(0,g),f=m.substr(g+1)):(h=m,f=""),d=decodeURIComponent(h),p=decodeURIComponent(f),n(o,d)?i(o[d])?o[d].push(p):o[d]=[o[d],p]:o[d]=p}return o};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],491:[function(t,e,r){"use strict";function n(t,e){if(t.map)return t.map(e);for(var r=[],n=0;nr;){if(o-r>600){var l=o-r+1,u=e-r+1,c=Math.log(l),h=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*h*(l-h)/l)*(u-l/2<0?-1:1);n(t,e,Math.max(r,Math.floor(e-u*h/l+f)),Math.min(o,Math.floor(e+(l-u)*h/l+f)),s)}var d=t[e],p=r,m=o;for(i(t,r,e),s(t[o],d)>0&&i(t,r,o);p0;)m--}0===s(t[r],d)?i(t,r,m):(m++,i(t,m,o)),m<=e&&(r=m+1),e<=m&&(o=m-1)}}function i(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function a(t,e){return te?1:0}e.exports=n},{}],494:[function(t,e,r){"use strict";function n(t,e){for(var r=t.length,n=new Array(r),a=0;a0){var u=t[r-1];if(0===i(s,u)&&o(u)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}var i=t("compare-cell"),a=t("compare-oriented-cell"),o=t("cell-orientation");e.exports=n},{"cell-orientation":85,"compare-cell":101,"compare-oriented-cell":102}],499:[function(e,r,n){!function(e,i){"object"==typeof n&&void 0!==r?r.exports=i():"function"==typeof t&&t.amd?t(i):e.createREGL=i()}(this,function(){"use strict";function t(t){return"undefined"!=typeof btoa?btoa(t):"base64:"+t}function e(t){var e=new Error("(regl) "+t);throw console.error(e),e}function r(t,r){t||e(r)}function n(t){return t?": "+t:""}function i(t,r,i){t in r||e("unknown parameter ("+t+")"+n(i)+". possible values: "+Object.keys(r).join())}function a(t,r){Qt(t)||e("invalid parameter type"+n(r)+". must be a typed array")}function o(t,r,i){typeof t!==r&&e("invalid parameter type"+n(i)+". expected "+r+", got "+typeof t)}function s(t,r){t>=0&&(0|t)===t||e("invalid parameter type, ("+t+")"+n(r)+". must be a nonnegative integer")}function l(t,r,i){r.indexOf(t)<0&&e("invalid value"+n(i)+". must be one of: "+r)}function u(t){Object.keys(t).forEach(function(t){te.indexOf(t)<0&&e('invalid regl constructor argument "'+t+'". must be one of '+te)})}function c(t,e){for(t+="";t.length0&&e.push(new d("unknown",0,t))}}),e}function y(t,e){e.forEach(function(e){var r=t[e.file];if(r){var n=r.index[e.line];if(n)return n.errors.push(e),void(r.hasErrors=!0)}t.unknown.hasErrors=!0,t.unknown.lines[0].errors.push(e)})}function b(t,e,n,i,a){if(!t.getShaderParameter(e,t.COMPILE_STATUS)){var o=t.getShaderInfoLog(e),s=i===t.FRAGMENT_SHADER?"fragment":"vertex";T(n,"string",s+" shader source must be a string",a);var l=g(n,a),u=v(o);y(l,u),Object.keys(l).forEach(function(t){function e(t,e){n.push(t),i.push(e||"")}var r=l[t];if(r.hasErrors){var n=[""],i=[""];e("file number "+t+": "+r.name+"\n","color:red;text-decoration:underline;font-weight:bold"),r.lines.forEach(function(t){if(t.errors.length>0){e(c(t.number,4)+"| ","background-color:yellow; font-weight:bold"),e(t.line+"\n","color:red; background-color:yellow; font-weight:bold");var r=0;t.errors.forEach(function(n){var i=n.message,a=/^\s*\'(.*)\'\s*\:\s*(.*)$/.exec(i);if(a){var o=a[1];switch(i=a[2],o){case"assign":o="="}r=Math.max(t.line.indexOf(o,r),0)}else r=0;e(c("| ",6)),e(c("^^^",r+3)+"\n","font-weight:bold"),e(c("| ",6)),e(i+"\n","font-weight:bold")}),e(c("| ",6)+"\n")}else e(c(t.number,4)+"| "),e(t.line+"\n","color:red")}),"undefined"!=typeof document?(i[0]=n.join("%c"),console.log.apply(console,i)):console.log(n.join(""))}}),r.raise("Error compiling "+s+" shader, "+l[0].name)}}function x(t,e,n,i,a){if(!t.getProgramParameter(e,t.LINK_STATUS)){var o=t.getProgramInfoLog(e),s=g(n,a),l=g(i,a),u='Error linking program with vertex shader, "'+l[0].name+'", and fragment shader "'+s[0].name+'"';"undefined"!=typeof document?console.log("%c"+u+"\n%c"+o,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(u+"\n"+o),r.raise(u)}}function _(t){t._commandRef=p()}function w(t,e,r,n){function i(t){return t?n.id(t):0}function a(t,e){Object.keys(e).forEach(function(e){t[n.id(e)]=!0})}_(t),t._fragId=i(t.static.frag),t._vertId=i(t.static.vert);var o=t._uniformSet={};a(o,e.static),a(o,e.dynamic);var s=t._attributeSet={};a(s,r.static),a(s,r.dynamic),t._hasCount="count"in t.static||"count"in t.dynamic||"elements"in t.static||"elements"in t.dynamic}function M(t,r){var n=m();e(t+" in command "+(r||p())+("unknown"===n?"":" called from "+n))}function k(t,e,r){t||M(e,r||p())}function A(t,e,r,i){t in e||M("unknown parameter ("+t+")"+n(r)+". possible values: "+Object.keys(e).join(),i||p())}function T(t,e,r,i){typeof t!==e&&M("invalid parameter type"+n(r)+". expected "+e+", got "+typeof t,i||p())}function S(t){t()}function E(t,e,r){t.texture?l(t.texture._texture.internalformat,e,"unsupported texture format for attachment"):l(t.renderbuffer._renderbuffer.format,r,"unsupported renderbuffer format for attachment")}function L(t,e){return t===ue||t===le||t===ce?2:t===he?4:fe[t]*e}function C(t){return!(t&t-1||!t)}function I(t,e,n){var i,a=e.width,o=e.height,s=e.channels;r(a>0&&a<=n.maxTextureSize&&o>0&&o<=n.maxTextureSize,"invalid texture shape"),t.wrapS===ee&&t.wrapT===ee||r(C(a)&&C(o),"incompatible wrap mode for texture, both width and height must be power of 2"),1===e.mipmask?1!==a&&1!==o&&r(t.minFilter!==ne&&t.minFilter!==ae&&t.minFilter!==ie&&t.minFilter!==oe,"min filter requires mipmap"):(r(C(a)&&C(o),"texture must be a square power of 2 to support mipmapping"),r(e.mipmask===(a<<1)-1,"missing or incomplete mipmap data")),e.type===se&&(n.extensions.indexOf("oes_texture_float_linear")<0&&r(t.minFilter===re&&t.magFilter===re,"filter not supported, must enable oes_texture_float_linear"),r(!t.genMipmaps,"mipmap generation not supported with float textures"));var l=e.images;for(i=0;i<16;++i)if(l[i]){var u=a>>i,c=o>>i;r(e.mipmask&1<0&&a<=i.maxTextureSize&&o>0&&o<=i.maxTextureSize,"invalid texture shape"),r(a===o,"cube map must be square"),r(e.wrapS===ee&&e.wrapT===ee,"wrap mode not supported by cube map");for(var l=0;l>h,p=o>>h;r(u.mipmask&1<1&&e===r&&('"'===e||"'"===e))return['"'+P(t.substr(1,t.length-2))+'"'];var n=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(t);if(n)return O(t.substr(0,n.index)).concat(O(n[1])).concat(O(t.substr(n.index+n[0].length)));var i=t.split(".");if(1===i.length)return['"'+P(t)+'"'];for(var a=[],o=0;o0,"invalid pixel ratio"))):de.raise("invalid arguments to regl"),e&&("canvas"===e.nodeName.toLowerCase()?n=e:r=e),!i){if(!n){de("undefined"!=typeof document,"must manually specify webgl context outside of DOM environments");var d=U(r||document.body,h,u);if(!d)return null;n=d.canvas,f=d.onDestroy}i=V(n,o)}return i?{gl:i,canvas:n,container:r,extensions:s,optionalExtensions:l,pixelRatio:u,profile:c,onDone:h,onDestroy:f}:(f(),h("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function X(t,e){function r(e){de.type(e,"string","extension name must be string");var r,i=e.toLowerCase();try{r=n[i]=t.getExtension(i)}catch(t){}return!!r}for(var n={},i=0;i65535)<<4,t>>>=e,r=(t>255)<<3,t>>>=r,e|=r,r=(t>15)<<2,t>>>=r,e|=r,r=(t>3)<<1,t>>>=r,(e|=r)|t>>1}function $(t){var e=K(t),r=Ee[Q(e)>>2];return r.length>0?r.pop():new ArrayBuffer(e)}function tt(t){Ee[Q(t.byteLength)>>2].push(t)}function et(t,e){var r=null;switch(t){case _e:r=new Int8Array($(e),0,e);break;case we:r=new Uint8Array($(e),0,e);break;case Me:r=new Int16Array($(2*e),0,e);break;case ke:r=new Uint16Array($(2*e),0,e);break;case Ae:r=new Int32Array($(4*e),0,e);break;case Te:r=new Uint32Array($(4*e),0,e);break;case Se:r=new Float32Array($(4*e),0,e);break;default:return null}return r.length!==e?r.subarray(0,e):r}function rt(t){tt(t.buffer)}function nt(t,e,r){for(var n=0;n0){var l;if(Array.isArray(e[0])){s=Pe(e);for(var u=1,c=1;c0)if("number"==typeof t[0]){var i=Le.allocType(p.dtype,t.length);ct(i,t),h(i,n),Le.freeType(i)}else if(Array.isArray(t[0])||Qt(t[0])){r=Pe(t);var a=De(t,r,p.dtype);h(a,n),Le.freeType(a)}else de.raise("invalid buffer data")}else if(Qt(t))h(t,n);else if(Z(t)){r=t.shape;var o=t.stride,s=0,l=0,u=0,f=0;1===r.length?(s=r[0],l=1,u=o[0],f=0):2===r.length?(s=r[0],l=r[1],u=o[0],f=o[1]):de.raise("invalid shape");var d=Array.isArray(t.data)?p.dtype:ut(t.data),m=Le.allocType(d,s*l);ht(m,t.data,s,l,u,f,t.offset),h(m,n),Le.freeType(m)}else de.raise("invalid data for buffer subdata");return c}e.bufferCount++;var p=new n(a);return f[p.id]=p,o||c(i),c._reglType="buffer",c._buffer=p,c.subdata=d,r.profile&&(c.stats=p.stats),c.destroy=function(){l(p)},c}function c(){xe(f).forEach(function(e){e.buffer=t.createBuffer(),t.bindBuffer(e.type,e.buffer),t.bufferData(e.type,e.persistentData||e.byteLength,e.usage)})}var h=0,f={};n.prototype.bind=function(){t.bindBuffer(this.type,this.buffer)},n.prototype.destroy=function(){l(this)};var d=[];return r.profile&&(e.getTotalBufferSize=function(){var t=0;return Object.keys(f).forEach(function(e){t+=f[e].stats.size}),t}),{create:u,createStream:i,destroyStream:a,clear:function(){xe(f).forEach(l),d.forEach(l)},getBuffer:function(t){return t&&t._buffer instanceof n?t._buffer:null},restore:c,_initBuffer:s}}function dt(t,e,r,n){function i(t){this.id=h++,c[this.id]=this,this.buffer=t,this.primType=He,this.vertCount=0,this.type=0}function a(t){var e=d.pop();return e||(e=new i(r.create(null,Je,!0,!1)._buffer)),s(e,t,Ke,-1,-1,0,0),e}function o(t){d.push(t)}function s(n,i,a,o,s,l,u){if(n.buffer.bind(),i){var c=u;u||Qt(i)&&(!Z(i)||Qt(i.data))||(c=e.oes_element_index_uint?Ze:We),r._initBuffer(n.buffer,i,a,c,3)}else t.bufferData(Je,l,a),n.buffer.dtype=h||Ge,n.buffer.usage=a,n.buffer.dimension=3,n.buffer.byteLength=l;var h=u;if(!u){switch(n.buffer.dtype){case Ge:case qe:h=Ge;break;case We:case Ye:h=We;break;case Ze:case Xe:h=Ze;break;default:de.raise("unsupported type for element array")}n.buffer.dtype=h}n.type=h,de(h!==Ze||!!e.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var f=s;f<0&&(f=n.buffer.byteLength,h===We?f>>=1:h===Ze&&(f>>=2)),n.vertCount=f;var d=o;if(o<0){d=He;var p=n.buffer.dimension;1===p&&(d=Ue),2===p&&(d=Ve),3===p&&(d=He)}n.primType=d}function l(t){n.elementsCount--,de(null!==t.buffer,"must not double destroy elements"),delete c[t.id],t.buffer.destroy(),t.buffer=null}function u(t,e){function a(t){if(t)if("number"==typeof t)o(t),u.primType=He,u.vertCount=0|t,u.type=Ge;else{var e=null,r=Qe,n=-1,i=-1,l=0,c=0;Array.isArray(t)||Qt(t)||Z(t)?e=t:(de.type(t,"object","invalid arguments for elements"),"data"in t&&(e=t.data,de(Array.isArray(e)||Qt(e)||Z(e),"invalid data for element buffer")),"usage"in t&&(de.parameter(t.usage,ze,"invalid element buffer usage"),r=ze[t.usage]),"primitive"in t&&(de.parameter(t.primitive,Be,"invalid element buffer primitive"),n=Be[t.primitive]),"count"in t&&(de("number"==typeof t.count&&t.count>=0,"invalid vertex count for elements"),i=0|t.count),"type"in t&&(de.parameter(t.type,f,"invalid buffer type"),c=f[t.type]),"length"in t?l=0|t.length:(l=i,c===We||c===Ye?l*=2:c!==Ze&&c!==Xe||(l*=4))),s(u,e,r,n,i,l,c)}else o(),u.primType=He, u.vertCount=0,u.type=Ge;return a}var o=r.create(null,Je,!0),u=new i(o._buffer);return n.elementsCount++,a(t),a._reglType="elements",a._elements=u,a.subdata=function(t,e){return o.subdata(t,e),a},a.destroy=function(){l(u)},a}var c={},h=0,f={uint8:Ge,uint16:We};e.oes_element_index_uint&&(f.uint32=Ze),i.prototype.bind=function(){this.buffer.bind()};var d=[];return{create:u,createStream:a,destroyStream:o,getElements:function(t){return"function"==typeof t&&t._elements instanceof i?t._elements:null},clear:function(){xe(c).forEach(l)}}}function pt(t){for(var e=Le.allocType(er,t.length),r=0;r>>31<<15,a=(n<<1>>>24)-127,o=n>>13&1023;if(a<-24)e[r]=i;else if(a<-14){var s=-14-a;e[r]=i+(o+1024>>s)}else e[r]=a>15?i+31744:i+(a+15<<10)+o}return e}function mt(t){return Array.isArray(t)||Qt(t)}function gt(t){return"[object "+t+"]"}function vt(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function yt(t){return!!Array.isArray(t)&&!(0===t.length||!mt(t[0]))}function bt(t){return Object.prototype.toString.call(t)}function xt(t){return bt(t)===dn}function _t(t){return bt(t)===pn}function wt(t){return bt(t)===mn}function Mt(t){return bt(t)===gn}function kt(t){if(!t)return!1;var e=bt(t);return vn.indexOf(e)>=0||(vt(t)||yt(t)||Z(t))}function At(t){return 0|Kt[Object.prototype.toString.call(t)]}function Tt(t,e){var r=e.length;switch(t.type){case Or:case Rr:case Fr:case jr:var n=Le.allocType(t.type,r);n.set(e),t.data=n;break;case wr:t.data=pt(e);break;default:de.raise("unsupported texture type, must specify a typed array")}}function St(t,e){return Le.allocType(t.type===wr?jr:t.type,e)}function Et(t,e){t.type===wr?(t.data=pt(e),Le.freeType(e)):t.data=e}function Lt(t,e,r,n,i,a){for(var o=t.width,s=t.height,l=t.channels,u=o*s*l,c=St(t,u),h=0,f=0;f=1;)s+=o*l*l,l/=2;return s}return o*r*n}function It(t,e,r,n,i,a,o){function s(){this.internalformat=or,this.format=or,this.type=Or,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=0,this.width=0,this.height=0,this.channels=0}function l(t,e){t.internalformat=e.internalformat,t.format=e.format,t.type=e.type,t.compressed=e.compressed,t.premultiplyAlpha=e.premultiplyAlpha,t.flipY=e.flipY,t.unpackAlignment=e.unpackAlignment,t.colorSpace=e.colorSpace,t.width=e.width,t.height=e.height,t.channels=e.channels}function u(t,n){if("object"==typeof n&&n){if("premultiplyAlpha"in n&&(de.type(n.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),t.premultiplyAlpha=n.premultiplyAlpha),"flipY"in n&&(de.type(n.flipY,"boolean","invalid texture flip"),t.flipY=n.flipY),"alignment"in n&&(de.oneOf(n.alignment,[1,2,4,8],"invalid texture unpack alignment"),t.unpackAlignment=n.alignment),"colorSpace"in n&&(de.parameter(n.colorSpace,j,"invalid colorSpace"),t.colorSpace=j[n.colorSpace]),"type"in n){var i=n.type;de(e.oes_texture_float||!("float"===i||"float32"===i),"you must enable the OES_texture_float extension in order to use floating point textures."),de(e.oes_texture_half_float||!("half float"===i||"float16"===i),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),de(e.webgl_depth_texture||!("uint16"===i||"uint32"===i||"depth stencil"===i),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),de.parameter(i,N,"invalid texture type"),t.type=N[i]}var a=t.width,o=t.height,s=t.channels,l=!1;"shape"in n?(de(Array.isArray(n.shape)&&n.shape.length>=2,"shape must be an array"),a=n.shape[0],o=n.shape[1],3===n.shape.length&&(s=n.shape[2],de(s>0&&s<=4,"invalid number of channels"),l=!0),de(a>=0&&a<=r.maxTextureSize,"invalid width"),de(o>=0&&o<=r.maxTextureSize,"invalid height")):("radius"in n&&(a=o=n.radius,de(a>=0&&a<=r.maxTextureSize,"invalid radius")),"width"in n&&(a=n.width,de(a>=0&&a<=r.maxTextureSize,"invalid width")),"height"in n&&(o=n.height,de(o>=0&&o<=r.maxTextureSize,"invalid height")),"channels"in n&&(s=n.channels,de(s>0&&s<=4,"invalid number of channels"),l=!0)),t.width=0|a,t.height=0|o,t.channels=0|s;var u=!1;if("format"in n){var c=n.format;de(e.webgl_depth_texture||!("depth"===c||"depth stencil"===c),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),de.parameter(c,B,"invalid texture format");var h=t.internalformat=B[c];t.format=J[h],c in N&&("type"in n||(t.type=N[c])),c in U&&(t.compressed=!0),u=!0}!l&&u?t.channels=fn[t.format]:l&&!u?t.channels!==hn[t.format]&&(t.format=t.internalformat=hn[t.channels]):u&&l&&de(t.channels===fn[t.format],"number of channels inconsistent with specified format")}}function c(e){t.pixelStorei(an,e.flipY),t.pixelStorei(on,e.premultiplyAlpha),t.pixelStorei(sn,e.colorSpace),t.pixelStorei(nn,e.unpackAlignment)}function h(){s.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function f(t,e){var n=null;if(kt(e)?n=e:e&&(de.type(e,"object","invalid pixel data type"),u(t,e),"x"in e&&(t.xOffset=0|e.x),"y"in e&&(t.yOffset=0|e.y),kt(e.data)&&(n=e.data)),de(!t.compressed||n instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),e.copy){de(!n,"can not specify copy and data field for the same texture");var a=i.viewportWidth,o=i.viewportHeight;t.width=t.width||a-t.xOffset,t.height=t.height||o-t.yOffset,t.needsCopy=!0,de(t.xOffset>=0&&t.xOffset=0&&t.yOffset0&&t.width<=a&&t.height>0&&t.height<=o,"copy texture read out of bounds")}else if(n){if(Qt(n))t.channels=t.channels||4,t.data=n,"type"in e||t.type!==Or||(t.type=At(n));else if(vt(n))t.channels=t.channels||4,Tt(t,n),t.alignment=1,t.needsFree=!0;else if(Z(n)){var s=n.data;Array.isArray(s)||t.type!==Or||(t.type=At(s));var l,c,h,f,d,p,m=n.shape,g=n.stride;3===m.length?(h=m[2],p=g[2]):(de(2===m.length,"invalid ndarray pixel data, must be 2 or 3D"),h=1,p=1),l=m[0],c=m[1],f=g[0],d=g[1],t.alignment=1,t.width=l,t.height=c,t.channels=h,t.format=t.internalformat=hn[h],t.needsFree=!0,Lt(t,s,f,d,p,n.offset)}else if(xt(n)||_t(n))xt(n)?t.element=n:t.element=n.canvas,t.width=t.element.width,t.height=t.element.height,t.channels=4;else if(wt(n))t.element=n,t.width=n.naturalWidth,t.height=n.naturalHeight,t.channels=4;else if(Mt(n))t.element=n,t.width=n.videoWidth,t.height=n.videoHeight,t.channels=4;else if(yt(n)){var v=t.width||n[0].length,y=t.height||n.length,b=t.channels;b=mt(n[0][0])?b||n[0][0].length:b||1;for(var x=Ce.shape(n),_=1,w=0;w=0,"oes_texture_float extension not enabled"):t.type===wr&&de(r.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function d(e,r,i){var a=e.element,o=e.data,s=e.internalformat,l=e.format,u=e.type,h=e.width,f=e.height;c(e),a?t.texImage2D(r,i,l,l,u,a):e.compressed?t.compressedTexImage2D(r,i,s,h,f,0,o):e.needsCopy?(n(),t.copyTexImage2D(r,i,l,e.xOffset,e.yOffset,h,f,0)):t.texImage2D(r,i,l,h,f,0,l,u,o)}function p(e,r,i,a,o){var s=e.element,l=e.data,u=e.internalformat,h=e.format,f=e.type,d=e.width,p=e.height;c(e),s?t.texSubImage2D(r,o,i,a,h,f,s):e.compressed?t.compressedTexSubImage2D(r,o,i,a,u,d,p,l):e.needsCopy?(n(),t.copyTexSubImage2D(r,o,i,a,e.xOffset,e.yOffset,d,p)):t.texSubImage2D(r,o,i,a,d,p,h,f,l)}function m(){return K.pop()||new h}function g(t){t.needsFree&&Le.freeType(t.data),h.call(t),K.push(t)}function v(){s.call(this),this.genMipmaps=!1,this.mipmapHint=$r,this.mipmask=0,this.images=Array(16)}function y(t,e,r){var n=t.images[0]=m();t.mipmask=1,n.width=t.width=e,n.height=t.height=r,n.channels=t.channels=4}function b(t,e){var r=null;if(kt(e))r=t.images[0]=m(),l(r,t),f(r,e),t.mipmask=1;else if(u(t,e),Array.isArray(e.mipmap))for(var n=e.mipmap,i=0;i>=i,r.height>>=i,f(r,n[i]),t.mipmask|=1<=0&&(t.genMipmaps=!0)}if("mag"in e){var i=e.mag;de.parameter(i,R),t.magFilter=R[i]}var a=t.wrapS,o=t.wrapT;if("wrap"in e){var s=e.wrap;"string"==typeof s?(de.parameter(s,O),a=o=O[s]):Array.isArray(s)&&(de.parameter(s[0],O),de.parameter(s[1],O),a=O[s[0]],o=O[s[1]])}else{if("wrapS"in e){var l=e.wrapS;de.parameter(l,O),a=O[l]}if("wrapT"in e){var u=e.wrapT;de.parameter(u,O),o=O[u]}}if(t.wrapS=a,t.wrapT=o,"anisotropic"in e){var c=e.anisotropic;de("number"==typeof c&&c>=1&&c<=r.maxAnisotropic,"aniso samples must be between 1 and "),t.anisotropic=e.anisotropic}if("mipmap"in e){var h=!1;switch(typeof e.mipmap){case"string":de.parameter(e.mipmap,P,"invalid mipmap hint"),t.mipmapHint=P[e.mipmap],t.genMipmaps=!0,h=!0;break;case"boolean":h=t.genMipmaps=e.mipmap;break;case"object":de(Array.isArray(e.mipmap),"invalid mipmap type"),t.genMipmaps=!1,h=!0;break;default:de.raise("invalid mipmap type")}!h||"min"in e||(t.minFilter=Xr)}}function A(r,n){t.texParameteri(n,Gr,r.minFilter),t.texParameteri(n,qr,r.magFilter),t.texParameteri(n,Nr,r.wrapS),t.texParameteri(n,Br,r.wrapT),e.ext_texture_filter_anisotropic&&t.texParameteri(n,rn,r.anisotropic),r.genMipmaps&&(t.hint(Qr,r.mipmapHint),t.generateMipmap(n))}function T(e){s.call(this),this.mipmask=0,this.internalformat=or,this.id=$++,this.refCount=1,this.target=e,this.texture=t.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new M,o.profile&&(this.stats={size:0})}function S(e){t.activeTexture(un),t.bindTexture(e.target,e.texture)}function E(){var e=rt[0];e?t.bindTexture(e.target,e.texture):t.bindTexture(nr,null)}function L(e){var r=e.texture;de(r,"must not double destroy texture");var n=e.unit,i=e.target;n>=0&&(t.activeTexture(un+n),t.bindTexture(i,null),rt[n]=null),t.deleteTexture(r),e.texture=null,e.params=null,e.pixels=null,e.refCount=0,delete tt[e.id],a.textureCount--}function C(e,n){function i(t,e){var n=c.texInfo;M.call(n);var a=_();return"number"==typeof t?"number"==typeof e?y(a,0|t,0|e):y(a,0|t,0|t):t?(de.type(t,"object","invalid arguments to regl.texture"),k(n,t),b(a,t)):y(a,1,1),n.genMipmaps&&(a.mipmask=(a.width<<1)-1),c.mipmask=a.mipmask,l(c,a),de.texture2D(n,a,r),c.internalformat=a.internalformat,i.width=a.width,i.height=a.height,S(c),x(a,nr),A(n,nr),E(),w(a),o.profile&&(c.stats.size=Ct(c.internalformat,c.type,a.width,a.height,n.genMipmaps,!1)),i.format=q[c.internalformat],i.type=G[c.type],i.mag=Y[n.magFilter],i.min=W[n.minFilter],i.wrapS=X[n.wrapS],i.wrapT=X[n.wrapT],i}function s(t,e,r,n){de(!!t,"must specify image data");var a=0|e,o=0|r,s=0|n,u=m();return l(u,c),u.width=0,u.height=0,f(u,t),u.width=u.width||(c.width>>s)-a,u.height=u.height||(c.height>>s)-o,de(c.type===u.type&&c.format===u.format&&c.internalformat===u.internalformat,"incompatible format for texture.subimage"),de(a>=0&&o>=0&&a+u.width<=c.width&&o+u.height<=c.height,"texture.subimage write out of bounds"),de(c.mipmask&1<>s;++s)t.texImage2D(nr,s,c.format,n>>s,a>>s,0,c.format,c.type,null);return E(),o.profile&&(c.stats.size=Ct(c.internalformat,c.type,n,a,!1,!1)),i}var c=new T(nr);return tt[c.id]=c,a.textureCount++,i(e,n),i.subimage=s,i.resize=u,i._reglType="texture2d",i._texture=c,o.profile&&(i.stats=c.stats),i.destroy=function(){c.decRef()},i}function I(e,n,i,s,c,h){function d(t,e,n,i,a,s){var c,h=C.texInfo;for(M.call(h),c=0;c<6;++c)I[c]=_();if("number"!=typeof t&&t)if("object"==typeof t)if(e)b(I[0],t),b(I[1],e),b(I[2],n),b(I[3],i),b(I[4],a),b(I[5],s);else if(k(h,t),u(C,t),"faces"in t){var f=t.faces;for(de(Array.isArray(f)&&6===f.length,"cube faces must be a length 6 array"),c=0;c<6;++c)de("object"==typeof f[c]&&!!f[c],"invalid input for cube map face"),l(I[c],C),b(I[c],f[c])}else for(c=0;c<6;++c)b(I[c],t);else de.raise("invalid arguments to cube map");else{var p=0|t||1;for(c=0;c<6;++c)y(I[c],p,p)}for(l(C,I[0]),h.genMipmaps?C.mipmask=(I[0].width<<1)-1:C.mipmask=I[0].mipmask,de.textureCube(C,h,I,r),C.internalformat=I[0].internalformat,d.width=I[0].width,d.height=I[0].height,S(C),c=0;c<6;++c)x(I[c],ar+c);for(A(h,ir),E(),o.profile&&(C.stats.size=Ct(C.internalformat,C.type,d.width,d.height,h.genMipmaps,!0)),d.format=q[C.internalformat],d.type=G[C.type],d.mag=Y[h.magFilter],d.min=W[h.minFilter],d.wrapS=X[h.wrapS],d.wrapT=X[h.wrapT],c=0;c<6;++c)w(I[c]);return d}function v(t,e,r,n,i){de(!!e,"must specify image data"),de("number"==typeof t&&t===(0|t)&&t>=0&&t<6,"invalid face");var a=0|r,o=0|n,s=0|i,u=m();return l(u,C),u.width=0,u.height=0,f(u,e),u.width=u.width||(C.width>>s)-a,u.height=u.height||(C.height>>s)-o,de(C.type===u.type&&C.format===u.format&&C.internalformat===u.internalformat,"incompatible format for texture.subimage"),de(a>=0&&o>=0&&a+u.width<=C.width&&o+u.height<=C.height,"texture.subimage write out of bounds"),de(C.mipmask&1<>i;++i)t.texImage2D(ar+n,i,C.format,r>>i,r>>i,0,C.format,C.type,null);return E(),o.profile&&(C.stats.size=Ct(C.internalformat,C.type,d.width,d.height,!1,!0)),d}}var C=new T(ir);tt[C.id]=C,a.cubeCount++;var I=new Array(6);return d(e,n,i,s,c,h),d.subimage=v,d.resize=L,d._reglType="textureCube",d._texture=C,o.profile&&(d.stats=C.stats),d.destroy=function(){C.decRef()},d}function z(){for(var e=0;e>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;n<6;++n)t.texImage2D(ar+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);A(e.texInfo,e.target)})}var P={"don't care":$r,"dont care":$r,nice:en,fast:tn},O={repeat:Ur,clamp:Vr,mirror:Hr},R={nearest:Yr,linear:Wr},F=$t({mipmap:Kr,"nearest mipmap nearest":Xr,"linear mipmap nearest":Zr,"nearest mipmap linear":Jr,"linear mipmap linear":Kr},R),j={none:0,browser:ln},N={uint8:Or,rgba4:pr,rgb565:gr,"rgb5 a1":mr},B={alpha:sr,luminance:ur,"luminance alpha":cr,rgb:lr,rgba:or,rgba4:hr,"rgb5 a1":fr,rgb565:dr},U={};e.ext_srgb&&(B.srgb=xr,B.srgba=_r),e.oes_texture_float&&(N.float32=N.float=jr),e.oes_texture_half_float&&(N.float16=N["half float"]=wr),e.webgl_depth_texture&&($t(B,{depth:yr,"depth stencil":br}),$t(N,{uint16:Rr,uint32:Fr,"depth stencil":vr})),e.webgl_compressed_texture_s3tc&&$t(U,{"rgb s3tc dxt1":Mr,"rgba s3tc dxt1":kr,"rgba s3tc dxt3":Ar,"rgba s3tc dxt5":Tr}),e.webgl_compressed_texture_atc&&$t(U,{"rgb atc":Sr,"rgba atc explicit alpha":Er,"rgba atc interpolated alpha":Lr}),e.webgl_compressed_texture_pvrtc&&$t(U,{"rgb pvrtc 4bppv1":Cr,"rgb pvrtc 2bppv1":Ir,"rgba pvrtc 4bppv1":zr,"rgba pvrtc 2bppv1":Dr}),e.webgl_compressed_texture_etc1&&(U["rgb etc1"]=Pr);var V=Array.prototype.slice.call(t.getParameter(rr));Object.keys(U).forEach(function(t){var e=U[t];V.indexOf(e)>=0&&(B[t]=e)});var H=Object.keys(B);r.textureFormats=H;var q=[];Object.keys(B).forEach(function(t){var e=B[t];q[e]=t});var G=[];Object.keys(N).forEach(function(t){var e=N[t];G[e]=t});var Y=[];Object.keys(R).forEach(function(t){var e=R[t];Y[e]=t});var W=[];Object.keys(F).forEach(function(t){var e=F[t];W[e]=t});var X=[];Object.keys(O).forEach(function(t){var e=O[t];X[e]=t});var J=H.reduce(function(t,e){var r=B[e];return r===ur||r===sr||r===ur||r===cr||r===yr||r===br?t[r]=r:r===fr||e.indexOf("rgba")>=0?t[r]=or:t[r]=lr,t},{}),K=[],Q=[],$=0,tt={},et=r.maxTextureUnits,rt=Array(et).map(function(){return null});return $t(T.prototype,{bind:function(){var e=this;e.bindCount+=1;var r=e.unit;if(r<0){for(var n=0;n0)continue;i.unit=-1}rt[n]=e,r=n;break}r>=et&&de.raise("insufficient number of texture units"),o.profile&&a.maxTextureUnits=Sn&&e=2,"invalid shape for framebuffer"),u=z[0],d=z[1]}else"radius"in I&&(u=d=I.radius),"width"in I&&(u=I.width),"height"in I&&(d=I.height);("color"in I||"colors"in I)&&(y=I.color||I.colors,Array.isArray(y)&&de(1===y.length||o,"multiple render targets not supported")),y||("colorCount"in I&&(T=0|I.colorCount,de(T>0,"invalid color buffer count")),"colorTexture"in I&&(b=!!I.colorTexture,x="rgba4"),"colorType"in I&&(A=I.colorType,b?(de(e.oes_texture_float||!("float"===A||"float32"===A),"you must enable OES_texture_float in order to use floating point framebuffer objects"),de(e.oes_texture_half_float||!("half float"===A||"float16"===A),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):"half float"===A||"float16"===A?(de(e.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),x="rgba16f"):"float"!==A&&"float32"!==A||(de(e.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),x="rgba32f"),de.oneOf(A,k,"invalid color type")),"colorFormat"in I&&(x=I.colorFormat,w.indexOf(x)>=0?b=!0:M.indexOf(x)>=0?b=!1:b?de.oneOf(I.colorFormat,w,"invalid color format for texture"):de.oneOf(I.colorFormat,M,"invalid color format for renderbuffer"))),("depthTexture"in I||"depthStencilTexture"in I)&&(C=!(!I.depthTexture&&!I.depthStencilTexture),de(!C||e.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in I&&("boolean"==typeof I.depth?p=I.depth:(S=I.depth,g=!1)),"stencil"in I&&("boolean"==typeof I.stencil?g=I.stencil:(E=I.stencil,p=!1)),"depthStencil"in I&&("boolean"==typeof I.depthStencil?p=g=I.depthStencil:(L=I.depthStencil,p=!1,g=!1))}else u=d=1;var D=null,P=null,O=null,R=null;if(Array.isArray(y))D=y.map(c);else if(y)D=[c(y)];else for(D=new Array(T),a=0;a=0||D[a].renderbuffer&&Bn.indexOf(D[a].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+a+" is invalid"),D[a]&&D[a].texture){var j=On[D[a].texture._texture.format]*Rn[D[a].texture._texture.type];null===F?F=j:de(F===j,"all color attachments much have the same number of bits per pixel.")}return l(P,u,d),de(!P||P.texture&&P.texture._texture.format===Dn||P.renderbuffer&&P.renderbuffer._renderbuffer.format===Fn,"invalid depth attachment for framebuffer object"),l(O,u,d),de(!O||O.renderbuffer&&O.renderbuffer._renderbuffer.format===jn,"invalid stencil attachment for framebuffer object"),l(R,u,d),de(!R||R.texture&&R.texture._texture.format===Nn||R.renderbuffer&&R.renderbuffer._renderbuffer.format===Nn,"invalid depth-stencil attachment for framebuffer object"),m(s),s.width=u,s.height=d,s.colorAttachments=D,s.depthAttachment=P,s.stencilAttachment=O,s.depthStencilAttachment=R,i.color=D.map(f),i.depth=f(P),i.stencil=f(O),i.depthStencil=f(R),i.width=s.width,i.height=s.height,v(s),i}function o(t,e){de(_.next!==s,"can not resize a framebuffer which is currently in use");var r=0|t,n=0|e||r;if(r===s.width&&n===s.height)return i;for(var a=s.colorAttachments,o=0;o=2,"invalid shape for framebuffer"),de(p[0]===p[1],"cube framebuffer must be square"),l=p[0]}else"radius"in d&&(l=0|d.radius),"width"in d?(l=0|d.width,"height"in d&&de(d.height===l,"must be square")):"height"in d&&(l=0|d.height);("color"in d||"colors"in d)&&(u=d.color||d.colors,Array.isArray(u)&&de(1===u.length||a,"multiple render targets not supported")),u||("colorCount"in d&&(f=0|d.colorCount,de(f>0,"invalid color buffer count")),"colorType"in d&&(de.oneOf(d.colorType,k,"invalid color type"),h=d.colorType),"colorFormat"in d&&(c=d.colorFormat,de.oneOf(d.colorFormat,w,"invalid color format for texture"))),"depth"in d&&(s.depth=d.depth),"stencil"in d&&(s.stencil=d.stencil),"depthStencil"in d&&(s.depthStencil=d.depthStencil)}else l=1;var m;if(u)if(Array.isArray(u))for(m=[],r=0;r0&&(s.depth=o[0].depth,s.stencil=o[0].stencil,s.depthStencil=o[0].depthStencil),o[r]?o[r](s):o[r]=y(s)}return $t(i,{width:l,height:l,color:m})}function a(t){var e,n=0|t;if(de(n>0&&n<=r.maxCubeMapSize,"invalid radius for cube fbo"),n===i.width)return i;var a=i.color;for(e=0;e1)for(var m=0;mt&&(t=e.stats.uniformsCount)}),t},r.getMaxAttributesCount=function(){var t=0;return d.forEach(function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)}),t}),{clear:function(){var e=t.deleteShader.bind(t);xe(c).forEach(e),c={},xe(h).forEach(e),h={},d.forEach(function(e){t.deleteProgram(e.program)}),d.length=0,f={},r.shaderCount=0},program:function(t,e,n){de.command(t>=0,"missing vertex shader",n),de.command(e>=0,"missing fragment shader",n);var i=f[e];i||(i=f[e]={});var a=i[t];return a||(a=new s(e,t),r.shaderCount++,l(a,n),i[t]=a,d.push(a)),a},restore:u,shader:o,frag:-1,vert:-1}}function Ft(t,e,r,n,i,a){function o(o){var s;null===e.next?(de(i.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),s=Xn):(de(null!==e.next.colorAttachments[0].texture,"You cannot read from a renderbuffer"),s=e.next.colorAttachments[0].texture._texture.type,a.oes_texture_float?de(s===Xn||s===Jn,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"):de(s===Xn,"Reading from a framebuffer is only allowed for the type 'uint8'"));var l=0,u=0,c=n.framebufferWidth,h=n.framebufferHeight,f=null;Qt(o)?f=o:o&&(de.type(o,"object","invalid arguments to regl.read()"),l=0|o.x,u=0|o.y,de(l>=0&&l=0&&u0&&c+l<=n.framebufferWidth,"invalid width for read pixels"),de(h>0&&h+u<=n.framebufferHeight,"invalid height for read pixels"),r();var d=c*h*4;return f||(s===Xn?f=new Uint8Array(d):s===Jn&&(f=f||new Float32Array(d))),de.isTypedArray(f,"data buffer for regl.read() must be a typedarray"),de(f.byteLength>=d,"data buffer for regl.read() too small"),t.pixelStorei(Zn,4),t.readPixels(l,u,c,h,Wn,s,f),f}function s(t){var r;return e.setFBO({framebuffer:t.framebuffer},function(){r=o(t)}),r}function l(t){return t&&"framebuffer"in t?s(t):o(t)}return l}function jt(t){return Array.prototype.slice.call(t)}function Nt(t){return jt(t).join("")}function Bt(){function t(t){for(var e=0;e0&&(r.push(t,"="),r.push.apply(r,jt(arguments)),r.push(";")),t}var r=[],n=[];return $t(t,{def:e,toString:function(){return Nt([n.length>0?"var "+n+";":"",Nt(r)])}})}function r(){function t(t,e){ @@ -54,27 +54,27 @@ Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375," ;i<=r.distance&&(r.index=n,r.distance=i)}return r},r.inbox=function(t,e){return t*e<0||0===t?a.MAXDIST*(.6-.3/Math.max(3,Math.abs(t-e))):1/0},r.appendArrayPointValue=function(t,e,r){var n=e._arrayAttrs;if(n)for(var a=0;aQ.width||J<0||J>Q.height)return b.unhoverRaw(t,e)}if(P="xval"in e?w.flat(f,e.xval):w.p2c(S,Z),O="yval"in e?w.flat(f,e.yval):w.p2c(E,J),!h(P[0])||!h(O[0]))return d.warn("Fx.hover failed",e,t),b.unhoverRaw(t,e)}var $=1/0;for(F=0;FY&&(W.splice(0,Y),$=W[0].distance)}if(0===W.length)return b.unhoverRaw(t,e);W.sort(function(t,e){return t.distance-e.distance});var it=t._hoverdata,at=[];for(R=0;R1,ut=y.combine(m.plot_bgcolor||y.background,m.paper_bgcolor),ct={hovermode:D,rotateLabels:lt,bgColor:ut,container:m._hoverlayer,outerContainer:m._paperdiv,commonLabelOpts:m.hoverlabel},ht=i(W,ct,t);if(a(W,lt?"xa":"ya"),o(ht,lt),e.target&&e.target.tagName){var ft=_.getComponentMethod("annotations","hasClickToShow")(t,at);g(c.select(e.target),ft?"pointer":"")}e.target&&!n&&u(t,e,it)&&(it&&t.emit("plotly_unhover",{event:e,points:it}),t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:S,yaxes:E,xvals:P,yvals:O}))}function i(t,e,r){var n,i,a=e.hovermode,o=e.rotateLabels,s=e.bgColor,l=e.container,u=e.outerContainer,h=e.commonLabelOpts||{},f=e.fontFamily||M.HOVERFONT,d=e.fontSize||M.HOVERFONTSIZE,p=t[0],g=p.xa,b=p.ya,x="y"===a?"yLabel":"xLabel",_=p[x],w=(String(_)||"").split(" ")[0],A=u.node().getBoundingClientRect(),T=A.top,S=A.width,E=A.height,I=p.distance<=M.MAXDIST&&("x"===a||"y"===a);for(n=0;n-1&&n.length>p&&(n=p>3?n.substr(0,p-3)+"...":n.substr(0,p))}void 0!==t.extraText&&(i+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(i+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(i+="y: "+t.yLabel+"
"),i+=(i?"z: ":"")+t.zLabel):I&&t[a+"Label"]===_?i=t[("x"===a?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(i=t.yLabel):i=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(i+=(i?"
":"")+t.text),""===i&&(""===n&&e.remove(),i=n);var g=e.select("text.nums").call(v.font,t.fontFamily||f,t.fontSize||d,t.fontColor||h).text(i).attr("data-notex",1).call(m.positionText,0,0).call(m.convertToTspans,r),b=e.select("text.name"),x=0;n&&n!==i?(b.call(v.font,t.fontFamily||f,t.fontSize||d,u).text(n).attr("data-notex",1).call(m.positionText,0,0).call(m.convertToTspans,r),x=b.node().getBoundingClientRect().width+2*C):(b.remove(),e.select("rect").remove()),e.select("path").style({fill:u,stroke:h});var w,M,A=g.node().getBoundingClientRect(),z=t.xa._offset+(t.x0+t.x1)/2,D=t.ya._offset+(t.y0+t.y1)/2,P=Math.abs(t.x1-t.x0),O=Math.abs(t.y1-t.y0),R=A.width+L+C+x;t.ty0=T-A.top,t.bx=A.width+2*C,t.by=A.height+2*C,t.anchor="start",t.txwidth=A.width,t.tx2width=x,t.offset=0,o?(t.pos=z,w=D+O/2+R<=E,M=D-O/2-R>=0,"top"!==t.idealAlign&&w||!M?w?(D+=O/2,t.anchor="start"):t.anchor="middle":(D-=O/2,t.anchor="end")):(t.pos=D,w=z+P/2+R<=S,M=z-P/2-R>=0,"left"!==t.idealAlign&&w||!M?w?(z+=P/2,t.anchor="start"):t.anchor="middle":(z-=P/2,t.anchor="end")),g.attr("text-anchor",t.anchor),x&&b.attr("text-anchor",t.anchor),e.attr("transform","translate("+z+","+D+")"+(o?"rotate("+k+")":""))}),P}function a(t,e){function r(t){var e=t[0],r=t[t.length-1];if(i=e.pmin-e.pos-e.dp+e.size,a=r.pos+r.dp+r.size-e.pmax,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(a<.01)){if(i<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=a;n=!1}if(n){var u=0;for(o=0;oe.pmax&&u++;for(o=t.length-1;o>=0&&!(u<=0);o--)l=t[o],l.pos>e.pmax-1&&(l.del=!0,u--);for(o=0;o=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(u<=0);o--)l=t[o],l.pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}for(var n,i,a,o,s,l,u,c=0,h=t.map(function(t,r){var n=t[e];return[{i:r,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===n._id.charAt(0)?T:1)/2,pmin:n._offset,pmax:n._offset+n._length}]}).sort(function(t,e){return t[0].posref-e[0].posref});!n&&c<=t.length;){for(c++,n=!0,o=0;o.01&&p.pmin===m.pmin&&p.pmax===m.pmax){for(s=d.length-1;s>=0;s--)d[s].dp+=i;for(f.push.apply(f,d),h.splice(o+1,1),u=0,s=f.length-1;s>=0;s--)u+=f[s].dp;for(a=u/f.length,s=f.length-1;s>=0;s--)f[s].dp-=a;n=!1}else o++}h.forEach(r)}for(o=h.length-1;o>=0;o--){var g=h[o];for(s=g.length-1;s>=0;s--){var v=g[s],y=t[v.i];y.offset=v.dp,y.del=v.del}}}function o(t,e){t.each(function(t){var r=c.select(this);if(t.del)return void r.remove();var n="end"===t.anchor?-1:1,i=r.select("text.nums"),a={start:1,end:-1,middle:0}[t.anchor],o=a*(L+C),s=o+a*(t.txwidth+C),l=0,u=t.offset;"middle"===t.anchor&&(o-=t.tx2width/2,s-=t.tx2width/2),e&&(u*=-E,l=t.offset*S),r.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(n*L+l)+","+(L+u)+"v"+(t.by/2-L)+"h"+n*t.bx+"v-"+t.by+"H"+(n*L+l)+"V"+(u-L)+"Z"),i.call(m.positionText,o+l,u+t.ty0-t.by/2+C),t.tx2width&&(r.select("text.name").call(m.positionText,s+a*C+l,u+t.ty0-t.by/2+C),r.select("rect").call(v.setRect,s+(a-1)*t.tx2width/2+l,u-t.by/2-1,t.tx2width,t.by+2))})}function s(t,e){function r(e,r,n){var i=s(r,n);i&&(t[e]=i)}var n=t.index,i=t.trace||{},a=t.cd[0],o=t.cd[n]||{},s=Array.isArray(n)?function(t,e){return d.castOption(a,n,t)||d.extractOption({},i,"",e)}:function(t,e){return d.extractOption(o,i,t,e)};r("hoverinfo","hi","hoverinfo"),r("color","hbg","hoverlabel.bgcolor"),r("borderColor","hbc","hoverlabel.bordercolor"),r("fontFamily","htf","hoverlabel.font.family"),r("fontSize","hts","hoverlabel.font.size"),r("fontColor","htc","hoverlabel.font.color"),r("nameLength","hnl","hoverlabel.namelength"),t.posref="y"===e?(t.x0+t.x1)/2:(t.y0+t.y1)/2,t.x0=d.constrain(t.x0,0,t.xa._length),t.x1=d.constrain(t.x1,0,t.xa._length),t.y0=d.constrain(t.y0,0,t.ya._length),t.y1=d.constrain(t.y1,0,t.ya._length);var l;if(void 0!==t.xLabelVal){l="log"===t.xa.type&&t.xLabelVal<=0;var u=x.tickText(t.xa,t.xa.c2l(l?-t.xLabelVal:t.xLabelVal),"hover");l?0===t.xLabelVal?t.xLabel="0":t.xLabel="-"+u.text:t.xLabel=u.text,t.xVal=t.xa.c2d(t.xLabelVal)}if(void 0!==t.yLabelVal){l="log"===t.ya.type&&t.yLabelVal<=0;var c=x.tickText(t.ya,t.ya.c2l(l?-t.yLabelVal:t.yLabelVal),"hover");l?0===t.yLabelVal?t.yLabel="0":t.yLabel="-"+c.text:t.yLabel=c.text,t.yVal=t.ya.c2d(t.yLabelVal)}if(void 0!==t.zLabelVal&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var h=x.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+h+" / -"+x.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+h,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var f=x.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+f+" / -"+x.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+f,"y"===e&&(t.distance+=1)}var p=t.hoverinfo||t.trace.hoverinfo;return"all"!==p&&(p=p.split("+"),-1===p.indexOf("x")&&(t.xLabel=void 0),-1===p.indexOf("y")&&(t.yLabel=void 0),-1===p.indexOf("z")&&(t.zLabel=void 0),-1===p.indexOf("text")&&(t.text=void 0),-1===p.indexOf("name")&&(t.name=void 0)),t}function l(t,e){var r=e.hovermode,n=e.container,i=t[0],a=i.xa,o=i.ya,s=a.showspikes,l=o.showspikes;if(n.selectAll(".spikeline").remove(),"closest"===r&&(s||l)){var u=e.fullLayout,c=a._offset+(i.x0+i.x1)/2,h=o._offset+(i.y0+i.y1)/2,d=y.combine(u.plot_bgcolor,u.paper_bgcolor),p=f.readability(i.color,d)<1.5?y.contrast(d):i.color;if(l){var m=o.spikemode,g=o.spikethickness,b=o.spikecolor||p,x=o._boundingBox,_=(x.left+x.right)/2=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber))return!0}return!1}var c=t("d3"),h=t("fast-isnumeric"),f=t("tinycolor2"),d=t("../../lib"),p=t("../../lib/events"),m=t("../../lib/svg_text_utils"),g=t("../../lib/override_cursor"),v=t("../drawing"),y=t("../color"),b=t("../dragelement"),x=t("../../plots/cartesian/axes"),_=t("../../registry"),w=t("./helpers"),M=t("./constants"),k=M.YANGLE,A=Math.PI*k/180,T=1/Math.sin(A),S=Math.cos(A),E=Math.sin(A),L=M.HOVERARROWSIZE,C=M.HOVERTEXTPAD;r.hover=function(t,e,r,i){t=d.getGraphDiv(t),d.throttle(t._fullLayout._uid+M.HOVERID,M.HOVERMINTIME,function(){n(t,e,r,i)})},r.loneHover=function(t,e){var r={color:t.color||y.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,trace:{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0},n=c.select(e.container),a=e.outerContainer?c.select(e.outerContainer):n,s={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||y.background,container:n,outerContainer:a},l=i([r],s,e.gd);return o(l,s.rotateLabels),l.node()}},{"../../lib":728,"../../lib/events":716,"../../lib/override_cursor":738,"../../lib/svg_text_utils":750,"../../plots/cartesian/axes":772,"../../registry":846,"../color":604,"../dragelement":625,"../drawing":628,"./constants":640,"./helpers":642,d3:122,"fast-isnumeric":131,tinycolor2:534}],644:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,i){i=i||{},r("hoverlabel.bgcolor",i.bgcolor),r("hoverlabel.bordercolor",i.bordercolor),r("hoverlabel.namelength",i.namelength),n.coerceFont(r,"hoverlabel.font",i.font)}},{"../../lib":728}],645:[function(t,e,r){"use strict";function n(t){var e=s.isD3Selection(t)?t:o.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()}function i(t,e,r){return s.castOption(t,e,"hoverlabel."+r)}function a(t,e,r){function n(r){return s.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}return s.castOption(t,r,"hoverinfo",n)}var o=t("d3"),s=t("../../lib"),l=t("../dragelement"),u=t("./helpers"),c=t("./layout_attributes");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:c},attributes:t("./attributes"),layoutAttributes:c,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:u.getDistanceFunction,getClosest:u.getClosest,inbox:u.inbox,appendArrayPointValue:u.appendArrayPointValue,castHoverOption:i,castHoverinfo:a,hover:t("./hover").hover,unhover:l.unhover,loneHover:t("./hover").loneHover,loneUnhover:n,click:t("./click")}},{"../../lib":728,"../dragelement":625,"./attributes":637,"./calc":638,"./click":639,"./constants":640,"./defaults":641,"./helpers":642,"./hover":643,"./layout_attributes":646,"./layout_defaults":647,"./layout_global_defaults":648,d3:122}],646:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../plots/font_attributes")({editType:"none"});i.family.dflt=n.HOVERFONT,i.size.dflt=n.HOVERFONTSIZE,e.exports={dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1],editType:"modebar"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:i,namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"}}},{"../../plots/font_attributes":796,"./constants":640}],647:[function(t,e,r){"use strict";function n(t){for(var e=!0,r=0;r=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}},{}],655:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes");e.exports={bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:i.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:n({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},x:{valType:"number",min:-2,max:3,dflt:1.02,editType:"legend"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",min:-2,max:3,dflt:1,editType:"legend"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"legend"},editType:"legend"}},{"../../plots/font_attributes":796,"../color/attributes":603}],656:[function(t,e,r){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],657:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("./attributes"),o=t("../../plots/layout_attributes"),s=t("./helpers");e.exports=function(t,e,r){function l(t,e){return i.coerce(d,p,a,t,e)}for(var u,c,h,f,d=t.legend||{},p=e.legend={},m=0,g="normal",v=0;v1)){if(l("bgcolor",e.paper_bgcolor),l("bordercolor"),l("borderwidth"),i.coerceFont(l,"font",e.font),l("orientation"),"h"===p.orientation){var b=t.xaxis;b&&b.rangeslider&&b.rangeslider.visible?(u=0,h="left",c=1.1,f="bottom"):(u=0,h="left",c=-.1,f="top")}l("traceorder",g),s.isGrouped(e.legend)&&l("tracegroupgap"),l("x",u),l("xanchor",h),l("y",c),l("yanchor",f),i.noneOrAll(d,p,["x","y"])}}},{"../../lib":728,"../../plots/layout_attributes":822,"../../registry":846,"./attributes":655,"./helpers":661}],658:[function(t,e,r){"use strict";function n(t,e){function r(r){v.convertToTspans(r,e,function(){a(t,e)})}var n=t.data()[0][0],i=e._fullLayout,o=n.trace,s=d.traceIs(o,"pie"),l=o.index,u=s?n.label:o.name,f=t.selectAll("text.legendtext").data([0]);f.enter().append("text").classed("legendtext",!0),f.attr("text-anchor","start").classed("user-select-none",!0).call(m.font,i.legend.font).text(u),e._context.edits.legendText&&!s?f.call(v.makeEditable,{gd:e}).call(r).on("edit",function(t){this.text(t).call(r);var i=t;this.text()||(t=" ");var a,o,s=n.trace._fullInput||{},u={};if(-1!==["ohlc","candlestick"].indexOf(s.type))a=n.trace.transforms,o=a[a.length-1].direction,u[o+".name"]=t;else if(d.hasTransform(s,"groupby")){var f=d.getTransformIndices(s,"groupby"),p=f[f.length-1],m=h.keyedContainer(s,"transforms["+p+"].styles","target","value.name");""===i?m.remove(n.trace._group):m.set(n.trace._group,t),u=m.constructUpdate()}else u.name=t;return c.restyle(e,u,l)}):f.call(r)}function i(t,e){var r,n=1,i=t.selectAll("rect").data([0]);i.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(g.fill,"rgba(0,0,0,0)"),i.on("mousedown",function(){r=(new Date).getTime(),r-e._legendMouseDownTimeT&&(n=Math.max(n-1,1)),1===n?r._clickTimeout=setTimeout(function(){y(t,e,n)},T):2===n&&(r._clickTimeout&&clearTimeout(r._clickTimeout),e._legendMouseDownTime=0,y(t,e,n))}})}function a(t,e){var r=t.data()[0][0];if(!r.trace.showlegend)return void t.remove();var n,i,a=t.select("g[class*=math-group]"),o=a.node(),s=e._fullLayout.legend,l=s.font.size*_;if(o){var u=m.bBox(o);n=u.height,i=u.width,m.setTranslate(a,0,n/4)}else{var c=t.select(".legendtext"),h=v.lineCount(c),f=c.node();n=l*h,i=f?m.bBox(f).width:0;var d=l*(.3+(1-h)/2);v.positionText(c,40,d)}n=Math.max(n,16)+3,r.height=n,r.width=i}function o(t,e,r){var n=t._fullLayout,i=n.legend,a=i.borderwidth,o=k.isGrouped(i),s=0;if(i.width=0,i.height=0,k.isVertical(i))o&&e.each(function(t,e){m.setTranslate(this,0,e*i.tracegroupgap)}),r.each(function(t){var e=t[0],r=e.height,n=e.width;m.setTranslate(this,a,5+a+i.height+r/2),i.height+=r,i.width=Math.max(i.width,n)}),i.width+=45+2*a,i.height+=10+2*a,o&&(i.height+=(i._lgroupsLength-1)*i.tracegroupgap),s=40;else if(o){for(var l=[i.width],c=e.data(),h=0,f=c.length;hn.width-(n.margin.r+n.margin.l)&&(b=0,g+=v,i.height=i.height+v,v=0),m.setTranslate(this,a+b,5+a+e.height/2+g),i.width+=o+r,i.height=Math.max(i.height,e.height),b+=o+r,v=Math.max(e.height,v)}),i.width+=2*a,i.height+=10+2*a}i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),r.each(function(e){var r=e[0];u.select(this).select(".legendtoggle").call(m.setRect,0,-r.height/2,(t._context.edits.legendText?0:i.width)+s,r.height)})}function s(t){var e=t._fullLayout,r=e.legend,n="left";A.isRightAnchor(r)?n="right":A.isCenterAnchor(r)&&(n="center");var i="top";A.isBottomAnchor(r)?i="bottom":A.isMiddleAnchor(r)&&(i="middle"),f.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}[i]||0),t:r.height*({bottom:1,middle:.5}[i]||0)})}function l(t){var e=t._fullLayout,r=e.legend,n="left";A.isRightAnchor(r)?n="right":A.isCenterAnchor(r)&&(n="center"),f.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 u=t("d3"),c=t("../../plotly"),h=t("../../lib"),f=t("../../plots/plots"),d=t("../../registry"),p=t("../dragelement"),m=t("../drawing"),g=t("../color"),v=t("../../lib/svg_text_utils"),y=t("./handle_click"),b=t("./constants"),x=t("../../constants/interactions"),_=t("../../constants/alignment").LINE_SPACING,w=t("./get_legend_data"),M=t("./style"),k=t("./helpers"),A=t("./anchor_utils"),T=x.DBLCLICKDELAY;e.exports=function(t){function e(t,e){L.attr("data-scroll",e).call(m.setTranslate,0,e),C.call(m.setRect,N,t,b.scrollBarWidth,b.scrollBarHeight),S.select("rect").attr({y:v.borderwidth-e})}var r=t._fullLayout,a="legend"+r._uid;if(r._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var v=r.legend,x=r.showlegend&&w(t.calcdata,v),_=r.hiddenlabels||[];if(!r.showlegend||!x.length)return r._infolayer.selectAll(".legend").remove(),r._topdefs.select("#"+a).remove(),void f.autoMargin(t,"legend");var k=r._infolayer.selectAll("g.legend").data([0]);k.enter().append("g").attr({class:"legend","pointer-events":"all"});var S=r._topdefs.selectAll("#"+a).data([0]);S.enter().append("clipPath").attr("id",a).append("rect");var E=k.selectAll("rect.bg").data([0]);E.enter().append("rect").attr({class:"bg","shape-rendering":"crispEdges"}),E.call(g.stroke,v.bordercolor),E.call(g.fill,v.bgcolor),E.style("stroke-width",v.borderwidth+"px");var L=k.selectAll("g.scrollbox").data([0]);L.enter().append("g").attr("class","scrollbox");var C=k.selectAll("rect.scrollbar").data([0]);C.enter().append("rect").attr({class:"scrollbar",rx:20,ry:2,width:0,height:0}).call(g.fill,"#808BA4");var I=L.selectAll("g.groups").data(x);I.enter().append("g").attr("class","groups"),I.exit().remove();var z=I.selectAll("g.traces").data(h.identity) ;z.enter().append("g").attr("class","traces"),z.exit().remove(),z.call(M,t).style("opacity",function(t){var e=t[0].trace;return d.traceIs(e,"pie")?-1!==_.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){u.select(this).call(n,t).call(i,t)});var D=0!==k.enter().size();D&&(o(t,I,z),s(t));var P=r.width,O=r.height;o(t,I,z),v.height>O?l(t):s(t);var R=r._size,F=R.l+R.w*v.x,j=R.t+R.h*(1-v.y);A.isRightAnchor(v)?F-=v.width:A.isCenterAnchor(v)&&(F-=v.width/2),A.isBottomAnchor(v)?j-=v.height:A.isMiddleAnchor(v)&&(j-=v.height/2);var N=v.width,B=R.w;N>B?(F=R.l,N=B):(F+N>P&&(F=P-N),F<0&&(F=0),N=Math.min(P-F,v.width));var U=v.height,V=R.h;U>V?(j=R.t,U=V):(j+U>O&&(j=O-U),j<0&&(j=0),U=Math.min(O-j,v.height)),m.setTranslate(k,F,j);var H,q,G=U-b.scrollBarHeight-2*b.scrollBarMargin,Y=v.height-U;if(v.height<=U||t._context.staticPlot)E.attr({width:N-v.borderwidth,height:U-v.borderwidth,x:v.borderwidth/2,y:v.borderwidth/2}),m.setTranslate(L,0,0),S.select("rect").attr({width:N-2*v.borderwidth,height:U-2*v.borderwidth,x:v.borderwidth,y:v.borderwidth}),L.call(m.setClipUrl,a);else{H=b.scrollBarMargin,q=L.attr("data-scroll")||0,E.attr({width:N-2*v.borderwidth+b.scrollBarWidth+b.scrollBarMargin,height:U-v.borderwidth,x:v.borderwidth/2,y:v.borderwidth/2}),S.select("rect").attr({width:N-2*v.borderwidth+b.scrollBarWidth+b.scrollBarMargin,height:U-2*v.borderwidth,x:v.borderwidth,y:v.borderwidth-q}),L.call(m.setClipUrl,a),D&&e(H,q),k.on("wheel",null),k.on("wheel",function(){q=h.constrain(L.attr("data-scroll")-u.event.deltaY/G*Y,-Y,0),H=b.scrollBarMargin-q/Y*G,e(H,q),0!==q&&q!==-Y&&u.event.preventDefault()}),C.on(".drag",null),L.on(".drag",null);var W=u.behavior.drag().on("drag",function(){H=h.constrain(u.event.y-b.scrollBarHeight/2,b.scrollBarMargin,b.scrollBarMargin+G),q=-(H-b.scrollBarMargin)/G*Y,e(H,q)});C.call(W),L.call(W)}if(t._context.edits.legendPosition){var X,Z,J,K;k.classed("cursor-move",!0),p.init({element:k.node(),gd:t,prepFn:function(){var t=m.getTranslate(k);J=t.x,K=t.y},moveFn:function(t,e){var r=J+t,n=K+e;m.setTranslate(k,r,n),X=p.align(r,0,R.l,R.l+R.w,v.xanchor),Z=p.align(n,0,R.t+R.h,R.t,v.yanchor)},doneFn:function(e,n,i){if(e&&void 0!==X&&void 0!==Z)c.relayout(t,{"legend.x":X,"legend.y":Z});else{var a=r._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return i.clientX>=t.left&&i.clientX<=t.right&&i.clientY>=t.top&&i.clientY<=t.bottom});a.size()>0&&(1===n?k._clickTimeout=setTimeout(function(){y(a,t,n)},T):2===n&&(k._clickTimeout&&clearTimeout(k._clickTimeout),y(a,t,n)))}}})}}}},{"../../constants/alignment":701,"../../constants/interactions":706,"../../lib":728,"../../lib/svg_text_utils":750,"../../plotly":767,"../../plots/plots":831,"../../registry":846,"../color":604,"../dragelement":625,"../drawing":628,"./anchor_utils":654,"./constants":656,"./get_legend_data":659,"./handle_click":660,"./helpers":661,"./style":663,d3:122}],659:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){function r(t,r){if(""!==t&&i.isGrouped(e))-1===l.indexOf(t)?(l.push(t),u=!0,s[t]=[[r]]):s[t].push([r]);else{var n="~~i"+h;l.push(n),s[n]=[[r]],h++}}var a,o,s={},l=[],u=!1,c={},h=0;for(a=0;ar[1])return r[1]}return i}function i(t){return t[0]}var s,u,c=t[0],h=c.trace,f=l.hasMarkers(h),d=l.hasText(h),p=l.hasLines(h);if(f||d||p){var m={},g={};f&&(m.mc=r("marker.color",i),m.mo=r("marker.opacity",a.mean,[.2,1]),m.ms=r("marker.size",a.mean,[2,16]),m.mlc=r("marker.line.color",i),m.mlw=r("marker.line.width",a.mean,[0,5]),g.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),p&&(g.line={width:r("line.width",i,[0,10])}),d&&(m.tx="Aa",m.tp=r("textposition",i),m.ts=10,m.tc=r("textfont.color",i),m.tf=r("textfont.family",i)),s=[a.minExtend(c,m)],u=a.minExtend(h,g)}var v=n.select(this).select("g.legendpoints"),y=v.selectAll("path.scatterpts").data(f?s:[]);y.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),y.exit().remove(),y.call(o.pointStyle,u,e),f&&(s[0].mrc=3);var b=v.selectAll("g.pointtext").data(d?s:[]);b.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),b.exit().remove(),b.selectAll("text").call(o.textPointStyle,u,e)}function h(t){var e=t[0].trace,r=e.marker||{},a=r.line||{},o=n.select(this).select("g.legendpoints").selectAll("path.legendbar").data(i.traceIs(e,"bar")?[t]:[]);o.enter().append("path").classed("legendbar",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),o.exit().remove(),o.each(function(t){var e=n.select(this),i=t[0],o=(i.mlw+1||a.width+1)-1;e.style("stroke-width",o+"px").call(s.fill,i.mc||r.color),o&&e.call(s.stroke,i.mlc||a.color)})}function f(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(i.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(){var t=e.line.width,r=n.select(this);r.style("stroke-width",t+"px").call(s.fill,e.fillcolor),t&&r.call(s.stroke,e.line.color)})}function d(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendpie").data(i.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(u,t[0],e)}t.each(function(t){var e=n.select(this),r=e.selectAll("g.layers").data([0]);r.enter().append("g").classed("layers",!0),r.style("opacity",t[0].trace.opacity),r.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),r.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var i=r.selectAll("g.legendsymbols").data([t]);i.enter().append("g").classed("legendsymbols",!0),i.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(h).each(f).each(d).each(r).each(c)}},{"../../lib":728,"../../registry":846,"../../traces/pie/style_one":1017,"../../traces/scatter/subtypes":1052,"../color":604,"../drawing":628,d3:122}],664:[function(t,e,r){"use strict";function n(t,e){var r,n,i=e.currentTarget,a=i.getAttribute("data-attr"),o=i.getAttribute("data-val")||!0,s=t._fullLayout,l={},u=d.list(t,null,!0),c="on";if("zoom"===a){var f,p="in"===o?.5:2,m=(1+p)/2,g=(1-p)/2;for(n=0;n1)return n(["resetViews","toggleHover"]),o(v,r);c&&(n(["zoom3d","pan3d","orbitRotation","tableRotation"]),n(["resetCameraDefault3d","resetCameraLastSave3d"]),n(["hoverClosest3d"]));var y=i(s),b=[];return((u||p)&&!y||m)&&(b=["zoom2d","pan2d"]),(g||h)&&(b=["pan2d"]),a(l)&&(b.push("select2d"),b.push("lasso2d")),b.length&&n(b),!u&&!p||y||m||n(["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"]),u&&d?n(["toggleHover"]):p?n(["hoverClosestGl2d"]):u?n(["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]):d?n(["hoverClosestPie"]):g?n(["resetViewMapbox","toggleHover"]):h&&(n(["zoomInGeo","zoomOutGeo","resetGeo"]),n(["hoverClosestGeo"])),o(v,r)}function i(t){for(var e=l.list({_fullLayout:t},null,!0),r=!0,n=0;n0)){var p=i(e,r,l);h("x",p[0]),h("y",p[1]),a.noneOrAll(t,e,["x","y"]),h("xanchor"),h("yanchor"),a.coerceFont(h,"font",r.font);var m=h("bgcolor");h("activecolor",o.contrast(m,u.lightAmount,u.darkAmount)),h("bordercolor"),h("borderwidth")}}},{"../../lib":728,"../color":604,"./attributes":668,"./button_attributes":669,"./constants":670}],672:[function(t,e,r){"use strict";function n(t){for(var e=v.list(t,"x",!0),r=[],n=0;np&&(p=f)));return p>=d?[d,p]:void 0}}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./constants"),s=t("./helpers");e.exports=function(t){var e=t._fullLayout,r=i.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var s=0;sY&&n>W&&!t.shiftKey?p.getCursor(i/r,1-a/n):"move";m(e,o),G=o.split("-")[0]}function a(e){N=h.getFromId(t,r.xref),B=h.getFromId(t,r.yref),U=v.getDataToPixel(t,N),V=v.getDataToPixel(t,B,!0),H=v.getPixelToData(t,N),q=v.getPixelToData(t,B,!0);var a="shapes["+n+"]";"path"===r.type?(F=r.path,j=a+".path"):(g=U(r.x0),y=V(r.y0),b=U(r.x1),x=V(r.y1),_=a+".x0",w=a+".y0",M=a+".x1",k=a+".y1"),gW&&(d[L]=r[D]=q(u),d[C]=r[P]=q(c)),f-h>Y&&(d[I]=r[O]=H(h),d[z]=r[R]=H(f))}e.attr("d",o(t,r))}var d,g,y,b,x,_,w,M,k,A,T,S,E,L,C,I,z,D,P,O,R,F,j,N,B,U,V,H,q,G,Y=10,W=10,X={element:e.node(),gd:t,prepFn:a,doneFn:s},Z=X.element.getBoundingClientRect();p.init(X),e.node().onmousemove=i}function o(t,e){var r,n,i,a,o=e.type,l=h.getFromId(t,e.xref),u=h.getFromId(t,e.yref),c=t._fullLayout._size;if(l?(r=v.shapePositionToRange(l),n=function(t){return l._offset+l.r2p(r(t,!0))}):n=function(t){return c.l+c.w*t},u?(i=v.shapePositionToRange(u),a=function(t){return u._offset+u.r2p(i(t,!0))}):a=function(t){return c.t+c.h*(1-t)},"path"===o)return l&&"date"===l.type&&(n=v.decodeDate(n)),u&&"date"===u.type&&(a=v.decodeDate(a)),s(e.path,n,a);var f=n(e.x0),d=n(e.x1),p=a(e.y0),m=a(e.y1);if("line"===o)return"M"+f+","+p+"L"+d+","+m;if("rect"===o)return"M"+f+","+p+"H"+d+"V"+m+"H"+f+"Z";var g=(f+d)/2,y=(p+m)/2,b=Math.abs(g-f),x=Math.abs(y-p),_="A"+b+","+x,w=g+b+","+y;return"M"+w+_+" 0 1,1 "+g+","+(y-x)+_+" 0 0,1 "+w+"Z"}function s(t,e,r){return t.replace(g.segmentRE,function(t){var n=0,i=t.charAt(0),a=g.paramIsX[i],o=g.paramIsY[i],s=g.numParams[i],l=t.substr(1).replace(g.paramRE,function(t){return a[n]?t=e(t):o[n]&&(t=r(t)),n++,n>s&&(t="X"),t});return n>s&&(l=l.replace(/[\s,]*X.*/,""),c.log("Ignoring extra params in segment "+t)),i+l})}function l(t,e,r){return t.replace(g.segmentRE,function(t){var n=0,i=t.charAt(0),a=g.paramIsX[i],o=g.paramIsY[i],s=g.numParams[i];return i+t.substr(1).replace(g.paramRE,function(t){return n>=s?t:(a[n]?t=e(t):o[n]&&(t=r(t)),n++,t)})})}var u=t("../../plotly"),c=t("../../lib"),h=t("../../plots/cartesian/axes"),f=t("../color"),d=t("../drawing"),p=t("../dragelement"),m=t("../../lib/setcursor"),g=t("./constants"),v=t("./helpers");e.exports={draw:n,drawOne:i}},{"../../lib":728,"../../lib/setcursor":746,"../../plotly":767,"../../plots/cartesian/axes":772,"../color":604,"../dragelement":625,"../drawing":628,"./constants":683,"./helpers":686}],686:[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 i,a=t._fullLayout._size;if(e){var o=r.shapePositionToRange(e);i=function(t){return e._offset+e.r2p(o(t,!0))},"date"===e.type&&(i=r.decodeDate(i))}else i=n?function(t){return a.t+a.h*(1-t)}:function(t){return a.l+a.w*t};return i},r.getPixelToData=function(t,e,n){var i,a=t._fullLayout._size;if(e){var o=r.rangeToShapePosition(e);i=function(t){return o(e.p2r(t-e._offset))}}else i=n?function(t){return 1-(t-a.t)/a.h}:function(t){return(t-a.l)/a.w};return i}},{}],687:[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":681,"./calc_autorange":682,"./defaults":684,"./draw":685}],688:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./attributes"),o=t("./helpers");e.exports=function(t,e,r,s,l){function u(r,i){return n.coerce(t,e,a,r,i)}if(s=s||{},l=l||{},!u("visible",!l.itemIsNotPlainObject))return e;u("layer"),u("opacity"),u("fillcolor"),u("line.color"),u("line.width"),u("line.dash");for(var c=t.path?"path":"rect",h=u("type",c),f=["x","y"],d=0;d<2;d++){var p=f[d],m={_fullLayout:r},g=i.coerceRef(t,e,m,p,"","paper");if("path"!==h){var v,y,b;"paper"!==g?(v=i.getFromId(m,g),b=o.rangeToShapePosition(v),y=o.shapePositionToRange(v)):y=b=n.identity;var x=p+"0",_=p+"1",w=t[x],M=t[_];t[x]=y(t[x],!0),t[_]=y(t[_],!0),i.coercePosition(e,m,u,g,x,.25),i.coercePosition(e,m,u,g,_,.75),e[x]=b(e[x]),e[_]=b(e[_]),t[x]=w,t[_]=M}}return"path"===h?u("path"):n.noneOrAll(t,e,["x0","x1","y0","y1"]),e}},{"../../lib":728,"../../plots/cartesian/axes":772,"./attributes":681,"./helpers":686}],689:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/pad_attributes"),a=t("../../lib/extend").extendDeepAll,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/animation_attributes"),l=t("./constants"),u={_isLinkedToArray:"step",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}};e.exports=o({_isLinkedToArray:"slider",visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:u,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:a({},i,{},{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:s.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:n({})},font:n({}),activebgcolor:{valType:"color",dflt:l.gripBgActiveColor},bgcolor:{valType:"color",dflt:l.railBgColor},bordercolor:{valType:"color",dflt:l.railBorderColor},borderwidth:{valType:"number",min:0,dflt:l.railBorderWidth},ticklen:{valType:"number",min:0,dflt:l.tickLength},tickcolor:{valType:"color",dflt:l.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:l.minorTickLength}},"arraydraw","from-root")},{"../../lib/extend":717,"../../plot_api/edit_types":756,"../../plots/animation_attributes":768,"../../plots/font_attributes":796,"../../plots/pad_attributes":830,"./constants":690}],690:[function(t,e,r){"use strict";e.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],691:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return a.coerce(t,e,s,r,n)}n("visible",i(t,e).length>0)&&(n("active"),n("x"),n("y"),a.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"),a.coerceFont(n,"font",r.font),n("currentvalue.visible")&&(n("currentvalue.xanchor"),n("currentvalue.prefix"),n("currentvalue.suffix"),n("currentvalue.offset"),a.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 i(t,e){function r(t,e){return a.coerce(n,i,c,t,e)}for(var n,i,o=t.steps||[],s=e.steps=[],l=0;l=r.steps.length&&(r.active=0),e.call(s,r).call(x,r).call(c,r).call(p,r).call(b,t,r).call(l,t,r),A.setTranslate(e,r.lx+r.pad.l,r.ly+r.pad.t),e.call(g,r,r.active/(r.steps.length-1),!1),e.call(s,r)}function s(t,e,r){if(e.currentvalue.visible){var n,i,a=t.selectAll("text").data([0]);switch(e.currentvalue.xanchor){case"right":n=e.inputAreaLength-E.currentValueInset-e.currentValueMaxWidth,i="left";break;case"center":n=.5*e.inputAreaLength,i="middle";break;default:n=E.currentValueInset,i="left"}a.enter().append("text").classed(E.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":i,"data-notex":1});var o=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)o+=r;else{o+=e.steps[e.active].label}e.currentvalue.suffix&&(o+=e.currentvalue.suffix),a.call(A.font,e.currentvalue.font).text(o).call(T.convertToTspans,e.gd);var s=T.lineCount(a),l=(e.currentValueMaxLines+1-s)*e.currentvalue.font.size*L;return T.positionText(a,n,l),a}}function l(t,e,r){var n=t.selectAll("rect."+E.gripRectClass).data([0]);n.enter().append("rect").classed(E.gripRectClass,!0).call(d,e,t,r).style("pointer-events","all"),n.attr({width:E.gripWidth,height:E.gripHeight,rx:E.gripRadius,ry:E.gripRadius}).call(k.stroke,r.bordercolor).call(k.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function u(t,e,r){var n=t.selectAll("text").data([0]);return n.enter().append("text").classed(E.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1}),n.call(A.font,r.font).text(e.step.label).call(T.convertToTspans,r.gd),n}function c(t,e){var r=t.selectAll("g."+E.labelsClass).data([0]);r.enter().append("g").classed(E.labelsClass,!0);var n=r.selectAll("g."+E.labelGroupClass).data(e.labelSteps);n.enter().append("g").classed(E.labelGroupClass,!0),n.exit().remove(),n.each(function(t){var r=w.select(this);r.call(u,t,e),A.setTranslate(r,v(e,t.fraction),E.tickOffset+e.ticklen+e.font.size*L+E.labelOffset+e.currentValueTotalHeight)})}function h(t,e,r,n,i){var a=Math.round(n*(r.steps.length-1));a!==r.active&&f(t,e,r,a,!0,i)}function f(t,e,r,n,i,a){var o=r.active;r._input.active=r.active=n;var l=r.steps[r.active];e.call(g,r,r.active/(r.steps.length-1),a),e.call(s,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:i,previousActive:o}),l&&l.method&&i&&(e._nextMethod?(e._nextMethod.step=l,e._nextMethod.doCallback=i,e._nextMethod.doTransition=a):(e._nextMethod={step:l,doCallback:i,doTransition:a},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(r.execute&&M.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function d(t,e,r){function n(){return r.data()[0]}var i=r.node(),a=w.select(e);t.on("mousedown",function(){var t=n();e.emit("plotly_sliderstart",{slider:t});var o=r.select("."+E.gripRectClass);w.event.stopPropagation(),w.event.preventDefault(),o.call(k.fill,t.activebgcolor);var s=y(t,w.mouse(i)[0]);h(e,r,t,s,!0),t._dragging=!0,a.on("mousemove",function(){var t=n(),a=y(t,w.mouse(i)[0]);h(e,r,t,a,!1)}),a.on("mouseup",function(){var t=n();t._dragging=!1,o.call(k.fill,t.bgcolor),a.on("mouseup",null),a.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function p(t,e){var r=t.selectAll("rect."+E.tickRectClass).data(e.steps);r.enter().append("rect").classed(E.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each(function(t,r){var n=r%e.labelStride==0,i=w.select(this);i.attr({height:n?e.ticklen:e.minorticklen}).call(k.fill,e.tickcolor),A.setTranslate(i,v(e,r/(e.steps.length-1))-.5*e.tickwidth,(n?E.tickOffset:E.minorTickOffset)+e.currentValueTotalHeight)})}function m(t){t.labelSteps=[];for(var e=t.steps.length,r=0;r0&&(o=o.transition().duration(e.transition.duration).ease(e.transition.easing)),o.attr("transform","translate("+(a-.5*E.gripWidth)+","+e.currentValueTotalHeight+")")}}function v(t,e){return t.inputAreaStart+E.stepInset+(t.inputAreaLength-2*E.stepInset)*Math.min(1,Math.max(0,e))}function y(t,e){return Math.min(1,Math.max(0,(e-E.stepInset-t.inputAreaStart)/(t.inputAreaLength-2*E.stepInset-2*t.inputAreaStart)))}function b(t,e,r){var n=t.selectAll("rect."+E.railTouchRectClass).data([0]);n.enter().append("rect").classed(E.railTouchRectClass,!0).call(d,e,t,r).style("pointer-events","all"),n.attr({width:r.inputAreaLength,height:Math.max(r.inputAreaWidth,E.tickOffset+r.ticklen+r.labelHeight)}).call(k.fill,r.bgcolor).attr("opacity",0),A.setTranslate(n,0,r.currentValueTotalHeight)}function x(t,e){var r=t.selectAll("rect."+E.railRectClass).data([0]);r.enter().append("rect").classed(E.railRectClass,!0);var n=e.inputAreaLength-2*E.railInset;r.attr({width:n,height:E.railWidth,rx:E.railRadius,ry:E.railRadius,"shape-rendering":"crispEdges"}).call(k.stroke,e.bordercolor).call(k.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),A.setTranslate(r,E.railInset,.5*(e.inputAreaWidth-E.railWidth)+e.currentValueTotalHeight)}function _(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n0?[0]:[]);if(s.enter().append("g").classed(E.containerClassName,!0).style("cursor","ew-resize"),s.exit().remove(),s.exit().size()&&_(t),0!==r.length){var l=s.selectAll("g."+E.groupClassName).data(r,i);l.enter().append("g").classed(E.groupClassName,!0),l.exit().each(function(e){w.select(this).remove(),e._commandObserver.remove(),delete e._commandObserver,M.autoMargin(t,E.autoMarginIdRoot+e._index)});for(var u=0;u0||f<0){var m={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[_.side];e.attr("transform","translate("+m+")")}}}var g,v=r.propContainer,y=r.propName,b=r.traceIndex,x=r.dfltName,_=r.avoid||{},w=r.attributes,M=r.transform,k=r.containerGroup,A=t._fullLayout,T=v.titlefont.family,S=v.titlefont.size,E=v.titlefont.color,L=1,C=!1,I=v.title.trim();"title"===y?g="titleText":-1!==y.indexOf("axis")?g="axisTitleText":y.indexOf(!0)&&(g="colorbarTitleText");var z=t._context.edits[g];""===I&&(L=0),I.match(f)&&(L=.2,C=!0,z||(I=""));var D=I||z;k||(k=A._infolayer.selectAll(".g-"+e).data([0]),k.enter().append("g").classed("g-"+e,!0));var P=k.selectAll("text").data(D?[0]:[]);if(P.enter().append("text"),P.text(I).attr("class",e),P.exit().remove(),D){P.call(d);var O="Click to enter "+x+" title";z&&(I?P.on(".opacity",null):function(){L=0,C=!0,I=O,P.text(I).on("mouseover.opacity",function(){n.select(this).transition().duration(h.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(h.HIDE_PLACEHOLDER).style("opacity",0)})}(),P.call(c.makeEditable,{gd:t}).on("edit",function(e){void 0!==b?a.restyle(t,y,e,b):a.relayout(t,y,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(d)}).on("input",function(t){this.text(t||" ").call(c.positionText,w.x,w.y)})),P.classed("js-placeholder",C)}}},{"../../constants/interactions":706,"../../lib":728,"../../lib/svg_text_utils":750,"../../plotly":767,"../../plots/plots":831,"../color":604,"../drawing":628,d3:122,"fast-isnumeric":131}],695:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l={_isLinkedToArray:"button",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}};e.exports=o({_isLinkedToArray:"updatemenu",_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons: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:a({},s,{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}},"arraydraw","from-root")},{"../../lib/extend":717,"../../plot_api/edit_types":756,"../../plots/font_attributes":796,"../../plots/pad_attributes":830,"../color/attributes":603}],696:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],697:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return a.coerce(t,e,s,r,n)}n("visible",i(t,e).length>0)&&(n("active"),n("direction"),n("type"),n("showactive"),n("x"),n("y"),a.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),a.coerceFont(n,"font",r.font),n("bgcolor",r.paper_bgcolor),n("bordercolor"),n("borderwidth"))}function i(t,e){function r(t,e){return a.coerce(n,i,c,t,e)}for(var n,i,o=t.buttons||[],s=e.buttons=[],l=0;l0?[0]:[]);if(a.enter().append("g").classed(L.containerClassName,!0).style("cursor","pointer"),a.exit().remove(),a.exit().size()&&_(t),0!==r.length){var c=a.selectAll("g."+L.headerGroupClassName).data(r,i);c.enter().append("g").classed(L.headerGroupClassName,!0);var h=a.selectAll("g."+L.dropdownButtonGroupClassName).data([0]);h.enter().append("g").classed(L.dropdownButtonGroupClassName,!0).style("pointer-events","all");for(var f=0;fM,T=n.barLength+2*n.barPad,S=n.barWidth+2*n.barPad,E=p,L=g+v;L+S>u&&(L=u-S);var C=this.container.selectAll("rect.scrollbar-horizontal").data(A?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,n.barColor),A?(this.hbar=C.attr({rx:n.barRadius,ry:n.barRadius,x:E,y:L,width:T,height:S}),this._hbarXMin=E+T/2,this._hbarTranslateMax=M-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var I=v>k,z=n.barWidth+2*n.barPad,D=n.barLength+2*n.barPad,P=p+m,O=g;P+z>l&&(P=l-z);var R=this.container.selectAll("rect.scrollbar-vertical").data(I?[0]:[]);R.exit().on(".drag",null).remove(),R.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,n.barColor),I?(this.vbar=R.attr({rx:n.barRadius,ry:n.barRadius,x:P,y:O,width:z,height:D}),this._vbarYMin=O+D/2,this._vbarTranslateMax=k-D):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var F=this.id,j=c-.5,N=I?h+z+.5:h+.5,B=f-.5,U=A?d+S+.5:d+.5,V=s._topdefs.selectAll("#"+F).data(A||I?[0]:[]);if(V.exit().remove(),V.enter().append("clipPath").attr("id",F).append("rect"),A||I?(this._clipRect=V.select("rect").attr({x:Math.floor(j),y:Math.floor(B),width:Math.ceil(N)-Math.floor(j),height:Math.ceil(U)-Math.floor(B)}),this.container.call(o.setClipUrl,F),this.bg.attr({x:p,y:g,width:m,height:v})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),A||I){var H=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(H);var q=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault(),i.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));A&&this.hbar.on(".drag",null).call(q),I&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,r)},n.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},n.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=i.event.dx),this.vbar&&(e-=i.event.dy),this.setTranslate(t,e)},n.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=i.event.deltaY),this.vbar&&(e+=i.event.deltaY),this.setTranslate(t,e)},n.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,n=r+this._hbarTranslateMax;t=(s.constrain(i.event.x,r,n)-r)/(n-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,o=a+this._vbarTranslateMax;e=(s.constrain(i.event.y,a,o)-a)/(o-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},n.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=s.constrain(t||0,0,r),e=s.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(o.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/r;this.hbar.call(o.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var a=e/n;this.vbar.call(o.setTranslate,t,e+a*this._vbarTranslateMax)}}},{"../../lib":728,"../color":604,"../drawing":628,d3:122}],701:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},LINE_SPACING:1.3,MID_SHIFT:.35}},{}],702:[function(t,e,r){"use strict";e.exports={solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}},{}],703:[function(t,e,r){"use strict";for(var n=t("../lib/extend").extendFlat,i={circle:{unicode:"\u25cf"},square:{unicode:"\u25a0"},diamond:{unicode:"\u25c6"},cross:{unicode:"\u271a"},x:{unicode:"\u274c"},"triangle-up":{unicode:"\u25b2"},"triangle-down":{unicode:"\u25bc"},"triangle-left":{unicode:"\u25c4"},"triangle-right":{unicode:"\u25ba"},"triangle-ne":{unicode:"\u25e5"},"triangle-nw":{unicode:"\u25e4"},"triangle-se":{unicode:"\u25e2"},"triangle-sw":{unicode:"\u25e3"},pentagon:{unicode:"\u2b1f"},hexagon:{unicode:"\u2b22"},hexagon2:{unicode:"\u2b23"},star:{unicode:"\u2605"},"diamond-tall":{unicode:"\u2666"},bowtie:{unicode:"\u29d3"},"diamond-x":{unicode:"\u2756"},"cross-thin":{unicode:"+",noBorder:!0},asterisk:{unicode:"\u2733",noBorder:!0},"y-up":{unicode:"\u2144",noBorder:!0},"y-down":{unicode:"Y",noBorder:!0},"line-ew":{unicode:"\u2500",noBorder:!0},"line-ns":{unicode:"\u2502",noBorder:!0}},a={},o=Object.keys(i),s=0;s","#62":">",nbsp:"\xa0","#160":"\xa0",times:"\xd7","#215":"\xd7",plusmn:"\xb1","#177":"\xb1",deg:"\xb0","#176":"\xb0"}}},{}],709:[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}},{}],710:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.31.1",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/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":595,"./components/annotations3d":600,"./components/fx":645,"./components/images":653,"./components/legend":662,"./components/rangeselector":674,"./components/rangeslider":680,"./components/shapes":687,"./components/sliders":693,"./components/updatemenus":699,"./fonts/mathjax_config":711,"./lib/queue":741,"./plot_api/plot_schema":761,"./plot_api/register":762,"./plot_api/set_plot_config":763,"./plot_api/to_image":765,"./plot_api/validate":766,"./plotly":767,"./snapshot":851,"./snapshot/download":848,"./traces/scatter":1042,d3:122,"es6-promise":128}],711:[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},{}],712:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../constants/numerical").BADNUM,a=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(a,"")),n(t)?Number(t):i}},{"../constants/numerical":707,"fast-isnumeric":131}],713:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("../plots/attributes"),o=t("../components/colorscale/get_scale"),s=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),l=t("./regex").counter;r.valObjectMeta={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),-1===n.values.indexOf(t)?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;ni.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},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){if("string"==typeof t&&l(r).test(t))return void e.set(t);e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!l(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"!=typeof t)return void e.set(r);if(-1!==(n.extras||[]).indexOf(t))return void e.set(t);for(var i=t.split("+"),a=0;a0&&(o=o.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+o}return n}function l(t){return t.formatDate("yyyy")}function u(t){return t.formatDate("M yyyy")}function c(t){return t.formatDate("M d")}function h(t){return t.formatDate("M d, yyyy")}var f=t("d3"),d=t("fast-isnumeric"),p=t("./loggers").error,m=t("./mod"),g=t("../constants/numerical"),v=g.BADNUM,y=g.ONEDAY,b=g.ONEHOUR,x=g.ONEMIN,_=g.ONESEC,w=g.EPOCHJD,M=t("../registry"),k=f.time.format.utc,A=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,T=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,S=(new Date).getFullYear()-70;r.dateTick0=function(t,e){return n(t)?e?M.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:M.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},r.dfltRange=function(t){return n(t)?M.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},r.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime};var E,L;r.dateTime2ms=function(t,e){if(r.isJSDate(t))return t=Number(t)-t.getTimezoneOffset()*x,t>=E&&t<=L?t:v;if("string"!=typeof t&&"number"!=typeof t)return v;t=String(t);var i=n(e),a=t.charAt(0);!i||"G"!==a&&"g"!==a||(t=t.substr(1),e="");var o=i&&"chinese"===e.substr(0,7),s=t.match(o?T:A);if(!s)return v;var l=s[1],u=s[3]||"1",c=Number(s[5]||1),h=Number(s[7]||0),f=Number(s[9]||0),d=Number(s[11]||0);if(i){if(2===l.length)return v;l=Number(l);var p;try{var m=M.getComponentMethod("calendars","getCal")(e);if(o){var g="i"===u.charAt(u.length-1);u=parseInt(u,10),p=m.newDate(l,m.toMonthIndex(l,u,g),c)}else p=m.newDate(l,Number(u),c)}catch(t){return v}return p?(p.toJD()-w)*y+h*b+f*x+d*_:v}l=2===l.length?(Number(l)+2e3-S)%100+S:Number(l),u-=1;var k=new Date(Date.UTC(2e3,u,c,h,f));return k.setUTCFullYear(l),k.getUTCMonth()!==u?v:k.getUTCDate()!==c?v:k.getTime()+d*_},E=r.MIN_MS=r.dateTime2ms("-9999"),L=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==v};var C=90*y,I=3*b,z=5*x;r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=E&&t<=L))return v;e||(e=0);var i,o,s,l,u,c,h=Math.floor(10*m(t+.05,1)),f=Math.round(t-h/10);if(n(r)){var d=Math.floor(f/y)+w,p=Math.floor(m(t,y));try{i=M.getComponentMethod("calendars","getCal")(r).fromJD(d).formatDate("yyyy-mm-dd")}catch(t){i=k("G%Y-%m-%d")(new Date(f))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e=E+y&&t<=L-y))return v;var e=Math.floor(10*m(t+.05,1)),r=new Date(Math.round(t-e/10));return a(f.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,i){if(r.isJSDate(t)||"number"==typeof t){if(n(i))return p("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,i))return p("unrecognized date",t),e;return t};var D=/%\d?f/g,P=[59,59.9,59.99,59.999,59.9999],O=k("%Y"),R=k("%b %Y"),F=k("%b %-d"),j=k("%b %-d, %Y");r.formatDate=function(t,e,r,i){var a,f;if(i=n(i)&&i,e)return o(e,t,i);if(i)try{var d=Math.floor((t+.05)/y)+w,p=M.getComponentMethod("calendars","getCal")(i).fromJD(d);"y"===r?f=l(p):"m"===r?f=u(p):"d"===r?(a=l(p),f=c(p)):(a=h(p),f=s(t,r))}catch(t){return"Invalid"}else{var m=new Date(Math.floor(t+.05)) +return e.attr("transform",M?"rotate("+[M.rotate,w.x,w.y]+") translate(0, "+M.offset+")":null),e.style({"font-family":T,"font-size":n.round(S,2)+"px",fill:u.rgb(E),opacity:L*u.opacity(E),"font-weight":o.fontWeight}).attr(w).call(c.convertToTspans,t),o.previousPromises(t)}function m(t){var e=n.select(t.node().parentNode);if(_&&_.selection&&_.side&&I){e.attr("transform",null);var r=0,a={left:"right",right:"left",top:"bottom",bottom:"top"}[_.side],o=-1!==["left","top"].indexOf(_.side)?-1:1,u=i(_.pad)?_.pad:2,c=l.bBox(e.node()),h={left:0,top:0,right:A.width,bottom:A.height},f=_.maxShift||(h[_.side]-c[_.side])*("left"===_.side||"top"===_.side?-1:1);if(f<0)r=f;else{var d=_.offsetLeft||0,p=_.offsetTop||0;c.left-=d,c.right-=d,c.top-=p,c.bottom-=p,_.selection.each(function(){var t=l.bBox(this);s.bBoxIntersect(c,t,u)&&(r=Math.max(r,o*(t[_.side]-c[a])+u))}),r=Math.min(f,r)}if(r>0||f<0){var m={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[_.side];e.attr("transform","translate("+m+")")}}}var g,v=r.propContainer,y=r.propName,b=r.traceIndex,x=r.dfltName,_=r.avoid||{},w=r.attributes,M=r.transform,k=r.containerGroup,A=t._fullLayout,T=v.titlefont.family,S=v.titlefont.size,E=v.titlefont.color,L=1,C=!1,I=v.title.trim();"title"===y?g="titleText":-1!==y.indexOf("axis")?g="axisTitleText":y.indexOf(!0)&&(g="colorbarTitleText");var z=t._context.edits[g];""===I&&(L=0),I.match(f)&&(L=.2,C=!0,z||(I=""));var D=I||z;k||(k=A._infolayer.selectAll(".g-"+e).data([0]),k.enter().append("g").classed("g-"+e,!0));var P=k.selectAll("text").data(D?[0]:[]);if(P.enter().append("text"),P.text(I).attr("class",e),P.exit().remove(),D){P.call(d);var O="Click to enter "+x+" title";z&&(I?P.on(".opacity",null):function(){L=0,C=!0,I=O,P.text(I).on("mouseover.opacity",function(){n.select(this).transition().duration(h.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(h.HIDE_PLACEHOLDER).style("opacity",0)})}(),P.call(c.makeEditable,{gd:t}).on("edit",function(e){void 0!==b?a.restyle(t,y,e,b):a.relayout(t,y,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(d)}).on("input",function(t){this.text(t||" ").call(c.positionText,w.x,w.y)})),P.classed("js-placeholder",C)}}},{"../../constants/interactions":706,"../../lib":728,"../../lib/svg_text_utils":750,"../../plotly":767,"../../plots/plots":831,"../color":604,"../drawing":628,d3:122,"fast-isnumeric":131}],695:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l={_isLinkedToArray:"button",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}};e.exports=o({_isLinkedToArray:"updatemenu",_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons: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:a({},s,{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}},"arraydraw","from-root")},{"../../lib/extend":717,"../../plot_api/edit_types":756,"../../plots/font_attributes":796,"../../plots/pad_attributes":830,"../color/attributes":603}],696:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],697:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return a.coerce(t,e,s,r,n)}n("visible",i(t,e).length>0)&&(n("active"),n("direction"),n("type"),n("showactive"),n("x"),n("y"),a.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),a.coerceFont(n,"font",r.font),n("bgcolor",r.paper_bgcolor),n("bordercolor"),n("borderwidth"))}function i(t,e){function r(t,e){return a.coerce(n,i,c,t,e)}for(var n,i,o=t.buttons||[],s=e.buttons=[],l=0;l0?[0]:[]);if(a.enter().append("g").classed(L.containerClassName,!0).style("cursor","pointer"),a.exit().remove(),a.exit().size()&&_(t),0!==r.length){var c=a.selectAll("g."+L.headerGroupClassName).data(r,i);c.enter().append("g").classed(L.headerGroupClassName,!0);var h=a.selectAll("g."+L.dropdownButtonGroupClassName).data([0]);h.enter().append("g").classed(L.dropdownButtonGroupClassName,!0).style("pointer-events","all");for(var f=0;fM,T=n.barLength+2*n.barPad,S=n.barWidth+2*n.barPad,E=p,L=g+v;L+S>u&&(L=u-S);var C=this.container.selectAll("rect.scrollbar-horizontal").data(A?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,n.barColor),A?(this.hbar=C.attr({rx:n.barRadius,ry:n.barRadius,x:E,y:L,width:T,height:S}),this._hbarXMin=E+T/2,this._hbarTranslateMax=M-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var I=v>k,z=n.barWidth+2*n.barPad,D=n.barLength+2*n.barPad,P=p+m,O=g;P+z>l&&(P=l-z);var R=this.container.selectAll("rect.scrollbar-vertical").data(I?[0]:[]);R.exit().on(".drag",null).remove(),R.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,n.barColor),I?(this.vbar=R.attr({rx:n.barRadius,ry:n.barRadius,x:P,y:O,width:z,height:D}),this._vbarYMin=O+D/2,this._vbarTranslateMax=k-D):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var F=this.id,j=c-.5,N=I?h+z+.5:h+.5,B=f-.5,U=A?d+S+.5:d+.5,V=s._topdefs.selectAll("#"+F).data(A||I?[0]:[]);if(V.exit().remove(),V.enter().append("clipPath").attr("id",F).append("rect"),A||I?(this._clipRect=V.select("rect").attr({x:Math.floor(j),y:Math.floor(B),width:Math.ceil(N)-Math.floor(j),height:Math.ceil(U)-Math.floor(B)}),this.container.call(o.setClipUrl,F),this.bg.attr({x:p,y:g,width:m,height:v})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),A||I){var H=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(H);var q=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault(),i.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));A&&this.hbar.on(".drag",null).call(q),I&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,r)},n.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},n.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=i.event.dx),this.vbar&&(e-=i.event.dy),this.setTranslate(t,e)},n.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=i.event.deltaY),this.vbar&&(e+=i.event.deltaY),this.setTranslate(t,e)},n.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,n=r+this._hbarTranslateMax;t=(s.constrain(i.event.x,r,n)-r)/(n-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,o=a+this._vbarTranslateMax;e=(s.constrain(i.event.y,a,o)-a)/(o-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},n.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=s.constrain(t||0,0,r),e=s.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(o.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/r;this.hbar.call(o.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var a=e/n;this.vbar.call(o.setTranslate,t,e+a*this._vbarTranslateMax)}}},{"../../lib":728,"../color":604,"../drawing":628,d3:122}],701:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},LINE_SPACING:1.3,MID_SHIFT:.35}},{}],702:[function(t,e,r){"use strict";e.exports={solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}},{}],703:[function(t,e,r){"use strict";for(var n=t("../lib/extend").extendFlat,i={circle:{unicode:"\u25cf"},square:{unicode:"\u25a0"},diamond:{unicode:"\u25c6"},cross:{unicode:"\u271a"},x:{unicode:"\u274c"},"triangle-up":{unicode:"\u25b2"},"triangle-down":{unicode:"\u25bc"},"triangle-left":{unicode:"\u25c4"},"triangle-right":{unicode:"\u25ba"},"triangle-ne":{unicode:"\u25e5"},"triangle-nw":{unicode:"\u25e4"},"triangle-se":{unicode:"\u25e2"},"triangle-sw":{unicode:"\u25e3"},pentagon:{unicode:"\u2b1f"},hexagon:{unicode:"\u2b22"},hexagon2:{unicode:"\u2b23"},star:{unicode:"\u2605"},"diamond-tall":{unicode:"\u2666"},bowtie:{unicode:"\u29d3"},"diamond-x":{unicode:"\u2756"},"cross-thin":{unicode:"+",noBorder:!0},asterisk:{unicode:"\u2733",noBorder:!0},"y-up":{unicode:"\u2144",noBorder:!0},"y-down":{unicode:"Y",noBorder:!0},"line-ew":{unicode:"\u2500",noBorder:!0},"line-ns":{unicode:"\u2502",noBorder:!0}},a={},o=Object.keys(i),s=0;s","#62":">",nbsp:"\xa0","#160":"\xa0",times:"\xd7","#215":"\xd7",plusmn:"\xb1","#177":"\xb1",deg:"\xb0","#176":"\xb0"}}},{}],709:[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}},{}],710:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.31.2",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/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":595,"./components/annotations3d":600,"./components/fx":645,"./components/images":653,"./components/legend":662,"./components/rangeselector":674,"./components/rangeslider":680,"./components/shapes":687,"./components/sliders":693,"./components/updatemenus":699,"./fonts/mathjax_config":711,"./lib/queue":741,"./plot_api/plot_schema":761,"./plot_api/register":762,"./plot_api/set_plot_config":763,"./plot_api/to_image":765,"./plot_api/validate":766,"./plotly":767,"./snapshot":851,"./snapshot/download":848,"./traces/scatter":1042,d3:122,"es6-promise":128}],711:[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},{}],712:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../constants/numerical").BADNUM,a=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(a,"")),n(t)?Number(t):i}},{"../constants/numerical":707,"fast-isnumeric":131}],713:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("../plots/attributes"),o=t("../components/colorscale/get_scale"),s=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),l=t("./regex").counter;r.valObjectMeta={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),-1===n.values.indexOf(t)?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;ni.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},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){if("string"==typeof t&&l(r).test(t))return void e.set(t);e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!l(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"!=typeof t)return void e.set(r);if(-1!==(n.extras||[]).indexOf(t))return void e.set(t);for(var i=t.split("+"),a=0;a0&&(o=o.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+o}return n}function l(t){return t.formatDate("yyyy")}function u(t){return t.formatDate("M yyyy")}function c(t){return t.formatDate("M d")}function h(t){return t.formatDate("M d, yyyy")}var f=t("d3"),d=t("fast-isnumeric"),p=t("./loggers").error,m=t("./mod"),g=t("../constants/numerical"),v=g.BADNUM,y=g.ONEDAY,b=g.ONEHOUR,x=g.ONEMIN,_=g.ONESEC,w=g.EPOCHJD,M=t("../registry"),k=f.time.format.utc,A=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,T=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,S=(new Date).getFullYear()-70;r.dateTick0=function(t,e){return n(t)?e?M.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:M.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},r.dfltRange=function(t){return n(t)?M.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},r.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime};var E,L;r.dateTime2ms=function(t,e){if(r.isJSDate(t))return t=Number(t)-t.getTimezoneOffset()*x,t>=E&&t<=L?t:v;if("string"!=typeof t&&"number"!=typeof t)return v;t=String(t);var i=n(e),a=t.charAt(0);!i||"G"!==a&&"g"!==a||(t=t.substr(1),e="");var o=i&&"chinese"===e.substr(0,7),s=t.match(o?T:A);if(!s)return v;var l=s[1],u=s[3]||"1",c=Number(s[5]||1),h=Number(s[7]||0),f=Number(s[9]||0),d=Number(s[11]||0);if(i){if(2===l.length)return v;l=Number(l);var p;try{var m=M.getComponentMethod("calendars","getCal")(e);if(o){var g="i"===u.charAt(u.length-1);u=parseInt(u,10),p=m.newDate(l,m.toMonthIndex(l,u,g),c)}else p=m.newDate(l,Number(u),c)}catch(t){return v}return p?(p.toJD()-w)*y+h*b+f*x+d*_:v}l=2===l.length?(Number(l)+2e3-S)%100+S:Number(l),u-=1;var k=new Date(Date.UTC(2e3,u,c,h,f));return k.setUTCFullYear(l),k.getUTCMonth()!==u?v:k.getUTCDate()!==c?v:k.getTime()+d*_},E=r.MIN_MS=r.dateTime2ms("-9999"),L=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==v};var C=90*y,I=3*b,z=5*x;r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=E&&t<=L))return v;e||(e=0);var i,o,s,l,u,c,h=Math.floor(10*m(t+.05,1)),f=Math.round(t-h/10);if(n(r)){var d=Math.floor(f/y)+w,p=Math.floor(m(t,y));try{i=M.getComponentMethod("calendars","getCal")(r).fromJD(d).formatDate("yyyy-mm-dd")}catch(t){i=k("G%Y-%m-%d")(new Date(f))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e=E+y&&t<=L-y))return v;var e=Math.floor(10*m(t+.05,1)),r=new Date(Math.round(t-e/10));return a(f.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,i){if(r.isJSDate(t)||"number"==typeof t){if(n(i))return p("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,i))return p("unrecognized date",t),e;return t};var D=/%\d?f/g,P=[59,59.9,59.99,59.999,59.9999],O=k("%Y"),R=k("%b %Y"),F=k("%b %-d"),j=k("%b %-d, %Y");r.formatDate=function(t,e,r,i){var a,f;if(i=n(i)&&i,e)return o(e,t,i);if(i)try{var d=Math.floor((t+.05)/y)+w,p=M.getComponentMethod("calendars","getCal")(i).fromJD(d);"y"===r?f=l(p):"m"===r?f=u(p):"d"===r?(a=l(p),f=c(p)):(a=h(p),f=s(t,r))}catch(t){return"Invalid"}else{var m=new Date(Math.floor(t+.05)) ;"y"===r?f=O(m):"m"===r?f=R(m):"d"===r?(a=O(m),f=F(m)):(a=j(m),f=s(t,r))}return f+(a?"\n"+a:"")};var N=3*y;r.incrementMonth=function(t,e,r){r=n(r)&&r;var i=m(t,y);if(t=Math.round(t-i),r)try{var a=Math.round(t/y)+w,o=M.getComponentMethod("calendars","getCal")(r),s=o.fromJD(a);return e%12?o.add(s,e,"m"):o.add(s,e/12,"y"),(s.toJD()-w)*y+i}catch(e){p("invalid ms "+t+" in calendar "+r)}var l=new Date(t+N);return l.setUTCMonth(l.getUTCMonth()+e)+i-N},r.findExactDates=function(t,e){for(var r,i,a=0,o=0,s=0,l=0,u=n(e)&&M.getComponentMethod("calendars","getCal")(e),c=0;c0&&(i.push(a),a=[])}return a.length>0&&i.push(a),i},r.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},r.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r1||m<0||m>1?null:{x:t+l*m,y:e+h*m}}function i(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}var a=t("./mod");r.segmentsIntersect=n,r.segmentDistance=function(t,e,r,a,o,s,l,u){if(n(t,e,r,a,o,s,l,u))return 0;var c=r-t,h=a-e,f=l-o,d=u-s,p=c*c+h*h,m=f*f+d*d,g=Math.min(i(c,h,p,o-t,s-e),i(c,h,p,l-t,u-e),i(f,d,m,t-o,e-s),i(f,d,m,r-o,a-s));return Math.sqrt(g)};var o,s,l;r.getTextLocation=function(t,e,r,n){if(t===s&&n===l||(o={},s=t,l=n),o[r])return o[r];var i=t.getPointAtLength(a(r-n/2,e)),u=t.getPointAtLength(a(r+n/2,e)),c=Math.atan((u.y-i.y)/(u.x-i.x)),h=t.getPointAtLength(a(r,e)),f=(4*h.x+i.x+u.x)/6,d=(4*h.y+i.y+u.y)/6,p={x:f,y:d,theta:c};return o[r]=p,p},r.clearLocationCache=function(){s=null},r.getVisibleSegment=function(t,e,r){function n(e){var r=t.getPointAtLength(e);0===e?i=r:e===h&&(a=r);var n=r.xs?r.x-s:0,c=r.yu?r.y-u:0;return Math.sqrt(n*n+c*c)}for(var i,a,o=e.left,s=e.right,l=e.top,u=e.bottom,c=0,h=t.getTotalLength(),f=h,d=n(c);d;){if((c+=d+r)>f)return;d=n(c)}for(d=n(f);d;){if(f-=d+r,c>f)return;d=n(f)}return{min:c,max:f,len:f-c,total:h,isClosed:0===c&&f===h&&Math.abs(i.x-a.x)<.1&&Math.abs(i.y-a.y)<.1}}},{"./mod":734}],723:[function(t,e,r){"use strict";e.exports=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t}},{}],724:[function(t,e,r){"use strict";function n(t,e){var r=t;return r[3]*=e,r}function i(t){if(s(t))return h;var e=l(t);return e.length?e:h}function a(t){return s(t)?t:f}function o(t,e,r){var o,s,c,d,p,m=t.color,g=Array.isArray(m),v=Array.isArray(e),y=[];if(o=void 0!==t.colorscale?u.makeColorScaleFunc(u.extractScale(t.colorscale,t.cmin,t.cmax)):i,s=g?function(t,e){return void 0===t[e]?h:l(o(t[e]))}:i,c=v?function(t,e){return void 0===t[e]?f:a(t[e])}:a,g||v)for(var b=0;b",e))>=0;){var r=t.indexOf("",e);if(r/g,"\n")}function a(t){return t.replace(/\<.*\>/g,"")}function o(t){for(var e=u.entityToUnicode,r=0;(r=t.indexOf("&",r))>=0;){var n=t.indexOf(";",r);if(no?s:i(t)?Number(t):s):s},l.noop=t("./noop"),l.identity=t("./identity"),l.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var i=0;ir?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},l.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},l.simpleMap=function(t,e,r,n){for(var i=t.length,a=new Array(i),o=0;o-1||c!==1/0&&c>=Math.pow(2,r)?t(e,r,n):l},l.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},l.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(r=0;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*u[n];c[r]=a}return c},l.syncOrAsync=function(t,e,r){function n(){return l.syncOrAsync(t,e,r)}for(var i,a;t.length;)if(a=t.splice(0,1)[0],(i=a(e))&&i.then)return i.then(n).then(void 0,l.promiseError);return r&&r(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,r){if(t){var n,i,a=!1,o=!0;for(n=0;n1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l};var _=/%{([^\s%{}]*)}/g,w=/^\w*$/;l.templateString=function(t,e){var r={};return t.replace(_,function(t,n){return w.test(n)?e[n]||"":(r[n]=r[n]||l.nestedProperty(e,n).get,r[n]()||"")})}},{"../constants/numerical":707,"./clean_number":712,"./coerce":713,"./dates":714,"./ensure_array":715,"./extend":717,"./filter_unique":718,"./filter_visible":719,"./geometry2d":722,"./get_graph_div":723,"./identity":727,"./is_array":729,"./is_plain_object":730,"./keyed_container":731,"./loggers":732,"./matrix":733,"./mod":734,"./nested_property":735,"./noop":736,"./notifier":737,"./push_unique":740,"./regex":742,"./relative_attr":743,"./relink_private":744,"./search":745,"./stats":748,"./throttle":751,"./to_log_range":752,d3:122,"fast-isnumeric":131}],729:[function(t,e,r){"use strict";var n="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}};e.exports=function(t){return Array.isArray(t)||n.isView(t)}},{}],730:[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}},{}],731:[function(t,e,r){"use strict";var n=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,r,a){r=r||"name",a=a||"value";var o,s,l={};s=e&&e.length?n(t,e).get():t,e=e||"",s=s||[];var u={};for(o=0;o2)return l[e]=2|l[e],h.set(t,null);if(c){for(o=e;o1){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][0],a=t[e][1],l=!1,d(n))for(r=n.length-1;r>=0;r--)i(n[r],o(a,r))?l?n[r]=void 0:n.pop():l=!0;else if("object"==typeof n&&null!==n)for(s=Object.keys(n),l=!1,r=s.length-1;r>=0;r--)i(n[s[r]],o(a,s[r]))?delete n[s[r]]:l=!0;if(l)return}}function c(t){return void 0===t||null===t||"object"==typeof t&&(d(t)?!t.length:!Object.keys(t).length)}function h(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"),p=t("./is_plain_object"),m=t("../plot_api/container_array_match");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,i,o,s=0,l=e.split(".");s/g),s=0;so||n===i||nl)&&(!e||!c(t))}function r(t,e){var r=t[0],u=t[1];if(r===i||ro||u===i||ul)return!1;var c,h,f,d,p,m=n.length,g=n[0][0],v=n[0][1],y=0;for(c=1;cMath.max(h,g)||u>Math.max(f,v)))if(uc||Math.abs(n(o,f))>i)return!0;return!1};a.filter=function(t,e){function r(r){t.push(r);var s=n.length,l=i;n.splice(a+1);for(var u=l+1;u1){r(t.pop())}return{addPt:r,raw:t,filtered:n}}},{"../constants/numerical":707,"./matrix":733}],740:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){var r,n=e.toString();for(r=0;ra.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--)},o.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},o.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},o.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 o(t,e){return t>=e}var s=t("fast-isnumeric"),l=t("./loggers");r.findBin=function(t,e,r){if(s(e.start))return r?Math.ceil((t-e.start)/e.size)-1:Math.floor((t-e.start)/e.size);var u,c,h=0,f=e.length,d=0;for(c=e[e.length-1]>=e[0]?r?n:i:r?o:a;h90&&l.log("Long binary search..."),h-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e=t.slice();e.sort(r.sorterAsc);for(var n=e.length-1,i=e[n]-e[0]||1,a=i/(n||1)/1e4,o=[e[0]],s=0;se[s]+a&&(i=Math.min(i,e[s+1]-e[s]),o.push(e[s+1]));return{vals:o,minDiff:i}},r.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;it.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":131}],749:[function(t,e,r){"use strict";function n(t){var e=i(t);return e.length?e:[0,0,0,1]}var i=t("color-rgba");e.exports=n},{"color-rgba":95}],750:[function(t,e,r){"use strict";function n(t,e){return t.node().getBoundingClientRect()[e]}function i(t){return t.replace(v,"\\lt ").replace(y,"\\gt ")}function a(t,e,r){var n="math-output-"+f.randstr([],64),a=h.select("body").append("div").attr({id:n}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(i(t));MathJax.Hub.Queue(["Typeset",MathJax.Hub,a.node()],function(){var e=h.select("body").select("#MathJax_SVG_glyphs") ;if(a.select(".MathJax_SVG").empty()||!a.select("svg").node())f.log("There was an error in the tex syntax.",t),r();else{var n=a.select("svg").node().getBoundingClientRect();r(a.select(".MathJax_SVG"),e,n)}a.remove()})}function o(t,e){if(!t)return null;var r=t.match(e);return r&&(r[3]||r[4])}function s(t,e){if(!t)return"";for(var r=0;r1)for(var i=1;i.",e);var r=u.pop();t!==r.type&&f.log("Start tag <"+r.type+"> doesnt match end tag <"+t+">. Pretending it did match.",e),a=u[u.length-1].node}(k);else{var O=y[4],R={type:k},F=o(O,C);if(F?(F=F.replace(P,"$1 fill:"),A&&(F+=";"+A)):A&&(F=A),F&&(R.style=F),"a"===k){s=!0;var j=o(O,I);if(j){var N=document.createElement("a");N.href=j,-1!==M.indexOf(N.protocol)&&(R.href=encodeURI(j),R.target=o(O,z)||"_blank",R.popup=o(O,D))}}n(R)}}return s}function c(t,e,r){var n,i,a,o=r.horizontalAlign,s=r.verticalAlign||"top",l=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return i="bottom"===s?function(){return l.bottom-n.height}:"middle"===s?function(){return l.top+(l.height-n.height)/2}:function(){return l.top},a="right"===o?function(){return l.right-n.width}:"center"===o?function(){return l.left+(l.width-n.width)/2}:function(){return l.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:i()-u.top+"px",left:a()-u.left+"px","z-index":1e3}),this}}var h=t("d3"),f=t("../lib"),d=t("../constants/xmlns_namespaces"),p=t("../constants/string_mappings"),m=t("../constants/alignment").LINE_SPACING,g=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,i){function o(){c.empty()||(f=t.attr("class")+"-math",c.select("svg."+f).remove()),t.text("").style("white-space","pre"),u(t.node(),s)&&t.style("pointer-events","all"),r.positionText(t),i&&i.call(t)}var s=t.text(),l=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&s.match(g),c=h.select(t.node().parentNode);if(!c.empty()){var f=t.attr("class")?t.attr("class").split(" ")[0]:"text";return f+="-math",c.selectAll("svg."+f).remove(),c.selectAll("g."+f+"-group").remove(),t.style("display",null).attr({"data-unformatted":s,"data-math":"N"}),l?(e&&e._promises||[]).push(new Promise(function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10);a(l[2],{fontSize:r},function(a,l,u){c.selectAll("svg."+f).remove(),c.selectAll("g."+f+"-group").remove();var h=a&&a.select("svg");if(!h||!h.node())return o(),void e();var d=c.append("g").classed(f+"-group",!0).attr({"pointer-events":"none","data-unformatted":s,"data-math":"Y"});d.node().appendChild(h.node()),l&&l.node()&&h.node().insertBefore(l.node().cloneNode(!0),h.node().firstChild),h.attr({class:f,height:u.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var p=t.node().style.fill||"black";h.select("g").attr({fill:p,stroke:p});var m=n(h,"width"),g=n(h,"height"),v=+t.attr("x")-m*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],y=r||n(t,"height"),b=-y/4;"y"===f[0]?(d.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-m/2,b-g/2]+")"}),h.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===f[0]?h.attr({x:t.attr("x"),y:b-g/2}):"a"===f[0]?h.attr({x:0,y:b}):h.attr({x:v,y:+t.attr("y")+b-g/2}),i&&i.call(t,d),e(d)})})):o(),t}};var v=/(<|<|<)/g,y=/(>|>|>)/g,b={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},x={sub:"0.3em",sup:"-0.6em"},_={sub:"-0.21em",sup:"0.42em"},w="\u200b",M=["http:","https:","mailto:","",void 0,":"],k=new RegExp("]*)?/?>","g"),A=Object.keys(p.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:p.entityToUnicode[t]}}),T=/(\r\n?|\n)/g,S=/(<[^<>]*>)/,E=/<(\/?)([^ >]*)(\s+(.*))?>/i,L=//i,C=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,I=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,z=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,D=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i,P=/(^|;)\s*color:/;r.plainText=function(t){return(t||"").replace(k," ")},r.lineCount=function(t){return t.selectAll("tspan.line").size()||1},r.positionText=function(t,e,r){return t.each(function(){function t(t,e){return void 0===e?null===(e=n.attr(t))&&(n.attr(t,0),e=0):n.attr(t,e),e}var n=h.select(this),i=t("x",e),a=t("y",r);"text"===this.nodeName&&n.selectAll("tspan.line").attr({x:i,y:a})})},r.makeEditable=function(t,e){function r(){i(),t.style({opacity:0});var e,r=l.attr("class");(e=r?"."+r.split(" ")[0]+"-math-group":"[class*=-math-group]")&&h.select(t.node().parentNode).select(e).style({opacity:0})}function n(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}function i(){var r=h.select(a),i=r.select(".svg-container"),o=i.append("div"),l=t.node().style,u=parseFloat(l.fontSize||12);o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":l.fontFamily||"Arial","font-size":u,color:e.fill||l.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-u/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(e.text||t.attr("data-unformatted")).call(c(t,i,e)).on("blur",function(){a._editing=!1,t.text(this.textContent).style({opacity:1});var e,r=h.select(this).attr("class");(e=r?"."+r.split(" ")[0]+"-math-group":"[class*=-math-group]")&&h.select(t.node().parentNode).select(e).style({opacity:0});var n=this.textContent;h.select(this).transition().duration(0).remove(),h.select(document).on("mouseup",null),s.edit.call(t,n)}).on("focus",function(){var t=this;a._editing=!0,h.select(document).on("mouseup",function(){if(h.event.target===t)return!1;document.activeElement===o.node()&&o.node().blur()})}).on("keyup",function(){27===h.event.which?(a._editing=!1,t.style({opacity:1}),h.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),s.cancel.call(t,this.textContent)):(s.input.call(t,this.textContent),h.select(this).call(c(t,i,e)))}).on("keydown",function(){13===h.event.which&&this.blur()}).call(n)}var a=e.gd,o=e.delegate,s=h.dispatch("edit","input","cancel"),l=o||t;if(t.style({"pointer-events":o?"none":"all"}),1!==t.size())throw new Error("boo");return e.immediate?r():l.on("click",r),h.rebind(t,s,"on")}},{"../constants/alignment":701,"../constants/string_mappings":708,"../constants/xmlns_namespaces":709,"../lib":728,d3:122}],751:[function(t,e,r){"use strict";function n(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}var i={};r.throttle=function(t,e,r){function a(){r(),o.ts=Date.now(),o.onDone&&(o.onDone(),o.onDone=null)}var o=i[t],s=Date.now();if(!o){for(var l in i)i[l].tso.ts+e)return void a();o.timer=setTimeout(function(){a(),o.timer=null},e)},r.done=function(t){var e=i[t];return e&&e.timer?new Promise(function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}}):Promise.resolve()},r.clear=function(t){if(t)n(i[t]),delete i[t];else for(var e in i)r.clear(e)}},{}],752:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},{"fast-isnumeric":131}],753:[function(t,e,r){"use strict";var n=e.exports={},i=t("../plots/geo/constants").locationmodeToLayer,a=t("topojson-client").feature;n.getTopojsonName=function(t){return[t.scope.replace(/ /g,"-"),"_",t.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(t,e){return t+e+".json"},n.getTopojsonFeatures=function(t,e){var r=i[t.locationmode],n=e.objects[r];return a(e,n).features}},{"../plots/geo/constants":798,"topojson-client":536}],754:[function(t,e,r){"use strict";function n(t,e){for(var r=new Float32Array(e),n=0;n0)return t.substr(0,e)}var s=t("fast-isnumeric"),l=t("gl-mat4/fromQuat"),u=t("../registry"),c=t("../lib"),h=t("../plots/plots"),f=t("../plots/cartesian/axes"),d=t("../components/color");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 i=f.list({_fullLayout:t});for(e=0;e3?(g.x=1.02,g.xanchor="left"):g.x<-2&&(g.x=-.02,g.xanchor="right"),g.y>3?(g.y=1.02,g.yanchor="bottom"):g.y<-2&&(g.y=-.02,g.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var v=h.getSubplotIds(t,"gl3d");for(e=0;e1&&o.warn("Full array edits are incompatible with other edits",h);var y=r[""][""];if(c(y))e.set(null);else{if(!Array.isArray(y))return o.warn("Unrecognized full array edit value",h,y),!0;e.set(y)}return!m&&(f(g,v),d(t),!0)}var b,x,_,w,M,k,A,T=Object.keys(r).map(Number).sort(s),S=e.get(),E=S||[],L=n(v,h).get(),C=[],I=-1,z=E.length;for(b=0;bE.length-(A?0:1))o.warn("index out of range",h,_);else if(void 0!==k)M.length>1&&o.warn("Insertion & removal are incompatible with edits to the same index.",h,_),c(k)?C.push(_):A?("add"===k&&(k={}),E.splice(_,0,k),L&&L.splice(_,0,{})):o.warn("Unrecognized full object edit value",h,_,k),-1===I&&(I=_);else for(x=0;x=0;b--)E.splice(C[b],1),L&&L.splice(C[b],1);if(E.length?S||e.set(E):e.set(null),m)return!1;if(f(g,v),p!==a){var D;if(-1===I)D=T;else{for(z=Math.max(E.length,z),D=[],b=0;b=I);b++)D.push(_);for(b=I;b=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function u(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),l(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&l(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function c(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&lY.range[0]?[1,2]:[2,1]);else{var Z=Y.range[0],J=Y.range[1];W?(Z<=0&&J<=0&&r(P+".autorange",!0),Z<=0?Z=J/1e6:J<=0&&(J=Z/1e6),r(P+".range[0]",Math.log(Z)/Math.LN10),r(P+".range[1]",Math.log(J)/Math.LN10)):(r(P+".range[0]",Math.pow(10,Z)),r(P+".range[1]",Math.pow(10,J)))}else r(P+".autorange",!0);A.getComponentMethod("annotations","convertCoords")(t,B,L,r),A.getComponentMethod("images","convertCoords")(t,B,L,r)}else r(P+".autorange",!0),r(P+".range",null);w.nestedProperty(u,P+"._inputRange").set(null)}else if(z.match(N.AX_NAME_PATTERN)){var K=w.nestedProperty(u,k).get(),Q=(L||{}).type;Q&&"-"!==Q||(Q="linear"),A.getComponentMethod("annotations","convertCoords")(t,K,Q,r),A.getComponentMethod("images","convertCoords")(t,K,Q,r)}var $=O.containerArrayMatch(k);if($){a=$.array,o=$.index;var tt=$.property,et=w.nestedProperty(l,a),rt=(et||[])[o]||{},nt=rt,it=V||{editType:"calc"},at=-1!==it.editType.indexOf("calcIfAutorange");""===o?(at?y.calc=!0:j.update(y,it),at=!1):""===tt&&(nt=L,O.isAddVal(L)?x[k]=null:O.isRemoveVal(L)?(x[k]=rt,nt=rt):w.warn("unrecognized full object value",e)),at&&(n(nt,"x")||n(nt,"y"))?y.calc=!0:j.update(y,it),f[a]||(f[a]={});var ot=f[a][o];ot||(ot=f[a][o]={}),ot[tt]=L,delete e[k]}else"reverse"===z?(F.range?F.range.reverse():(r(P+".autorange",!0),F.range=[1,0]),B.autorange?y.calc=!0:y.plot=!0):((!u._has("gl2d")||"dragmode"!==k||"lasso"!==L&&"select"!==L||"lasso"===U||"select"===U)&&V?j.update(y,V):y.calc=!0,E.set(L))}}for(a in f){O.applyContainerArrayChanges(t,w.nestedProperty(l,a),f[a],y)||(y.plot=!0)}var st=u._axisConstraintGroups;for(v in M)for(o=0;o=s.length?s[0]:s[t]:s}function i(t){return Array.isArray(l)?t>=l.length?l[0]:l[t]:l}function a(t,e){var r=0;return function(){if(t&&++r===e)return t()}}if(t=w.getGraphDiv(t),!w.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 o=t._transitionData;o._frameQueue||(o._frameQueue=[]),r=S.supplyAnimationDefaults(r);var s=r.transition,l=r.frame;return void 0===o._frameWaitingCnt&&(o._frameWaitingCnt=0),new Promise(function(l,u){function c(){t.emit("plotly_animated"),window.cancelAnimationFrame(o._animationRaf),o._animationRaf=null}function h(){o._currentFrame&&o._currentFrame.onComplete&&o._currentFrame.onComplete();var e=o._currentFrame=o._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,o._lastFrameAt=Date.now(),o._timeToNext=e.frameOpts.duration,S.transition(t,e.frame.data,e.frame.layout,R.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then(function(){e.onComplete&&e.onComplete()}),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else c()}function f(){t.emit("plotly_animating"),o._lastFrameAt=-1/0,o._timeToNext=0,o._runningTransitions=0,o._currentFrame=null;var e=function(){o._animationRaf=window.requestAnimationFrame(e),Date.now()-o._lastFrameAt>o._timeToNext&&h()};e()}function d(t){return Array.isArray(s)?g>=s.length?t.transitionOpts=s[g]:t.transitionOpts=s[0]:t.transitionOpts=s,g++,t}var p,m,g=0,v=[],y=void 0===e||null===e,b=Array.isArray(e);if(y||b||!w.isPlainObject(e)){if(y||-1!==["string","number"].indexOf(typeof e))for(p=0;p0&&MM)&&k.push(m);v=k}}v.length>0?function(e){if(0!==e.length){for(var s=0;s=0;i--)if(w.isPlainObject(e[i])){var f=(u[e[i].name]||{}).name,d=e[i].name;f&&d&&"number"==typeof d&&u[f]&&(n++,w.warn('addFrames: overwriting frame "'+u[f].name+'" with a frame whose name of type "number" also equates to "'+f+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),n>5&&w.warn("addFrames: This API call has yielded too many warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h.push({frame:S.supplyFrameDefaults(e[i]),index:r&&void 0!==r[i]&&null!==r[i]?r[i]:c+i})}h.sort(function(t,e){return t.index>e.index?-1:t.index=0;i--){if(a=h[i].frame,"number"==typeof a.name&&w.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+t._transitionData._counter++];);if(u[a.name]){for(o=0;o=0;r--)n=e[r],a.push({type:"delete",index:n}),o.unshift({type:"insert",index:n,value:i[n]});var s=S.modifyFrames,l=S.modifyFrames,u=[t,o],c=[t,a];return k&&k.add(t,s,u,l,c),S.modifyFrames(t,a)},_.purge=function(t){t=w.getGraphDiv(t);var e=t._fullLayout||{},r=t._fullData||[];return S.cleanPlot([],{},r,e),S.purge(t),M.purge(t),e._container&&e._container.remove(),delete t._context,t}},{"../components/color":604,"../components/drawing":628,"../components/errorbars":634,"../constants/xmlns_namespaces":709,"../lib":728,"../lib/events":716,"../lib/queue":741,"../lib/svg_text_utils":750,"../plotly":767,"../plots/cartesian/axis_ids":775,"../plots/cartesian/constants":777,"../plots/cartesian/constraints":779,"../plots/cartesian/graph_interact":781,"../plots/plots":831,"../plots/polar":834,"../registry":846,"./edit_types":756,"./helpers":757,"./manage_arrays":758,"./plot_schema":761,"./subroutines":764,d3:122,"fast-isnumeric":131,"has-hover":288}],760:[function(t,e,r){"use strict";e.exports={staticPlot:!1,editable:!1,edits:{annotationPosition:!1,annotationTail:!1,annotationText:!1,axisTitleText:!1,colorbarPosition:!1,colorbarTitleText:!1,legendPosition:!1,legendText:!1,shapePosition:!1,titleText:!1},autosizable:!1,queueLength:0,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showAxisDragHandles:!0,showAxisRangeEntryBoxes:!0,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:"transparent",topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:!1,globalTransforms:[]}},{}],761:[function(t,e,r){"use strict";function n(t,e){var r,n,i,a,o=t._basePlotModules;if(o){var s;for(r=0;r=t.items.length)return!1;t=t.items[i]}}return t}function a(t){return t===Math.round(t)&&t>=0}function o(t){var e,r;"area"===t?(e={attributes:w},r={}):(e=g.modules[t]._module,r=e.basePlotModule);var n={};n.type=null,T(n,y),T(n,e.attributes),r.attributes&&T(n,r.attributes),n.type=t;var i={meta:e.meta||{},attributes:c(n)};if(e.layoutAttributes){var a={};T(a,e.layoutAttributes),i.layoutAttributes=c(a)}return i}function s(){var t,e,r={};T(r,b);for(t in g.subplotsRegistry)if(e=g.subplotsRegistry[t],e.layoutAttributes)if("cartesian"===e.name)p(r,e,"xaxis"),p(r,e,"yaxis");else{var n="subplot"===e.attr?e.name:e.attr;p(r,e,n)}r=d(r);for(t in g.componentsRegistry){e=g.componentsRegistry[t];var i=e.schema;if(i&&(i.subplots||i.layout)){var a=i.subplots;if(a&&a.xaxis&&!a.yaxis)for(var o in a.xaxis)delete r.yaxis[o]}else e.layoutAttributes&&m(r,e.layoutAttributes,e.name)}return{layoutAttributes:c(r)}}function l(t){var e=g.transformsRegistry[t],r=T({},e.attributes);return Object.keys(g.componentsRegistry).forEach(function(e){var n=g.componentsRegistry[e];n.schema&&n.schema.transforms&&n.schema.transforms[t]&&Object.keys(n.schema.transforms[t]).forEach(function(e){m(r,n.schema.transforms[t][e],e)})}),{attributes:c(r)}}function u(){var t={frames:v.extendDeepAll({},x)};return c(t),t.frames}function c(t){return h(t),f(t),t}function h(t){function e(t){return{valType:"string",editType:"none"}}function n(t,n,i){r.isValObject(t)?"data_array"===t.valType?(t.role="data",i[n+"src"]=e(n)):!0===t.arrayOk&&(i[n+"src"]=e(n)):v.isPlainObject(t)&&(t.role="object")}r.crawl(t,n)}function f(t){function e(t,e,r){if(t){var n=t[E];n&&(delete t[E],r[e]={items:{}},r[e].items[n]=t,r[e].role="object")}}r.crawl(t,e)}function d(t){return A(t,{radialaxis:M.radialaxis,angularaxis:M.angularaxis}),A(t,M.layout),t}function p(t,e,r){var n=v.nestedProperty(t,r),i=T({},e.layoutAttributes);i[S]=!0,n.set(i)}function m(t,e,r){var n=v.nestedProperty(t,r);n.set(T(n.get()||{},e))}var g=t("../registry"),v=t("../lib"),y=t("../plots/attributes"),b=t("../plots/layout_attributes"),x=t("../plots/frame_attributes"),_=t("../plots/animation_attributes"),w=t("../plots/polar/area_attributes"),M=t("../plots/polar/axis_attributes"),k=t("./edit_types"),A=v.extendFlat,T=v.extendDeepAll,S="_isSubplotObj",E="_isLinkedToArray",L=[S,E,"_arrayAttrRegexps","_deprecated"];r.IS_SUBPLOT_OBJ=S,r.IS_LINKED_TO_ARRAY=E,r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=L,r.get=function(){var t={};g.allTypes.concat("area").forEach(function(e){t[e]=o(e)});var e={};return Object.keys(g.transformsRegistry).forEach(function(t){e[t]=l(t)}),{defs:{valObjects:v.valObjectMeta,metaKeys:L.concat(["description","role","editType","impliedEdits"]),editType:{traces:k.traces,layout:k.layout},impliedEdits:{}},traces:t,layout:s(),transforms:e,frames:u(),animation:c(_)}},r.crawl=function(t,e,n,i){var a=n||0;i=i||"",Object.keys(t).forEach(function(n){var o=t[n];if(-1===L.indexOf(n)){var s=(i?i+".":"")+n;e(o,n,t,a,s),r.isValObject(o)||v.isPlainObject(o)&&"impliedEdits"!==n&&r.crawl(o,e,a+1,s)}})},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){function e(e,r,o,s){if(a=a.slice(0,s).concat([r]),e&&("data_array"===e.valType||!0===e.arrayOk)&&!("colorbar"===a[s-1]&&("ticktext"===r||"tickvals"===r))){var l=n(a),u=v.nestedProperty(t,l).get();Array.isArray(u)&&i.push(l)}}function n(t){return t.join(".")}var i=[],a=[];if(r.crawl(y,e),t._module&&t._module.attributes&&r.crawl(t._module.attributes,e),t.transforms)for(var o=t.transforms,s=0;s=t.transforms.length)return!1;r=(g.transformsRegistry[t.transforms[l].type]||{}).attributes,n=r&&r[e[2]],s=3}else if("area"===t.type)n=w[o];else{var u=t._module;if(u||(u=(g.modules[t.type||y.type.dflt]||{})._module),!u)return!1;if(r=u.attributes,!(n=r&&r[o])){var c=u.basePlotModule;c&&c.attributes&&(n=c.attributes[o])}n||(n=y[o])}return i(n,e,s)},r.getLayoutValObject=function(t,e){return i(n(t,e[0]),e,1)}},{"../lib":728,"../plots/animation_attributes":768,"../plots/attributes":770,"../plots/frame_attributes":797,"../plots/layout_attributes":822,"../plots/polar/area_attributes":832,"../plots/polar/axis_attributes":833,"../registry":846,"./edit_types":756}],762:[function(t,e,r){"use strict";function n(t){o.register(t,t.name,t.categories,t.meta),o.subplotsRegistry[t.basePlotModule.name]||o.registerSubplot(t.basePlotModule)}function i(t){if("string"!=typeof t.name)throw new Error("Transform module *name* must be a string.");var e="Transform module "+t.name,r="function"==typeof t.transform,n="function"==typeof t.calcTransform;if(!r&&!n)throw new Error(e+" is missing a *transform* or *calcTransform* method.");r&&n&&s.log([e+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),s.isPlainObject(t.attributes)||s.log(e+" registered without an *attributes* object."),"function"!=typeof t.supplyDefaults&&s.log(e+" registered without a *supplyDefaults* method."),o.registerTransform(t)}function a(t){if("string"!=typeof t.name)throw new Error("Component module *name* must be a string.");o.registerComponent(t)}var o=t("../registry"),s=t("../lib");e.exports=function(t){if(!t)throw new Error("No argument passed to Plotly.register.");t&&!Array.isArray(t)&&(t=[t]);for(var e=0;e=t[1]||i[1]<=t[0])&&(a[0]e[0]))return!0}return!1}function i(t,e,r){return t._anchorAxis===e&&(t.mirror||t.side===r)||"all"===t.mirror||"allticks"===t.mirror||t.mirrors&&t.mirrors[e._id+r]}function a(t,e,r){var n=[],i=e._anchorAxis;if(i){var a=i._mainAxis;if(-1===n.indexOf(a)){n.push(a);for(var o=0;o1&&l.push(o("object","layout"))),f.supplyDefaults(u);for(var c=u._fullData,g=r.length,v=0;v.3*h||a(n)||a(i))){var f=r.dtick/2;t+=t+f.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=B.tickIncrement(t,"M6","reverse")+1.5*P:a.exactMonths>.8?t=B.tickIncrement(t,"M1","reverse")+15.5*P:t-=P/2;var s=B.tickIncrement(t,r);if(s<=n)return s}return t}function s(t){var e,r,n=t.tickvals,i=t.ticktext,a=new Array(n.length),o=A.simpleMap(t.range,t.r2l),s=1.0001*o[0]-1e-4*o[1],l=1.0001*o[1]-1e-4*o[0],u=Math.min(s,l),h=Math.max(s,l),f=0;Array.isArray(i)||(i=[]);var d="category"===t.type?t.d2l_noadd:t.d2l;for("log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1)),r=0;ru&&e10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=P&&i<=10||e>=15*P)t._tickround="d";else if(e>=R&&i<=16||e>=O)t._tickround="M";else if(e>=F&&i<=19||e>=R)t._tickround="S";else{var a=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,a)-20}}else if(M(e)||"L"===e.charAt(0)){var o=t.range.map(t.r2d||Number);M(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var s=Math.max(Math.abs(o[0]),Math.abs(o[1])),l=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(l)>3&&(m(t.exponentformat)&&!g(l)?t._tickexponent=3*Math.round((l-1)/3):t._tickexponent=l)}else t._tickround=null}function c(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}function h(t,e,r,n){var i=t._tickround,a=r&&t.hoverformat||t.tickformat;n&&(i=M(i)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[i]);var o,s=A.formatDate(e.x,a,i,t.calendar),l=s.indexOf("\n");-1!==l&&(o=s.substr(l+1),s=s.substr(0,l)),n&&("00:00:00"===s||"00:00"===s?(s=o,o=""):8===s.length&&(s=s.replace(/:00$/,""))),o&&(r?"d"===i?s+=", "+o:s=o+(s?", "+s:""):t._inCalcTicks&&o===t._prevDateHead||(s+="
"+o,t._prevDateHead=o)),e.text=s}function f(t,e,r,n,i){var a=t.dtick,o=e.x;if("never"===i&&(i=""),!n||"string"==typeof a&&"L"===a.charAt(0)||(a="L3"),t.tickformat||"string"==typeof a&&"L"===a.charAt(0))e.text=v(Math.pow(10,o),t,i,n);else if(M(a)||"D"===a.charAt(0)&&A.mod(o+.01,1)<.1){var s=Math.round(o);-1!==["e","E","power"].indexOf(t.exponentformat)||m(t.exponentformat)&&g(s)?(e.text=0===s?1:1===s?"10":s>1?"10"+s+"":"10"+j+-s+"",e.fontSize*=1.25):(e.text=v(Math.pow(10,o),t,"","fakehover"),"D1"===a&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==a.charAt(0))throw"unrecognized dtick "+String(a);e.text=String(Math.round(Math.pow(10,A.mod(o,1)))),e.fontSize*=.75}if("D1"===t.dtick){var l=String(e.text).charAt(0);"0"!==l&&"1"!==l||("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*(o<0?.5:.25)))}}function d(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}function p(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=v(e.x,t,i,n)}function m(t){return"SI"===t||"B"===t}function g(t){return t>14||t<-15}function v(t,e,r,n){var i=t<0,a=e._tickround,o=r||e.exponentformat||"B",s=e._tickexponent,l=e.tickformat,c=e.separatethousands;if(n){var h={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:M(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};u(h),a=(Number(h._tickround)||0)+4,s=h._tickexponent,e.hoverformat&&(l=e.hoverformat)}if(l)return w.format(l)(t).replace(/-/g,j);var f=Math.pow(10,-a)/2;if("none"===o&&(s=0),(t=Math.abs(t))"+v+"":"B"===o&&9===s?t+="B":m(o)&&(t+=J[s/3+5])}return i?j+t:t}function y(t,e){var r,n,i=[];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},B.getAutoRange=function(t){var e,r=[],n=t._min[0].val,i=t._max[0].val;for(e=1;e0&&c>0&&h/c>f&&(l=o,u=s,f=h/c);if(n===i){var m=n-1,g=n+1;r="tozero"===t.rangemode?n<0?[m,0]:[0,g]:"nonnegative"===t.rangemode?[Math.max(0,m),Math.max(0,g)]:[m,g]}else f&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(l.val>=0&&(l={val:0,pad:0}),u.val<=0&&(u={val:0,pad:0})):"nonnegative"===t.rangemode&&(l.val-f*l.pad<0&&(l={val:0,pad:0}),u.val<0&&(u={val:1,pad:0})),f=(u.val-l.val)/(t._length-l.pad-u.pad)),r=[l.val-f*l.pad,u.val+f*u.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])))),d&&r.reverse(),A.simpleMap(r,t.l2r||Number)},B.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=B.getAutoRange(t),t._r=t.range.slice(),t._rl=A.simpleMap(t._r,t.r2l);var r=t._input;r.range=t.range.slice(),r.autorange=t.autorange}},B.saveRangeInitial=function(t,e){for(var r=B.list(t,"",!0),n=!1,i=0;i=f?d=!1:s.val>=u&&s.pad<=f&&(t._min.splice(o,1),o--);d&&t._min.push({val:u,pad:y&&0===u?0:f})}if(n(c)){for(d=!0,o=0;o=c&&s.pad>=h?d=!1:s.val<=c&&s.pad<=h&&(t._max.splice(o,1),o--);d&&t._max.push({val:c,pad:y&&0===c?0:h})}}}if((t.autorange||!!A.nestedProperty(t,"rangeslider.autorange").get())&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var a,o,s,l,u,c,h,f,d,p,m,g=e.length,v=r.padded?.05*t._length:0,y=r.tozero&&("linear"===t.type||"-"===t.type);v&&"domain"===t.constrain&&t._inputDomain&&(v*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0]));var b=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),x=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),_=n(r.vpadplus||r.vpad),w=n(r.vpadminus||r.vpad);for(a=0;a<6;a++)i(a);for(a=g-1;a>5;a--)i(a)}},B.autoBin=function(t,e,r,n,i){var s=A.aggNums(Math.min,null,t),l=A.aggNums(Math.max,null,t);if(i||(i=e.calendar),"category"===e.type)return{start:s-.5,end:l+.5,size:1,_count:l-s+1};var u;if(r)u=(l-s)/r;else{var c=A.distinctVals(t),h=Math.pow(10,Math.floor(Math.log(c.minDiff)/Math.LN10)),f=h*A.roundUp(c.minDiff/h,[.9,1.9,4.9,9.9],!0);u=Math.max(f,2*A.stdev(t)/Math.pow(t.length,n?.25:.4)),M(u)||(u=1)}var d;d="log"===e.type?{type:"linear",range:[s,l]}:{type:e.type,range:A.simpleMap([s,l],e.c2r,0,i),calendar:i},B.setConvert(d),B.autoTicks(d,u);var p,m,g=B.tickIncrement(B.tickFirst(d),d.dtick,"reverse",i);if("number"==typeof d.dtick)g=a(g,t,d,s,l),m=1+Math.floor((l-g)/d.dtick),p=g+m*d.dtick;else for("M"===d.dtick.charAt(0)&&(g=o(g,t,d.dtick,s,i)),p=g,m=0;p<=l;)p=B.tickIncrement(p,d.dtick,!1,i),m++;return{start:e.c2r(g,0,i),end:e.c2r(p,0,i),size:d.dtick,_count:m}},B.calcTicks=function(t){var e=A.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var r,n=t.nticks;n||("category"===t.type?(r=t.tickfont?1.2*(t.tickfont.size||12):15,n=t._length/r):(r="y"===t._id.charAt(0)?40:80,n=A.constrain(t._length/r,4,9)+1)),"array"===t.tickmode&&(n*=100),B.autoTicks(t,Math.abs(e[1]-e[0])/n),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}if(t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),u(t),"array"===t.tickmode)return s(t);t._tmin=B.tickFirst(t);var i=e[1]=o:h<=o)&&!(a.length>c||h===l);h=B.tickIncrement(h,t.dtick,i,t.calendar))l=h,a.push(h);t._tmax=a[a.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var f=new Array(a.length),d=0;dz?(e/=z,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*l(e,r,q)):n>D?(e/=D,t.dtick="M"+l(e,1,G)):n>P?(t.dtick=l(e,P,W),t.tick0=A.dateTick0(t.calendar,!0)):n>O?t.dtick=l(e,O,G):n>R?t.dtick=l(e,R,Y):n>F?t.dtick=l(e,F,Y):(r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=l(e,r,q))}else if("log"===t.type){t.tick0=0;var i=A.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(i[1]-i[0])<1){var a=1.5*Math.abs((i[1]-i[0])/e);e=Math.abs(Math.pow(10,i[1])-Math.pow(10,i[0]))/a,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+l(e,r,q)}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=l(e,r,q));if(0===t.dtick&&(t.dtick=1),!M(t.dtick)&&"string"!=typeof t.dtick){var o=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(o)}},B.tickIncrement=function(t,e,r,n){var i=r?-1:1;if(M(e))return t+i*e;var a=e.charAt(0),o=i*Number(e.substr(1));if("M"===a)return A.incrementMonth(t,o,n);if("L"===a)return Math.log(Math.pow(10,t)+o)/Math.LN10;if("D"===a){var s="D2"===e?Z:X,l=t+.01*i,u=A.roundUp(A.mod(l,1),s,r);return Math.floor(l)+Math.log(w.round(Math.pow(10,u),1))/Math.LN10}throw"unrecognized dtick "+String(e)},B.tickFirst=function(t){var e=t.r2l||Number,r=A.simpleMap(t.range,e),n=r[1]1&&e2*i}function a(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,i=0,a=0;a2*n}var o=t("fast-isnumeric"),s=t("../../lib"),l=t("../../constants/numerical").BADNUM;e.exports=function(t,e){return i(t,e)?"date":a(t)?"category":n(t)?"linear":"-"}},{"../../constants/numerical":707,"../../lib":728,"fast-isnumeric":131}],774:[function(t,e,r){"use strict";var n=t("tinycolor2").mix,i=t("../../registry"),a=t("../../lib"),o=t("../../components/color/attributes").lightFraction,s=t("./layout_attributes"),l=t("./tick_value_defaults"),u=t("./tick_mark_defaults"),c=t("./tick_label_defaults"),h=t("./category_order_defaults"),f=t("./set_convert"),d=t("./ordered_categories");e.exports=function(t,e,r,p,m){function g(r,n){return a.coerce2(t,e,s,r,n)}var v=p.letter,y=p.font||{},b="Click to enter "+(p.title||v.toUpperCase()+" axis")+" title",x=r("visible",!p.cheateronly),_=e.type;if("date"===_){i.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",p.calendar)}if(f(e,m),r("autorange",!e.isValidRange(t.range))&&r("rangemode"),r("range"),e.cleanRange(),h(t,e,r),e._initialCategories="category"===_?d(v,e.categoryorder,e.categoryarray,p.data):[],!x)return e;var w=r("color"),M=w===t.color?w:y.color;r("title",b),a.coerceFont(r,"titlefont",{family:y.family,size:Math.round(1.2*y.size),color:M}),l(t,e,r,_),c(t,e,r,_,p),u(t,e,r,p);var k=g("linecolor",w),A=g("linewidth"),T=r("showline",!!k||!!A);T||(delete e.linecolor,delete e.linewidth),(T||e.ticks)&&r("mirror");var S=g("gridcolor",n(w,p.bgColor,o).toRgbString()),E=g("gridwidth");r("showgrid",p.showGrid||!!S||!!E)||(delete e.gridcolor,delete e.gridwidth);var L=g("zerolinecolor",w),C=g("zerolinewidth");return r("zeroline",p.showGrid||!!L||!!C)||(delete e.zerolinecolor,delete e.zerolinewidth),e}},{"../../components/color/attributes":603,"../../lib":728,"../../registry":846,"./category_order_defaults":776,"./layout_attributes":783,"./ordered_categories":785,"./set_convert":789,"./tick_label_defaults":790,"./tick_mark_defaults":791,"./tick_value_defaults":792,tinycolor2:534}],775:[function(t,e,r){"use strict";function n(t,e,r){function n(t,r){for(var n=Object.keys(t),i=/^[xyz]axis[0-9]*/,a=[],o=0;o0;a&&(n="array");var o=r("categoryorder",n);"array"===o&&r("categoryarray"),a||"array"!==o||(e.categoryorder="trace")}}},{}],777:[function(t,e,r){"use strict";var n=t("../../lib").counterRegex;e.exports={idRegex:{x:n("x"),y:n("y")},attrRegex:n("[xy]axis"),xAxisMatch:n("xaxis"),yAxisMatch:n("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,SELECTDELAY:100,SELECTID:"-select",DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","maplayer","barlayer","carpetlayer","boxlayer","scatterlayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},{"../../lib":728}],778:[function(t,e,r){"use strict";function n(t,e,r,n){var i,a,s,l,u=n[o(e)].type,c=[];for(a=0;ao*v)||_)for(r=0;rI&&DL&&(L=D);var R=(L-E)/(2*C);h/=R,E=l.l2r(E),L=l.l2r(L),l.range=l._input.range=A=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function u(t,e){return t?"nsew"===t?"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}function c(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",i+"Z")}function h(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:T.background,stroke:T.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function f(t){t.selectAll(".select-outline").remove()}function d(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),i||(t.transition().style("fill",a>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function p(t){x.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function m(t){return-1!==["lasso","select"].indexOf(t)}function g(t,e){return"M"+(t.l-.5)+","+(e-j-.5)+"h-3v"+(2*j+1)+"h3ZM"+(t.r+.5)+","+(e-j-.5)+"h3v"+(2*j+1)+"h-3Z"}function v(t,e){return"M"+(e-j-.5)+","+(t.t-.5)+"v-3h"+(2*j+1)+"v3ZM"+(e-j-.5)+","+(t.b+.5)+"v3h"+(2*j+1)+"v-3Z"}function y(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,j)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function b(t,e,r){var n,i,a,o,s,l,u=!1,c={},h={};for(n=0;nj||s>j?(kt="xy",o/at>s/ot?(s=o*ot/at,bt>a?xt.t=bt-s:xt.b=bt+s):(o=s*at/ot,yt>i?xt.l=yt-o:xt.r=yt+o),Tt.attr("d",y(xt))):n():!lt||szoom back out","long"),N=!1)}function W(e,r){var n=1===(U+V).length;if(e)Q();else if(2!==r||n){if(1===r&&n){var i=U?rt[0]:et[0],o="s"===U||"w"===V?0:1,s=i._name+".range["+o+"]",l=a(i,o),u="left",c="middle";if(i.fixedrange)return;U?(c="n"===U?"top":"bottom","right"===i.side&&(u="right")):"e"===V&&(u="right"),t._context.showAxisRangeEntryBoxes&&x.select(gt).call(A.makeEditable,{gd:t,immediate:!0,background:dt.paper_bgcolor,text:String(l),fill:i.tickfont?i.tickfont.color:"#444",horizontalAlign:u,verticalAlign:c}).on("edit",function(e){var r=i.d2r(e);void 0!==r&&w.relayout(t,s,r)})}}else K()}function X(e){function r(t,e,r){function n(e){return t.l2r(a+(e-a)*r)}if(!t.fixedrange){var i=k.simpleMap(t.range,t.r2l),a=i[0]+(i[1]-i[0])*e;t.range=i.map(n)}}if(t._context.scrollZoom||dt._enablescrollzoom){if(t._transitioningWithDuration)return k.pauseEvent(e);var n=t.querySelector(".plotly");if(H(),!(n.scrollHeight-n.clientHeight>10||n.scrollWidth-n.clientWidth>10)){clearTimeout(Lt);var i=-e.deltaY;if(isFinite(i)||(i=e.wheelDelta/10),!isFinite(i))return void k.log("Did not find wheel motion attributes: ",e);var a,o=Math.exp(-Math.min(Math.max(i,-20),20)/200),s=It.draglayer.select(".nsewdrag").node().getBoundingClientRect(),l=(e.clientX-s.left)/s.width,u=(s.bottom-e.clientY)/s.height;if(V||ct){for(V||(l=.5),a=0;a rect").call(S.setTranslate,s,l).call(S.setScale,a,o);var w=m.plot.selectAll(".scatterlayer .points, .boxlayer .points");m.plot.call(S.setTranslate,x,_).call(S.setScale,1/a,1/o),w.selectAll(".point").call(S.setPointGroupScale,a,o).call(S.hideOutsideRangePoints,m),w.selectAll(".textpoint").call(S.setTextPointsScale,a,o).call(S.hideOutsideRangePoints,m)}}}var tt,et,rt,nt,it,at,ot,st,lt,ut,ct,ht,ft,dt=t._fullLayout,pt=t._fullLayout._zoomlayer,mt=U+V==="nsew";H();var gt=n(e,U+V+"drag",ut,r,T,E,B);if(!lt&&!st&&!m(dt.dragmode))return gt.onmousedown=null,gt.style.pointerEvents=mt?"all":"none",gt;var vt={element:gt,gd:t,plotinfo:e,prepFn:function(e,r,n){var i=t._fullLayout.dragmode;mt?e.shiftKey&&(i="pan"===i?"zoom":"pan"):i="pan",vt.minDrag="lasso"===i?1:void 0,"zoom"===i?(vt.moveFn=G,vt.doneFn=Y,vt.minDrag=1,q(e,r,n)):"pan"===i?(vt.moveFn=Z,vt.doneFn=W,f(pt)):m(i)&&(vt.xaxes=et,vt.yaxes=rt,P(e,r,n,vt,i))}};L.init(vt);var yt,bt,xt,_t,wt,Mt,kt,At,Tt,St={},Et=[0,0,at,ot],Lt=null,Ct=R.REDRAWDELAY,It=e.mainplot?dt._plots[e.mainplot]:e;return U.length*V.length!=1&&(void 0!==gt.onwheel?gt.onwheel=X:void 0!==gt.onmousewheel&&(gt.onmousewheel=X)),gt}},{"../../components/color":604,"../../components/dragelement":625,"../../components/drawing":628,"../../constants/alignment":701,"../../lib":728,"../../lib/setcursor":746,"../../lib/svg_text_utils":750,"../../plotly":767,"../../registry":846,"../plots":831,"./axes":772,"./axis_ids":775,"./constants":777,"./scale_zoom":787,"./select":788,d3:122,tinycolor2:534}],781:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../components/fx"),a=t("../../components/dragelement"),o=t("./constants"),s=t("./dragbox");e.exports=function(t){var e=t._fullLayout;if((e._has("cartesian")||e._has("gl2d"))&&!t._context.staticPlot){Object.keys(e._plots||{}).sort(function(t,r){if((e._plots[t].mainplot&&!0)===(e._plots[r].mainplot&&!0)){var n=t.split("y"),i=r.split("y");return n[0]===i[0]?Number(n[1]||1)-Number(i[1]||1):Number(n[0]||1)-Number(i[0]||1)}return e._plots[t].mainplot?1:-1}).forEach(function(r){var l=e._plots[r],u=l.xaxis,c=l.yaxis,h=(u._linepositions[r]||[])[3],f=(c._linepositions[r]||[])[3],d=o.DRAGGERSIZE;if(n(h)&&"top"===u.side&&(h-=d),n(f)&&"right"!==c.side&&(f-=d),!l.mainplot){var p=s(t,l,0,0,u._length,c._length,"ns","ew");p.onmousemove=function(e){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===r&&i.hover(t,e,r)},i.hover(t,e,r),t._fullLayout._lasthover=p,t._fullLayout._hoversubplot=r},p.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,a.unhover(t,e))},p.onclick=function(e){i.click(t,e,r)},t._context.showAxisDragHandles&&(s(t,l,-d,-d,d,d,"n","w"),s(t,l,u._length,-d,d,d,"n","e"),s(t,l,-d,c._length,d,d,"s","w"),s(t,l,u._length,c._length,d,d,"s","e"))}t._context.showAxisDragHandles&&(n(h)&&("free"===u.anchor&&(h-=e._size.h*(1-c.domain[1])),s(t,l,.1*u._length,h,.8*u._length,d,"","ew"),s(t,l,0,h,.1*u._length,d,"","w"),s(t,l,.9*u._length,h,.1*u._length,d,"","e")),n(f)&&("free"===c.anchor&&(f-=e._size.w*u.domain[0]),s(t,l,f,.1*c._length,d,.8*c._length,"ns",""),s(t,l,f,.9*c._length,d,.1*c._length,"s",""),s(t,l,f,0,d,.1*c._length,"n","")))});var r=e._hoverlayer.node();r.onmousemove=function(r){r.target=e._lasthover,i.hover(t,r,e._hoversubplot)},r.onclick=function(r){r.target=e._lasthover,i.click(t,r)},r.onmousedown=function(t){e._lasthover.onmousedown(t)}}}},{"../../components/dragelement":625,"../../components/fx":645,"./constants":777,"./dragbox":780,"fast-isnumeric":131}],782:[function(t,e,r){"use strict";function n(t,e,r,n,i){var a=t._fullLayout,o=a._modules;e.plot&&e.plot.selectAll("g:not(.scatterlayer)").selectAll("g.trace").remove();for(var s=0;sc[1]-.01&&(e.domain=[0,1]),i.noneOrAll(t.domain,e.domain,[0,1])}return r("layer"),e}},{"../../lib":728,"fast-isnumeric":131}],787:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*r;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)]}},{"../../constants/alignment":701}],788:[function(t,e,r){"use strict";function n(t){return t._id}function i(t,e){if(Array.isArray(t))for(var r=e.cd[0].trace,n=0;n0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-3*M*Math.abs(n-i))}return d}function h(e,r,n){var i=u(e,n||t.calendar);if(i===d){if(!a(e))return d;i=u(new Date(+e))}return i}function g(e,r,n){return l(e,r,n||t.calendar)}function v(e){return t._categories[Math.round(e)]}function y(e){if(null!==e&&void 0!==e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return d}function b(e){if(t._categoriesMap){var r=t._categoriesMap[e];if(void 0!==r)return r}if(a(e))return+e}function x(e){return a(e)?i.round(t._b+t._m*e,2):d}function _(e){return(e-t._b)/t._m}e=e||{};var w=(t._id||"x").charAt(0),M=10;t.c2l="log"===t.type?r:c,t.l2c="log"===t.type?n:c,t.l2p=x,t.p2l=_,t.c2p="log"===t.type?function(t,e){return x(r(t,e))}:x,t.p2c="log"===t.type?function(t){return n(_(t))}:_,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=s,t.c2d=t.c2r=t.l2d=t.l2r=c,t.d2p=t.r2p=function(e){return t.l2p(s(e))},t.p2d=t.p2r=_,t.cleanPos=c):"log"===t.type?(t.d2r=t.d2l=function(t,e){return r(s(t),e)},t.r2d=t.r2c=function(t){return n(s(t))},t.d2c=t.r2l=s,t.c2d=t.l2r=c,t.c2r=r,t.l2d=n,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return n(_(t))},t.r2p=function(e){return t.l2p(s(e))},t.p2r=_,t.cleanPos=c):"date"===t.type?(t.d2r=t.r2d=o.identity,t.d2c=t.r2c=t.d2l=t.r2l=h,t.c2d=t.c2r=t.l2d=t.l2r=g,t.d2p=t.r2p=function(e,r,n){return t.l2p(h(e,0,n))},t.p2d=t.p2r=function(t,e,r){return g(_(t),e,r)},t.cleanPos=function(e){return o.cleanDate(e,d,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=y,t.r2d=t.c2d=t.l2d=v,t.d2r=t.d2l_noadd=b,t.r2c=function(e){var r=b(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=c,t.r2l=b,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return v(_(t))},t.r2p=t.d2p,t.p2r=_,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:c(t)}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e){e||(e="range");var r,n,i=o.nestedProperty(t,e).get();if(n="date"===t.type?o.dfltRange(t.calendar):"y"===w?p.DFLTRANGEY:p.DFLTRANGEX,n=n.slice(),!i||2!==i.length)return void o.nestedProperty(t,e).set(n);for("date"===t.type&&(i[0]=o.cleanDate(i[0],d,t.calendar),i[1]=o.cleanDate(i[1],d,t.calendar)),r=0;r<2;r++)if("date"===t.type){if(!o.isDateTime(i[r],t.calendar)){t[e]=n;break}if(t.r2l(i[0])===t.r2l(i[1])){var s=o.constrain(t.r2l(i[0]),o.MIN_MS+1e3,o.MAX_MS-1e3);i[0]=t.l2r(s-1e3),i[1]=t.l2r(s+1e3);break}}else{if(!a(i[r])){if(!a(i[1-r])){t[e]=n;break}i[r]=i[1-r]*(r?10:.1)}if(i[r]<-f?i[r]=-f:i[r]>f&&(i[r]=f),i[0]===i[1]){var l=Math.max(1,Math.abs(1e-6*i[0]));i[0]-=l,i[1]+=l}}},t.setScale=function(r){var n=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var i=m.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",s=t.calendar;t.cleanRange(a);var l=t.r2l(t[a][0],s),u=t.r2l(t[a][1],s);if("y"===w?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(l-u),t._b=-t._m*u):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(u-l),t._b=-t._m*l),!isFinite(t._m)||!isFinite(t._b))throw o.notifier("Something went wrong with axis scaling","long"),e._replotting=!1,new Error("axis scaling")},t.makeCalcdata=function(e,r){var n,i,a,o="date"===t.type&&e[r+"calendar"];if(r in e)for(n=e[r],i=new Array(n.length),a=0;a=t.range[0]&&r<=t.range[1]}:function(e){var r=e.y;return r>=t.range[0]&&r<=t.range[1]},t._min=[],t._max=[],t._separators=e.separators,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":707,"../../lib":728,"./axis_ids":775,"./constants":777,d3:122,"fast-isnumeric":131}],790:[function(t,e,r){"use strict";function n(t){var e=["showexponent","showtickprefix","showticksuffix"],r=e.filter(function(e){return void 0!==t[e]}),n=function(e){return t[e]===t[r[0]]};if(r.every(n)||1===r.length)return t[r[0]]}var i=t("../../lib");e.exports=function(t,e,r,a,o){var s=n(t);if(r("tickprefix")&&r("showtickprefix",s),r("ticksuffix")&&r("showticksuffix",s),r("showticklabels")){var l=o.font||{},u=e.color===t.color?e.color:l.color;i.coerceFont(r,"tickfont",{family:l.family,size:l.size,color:u}),r("tickangle"),"category"!==a&&(r("tickformat")||"date"===a||(r("showexponent",s),r("exponentformat"),r("separatethousands")))}"category"===a||o.noHover||r("hoverformat")}},{"../../lib":728}],791:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r,a){var o=n.coerce2(t,e,i,"ticklen"),s=n.coerce2(t,e,i,"tickwidth"),l=n.coerce2(t,e,i,"tickcolor",e.color);r("ticks",a.outerTicks||o||s||l?"outside":"")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":728,"./layout_attributes":783}],792:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../constants/numerical").ONEDAY;e.exports=function(t,e,r,o){var s="auto";"array"!==t.tickmode||"log"!==o&&"date"!==o||(t.tickmode="auto"),Array.isArray(t.tickvals)?s="array":t.dtick&&(s="linear");var l=r("tickmode",s);if("auto"===l)r("nticks");else if("linear"===l){var u="date"===o?a:1,c=r("dtick",u);if(n(c))e.dtick=c>0?Number(c):u;else if("string"!=typeof c)e.dtick=u;else{var h=c.charAt(0),f=c.substr(1);f=n(f)?Number(f):0,(f<=0||!("date"===o&&"M"===h&&f===Math.round(f)||"log"===o&&"L"===h||"log"===o&&"D"===h&&(1===f||2===f)))&&(e.dtick=u)}var d="date"===o?i.dateTick0(e.calendar):0,p=r("tick0",d);"date"===o?e.tick0=i.cleanDate(p,d):n(p)&&"D1"!==c&&"D2"!==c?e.tick0=Number(p):e.tick0=d}else{var m=r("tickvals");void 0===m?e.tickmode="auto":r("ticktext")}}},{"../../constants/numerical":707,"../../lib":728,"fast-isnumeric":131}],793:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plotly"),a=t("../../registry"),o=t("../../components/drawing"),s=t("./axes"),l=t("./constants").attrRegex;e.exports=function(t,e,r,u){function c(e,r){function n(e,r,n){for(i=0;i rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.select(".scatterlayer").selectAll(".points");n.selectAll(".point").call(o.setPointGroupScale,1,1).call(o.hideOutsideRangePoints,t),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1).call(o.hideOutsideRangePoints,t)}function f(e,r){var n,i,a,s=y[e.xaxis._id],l=y[e.yaxis._id],u=[];if(s){n=t._fullLayout[s.axisName],i=n._r,a=s.to,u[0]=(i[0]*(1-r)+r*a[0]-i[0])/(i[1]-i[0])*e.xaxis._length;var h=i[1]-i[0],f=a[1]-a[0];n.range[0]=i[0]*(1-r)+r*a[0],n.range[1]=i[1]*(1-r)+r*a[1],u[2]=e.xaxis._length*(1-r+r*f/h)}else u[0]=0,u[2]=e.xaxis._length;if(l){n=t._fullLayout[l.axisName],i=n._r,a=l.to,u[1]=(i[1]*(1-r)+r*a[1]-i[1])/(i[0]-i[1])*e.yaxis._length;var d=i[1]-i[0],p=a[1]-a[0];n.range[0]=i[0]*(1-r)+r*a[0],n.range[1]=i[1]*(1-r)+r*a[1],u[3]=e.yaxis._length*(1-r+r*p/d)}else u[1]=0,u[3]=e.yaxis._length;c(e.xaxis,e.yaxis);var m=e.xaxis,v=e.yaxis,b=!!s,x=!!l,_=b?m._length/u[2]:1,w=x?v._length/u[3]:1,M=b?u[0]:0,k=x?u[1]:0,A=b?u[0]/u[2]*m._length:0,T=x?u[1]/u[3]*v._length:0,S=m._offset-A,E=v._offset-T;g._defs.select("#"+e.clipId+"> rect").call(o.setTranslate,M,k).call(o.setScale,1/_,1/w),e.plot.call(o.setTranslate,S,E).call(o.setScale,_,w).selectAll(".points").selectAll(".point").call(o.setPointGroupScale,1/_,1/w),e.plot.selectAll(".points").selectAll(".textpoint").call(o.setTextPointsScale,1/_,1/w)}function d(){for(var e={},r=0;rr.duration?(d(),k=window.cancelAnimationFrame(m)):k=window.requestAnimationFrame(m)}var g=t._fullLayout,v=[],y=function(t){var e,r,n,i,a={};for(e in t)if(r=e.split("."),r[0].match(l)){var o=e.charAt(0),s=r[0];if(n=g[s],i={},Array.isArray(t[e])?i.to=t[e].slice(0):Array.isArray(t[e].range)&&(i.to=t[e].range.slice(0)),!i.to)continue;i.axisName=s,i.length=n._length,v.push(o),a[o]=i}return a}(e),b=Object.keys(y),x=function(t,e,r){var n,i,a,o=t._plots,s=[];for(n in o){var l=o[n];if(-1===s.indexOf(l)){var u=l.xaxis._id,c=l.yaxis._id,h=l.xaxis.range,f=l.yaxis.range;l.xaxis._r=l.xaxis.range.slice(),l.yaxis._r=l.yaxis.range.slice(),i=r[u]?r[u].to:h,a=r[c]?r[c].to:f,h[0]===i[0]&&h[1]===i[1]&&f[0]===a[0]&&f[1]===a[1]||-1===e.indexOf(u)&&-1===e.indexOf(c)||s.push(l)}}return s}(g,b,y);if(!x.length)return function(){function e(e,r,n){for(var i=0;i0?".":"")+i;u.isPlainObject(a)?s(a,e,o,n+1):e(o,i,a)}})}var l=t("../plotly"),u=t("../lib");r.manageCommandObserver=function(t,e,i,a){var o={},s=!0;e&&e._commandObserver&&(o=e._commandObserver),o.cache||(o.cache={}),o.lookupTable={};var l=r.hasSimpleAPICommandBindings(t,i,o.lookupTable);if(e&&e._commandObserver){if(l)return o;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,o}if(l){n(t,l,o.cache),o.check=function(){if(s){var e=n(t,l,o.cache);return e.changed&&a&&void 0!==o.lookupTable[e.value]&&(o.disable(),Promise.resolve(a({value:e.value,type:l.type,prop:l.prop,traces:l.traces,index:o.lookupTable[e.value]})).then(o.enable,o.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],h=0;hi*Math.PI/180}return!1},n.getPath=function(){return s.geo.path().projection(n)},n.getBounds=function(t){return n.getPath().bounds(t)},n.fitExtent=function(t,e){var r=t[1][0]-t[0][0],i=t[1][1]-t[0][1],a=n.clipExtent&&n.clipExtent();n.scale(150).translate([0,0]),a&&n.clipExtent(null);var o=n.getBounds(e),s=Math.min(r/(o[1][0]-o[0][0]),i/(o[1][1]-o[0][1])),l=+t[0][0]+(r-s*(o[1][0]+o[0][0]))/2,u=+t[0][1]+(i-s*(o[1][1]+o[0][1]))/2;return a&&n.clipExtent(a),n.scale(150*s).translate([l,u])},n.precision(y.precision),i&&n.clipAngle(i-y.clipPad),n}function a(t,e){var r=e[t],n=r.dtick,i=y.scopeDefaults[e.scope],a=i.lonaxisRange,o=i.lataxisRange,l="lonaxis"===t?[n]:[0,n];return s.geo.graticule().extent([[a[0],o[0]],[a[1],o[1]]]).step(l)}function o(t,e){var r=y.clipPad,n=t[0]+r,i=t[1]-r,a=e[0]+r,o=e[1]-r;n>0&&i<0&&(i+=360);var s=(i-n)/4;return{type:"Polygon",coordinates:[[[n,a],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[i,o],[i,a],[i-s,a],[i-2*s,a],[i-3*s,a],[n,a]]]}}var s=t("d3"),l=t("../../plotly"),u=t("../../lib"),c=t("../../components/color"),h=t("../../components/drawing"),f=t("../../components/fx"),d=t("../plots"),p=t("../cartesian/axes"),m=t("../../components/dragelement"),g=t("../cartesian/select"),v=t("./zoom"),y=t("./constants"),b=t("../../lib/topojson_utils"),x=t("topojson-client").feature;t("./projections")(s);var _=n.prototype;e.exports=function(t){return new n(t)},_.plot=function(t,e,r){var n=this,i=e[this.id],a=b.getTopojsonName(i);null===n.topojson||a!==n.topojsonName?(n.topojsonName=a,void 0===PlotlyGeoAssets.topojson[n.topojsonName]?r.push(n.fetchTopojson().then(function(r){PlotlyGeoAssets.topojson[n.topojsonName]=r,n.topojson=r,n.update(t,e)})):(n.topojson=PlotlyGeoAssets.topojson[n.topojsonName],n.update(t,e))):n.update(t,e)},_.fetchTopojson=function(){var t=b.getTopojsonPath(this.topojsonURL,this.topojsonName);return new Promise(function(e,r){s.json(t,function(n,i){if(n)return r(404===n.status?new Error(["plotly.js could not find topojson file at",t,".","Make sure the *topojsonURL* plot config option","is set properly."].join(" ")):new Error(["unexpected error while fetching topojson file at",t].join(" ")));e(i)})})},_.update=function(t,e){var r=e[this.id];if(!this.updateProjection(e,r)){this.hasChoropleth=!1;for(var n=0;n0&&M<0&&(M+=360);var k,A=(w+M)/2;if(!c){var T=h?l.projRotate:[A,0,0];k=r("projection.rotation.lon",T[0]),r("projection.rotation.lat",T[1]),r("projection.rotation.roll",T[2]),n=r("showcoastlines",!h),n&&(r("coastlinecolor"),r("coastlinewidth")),n=r("showocean"),n&&r("oceancolor")}var S,E;if(c?(S=-96.6,E=38.7):(S=h?A:k,E=(_[0]+_[1])/2),r("center.lon",S),r("center.lat",E),f){r("projection.parallels",l.projParallels||[0,60])}r("projection.scale"),n=r("showland"),n&&r("landcolor"),n=r("showlakes"),n&&r("lakecolor"),n=r("showrivers"),n&&(r("rivercolor"),r("riverwidth")),n=r("showcountries",h&&"usa"!==o),n&&(r("countrycolor"),r("countrywidth")),("usa"===o||"north america"===o&&50===i)&&(r("showsubunits",!0),r("subunitcolor"),r("subunitwidth")),h||(n=r("showframe",!0))&&(r("framecolor"),r("framewidth")),r("bgcolor")}var i=t("../../subplot_defaults"),a=t("../constants"),o=t("./layout_attributes"),s=a.axesNames;e.exports=function(t,e,r){i(t,e,r,{type:"geo",attributes:o,handleDefaults:n,partition:"y"})}},{"../../subplot_defaults":838,"../constants":798,"./layout_attributes":803}],803:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("../constants"),a=t("../../../plot_api/edit_types").overrideAll,o={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number"},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:n.lightLine},gridwidth:{valType:"number",min:0,dflt:1}};e.exports=a({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]}},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:Object.keys(i.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:Object.keys(i.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:n.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:i.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:i.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:i.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:i.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:n.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:n.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:n.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:n.background},lonaxis:o,lataxis:o},"plot","from-root")},{"../../../components/color/attributes":603,"../../../plot_api/edit_types":756,"../constants":798}],804:[function(t,e,r){"use strict";function n(t){function e(t,e){return{type:"Feature",id:t.id,properties:t.properties,geometry:r(t.geometry,e)}}function r(e,n){if(!e)return null;if("GeometryCollection"===e.type)return{type:"GeometryCollection",geometries:object.geometries.map(function(t){return r(t,n)})};if(!S.hasOwnProperty(e.type))return null;var i=S[e.type];return t.geo.stream(e,n(i)),i.result()}function n(){}function i(t){if((e=t.length)<4)return!1;for(var e,r=0,n=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++rn^d>n&&r<(f-u)*(n-c)/(d-c)+u&&(i=!i)}return i}function o(t){return t?t/Math.sin(t):1}function s(t){return t>1?I:t<-1?-I:Math.asin(t)}function l(t){return t>1?0:t<-1?C:Math.acos(t)}function u(t,e){var r=(2+I)*Math.sin(e);e/=2;for(var n=0,i=1/0;n<10&&Math.abs(i)>E;n++){var a=Math.cos(e);e-=i=(e+Math.sin(e)*(a+2)-r)/(2*a*(1+a))}return[2/Math.sqrt(C*(4+C))*t*(1+Math.cos(e)),2*Math.sqrt(C/(4+C))*Math.sin(e)]}function c(t,e){function r(r,n){var i=R(r/e,n);return i[0]*=t,i}return arguments.length<2&&(e=t),1===e?R:e===1/0?f:(r.invert=function(r,n){var i=R.invert(r/t,n);return i[0]*=e,i},r)}function h(){var t=2,e=O(c),r=e(t);return r.coefficient=function(r){return arguments.length?e(t=+r):t},r}function f(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function d(t,e){return[3*t/(2*C)*Math.sqrt(C*C/3-e*e),e]}function p(t,e){return[t,1.25*Math.log(Math.tan(C/4+.4*e))]}function m(t){return function(e){var r,n=t*Math.sin(e),i=30;do{e-=r=(e+Math.sin(e)-n)/(1+Math.cos(e))}while(Math.abs(r)>E&&--i>0);return e/2}}function g(t,e){var r=e*e,n=r*r;return[t*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),e*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}function v(t,e){var r,n=Math.min(18,36*Math.abs(e)/C),i=Math.floor(n),a=n-i,o=(r=j[i])[0],s=r[1],l=(r=j[++i])[0],u=r[1],c=(r=j[Math.min(19,++i)])[0],h=r[1];return[t*(l+a*(c-o)/2+a*a*(c-2*l+o)/2),(e>0?I:-I)*(u+a*(h-s)/2+a*a*(h-2*u+s)/2)]}function y(t,e){return[t*Math.cos(e),e]}function b(t,e){var r=Math.cos(e),n=o(l(r*Math.cos(t/=2)));return[2*r*Math.sin(t)*n,Math.sin(e)*n]}function x(t,e){var r=b(t,e);return[(r[0]+t/I)/2,(r[1]+e)/2]}t.geo.project=function(t,e){var n=e.stream;if(!n)throw new Error("not yet supported");return(t&&_.hasOwnProperty(t.type)?_[t.type]:r)(t,n)};var _={Feature:e,FeatureCollection:function(t,r){return{type:"FeatureCollection",features:t.features.map(function(t){return e(t,r)})}}},w=[],M=[],k={point:function(t,e){w.push([t,e])},result:function(){var t=w.length?w.length<2?{type:"Point",coordinates:w[0]}:{type:"MultiPoint",coordinates:w}:null;return w=[],t}},A={lineStart:n,point:function(t,e){w.push([t,e])},lineEnd:function(){w.length&&(M.push(w),w=[])},result:function(){var t=M.length?M.length<2?{type:"LineString",coordinates:M[0]}:{type:"MultiLineString",coordinates:M}:null;return M=[],t}},T={polygonStart:n,lineStart:n,point:function(t,e){w.push([t,e])},lineEnd:function(){var t=w.length;if(t){do{w.push(w[0].slice())}while(++t<4);M.push(w),w=[]}},polygonEnd:n,result:function(){if(!M.length)return null;var t=[],e=[];return M.forEach(function(r){i(r)?t.push([r]):e.push(r)}),e.forEach(function(e){var r=e[0];t.some(function(t){if(a(t[0],r))return t.push(e),!0})||t.push([e])}),M=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},S={Point:k,MultiPoint:k,LineString:A,MultiLineString:A,Polygon:T,MultiPolygon:T,Sphere:T},E=1e-6,L=E*E,C=Math.PI,I=C/2,z=(Math.sqrt(C),C/180),D=180/C,P=t.geo.projection,O=t.geo.projectionMutator;t.geo.interrupt=function(e){function r(t,r){for(var n=r<0?-1:1,i=l[+(r<0)],a=0,o=i.length-1;ai[a][2][0];++a);var s=e(t-i[a][1][0],r);return s[0]+=e(i[a][1][0],n*r>n*i[a][0][1]?i[a][0][1]:r)[0],s}function n(){s=l.map(function(t){return t.map(function(t){var r,n=e(t[0][0],t[0][1])[0],i=e(t[2][0],t[2][1])[0],a=e(t[1][0],t[0][1])[1],o=e(t[1][0],t[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]})})}function i(){for(var e=1e-6,r=[],n=0,i=l[0].length;n=0;--n){var o=l[1][n],s=180*o[0][0]/C,u=180*o[0][1]/C,c=180*o[1][1]/C,h=180*o[2][0]/C,f=180*o[2][1]/C;r.push(a([[h-e,f-e],[h-e,c+e],[s+e,c+e],[s+e,u-e]],30))}return{type:"Polygon",coordinates:[t.merge(r)]}}function a(t,e){for(var r,n,i,a=-1,o=t.length,s=t[0],l=[];++aE&&--i>0);return[t/(.8707+(a=n*n)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),n]},(t.geo.naturalEarth=function(){return P(g)}).raw=g;var j=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];j.forEach(function(t){t[1]*=1.0144}),v.invert=function(t,e){var r=e/I,n=90*r,i=Math.min(18,Math.abs(n/5)),a=Math.max(0,Math.floor(i));do{var o=j[a][1],s=j[a+1][1],l=j[Math.min(19,a+2)][1],u=l-o,c=l-2*s+o,h=2*(Math.abs(r)-s)/u,f=c/u,d=h*(1-f*h*(1-2*f*h));if(d>=0||1===a){n=(e>=0?5:-5)*(d+i);var p,m=50;do{i=Math.min(18,Math.abs(n)/5),a=Math.floor(i),d=i-a,o=j[a][1],s=j[a+1][1],l=j[Math.min(19,a+2)][1],n-=(p=(e>=0?I:-I)*(s+d*(l-o)/2+d*d*(l-2*s+o)/2)-e)*D}while(Math.abs(p)>L&&--m>0);break}}while(--a>=0);var g=j[a][0],v=j[a+1][0],y=j[Math.min(19,a+2)][0];return[t/(v+d*(y-g)/2+d*d*(y-2*v+g)/2),n*z]},(t.geo.robinson=function(){return P(v)}).raw=v,y.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return P(y)}).raw=y,b.invert=function(t,e){if(!(t*t+4*e*e>C*C+E)){var r=t,n=e,i=25;do{var a,o=Math.sin(r),s=Math.sin(r/2),u=Math.cos(r/2),c=Math.sin(n),h=Math.cos(n),f=Math.sin(2*n),d=c*c,p=h*h,m=s*s,g=1-p*u*u,v=g?l(h*u)*Math.sqrt(a=1/g):a=0,y=2*v*h*s-t,b=v*c-e,x=a*(p*m+v*h*u*d),_=a*(.5*o*f-2*v*c*s),w=.25*a*(f*s-v*c*p*o),M=a*(d*u+v*m*h),k=_*w-M*x;if(!k)break;var A=(b*_-y*M)/k,T=(y*w-b*x)/k;r-=A,n-=T}while((Math.abs(A)>E||Math.abs(T)>E)&&--i>0);return[r,n]}},(t.geo.aitoff=function(){return P(b)}).raw=b,x.invert=function(t,e){var r=t,n=e,i=25;do{var a,o=Math.cos(n),s=Math.sin(n),u=Math.sin(2*n),c=s*s,h=o*o,f=Math.sin(r),d=Math.cos(r/2),p=Math.sin(r/2),m=p*p,g=1-h*d*d,v=g?l(o*d)*Math.sqrt(a=1/g):a=0,y=.5*(2*v*o*p+r/I)-t,b=.5*(v*s+n)-e,x=.5*a*(h*m+v*o*d*c)+.5/I,_=a*(f*u/4-v*s*p),w=.125*a*(u*p-v*s*h*f),M=.5*a*(c*d+v*m*o)+.5,k=_*w-M*x,A=(b*_-y*M)/k,T=(y*w-b*x)/k;r-=A,n-=T}while((Math.abs(A)>E||Math.abs(T)>E)&&--i>0);return[r,n]},(t.geo.winkel3=function(){return P(x)}).raw=x}e.exports=n},{}],805:[function(t,e,r){"use strict";function n(t,e){var r=t.projection;return(e._isScoped?o:e._isClipped?l:s)(t,r)}function i(t,e){return w.behavior.zoom().translate(e.translate()).scale(e.scale())}function a(t,e,r){function n(t,e){var r=M.nestedProperty(s,t);r.get()!==e&&(r.set(e),M.nestedProperty(o,t).set(e),l[i+"."+t]=e)}var i=t.id,a=t.graphDiv,o=a.layout[i],s=a._fullLayout[i],l={};r(n),n("projection.scale",e.scale()/t.fitScale),a.emit("plotly_relayout",l)}function o(t,e){function r(){w.select(this).style(T)}function n(){e.scale(w.event.scale).translate(w.event.translate),t.render()}function o(r){var n=e.invert(t.midPt);r("center.lon",n[0]),r("center.lat",n[1])}function s(){w.select(this).style(S),a(t,e,o)}var l=i(t,e);return l.on("zoomstart",r).on("zoom",n).on("zoomend",s),l}function s(t,e){function r(t){return e.invert(t)}function n(t){var n=e(r(t));return Math.abs(n[0]-t[0])>b||Math.abs(n[1]-t[1])>b}function o(){w.select(this).style(T),c=w.mouse(this),h=e.rotate(),f=e.translate(),d=h,p=r(c)}function s(){if(m=w.mouse(this),n(c))return y.scale(e.scale()),void y.translate(e.translate());e.scale(w.event.scale),e.translate([f[0],w.event.translate[1]]),p?r(m)&&(v=r(m),g=[d[0]+(v[0]-p[0]),h[1],h[2]],e.rotate(g),d=g):(c=m,p=r(c)),t.render()}function l(){w.select(this).style(S),a(t,e,u)}function u(r){var n=e.rotate(),i=e.invert(t.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",i[0]),r("center.lat",i[1])}var c,h,f,d,p,m,g,v,y=i(t,e),b=2;return y.on("zoomstart",o).on("zoom",s).on("zoomend",l),y}function l(t,e){function r(t){y++||t({type:"zoomstart"})}function n(t){t({type:"zoom"})}function o(t){--y||t({type:"zoomend"})}function s(t){var r=e.rotate();t("projection.rotation.lon",-r[0]),t("projection.rotation.lat",-r[1])}var l,p={r:e.rotate(),k:e.scale()},m=i(t,e),g=_(m,"zoomstart","zoom","zoomend"),y=0,b=m.on;return m.on("zoomstart",function(){w.select(this).style(T);var t=w.mouse(this),i=e.rotate(),a=i,o=e.translate(),s=c(i);l=u(e,t),b.call(m,"zoom",function(){var r=w.mouse(this);if(e.scale(p.k=w.event.scale),l){if(u(e,r)){e.rotate(i).translate(o);var c=u(e,r),m=f(l,c),y=v(h(s,m)),b=p.r=d(y,l,a);isFinite(b[0])&&isFinite(b[1])&&isFinite(b[2])||(b=a),e.rotate(b),a=b}}else t=r,l=u(e,t);n(g.of(this,arguments))}),r(g.of(this,arguments))}).on("zoomend",function(){w.select(this).style(S),b.call(m,"zoom",null),o(g.of(this,arguments)),a(t,e,s)}).on("zoom.redraw",function(){t.render()}),w.rebind(m,g,"on")}function u(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&y(r)}function c(t){var e=.5*t[0]*k,r=.5*t[1]*k,n=.5*t[2]*k,i=Math.sin(e),a=Math.cos(e),o=Math.sin(r),s=Math.cos(r),l=Math.sin(n),u=Math.cos(n);return[a*s*u+i*o*l,i*s*u-a*o*l,a*o*u+i*s*l,a*s*l-i*o*u]}function h(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=e[0],s=e[1],l=e[2],u=e[3];return[r*o-n*s-i*l-a*u,r*s+n*o+i*u-a*l,r*l-n*u+i*o+a*s,r*u+n*l-i*s+a*o]}function f(t,e){if(t&&e){var r=x(t,e),n=Math.sqrt(b(r,r)),i=.5*Math.acos(Math.max(-1,Math.min(1,b(t,e)))),a=Math.sin(i)/n;return n&&[Math.cos(i),r[2]*a,-r[1]*a,r[0]*a]}}function d(t,e,r){var n=g(e,2,t[0]);n=g(n,1,t[1]),n=g(n,0,t[2]-r[2]);var i,a,o=e[0],s=e[1],l=e[2],u=n[0],c=n[1],h=n[2],f=Math.atan2(s,o)*A,d=Math.sqrt(o*o+s*s);Math.abs(c)>d?(a=(c>0?90:-90)-f,i=0):(a=Math.asin(c/d)*A-f,i=Math.sqrt(d*d-c*c));var m=180-a-2*f,v=(Math.atan2(h,u)-Math.atan2(l,i))*A,y=(Math.atan2(h,u)-Math.atan2(l,-i))*A;return p(r[0],r[1],a,v)<=p(r[0],r[1],m,y)?[a,v,r[2]]:[m,y,r[2]]}function p(t,e,r,n){var i=m(r-t),a=m(n-e);return Math.sqrt(i*i+a*a)}function m(t){return(t%360+540)%360-180}function g(t,e,r){var n=r*k,i=t.slice(),a=0===e?1:0,o=2===e?1:2,s=Math.cos(n),l=Math.sin(n);return i[a]=t[a]*s-t[o]*l,i[o]=t[o]*s+t[a]*l,i}function v(t){return[Math.atan2(2*(t[0]*t[1]+t[2]*t[3]),1-2*(t[1]*t[1]+t[2]*t[2]))*A,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*A,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*A]}function y(t){var e=t[0]*k,r=t[1]*k,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function b(t,e){for(var r=0,n=0,i=t.length;nMath.abs(u)?(h.boxEnd[1]=h.boxStart[1]+Math.abs(s)*w*(u>=0?1:-1),h.boxEnd[1]f[3]&&(h.boxEnd[1]=f[3],h.boxEnd[0]=h.boxStart[0]+(f[3]-h.boxStart[1])/Math.abs(w))):(h.boxEnd[0]=h.boxStart[0]+Math.abs(u)/w*(s>=0?1:-1),h.boxEnd[0]f[2]&&(h.boxEnd[0]=f[2],h.boxEnd[1]=h.boxStart[1]+(f[2]-h.boxStart[0])*Math.abs(w)))}}else h.boxEnabled?(s=h.boxStart[0]!==h.boxEnd[0],u=h.boxStart[1]!==h.boxEnd[1],s||u?(s&&(o(0,h.boxStart[0],h.boxEnd[0]),t.xaxis.autorange=!1),u&&(o(1,h.boxStart[1],h.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),h.boxEnabled=!1,h.boxInited=!1):h.boxInited&&(h.boxInited=!1);break;case"pan":h.boxEnabled=!1,h.boxInited=!1,n?(h.panning||(h.dragStart[0]=i,h.dragStart[1]=a),Math.abs(h.dragStart[0]-i)f[p+2]&&(f[p]=-1,f[p+2]=1),d=this[_[p]],d._length=o.viewBox[p+2]-o.viewBox[p],l.doAutoRange(d),d.setScale();b(s),o.ticks=this.computeTickMarks(),o.dataBox=this.calcDataBox(),o.merge(r),n.update(o),this.glplot.draw()},w.calcDataBox=function(){var t=this.xaxis,e=this.yaxis,r=t.range,n=e.range,i=t.r2l,a=e.r2l;return[i(r[0]),a(n[0]),i(r[1]),a(n[1])]},w.setRanges=function(t){var e=this.xaxis,r=this.yaxis,n=e.l2r,i=r.l2r;e.range=[n(t[0]),n(t[2])],r.range=[i(t[1]),i(t[3])]},w.updateTraces=function(t,e){var r,n,i,a=Object.keys(this.traces);this.fullData=t;t:for(r=0;rMath.abs(e))u.rotate(a,0,0,-t*r*Math.PI*p.rotateSpeed/window.innerWidth);else{var o=-p.zoomSpeed*n*e/window.innerHeight*(a-u.lastT())/20;u.pan(a,0,0,h*(Math.exp(o)-1))}}},!0),p}e.exports=n;var i=t("right-now"),a=t("3d-view"),o=t("mouse-change"),s=t("mouse-wheel"),l=t("mouse-event-offset")},{"3d-view":37,"mouse-change":452,"mouse-event-offset":453,"mouse-wheel":455,"right-now":502}],811:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../components/fx/layout_attributes"),a=t("./scene"),o=t("../plots"),s=t("../../lib"),l=t("../../constants/xmlns_namespaces");r.name="gl3d",r.attr="scene",r.idRoot="scene",r.idRegex=r.attrRegex=s.counterRegex("scene"),r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.baseLayoutAttrOverrides=n({hoverlabel:i.hoverlabel},"plot","nested"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,n=o.getSubplotIds(e,"gl3d"),i=0;i1;s(t,e,r,{type:"gl3d",attributes:u,handleDefaults:n,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:a,paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":604,"../../../lib":728,"../../../registry":846,"../../subplot_defaults":838,"./axis_defaults":814,"./layout_attributes":817}],817:[function(t,e,r){"use strict";function n(t,e,r){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:e,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}var i=t("./axis_attributes"),a=t("../../../lib/extend").extendFlat,o=t("../../../lib").counterRegex;e.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:a(n(0,0,1),{}),center:a(n(0,0,0),{}),eye:a(n(1.25,1.25,1.25),{}),editType:"camera"},domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot"},y:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot"},editType:"plot"},aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:i,yaxis:i,zaxis:i,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],dflt:"turntable",editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":728,"../../../lib/extend":717,"./axis_attributes":813}],818:[function(t,e,r){"use strict";function n(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}function i(t){var e=new n;return e.merge(t),e}var a=t("../../../lib/str2rgbarray"),o=["xaxis","yaxis","zaxis"];n.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[o[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=a(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=i},{"../../../lib/str2rgbarray":749}],819:[function(t,e,r){"use strict";function n(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],i=new Array(n.length),a=0;af[1][o]?d[o]=1:f[1][o]===f[0][o]?d[o]=1:d[o]=1/(f[1][o]-f[0][o]);for(this.dataScale=d,this.convertAnnotations(this),a=0;am[1][a])m[0][a]=-1,m[1][a]=1;else{var A=m[1][a]-m[0][a];m[0][a]-=A/32,m[1][a]+=A/32}}else{var S=l.range;m[0][a]=l.r2l(S[0]),m[1][a]=l.r2l(S[1])}m[0][a]===m[1][a]&&(m[0][a]-=1,m[1][a]+=1),g[a]=m[1][a]-m[0][a],this.glplot.bounds[0][a]=m[0][a]*d[a],this.glplot.bounds[1][a]=m[1][a]*d[a]}var E=[1,1,1];for(a=0;a<3;++a){l=c[T[a]],u=l.type;var L=v[u];E[a]=Math.pow(L.acc,1/L.count)/d[a]}var C;if("auto"===c.aspectmode)C=Math.max.apply(null,E)/Math.min.apply(null,E)<=4?E:[1,1,1];else if("cube"===c.aspectmode)C=[1,1,1];else if("data"===c.aspectmode)C=E;else{if("manual"!==c.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var I=c.aspectratio;C=[I.x,I.y,I.z]}c.aspectratio.x=h.aspectratio.x=C[0],c.aspectratio.y=h.aspectratio.y=C[1],c.aspectratio.z=h.aspectratio.z=C[2],this.glplot.aspect=C;var z=c.domain||null,D=e._size||null;if(z&&D){var P=this.container.style;P.position="absolute",P.left=D.l+z.x[0]*D.w+"px",P.top=D.t+(1-z.y[1])*D.h+"px",P.width=D.w*(z.x[1]-z.x[0])+"px",P.height=D.h*(z.y[1]-z.y[0])+"px"}this.glplot.redraw()}},A.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=this.glplot.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},A.getCamera=function(){return this.glplot.camera.view.recalcMatrix(this.camera.view.lastT()),u(this.glplot.camera)},A.setCamera=function(t){this.glplot.camera.lookAt.apply(this,l(t))},A.saveCamera=function(t){var e=this.getCamera(),r=m.nestedProperty(t,this.id+".camera"),n=r.get(),i=!1;if(void 0===n)i=!0;else for(var a=0;a<3;a++)for(var o=0;o<3;o++)if(!function(t,e,r,n){var i=["up","center","eye"],a=["x","y","z"];return e[i[r]]&&t[i[r]][a[n]]===e[i[r]][a[n]]}(e,n,a,o)){i=!0;break}return i&&r.set(e),i},A.updateFx=function(t,e){var r=this.camera;r&&("orbit"===t?(r.mode="orbit",r.keyBindingMode="rotate"):"turntable"===t?(r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate"):r.keyBindingMode=t),this.fullSceneLayout.hovermode=e},A.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(c),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,n=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*n*4);e.readPixels(0,0,r,n,e.RGBA,e.UNSIGNED_BYTE,i);for(var a=0,o=n-1;a0}function a(t){var e={},r={};switch(t.type){case"circle":s.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":s.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity});break;case"fill":s.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var n=t.symbol,i=l(n.textposition,n.iconsize);s.extendFlat(e,{"icon-image":n.icon+"-15","icon-size":n.iconsize/10,"text-field":n.text,"text-size":n.textfont.size,"text-anchor":i.anchor,"text-offset":i.offset}),s.extendFlat(r,{"icon-color":t.color,"text-color":n.textfont.color,"text-opacity":t.opacity})}return{layout:e,paint:r}}function o(t){var e,r=t.sourcetype,n=t.source,i={type:r},a="string"==typeof n;return"geojson"===r?e="data":"vector"===r&&(e=a?"url":"tiles"),i[e]=n,i}var s=t("../../lib"),l=t("./convert_text_opts"),u=n.prototype;u.update=function(t){this.visible?this.needsNewSource(t)?(this.updateLayer(t),this.updateSource(t)):this.needsNewLayer(t)&&this.updateLayer(t):(this.updateSource(t),this.updateLayer(t)),this.updateStyle(t),this.visible=i(t)},u.needsNewSource=function(t){return this.sourceType!==t.sourcetype||this.source!==t.source||this.layerType!==t.type},u.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==t.below},u.updateSource=function(t){var e=this.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,i(t)){var r=o(t);e.addSource(this.idSource,r)}},u.updateLayer=function(t){var e=this.map;if(e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer),this.layerType=t.type,i(t)){e.addLayer({id:this.idLayer,source:this.idSource,"source-layer":t.sourcelayer||"",type:t.type},t.below);var r={visibility:"visible"};this.mapbox.setOptions(this.idLayer,"setLayoutProperty",r)}},u.updateStyle=function(t){var e=a(t);i(t)&&(this.mapbox.setOptions(this.idLayer,"setLayoutProperty",e.layout),this.mapbox.setOptions(this.idLayer,"setPaintProperty",e.paint))},u.dispose=function(){var t=this.map;t.removeLayer(this.idLayer),t.removeSource(this.idSource)},e.exports=function(t,e,r){var i=new n(t,e);return i.update(r),i}},{"../../lib":728,"./convert_text_opts":824}],827:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color").defaultLine,a=t("../font_attributes"),o=t("../../traces/scatter/attributes").textposition,s=t("../../plot_api/edit_types").overrideAll,l=a({});l.family.dflt="Open Sans Regular, Arial Unicode MS Regular",e.exports=s({_arrayAttrRegexps:[n.counterRegex("mapbox",".layers",!0)],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]}},accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],dflt:"basic"},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},layers:{_isLinkedToArray:"layer",sourcetype:{valType:"enumerated",values:["geojson","vector"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},type:{valType:"enumerated",values:["circle","line","fill","symbol"],dflt:"circle"},below:{valType:"string",dflt:""},color:{valType:"color",dflt:i},opacity:{valType:"number",min:0,max:1,dflt:1},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2}},fill:{outlinecolor:{valType:"color",dflt:i}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},textfont:l,textposition:n.extendFlat({},o,{arrayOk:!1})}}},"plot","from-root")},{"../../components/color":604,"../../lib":728,"../../plot_api/edit_types":756,"../../traces/scatter/attributes":1031,"../font_attributes":796}],828:[function(t,e,r){"use strict";function n(t,e,r){r("accesstoken"),r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch"),i(t,e),e._input=t}function i(t,e){function r(t,e){return a.coerce(n,i,s.layers,t,e)}for(var n,i,o=t.layers||[],l=e.layers=[],u=0;u=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),r.attr(a);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),u=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&n(t,o),s.text(o.text()&&u.text()?" - ":"")}},g.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=l.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return n.append("input").attr({type:"text",name:"data"}).node().value=g.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},g.supplyDefaults=function(t){var e,r=t._fullLayout||{},n=t._fullLayout={},a=t.layout||{},o=t._fullData||[],s=t._fullData=[],l=t.data||[];if(t._transitionData||g.createTransitionData(t),r._initialAutoSizeIsDone){var u=r.width,h=r.height;g.supplyLayoutGlobalDefaults(a,n),a.width||(n.width=u),a.height||(n.height=h)}else{g.supplyLayoutGlobalDefaults(a,n);var f=!a.width||!a.height,d=n.autosize,p=t._context&&t._context.autosizable;f&&(d||p)?g.plotAutoSize(t,a,n):f&&g.sanitizeMargins(t),!d&&f&&(a.width=n.width,a.height=n.height)}n._initialAutoSizeIsDone=!0,n._dataLength=l.length,n._globalTransforms=(t._context||{}).globalTransforms,g.supplyDataDefaults(l,s,a,n),n._has=g._hasPlotType.bind(n);var m=n._modules;for(e=0;e0){var c=o(t._boundingBoxMargins),h=c.left+c.right,f=c.bottom+c.top,p=1-2*s,m=r._container&&r._container.node?r._container.node().getBoundingClientRect():{width:r.width,height:r.height};n=Math.round(p*(m.width-h)),i=Math.round(p*(m.height-f))}else{var v=l?window.getComputedStyle(t):{};n=parseFloat(v.width)||r.width,i=parseFloat(v.height)||r.height}var y=g.layoutAttributes.width.min,b=g.layoutAttributes.height.min;n1,_=!e.height&&Math.abs(r.height-i)>1;(_||x)&&(x&&(r.width=n),_&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),g.sanitizeMargins(r)},g.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a;c.Axes.supplyLayoutDefaults(t,e,r);var o=e._basePlotModules;for(i=0;i.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+i},r:{val:r.x,size:r.r+i},b:{val:r.y,size:r.b+i},t:{val:r.y,size:r.t+i}}}else delete n._pushmargin[e];n._replotting||g.doAutoMargin(t)}},g.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),i=Math.max(e.margin.l||0,0),a=Math.max(e.margin.r||0,0),o=Math.max(e.margin.t||0,0),s=Math.max(e.margin.b||0,0),l=e._pushmargin;if(!1!==e.margin.autoexpand){l.base={l:{val:0,size:i},r:{val:1,size:a},t:{val:1,size:o},b:{val:0,size:s}};for(var h=Object.keys(l),f=0;fg){var k=(v*w+(M-e.width)*g)/(w-g),A=(M*(1-g)+(v-e.width)*(1-w))/(w-g);k>=0&&A>=0&&k+A>i+a&&(i=k,a=A)}}if(u(b)&&l[_].t){var T=l[_].t.val,S=l[_].t.size;if(T>y){var E=(b*T+(S-e.height)*y)/(T-y),L=(S*(1-y)+(b-e.height)*(1-T))/(T-y);E>=0&&L>=0&&E+L>s+o&&(s=E,o=L)}}}}if(r.l=Math.round(i),r.r=Math.round(a),r.t=Math.round(o),r.b=Math.round(s),r.p=Math.round(e.margin.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,!e._replotting&&"{}"!==n&&n!==JSON.stringify(e._size))return c.plot(t)},g.graphJson=function(t,e,r,n,i){function a(t){if("function"==typeof t)return null;if(d.isPlainObject(t)){var e,n,i={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0&&!d.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;i[e]=a(t[e])}return i}return Array.isArray(t)?t.map(a):d.isJSDate(t)?d.ms2DateTimeLocal(+t):t}(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&g.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l=(t._transitionData||{})._frames,u={data:(o||[]).map(function(t){var r=a(t);return e&&delete r.fit,r})};return e||(u.layout=a(s)),t.framework&&t.framework.isPolar&&(u=t.framework.getConfig()),l&&(u.frames=a(l)),"object"===n?u:JSON.stringify(u)},g.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){x=!0}),i.redraw&&t._transitionData._interruptCallbacks.push(function(){return c.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var o,s,l=0,u=0,f=t._fullLayout._basePlotModules,p=!1;if(r)for(s=0;s=0,L=E?f.angularAxis.domain:n.extent(k),C=Math.abs(k[1]-k[0]);T&&!A&&(C=0);var I=L.slice();S&&A&&(I[1]+=C);var z=f.angularAxis.ticksCount||4;z>8&&(z=z/(z/8)+z%8),f.angularAxis.ticksStep&&(z=(I[1]-I[0])/z);var D=f.angularAxis.ticksStep||(I[1]-I[0])/(z*(f.minorTicks+1));M&&(D=Math.max(Math.round(D),1)),I[2]||(I[2]=D);var P=n.range.apply(this,I);if(P=P.map(function(t,e){return parseFloat(t.toPrecision(12))}),l=n.scale.linear().domain(I.slice(0,2)).range("clockwise"===f.direction?[0,360]:[360,0]),h.layout.angularAxis.domain=l.domain(),h.layout.angularAxis.endPadding=S?C:0,void 0===(e=n.select(this).select("svg.chart-root"))||e.empty()){var O=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),R=this.appendChild(this.ownerDocument.importNode(O.documentElement,!0));e=n.select(R)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var F,j=e.select(".chart-group"),N={fill:"none",stroke:f.tickColor},B={"font-size":f.font.size,"font-family":f.font.family,fill:f.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+f.font.outlineColor}).join(",")};if(f.showLegend){F=e.select(".legend-group").attr({transform:"translate("+[x,f.margin.top]+")"}).style({display:"block"});var U=p.map(function(t,e){var r=s.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});s.Legend().config({data:p.map(function(t,e){return t.name||"Element"+e}),legendConfig:a({},s.Legend.defaultConfig().legendConfig,{container:F,elements:U,reverseOrder:f.legend.reverseOrder})})();var V=F.node().getBBox();x=Math.min(f.width-V.width-f.margin.left-f.margin.right,f.height-f.margin.top-f.margin.bottom)/2,x=Math.max(10,x),w=[f.margin.left+x,f.margin.top+x],i.range([0,x]),h.layout.radialAxis.domain=i.domain(),F.attr("transform","translate("+[w[0]+x,w[1]-x]+")")}else F=e.select(".legend-group").style({display:"none"});e.attr({width:f.width,height:f.height}).style({opacity:f.opacity}),j.attr("transform","translate("+w+")").style({cursor:"crosshair"});var H=[(f.width-(f.margin.left+f.margin.right+2*x+(V?V.width:0)))/2,(f.height-(f.margin.top+f.margin.bottom+2*x))/2];if(H[0]=Math.max(0,H[0]),H[1]=Math.max(0,H[1]),e.select(".outer-group").attr("transform","translate("+H+")"),f.title){var q=e.select("g.title-group text").style(B).text(f.title),G=q.node().getBBox();q.attr({x:w[0]-G.width/2,y:w[1]-x-20})}var Y=e.select(".radial.axis-group");if(f.radialAxis.gridLinesVisible){var W=Y.selectAll("circle.grid-circle").data(i.ticks(5));W.enter().append("circle").attr({class:"grid-circle"}).style(N),W.attr("r",i),W.exit().remove()}Y.select("circle.outside-circle").attr({r:x}).style(N);var X=e.select("circle.background-circle").attr({r:x}).style({fill:f.backgroundColor,stroke:f.stroke});if(f.radialAxis.visible){var Z=n.svg.axis().scale(i).ticks(5).tickSize(5);Y.call(Z).attr({transform:"rotate("+f.radialAxis.orientation+")"}),Y.selectAll(".domain").style(N),Y.selectAll("g>text").text(function(t,e){return this.textContent+f.radialAxis.ticksSuffix}).style(B).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===f.radialAxis.tickOrientation?"rotate("+-f.radialAxis.orientation+") translate("+[0,B["font-size"]]+")":"translate("+[0,B["font-size"]]+")"}}),Y.selectAll("g>line").style({stroke:"black"})}var J=e.select(".angular.axis-group").selectAll("g.angular-tick").data(P),K=J.enter().append("g").classed("angular-tick",!0);J.attr({transform:function(t,e){return"rotate("+u(t,e)+")"}}).style({display:f.angularAxis.visible?"block":"none"}),J.exit().remove(),K.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(f.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(f.minorTicks+1)==0)}).style(N),K.selectAll(".minor").style({stroke:f.minorTickColor}),J.select("line.grid-line").attr({x1:f.tickLength?x-f.tickLength:0,x2:x}).style({display:f.angularAxis.gridLinesVisible?"block":"none"}),K.append("text").classed("axis-text",!0).style(B);var Q=J.select("text.axis-text").attr({x:x+f.labelOffset,dy:o+"em",transform:function(t,e){var r=u(t,e),n=x+f.labelOffset,i=f.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:f.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(f.minorTicks+1)!=0?"":M?M[t]+f.angularAxis.ticksSuffix:t+f.angularAxis.ticksSuffix}).style(B);f.angularAxis.rewriteTicks&&Q.text(function(t,e){return e%(f.minorTicks+1)!=0?"":f.angularAxis.rewriteTicks(this.textContent,e)});var $=n.max(j.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));F.attr({transform:"translate("+[x+$,f.margin.top]+")"});var tt=e.select("g.geometry-group").selectAll("g").size()>0,et=e.select("g.geometry-group").selectAll("g.geometry").data(p);if(et.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),et.exit().remove(),p[0]||tt){var rt=[];p.forEach(function(t,e){var r={};r.radialScale=i,r.angularScale=l,r.container=et.filter(function(t,r){return r==e}),r.geometry=t.geometry,r.orientation=f.orientation,r.direction=f.direction,r.index=e,rt.push({data:t,geometryConfig:r})});var nt=n.nest().key(function(t,e){return void 0!==t.data.groupId||"unstacked"}).entries(rt),it=[];nt.forEach(function(t,e){"unstacked"===t.key?it=it.concat(t.values.map(function(t,e){return[t]})):it.push(t.values)}),it.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return a(s[r].defaultConfig(),t)});s[r]().config(n)()})}var at,ot,st=e.select(".guides-group"),lt=e.select(".tooltips-group"),ut=s.tooltipPanel().config({container:lt,fontSize:8})(),ct=s.tooltipPanel().config({container:lt,fontSize:8})(),ht=s.tooltipPanel().config({container:lt,hasTick:!0})();if(!A){var ft=st.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});j.on("mousemove.angular-guide",function(t,e){var r=s.util.getMousePos(X).angle;ft.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-f.orientation)%360;at=l.invert(n);var i=s.util.convertToCartesian(x+12,r+180);ut.text(s.util.round(at)).move([i[0]+w[0],i[1]+w[1]])}).on("mouseout.angular-guide",function(t,e){st.select("line").style({opacity:0})})}var dt=st.select("circle").style({stroke:"grey",fill:"none"});j.on("mousemove.radial-guide",function(t,e){var r=s.util.getMousePos(X).radius;dt.attr({r:r}).style({opacity:.5}),ot=i.invert(s.util.getMousePos(X).radius);var n=s.util.convertToCartesian(r,f.radialAxis.orientation);ct.text(s.util.round(ot)).move([n[0]+w[0],n[1]+w[1]])}).on("mouseout.radial-guide",function(t,e){dt.style({opacity:0}),ht.hide(),ut.hide(),ct.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,r){var i=n.select(this),a=this.style.fill,o="black",l=this.style.opacity||1;if(i.attr({"data-opacity":l}),a&&"none"!==a){i.attr({"data-fill":a}),o=n.hsl(a).darker().toString(),i.style({fill:o,opacity:1});var u={t:s.util.round(t[0]),r:s.util.round(t[1])};A&&(u.t=M[t[0]]);var c="t: "+u.t+", r: "+u.r,h=this.getBoundingClientRect(),f=e.node().getBoundingClientRect(),d=[h.left+h.width/2-H[0]-f.left,h.top+h.height/2-H[1]-f.top];ht.config({color:o}).text(c),ht.move(d)}else a=this.style.stroke||"black",i.attr({"data-stroke":a}),o=n.hsl(a).darker().toString(),i.style({stroke:o,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ht.show()}).on("mouseout.tooltip",function(t,e){ht.hide();var r=n.select(this),i=r.attr("data-fill");i?r.style({fill:i,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})}),d}var e,r,i,l,u={data:[],layout:{}},c={},h={},f=n.dispatch("hover"),d={};return d.render=function(e){return t(e),this},d.config=function(t){if(!arguments.length)return u;var e=s.util.cloneJson(t);return e.data.forEach(function(t,e){u.data[e]||(u.data[e]={}),a(u.data[e],s.Axis.defaultConfig().data[0]),a(u.data[e],t)}),a(u.layout,s.Axis.defaultConfig().layout),a(u.layout,e.layout),this},d.getLiveConfig=function(){return h},d.getinputConfig=function(){return c},d.radialScale=function(t){return i},d.angularScale=function(t){return l},d.svg=function(){return e},n.rebind(d,f,"on"),d},s.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},s.util={},s.DATAEXTENT="dataExtent",s.AREA="AreaChart",s.LINE="LinePlot",s.DOT="DotPlot",s.BAR="BarChart",s.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},s.util._extend=function(t,e){for(var r in t)e[r]=t[r]},s.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},s.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180;return[e,t(n)]})},s.util.dataFromEquation=function(t,e,r){var i=e||6,a=[],o=[];n.range(0,360+i,i).forEach(function(e,r){var n=e*Math.PI/180,i=t(n);a.push(e),o.push(i)});var s={t:a,r:o};return r&&(s.name=r),s},s.util.ensureArray=function(t,e){if(void 0===t)return null;var r=[].concat(t);return n.range(e).map(function(t,e){return r[e]||r[0]})},s.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=s.util.ensureArray(t[e],r)}),t},s.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},s.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},s.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},s.util.arrayLast=function(t){return t[t.length-1]},s.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},s.util.flattenArray=function(t){for(var e=[];!s.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},s.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},s.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},s.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},s.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],i=e[1],a={};return a.x=r,a.y=i,a.pos=e,a.angle=180*(Math.atan2(i,r)+Math.PI)/Math.PI,a.radius=Math.sqrt(r*r+i*i),a},s.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,a=t.length;i0)){var s=n.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({class:"line",d:f(o),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return g.fill(r,i,a)},"fill-opacity":0,stroke:function(t,e){return g.stroke(r,i,a)},"stroke-width":function(t,e){return g["stroke-width"](r,i,a)},"stroke-dasharray":function(t,e){return g["stroke-dasharray"](r,i,a)},opacity:function(t,e){return g.opacity(r,i,a)},display:function(t,e){return g.display(r,i,a)}})}};var d=t.angularScale.range(),p=Math.abs(d[1]-d[0])/l[0].length*Math.PI/180,m=n.svg.arc().startAngle(function(t){return-p/2}).endAngle(function(t){return p/2}).innerRadius(function(e){return t.radialScale(c+(e[2]||0))}).outerRadius(function(e){return t.radialScale(c+(e[2]||0))+t.radialScale(e[1])});h.arc=function(e,r,i){n.select(this).attr({class:"mark arc",d:m,transform:function(e,r){return"rotate("+(t.orientation+u(e[0])+90)+")"}})};var g={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 i[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return void 0===e[n].data.visible||e[n].data.visible?"block":"none"}},v=n.select(this).selectAll("g.layer").data(l);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(g).each(h[t.geometryType]),y.exit().remove(),v.exit().remove()})}var e=[s.PolyChart.defaultConfig()],r=n.dispatch("hover"),i={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,r){e[r]||(e[r]={}),a(e[r],s.PolyChart.defaultConfig()),a(e[r],t)}),this):e},t.getColorScale=function(){},n.rebind(t,r,"on"),t},s.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},s.BarChart=function(){return s.PolyChart()},s.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},s.AreaChart=function(){return s.PolyChart()},s.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},s.DotPlot=function(){return s.PolyChart()},s.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},s.LinePlot=function(){return s.PolyChart()},s.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},s.Legend=function(){function t(){var r=e.legendConfig,i=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var i=a({},r.elements[e]);return i.name=t,i.color=[].concat(r.elements[e].color)[n],i})}),o=n.merge(i);o=o.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||void 0===r.elements[e].visibleInLegend)}),r.reverseOrder&&(o=o.reverse());var s=r.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map(function(t,e){return t.color}),u=r.fontSize,c=null==r.isContinuous?"number"==typeof o[0]:r.isContinuous,h=c?r.height:u*o.length,f=s.classed("legend-group",!0),d=f.selectAll("svg").data([0]),p=d.enter().append("svg").attr({width:300,height:h+u,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 m=n.range(o.length),g=n.scale[c?"linear":"ordinal"]().domain(m).range(l),v=n.scale[c?"linear":"ordinal"]().domain(m)[c?"range":"rangePoints"]([0,h]),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":-1!=n.svg.symbolTypes.indexOf(t)?n.svg.symbol().type(t).size(r)():n.svg.symbol().type("square").size(r)()};if(c){var b=d.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);b.enter().append("stop"),b.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),d.append("rect").classed("legend-mark",!0).attr({height:r.height,width:r.colorBandWidth,fill:"url(#grad1)"})}else{var x=d.select(".legend-marks").selectAll("path.legend-mark").data(o);x.enter().append("path").classed("legend-mark",!0),x.attr({transform:function(t,e){return"translate("+[u/2,v(e)+u/2]+")"},d:function(t,e){var r=t.symbol;return y(r,u)},fill:function(t,e){return g(e)}}),x.exit().remove()}var _=n.svg.axis().scale(v).orient("right"),w=d.select("g.legend-axis").attr({transform:"translate("+[c?r.colorBandWidth:u,u/2]+")"}).call(_);return w.selectAll(".domain").style({fill:"none",stroke:"none"}),w.selectAll("line").style({fill:"none",stroke:c?r.textColor:"none"}),w.selectAll("text").style({fill:r.textColor,"font-size":r.fontSize}).text(function(t,e){return o[e].name}),t}var e=s.Legend.defaultConfig(),r=n.dispatch("hover");return t.config=function(t){return arguments.length?(a(e,t),this):e},n.rebind(t,r,"on"),t},s.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},s.tooltipPanel=function(){var t,e,r,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},o="tooltip-"+s.tooltipPanel.uid++,l=function(){t=i.container.selectAll("g."+o).data([0]);var n=t.enter().append("g").classed(o,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:i.padding+10,dy:.3*+i.fontSize}),l};return l.text=function(a){var o=n.hsl(i.color).l,s=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",c=a||"";e.style({fill:u,"font-size":i.fontSize+"px"}).text(c);var h=i.padding,f=e.node().getBBox(),d={fill:i.color,stroke:s,"stroke-width":"2px"},p=f.width+2*h+10,m=f.height+2*h;return r.attr({d:"M"+[[10,-m/2],[10,-m/4],[i.hasTick?0:10,0],[10,m/4],[10,m/2],[p,m/2],[p,-m/2]].join("L")+"Z"}).style(d),t.attr({transform:"translate("+[10,-m/2+2*h]+")"}),t.style({display:"block"}),l},l.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),l},l.hide=function(){if(t)return t.style({display:"none"}),l},l.show=function(){if(t)return t.style({display:"block"}),l},l.config=function(t){return a(i,t),l},l},s.tooltipPanel.uid=1,s.adapter={},s.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=a({},t);return[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]].forEach(function(t,r){s.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var i=s.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=i.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)})}if(t.layout){var o=a({},t.layout);if([[o,["plot_bgcolor"],["backgroundColor"]],[o,["showlegend"],["showLegend"]],[o,["radialaxis"],["radialAxis"]],[o,["angularaxis"],["angularAxis"]],[o.angularaxis,["showline"],["gridLinesVisible"]],[o.angularaxis,["showticklabels"],["labelsVisible"]],[o.angularaxis,["nticks"],["ticksCount"]],[o.angularaxis,["tickorientation"],["tickOrientation"]],[o.angularaxis,["ticksuffix"],["ticksSuffix"]],[o.angularaxis,["range"],["domain"]],[o.angularaxis,["endpadding"],["endPadding"]],[o.radialaxis,["showline"],["gridLinesVisible"]],[o.radialaxis,["tickorientation"],["tickOrientation"]],[o.radialaxis,["ticksuffix"],["ticksSuffix"]],[o.radialaxis,["range"],["domain"]],[o.angularAxis,["showline"],["gridLinesVisible"]],[o.angularAxis,["showticklabels"],["labelsVisible"]],[o.angularAxis,["nticks"],["ticksCount"]],[o.angularAxis,["tickorientation"],["tickOrientation"]],[o.angularAxis,["ticksuffix"],["ticksSuffix"]],[o.angularAxis,["range"],["domain"]],[o.angularAxis,["endpadding"],["endPadding"]],[o.radialAxis,["showline"],["gridLinesVisible"]],[o.radialAxis,["tickorientation"],["tickOrientation"]],[o.radialAxis,["ticksuffix"],["ticksSuffix"]],[o.radialAxis,["range"],["domain"]],[o.font,["outlinecolor"],["outlineColor"]],[o.legend,["traceorder"],["reverseOrder"]],[o,["labeloffset"],["labelOffset"]],[o,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(t,r){s.util.translator.apply(null,t.concat(e))}),e?(void 0!==o.tickLength&&(o.angularaxis.ticklen=o.tickLength,delete o.tickLength),o.tickColor&&(o.angularaxis.tickcolor=o.tickColor,delete o.tickColor)):(o.angularAxis&&void 0!==o.angularAxis.ticklen&&(o.tickLength=o.angularAxis.ticklen),o.angularAxis&&void 0!==o.angularAxis.tickcolor&&(o.tickColor=o.angularAxis.tickcolor)),o.legend&&"boolean"!=typeof o.legend.reverseOrder&&(o.legend.reverseOrder="normal"!=o.legend.reverseOrder),o.legend&&"boolean"==typeof o.legend.traceorder&&(o.legend.traceorder=o.legend.traceorder?"reversed":"normal",delete o.legend.reverseOrder),o.margin&&void 0!==o.margin.t){var l=["t","r","b","l","pad"],u=["top","right","bottom","left","pad"],c={};n.entries(o.margin).forEach(function(t,e){c[u[l.indexOf(t.key)]]=t.value}),o.margin=c}e&&(delete o.needsEndSpacing,delete o.minorTickColor,delete o.minorTicks,delete o.angularaxis.ticksCount,delete o.angularaxis.ticksCount,delete o.angularaxis.ticksStep,delete o.angularaxis.rewriteTicks,delete o.angularaxis.nticks,delete o.radialaxis.ticksCount,delete o.radialaxis.ticksCount,delete o.radialaxis.ticksStep,delete o.radialaxis.rewriteTicks,delete o.radialaxis.nticks),r.layout=o}return r},t}},{"../../constants/alignment":701,"../../lib":728,d3:122}],836:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=i.extendDeepAll,u=e.exports={};u.framework=function(t){function e(e,i){return i&&(h=i),n.select(n.select(h).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),r=r?l(r,e):e,a||(a=o.Axis()),c=o.adapter.plotly().convert(r),a.config(c).render(h),t.data=r.data,t.layout=r.layout,u.fillLayout(t),r}var r,i,a,c,h,f=new s;return e.isPolar=!0,e.svg=function(){return a.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},e.setUndoPoint=function(){var t=this,e=o.util.cloneJson(r);!function(e,r){f.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,i),i=o.util.cloneJson(e)},e.undo=function(){f.undo()},e.redo=function(){f.redo()},e},u.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),i=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:a.background,_container:e,_paperdiv:r,_paper:i};t._fullLayout=l(o,t.layout)}},{"../../components/color":604,"../../lib":728,"./micropolar":835,"./undo_manager":837,d3:122}],837:[function(t,e,r){"use strict";e.exports=function(){function t(t,e){return t?(i=!0,t[e](),i=!1,this):this}var e,r=[],n=-1,i=!1;return{add:function(t){return i?this:(r.splice(n+1,r.length-n),r.push(t),n=r.length-1,this)},setCallback:function(t){e=t},undo:function(){var i=r[n];return i?(t(i,"undo"),n-=1,e&&e(i.undo),this):this},redo:function(){var i=r[n+1];return i?(t(i,"redo"),n+=1,e&&e(i.redo),this):this},clear:function(){r=[],n=-1},hasUndo:function(){return-1!==n},hasRedo:function(){return n=o&&(d.min=0,p.min=0,m.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}var i=t("../../../components/color"),a=t("../../subplot_defaults"),o=t("./layout_attributes"),s=t("./axis_defaults"),l=["aaxis","baxis","caxis"];e.exports=function(t,e,r){a(t,e,r,{type:"ternary",attributes:o,handleDefaults:n,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../../components/color":604,"../../subplot_defaults":838,"./axis_defaults":842,"./layout_attributes":844}],844:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("./axis_attributes"),a=t("../../../plot_api/edit_types").overrideAll;e.exports=a({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:i,baxis:i,caxis:i},"plot","from-root")},{"../../../components/color/attributes":603,"../../../plot_api/edit_types":756,"./axis_attributes":841}],845:[function(t,e,r){"use strict";function n(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework(e)}function i(t){a.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}var a=t("d3"),o=t("tinycolor2"),s=t("../../plotly"),l=t("../../lib"),u=t("../../components/color"),c=t("../../components/drawing"),h=t("../cartesian/set_convert"),f=t("../../lib/extend").extendFlat,d=t("../plots"),p=t("../cartesian/axes"),m=t("../../components/dragelement"),g=t("../../components/fx"),v=t("../../components/titles"),y=t("../cartesian/select"),b=t("../cartesian/constants");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={},this.layers={}},x.plot=function(t,e){var r=this,n=e[r.id],i=e._size;r._hasClipOnAxisFalse=!1;for(var a=0;a_*b?(a=b,i=a*_):(i=y,a=i/_),o=g*i/y,s=v*a/b,r=e.l+e.w*p-i/2,n=e.t+e.h*(1-m)-a/2,l.x0=r,l.y0=n,l.w=i,l.h=a,l.sum=x,l.xaxis={type:"linear",range:[w+2*k-x,x-w-2*M],domain:[p-o/2,p+o/2],_id:"x"},h(l.xaxis,l.graphDiv._fullLayout),l.xaxis.setScale(),l.xaxis.isPtWithinRange=function(t){return t.a>=l.aaxis.range[0]&&t.a<=l.aaxis.range[1]&&t.b>=l.baxis.range[1]&&t.b<=l.baxis.range[0]&&t.c>=l.caxis.range[1]&&t.c<=l.caxis.range[0]},l.yaxis={type:"linear",range:[w,x-M-k],domain:[m-s/2,m+s/2],_id:"y"},h(l.yaxis,l.graphDiv._fullLayout),l.yaxis.setScale(),l.yaxis.isPtWithinRange=function(){return!0};var A=l.yaxis.domain[0],T=l.aaxis=f({},t.aaxis,{visible:!0,range:[w,x-M-k],side:"left",_counterangle:30,tickangle:(+t.aaxis.tickangle||0)-30,domain:[A,A+s*_],_axislayer:l.layers.aaxis,_gridlayer:l.layers.agrid,_pos:0,_id:"y",_length:i,_gridpath:"M0,0l"+a+",-"+i/2});h(T,l.graphDiv._fullLayout),T.setScale();var S=l.baxis=f({},t.baxis,{visible:!0,range:[x-w-k,M],side:"bottom",_counterangle:30,domain:l.xaxis.domain,_axislayer:l.layers.baxis,_gridlayer:l.layers.bgrid,_counteraxis:l.aaxis,_pos:0,_id:"x",_length:i,_gridpath:"M0,0l-"+i/2+",-"+a});h(S,l.graphDiv._fullLayout),S.setScale(),T._counteraxis=S;var E=l.caxis=f({},t.caxis,{visible:!0,range:[x-w-M,k],side:"right",_counterangle:30,tickangle:(+t.caxis.tickangle||0)+30,domain:[A,A+s*_],_axislayer:l.layers.caxis,_gridlayer:l.layers.cgrid,_counteraxis:l.baxis,_pos:0,_id:"y",_length:i,_gridpath:"M0,0l-"+a+","+i/2});h(E,l.graphDiv._fullLayout),E.setScale();var L="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";l.clipDef.select("path").attr("d",L),l.layers.plotbg.select("path").attr("d",L);var C="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";l.clipDefRelative.select("path").attr("d",C);var I="translate("+r+","+n+")";l.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",I),l.clipDefRelative.select("path").attr("transform",null);var z="translate("+r+","+(n+a)+")";l.layers.baxis.attr("transform",z),l.layers.bgrid.attr("transform",z);var D="translate("+(r+i/2)+","+n+")rotate(30)";l.layers.aaxis.attr("transform",D),l.layers.agrid.attr("transform",D);var P="translate("+(r+i/2)+","+n+")rotate(-30)";l.layers.caxis.attr("transform",P),l.layers.cgrid.attr("transform",P),l.drawAxes(!0),l.plotContainer.selectAll(".crisp").classed("crisp",!1),l.layers.aline.select("path").attr("d",T.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(u.stroke,T.linecolor||"#000").style("stroke-width",(T.linewidth||0)+"px"),l.layers.bline.select("path").attr("d",S.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(u.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),l.layers.cline.select("path").attr("d",E.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(u.stroke,E.linecolor||"#000").style("stroke-width",(E.linewidth||0)+"px"),l.graphDiv._context.staticPlot||l.initInteractions(),c.setClipUrl(l.layers.frontplot,l._hasClipOnAxisFalse?null:l.clipId)},x.drawAxes=function(t){var e=this,r=e.graphDiv,n=e.id.substr(7)+"title",i=e.aaxis,a=e.baxis,o=e.caxis;if(p.doTicks(r,i,!0),p.doTicks(r,a,!0),p.doTicks(r,o,!0),t){var s=Math.max(i.showticklabels?i.tickfont.size/2:0,(o.showticklabels?.75*o.tickfont.size:0)+("outside"===o.ticks?.87*o.ticklen:0));v.draw(r,"a"+n,{propContainer:i,propName:e.id+".aaxis.title",dfltName:"Component A",attributes:{x:e.x0+e.w/2,y:e.y0-i.titlefont.size/3-s,"text-anchor":"middle"}});var l=(a.showticklabels?a.tickfont.size:0)+("outside"===a.ticks?a.ticklen:0)+3;v.draw(r,"b"+n,{propContainer:a,propName:e.id+".baxis.title",dfltName:"Component B",attributes:{x:e.x0-l,y:e.y0+e.h+.83*a.titlefont.size+l,"text-anchor":"middle"}}),v.draw(r,"c"+n,{propContainer:o,propName:e.id+".caxis.title",dfltName:"Component C",attributes:{x:e.x0+e.w+l,y:e.y0+e.h+.83*o.titlefont.size+l,"text-anchor":"middle"}})}};var w=b.MINZOOM/2+.87,M="m-0.87,.5h"+w+"v3h-"+(w+5.2)+"l"+(w/2+2.6)+",-"+(.87*w+4.5)+"l2.6,1.5l-"+w/2+","+.87*w+"Z",k="m0.87,.5h-"+w+"v3h"+(w+5.2)+"l-"+(w/2+2.6)+",-"+(.87*w+4.5)+"l-2.6,1.5l"+w/2+","+.87*w+"Z",A="m0,1l"+w/2+","+.87*w+"l2.6,-1.5l-"+(w/2+2.6)+",-"+(.87*w+4.5)+"l-"+(w/2+2.6)+","+(.87*w+4.5)+"l2.6,1.5l"+w/2+",-"+.87*w+"Z",T=!0;x.initInteractions=function(){function t(t,e,r){var n=F.getBoundingClientRect();w=e-n.left,S=r-n.top,E={a:R.aaxis.range[0],b:R.baxis.range[1],c:R.caxis.range[1]},C=E,L=R.aaxis.range[1]-E.a,I=o(R.graphDiv._fullLayout[R.id].bgcolor).getLuminance(),z="M0,"+R.h+"L"+R.w/2+", 0L"+R.w+","+R.h+"Z",D=!1,P=N.append("path").attr("class","zoombox").attr("transform","translate("+R.x0+", "+R.y0+")").style({fill:I>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",z),O=N.append("path").attr("class","zoombox-corners").attr("transform","translate("+R.x0+", "+R.y0+")").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),v()}function e(t,e){return 1-e/R.h}function r(t,e){return 1-(t+(R.h-e)/Math.sqrt(3))/R.w}function n(t,e){return(t-(R.h-e)/Math.sqrt(3))/R.w}function a(t,i){var a=w+t,o=S+i,s=Math.max(0,Math.min(1,e(w,S),e(a,o))),l=Math.max(0,Math.min(1,r(w,S),r(a,o))),u=Math.max(0,Math.min(1,n(w,S),n(a,o))),c=(s/2+u)*R.w,h=(1-s/2-l)*R.w,f=(c+h)/2,d=h-c,p=(1-s)*R.h,m=p-d/_;d.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),O.transition().style("opacity",1).duration(200),D=!0)}function h(t,e){if(C===E)return 2===e&&x(),i(j);i(j);var r={};r[R.id+".aaxis.min"]=C.a,r[R.id+".baxis.min"]=C.b,r[R.id+".caxis.min"]=C.c,s.relayout(j,r),T&&j.data&&j._context.showTips&&(l.notifier("Double-click to
zoom back out","long"),T=!1)}function f(){E={a:R.aaxis.range[0],b:R.baxis.range[1],c:R.caxis.range[1]},C=E}function d(t,e){var r=t/R.xaxis._m,n=e/R.yaxis._m;C={a:E.a-n,b:E.b+(r+n)/2,c:E.c-(r-n)/2};var i=[C.a,C.b,C.c].sort(),a={a:i.indexOf(C.a),b:i.indexOf(C.b),c:i.indexOf(C.c)};i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),C={a:i[a.a],b:i[a.b],c:i[a.c]},e=(E.a-C.a)*R.yaxis._m,t=(E.c-C.c-E.b+C.b)*R.xaxis._m);var o="translate("+(R.x0+t)+","+(R.y0+e)+")";R.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",o);var s="translate("+-t+","+-e+")";if(R.clipDefRelative.select("path").attr("transform",s),R.aaxis.range=[C.a,R.sum-C.b-C.c],R.baxis.range=[R.sum-C.a-C.c,C.b],R.caxis.range=[R.sum-C.a-C.b,C.c],R.drawAxes(!1),R.plotContainer.selectAll(".crisp").classed("crisp",!1),R._hasClipOnAxisFalse){var l=R.plotContainer.select(".scatterlayer").selectAll(".points");l.selectAll(".point").call(c.hideOutsideRangePoints,R),l.selectAll(".textpoint").call(c.hideOutsideRangePoints,R)}}function p(t,e){if(t){var r={};r[R.id+".aaxis.min"]=C.a,r[R.id+".baxis.min"]=C.b,r[R.id+".caxis.min"]=C.c,s.relayout(j,r)}else 2===e&&x()}function v(){N.selectAll(".select-outline").remove()}function x(){var t={};t[R.id+".aaxis.min"]=0,t[R.id+".baxis.min"]=0,t[R.id+".caxis.min"]=0,j.emit("plotly_doubleclick",null),s.relayout(j,t)}var w,S,E,L,C,I,z,D,P,O,R=this,F=R.layers.plotbg.select("path").node(),j=R.graphDiv,N=j._fullLayout._zoomlayer,B={element:F,gd:j,plotinfo:{xaxis:R.xaxis,yaxis:R.yaxis},doubleclick:x,subplot:R.id,prepFn:function(e,r,n){B.xaxes=[R.xaxis],B.yaxes=[R.yaxis];var i=j._fullLayout.dragmode;e.shiftKey&&(i="pan"===i?"zoom":"pan"),B.minDrag="lasso"===i?1:void 0,"zoom"===i?(B.moveFn=a,B.doneFn=h,t(e,r,n)):"pan"===i?(B.moveFn=d,B.doneFn=p,f(),v()):"select"!==i&&"lasso"!==i||y(e,r,n,B,i)}};F.onmousemove=function(t){g.hover(j,t,R.id),j._fullLayout._lasthover=F,j._fullLayout._hoversubplot=R.id},F.onmouseout=function(t){j._dragging||m.unhover(j,t)},F.onclick=function(t){g.click(j,t,R.id)},m.init(B)}},{"../../components/color":604,"../../components/dragelement":625,"../../components/drawing":628,"../../components/fx":645,"../../components/titles":694,"../../lib":728,"../../lib/extend":717,"../../plotly":767,"../cartesian/axes":772,"../cartesian/constants":777,"../cartesian/select":788,"../cartesian/set_convert":789,"../plots":831,d3:122,tinycolor2:534}],846:[function(t,e,r){"use strict";function n(t){if(t.layoutAttributes){var e=t.layoutAttributes._arrayAttrRegexps;if(e)for(var n=0;n-1}var a=t("../lib"),o=t("../plots/plots"),s=a.extendFlat,l=a.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,a=t.data,u=t.layout,c=l([],a),h=l({},u,n(e.tileClass)),f=t._context||{};if(e.width&&(h.width=e.width),e.height&&(h.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){h.annotations=[];var d=Object.keys(h);for(r=0;r")?"":e.html(t).text()});return e.remove(),r}function i(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}var a=t("d3"),o=t("../lib"),s=t("../components/drawing"),l=t("../components/color"),u=t("../constants/xmlns_namespaces"),c=/"/g,h=new RegExp('("TOBESTRIPPED)|(TOBESTRIPPED")',"g");e.exports=function(t,e,r){var f,d=t._fullLayout,p=d._paper,m=d._toppaper,g=d.width,v=d.height;p.insert("rect",":first-child").call(s.setRect,0,0,g,v).call(l.fill,d.paper_bgcolor);var y=d._basePlotModules||[];for(f=0;f0&&A>0,N=M<=R&&A<=F,B=M<=F&&A<=R,U="h"===v?R>=M*(F/A):F>=A*(R/M);j&&(N||B||U)?b="inside":(b="outside",x.remove(),x=null)}else b="inside";if(!x&&(x=m(e,y,"outside"===b?E:S),_=k.bBox(x.node()),M=_.width,A=_.height,M<=0||A<=0))return void x.remove();var V,H;"outside"===b?(H="both"===g.constraintext||"outside"===g.constraintext,V=a(o,f,d,p,_,v,H)):(H="both"===g.constraintext||"inside"===g.constraintext,V=i(o,f,d,p,_,v,H)),x.attr("transform",V)}}}function i(t,e,r,n,i,a,s){var l,u,c,h,f,d=i.width,p=i.height,m=(i.left+i.right)/2,g=(i.top+i.bottom)/2,v=Math.abs(e-t),y=Math.abs(n-r);v>2*z&&y>2*z?(f=z,v-=2*f,y-=2*f):f=0;var b,x;return d<=v&&p<=y?(b=!1,x=1):d<=y&&p<=v?(b=!0,x=1):dr?(c=(t+e)/2,h=n-f-u/2):(c=(t+e)/2,h=n+f+u/2),o(m,g,c,h,x,b)}function a(t,e,r,n,i,a,s){var l,u="h"===a?Math.abs(n-r):Math.abs(e-t);u>2*z&&(l=z);var c=1;s&&(c="h"===a?Math.min(1,u/i.height):Math.min(1,u/i.width));var h,f,d,p,m=(i.left+i.right)/2,g=(i.top+i.bottom)/2;return h=c*i.width,f=c*i.height,"h"===a?er?(d=(t+e)/2,p=n+l+f/2):(d=(t+e)/2,p=n-l-f/2),o(m,g,d,p,c,!1)}function o(t,e,r,n,i,a){var o,s;return i<1?o="scale("+i+") ":(i=1,o=""),s=a?"rotate("+a+" "+t+" "+e+") ":"","translate("+(r-i*t)+" "+(n-i*e)+")"+o+s}function s(t,e){var r=d(t.text,e);return p(S,r)}function l(t,e){var r=d(t.textposition,e);return m(E,r)}function u(t,e,r){return f(L,t.textfont,e,r)}function c(t,e,r){return f(C,t.insidetextfont,e,r)}function h(t,e,r){return f(I,t.outsidetextfont,e,r)}function f(t,e,r,n){e=e||{};var i=d(e.family,r),a=d(e.size,r),o=d(e.color,r);return{family:p(t.family,i,n.family),size:g(t.size,a,n.size),color:v(t.color,o,n.color)}}function d(t,e){var r;return Array.isArray(t)?ei))return e}return void 0!==r?r:t.dflt}function v(t,e,r){return x(e).isValid()?e:void 0!==r?r:t.dflt}var y=t("d3"),b=t("fast-isnumeric"),x=t("tinycolor2"),_=t("../../lib"),w=t("../../lib/svg_text_utils"),M=t("../../components/color"),k=t("../../components/drawing"),A=t("../../components/errorbars"),T=t("./attributes"),S=T.text,E=T.textposition,L=T.textfont,C=T.insidetextfont,I=T.outsidetextfont,z=3;e.exports=function(t,e,r){var i=e.xaxis,a=e.yaxis,o=t._fullLayout,s=e.plot.select(".barlayer").selectAll("g.trace.bars").data(r);s.enter().append("g").attr("class","trace bars"),s.append("g").attr("class","points").each(function(e){var r=e[0].node3=y.select(this),s=e[0].t,l=e[0].trace,u=s.poffset,c=Array.isArray(u);r.selectAll("g.point").data(_.identity).enter().append("g").classed("point",!0).each(function(r,s){function h(t){return 0===o.bargap&&0===o.bargroupgap?y.round(Math.round(t)-A,2):t}function f(t,e){return Math.abs(t-e)>=2?h(t):t>e?Math.ceil(t):Math.floor(t)}var d,p,m,g,v=r.p+(c?u[s]:u),x=v+r.w,_=r.b,w=_+r.s;if("h"===l.orientation?(m=a.c2p(v,!0),g=a.c2p(x,!0),d=i.c2p(_,!0),p=i.c2p(w,!0),r.ct=[p,(m+g)/2]):(d=i.c2p(v,!0),p=i.c2p(x,!0),m=a.c2p(_,!0),g=a.c2p(w,!0),r.ct=[(d+p)/2,g]),!(b(d)&&b(p)&&b(m)&&b(g)&&d!==p&&m!==g))return void y.select(this).remove();var k=(r.mlw+1||l.marker.line.width+1||(r.trace?r.trace.marker.line.width:0)+1)-1,A=y.round(k/2%1,2);if(!t._context.staticPlot){var T=M.opacity(r.mc||l.marker.color),S=T<1||k>.01?h:f;d=S(d,p),p=S(p,d),m=S(m,g),g=S(g,m)}var E=y.select(this);E.append("path").style("vector-effect","non-scaling-stroke").attr("d","M"+d+","+m+"V"+g+"H"+p+"V"+m+"Z"),n(t,E,e,s,d,p,m,g)})}),s.call(A.plot,e)}},{"../../components/color":604,"../../components/drawing":628,"../../components/errorbars":634,"../../lib":728,"../../lib/svg_text_utils":750,"./attributes":856,d3:122,"fast-isnumeric":131,tinycolor2:534}],864:[function(t,e,r){"use strict";var n=t("../../constants/interactions").DESELECTDIM;e.exports=function(t,e){var r,i=t.cd,a=[],o=i[0].trace,s=i[0].node3;if(!0!==o.visible)return[];if(!1===e)for(r=0;ru+s||!y(l))&&(h=!0,f(c,t))}for(var i=r.traces,a=v(e),o="fraction"===t._fullLayout.barnorm?1:100,s=o/1e9,l=e.l2c(e.c2l(0)),u="stack"===t._fullLayout.barmode?o:l,c=[l,u],h=!1,d=0;d1||0===s.bargap&&0===s.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,o=r.line,s=a.tryColorscale(r,""),l=a.tryColorscale(r,"line");n.select(this).selectAll("path").each(function(t){var e,a,u=(t.mlw+1||o.width+1)-1,c=n.select(this);e="mc"in t?t.mcc=s(t.mc):Array.isArray(r.color)?i.defaultLine:r.color,c.style("stroke-width",u+"px").call(i.fill,e),u&&(a="mlc"in t?t.mlcc=l(t.mlc):Array.isArray(o.color)?i.defaultLine:o.color,c.call(i.stroke,a))})}),e.call(o.style)}},{"../../components/color":604,"../../components/drawing":628,"../../components/errorbars":634,d3:122}],868:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s){r("marker.color",o),i(t,"marker")&&a(t,e,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),i(t,"marker.line")&&a(t,e,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width")}},{"../../components/color":604,"../../components/colorscale/defaults":613,"../../components/colorscale/has_colorscale":617}],869:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/color/attributes"),a=t("../../lib/extend").extendFlat,o=n.marker,s=o.line;e.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},name:{valType:"string",editType:"calc+clearAxisTypes"},whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calcIfAutorange"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers",editType:"calcIfAutorange"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1,editType:"calcIfAutorange"},jitter:{valType:"number",min:0,max:1,editType:"calcIfAutorange"},pointpos:{valType:"number",min:-2,max:2,editType:"calcIfAutorange"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:a({},o.symbol,{arrayOk:!1,editType:"plot"}),opacity:a({},o.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:a({},o.size,{arrayOk:!1,editType:"calcIfAutorange"}),color:a({},o.color,{arrayOk:!1,editType:"style"}),line:{color:a({},s.color,{arrayOk:!1,dflt:i.defaultLine,editType:"style"}),width:a({},s.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor}},{"../../components/color/attributes":603,"../../lib/extend":717,"../scatter/attributes":1031}],870:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/cartesian/axes");e.exports=function(t,e){var r,o,s,l,u,c,h,f,d,p=a.getFromId(t,e.xaxis||"x"),m=a.getFromId(t,e.yaxis||"y"),g=e.orientation,v=[];"h"===g?(r=p,o="x",u=m,c="y"):(r=m,o="y",u=p,c="x"),s=r.makeCalcdata(e,o),a.expand(r,s,{padded:!0}),h=function(t,e,r,a,o){var s;return r in e?h=a.makeCalcdata(e,r):(s=r+"0"in e?e[r+"0"]:"name"in e&&("category"===a.type||n(e.name)&&-1!==["linear","log"].indexOf(a.type)||i.isDateTime(e.name)&&"date"===a.type)?e.name:t.numboxes,s=a.d2c(s,0,e[r+"calendar"]),h=o.map(function(){return s})),h}(t,e,c,u,s);var y=i.distinctVals(h);return f=y.vals,d=y.minDiff/2,l=function(t,e,r,a,o){var s,l,u,c,h=a.length,f=e.length,d=[],p=[];for(s=0;s=0&&u1,m=r.dPos*(1-c.boxgap)*(1-c.boxgroupgap)/(p?t.numboxes:1),g=p?2*r.dPos*((r.boxnum+.5)/t.numboxes-.5)*(1-c.boxgap):0,v=m*d.whiskerwidth;if(!0!==d.visible||r.emptybox)return void a.select(this).remove();"h"===d.orientation?(l=f,u=h):(l=h,u=f),r.bPos=g,r.bdPos=m,n(),a.select(this).selectAll("path.box").data(o.identity).enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","box").each(function(t){var e=l.c2p(t.pos+g,!0),r=l.c2p(t.pos+g-m,!0),n=l.c2p(t.pos+g+m,!0),i=l.c2p(t.pos+g-v,!0),s=l.c2p(t.pos+g+v,!0),c=u.c2p(t.q1,!0),h=u.c2p(t.q3,!0),f=o.constrain(u.c2p(t.med,!0),Math.min(c,h)+1,Math.max(c,h)-1),p=u.c2p(!1===d.boxpoints?t.min:t.lf,!0),y=u.c2p(!1===d.boxpoints?t.max:t.uf,!0);"h"===d.orientation?a.select(this).attr("d","M"+f+","+r+"V"+n+"M"+c+","+r+"V"+n+"H"+h+"V"+r+"ZM"+c+","+e+"H"+p+"M"+h+","+e+"H"+y+(0===d.whiskerwidth?"":"M"+p+","+i+"V"+s+"M"+y+","+i+"V"+s)):a.select(this).attr("d","M"+r+","+f+"H"+n+"M"+r+","+c+"H"+n+"V"+h+"H"+r+"ZM"+e+","+c+"V"+p+"M"+e+","+h+"V"+y+(0===d.whiskerwidth?"":"M"+i+","+p+"H"+s+"M"+i+","+y+"H"+s))}),d.boxpoints&&a.select(this).selectAll("g.points").data(function(t){return t.forEach(function(t){t.t=r,t.trace=d}),t}).enter().append("g").attr("class","points").selectAll("path").data(function(t){var e,r,n,a,s,l,u,c="all"===d.boxpoints?t.val:t.val.filter(function(e){return et.uf}),h=Math.max((t.max-t.min)/10,t.q3-t.q1),f=1e-9*h,p=.01*h,v=[],y=0;if(d.jitter){if(0===h)for(y=1,v=new Array(c.length),e=0;et.lo&&(n.so=!0),n})}).enter().append("path").classed("point",!0).call(s.translatePoints,h,f),d.boxmean&&a.select(this).selectAll("path.mean").data(o.identity).enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}).each(function(t){var e=l.c2p(t.pos+g,!0),r=l.c2p(t.pos+g-m,!0),n=l.c2p(t.pos+g+m,!0),i=u.c2p(t.mean,!0),o=u.c2p(t.mean-t.sd,!0),s=u.c2p(t.mean+t.sd,!0);"h"===d.orientation?a.select(this).attr("d","M"+i+","+r+"V"+n+("sd"!==d.boxmean?"":"m0,0L"+o+","+e+"L"+i+","+r+"L"+s+","+e+"Z")):a.select(this).attr("d","M"+r+","+i+"H"+n+("sd"!==d.boxmean?"":"m0,0L"+e+","+o+"L"+r+","+i+"L"+e+","+s+"Z"))})})}},{"../../components/drawing":628,"../../lib":728,d3:122}],877:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/cartesian/axes"),a=t("../../lib");e.exports=function(t,e){var r,o,s,l,u=t._fullLayout,c=e.xaxis,h=e.yaxis,f=["v","h"];for(o=0;o=10)return null;for(var r=1/0,i=-1/0,a=t.length,o=0;o0?Math.floor:Math.ceil,z=L>0?Math.ceil:Math.floor,D=L>0?Math.min:Math.max,P=L>0?Math.max:Math.min,O=I(S+C),R=z(E-C);c=T(S);var F=[[c]];for(i=O;i*L=0;i--)a[c-i]=t[h][i],o[c-i]=e[h][i];for(s.push({x:a,y:o,bicubic:l}),i=h,a=[],o=[];i>=0;i--)a[h-i]=t[i][0],o[h-i]=e[i][0];return s.push({x:a,y:o,bicubic:u}),s}},{}],891:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e,r,a){function o(e){var n,i,o,s,l,u,c,h,f,d,p,g,v=[],y=[],b={};if("b"===r)for(i=t.b2j(e),o=Math.floor(Math.max(0,Math.min(P-2,i))),s=i-o,b.length=P,b.crossLength=D,b.xy=function(e){return t.evalxy([],e,i)},b.dxy=function(e,r){return t.dxydi([],e,o,r,s)},n=0;n0&&(f=t.dxydi([],n-1,o,0,s),v.push(l[0]+f[0]/3),y.push(l[1]+f[1]/3),d=t.dxydi([],n-1,o,1,s),v.push(h[0]-d[0]/3),y.push(h[1]-d[1]/3)),v.push(h[0]),y.push(h[1]),l=h;else for(n=t.a2i(e),u=Math.floor(Math.max(0,Math.min(D-2,n))),c=n-u,b.length=D,b.crossLength=P,b.xy=function(e){return t.evalxy([],n,e)},b.dxy=function(e,r){return t.dxydj([],u,e,c,r)},i=0;i0&&(p=t.dxydj([],u,i-1,c,0),v.push(l[0]+p[0]/3),y.push(l[1]+p[1]/3),g=t.dxydj([],u,i-1,c,1),v.push(h[0]-g[0]/3),y.push(h[1]-g[1]/3)),v.push(h[0]),y.push(h[1]),l=h;return b.axisLetter=r,b.axis=M,b.crossAxis=E,b.value=e,b.constvar=a,b.index=m,b.x=v,b.y=y,b.smoothing=E.smoothing,b}function s(e){var n,i,o,s,l,u=[],c=[],h={};if(h.length=w.length,h.crossLength=S.length,"b"===r)for(o=Math.max(0,Math.min(P-2,e)),l=Math.min(1,Math.max(0,e-o)),h.xy=function(r){return t.evalxy([],r,e)},h.dxy=function(e,r){return t.dxydi([],e,o,r,l)},n=0;nw.length-1||k.push(i(s(u),{color:M.gridcolor,width:M.gridwidth}));for(m=d;mw.length-1||y<0||y>w.length-1))for(b=w[c],x=w[y],l=0;lw[w.length-1]||A.push(i(o(v),{color:M.minorgridcolor,width:M.minorgridwidth}));M.startline&&T.push(i(s(0),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&T.push(i(s(w.length-1),{color:M.endlinecolor,width:M.endlinewidth}))}else{for(h=5e-15,f=[Math.floor((w[w.length-1]-M.tick0)/M.dtick*(1+h)),Math.ceil((w[0]-M.tick0)/M.dtick/(1+h))].sort(function(t,e){return t-e}),d=f[0],p=f[1],m=d;m<=p;m++)g=M.tick0+M.dtick*m,k.push(i(o(g),{color:M.gridcolor,width:M.gridwidth}));for(m=d-1;mw[w.length-1]||A.push(i(o(v),{color:M.minorgridcolor,width:M.minorgridwidth}));M.startline&&T.push(i(o(w[0]),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&T.push(i(o(w[w.length-1]),{color:M.endlinecolor,width:M.endlinewidth}))}}},{"../../lib/extend":717,"../../plots/cartesian/axes":772}],892:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e){var r,a,o,s=e._labels=[],l=e._gridlines;for(r=0;re.length&&(t=t.slice(0,e.length)):t=[],n=0;ne.length&&(t=t.slice(0,e.length)):t=[],n=0;ne.length&&(t[n]=t[n].slice(0,e.length)):t[n]=[],i=0;i90&&(d-=180,l=-l),{angle:d,flip:l,p:t.c2p(n,e,r),offsetMultplier:u}}},{}],908:[function(t,e,r){"use strict";function n(t,e,r){var n=t.selectAll(e+"."+r).data([0]);return n.enter().append(e).classed(r,!0),n}function i(t,e,r){var i=r[0],u=r[0].trace,c=e.xaxis,h=e.yaxis,f=u.aaxis,d=u.baxis,p=t._fullLayout,m=e.plot.selectAll(".carpetlayer"),g=p._clips,v=n(m,"g","carpet"+u.uid).classed("trace",!0),y=n(v,"g","minorlayer"),b=n(v,"g","majorlayer"),x=n(v,"g","boundarylayer"),_=n(v,"g","labellayer");v.style("opacity",u.opacity),o(c,h,b,f,"a",f._gridlines),o(c,h,b,d,"b",d._gridlines),o(c,h,y,f,"a",f._minorgridlines),o(c,h,y,d,"b",d._minorgridlines),o(c,h,x,f,"a-boundary",f._boundarylines),o(c,h,x,d,"b-boundary",d._boundarylines),l(t,_,u,i,c,h,s(t,c,h,u,i,_,f._labels,"a-label"),s(t,c,h,u,i,_,d._labels,"b-label")),a(u,i,g,c,h)}function a(t,e,r,i,a){var o,s,l,u,c=r.select("#"+t._clipPathId);c.size()||(c=r.append("clipPath").classed("carpetclip",!0));var h=n(c,"path","carpetboundary"),p=e.clipsegments,m=[];for(u=0;u0?"start":"end","data-notex":1}).call(h.font,i.font).text(i.text).call(m.convertToTspans,t),f=h.bBox(this);l.attr("transform","translate("+a.p[0]+","+a.p[1]+") rotate("+a.angle+")translate("+i.axis.labelpadding*s+","+.3*f.height+")"),u=Math.max(u,f.width+i.axis.labelpadding)}),l.exit().remove(),u}function l(t,e,r,n,i,a,o,s){var l,c,h,f;l=.5*(r.a[0]+r.a[r.a.length-1]),c=r.b[0],h=r.ab2xy(l,c,!0),f=r.dxyda_rough(l,c),u(t,e,r,n,h,f,r.aaxis,i,a,o,"a-title"),l=r.a[0],c=.5*(r.b[0]+r.b[r.b.length-1]),h=r.ab2xy(l,c,!0),f=r.dxydb_rough(l,c),u(t,e,r,n,h,f,r.baxis,i,a,s,"b-title")}function u(t,e,r,n,i,a,o,s,l,u,f){var d=[];o.title&&d.push(o.title);var g=e.selectAll("text."+f).data(d);g.enter().append("text").classed(f,!0),g.each(function(){var e=p(r,s,l,i,a);-1===["start","both"].indexOf(o.showticklabels)&&(u=0),u+=o.titlefont.size+o.titleoffset,c.select(this).text(o.title||"").call(m.convertToTspans,t).attr("transform","translate("+e.p[0]+","+e.p[1]+") rotate("+e.angle+") translate(0,"+u+")").classed("user-select-none",!0).attr("text-anchor","middle").call(h.font,o.titlefont)}),g.exit().remove()}var c=t("d3"),h=t("../../components/drawing"),f=t("./map_1d_array"),d=t("./makepath"),p=t("./orient_text"),m=t("../../lib/svg_text_utils");e.exports=function(t,e,r){for(var n=0;nd&&tm&&ep||eg},h.c2p=function(t){return t},f.c2p=function(t){return t},t.setScale=function(){var e=t.x,r=t.y,n=a(t.xctrl,t.yctrl,e,r,h.smoothing,f.smoothing);t.xctrl=n[0],t.yctrl=n[1],t.evalxy=o([t.xctrl,t.yctrl],u,c,h.smoothing,f.smoothing),t.dxydi=s([t.xctrl,t.yctrl],h.smoothing,f.smoothing),t.dxydj=l([t.xctrl,t.yctrl],h.smoothing,f.smoothing)},t.i2a=function(t){var r=Math.max(0,Math.floor(t[0]),u-2),n=t[0]-r;return(1-n)*e[r]+n*e[r+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),u-2),n=t[1]-e;return(1-n)*r[e]+n*r[e+1]},t.ij2ab=function(e){return[t.i2a(e[0]),t.j2b(e[1])]},t.a2i=function(t){var r=Math.max(0,Math.min(i(t,e),u-2)),n=e[r],a=e[r+1];return Math.max(0,Math.min(u-1,r+(t-n)/(a-n)))},t.b2j=function(t){var e=Math.max(0,Math.min(i(t,r),c-2)),n=r[e],a=r[e+1];return Math.max(0,Math.min(c-1,e+(t-n)/(a-n)))},t.ab2ij=function(e){return[t.a2i(e[0]),t.b2j(e[1])]},t.i2c=function(e,r){return t.evalxy([],e,r)},t.ab2xy=function(n,i,a){if(!a&&(ne[u-1]|ir[c-1]))return[!1,!1];var o=t.a2i(n),s=t.b2j(i),l=t.evalxy([],o,s);if(a){var h,f,d,p,m=0,g=0,v=[];ne[u-1]?(h=u-2,f=1,m=(n-e[u-1])/(e[u-1]-e[u-2])):(h=Math.max(0,Math.min(u-2,Math.floor(o))),f=o-h),ir[c-1]?(d=c-2,p=1,g=(i-r[c-1])/(r[c-1]-r[c-2])):(d=Math.max(0,Math.min(c-2,Math.floor(s))),p=s-d),m&&(t.dxydi(v,h,d,f,p),l[0]+=v[0]*m,l[1]+=v[1]*m),g&&(t.dxydj(v,h,d,f,p),l[0]+=v[0]*g,l[1]+=v[1]*g)}return l},t.c2p=function(t,e,r){return[e.c2p(t[0]),r.c2p(t[1])]},t.p2x=function(t,e,r){return[e.p2c(t[0]),r.p2c(t[1])]},t.dadi=function(t){var r=Math.max(0,Math.min(e.length-2,t));return e[r+1]-e[r]},t.dbdj=function(t){var e=Math.max(0,Math.min(r.length-2,t));return r[e+1]-r[e]},t.dxyda=function(e,r,n,i){var a=t.dxydi(null,e,r,n,i),o=t.dadi(e,n);return[a[0]/o,a[1]/o]},t.dxydb=function(e,r,n,i){var a=t.dxydj(null,e,r,n,i),o=t.dbdj(r,i);return[a[0]/o,a[1]/o]},t.dxyda_rough=function(e,r,n){var i=v*(n||.1),a=t.ab2xy(e+i,r,!0),o=t.ab2xy(e-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dxydb_rough=function(e,r,n){var i=y*(n||.1),a=t.ab2xy(e,r+i,!0),o=t.ab2xy(e,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}},{"../../lib/search":745,"./compute_control_points":895,"./constants":896,"./create_i_derivative_evaluator":897,"./create_j_derivative_evaluator":898,"./create_spline_evaluator":899}],910:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){var i,a,o,s=[],l=[],u=t[0].length,c=t.length,h=0;for(i=0;i0&&void 0!==(n=t[r][e-1])&&(a++,i+=n),e0&&void 0!==(n=t[r-1][e])&&(a++,i+=n),r0&&a0&&i1e-5);return n.log("Smoother converged to",M,"after",k,"iterations"),t}},{"../../lib":728}],911:[function(t,e,r){"use strict";var n=t("./has_columns"),i=t("../heatmap/convert_column_xyz");e.exports=function(t,e,r){var a=[],o=r("x");o&&!n(o)&&a.push("x"),e._cheater=!o;var s=r("y");if(s&&!n(s)&&a.push("y"),o||s)return a.length&&i(e,e.aaxis,e.baxis,"a","b",a),!0}},{"../heatmap/convert_column_xyz":952,"./has_columns":901}],912:[function(t,e,r){"use strict";var n=t("../scattergeo/attributes"),i=t("../../components/colorscale/attributes"),a=t("../../components/colorbar/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend"),l=s.extendFlat,u=s.extendDeepAll,c=n.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:n.locationmode,z:{valType:"data_array",editType:"calc"},text:l({},n.text,{}),marker:{line:{color:c.color,width:l({},c.width,{dflt:1}),editType:"calc"},editType:"calc"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]})},u({},i,{zmax:{editType:"calc"},zmin:{editType:"calc"}}),{colorbar:a})},{"../../components/colorbar/attributes":605,"../../components/colorscale/attributes":609,"../../lib/extend":717,"../../plots/attributes":770,"../scattergeo/attributes":1069}],913:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../constants/numerical").BADNUM,a=t("../../components/colorscale/calc"),o=t("../scatter/arrays_to_calcdata");e.exports=function(t,e){for(var r=e.locations.length,s=new Array(r),l=0;ll&&(e.z=c.slice(0,l)),s("locationmode"),s("text"),s("marker.line.color"),s("marker.line.width"),i(t,e,o,s,{prefix:"",cLetter:"z"})}},{"../../components/colorscale/defaults":613,"../../lib":728,"./attributes":912}],915:[function(t,e,r){"use strict";e.exports=function(t,e){return t.location=e.location,t.z=e.z,t}},{}],916:[function(t,e,r){"use strict";function n(t,e,r,n){var s=r.hi||e.hoverinfo,l="all"===s?a.hoverinfo.flags:s.split("+"),u=-1!==l.indexOf("name"),c=-1!==l.indexOf("location"),h=-1!==l.indexOf("z"),f=-1!==l.indexOf("text"),d=!u&&c,p=[];d?t.nameOverride=r.loc:(u&&(t.nameOverride=e.name),c&&p.push(r.loc)),h&&p.push(function(t){return i.tickText(n,n.c2l(t),"hover").text}(r.z)),f&&o(r,e,p),t.extraText=p.join("
")}var i=t("../../plots/cartesian/axes"),a=t("./attributes"),o=t("../scatter/fill_hover_text");e.exports=function(t,e,r){var i,a,o,s,l=t.cd,u=l[0].trace,c=t.subplot;for(a=0;a0&&t[e+1][0]<0)return e;return null}var r,n,i,a,o=t.geometry,s=o.coordinates,l=t.id,u=[];switch(r="RUS"===l||"FJI"===l?function(t){var r;if(null===e(t))r=t;else for(r=new Array(t.length),a=0;ar?n[i++]=[t[a][0]+360,t[a][1]]:a===r?(n[i++]=t[a],n[i++]=[t[a][0],-90]):n[i++]=t[a];var o=h.tester(n);o.pts.pop(),u.push(o)}:function(t){u.push(h.tester(t))},o.type){case"MultiPolygon":for(n=0;ns.end&&(s.start=s.end=(s.start+s.end)/2),e._input.contours||(e._input.contours={}),a(e._input.contours,{start:s.start,end:s.end,size:s.size}),e._input.autocontour=!0}else{var u=s.start,c=s.end,h=e._input.contours;if(u>c&&(s.start=h.start=c,c=s.end=h.end=u,u=s.start),!(s.size>0)){var f;f=u===c?1:n(u,c,e.ncontours).dtick,h.size=s.size=f}}return r}},{"../../lib":728,"../../plots/cartesian/axes":772,"../heatmap/calc":949}],922:[function(t,e,r){"use strict";var n=t("../../plots/plots"),i=t("../../components/colorbar/draw"),a=t("./make_color_map"),o=t("./end_plus");e.exports=function(t,e){var r=e[0].trace,s="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+s).remove(),!r.showscale)return void n.autoMargin(t,s);var l=i(t,s);e[0].t.cb=l;var u=r.contours,c=r.line,h=u.size||1,f=u.coloring,d=a(r,{isColorbar:!0});"heatmap"===f&&l.filllevels({start:r.zmin,end:r.zmax,size:(r.zmax-r.zmin)/254}),l.fillcolor("fill"===f||"heatmap"===f?d:"").line({color:"lines"===f?d:c.color,width:!1!==u.showlines?c.width:0,dash:c.dash}).levels({start:u.start,end:o(u),size:h}).options(r.colorbar)()}},{"../../components/colorbar/draw":607,"../../plots/plots":831,"./end_plus":926,"./make_color_map":930}],923:[function(t,e,r){"use strict";e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},{}],924:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){var a,o=n.coerce2(t,e,i,"contours.start"),s=n.coerce2(t,e,i,"contours.end"),l=!1===o||!1===s,u=r("contours.size");!(a=l?e.autocontour=!0:r("autocontour",!1))&&u||r("ncontours")}},{"../../lib":728,"./attributes":920}],925:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../heatmap/has_columns"),a=t("../heatmap/xyz_defaults"),o=t("./contours_defaults"),s=t("./style_defaults"),l=t("./attributes");e.exports=function(t,e,r,u){function c(r,i){return n.coerce(t,e,l,r,i)}if(!a(t,e,c,u))return void(e.visible=!1);c("text"),c("connectgaps",i(e)),o(t,e,c),s(t,e,c,u)}},{"../../lib":728,"../heatmap/has_columns":955,"../heatmap/xyz_defaults":963,"./attributes":920,"./contours_defaults":924,"./style_defaults":934}],926:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],927:[function(t,e,r){"use strict";function n(t,e,r,n){return Math.abs(t[0]-e[0])20?(m=u.CHOOSESADDLE[m][(g[0]||g[1])<0?0:1],t.crossings[p]=u.SADDLEREMAINDER[m]):delete t.crossings[p],!(g=u.NEWDELTA[m])){l.log("Found bad marching index:",m,e,t.level);break}v.push(s(t,e,g)),e[0]+=g[0],e[1]+=g[1],n(v[v.length-1],v[v.length-2],a,c)&&v.pop(),p=e.join(",");var _=g[0]&&(e[0]<0||e[0]>x-2)||g[1]&&(e[1]<0||e[1]>b-2);if(p===d&&g.join(",")===y||r&&_)break;m=t.crossings[p]}1e4===f&&l.log("Infinite loop in contour?");var w,M,k,A,T,S,E,L=n(v[0],v[v.length-1],a,c),C=0,I=.2*t.smoothing,z=[],D=0;for(f=1;f=D;f--)if((w=z[f])=D&&w+z[M]20&&e?208===t||1114===t?n=0===r[0]?1:-1:i=0===r[1]?1:-1:-1!==u.BOTTOMSTART.indexOf(t)?i=1:-1!==u.LEFTSTART.indexOf(t)?n=1:-1!==u.TOPSTART.indexOf(t)?i=-1:n=-1,[n,i]}function s(t,e,r){var n=e[0]+Math.max(r[0],0),i=e[1]+Math.max(r[1],0),a=t.z[i][n],o=t.xaxis,s=t.yaxis;if(r[1]){var l=(t.level-a)/(t.z[i][n+1]-a);return[o.c2p((1-l)*t.x[n]+l*t.x[n+1],!0),s.c2p(t.y[i],!0),n+l,i]}var u=(t.level-a)/(t.z[i+1][n]-a);return[o.c2p(t.x[n],!0),s.c2p((1-u)*t.y[i]+u*t.y[i+1],!0),n,i+u]}var l=t("../../lib"),u=t("./constants");e.exports=function(t,e,r){var n,i,o,s,u;for(e=e||.01,r=r||.01,o=0;ot?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){return t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208}return 15===r?0:r}var i=t("./constants");e.exports=function(t){var e,r,a,o,s,l,u,c,h,f=t[0].z,d=f.length,p=f[0].length,m=2===d||2===p;for(r=0;r1e3){d.warn("Too many contours, clipping at 1000",t);break}return i}function a(t,e,r){var n=t.selectAll("g.contourbg").data([0]);n.enter().append("g").classed("contourbg",!0);var i=n.selectAll("path").data("fill"===r.coloring?[0]:[]);i.enter().append("path"),i.exit().remove(),i.attr("d","M"+e.join("L")+"Z").style("stroke","none")}function o(t,e,r,n){var i=t.selectAll("g.contourfill").data([0]);i.enter().append("g").classed("contourfill",!0);var a=i.selectAll("path").data("fill"===n.coloring?e:[]);a.enter().append("path"),a.exit().remove(),a.each(function(t){var e=s(t,r);e?f.select(this).attr("d",e).style("stroke","none"):f.select(this).remove()})}function s(t,e){function r(t){return Math.abs(t[0]-e[2][0])<.01}for(var n,i,a,o,s,l,u=Math.min(t.z[0][0],t.z[0][1]),c=t.edgepaths.length||u<=t.level?"":"M"+e.join("L")+"Z",h=0,f=t.edgepaths.map(function(t,e){return e}),m=!0;f.length;){for(l=p.smoothopen(t.edgepaths[h],t.smoothing),c+=m?l:l.replace(/^M/,"L"),f.splice(f.indexOf(h),1),n=t.edgepaths[h][t.edgepaths[h].length-1],o=-1,a=0;a<4;a++){if(!n){d.log("Missing end?",h,t);break}for(!function(t){return Math.abs(t[1]-e[0][1])<.01}(n)||r(n)?!function(t){return Math.abs(t[0]-e[0][0])<.01}(n)?!function(t){return Math.abs(t[1]-e[2][1])<.01}(n)?r(n)&&(i=e[2]):i=e[3]:i=e[0]:i=e[1],s=0;s=0&&(i=g,o=s):Math.abs(n[1]-i[1])<.01?Math.abs(n[1]-g[1])<.01&&(g[0]-n[0])*(i[0]-g[0])>=0&&(i=g,o=s):d.log("endpt to newendpt is not vert. or horz.",n,i,g)}if(n=i,o>=0)break;c+="L"+i}if(o===t.edgepaths.length){d.log("unclosed perimeter path");break}h=o,m=-1===f.indexOf(h),m&&(h=f[0],c+="Z")}for(h=0;hn.center?n.right-o:o-n.left)/(u+Math.abs(Math.sin(l)*a)),f=(s>n.middle?n.bottom-s:s-n.top)/(Math.abs(c)+Math.cos(l)*a);if(h<1||f<1)return 1/0;var p=M.EDGECOST*(1/(h-1)+1/(f-1));p+=M.ANGLECOST*l*l;for(var m=o-u,g=s-c,v=o+u,y=s+c,b=0;b2*M.MAXCOST)break;p&&(o/=2),a=l-o/2,s=a+1.5*o}if(f<=M.MAXCOST)return c},r.addLabelData=function(t,e,r,n){var i=e.width/2,a=e.height/2,o=t.x,s=t.y,l=t.theta,u=Math.sin(l),c=Math.cos(l),h=i*c,f=a*u,d=i*u,p=-a*c,m=[[o-h-f,s-d-p],[o+h-f,s+d-p],[o+h+f,s+d+p],[o-h+f,s-d+p]];r.push({text:e.text,x:o,y:s,dy:e.dy,theta:l,level:e.level,width:e.width,height:e.height}),n.push(m)},r.drawLabels=function(t,e,r,n,i){var a=t.selectAll("text").data(e,function(t){return t.text+","+t.x+","+t.y+","+t.theta});if(a.exit().remove(),a.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each(function(t){var e=t.x+Math.sin(t.theta)*t.dy,n=t.y-Math.cos(t.theta)*t.dy;f.select(this).text(t.text).attr({x:e,y:n,transform:"rotate("+180*t.theta/Math.PI+" "+e+" "+n+")"}).call(m.convertToTspans,r)}),i){for(var o="",s=0;sS){r("a scale is not linear");break}}if(s.length&&"fast"===A){var E=(s[s.length-1]-s[0])/(s.length-1),L=Math.abs(E/100);for(x=0;xL){r("b scale is not linear");break}}}var C=d(b),I="scaled"===e.xtype?"":n,z=g(e,I,i,o,C,w),D="scaled"===e.ytype?"":s,P=g(e,D,v,y,b.length,M),O={a:z,b:P,z:b};return"levels"===e.contours.type&&u(e,b,"","z"),[O]}var a=t("../../lib"),o=t("../../plots/cartesian/axes"),s=t("../../lib").extendFlat,l=t("../../registry"),u=t("../../components/colorscale/calc"),c=t("../heatmap/has_columns"),h=t("../heatmap/convert_column_xyz"),f=t("../heatmap/clean_2d_array"),d=t("../heatmap/max_row_length"),p=t("../heatmap/interp2d"),m=t("../heatmap/find_empties"),g=t("../heatmap/make_bound_array"),v=t("./defaults"),y=t("../carpet/lookup_carpetid");e.exports=function(t,e){var r=e.carpetTrace=y(t,e);if(r&&r.visible&&"legendonly"!==r.visible){if(!e.a||!e.b){var a=t.data[r.index],l=t.data[e.index];l.a||(l.a=a.a),l.b||(l.b=a.b),v(l,e,e._defaultColor,t._fullLayout)}var u=i(t,e),c=e.contours;if(!0===e.autocontour){var h=n(e.zmin,e.zmax,e.ncontours);c.size=h.dtick,c.start=o.tickFirst(h),h.range.reverse(),c.end=o.tickFirst(h),c.start===e.zmin&&(c.start+=c.size),c.end===e.zmax&&(c.end-=c.size),c.start>c.end&&(c.start=c.end=(c.start+c.end)/2),e._input.contours=s({},c)}else{var f=c.start,d=c.end,p=e._input.contours;if(f>d&&(c.start=p.start=d,d=c.end=p.end=f,f=c.start),!(c.size>0)){var m;m=f===d?1:n(f,d,e.ncontours).dtick,p.size=c.size=m}}return u}}},{"../../components/colorscale/calc":610,"../../lib":728,"../../plots/cartesian/axes":772,"../../registry":846,"../carpet/lookup_carpetid":903,"../heatmap/clean_2d_array":950,"../heatmap/convert_column_xyz":952,"../heatmap/find_empties":954,"../heatmap/has_columns":955,"../heatmap/interp2d":958,"../heatmap/make_bound_array":959,"../heatmap/max_row_length":960,"./defaults":942}],937:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i,a,o,s=n.a.length,l=n.b.length,u=n.z,c=-1/0,h=1/0;for(i=0;i":case">=":n.contours.value>c&&(t[0].prefixBoundary=!0);break;case"<":case"<=":n.contours.valuec&&(t[0].prefixBoundary=!0);break;case"][":case")(":a=Math.min.apply(null,n.contours.value),o=Math.max.apply(null,n.contours.value),ac&&(t[0].prefixBoundary=!0)}}},{}],938:[function(t,e,r){"use strict";e.exports={INEQUALITY_OPS:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"]}},{}],939:[function(t,e,r){"use strict";function n(t,e){function r(t){return s(t)?+t:null}var n,i=Array.isArray(e);return-1!==o.INEQUALITY_OPS.indexOf(t)?n=r(i?e[0]:e):-1!==o.INTERVAL_OPS.indexOf(t)?n=i?[r(e[0]),r(e[1])]:[r(e),r(e)]:-1!==o.SET_OPS.indexOf(t)&&(n=i?e.map(r):[r(e)]),n}function i(t){return function(e){e=n(t,e);var r=Math.min(e[0],e[1]),i=Math.max(e[0],e[1]);return{start:r,end:i,size:i-r}}}function a(t){return function(e){return e=n(t,e),{start:e,end:1/0,size:1/0}}}var o=t("./constants"),s=t("fast-isnumeric");e.exports["[]"]=i("[]"),e.exports["()"]=i("()"),e.exports["[)"]=i("[)"),e.exports["(]"]=i("(]"),e.exports["]["]=i("]["),e.exports[")("]=i(")("),e.exports[")["]=i(")["),e.exports["]("]=i("]("),e.exports[">"]=a(">"),e.exports[">="]=a(">="),e.exports["<"]=a("<"),e.exports["<="]=a("<="),e.exports["="]=a("=")},{"./constants":938,"fast-isnumeric":131}],940:[function(t,e,r){"use strict";var n=t("./constraint_mapping"),i=t("fast-isnumeric");e.exports=function(t,e){var r;-1===["=","<","<=",">",">="].indexOf(e.operation)?(t("contours.value",[0,1]),Array.isArray(e.value)?e.value.length>2?e.value=e.value.slice(2):0===e.length?e.value=[0,1]:e.length<2?(r=parseFloat(e.value[0]),e.value=[r,r+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:i(e.value)&&(r=parseFloat(e.value),e.value=[r,r+1])):(t("contours.value",0),i(e.value)||(Array.isArray(e.value)?e.value=parseFloat(e.value[0]):e.value=0));var a=n[e.operation](e.value);e.start=a.start,e.end=a.end,e.size=a.size}},{"./constraint_mapping":939,"fast-isnumeric":131}],941:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r,i,a,o=function(t){return t.reverse()},s=function(t){return t};switch(e){case"][":case")[":case"](":case")(":var l=o;o=s,s=l;case"[]":case"[)":case"(]":case"()":if(2!==t.length)return void n.warn("Contour data invalid for the specified inequality range operation.");for(i=t[0],a=t[1],r=0;r=":case">":if(1!==t.length)return void n.warn("Contour data invalid for the specified inequality operation.");for(i=t[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",t);break}return a}},{"../../lib":728}],944:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../contour/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("../contour/style"),n.moduleType="trace",n.name="contourcarpet",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","carpet","contour","symbols","showLegend","hasLines","carpetDependent"],n.meta={},e.exports=n},{"../../plots/cartesian":782,"../contour/colorbar":922,"../contour/style":933,"./attributes":935,"./calc":936,"./defaults":942,"./plot":947}],945:[function(t,e,r){"use strict";var n=t("../../components/drawing"),i=t("../carpet/axis_aligned_line"),a=t("../../lib");e.exports=function(t,e,r,o,s,l,u,c){function h(t){return Math.abs(t[1]-r[0][1])=0&&(y=L,x=_):Math.abs(v[1]-y[1])=0&&(y=L,x=_):a.log("endpt to newendpt is not vert. or horz.",v,y,L)}if(x>=0)break;M+=m(v,y),v=y}if(x===e.edgepaths.length){a.log("unclosed perimeter path");break}g=x,A=-1===k.indexOf(g),A&&(g=k[0],M+=m(v,y)+"Z",v=null)}for(g=0;g=0;F--)P=s.clipsegments[F],O=f([],P.x,_.c2p),R=f([],P.y,T.c2p),O.reverse(),R.reverse(),N.push(d(O,R,P.bicubic));var B="M"+N.join("L")+"Z";u(j,s.clipsegments,_,T,C,m.coloring),c(a,j,_,T,L,I,n,o,s,m.coloring,B),i(j,L,t,r[0],m,e,o),p.setClipUrl(j,o._clipPathId)}}function i(t,e,r,n,i,o,s){var l=t.selectAll("g.contourlines").data([0]);l.enter().append("g").classed("contourlines",!0);var u=!1!==i.showlines,c=i.showlabels,f=u&&c,d=y.createLines(l,u||c,e),g=y.createLineClip(l,f,r._fullLayout._defs,n.trace.uid),v=t.selectAll("g.contourlabels").data(c?[0]:[]);if(v.exit().remove(),v.enter().append("g").classed("contourlabels",!0),c){var x=o.xaxis,_=o.yaxis,w=x._length,M=_._length,k=[[[0,0],[w,0],[w,M],[0,M]]],A=[];m.clearLocationCache();var T=y.labelFormatter(i,n.t.cb,r._fullLayout),S=p.tester.append("text").attr("data-notex",1).call(p.font,i.labelfont),E={left:0,right:w,center:w/2,top:0,bottom:M,middle:M/2},L=Math.sqrt(w*w+M*M),C=b.LABELDISTANCE*L/Math.max(1,e.length/b.LABELINCREASE);d.each(function(t){var e=y.calcTextOpts(t.level,T,S,r);h.select(this).selectAll("path").each(function(r){var n=this,i=m.getVisibleSegment(n,E,e.height/2);if(i&&(a(n,r,t,i,s,e.height),!(i.len<(e.width+e.height)*b.LABELMIN)))for(var o=Math.min(Math.ceil(i.len/C),b.LABELMAX),l=0;lb&&(n.max=b),n.len=n.max-n.min}}function o(t,e,r){var n=t.getPointAtLength(e),i=t.getPointAtLength(r),a=i.x-n.x,o=i.y-n.y,s=Math.sqrt(a*a+o*o);return[a/s,o/s]}function s(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}function l(t,e){var r=Math.abs(t[0]*e[0]+t[1]*e[1]);return Math.sqrt(1-r*r)/r}function u(t,e,r,n,i,a){var o,s,l,u,c=t.selectAll("g.contourbg").data([0]);c.enter().append("g").classed("contourbg",!0);var h=c.selectAll("path").data("fill"!==a||i?[]:[0]);h.enter().append("path"),h.exit().remove();var p=[];for(u=0;uI){r("x scale is not linear");break}}if(y.length&&"fast"===E){var z=(y[y.length-1]-y[0])/(y.length-1),D=Math.abs(z/100);for(w=0;wD){r("y scale is not linear");break}}}var P=c(_),O="scaled"===e.xtype?"":m,R=p(e,O,g,v,P,M),F="scaled"===e.ytype?"":y,j=p(e,F,b,x,_.length,k);S||(a.expand(M,R),a.expand(k,j));var N={x:R,y:j,z:_,text:e.text};if(s(e,_,"","z"),A&&e.contours&&"heatmap"===e.contours.coloring){var B={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};N.xfill=p(B,O,g,v,P,M),N.yfill=p(B,F,b,x,_.length,k)}return[N]}},{"../../components/colorscale/calc":610,"../../lib":728,"../../plots/cartesian/axes":772,"../../registry":846,"../histogram2d/calc":977,"./clean_2d_array":950,"./convert_column_xyz":952,"./find_empties":954,"./has_columns":955,"./interp2d":958,"./make_bound_array":959,"./max_row_length":960}],950:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){var r,i,a,o,s,l;if(e){for(r=0,s=0;s=0;o--)a=f[o],r=a[0],i=a[1],(s=((h[[r-1,i]]||m)[2]+(h[[r+1,i]]||m)[2]+(h[[r,i-1]]||m)[2]+(h[[r,i+1]]||m)[2])/20)&&(l[a]=[r,i,s],f.splice(o,1),u=!0);if(!u)throw"findEmpties iterated with no new neighbors";for(a in l)h[a]=l[a],c.push(l[a])}return c.sort(function(t,e){return e[2]-t[2]})}},{"./max_row_length":960}],955:[function(t,e,r){"use strict";e.exports=function(t){return!Array.isArray(t.z[0])}},{}],956:[function(t,e,r){"use strict";var n=t("../../components/fx"),i=t("../../lib"),a=n.constants.MAXDIST;e.exports=function(t,e,r,o,s){if(!(t.distance=y[0].length||h<0||h>y.length)return}else{if(n.inbox(e-g[0],e-g[g.length-1])>a||n.inbox(r-v[0],r-v[v.length-1])>a)return;if(s){var w;for(x=[2*g[0]-g[1]],w=1;wm&&(v=Math.max(v,Math.abs(t[i][a]-p)/(g-m))))}return v}var a=t("../../lib"),o=[[-1,0],[1,0],[0,-1],[0,1]];e.exports=function(t,e,r){var o,s,l=1;if(Array.isArray(r))for(o=0;o.01;o++)l=i(t,e,n(l));return l>.01&&a.log("interp2d didn't converge quickly",l),t}},{"../../lib":728}],959:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e,r,i,a,o){var s,l,u,c=[],h=n.traceIs(t,"contour"),f=n.traceIs(t,"histogram"),d=n.traceIs(t,"gl2d");if(Array.isArray(e)&&e.length>1&&!f&&"category"!==o.type){var p=e.length;if(!(p<=a))return h?e.slice(0,a):e.slice(0,a+1);if(h||d)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]],u=1;u0;)b=p.c2p(A[M]),M--;for(b0;)w=m.c2p(T[M]),M--;if(w<_&&(x=_,_=w,w=x,z=!0),S&&(A=r[0].xfill,T=r[0].yfill),"fast"!==E){var D="best"===E?0:.5;y=Math.max(-D*p._length,y),b=Math.min((1+D)*p._length,b),_=Math.max(-D*m._length,_),w=Math.min((1+D)*m._length,w)}var P=Math.round(b-y),O=Math.round(w-_),R=P<=0||O<=0,F=e.plot.select(".imagelayer").selectAll("g.hm."+v).data(R?[]:[0]);if(F.enter().append("g").classed("hm",!0).classed(v,!0),F.exit().remove(),!R){var j,N;"fast"===E?(j=C,N=L):(j=P,N=O);var B=document.createElement("canvas");B.width=j,B.height=N;var U,V,H=B.getContext("2d"),q=s.makeColorScaleFunc(s.extractScale(f.colorscale,f.zmin,f.zmax),{noNumericCheck:!0,returnArray:!0});"fast"===E?(U=I?function(t){return C-1-t}:o.identity,V=z?function(t){return L-1-t}:o.identity):(U=function(t){return o.constrain(Math.round(p.c2p(A[t])-y),0,P)},V=function(t){return o.constrain(Math.round(m.c2p(T[t])-_),0,O)});var G,Y,W,X,Z,J,K,Q=V(0),$=[Q,Q],tt=I?0:1,et=z?0:1,rt=0,nt=0,it=0,at=0;if(E){var ot,st=0;try{ot=new Uint8Array(P*O*4)}catch(t){ot=new Array(P*O*4)}if("best"===E){var lt,ut,ct,ht=new Array(A.length),ft=new Array(T.length),dt=new Array(P);for(M=0;M0&&a0&&s0&&(n=!0);for(var s=0;sa){var o=a-r[t];return r[t]=a,o}}return 0},max:function(t,e,r,i){var a=i[e];if(n(a)){if(a=Number(a),!n(r[t]))return r[t]=a,a;if(r[t]d.size/1.9?d.size:d.size/Math.ceil(d.size/b);var A=d.start+(d.size-b)/2;x=A-b*Math.ceil((A-x)/b)}for(l=0;l=0;a--)i(a);else if("increasing"===e){for(a=1;a=0;a--)t[a]+=t[a+1];"exclude"===r&&(t.push(0),t.shift())}}var u=t("fast-isnumeric"),c=t("../../lib"),h=t("../../plots/cartesian/axes"),f=t("../bar/arrays_to_calcdata"),d=t("./bin_functions"),p=t("./norm_functions"),m=t("./average"),g=t("./clean_bins"),v=t("../../constants/numerical").ONEAVGMONTH;e.exports=function(t,e){if(!0===e.visible){var r,i=[],a=[],o=h.getFromId(t,"h"===e.orientation?e.yaxis||"y":e.xaxis||"x"),s="h"===e.orientation?"y":"x",v={x:"y",y:"x"}[s],y=e[s+"calendar"],b=e.cumulative;g(e,o,s);var x,_,w,M=n(t,e,o,s),k=M[0],A=M[1],T="string"==typeof k.size,S=T?[]:k,E=[],L=[],C=0,I=e.histnorm,z=e.histfunc,D=-1!==I.indexOf("density");b.enabled&&D&&(I=I.replace(/ ?density$/,""),D=!1);var P,O="max"===z||"min"===z,R=O?null:0,F=d.count,j=p[I],N=!1,B=function(t){return o.r2c(t,0,y)};for(Array.isArray(e[v])&&"count"!==z&&(P=e[v],N="avg"===z,F=d[z]),r=B(k.start),_=B(k.end)+(r-h.tickIncrement(r,k.size,!1,y))/1e6;r<_&&i.length<1e6&&(x=h.tickIncrement(r,k.size,!1,y),i.push((r+x)/2),a.push(R),T&&S.push(r),D&&E.push(1/(x-r)),N&&L.push(0),!(x<=r));)r=x;T||"date"!==o.type||(S={start:B(S.start),end:B(S.end),size:S.size});var U=a.length;for(r=0;r=0&&w=q;r--)if(a[r]){G=r;break}for(r=q;r<=G;r++)u(i[r])&&u(a[r])&&H.push({p:i[r],s:a[r],b:0});return 1===H.length&&(H[0].width1=h.tickIncrement(H[0].p,k.size,!1,y)-H[0].p),f(H,e),H}}},{"../../constants/numerical":707,"../../lib":728,"../../plots/cartesian/axes":772,"../bar/arrays_to_calcdata":855,"./average":968,"./bin_functions":970,"./clean_bins":972,"./norm_functions":975,"fast-isnumeric":131}],972:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib").cleanDate,a=t("../../constants/numerical"),o=a.ONEDAY,s=a.BADNUM;e.exports=function(t,e,r){var a=e.type,l=r+"bins",u=t[l];u||(u=t[l]={});var c="date"===a?function(t){return t||0===t?i(t,s,u.calendar):null}:function(t){return n(t)?Number(t):null};u.start=c(u.start),u.end=c(u.end);var h="date"===a?o:1,f=u.size;if(n(f))u.size=f>0?Number(f):h;else if("string"!=typeof f)u.size=h;else{var d=f.charAt(0),p=f.substr(1);p=n(p)?Number(p):0,(p<=0||"date"!==a||"M"!==d||p!==Math.round(p))&&(u.size=h)}var m="autobin"+r;"boolean"!=typeof t[m]&&(t[m]=!((u.start||0===u.start)&&(u.end||0===u.end))),t[m]||delete t["nbins"+r]}},{"../../constants/numerical":707,"../../lib":728,"fast-isnumeric":131}],973:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/color"),o=t("./bin_defaults"),s=t("../bar/style_defaults"),l=t("../../components/errorbars/defaults"),u=t("./attributes");e.exports=function(t,e,r,c){function h(r,n){return i.coerce(t,e,u,r,n)}var f=h("x"),d=h("y");h("cumulative.enabled")&&(h("cumulative.direction"),h("cumulative.currentbin")),h("text");var p=h("orientation",d&&!f?"h":"v"),m=e["v"===p?"x":"y"];if(!m||!m.length)return void(e.visible=!1);n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],c),e["h"===p?"x":"y"]&&h("histfunc"),o(t,e,h,"h"===p?["y"]:["x"]),s(t,e,h,r,c),l(t,e,a.defaultLine,{axis:"y"}),l(t,e,a.defaultLine,{axis:"x",inherit:"y"})}},{"../../components/color":604,"../../components/errorbars/defaults":633,"../../lib":728,"../../registry":846,"../bar/style_defaults":868,"./attributes":967,"./bin_defaults":969}],974:[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.selectPoints=t("../bar/select"),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":782,"../bar/hover":859,"../bar/layout_attributes":861,"../bar/layout_defaults":862,"../bar/plot":863,"../bar/select":864,"../bar/set_positions":865,"../bar/style":867,"../scatter/colorbar":1034,"./attributes":967,"./calc":971,"./defaults":973}],975:[function(t,e,r){"use strict";e.exports={percent:function(t,e){for(var r=t.length,n=100/e,i=0;ik&&m.splice(k,m.length-k),v.length>k&&v.splice(k,v.length-k),!e.autobinx&&e.xbins&&null!==e.xbins.start&&null!==e.xbins.end||(e.xbins=i.autoBin(m,p,e.nbinsx,"2d",y),"histogram2dcontour"===e.type&&(e.xbins.start=w(i.tickIncrement(x(e.xbins.start),e.xbins.size,!0,y)),e.xbins.end=w(i.tickIncrement(x(e.xbins.end),e.xbins.size,!1,y))),e._input.xbins=e.xbins,e._input.autobinx=e.autobinx),!e.autobiny&&e.ybins&&null!==e.ybins.start&&null!==e.ybins.end||(e.ybins=i.autoBin(v,g,e.nbinsy,"2d",b),"histogram2dcontour"===e.type&&(e.ybins.start=M(i.tickIncrement(_(e.ybins.start),e.ybins.size,!0,b)),e.ybins.end=M(i.tickIncrement(_(e.ybins.end),e.ybins.size,!1,b))),e._input.ybins=e.ybins,e._input.autobiny=e.autobiny),f=[];var A,T,S=[],E=[],L="string"==typeof e.xbins.size,C="string"==typeof e.ybins.size,I=L?[]:e.xbins,z=C?[]:e.ybins,D=0,P=[],O=e.histnorm,R=e.histfunc,F=-1!==O.indexOf("density"),j="max"===R||"min"===R,N=j?null:0,B=a.count,U=o[O],V=!1,H=[],q=[],G="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";G&&"count"!==R&&(V="avg"===R,B=a[R]);var Y=e.xbins,W=x(Y.start),X=x(Y.end)+(W-i.tickIncrement(W,Y.size,!1,y))/1e6;for(d=W;d=0&&A=0&&T0)s=h(t.alphahull,l);else{var u=["x","y","z"].indexOf(t.delaunayaxis);s=c(l.map(function(t){return[t[(u+1)%3],t[(u+2)%3]]}))}var p={positions:l,cells:s,lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,contourEnable:t.contour.show,contourColor:d(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading};t.intensity?(this.color="#fff",p.vertexIntensity=t.intensity,p.vertexIntensityBounds=[t.cmin,t.cmax],p.colormap=i(t.colorscale)):t.vertexcolor?(this.color=t.vertexcolor[0],p.vertexColors=a(t.vertexcolor)):t.facecolor?(this.color=t.facecolor[0],p.cellColors=a(t.facecolor)):(this.color=t.color,p.meshColor=d(t.color)),this.mesh.update(p)},p.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=s},{"../../lib/str2rgbarray":749,"alpha-shape":43,"convex-hull":103,"delaunay-triangulate":123,"gl-mesh3d":205,tinycolor2:534}],988:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/colorscale/defaults"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,n){return i.coerce(t,e,o,r,n)}function u(t){var e=t.map(function(t){ -var e=l(t);return e&&Array.isArray(e)?e:null});return e.every(function(t){return t&&t.length===e[0].length})&&e}var c=u(["x","y","z"]),h=u(["i","j","k"]);if(!c)return void(e.visible=!1);h&&h.forEach(function(t){for(var e=0;eo?a=!0:e1)){var h=s.simpleMap(c.x,e.d2c,0,r.xcalendar),f=s.distinctVals(h).minDiff;a=Math.min(a,f)}}for(a===1/0&&(a=1),u=0;u");w.push(o,o,o,o,o,o,null)}(C,p[C],m[C],g[C],v[C]));e.x=x,e.y=_,e.text=w}},{"../../lib":728,"../../plots/cartesian/axes":772,"../../plots/cartesian/axis_ids":775,"./helpers":993,"fast-isnumeric":131}],997:[function(t,e,r){"use strict";var n=t("../../components/colorscale/color_attributes"),i=t("../../components/colorbar/attributes"),a=t("../../components/colorscale/scales"),o=t("../../plots/cartesian/layout_attributes"),s=t("../../plots/font_attributes"),l=t("../../lib/extend"),u=l.extendDeepAll,c=l.extendFlat;e.exports={domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},y:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},editType:"calc"},labelfont:s({editType:"calc"}),tickfont:s({editType:"calc"}),rangefont:s({editType:"calc"}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",editType:"calc"},tickvals:c({},o.tickvals,{editType:"calc"}),ticktext:c({},o.ticktext,{editType:"calc"}),tickformat:{valType:"string",dflt:"3s",editType:"calc"},visible:{valType:"boolean",dflt:!0,editType:"calc"},range:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc"},constraintrange:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc"},values:{valType:"data_array",dflt:[],editType:"calc"},editType:"calc"},line:c(u(n("line","calc"),{colorscale:{dflt:a.Viridis},autocolorscale:{dflt:!1}}),{showscale:{valType:"boolean",dflt:!1,editType:"calc"},colorbar:i,editType:"calc"})}},{"../../components/colorbar/attributes":605,"../../components/colorscale/color_attributes":611,"../../components/colorscale/scales":622,"../../lib/extend":717,"../../plots/cartesian/layout_attributes":783,"../../plots/font_attributes":796}],998:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plots/plots"),a=t("./plot"),o=t("../../constants/xmlns_namespaces"),s=t("./constants");r.name="parcoords",r.attr="type",r.plot=function(t){var e=i.getSubplotCalcData(t.calcdata,"parcoords","parcoords");e.length&&a(t,e)},r.clean=function(t,e,r,n){var i=n._has&&n._has("parcoords"),a=e._has&&e._has("parcoords");i&&!a&&(n._paperdiv.selectAll(".parcoords-line-layers").remove(),n._paperdiv.selectAll(".parcoords-line-layers").remove(),n._paperdiv.selectAll(".parcoords").remove(),n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},r.toSVG=function(t){function e(e){var n=this,i=n.toDataURL("image/png"),a=r.append("svg:image"),l=t._fullLayout._size,u=t._fullData[e.model.key].domain;a.attr({xmlns:o.svg,"xlink:href":i,x:l.l+l.w*u.x[0]-s.overdrag,y:l.t+l.h*(1-u.y[1]),width:(u.x[1]-u.x[0])*l.w+2*s.overdrag,height:(u.y[1]-u.y[0])*l.h,preserveAspectRatio:"none"})}var r=t._fullLayout._glimages,i=n.select(t).selectAll(".svg-container");i.filter(function(t,e){return e===i.size()-1}).selectAll(".parcoords-lines.context, .parcoords-lines.focus").each(e),window.setTimeout(function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}},{"../../constants/xmlns_namespaces":709,"../../plots/plots":831,"./constants":1001,"./plot":1006,d3:122}],999:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),a=t("../../lib"),o=t("../../lib/gup").wrap;e.exports=function(t,e){var r=!!e.line.colorscale&&a.isArray(e.line.color),s=r?e.line.color:Array.apply(0,Array(e.dimensions.reduce(function(t,e){return Math.max(t,e.values.length)},0))).map(function(){return.5}),l=r?e.line.colorscale:[[0,e.line.color],[1,e.line.color]];return n(e,"line")&&i(e,e.line.color,"line","c"),o({lineColor:s,cscale:l})}},{"../../components/colorscale/calc":610,"../../components/colorscale/has_colorscale":617,"../../lib":728,"../../lib/gup":725}],1e3:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l=r.line,u="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+u).remove(),void 0===l||!l.showscale)return void a.autoMargin(t,u);var c=l.color,h=l.cmin,f=l.cmax;n(h)||(h=i.aggNums(Math.min,null,c)),n(f)||(f=i.aggNums(Math.max,null,c));var d=e[0].t.cb=s(t,u),p=o.makeColorScaleFunc(o.extractScale(l.colorscale,h,f),{noNumericCheck:!0});d.fillcolor(p).filllevels({start:h,end:f,size:(f-h)/254}).options(l.colorbar)()}},{"../../components/colorbar/draw":607,"../../components/colorscale":618,"../../lib":728,"../../plots/plots":831,"fast-isnumeric":131}],1001:[function(t,e,r){"use strict";e.exports={maxDimensionCount:60,overdrag:45,verticalPadding:2,tickDistance:50,canvasPixelRatio:1,blockLineCount:5e3,scatter:!1,layers:["contextLineLayer","focusLineLayer","pickLineLayer"],axisTitleOffset:28,axisExtentOffset:10,bar:{width:4,capturewidth:10,fillcolor:"magenta",fillopacity:1,strokecolor:"white",strokeopacity:1,strokewidth:1,handleheight:16,handleopacity:1,handleoverlap:0},cn:{axisExtentText:"axis-extent-text",parcoordsLineLayers:"parcoords-line-layers",parcoordsLineLayer:"parcoords-lines",parcoords:"parcoords",parcoordsControlView:"parcoords-control-view",yAxis:"y-axis",axisOverlays:"axis-overlays",axis:"axis",axisHeading:"axis-heading",axisTitle:"axis-title",axisExtent:"axis-extent",axisExtentTop:"axis-extent-top",axisExtentTopText:"axis-extent-top-text",axisExtentBottom:"axis-extent-bottom",axisExtentBottomText:"axis-extent-bottom-text",axisBrush:"axis-brush"},id:{filterBarPattern:"filter-bar-pattern"}}},{}],1002:[function(t,e,r){"use strict";function n(t,e,r,n,i){i("line.color",r),s(t,"line")&&a.isArray(t.line.color)?(i("line.colorscale"),l(t,e,n,i,{prefix:"line.",cLetter:"c"})):i("line.color",r)}function i(t,e){function r(t,e){return a.coerce(n,i,o.dimensions,t,e)}var n,i,s,l=t.dimensions||[],c=e.dimensions=[],h=1/0;for(l.length>u&&(a.log("parcoords traces support up to "+u+" dimensions at the moment"),l.splice(u)),s=0;s0);d&&(r("label"),r("tickvals"),r("ticktext"),r("tickformat"),r("range"),r("constraintrange"),h=Math.min(h,i.values.length)),i._index=s,c.push(i)}if(isFinite(h))for(s=0;sh&&(i.values=i.values.slice(0,h));return c}var a=t("../../lib"),o=t("./attributes"),s=t("../../components/colorscale/has_colorscale"),l=t("../../components/colorscale/defaults"),u=t("./constants").maxDimensionCount;e.exports=function(t,e,r,s){function l(r,n){return a.coerce(t,e,o,r,n)}var u=i(t,e);n(t,e,r,s,l),l("domain.x"),l("domain.y"),Array.isArray(u)&&u.length||(e.visible=!1);var c={family:s.font.family,size:Math.round(s.font.size*(10/12)),color:s.font.color};a.coerceFont(l,"labelfont",c),a.coerceFont(l,"tickfont",c),a.coerceFont(l,"rangefont",c)}},{"../../components/colorscale/defaults":613,"../../components/colorscale/has_colorscale":617,"../../lib":728,"./attributes":997,"./constants":1001}],1003:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.moduleType="trace",n.name="parcoords",n.basePlotModule=t("./base_plot"),n.categories=["gl","noOpacity"],n.meta={},e.exports=n},{"./attributes":997,"./base_plot":998,"./calc":999,"./colorbar":1e3,"./defaults":1002,"./plot":1006}],1004:[function(t,e,r){"use strict";function n(t){t.read({x:0,y:0,width:1,height:1,data:x})}function i(t,e,r,n,i){var a=t._gl;a.enable(a.SCISSOR_TEST),a.scissor(e,r,n,i),t.clear({color:[0,0,0,0],depth:1})}function a(t,e,r,a,o,s){function l(n){var c;c=Math.min(a,o-n*a),s.offset=v*n*a,s.count=v*c,0===n&&(window.cancelAnimationFrame(r.currentRafs[u]),delete r.currentRafs[u],i(t,s.scissorX,s.scissorY,s.scissorWidth,s.viewBoxSize[1])),r.clearOnly||(e(s),n*a+c>>8*e)%256/255}function u(t,e,r,n){for(var i=[],a=0;a=g-4?l(a,g-2-s):.5);return i}function c(t,e,r){var n,i,a,o=[];for(i=0;if&&(f=t[l].dim2.canvasX,c=l),t[l].dim1.canvasXi)return a;i=o,a=n[r]}return n[n.length-1]}function o(t,e){return function(r,n){if(e){var i=e[n];return null===i||void 0===i?t(r):i}return t(r)}}function s(t,e,r){var n=i(r),a=r.ticktext;return r.tickvals?b.scale.ordinal().domain(r.tickvals.map(o(b.format(r.tickformat),a))).range(r.tickvals.map(function(t){return(t-n[0])/(n[1]-n[0])}).map(function(r){return t-e+r*(e-(t-e))})):b.scale.linear().domain(n).range([t-e,e])}function l(t,e){return b.scale.linear().range([t-e,e])}function u(t){return b.scale.linear().domain(i(t))}function c(t){var e=i(t);return t.tickvals&&b.scale.ordinal().domain(t.tickvals).range(t.tickvals.map(function(t){return(t-e[0])/(e[1]-e[0])}))}function h(t){var e=t.map(function(t){return t[0]}),r=t.map(function(t){return t[1]}),n=r.map(function(t){return b.rgb(t)}),i=function(t){return function(e){return e[t]}},a="rgb".split("").map(function(t){return b.scale.linear().clamp(!0).domain(e).range(n.map(i(t)))});return function(t){return a.map(function(e){return e(t)})}}function f(t,e,r){var i=M(e),a=i.trace,o=i.lineColor,s=i.cscale,l=a.line,c=a.domain,f=a.dimensions,d=t.width,p=a.labelfont,m=a.tickfont,g=a.rangefont,b=y.extendDeep({},l,{color:o.map(u({values:o,range:[l.cmin,l.cmax]})),blockLineCount:v.blockLineCount,canvasOverdrag:v.overdrag*v.canvasPixelRatio}),x=Math.floor(d*(c.x[1]-c.x[0])),_=Math.floor(t.height*(c.y[1]-c.y[0])),w=t.margin||{l:80,r:80,t:100,b:80},k=x,A=_;return{key:r,colCount:f.filter(n).length,dimensions:f,tickDistance:v.tickDistance,unitToColor:h(s),lines:b,labelFont:p,tickFont:m,rangeFont:g,translateX:c.x[0]*d,translateY:t.height-c.y[1]*t.height,pad:w,canvasWidth:k*v.canvasPixelRatio+2*b.canvasOverdrag,canvasHeight:A*v.canvasPixelRatio,width:k,height:A,canvasPixelRatio:v.canvasPixelRatio}}function d(t){var e=t.width,r=t.height,i=t.dimensions,a=t.canvasPixelRatio,o=function(r){return e*r/Math.max(1,t.colCount-1)},h=v.verticalPadding/(r*a),f=1-2*h,d=function(t){return h+f*t},p={key:t.key,xScale:o,model:t},m={};return p.dimensions=i.filter(n).map(function(e,n){var i=u(e),h=m[e.label];return m[e.label]=(h||0)+1,{key:e.label+(h?"__"+h:""),label:e.label,tickFormat:e.tickformat,tickvals:e.tickvals,ticktext:e.ticktext,ordinal:!!e.tickvals,scatter:v.scatter||e.scatter,xIndex:n,crossfilterDimensionIndex:n,visibleIndex:e._index,height:r,values:e.values,paddedUnitValues:e.values.map(i).map(d),xScale:o,x:o(n),canvasX:o(n)*a,unitScale:l(r,v.verticalPadding),domainScale:s(r,v.verticalPadding,e),ordinalScale:c(e),domainToUnitScale:i,filter:e.constraintrange?e.constraintrange.map(i):[0,1],parent:p,model:t}}),p}function p(t){return v.layers.map(function(e){return{key:e,context:"contextLineLayer"===e,pick:"pickLineLayer"===e,viewModel:t,model:t.model}})}function m(t){t.classed(v.cn.axisExtentText,!0).attr("text-anchor","middle").style("cursor","default").style("user-select","none")}var g=t("./lines"),v=t("./constants"),y=t("../../lib"),b=t("d3"),x=t("../../components/drawing"),_=t("../../lib/gup").keyFun,w=t("../../lib/gup").repeat,M=t("../../lib/gup").unwrap;e.exports=function(t,e,r,n,i){function o(t){var e=t.selectAll("defs").data(w,_);e.enter().append("defs");var r=e.selectAll("#"+v.id.filterBarPattern).data(w,_);r.enter().append("pattern").attr("id",v.id.filterBarPattern).attr("patternUnits","userSpaceOnUse"),r.attr("x",-v.bar.width).attr("width",v.bar.capturewidth).attr("height",function(t){return t.model.height});var n=r.selectAll("rect").data(w,_);n.enter().append("rect").attr("shape-rendering","crispEdges"),n.attr("height",function(t){return t.model.height}).attr("width",v.bar.width).attr("x",v.bar.width/2).attr("fill",v.bar.fillcolor).attr("fill-opacity",v.bar.fillopacity).attr("stroke",v.bar.strokecolor).attr("stroke-opacity",v.bar.strokeopacity).attr("stroke-width",v.bar.strokewidth)}function s(t){return t.dimensions.some(function(t){return 0!==t.filter[0]||1!==t.filter[1]})}function l(t,e){for(var r=e.panels||(e.panels=[]),n=t.each(function(t){return t})[e.key].map(function(t){return t.__data__}),i=n.length-1,a=0;a<1;a++)for(var o=0;o=r||s>=n)return;var l=t.lineLayer.readPixel(o,n-1-s),u=0!==l[3],c=u?l[2]+256*(l[1]+256*l[0]):null,h={x:o,y:s,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:c};c!==z&&(u?i.hover(h):i.unhover&&i.unhover(h),z=c)}}),C.style("margin",function(t){var e=t.model.pad;return e.t+"px "+e.r+"px "+e.b+"px "+e.l+"px"}).attr("width",function(t){return t.model.canvasWidth}).attr("height",function(t){return t.model.canvasHeight}).style("width",function(t){ -return t.model.width+2*v.overdrag+"px"}).style("height",function(t){return t.model.height+"px"}).style("opacity",function(t){return t.pick?.01:1}),e.style("background","rgba(255, 255, 255, 0)");var D=e.selectAll("."+v.cn.parcoords).data(E,_);D.exit().remove(),D.enter().append("g").classed(v.cn.parcoords,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","none").call(o),D.attr("width",function(t){return t.model.width+t.model.pad.l+t.model.pad.r}).attr("height",function(t){return t.model.height+t.model.pad.t+t.model.pad.b}).attr("transform",function(t){return"translate("+t.model.translateX+","+t.model.translateY+")"});var P=D.selectAll("."+v.cn.parcoordsControlView).data(w,_);P.enter().append("g").classed(v.cn.parcoordsControlView,!0).style("box-sizing","content-box"),P.attr("transform",function(t){return"translate("+t.model.pad.l+","+t.model.pad.t+")"});var O=P.selectAll("."+v.cn.yAxis).data(function(t){return t.dimensions},_);O.enter().append("g").classed(v.cn.yAxis,!0).each(function(t){I.dimensions.push(t)}),P.each(function(t){c(O,t)}),C.each(function(t){t.lineLayer=g(this,t.model.lines,t.model.canvasWidth,t.model.canvasHeight,t.viewModel.dimensions,t.viewModel.panels,t.model.unitToColor,t.context,t.pick,v.scatter),t.viewModel[t.key]=t.lineLayer,I.renderers.push(function(){t.lineLayer.render(t.viewModel.panels,!0)}),t.lineLayer.render(t.viewModel.panels,!t.context)}),O.attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),O.call(b.behavior.drag().origin(function(t){return t}).on("drag",function(t){var e=t.parent;S=!1,T||(t.x=Math.max(-v.overdrag,Math.min(t.model.width+v.overdrag,b.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,O.sort(function(t,e){return t.x-e.x}).each(function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio}),c(O,e),O.filter(function(e){return 0!==Math.abs(t.xIndex-e.xIndex)}).attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),b.select(this).attr("transform","translate("+t.x+", 0)"),O.each(function(r,n,i){i===t.parent.key&&(e.dimensions[n]=r)}),e.contextLineLayer&&e.contextLineLayer.render(e.panels,!1,!s(e)),e.focusLineLayer.render&&e.focusLineLayer.render(e.panels))}).on("dragend",function(t){var e=t.parent;if(T)return void("ending"===T&&(T=!1));t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,c(O,e),b.select(this).attr("transform",function(t){return"translate("+t.x+", 0)"}),e.contextLineLayer&&e.contextLineLayer.render(e.panels,!1,!s(e)),e.focusLineLayer&&e.focusLineLayer.render(e.panels),e.pickLineLayer&&e.pickLineLayer.render(e.panels,!0),S=!0,i&&i.axesMoved&&i.axesMoved(e.key,e.dimensions.map(function(t){return t.crossfilterDimensionIndex}))})),O.exit().remove();var R=O.selectAll("."+v.cn.axisOverlays).data(w,_);R.enter().append("g").classed(v.cn.axisOverlays,!0),R.selectAll("."+v.cn.axis).remove();var F=R.selectAll("."+v.cn.axis).data(w,_);F.enter().append("g").classed(v.cn.axis,!0),F.each(function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,n=r.domain();b.select(this).call(b.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?n:null).tickFormat(t.ordinal?function(t){return t}:null).scale(r)),x.font(F.selectAll("text"),t.model.tickFont)}),F.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),F.selectAll("text").style("text-shadow","1px 1px 1px #fff, -1px -1px 1px #fff, 1px -1px 1px #fff, -1px 1px 1px #fff").style("cursor","default").style("user-select","none");var j=R.selectAll("."+v.cn.axisHeading).data(w,_);j.enter().append("g").classed(v.cn.axisHeading,!0);var N=j.selectAll("."+v.cn.axisTitle).data(w,_);N.enter().append("text").classed(v.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("user-select","none").style("pointer-events","auto"),N.attr("transform","translate(0,"+-v.axisTitleOffset+")").text(function(t){return t.label}).each(function(t){x.font(N,t.model.labelFont)});var B=R.selectAll("."+v.cn.axisExtent).data(w,_);B.enter().append("g").classed(v.cn.axisExtent,!0);var U=B.selectAll("."+v.cn.axisExtentTop).data(w,_);U.enter().append("g").classed(v.cn.axisExtentTop,!0),U.attr("transform","translate(0,"+-v.axisExtentOffset+")");var V=U.selectAll("."+v.cn.axisExtentTopText).data(w,_);V.enter().append("text").classed(v.cn.axisExtentTopText,!0).call(m),V.text(function(t){return h(t)(t.domainScale.domain().slice(-1)[0])}).each(function(t){x.font(V,t.model.rangeFont)});var H=B.selectAll("."+v.cn.axisExtentBottom).data(w,_);H.enter().append("g").classed(v.cn.axisExtentBottom,!0),H.attr("transform",function(t){return"translate(0,"+(t.model.height+v.axisExtentOffset)+")"});var q=H.selectAll("."+v.cn.axisExtentBottomText).data(w,_);q.enter().append("text").classed(v.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(m),q.text(function(t){return h(t)(t.domainScale.domain()[0])}).each(function(t){x.font(q,t.model.rangeFont)});var G=R.selectAll("."+v.cn.axisBrush).data(w,_),Y=G.enter().append("g").classed(v.cn.axisBrush,!0);G.each(function(t){t.brush||(t.brush=b.svg.brush().y(t.unitScale).on("brushstart",y).on("brush",k).on("brushend",A),0===t.filter[0]&&1===t.filter[1]||t.brush.extent(t.filter),b.select(this).call(t.brush))}),Y.selectAll("rect").attr("x",-v.bar.capturewidth/2).attr("width",v.bar.capturewidth),Y.selectAll("rect.extent").attr("fill","url(#"+v.id.filterBarPattern+")").style("cursor","ns-resize").filter(function(t){return 0===t.filter[0]&&1===t.filter[1]}).attr("y",-100),Y.selectAll(".resize rect").attr("height",v.bar.handleheight).attr("opacity",0).style("visibility","visible"),Y.selectAll(".resize.n rect").style("cursor","n-resize").attr("y",v.bar.handleoverlap-v.bar.handleheight),Y.selectAll(".resize.s rect").style("cursor","s-resize").attr("y",v.bar.handleoverlap);var W=!1,X=!1;return I}},{"../../components/drawing":628,"../../lib":728,"../../lib/gup":725,"./constants":1001,"./lines":1004,d3:122}],1006:[function(t,e,r){"use strict";var n=t("./parcoords");e.exports=function(t,e){var r=t._fullLayout,i=r._paper,a=r._paperdiv,o={},s={},l=r._size;e.forEach(function(e,r){o[r]=t.data[r].dimensions,s[r]=t.data[r].dimensions.slice()});var u=function(e,r,n){var i=s[e][r],a=i.constraintrange;a&&2===a.length||(a=i.constraintrange=[]),a[0]=n[0],a[1]=n[1],t.emit("plotly_restyle")},c=function(e){t.emit("plotly_hover",e)},h=function(e){t.emit("plotly_unhover",e)},f=function(e,r){function n(t){return!("visible"in t)||t.visible}function i(t,e,r){var n=e.indexOf(r),i=t.indexOf(n);return-1===i&&(i+=e.length),i}var a=function(t){return function(e,n){return i(r,t,e)-i(r,t,n)}}(s[e].filter(n));o[e].sort(a),s[e].filter(function(t){return!n(t)}).sort(function(t){return s[e].indexOf(t)}).forEach(function(t){o[e].splice(o[e].indexOf(t),1),o[e].splice(s[e].indexOf(t),0,t)}),t.emit("plotly_restyle")};n(a,i,e,{width:l.w,height:l.h,margin:{t:l.t,r:l.r,b:l.b,l:l.l}},{filterChanged:u,hover:c,unhover:h,axesMoved:f})}},{"./parcoords":1005}],1007:[function(t,e,r){"use strict";var n=t("../../components/color/attributes"),i=t("../../plots/font_attributes"),a=t("../../plots/attributes"),o=t("../../lib/extend").extendFlat,s=i({editType:"calc",colorEditType:"style"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:n.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},editType:"calc"},text:{valType:"data_array",editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:o({},a.hoverinfo,{flags:["label","text","value","percent","name"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc"},textfont:o({},s,{}),insidetextfont:o({},s,{}),outsidetextfont:o({},s,{}),domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},y:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},editType:"calc"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"number",min:-360,max:360,dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}},{"../../components/color/attributes":603,"../../lib/extend":717,"../../plots/attributes":770,"../../plots/font_attributes":796}],1008:[function(t,e,r){"use strict";function n(t,e){for(var r=[],n=0;n")}return m};var l},{"../../components/color":604,"./helpers":1011,"fast-isnumeric":131,tinycolor2:534}],1010:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r,a){function o(r,a){return n.coerce(t,e,i,r,a)}var s=n.coerceFont,l=o("values");if(!Array.isArray(l)||!l.length)return void(e.visible=!1);var u=o("labels");Array.isArray(u)||(o("label0"),o("dlabel")),o("marker.line.width")&&o("marker.line.color");var c=o("marker.colors");Array.isArray(c)||(e.marker.colors=[]),o("scalegroup");var h=o("text"),f=o("textinfo",Array.isArray(h)?"text+percent":"percent");if(o("hovertext"),f&&"none"!==f){var d=o("textposition"),p=Array.isArray(d)||"auto"===d,m=p||"inside"===d,g=p||"outside"===d;if(m||g){var v=s(o,"textfont",a.font);m&&s(o,"insidetextfont",v),g&&s(o,"outsidetextfont",v)}}o("domain.x"),o("domain.y"),o("hole"),o("sort"),o("direction"),o("rotation"),o("pull")}},{"../../lib":728,"./attributes":1007}],1011:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)}},{"../../lib":728}],1012:[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":1007,"./base_plot":1008,"./calc":1009,"./defaults":1010,"./layout_attributes":1013,"./layout_defaults":1014,"./plot":1015,"./style":1016,"./style_one":1017}],1013:[function(t,e,r){"use strict";e.exports={hiddenlabels:{valType:"data_array",editType:"calc"}}},{}],1014:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){!function(r,a){n.coerce(t,e,i,r,a)}("hiddenlabels")}},{"../../lib":728,"./layout_attributes":1013}],1015:[function(t,e,r){"use strict";function n(t,e,r){var n=Math.sqrt(t.width*t.width+t.height*t.height),a=t.width/t.height,o=Math.PI*Math.min(e.v/r.vTotal,.5),s=1-r.trace.hole,l=i(e,r),u={scale:l*r.r*2/n,rCenter:1-l,rotate:0};if(u.scale>=1)return u;var c=a+1/(2*Math.tan(o)),h=r.r*Math.min(1/(Math.sqrt(c*c+.5)+c),s/(Math.sqrt(a*a+s/2)+a)),f={scale:2*h/t.height,rCenter:Math.cos(h/r.r)-h*a/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},d=1/a,p=d+1/(2*Math.tan(o)),m=r.r*Math.min(1/(Math.sqrt(p*p+.5)+p),s/(Math.sqrt(d*d+s/2)+d)),g={scale:2*m/t.width,rCenter:Math.cos(m/r.r)-m/a/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},v=g.scale>f.scale?g:f;return u.scale<1&&v.scale>u.scale?v:u}function i(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 a(t,e){var r=e.pxmid[0],n=e.pxmid[1],i=t.width/2,a=t.height/2;return r<0&&(i*=-1),n<0&&(a*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(a)*(i>0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}function o(t,e){function r(t,e){return t.pxmid[1]-e.pxmid[1]}function n(t,e){return e.pxmid[1]-t.pxmid[1]}var i,a,o,s,l,u,c,h,f,d,p,m,g;for(a=0;a<2;a++)for(o=a?r:n,l=a?Math.max:Math.min,c=a?1:-1,i=0;i<2;i++){for(s=i?Math.max:Math.min,u=i?1:-1,h=t[a][i],h.sort(o),f=t[1-a][i],d=f.concat(h),m=[],p=0;p0&&(t.labelExtraY=b),Array.isArray(e.pull))for(i=0;i=e.pull[o.i]||((t.pxmid[1]-o.pxmid[1])*c>0?(h=o.cyFinal+l(o.px0[1],o.px1[1]),(b=h-g-t.labelExtraY)*c>0&&(t.labelExtraY+=b)):(v+t.labelExtraY-y)*c>0&&(n=3*u*Math.abs(i-d.indexOf(t)),f=o.cxFinal+s(o.px0[0],o.px1[0]),(p=f+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*u>0&&(t.labelExtraX+=p)))}(m[p],v)}}}function s(t,e){var r,n,i,a,o,s,l,c,h,f,d=[];for(i=0;ic&&(c=s.pull[a]);o.r=Math.min(r/u(s.tilt,Math.sin(l),s.depth),n/u(s.tilt,Math.cos(l),s.depth))/(2+2*c),o.cx=e.l+e.w*(s.domain.x[1]+s.domain.x[0])/2,o.cy=e.t+e.h*(2-s.domain.y[1]-s.domain.y[0])/2,s.scalegroup&&-1===d.indexOf(s.scalegroup)&&d.push(s.scalegroup)}for(a=0;ah.vTotal/2?1:0)}function u(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 c=t("d3"),h=t("../../components/fx"),f=t("../../components/color"),d=t("../../components/drawing"),p=t("../../lib/svg_text_utils"),m=t("./helpers");e.exports=function(t,e){var r=t._fullLayout;s(e,r._size);var u=r._pielayer.selectAll("g.trace").data(e);u.enter().append("g").attr({"stroke-linejoin":"round",class:"trace"}),u.exit().remove(),u.order(),u.each(function(e){var s=c.select(this),u=e[0],g=u.trace,v=(g.depth||0)*u.r*Math.sin(0)/2,y=g.tiltaxis||0,b=y*Math.PI/180,x=[v*Math.sin(b),v*Math.cos(b)],_=u.r*Math.cos(0),w=s.selectAll("g.part").data(g.tilt?["top","sides"]:["top"]);w.enter().append("g").attr("class",function(t){return t+" part"}),w.exit().remove(),w.order(),l(e),s.selectAll(".top").each(function(){var s=c.select(this).selectAll("g.slice").data(e);s.enter().append("g").classed("slice",!0),s.exit().remove();var l=[[[],[]],[[],[]]],v=!1;s.each(function(e){function o(n){n.originalEvent=c.event;var a=t._fullLayout,o=t._fullData[g.index],s=h.castHoverinfo(o,a,e.i);if("all"===s&&(s="label+text+value+percent+name"),t._dragging||!1===a.hovermode||"none"===s||"skip"===s||!s)return void h.hover(t,n,"pie");var l=i(e,u),f=w+e.pxmid[0]*(1-l),d=M+e.pxmid[1]*(1-l),p=r.separators,v=[];-1!==s.indexOf("label")&&v.push(e.label),-1!==s.indexOf("text")&&(o.hovertext?v.push(Array.isArray(o.hovertext)?o.hovertext[e.i]:o.hovertext):o.text&&o.text[e.i]&&v.push(o.text[e.i])),-1!==s.indexOf("value")&&v.push(m.formatPieValue(e.v,p)),-1!==s.indexOf("percent")&&v.push(m.formatPiePercent(e.v/u.vTotal,p)),h.loneHover({x0:f-l*u.r,x1:f+l*u.r,y:d,text:v.join("
"),name:-1!==s.indexOf("name")?o.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:h.castHoverOption(g,e.i,"bgcolor")||e.color,borderColor:h.castHoverOption(g,e.i,"bordercolor"),fontFamily:h.castHoverOption(g,e.i,"font.family"),fontSize:h.castHoverOption(g,e.i,"font.size"),fontColor:h.castHoverOption(g,e.i,"font.color")},{container:a._hoverlayer.node(),outerContainer:a._paper.node(),gd:t}),h.hover(t,n,"pie"),T=!0}function s(e){e.originalEvent=c.event,t.emit("plotly_unhover",{event:c.event,points:[e]}),T&&(h.loneUnhover(r._hoverlayer.node()),T=!1)}function f(){t._hoverdata=[e],t._hoverdata.trace=u.trace,h.click(t,c.event)}function b(t,r,n,i){return"a"+i*u.r+","+i*_+" "+y+" "+e.largeArc+(n?" 1 ":" 0 ")+i*(r[0]-t[0])+","+i*(r[1]-t[1])}if(e.hidden)return void c.select(this).selectAll("path,g").remove();e.pointNumber=e.i,e.curveNumber=g.index,l[e.pxmid[1]<0?0:1][e.pxmid[0]<0?0:1].push(e);var w=u.cx+x[0],M=u.cy+x[1],k=c.select(this),A=k.selectAll("path.surface").data([e]),T=!1;if(A.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),k.select("path.textline").remove(),k.on("mouseover",o).on("mouseout",s).on("click",f),g.pull){var S=+(Array.isArray(g.pull)?g.pull[e.i]:g.pull)||0;S>0&&(w+=S*e.pxmid[0],M+=S*e.pxmid[1])}e.cxFinal=w,e.cyFinal=M;var E=g.hole;if(e.v===u.vTotal){var L="M"+(w+e.px0[0])+","+(M+e.px0[1])+b(e.px0,e.pxmid,!0,1)+b(e.pxmid,e.px0,!0,1)+"Z";E?A.attr("d","M"+(w+E*e.px0[0])+","+(M+E*e.px0[1])+b(e.px0,e.pxmid,!1,E)+b(e.pxmid,e.px0,!1,E)+"Z"+L):A.attr("d",L)}else{var C=b(e.px0,e.px1,!0,1);if(E){var I=1-E;A.attr("d","M"+(w+E*e.px1[0])+","+(M+E*e.px1[1])+b(e.px1,e.px0,!1,E)+"l"+I*e.px0[0]+","+I*e.px0[1]+C+"Z")}else A.attr("d","M"+w+","+M+"l"+e.px0[0]+","+e.px0[1]+C+"Z")}var z=Array.isArray(g.textposition)?g.textposition[e.i]:g.textposition,D=k.selectAll("g.slicetext").data(e.text&&"none"!==z?[0]:[]);D.enter().append("g").classed("slicetext",!0),D.exit().remove(),D.each(function(){var r=c.select(this).selectAll("text").data([0]);r.enter().append("text").attr("data-notex",1),r.exit().remove(),r.text(e.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(d.font,"outside"===z?g.outsidetextfont:g.insidetextfont).call(p.convertToTspans,t);var i,o=d.bBox(r.node());"outside"===z?i=a(o,e):(i=n(o,e,u),"auto"===z&&i.scale<1&&(r.call(d.font,g.outsidetextfont),g.outsidetextfont.family===g.insidetextfont.family&&g.outsidetextfont.size===g.insidetextfont.size||(o=d.bBox(r.node())),i=a(o,e)));var s=w+e.pxmid[0]*i.rCenter+(i.x||0),l=M+e.pxmid[1]*i.rCenter+(i.y||0);i.outside&&(e.yLabelMin=l-o.height/2,e.yLabelMid=l,e.yLabelMax=l+o.height/2,e.labelExtraX=0,e.labelExtraY=0,v=!0),r.attr("transform","translate("+s+","+l+")"+(i.scale<1?"scale("+i.scale+")":"")+(i.rotate?"rotate("+i.rotate+")":"")+"translate("+-(o.left+o.right)/2+","+-(o.top+o.bottom)/2+")")})}),v&&o(l,g),s.each(function(t){if(t.labelExtraX||t.labelExtraY){var e=c.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],i=t.cyFinal+t.pxmid[1],a="M"+n+","+i,o=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var s=t.labelExtraX*t.pxmid[1]/t.pxmid[0],l=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);Math.abs(s)>Math.abs(l)?a+="l"+l*t.pxmid[0]/t.pxmid[1]+","+l+"H"+(n+t.labelExtraX+o):a+="l"+t.labelExtraX+","+s+"v"+(l-s)+"h"+o}else a+="V"+(t.yLabelMid+t.labelExtraY)+"h"+o;e.append("path").classed("textline",!0).call(f.stroke,g.outsidetextfont.color).attr({"stroke-width":Math.min(2,g.outsidetextfont.size/8),d:a,fill:"none"})}})})}),setTimeout(function(){u.selectAll("tspan").each(function(){var t=c.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{"../../components/color":604,"../../components/drawing":628,"../../components/fx":645,"../../lib/svg_text_utils":750,"./helpers":1011,d3:122}],1016:[function(t,e,r){"use strict";var n=t("d3"),i=t("./style_one");e.exports=function(t){t._fullLayout._pielayer.selectAll(".trace").each(function(t){var e=t[0],r=e.trace,a=n.select(this);a.style({opacity:r.opacity}),a.selectAll(".top path.surface").each(function(t){n.select(this).call(i,t,r)})})}},{"./style_one":1017,d3:122}],1017:[function(t,e,r){"use strict";var n=t("../../components/color");e.exports=function(t,e,r){var i=r.marker.line.color;Array.isArray(i)&&(i=i[e.i]||n.defaultLine);var a=r.marker.line.width||0;Array.isArray(a)&&(a=a[e.i]||0),t.style({"stroke-width":a}).call(n.fill,e.color).call(n.stroke,i)}},{"../../components/color":604}],1018:[function(t,e,r){"use strict";var n=t("../scattergl/attributes");e.exports={x:n.x,y:n.y,xy:{valType:"data_array",editType:"calc"},indices:{valType:"data_array",editType:"calc"},xbounds:{valType:"data_array",editType:"calc"},ybounds:{valType:"data_array",editType:"calc"},text:n.text,marker:{color:{valType:"color",arrayOk:!1,editType:"calc"},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,editType:"calc"},blend:{valType:"boolean",dflt:null,editType:"calc"},sizemin:{valType:"number",min:.1,max:2,dflt:.5,editType:"calc"},sizemax:{valType:"number",min:.1,dflt:20,editType:"calc"},border:{color:{valType:"color",arrayOk:!1,editType:"calc"},arearatio:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},editType:"calc"},editType:"calc"}}},{"../scattergl/attributes":1077}],1019:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.type="pointcloud",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=a(t.glplot,this.pointcloudOptions),this.pointcloud._trace=this}function i(t,e){var r=new n(t,e.uid);return r.update(e),r}var a=t("gl-pointcloud2d"),o=t("../../lib/str2rgbarray"),s=t("../scatter/get_trace_color"),l=["xaxis","yaxis"],u=n.prototype;u.handlePick=function(t){var e=this.idToIndex[t.pointId];return{trace:this,dataCoord:t.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*e],this.pickXYData[2*e+1]]:[this.pickXData[e],this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:this.color,name:this.name,pointIndex:e,hoverinfo:this.hoverinfo}},u.update=function(t){this.index=t.index,this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.updateFast(t),this.color=s(t,{})},u.updateFast=function(t){var e,r,n,i,a,s,l=this.xData=this.pickXData=t.x,u=this.yData=this.pickYData=t.y,c=this.pickXYData=t.xy,h=t.xbounds&&t.ybounds,f=t.indices,d=this.bounds;if(c){if(n=c,e=c.length>>>1,h)d[0]=t.xbounds[0],d[2]=t.xbounds[1],d[1]=t.ybounds[0],d[3]=t.ybounds[1];else for(s=0;sd[2]&&(d[2]=i),ad[3]&&(d[3]=a);if(f)r=f;else for(r=new Int32Array(e),s=0;sd[2]&&(d[2]=i),ad[3]&&(d[3]=a);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var p=o(t.marker.color),m=o(t.marker.border.color),g=t.opacity*t.marker.opacity;p[3]*=g,this.pointcloudOptions.color=p;var v=t.marker.blend;if(null===v){v=l.length<100||u.length<100}this.pointcloudOptions.blend=v,m[3]*=g,this.pointcloudOptions.borderColor=m;var y=t.marker.sizemin,b=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=y,this.pointcloudOptions.sizeMax=b,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions),this.expandAxesFast(d,b/2)},u.expandAxesFast=function(t,e){for(var r,n,i,a=e||.5,o=0;o<2;o++)r=this.scene[l[o]],n=r._min,n||(n=[]),n.push({val:t[o],pad:a}),i=r._max,i||(i=[]),i.push({val:t[o+2],pad:a})},u.dispose=function(){this.pointcloud.dispose()},e.exports=i},{"../../lib/str2rgbarray":749,"../scatter/get_trace_color":1040,"gl-pointcloud2d":230}],1020:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){function a(r,a){return n.coerce(t,e,i,r,a)}a("x"),a("y"),a("xbounds"),a("ybounds"),t.xy&&t.xy instanceof Float32Array&&(e.xy=t.xy),t.indices&&t.indices instanceof Int32Array&&(e.indices=t.indices),a("text"),a("marker.color",r),a("marker.opacity"),a("marker.blend"),a("marker.sizemin"),a("marker.sizemax"),a("marker.border.color",r),a("marker.border.arearatio")}},{"../../lib":728,"./attributes":1018}],1021:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("../scatter3d/calc"),n.plot=t("./convert"),n.moduleType="trace",n.name="pointcloud",n.basePlotModule=t("../../plots/gl2d"),n.categories=["gl2d","showLegend"],n.meta={},e.exports=n},{"../../plots/gl2d":808,"../scatter3d/calc":1056,"./attributes":1018,"./convert":1019,"./defaults":1020}],1022:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/attributes"),a=t("../../components/color/attributes"),o=t("../../components/fx/attributes"),s=t("../../lib/extend").extendFlat,l=t("../../plot_api/edit_types").overrideAll;e.exports=l({hoverinfo:s({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),hoverlabel:o.hoverlabel,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]}},orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s"},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:n({}),node:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20}},link:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]}}},"calc","nested")},{"../../components/color/attributes":603,"../../components/fx/attributes":637,"../../lib/extend":717,"../../plot_api/edit_types":756,"../../plots/attributes":770,"../../plots/font_attributes":796}],1023:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../plots/plots"),a=t("./plot"),o=t("../../components/fx/layout_attributes");r.name="sankey",r.attr="type",r.baseLayoutAttrOverrides=n({hoverlabel:o.hoverlabel},"plot","nested"),r.plot=function(t){var e=i.getSubplotCalcData(t.calcdata,"sankey","sankey");e.length&&a(t,e)},r.clean=function(t,e,r,n){var i=n._has&&n._has("sankey"),a=e._has&&e._has("sankey");i&&!a&&n._paperdiv.selectAll(".sankey").remove()}},{"../../components/fx/layout_attributes":646,"../../plot_api/edit_types":756,"../../plots/plots":831,"./plot":1028}],1024:[function(t,e,r){"use strict";function n(t,e,r){for(var n=t.map(function(){return[]}),a=0;a1})}var i=t("strongly-connected-components"),a=t("../../lib"),o=t("../../lib/gup").wrap;e.exports=function(t,e){return n(e.node.label,e.link.source,e.link.target)&&(a.error("Circularity is present in the Sankey data. Removing all nodes and links."),e.link.label=[],e.link.source=[],e.link.target=[],e.link.value=[],e.link.color=[],e.node.label=[],e.node.color=[]),o({link:e.link,node:e.node})}},{"../../lib":728,"../../lib/gup":725,"strongly-connected-components":528}],1025:[function(t,e,r){"use strict";e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"cubic-in-out",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeCapture:"node-capture",nodeCentered:"node-entered",nodeLabelGuide:"node-label-guide",nodeLabel:"node-label",nodeLabelTextPath:"node-label-text-path"}}},{}],1026:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../components/color/attributes").defaults,o=t("../../components/color"),s=t("tinycolor2");e.exports=function(t,e,r,l){function u(r,a){return n.coerce(t,e,i,r,a)}u("node.label"),u("node.pad"),u("node.thickness"),u("node.line.color"),u("node.line.width");var c=function(t){return a[t%a.length]};u("node.color",e.node.label.map(function(t,e){return o.addOpacity(c(e),.8)})),u("link.label"),u("link.source"),u("link.target"),u("link.value"),u("link.line.color"),u("link.line.width"),u("link.color",e.link.value.map(function(){return s(l.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)"})),u("domain.x"),u("domain.y"),u("orientation"),u("valueformat"),u("valuesuffix"),u("arrangement"),n.coerceFont(u,"textfont",n.extendFlat({},l.font));var h=function(t,r){return-1===e.link.source.indexOf(r)&&-1===e.link.target.indexOf(r)} -;e.node.label.some(h)&&n.warn("Some of the nodes are neither sources nor targets, they will not be displayed.")}},{"../../components/color":604,"../../components/color/attributes":603,"../../lib":728,"./attributes":1022,tinycolor2:534}],1027:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.moduleType="trace",n.name="sankey",n.basePlotModule=t("./base_plot"),n.categories=["noOpacity"],n.meta={},e.exports=n},{"./attributes":1022,"./base_plot":1023,"./calc":1024,"./defaults":1026,"./plot":1028}],1028:[function(t,e,r){"use strict";function n(t){return""!==t}function i(t,e){return t.filter(function(t){return t.key===e.traceId})}function a(t,e){p.select(t).select("path").style("fill-opacity",e),p.select(t).select("rect").style("fill-opacity",e)}function o(t){p.select(t).select("text.name").style("fill","black")}function s(t){return function(e){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function l(t){return function(e){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function u(t,e,r){e&&r&&i(r,e).selectAll("."+b.sankeyLink).filter(s(e)).call(h.bind(0,e,r,!1))}function c(t,e,r){e&&r&&i(r,e).selectAll("."+b.sankeyLink).filter(s(e)).call(f.bind(0,e,r,!1))}function h(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",.4),a&&i(e,t).selectAll("."+b.sankeyLink).filter(function(t){return t.link.label===a}).style("fill-opacity",.4),r&&i(e,t).selectAll("."+b.sankeyNode).filter(l(t)).call(u)}function f(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",function(t){return t.tinyColorAlpha}),a&&i(e,t).selectAll("."+b.sankeyLink).filter(function(t){return t.link.label===a}).style("fill-opacity",function(t){return t.tinyColorAlpha}),r&&i(e,t).selectAll(b.sankeyNode).filter(l(t)).call(c)}function d(t,e){var r=t.hoverlabel||{},n=y.nestedProperty(r,e).get();return!Array.isArray(n)&&n}var p=t("d3"),m=t("./render"),g=t("../../components/fx"),v=t("../../components/color"),y=t("../../lib"),b=t("./constants").cn;e.exports=function(t,e){var r=t._fullLayout,i=r._paper,s=r._size,l=function(e,r){var n=r.link;n.originalEvent=p.event,t._hoverdata=[n],g.click(t,{target:!0})},y=function(e,r,n){var i=r.link;i.originalEvent=p.event,p.select(e).call(h.bind(0,r,n,!0)),g.hover(t,i,"sankey")},x=function(e,i){var s=i.link.trace,l=t._fullLayout._paperdiv.node().getBoundingClientRect(),u=e.getBoundingClientRect(),c=u.left+u.width/2,h=u.top+u.height/2,f=g.loneHover({x:c-l.left,y:h-l.top,name:p.format(i.valueFormat)(i.link.value)+i.valueSuffix,text:[i.link.label||"",["Source:",i.link.source.label].join(" "),["Target:",i.link.target.label].join(" ")].filter(n).join("
"),color:d(s,"bgcolor")||v.addOpacity(i.tinyColorHue,1),borderColor:d(s,"bordercolor"),fontFamily:d(s,"font.family"),fontSize:d(s,"font.size"),fontColor:d(s,"font.color"),idealAlign:p.event.x"),color:d(s,"bgcolor")||i.tinyColorHue,borderColor:d(s,"bordercolor"),fontFamily:d(s,"font.family"),fontSize:d(s,"font.size"),fontColor:d(s,"font.color"),idealAlign:"left"},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t});a(v,.85),o(v)},A=function(e,n,i){p.select(e).call(c,n,i),t.emit("plotly_unhover",{event:p.event,points:[n.node]}),g.loneUnhover(r._hoverlayer.node())};m(i,e,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},{linkEvents:{hover:y,follow:x,unhover:_,select:l},nodeEvents:{hover:M,follow:k,unhover:A,select:w}})}},{"../../components/color":604,"../../components/fx":645,"../../lib":728,"./constants":1025,"./render":1029,d3:122}],1029:[function(t,e,r){"use strict";function n(t){var e,r=[];for(e=0;e1||t.linkLineWidth>0}function v(t){return"translate("+t.translateX+","+t.translateY+")"+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function y(t){return"translate("+(t.horizontal?0:t.labelY)+" "+(t.horizontal?t.labelY:0)+")"}function b(t){return C.svg.line()([[t.horizontal?t.left?-t.sizeAcross:t.visibleWidth+L.nodeTextOffsetHorizontal:L.nodeTextOffsetHorizontal,0],[t.horizontal?t.left?-L.nodeTextOffsetHorizontal:t.sizeAcross:t.visibleHeight-L.nodeTextOffsetHorizontal,0]])}function x(t){return t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)"}function _(t){return t.horizontal?"scale(1 1)":"scale(-1 1)"}function w(t){return t.darkBackground&&!t.horizontal?"rgb(255,255,255)":"rgb(0,0,0)"}function M(t){return t.horizontal&&t.left?"100%":"0%"}function k(t,e,r){t.on(".basic",null).on("mouseover.basic",function(t){t.interactionState.dragInProgress||(r.hover(this,t,e),t.interactionState.hovered=[this,t])}).on("mousemove.basic",function(t){t.interactionState.dragInProgress||(r.follow(this,t),t.interactionState.hovered=[this,t])}).on("mouseout.basic",function(t){t.interactionState.dragInProgress||(r.unhover(this,t,e),t.interactionState.hovered=!1)}).on("click.basic",function(t){t.interactionState.hovered&&(r.unhover(this,t,e),t.interactionState.hovered=!1),t.interactionState.dragInProgress||r.select(this,t,e)})}function A(t,e,r){var n=C.behavior.drag().origin(function(t){return t.node}).on("dragstart",function(n){if("fixed"!==n.arrangement&&(R.raiseToTop(this),n.interactionState.dragInProgress=n.node,i(n.node),n.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,n.interactionState.hovered),n.interactionState.hovered=!1),"snap"===n.arrangement)){var a=n.traceId+"|"+Math.floor(n.node.originalX);n.forceLayouts[a]?n.forceLayouts[a].alpha(1):T(t,a,n),S(t,e,n,a)}}).on("drag",function(r){if("fixed"!==r.arrangement){var n=C.event.x,o=C.event.y;"snap"===r.arrangement?(r.node.x=n,r.node.y=o):("freeform"===r.arrangement&&(r.node.x=n),r.node.y=Math.max(r.node.dy/2,Math.min(r.size-r.node.dy/2,o))),i(r.node),"snap"!==r.arrangement&&(r.sankey.relayout(),p(t.filter(a(r)),e))}}).on("dragend",function(t){t.interactionState.dragInProgress=!1});t.on(".drag",null).call(n)}function T(t,e,r){var n=r.sankey.nodes().filter(function(t){return t.originalX===r.node.originalX});r.forceLayouts[e]=O.forceSimulation(n).alphaDecay(0).force("collide",O.forceCollide().radius(function(t){return t.dy/2+r.nodePad/2}).strength(1).iterations(L.forceIterations)).force("constrain",E(t,e,n,r)).stop()}function S(t,e,r,n){window.requestAnimationFrame(function i(){for(var o=0;o0&&window.requestAnimationFrame(i)})}function E(t,e,r,n){return function(){for(var t=0,i=0;i0&&n.forceLayouts[e].alpha(0)}}var L=t("./constants"),C=t("d3"),I=t("tinycolor2"),z=t("../../components/color"),D=t("../../components/drawing"),P=t("@plotly/d3-sankey").sankey,O=t("d3-force"),R=t("../../lib"),F=t("../../lib/gup").keyFun,j=t("../../lib/gup").repeat,N=t("../../lib/gup").unwrap;e.exports=function(t,e,r,i){var a=t.selectAll("."+L.cn.sankey).data(e.filter(function(t){return N(t).trace.visible}).map(l.bind(null,r)),F);a.exit().remove(),a.enter().append("g").classed(L.cn.sankey,!0).style("box-sizing","content-box").style("position","absolute").style("left",0).style("shape-rendering","geometricPrecision").style("pointer-events","auto").style("box-sizing","content-box").attr("transform",v),a.transition().ease(L.ease).duration(L.duration).attr("transform",v);var o=a.selectAll("."+L.cn.sankeyLinks).data(j,F);o.enter().append("g").classed(L.cn.sankeyLinks,!0).style("fill","none");var s=o.selectAll("."+L.cn.sankeyLink).data(function(t){var e={};return t.sankey.links().filter(function(t){return t.value}).map(u.bind(null,e,t))},F);s.enter().append("path").classed(L.cn.sankeyLink,!0).attr("d",f).call(k,a,i.linkEvents),s.style("stroke",function(t){return g(t)?z.tinyRGB(I(t.linkLineColor)):t.tinyColorHue}).style("stroke-opacity",function(t){return g(t)?z.opacity(t.linkLineColor):t.tinyColorAlpha}).style("stroke-width",function(t){return g(t)?t.linkLineWidth:1}).style("fill",function(t){return t.tinyColorHue}).style("fill-opacity",function(t){return t.tinyColorAlpha}),s.transition().ease(L.ease).duration(L.duration).attr("d",f),s.exit().transition().ease(L.ease).duration(L.duration).style("opacity",0).remove();var d=a.selectAll("."+L.cn.sankeyNodeSet).data(j,F);d.enter().append("g").classed(L.cn.sankeyNodeSet,!0),d.style("cursor",function(t){switch(t.arrangement){case"fixed":return"default";case"perpendicular":return"ns-resize";default:return"move"}});var p=d.selectAll("."+L.cn.sankeyNode).data(function(t){var e=t.sankey.nodes(),r={};return n(e),e.filter(function(t){return t.value}).map(c.bind(null,r,t))},F);p.enter().append("g").classed(L.cn.sankeyNode,!0).call(h).call(k,a,i.nodeEvents),p.call(A,s,i),p.transition().ease(L.ease).duration(L.duration).call(h),p.exit().transition().ease(L.ease).duration(L.duration).style("opacity",0).remove();var T=p.selectAll("."+L.cn.nodeRect).data(j);T.enter().append("rect").classed(L.cn.nodeRect,!0).call(m),T.style("stroke-width",function(t){return t.nodeLineWidth}).style("stroke",function(t){return z.tinyRGB(I(t.nodeLineColor))}).style("stroke-opacity",function(t){return z.opacity(t.nodeLineColor)}).style("fill",function(t){return t.tinyColorHue}).style("fill-opacity",function(t){return t.tinyColorAlpha}),T.transition().ease(L.ease).duration(L.duration).call(m);var S=p.selectAll("."+L.cn.nodeCapture).data(j);S.enter().append("rect").classed(L.cn.nodeCapture,!0).style("fill-opacity",0),S.attr("x",function(t){return t.zoneX}).attr("y",function(t){return t.zoneY}).attr("width",function(t){return t.zoneWidth}).attr("height",function(t){return t.zoneHeight});var E=p.selectAll("."+L.cn.nodeCentered).data(j);E.enter().append("g").classed(L.cn.nodeCentered,!0).attr("transform",y),E.transition().ease(L.ease).duration(L.duration).attr("transform",y);var C=E.selectAll("."+L.cn.nodeLabelGuide).data(j);C.enter().append("path").classed(L.cn.nodeLabelGuide,!0).attr("id",function(t){return t.uniqueNodeLabelPathId}).attr("d",b).attr("transform",x),C.transition().ease(L.ease).duration(L.duration).attr("d",b).attr("transform",x);var P=E.selectAll("."+L.cn.nodeLabel).data(j);P.enter().append("text").classed(L.cn.nodeLabel,!0).attr("transform",_).style("user-select","none").style("cursor","default").style("fill","black"),P.style("text-shadow",function(t){return t.horizontal?"-1px 1px 1px #fff, 1px 1px 1px #fff, 1px -1px 1px #fff, -1px -1px 1px #fff":"none"}).each(function(t){D.font(P,t.textFont)}),P.transition().ease(L.ease).duration(L.duration).attr("transform",_);var O=P.selectAll("."+L.cn.nodeLabelTextPath).data(j);O.enter().append("textPath").classed(L.cn.nodeLabelTextPath,!0).attr("alignment-baseline","middle").attr("xlink:href",function(t){return"#"+t.uniqueNodeLabelPathId}).attr("startOffset",M).style("fill",w),O.text(function(t){return t.horizontal||t.node.dy>5?t.node.label:""}).attr("text-anchor",function(t){return t.horizontal&&t.left?"end":"start"}),O.transition().ease(L.ease).duration(L.duration).attr("startOffset",M).style("fill",w)}},{"../../components/color":604,"../../components/drawing":628,"../../lib":728,"../../lib/gup":725,"./constants":1025,"@plotly/d3-sankey":38,d3:122,"d3-force":118,tinycolor2:534}],1030:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rm&&d.splice(m,d.length-m),p.length>m&&p.splice(m,p.length-m);var g={padded:!0},v={padded:!0};if(o.hasMarkers(e)){if(r=e.marker,u=r.size,Array.isArray(u)){var y={type:"linear"};i.setConvert(y),u=y.makeCalcdata(e.marker,"size"),u.length>m&&u.splice(m,u.length-m)}var b,x=1.6*(e.marker.sizeref||1);b="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=v.ppad=Array.isArray(u)?u.map(b):b(u)}s(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||d[0]===d[m-1]&&p[0]===p[m-1]?e.error_y.visible||-1===["tonexty","tozeroy"].indexOf(e.fill)&&(o.hasMarkers(e)||o.hasText(e))||(g.padded=!1,g.ppad=0):g.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||d[0]===d[m-1]&&p[0]===p[m-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(v.padded=!1):v.tozero=!0,i.expand(h,d,g),i.expand(f,p,v);var _=new Array(m);for(c=0;c=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],1034:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l=r.marker,u="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+u).remove(),void 0===l||!l.showscale)return void a.autoMargin(t,u);var c=l.color,h=l.cmin,f=l.cmax;n(h)||(h=i.aggNums(Math.min,null,c)),n(f)||(f=i.aggNums(Math.max,null,c));var d=e[0].t.cb=s(t,u),p=o.makeColorScaleFunc(o.extractScale(l.colorscale,h,f),{noNumericCheck:!0});d.fillcolor(p).filllevels({start:h,end:f,size:(f-h)/254}).options(l.colorbar)()}},{"../../components/colorbar/draw":607,"../../components/colorscale":618,"../../lib":728,"../../plots/plots":831,"fast-isnumeric":131}],1035:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),a=t("./subtypes");e.exports=function(t){a.hasLines(t)&&n(t,"line")&&i(t,t.line.color,"line","c"),a.hasMarkers(t)&&(n(t,"marker")&&i(t,t.marker.color,"marker","c"),n(t,"marker.line")&&i(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":610,"../../components/colorscale/has_colorscale":617,"./subtypes":1052}],1036:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20}},{}],1037:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("./constants"),o=t("./subtypes"),s=t("./xy_defaults"),l=t("./marker_defaults"),u=t("./line_defaults"),c=t("./line_shape_defaults"),h=t("./text_defaults"),f=t("./fillcolor_defaults"),d=t("../../components/errorbars/defaults");e.exports=function(t,e,r,p){function m(r,a){return n.coerce(t,e,i,r,a)}var g=s(t,e,p,m),v=gH!=O>=H&&(z=C[E-1][0],D=C[E][0],I=z+(D-z)*(H-P)/(O-P),N=Math.min(N,I),B=Math.max(B,I));N=Math.max(N,0),B=Math.min(B,d._length);var q=s.defaultLine;return s.opacity(f.fillcolor)?q=f.fillcolor:s.opacity((f.line||{}).color)&&(q=f.line.color),n.extendFlat(t,{distance:u+10,x0:N,x1:B,y0:H,y1:H,color:q}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":604,"../../components/errorbars":634,"../../components/fx":645,"../../lib":728,"./fill_hover_text":1038,"./get_trace_color":1040}],1042:[function(t,e,r){"use strict";var n={},i=t("./subtypes");n.hasLines=i.hasLines,n.hasMarkers=i.hasMarkers,n.hasText=i.hasText,n.isBubble=i.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","scatter-like"],n.meta={},e.exports=n},{"../../plots/cartesian":782,"./arrays_to_calcdata":1030,"./attributes":1031,"./calc":1032,"./clean_data":1033,"./colorbar":1034,"./defaults":1037,"./hover":1041,"./plot":1049,"./select":1050,"./style":1051,"./subtypes":1052}],1043:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,a,o,s){var l=(t.marker||{}).color;if(o("line.color",r),n(t,"line"))i(t,e,a,o,{prefix:"line.",cLetter:"c"});else{o("line.color",!Array.isArray(l)&&l||r)}o("line.width"),(s||{}).noDash||o("line.dash")}},{"../../components/colorscale/defaults":613,"../../components/colorscale/has_colorscale":617}],1044:[function(t,e,r){"use strict";var n=t("../../constants/numerical").BADNUM,i=t("../../lib"),a=i.segmentsIntersect,o=i.constrain,s=t("./constants");e.exports=function(t,e){function r(e){var r=O.c2p(t[e].x),i=R.c2p(t[e].y);return r!==n&&i!==n&&[r,i]}function l(t){var e=t[0]/O._length,r=t[1]/R._length;return(1+s.toleranceGrowth*Math.max(0,-e,e-1,-r,r-1))*N}function u(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function c(t,e){for(var r=[],n=0,i=0;i<4;i++){var o=it[i],s=a(t[0],t[1],e[0],e[1],o[0],o[1],o[2],o[3]);s&&(!n||Math.abs(s.x-r[0][0])>1||Math.abs(s.y-r[0][1])>1)&&(s=[s.x,s.y],n&&u(s,t)et||t[1]nt)return[o(t[0],tt,et),o(t[1],rt,nt)]}function f(t,e){return t[0]===e[0]&&(t[0]===tt||t[0]===et)||(t[1]===e[1]&&(t[1]===rt||t[1]===nt)||void 0)}function d(t,e){var r=[],n=h(t),i=h(e);return n&&i&&f(n,i)?r:(n&&r.push(n),i&&r.push(i),r)}function p(t,e,r){return function(n,a){var o=h(n),s=h(a),l=[];if(o&&s&&f(o,s))return l;o&&l.push(o),s&&l.push(s);var u=2*i.constrain((n[t]+a[t])/2,e,r)-((o||n)[t]+(s||a)[t]);if(u){var c;c=o&&s?u>0==o[t]>s[t]?o:s:o||s,c[t]+=u}return l}}function m(t,e){var r=e[0]-t[0],n=(e[1]-t[1])/r;return(t[1]*e[0]-e[1]*t[0])/r>0?[n>0?tt:et,nt]:[n>0?et:tt,rt]}function g(t){var e=t[0],r=t[1],n=e===q[G-1][0],i=r===q[G-1][1];if(!n||!i)if(G>1){var a=e===q[G-2][0],o=r===q[G-2][1];n&&(e===tt||e===et)&&a?o?G--:q[G-1]=t:i&&(r===rt||r===nt)&&o?a?G--:q[G-1]=t:q[G++]=t}else q[G++]=t}function v(t){q[G-1][0]!==t[0]&&q[G-1][1]!==t[1]&&g([X,Z]),g(t),J=null,X=Z=0}function y(t){if(Y=t[0]et?et:0,W=t[1]nt?nt:0,Y||W){if(G)if(J){var e=Q(J,t);e.length>1&&(v(e[0]),q[G++]=e[1])}else K=Q(q[G-1],t)[0],q[G++]=K;else q[G++]=[Y||t[0],W||t[1]];var r=q[G-1];Y&&W&&(r[0]!==Y||r[1]!==W)?(J&&(X!==Y&&Z!==W?g(X&&Z?m(J,t):[X||Y,Z||W]):X&&Z&&g([X,Z])),g([Y,W])):X-Y&&Z-W&&g([Y||X,W||Z]),J=t,X=Y,Z=W}else J&&v(Q(J,t)[0]),q[G++]=t}var b,x,_,w,M,k,A,T,S,E,L,C,I,z,D,P,O=e.xaxis,R=e.yaxis,F=e.simplify,j=e.connectGaps,N=e.baseTolerance,B=e.shape,U="linear"===B,V=[],H=s.minTolerance,q=new Array(t.length),G=0;F||(N=H=-1);var Y,W,X,Z,J,K,Q,$=s.maxScreensAway,tt=-O._length*$,et=O._length*(1+$),rt=-R._length*$,nt=R._length*(1+$),it=[[tt,rt,et,rt],[et,rt,et,nt],[et,nt,tt,nt],[tt,nt,tt,rt]];for("linear"===B||"spline"===B?Q=c:"hv"===B||"vh"===B?Q=d:"hvh"===B?Q=p(0,tt,et):"vhv"===B&&(Q=p(1,rt,nt)),b=0;bl(k))break;_=k,I=S[0]*T[0]+S[1]*T[1],I>L?(L=I,w=k,A=!1):I=t.length||!k)break;y(k),x=k}}else y(w)}J&&g([X||J[0],Z||J[1]]),V.push(q.slice(0,G))}return V}},{"../../constants/numerical":707,"../../lib":728,"./constants":1036}],1045:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],1046:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n,i,a=null,o=0;o0?Math.max(e,i):0}}},{"fast-isnumeric":131}],1048:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,u){var c,h=o.isBubble(t),f=(t.line||{}).color;if(u=u||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",h?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noLine||(c=f&&!Array.isArray(f)&&e.marker.color!==f?f:h?n.background:n.defaultLine,l("marker.line.color",c),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",h?1:0)),h&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),u.gradient){"none"!==l("marker.gradient.type")&&l("marker.gradient.color")}}},{"../../components/color":604,"../../components/colorscale/defaults":613,"../../components/colorscale/has_colorscale":617,"./subtypes":1052}],1049:[function(t,e,r){"use strict";function n(t,e,r){var n;e.selectAll("g.trace").each(function(t){var e=o.select(this);if(n=t[0].trace,n._nexttrace){if(n._nextFill=e.select(".js-fill.js-tonext"),!n._nextFill.size()){var i=":first-child";e.select(".js-fill.js-tozero").size()&&(i+=" + *"),n._nextFill=e.insert("path",i).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),n._nextFill=null;n.fill&&("tozero"===n.fill.substr(0,6)||"toself"===n.fill||"to"===n.fill.substr(0,2)&&!n._prevtrace)?(n._ownFill=e.select(".js-fill.js-tozero"),n._ownFill.size()||(n._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),n._ownFill=null),e.selectAll(".js-fill").call(l.setClipUrl,r.layerClipId)})}function i(t,e,r,n,i,f,p){function m(t){return M?t.transition():t}function g(t){return t.filter(function(t){return t.vis})}function v(t){return t.id}function y(t){if(t.ids)return v}function b(){return!1}function x(e){var n,i,a,u=e[0].trace,h=o.select(this),f=c.hasMarkers(u),d=c.hasText(u),p=y(u),v=b,x=b;f&&(v=u.marker.maxdisplayed||u._needsCull?g:s.identity),d&&(x=u.marker.maxdisplayed||u._needsCull?g:s.identity),i=h.selectAll("path.point"),n=i.data(v,p);var _=n.enter().append("path").classed("point",!0);M&&_.call(l.pointStyle,u,t).call(l.translatePoints,k,A).style("opacity",0).transition().style("opacity",1);var w=f&&l.tryColorscale(u.marker,""),T=f&&l.tryColorscale(u.marker,"line");n.order(),n.each(function(e){var n=o.select(this),i=m(n);a=l.translatePoint(e,i,k,A),a?(l.singlePointStyle(e,i,u,w,T,t),r.layerClipId&&l.hideOutsideRangePoint(e,i,k,A),u.customdata&&n.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):i.remove()}),M?n.exit().transition().style("opacity",0).remove():n.exit().remove(),i=h.selectAll("g"),n=i.data(x,p),n.enter().append("g").classed("textpoint",!0).append("text"),n.order(),n.each(function(t){var e=o.select(this),n=m(e.select("text"));a=l.translatePoint(t,n,k,A),a?r.layerClipId&&l.hideOutsideRangePoint(t,e,k,A):e.remove()}),n.selectAll("text").call(l.textPointStyle,u,t).each(function(t){var e=k.c2p(t.x),r=A.c2p(t.y);o.select(this).selectAll("tspan.line").each(function(){m(o.select(this)).attr({x:e,y:r})})}),n.exit().remove()}var _,w;a(t,e,r,n,i);var M=!!p&&p.duration>0,k=r.xaxis,A=r.yaxis,T=n[0].trace,S=T.line,E=o.select(f);if(E.call(u.plot,r,p),!0===T.visible){m(E).style("opacity",T.opacity);var L,C,I=T.fill.charAt(T.fill.length-1);"x"!==I&&"y"!==I&&(I=""),n[0].node3=E;var z="",D=[],P=T._prevtrace;P&&(z=P._prevRevpath||"",C=P._nextFill,D=P._polygons);var O,R,F,j,N,B,U,V,H,q="",G="",Y=[],W=s.noop;if(L=T._ownFill,c.hasLines(T)||"none"!==T.fill){for(C&&C.datum(n),-1!==["hv","vh","hvh","vhv"].indexOf(S.shape)?(F=l.steps(S.shape),j=l.steps(S.shape.split("").reverse().join(""))):F=j="spline"===S.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),S.smoothing):l.smoothopen(t,S.smoothing)}:function(t){return"M"+t.join("L")},N=function(t){return j(t.reverse())},Y=h(n,{xaxis:k,yaxis:A,connectGaps:T.connectgaps,baseTolerance:Math.max(S.width||1,3)/4,shape:S.shape,simplify:S.simplify}),H=T._polygons=new Array(Y.length),w=0;w1){var r=o.select(this);if(r.datum(n),t)m(r.style("opacity",0).attr("d",O).call(l.lineGroupStyle)).style("opacity",1);else{var i=m(r);i.attr("d",O),l.singleLineStyle(n,i)}}}}}var X=E.selectAll(".js-line").data(Y);m(X.exit()).style("opacity",0).remove(),X.each(W(!1)),X.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(W(!0)),l.setClipUrl(X,r.layerClipId),Y.length&&(L?B&&V&&(I?("y"===I?B[1]=V[1]=A.c2p(0,!0):"x"===I&&(B[0]=V[0]=k.c2p(0,!0)),m(L).attr("d","M"+V+"L"+B+"L"+q.substr(1)).call(l.singleFillStyle)):m(L).attr("d",q+"Z").call(l.singleFillStyle)):"tonext"===T.fill.substr(0,6)&&q&&z&&("tonext"===T.fill?m(C).attr("d",q+"Z"+z+"Z").call(l.singleFillStyle):m(C).attr("d",q+"L"+z.substr(1)+"Z").call(l.singleFillStyle),T._polygons=T._polygons.concat(D)),T._prevRevpath=G,T._prevPolygons=H);var Z=E.selectAll(".points");_=Z.data([n]),Z.each(x),_.enter().append("g").classed("points",!0).each(x),_.exit().remove(),_.each(function(t){var e=!1===t[0].trace.cliponaxis;l.setClipUrl(o.select(this),e?null:r.layerClipId)})}}function a(t,e,r,n,i){var a=r.xaxis,l=r.yaxis,u=o.extent(s.simpleMap(a.range,a.r2c)),h=o.extent(s.simpleMap(l.range,l.r2c)),f=n[0].trace;if(c.hasMarkers(f)){var d=f.marker.maxdisplayed;if(0!==d){var p=n.filter(function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=h[0]&&t.y<=h[1]}),m=Math.ceil(p.length/d),g=0;i.forEach(function(t,r){var n=t[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;for(c=p.selectAll("g.trace"),h=c.data(r,function(t){return t[0].trace.uid}),h.enter().append("g").attr("class",function(t){return"trace scatter trace"+t[0].trace.uid}).style("stroke-miterlimit",2),f(t,e,r),n(t,p,e),l=0,u={};lu[e[0].trace.uid]?1:-1}),g){s&&(d=s());o.transition().duration(a.duration).ease(a.easing).each("end",function(){d&&d()}).each("interrupt",function(){d&&d()}).each(function(){p.selectAll("g.trace").each(function(n,o){i(t,o,e,n,r,this,a)})})}else p.selectAll("g.trace").each(function(n,o){i(t,o,e,n,r,this,a)});m&&h.exit().remove(),p.selectAll("path:not([d])").remove()}},{"../../components/drawing":628,"../../components/errorbars":634,"../../lib":728,"../../lib/polygon":739,"./line_points":1044,"./link_traces":1046,"./subtypes":1052,d3:122}],1050:[function(t,e,r){"use strict";var n=t("./subtypes"),i=t("../../constants/interactions").DESELECTDIM;e.exports=function(t,e){var r,a,o,s,l=t.cd,u=t.xaxis,c=t.yaxis,h=[],f=l[0].trace,d=f.marker,p=!n.hasMarkers(f)&&!n.hasText(f);if(!0!==f.visible||p)return[];var m=Array.isArray(d.opacity)?1:d.opacity;if(!1===e)for(r=0;r=0&&(e[1]+=1),t.indexOf("top")>=0&&(e[1]-=1),t.indexOf("left")>=0&&(e[0]-=1),t.indexOf("right")>=0&&(e[0]+=1),e)}function s(t,e){return e(4*t)}function l(t){return M[t]}function u(t,e,r,n,i){var a=null;if(Array.isArray(t)){a=[];for(var o=0;o=0){var f=i(l.position,l.delaunayColor,l.delaunayAxis);f.opacity=t.opacity,this.delaunayMesh?this.delaunayMesh.update(f):(f.gl=o,this.delaunayMesh=g(f),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},A.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())},e.exports=f},{"../../constants/gl3d_dashes":704,"../../constants/gl3d_markers":705,"../../lib":728,"../../lib/gl_format_color":724,"../../lib/str2rgbarray":749,"../scatter/make_bubble_size_func":1047,"./calc_errors":1057,"delaunay-triangulate":123,"gl-error3d":161,"gl-line3d":172,"gl-mesh3d":205,"gl-scatter3d":251}],1059:[function(t,e,r){"use strict";function n(t,e,r,n){var a=0,o=r("x"),s=r("y"),l=r("z");return i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],n),o&&s&&l&&(a=Math.min(o.length,s.length,l.length),a=0&&f("surfacecolor",d||p);for(var m=["x","y","z"],g=0;g<3;++g){var v="projection."+m[g];f(v+".show")&&(f(v+".opacity"),f(v+".scale"))}c(t,e,r,{axis:"z"}),c(t,e,r,{axis:"y",inherit:"z"}),c(t,e,r,{axis:"x",inherit:"z"})}},{"../../components/errorbars/defaults":633,"../../lib":728,"../../registry":846,"../scatter/line_defaults":1043,"../scatter/marker_defaults":1048,"../scatter/subtypes":1052,"../scatter/text_defaults":1053,"./attributes":1055}],1060:[function(t,e,r){"use strict";var n={};n.plot=t("./convert"),n.attributes=t("./attributes"),n.markerSymbols=t("../../constants/gl3d_markers"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.moduleType="trace",n.name="scatter3d",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../constants/gl3d_markers":705,"../../plots/gl3d":811,"../scatter/colorbar":1034,"./attributes":1055,"./calc":1056,"./convert":1058,"./defaults":1059}],1061:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../components/colorscale/color_attributes"),o=t("../../components/colorbar/attributes"),s=t("../../lib/extend").extendFlat,l=n.marker,u=n.line,c=l.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:s({},n.mode,{dflt:"markers"}),text:s({},n.text,{}),line:{color:u.color,width:u.width,dash:u.dash,shape:s({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:s({},n.fill,{values:["none","toself","tonext"]}),fillcolor:n.fillcolor,marker:s({symbol:l.symbol,opacity:l.opacity,maxdisplayed:l.maxdisplayed,size:l.size,sizeref:l.sizeref,sizemin:l.sizemin,sizemode:l.sizemode,line:s({width:c.width,editType:"calc"},a("marker".line)),gradient:l.gradient,editType:"calc"},a("marker"),{showscale:l.showscale,colorbar:o}),textfont:n.textfont,textposition:n.textposition,hoverinfo:s({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron}},{"../../components/colorbar/attributes":605,"../../components/colorscale/color_attributes":611,"../../lib/extend":717,"../../plots/attributes":770,"../scatter/attributes":1031}],1062:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/cartesian/axes"),a=t("../scatter/subtypes"),o=t("../scatter/colorscale_calc"),s=t("../scatter/arrays_to_calcdata"),l=t("../carpet/lookup_carpetid");e.exports=function(t,e){var r=e.carpetTrace=l(t,e);if(r&&r.visible&&"legendonly"!==r.visible){var u;e.xaxis=r.xaxis,e.yaxis=r.yaxis;var c,h,f=e.a.length,d=new Array(f),p=!1;for(u=0;uf&&y.splice(f,y.length-f)}return o(e),s(d,e),d}}},{"../../plots/cartesian/axes":772,"../carpet/lookup_carpetid":903,"../scatter/arrays_to_calcdata":1030,"../scatter/colorscale_calc":1035,"../scatter/subtypes":1052,"fast-isnumeric":131}],1063:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/constants"),a=t("../scatter/subtypes"),o=t("../scatter/marker_defaults"),s=t("../scatter/line_defaults"),l=t("../scatter/line_shape_defaults"),u=t("../scatter/text_defaults"),c=t("../scatter/fillcolor_defaults"),h=t("./attributes");e.exports=function(t,e,r,f){function d(r,i){return n.coerce(t,e,h,r,i)}d("carpet"),e.xaxis="x",e.yaxis="y";var p,m=d("a"),g=d("b");if(!(p=Math.min(m.length,g.length)))return void(e.visible=!1);m&&p0?t.labelprefix.replace(/ = $/,""):t._hovertitle,v.push(r+": "+e.toFixed(3)+t.labelsuffix)}var o=n(t,e,r,i);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index){var l=1-s.y0/t.ya._length,u=t.xa._length,c=u*l/2,h=u-c;return s.x0=Math.max(Math.min(s.x0,h),c),s.x1=Math.max(Math.min(s.x1,h),c),o}var f=s.cd[s.index];s.a=f.a,s.b=f.b,s.xLabelVal=void 0,s.yLabelVal=void 0;var d=s.trace,p=d._carpet,m=f.hi||d.hoverinfo,g=m.split("+"),v=[];-1!==g.indexOf("all")&&(g=["a","b"]),-1!==g.indexOf("a")&&a(p.aaxis,f.a),-1!==g.indexOf("b")&&a(p.baxis,f.b);var y=p.ab2ij([f.a,f.b]),b=Math.floor(y[0]),x=y[0]-b,_=Math.floor(y[1]),w=y[1]-_,M=p.evalxy([],b,_,x,w);return v.push("y: "+M[1].toFixed(3)),s.extraText=v.join("
"),o}}},{"../scatter/hover":1041}],1065:[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="scattercarpet",n.basePlotModule=t("../../plots/cartesian"),n.categories=["carpet","symbols","markerColorscale","showLegend","carpetDependent"],n.meta={},e.exports=n},{"../../plots/cartesian":782,"../scatter/colorbar":1034,"./attributes":1061,"./calc":1062,"./defaults":1063,"./hover":1064,"./plot":1066,"./select":1067,"./style":1068}],1066:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../plots/cartesian/axes"),a=t("../../components/drawing");e.exports=function(t,e,r){var o,s,l,u=r[0][0].carpet,c={xaxis:i.getFromId(t,u.xaxis||"x"),yaxis:i.getFromId(t,u.yaxis||"y"),plot:e.plot};for(n(t,c,r),o=0;o")}var i=t("../../components/fx"),a=t("../../plots/cartesian/axes"),o=t("../../constants/numerical").BADNUM,s=t("../scatter/get_trace_color"),l=t("../scatter/fill_hover_text"),u=t("./attributes");e.exports=function(t,e,r){function a(t){var n=t.lonlat;if(n[0]===o)return 1/0;if(d(n))return 1/0;var i=p(n),a=p([e,r]),s=Math.abs(i[0]-a[0]),l=Math.abs(i[1]-a[1]),u=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(s*s+l*l)-u,1-3/u)}var l=t.cd,u=l[0].trace,c=t.xa,h=t.ya,f=t.subplot,d=f.projection.isLonLatOverEdges,p=f.project;if(i.getClosest(l,a,t),!1!==t.index){var m=l[t.index],g=m.lonlat,v=[c.c2p(g),h.c2p(g)],y=m.mrc||1;return t.x0=v[0]-y,t.x1=v[0]+y,t.y0=v[1]-y,t.y1=v[1]+y,t.loc=m.loc,t.lon=g[0],t.lat=g[1],t.color=s(u,m),t.extraText=n(u,m,f.mockAxis),[t]}}},{"../../components/fx":645,"../../constants/numerical":707,"../../plots/cartesian/axes":772,"../scatter/fill_hover_text":1038,"../scatter/get_trace_color":1040,"./attributes":1069}],1074:[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.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="scattergeo", -n.basePlotModule=t("../../plots/geo"),n.categories=["geo","symbols","markerColorscale","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/geo":800,"../scatter/colorbar":1034,"./attributes":1069,"./calc":1070,"./defaults":1071,"./event_data":1072,"./hover":1073,"./plot":1075,"./select":1076}],1075:[function(t,e,r){"use strict";function n(t,e){var r=t[0].trace;if(Array.isArray(r.locations))for(var n=c(r,e),i=r.locationmode,a=0;a=e.length?i:e[a]);return n}function o(t,e,r){return l(O(t,r),P(e,r),r)}function s(t,e,r,n){var i=k(t,e,n);return i=Array.isArray(i[0])?i:a(y.identity,[i],n),l(i,P(r,n),n)}function l(t,e,r){for(var n=new Array(4*r),i=0;iZ?X-Z:0),!q||H.noBorder||H.noFill?c(this.scatter.options.colors,Y,f,B,G):c(this.scatter.options.colors,z,f,0),c(this.scatter.options.borderColors,W,f,B,G);N?(this.scatter.options.positions=null,this.fancyScatter.update(),this.scatter.options.positions=k):this.fancyScatter.update()}else this.fancyScatter.clear();this.scatter.clear(),this.expandAxesFancy(l,h,j)},D.updateLines=function(t,e){var r;if(this.hasLines){var n=e;if(!t.connectgaps){var i=0,a=this.xData,s=this.yData;for(n=new Float64Array(2*a.length),r=0;r")}var i=t("../../components/fx"),a=t("../scatter/get_trace_color"),o=t("../scatter/fill_hover_text"),s=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r){function o(t){var e=t.lonlat;if(e[0]===s)return 1/0;var n=Math.abs(c.c2p(e)-c.c2p([p,e[1]])),i=Math.abs(h.c2p(e)-h.c2p([e[0],r])),a=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(n*n+i*i)-a,1-3/a)}var l=t.cd,u=l[0].trace,c=t.xa,h=t.ya,f=e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360),d=360*f,p=e-d;if(i.getClosest(l,o,t),!1!==t.index){var m=l[t.index],g=m.lonlat,v=[g[0]+d,g[1]],y=c.c2p(v),b=h.c2p(v),x=m.mrc||1;return t.x0=y-x,t.x1=y+x,t.y0=b-x,t.y1=b+x,t.color=a(u,m),t.extraText=n(u,m),[t]}}},{"../../components/fx":645,"../../constants/numerical":707,"../scatter/fill_hover_text":1038,"../scatter/get_trace_color":1040}],1088:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("../scattergeo/calc"),n.plot=t("./plot"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="scattermapbox",n.basePlotModule=t("../../plots/mapbox"),n.categories=["mapbox","gl","symbols","markerColorscale","showLegend","scatterlike"],n.meta={},e.exports=n},{"../../plots/mapbox":825,"../scatter/colorbar":1034,"../scattergeo/calc":1070,"./attributes":1083,"./defaults":1085,"./event_data":1086,"./hover":1087,"./plot":1089,"./select":1090}],1089:[function(t,e,r){"use strict";function n(t,e){this.mapbox=t,this.map=t.map,this.uid=e,this.idSourceFill=e+"-source-fill",this.idSourceLine=e+"-source-line",this.idSourceCircle=e+"-source-circle",this.idSourceSymbol=e+"-source-symbol",this.idLayerFill=e+"-layer-fill",this.idLayerLine=e+"-layer-line",this.idLayerCircle=e+"-layer-circle",this.idLayerSymbol=e+"-layer-symbol",this.mapbox.initSource(this.idSourceFill),this.mapbox.initSource(this.idSourceLine),this.mapbox.initSource(this.idSourceCircle),this.mapbox.initSource(this.idSourceSymbol),this.map.addLayer({id:this.idLayerFill,source:this.idSourceFill,type:"fill"}),this.map.addLayer({id:this.idLayerLine,source:this.idSourceLine,type:"line"}),this.map.addLayer({id:this.idLayerCircle,source:this.idSourceCircle,type:"circle"}),this.map.addLayer({id:this.idLayerSymbol,source:this.idSourceSymbol,type:"symbol"})}function i(t){return"visible"===t.layout.visibility}var a=t("./convert"),o=n.prototype;o.update=function(t){var e=this.mapbox,r=a(t);e.setOptions(this.idLayerFill,"setLayoutProperty",r.fill.layout),e.setOptions(this.idLayerLine,"setLayoutProperty",r.line.layout),e.setOptions(this.idLayerCircle,"setLayoutProperty",r.circle.layout),e.setOptions(this.idLayerSymbol,"setLayoutProperty",r.symbol.layout),i(r.fill)&&(e.setSourceData(this.idSourceFill,r.fill.geojson),e.setOptions(this.idLayerFill,"setPaintProperty",r.fill.paint)),i(r.line)&&(e.setSourceData(this.idSourceLine,r.line.geojson),e.setOptions(this.idLayerLine,"setPaintProperty",r.line.paint)),i(r.circle)&&(e.setSourceData(this.idSourceCircle,r.circle.geojson),e.setOptions(this.idLayerCircle,"setPaintProperty",r.circle.paint)),i(r.symbol)&&(e.setSourceData(this.idSourceSymbol,r.symbol.geojson),e.setOptions(this.idLayerSymbol,"setPaintProperty",r.symbol.paint)),t[0].trace._glTrace=this},o.dispose=function(){var t=this.map;t.removeLayer(this.idLayerFill),t.removeLayer(this.idLayerLine),t.removeLayer(this.idLayerCircle),t.removeLayer(this.idLayerSymbol),t.removeSource(this.idSourceFill),t.removeSource(this.idSourceLine),t.removeSource(this.idSourceCircle),t.removeSource(this.idSourceSymbol)},e.exports=function(t,e){var r=e[0].trace,i=new n(t,r.uid);return i.update(e),i}},{"./convert":1084}],1090:[function(t,e,r){"use strict";var n=t("../scatter/subtypes");e.exports=function(t,e){var r,i,a,o,s,l=t.cd,u=t.xaxis,c=t.yaxis,h=[],f=l[0].trace;if(f._hasDimmedPts=!1,!0!==f.visible||!n.hasMarkers(f))return[];if(!1===e)for(s=0;sk&&S.splice(k,S.length-k)}return o(e),s(A,e),A}},{"../../plots/cartesian/axes":772,"../scatter/arrays_to_calcdata":1030,"../scatter/colorscale_calc":1035,"../scatter/subtypes":1052,"fast-isnumeric":131}],1093:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/constants"),a=t("../scatter/subtypes"),o=t("../scatter/marker_defaults"),s=t("../scatter/line_defaults"),l=t("../scatter/line_shape_defaults"),u=t("../scatter/text_defaults"),c=t("../scatter/fillcolor_defaults"),h=t("./attributes");e.exports=function(t,e,r,f){function d(r,i){return n.coerce(t,e,h,r,i)}var p,m=d("a"),g=d("b"),v=d("c");if(m?(p=m.length,g?(p=Math.min(p,g.length),v&&(p=Math.min(p,v.length))):p=v?Math.min(p,v.length):0):g&&v&&(p=Math.min(g.length,v.length)),!p)return void(e.visible=!1);m&&p"),s}}},{"../../plots/cartesian/axes":772,"../scatter/hover":1041}],1095:[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","scatter-like"],n.meta={},e.exports=n},{"../../plots/ternary":839,"../scatter/colorbar":1034,"./attributes":1091,"./calc":1092,"./defaults":1093,"./hover":1094,"./plot":1096,"./select":1097,"./style":1098}],1096:[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 i={xaxis:t.xaxis,yaxis:t.yaxis,plot:r,layerClipId:t._hasClipOnAxisFalse?t.clipIdRelative:null},a=0;a",uplift:5,goldenRatio:1.618,columnTitleOffset:28,columnExtentOffset:10,transitionEase:"cubic-out",transitionDuration:100,releaseTransitionEase:"cubic-out",releaseTransitionDuration:120,scrollbarWidth:8,scrollbarCaptureWidth:18,scrollbarOffset:5,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}},{}],1109:[function(t,e,r){"use strict";function n(t){return t.calcdata.columns.reduce(function(e,r){return r.xIndex=e||c===t.length-1)&&(n[i]=s,s.key=u++,s.firstRowIndex=l,s.lastRowIndex=c,s=o(),i+=a,l=c+1,a=0);return n}function o(){return{firstRowIndex:null,lastRowIndex:null,rows:[]}}var s=t("./constants"),l=t("../../lib/extend").extendFlat;e.exports=function(t,e){var r=e.header.values.map(function(t){return Array.isArray(t)?t:[t]}),o=e.domain,u=Math.floor(t._fullLayout._size.w*(o.x[1]-o.x[0])),c=Math.floor(t._fullLayout._size.h*(o.y[1]-o.y[0])),h=r[0].map(function(){return e.header.height}),f=e.cells.values[0].map(function(){return e.cells.height}),d=h.reduce(function(t,e){return t+e},0),p=c-d,m=p+s.uplift,g=a(f,m),v=a(h,d),y=i(v,[]),b=i(g,y),x={},_=e._fullInput.columnorder,w=r.map(function(t,r){return Array.isArray(e.columnwidth)?e.columnwidth[Math.min(r,e.columnwidth.length-1)]:isFinite(e.columnwidth)&&null!==e.columnwidth?e.columnwidth:1}),M=w.reduce(function(t,e){return t+e},0);w=w.map(function(t){return t/M*u});var k={key:e.index,translateX:o.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-o.y[1]),size:t._fullLayout._size,width:u,height:c,columnOrder:_,groupHeight:c,rowBlocks:b,headerRowBlocks:y,scrollY:0,cells:e.cells,headerCells:l({},e.header,{values:r}),gdColumns:r.map(function(t){return t[0]}),gdColumnsOriginalOrder:r.map(function(t){return t[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:r.map(function(t,e){var r=x[t];return x[t]=(r||0)+1,{key:t+"__"+x[t],label:t,specIndex:e,xIndex:_[e],xScale:n,x:void 0,calcdata:void 0,columnWidth:w[e]}})};return k.columns.forEach(function(t){t.calcdata=k,t.x=n(t)}),k}},{"../../lib/extend":717,"./constants":1108}],1110:[function(t,e,r){"use strict";function n(t){var e=t.rowBlocks[t.page],r=e?e.rows[0].rowIndex:0;return[r,e?r+e.rows.length:0]}var i=t("../../lib/extend").extendFlat;r.splitToPanels=function(t){var e=[0,0],r=i({},t,{key:"header",type:"header",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!0,values:t.calcdata.headerCells.values[t.specIndex],rowBlocks:t.calcdata.headerRowBlocks,calcdata:i({},t.calcdata,{cells:t.calcdata.headerCells})});return[i({},t,{key:"cells1",type:"cells",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),i({},t,{key:"cells2",type:"cells",page:1,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),r]},r.splitToCells=function(t){var e=n(t);return t.values.slice(e[0],e[1]).map(function(r,n){return{keyWithinBlock:n+("string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:e[0]+n,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:r}})}},{"../../lib/extend":717}],1111:[function(t,e,r){"use strict";function n(t,e){for(var r=t.columnorder||[],n=t.header.values.length,i=r.slice(0,n),a=i.slice().sort(function(t,e){return t-e}),o=i.map(function(t){return a.indexOf(t)}),s=o.length;s/i),o=!i||a;t.mayHaveMarkup=i&&n.match(/[<&>]/);var s=v(n);t.latex=s;var l,u=s?"":x(t.calcdata.cells.prefix,e,r)||"",c=s?"":x(t.calcdata.cells.suffix,e,r)||"",h=s?null:x(t.calcdata.cells.format,e,r)||null,f=u+(h?N.format(h)(t.value):t.value)+c;t.wrappingNeeded=!t.wrapped&&!o&&!s&&(l=y(f)),t.cellHeightMayIncrease=a||s||t.mayHaveMarkup||(void 0===l?y(f):l),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex;var d;if(t.wrappingNeeded){var p=" "===j.wrapSplitCharacter?f.replace(/i&&n.push(a),i+=l}return n}function T(t,e,r){var n=a(e)[0],i=n.rowBlocks,s=n.calcdata,l=D(i,i.length),u=n.calcdata.groupHeight-k(n),c=s.scrollY=Math.max(0,Math.min(l-u,s.scrollY)),h=A(i,c,u);1===h.length&&(h[0]===i.length-1?h.unshift(h[0]-1):h.push(h[0]+1)),h[0]%2&&h.reverse(),e.each(function(t,e){t.page=h[e],t.scrollY=c}),e.attr("transform",function(t){return"translate(0 "+(D(t.rowBlocks,t.page)-t.scrollY)+")"}),t&&(E(t,r,e,h,n.prevPages,n,0),E(t,r,e,h,n.prevPages,n,1),o(r,t))}function S(t,e,r,n){return function(i){var a=i.calcdata?i.calcdata:i,o=e.filter(function(t){return a.key===t.key}),s=r||a.scrollbarState.dragMultiplier;a.scrollY=void 0===n?a.scrollY+s*N.event.dy:n;var l=o.selectAll("."+j.cn.yColumn).selectAll("."+j.cn.columnBlock).filter(w);T(t,l,o)}}function E(t,e,r,n,i,a,o){n[o]!==i[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout(function(){var a=r.filter(function(t,e){return e===o&&n[e]!==i[e]});s(t,e,a,r),i[o]=n[o]}))}function L(t,e,r){return function(){var n=N.select(e.parentNode);n.each(function(t){var e=t.fragments;n.selectAll("tspan.line").each(function(t,r){e[r].width=this.getComputedTextLength()});var r,i,a=e[e.length-1].width,o=e.slice(0,-1),s=[],l=0,u=t.column.columnWidth-2*j.cellPad;for(t.value="";o.length;)r=o.shift(),i=r.width+a,l+i>u&&(t.value+=s.join(j.wrapSpacer)+j.lineBreaker,s=[],l=0),s.push(r.text),l+=i;l&&(t.value+=s.join(j.wrapSpacer)),t.wrapped=!0}),n.selectAll("tspan.line").remove(),g(n.select("."+j.cn.cellText),r,t),N.select(e.parentNode.parentNode).call(z)}}function C(t,e,r,n,i){return function(){if(!i.settledY){var a=N.select(e.parentNode),s=R(i),l=i.key-s.firstRowIndex,u=s.rows[l].rowHeight,c=i.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*j.cellPad:u,h=Math.max(c,u);h-s.rows[l].rowHeight&&(s.rows[l].rowHeight=h,t.selectAll("."+j.cn.columnCell).call(z),T(null,t.filter(w),0),o(r,n,!0)),a.attr("transform",function(){var t=this,e=t.parentNode,r=e.getBoundingClientRect(),n=N.select(t.parentNode).select("."+j.cn.cellRect).node().getBoundingClientRect(),a=t.transform.baseVal.consolidate(),o=n.top-r.top+(a?a.matrix.f:j.cellPad);return"translate("+I(i,N.select(t.parentNode).select("."+j.cn.cellTextHolder).node().getBoundingClientRect().width)+" "+o+")"}),i.settledY=!0}}}function I(t,e){switch(t.align){case"left":return j.cellPad;case"right":return t.column.columnWidth-(e||0)-j.cellPad;case"center":return(t.column.columnWidth-(e||0))/2;default:return j.cellPad}}function z(t){t.attr("transform",function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce(function(t,e){return t+P(e,1/0)},0);return"translate(0 "+(P(R(t),t.key)+e)+")"}).selectAll("."+j.cn.cellRect).attr("height",function(t){return F(R(t),t.key).rowHeight})}function D(t,e){for(var r=0,n=e-1;n>=0;n--)r+=O(t[n]);return r}function P(t,e){for(var r=0,n=0;na&&(a=u,o=l)}}return a?i(o):h};case"rms":return function(t,e){for(var r=0,a=0,o=0;o":return function(t){return f(t)>i};case">=":return function(t){return f(t)>=i};case"[]":return function(t){var e=f(t);return e>=i[0]&&e<=i[1]};case"()":return function(t){var e=f(t);return e>i[0]&&e=i[0]&&ei[0]&&e<=i[1]};case"][":return function(t){var e=f(t);return e<=i[0]||e>=i[1]};case")(":return function(t){var e=f(t);return ei[1]};case"](":return function(t){var e=f(t);return e<=i[0]||e>i[1]};case")[":return function(t){var e=f(t);return e=i[1]};case"{}":return function(t){return-1!==i.indexOf(f(t))};case"}{":return function(t){return-1===i.indexOf(f(t))}}}var i=t("../lib"),a=t("../registry"),o=t("../plots/cartesian/axes"),s=["=","!=","<",">=",">","<="],l=["[]","()","[)","(]","][",")(","](",")["],u=["{}","}{"];r.moduleType="transform",r.name="filter",r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},target:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},operation:{valType:"enumerated",values:[].concat(s).concat(l).concat(u),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},preservegaps:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc"},r.supplyDefaults=function(t){function e(e,a){return i.coerce(t,n,r.attributes,e,a)}var n={};if(e("enabled")){e("preservegaps"),e("operation"),e("value"),e("target");var o=a.getComponentMethod("calendars","handleDefaults");o(t,n,"valuecalendar",null),o(t,n,"targetcalendar",null)}return n},r.calcTransform=function(t,e,r){function a(t,r){for(var n=0;n1?"%{group} (%{trace})":"%{group}");var l=t.styles,u=s.styles=[];if(l)for(o=0;oc[1]-.01&&(e.domain=[0,1]),i.noneOrAll(t.domain,e.domain,[0,1])}return r("layer"),e}},{"../../lib":728,"fast-isnumeric":131}],787:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*r;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)]}},{"../../constants/alignment":701}],788:[function(t,e,r){"use strict";function n(t){return t._id}function i(t,e){if(Array.isArray(t))for(var r=e.cd[0].trace,n=0;n0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-3*M*Math.abs(n-i))}return d}function h(e,r,n){var i=u(e,n||t.calendar);if(i===d){if(!a(e))return d;i=u(new Date(+e))}return i}function g(e,r,n){return l(e,r,n||t.calendar)}function v(e){return t._categories[Math.round(e)]}function y(e){if(null!==e&&void 0!==e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return d}function b(e){if(t._categoriesMap){var r=t._categoriesMap[e];if(void 0!==r)return r}if(a(e))return+e}function x(e){return a(e)?i.round(t._b+t._m*e,2):d}function _(e){return(e-t._b)/t._m}e=e||{};var w=(t._id||"x").charAt(0),M=10;t.c2l="log"===t.type?r:c,t.l2c="log"===t.type?n:c,t.l2p=x,t.p2l=_,t.c2p="log"===t.type?function(t,e){return x(r(t,e))}:x,t.p2c="log"===t.type?function(t){return n(_(t))}:_,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=s,t.c2d=t.c2r=t.l2d=t.l2r=c,t.d2p=t.r2p=function(e){return t.l2p(s(e))},t.p2d=t.p2r=_,t.cleanPos=c):"log"===t.type?(t.d2r=t.d2l=function(t,e){return r(s(t),e)},t.r2d=t.r2c=function(t){return n(s(t))},t.d2c=t.r2l=s,t.c2d=t.l2r=c,t.c2r=r,t.l2d=n,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return n(_(t))},t.r2p=function(e){return t.l2p(s(e))},t.p2r=_,t.cleanPos=c):"date"===t.type?(t.d2r=t.r2d=o.identity,t.d2c=t.r2c=t.d2l=t.r2l=h,t.c2d=t.c2r=t.l2d=t.l2r=g,t.d2p=t.r2p=function(e,r,n){return t.l2p(h(e,0,n))},t.p2d=t.p2r=function(t,e,r){return g(_(t),e,r)},t.cleanPos=function(e){return o.cleanDate(e,d,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=y,t.r2d=t.c2d=t.l2d=v,t.d2r=t.d2l_noadd=b,t.r2c=function(e){var r=b(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=c,t.r2l=b,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return v(_(t))},t.r2p=t.d2p,t.p2r=_,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:c(t)}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e){e||(e="range");var r,n,i=o.nestedProperty(t,e).get();if(n="date"===t.type?o.dfltRange(t.calendar):"y"===w?p.DFLTRANGEY:p.DFLTRANGEX,n=n.slice(),!i||2!==i.length)return void o.nestedProperty(t,e).set(n);for("date"===t.type&&(i[0]=o.cleanDate(i[0],d,t.calendar),i[1]=o.cleanDate(i[1],d,t.calendar)),r=0;r<2;r++)if("date"===t.type){if(!o.isDateTime(i[r],t.calendar)){t[e]=n;break}if(t.r2l(i[0])===t.r2l(i[1])){var s=o.constrain(t.r2l(i[0]),o.MIN_MS+1e3,o.MAX_MS-1e3);i[0]=t.l2r(s-1e3),i[1]=t.l2r(s+1e3);break}}else{if(!a(i[r])){if(!a(i[1-r])){t[e]=n;break}i[r]=i[1-r]*(r?10:.1)}if(i[r]<-f?i[r]=-f:i[r]>f&&(i[r]=f),i[0]===i[1]){var l=Math.max(1,Math.abs(1e-6*i[0]));i[0]-=l,i[1]+=l}}},t.setScale=function(r){var n=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var i=m.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",s=t.calendar;t.cleanRange(a);var l=t.r2l(t[a][0],s),u=t.r2l(t[a][1],s);if("y"===w?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(l-u),t._b=-t._m*u):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(u-l),t._b=-t._m*l),!isFinite(t._m)||!isFinite(t._b))throw o.notifier("Something went wrong with axis scaling","long"),e._replotting=!1,new Error("axis scaling")},t.makeCalcdata=function(e,r){var n,i,a,o="date"===t.type&&e[r+"calendar"];if(r in e)for(n=e[r],i=new Array(n.length),a=0;a=t.range[0]&&r<=t.range[1]}:function(e){var r=e.y;return r>=t.range[0]&&r<=t.range[1]},t._min=[],t._max=[],t._separators=e.separators,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":707,"../../lib":728,"./axis_ids":775,"./constants":777,d3:122,"fast-isnumeric":131}],790:[function(t,e,r){"use strict";function n(t){var e=["showexponent","showtickprefix","showticksuffix"],r=e.filter(function(e){return void 0!==t[e]}),n=function(e){return t[e]===t[r[0]]};if(r.every(n)||1===r.length)return t[r[0]]}var i=t("../../lib");e.exports=function(t,e,r,a,o){var s=n(t);if(r("tickprefix")&&r("showtickprefix",s),r("ticksuffix")&&r("showticksuffix",s),r("showticklabels")){var l=o.font||{},u=e.color===t.color?e.color:l.color;i.coerceFont(r,"tickfont",{family:l.family,size:l.size,color:u}),r("tickangle"),"category"!==a&&(r("tickformat")||"date"===a||(r("showexponent",s),r("exponentformat"),r("separatethousands")))}"category"===a||o.noHover||r("hoverformat")}},{"../../lib":728}],791:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r,a){var o=n.coerce2(t,e,i,"ticklen"),s=n.coerce2(t,e,i,"tickwidth"),l=n.coerce2(t,e,i,"tickcolor",e.color);r("ticks",a.outerTicks||o||s||l?"outside":"")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":728,"./layout_attributes":783}],792:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../constants/numerical").ONEDAY;e.exports=function(t,e,r,o){var s="auto";"array"!==t.tickmode||"log"!==o&&"date"!==o||(t.tickmode="auto"),Array.isArray(t.tickvals)?s="array":t.dtick&&(s="linear");var l=r("tickmode",s);if("auto"===l)r("nticks");else if("linear"===l){var u="date"===o?a:1,c=r("dtick",u);if(n(c))e.dtick=c>0?Number(c):u;else if("string"!=typeof c)e.dtick=u;else{var h=c.charAt(0),f=c.substr(1);f=n(f)?Number(f):0,(f<=0||!("date"===o&&"M"===h&&f===Math.round(f)||"log"===o&&"L"===h||"log"===o&&"D"===h&&(1===f||2===f)))&&(e.dtick=u)}var d="date"===o?i.dateTick0(e.calendar):0,p=r("tick0",d);"date"===o?e.tick0=i.cleanDate(p,d):n(p)&&"D1"!==c&&"D2"!==c?e.tick0=Number(p):e.tick0=d}else{var m=r("tickvals");void 0===m?e.tickmode="auto":r("ticktext")}}},{"../../constants/numerical":707,"../../lib":728,"fast-isnumeric":131}],793:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plotly"),a=t("../../registry"),o=t("../../components/drawing"),s=t("./axes"),l=t("./constants").attrRegex;e.exports=function(t,e,r,u){function c(e,r){function n(e,r,n){for(i=0;i rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.select(".scatterlayer").selectAll(".points");n.selectAll(".point").call(o.setPointGroupScale,1,1).call(o.hideOutsideRangePoints,t),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1).call(o.hideOutsideRangePoints,t)}function f(e,r){var n,i,a,s=y[e.xaxis._id],l=y[e.yaxis._id],u=[];if(s){n=t._fullLayout[s.axisName],i=n._r,a=s.to,u[0]=(i[0]*(1-r)+r*a[0]-i[0])/(i[1]-i[0])*e.xaxis._length;var h=i[1]-i[0],f=a[1]-a[0];n.range[0]=i[0]*(1-r)+r*a[0],n.range[1]=i[1]*(1-r)+r*a[1],u[2]=e.xaxis._length*(1-r+r*f/h)}else u[0]=0,u[2]=e.xaxis._length;if(l){n=t._fullLayout[l.axisName],i=n._r,a=l.to,u[1]=(i[1]*(1-r)+r*a[1]-i[1])/(i[0]-i[1])*e.yaxis._length;var d=i[1]-i[0],p=a[1]-a[0];n.range[0]=i[0]*(1-r)+r*a[0],n.range[1]=i[1]*(1-r)+r*a[1],u[3]=e.yaxis._length*(1-r+r*p/d)}else u[1]=0,u[3]=e.yaxis._length;c(e.xaxis,e.yaxis);var m=e.xaxis,v=e.yaxis,b=!!s,x=!!l,_=b?m._length/u[2]:1,w=x?v._length/u[3]:1,M=b?u[0]:0,k=x?u[1]:0,A=b?u[0]/u[2]*m._length:0,T=x?u[1]/u[3]*v._length:0,S=m._offset-A,E=v._offset-T;g._defs.select("#"+e.clipId+"> rect").call(o.setTranslate,M,k).call(o.setScale,1/_,1/w),e.plot.call(o.setTranslate,S,E).call(o.setScale,_,w).selectAll(".points").selectAll(".point").call(o.setPointGroupScale,1/_,1/w),e.plot.selectAll(".points").selectAll(".textpoint").call(o.setTextPointsScale,1/_,1/w)}function d(){for(var e={},r=0;rr.duration?(d(),k=window.cancelAnimationFrame(m)):k=window.requestAnimationFrame(m)}var g=t._fullLayout,v=[],y=function(t){var e,r,n,i,a={};for(e in t)if(r=e.split("."),r[0].match(l)){var o=e.charAt(0),s=r[0];if(n=g[s],i={},Array.isArray(t[e])?i.to=t[e].slice(0):Array.isArray(t[e].range)&&(i.to=t[e].range.slice(0)),!i.to)continue;i.axisName=s,i.length=n._length,v.push(o),a[o]=i}return a}(e),b=Object.keys(y),x=function(t,e,r){var n,i,a,o=t._plots,s=[];for(n in o){var l=o[n];if(-1===s.indexOf(l)){var u=l.xaxis._id,c=l.yaxis._id,h=l.xaxis.range,f=l.yaxis.range;l.xaxis._r=l.xaxis.range.slice(),l.yaxis._r=l.yaxis.range.slice(),i=r[u]?r[u].to:h,a=r[c]?r[c].to:f,h[0]===i[0]&&h[1]===i[1]&&f[0]===a[0]&&f[1]===a[1]||-1===e.indexOf(u)&&-1===e.indexOf(c)||s.push(l)}}return s}(g,b,y);if(!x.length)return function(){function e(e,r,n){for(var i=0;i0?".":"")+i;u.isPlainObject(a)?s(a,e,o,n+1):e(o,i,a)}})}var l=t("../plotly"),u=t("../lib");r.manageCommandObserver=function(t,e,i,a){var o={},s=!0;e&&e._commandObserver&&(o=e._commandObserver),o.cache||(o.cache={}),o.lookupTable={};var l=r.hasSimpleAPICommandBindings(t,i,o.lookupTable);if(e&&e._commandObserver){if(l)return o;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,o}if(l){n(t,l,o.cache),o.check=function(){if(s){var e=n(t,l,o.cache);return e.changed&&a&&void 0!==o.lookupTable[e.value]&&(o.disable(),Promise.resolve(a({value:e.value,type:l.type,prop:l.prop,traces:l.traces,index:o.lookupTable[e.value]})).then(o.enable,o.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],h=0;hi*Math.PI/180}return!1},n.getPath=function(){return s.geo.path().projection(n)},n.getBounds=function(t){return n.getPath().bounds(t)},n.fitExtent=function(t,e){var r=t[1][0]-t[0][0],i=t[1][1]-t[0][1],a=n.clipExtent&&n.clipExtent();n.scale(150).translate([0,0]),a&&n.clipExtent(null);var o=n.getBounds(e),s=Math.min(r/(o[1][0]-o[0][0]),i/(o[1][1]-o[0][1])),l=+t[0][0]+(r-s*(o[1][0]+o[0][0]))/2,u=+t[0][1]+(i-s*(o[1][1]+o[0][1]))/2;return a&&n.clipExtent(a),n.scale(150*s).translate([l,u])},n.precision(y.precision),i&&n.clipAngle(i-y.clipPad),n}function a(t,e){var r=e[t],n=r.dtick,i=y.scopeDefaults[e.scope],a=i.lonaxisRange,o=i.lataxisRange,l="lonaxis"===t?[n]:[0,n];return s.geo.graticule().extent([[a[0],o[0]],[a[1],o[1]]]).step(l)}function o(t,e){var r=y.clipPad,n=t[0]+r,i=t[1]-r,a=e[0]+r,o=e[1]-r;n>0&&i<0&&(i+=360);var s=(i-n)/4;return{type:"Polygon",coordinates:[[[n,a],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[i,o],[i,a],[i-s,a],[i-2*s,a],[i-3*s,a],[n,a]]]}}var s=t("d3"),l=t("../../plotly"),u=t("../../lib"),c=t("../../components/color"),h=t("../../components/drawing"),f=t("../../components/fx"),d=t("../plots"),p=t("../cartesian/axes"),m=t("../../components/dragelement"),g=t("../cartesian/select"),v=t("./zoom"),y=t("./constants"),b=t("../../lib/topojson_utils"),x=t("topojson-client").feature;t("./projections")(s);var _=n.prototype;e.exports=function(t){return new n(t)},_.plot=function(t,e,r){var n=this,i=e[this.id],a=b.getTopojsonName(i);null===n.topojson||a!==n.topojsonName?(n.topojsonName=a,void 0===PlotlyGeoAssets.topojson[n.topojsonName]?r.push(n.fetchTopojson().then(function(r){PlotlyGeoAssets.topojson[n.topojsonName]=r,n.topojson=r,n.update(t,e)})):(n.topojson=PlotlyGeoAssets.topojson[n.topojsonName],n.update(t,e))):n.update(t,e)},_.fetchTopojson=function(){var t=b.getTopojsonPath(this.topojsonURL,this.topojsonName);return new Promise(function(e,r){s.json(t,function(n,i){if(n)return r(404===n.status?new Error(["plotly.js could not find topojson file at",t,".","Make sure the *topojsonURL* plot config option","is set properly."].join(" ")):new Error(["unexpected error while fetching topojson file at",t].join(" ")));e(i)})})},_.update=function(t,e){var r=e[this.id];if(!this.updateProjection(e,r)){this.hasChoropleth=!1 +;for(var n=0;n0&&M<0&&(M+=360);var k,A=(w+M)/2;if(!c){var T=h?l.projRotate:[A,0,0];k=r("projection.rotation.lon",T[0]),r("projection.rotation.lat",T[1]),r("projection.rotation.roll",T[2]),n=r("showcoastlines",!h),n&&(r("coastlinecolor"),r("coastlinewidth")),n=r("showocean"),n&&r("oceancolor")}var S,E;if(c?(S=-96.6,E=38.7):(S=h?A:k,E=(_[0]+_[1])/2),r("center.lon",S),r("center.lat",E),f){r("projection.parallels",l.projParallels||[0,60])}r("projection.scale"),n=r("showland"),n&&r("landcolor"),n=r("showlakes"),n&&r("lakecolor"),n=r("showrivers"),n&&(r("rivercolor"),r("riverwidth")),n=r("showcountries",h&&"usa"!==o),n&&(r("countrycolor"),r("countrywidth")),("usa"===o||"north america"===o&&50===i)&&(r("showsubunits",!0),r("subunitcolor"),r("subunitwidth")),h||(n=r("showframe",!0))&&(r("framecolor"),r("framewidth")),r("bgcolor")}var i=t("../../subplot_defaults"),a=t("../constants"),o=t("./layout_attributes"),s=a.axesNames;e.exports=function(t,e,r){i(t,e,r,{type:"geo",attributes:o,handleDefaults:n,partition:"y"})}},{"../../subplot_defaults":838,"../constants":798,"./layout_attributes":803}],803:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("../constants"),a=t("../../../plot_api/edit_types").overrideAll,o={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number"},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:n.lightLine},gridwidth:{valType:"number",min:0,dflt:1}};e.exports=a({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]}},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:Object.keys(i.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:Object.keys(i.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:n.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:i.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:i.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:i.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:i.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:n.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:n.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:n.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:n.background},lonaxis:o,lataxis:o},"plot","from-root")},{"../../../components/color/attributes":603,"../../../plot_api/edit_types":756,"../constants":798}],804:[function(t,e,r){"use strict";function n(t){function e(t,e){return{type:"Feature",id:t.id,properties:t.properties,geometry:r(t.geometry,e)}}function r(e,n){if(!e)return null;if("GeometryCollection"===e.type)return{type:"GeometryCollection",geometries:object.geometries.map(function(t){return r(t,n)})};if(!S.hasOwnProperty(e.type))return null;var i=S[e.type];return t.geo.stream(e,n(i)),i.result()}function n(){}function i(t){if((e=t.length)<4)return!1;for(var e,r=0,n=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++rn^d>n&&r<(f-u)*(n-c)/(d-c)+u&&(i=!i)}return i}function o(t){return t?t/Math.sin(t):1}function s(t){return t>1?I:t<-1?-I:Math.asin(t)}function l(t){return t>1?0:t<-1?C:Math.acos(t)}function u(t,e){var r=(2+I)*Math.sin(e);e/=2;for(var n=0,i=1/0;n<10&&Math.abs(i)>E;n++){var a=Math.cos(e);e-=i=(e+Math.sin(e)*(a+2)-r)/(2*a*(1+a))}return[2/Math.sqrt(C*(4+C))*t*(1+Math.cos(e)),2*Math.sqrt(C/(4+C))*Math.sin(e)]}function c(t,e){function r(r,n){var i=R(r/e,n);return i[0]*=t,i}return arguments.length<2&&(e=t),1===e?R:e===1/0?f:(r.invert=function(r,n){var i=R.invert(r/t,n);return i[0]*=e,i},r)}function h(){var t=2,e=O(c),r=e(t);return r.coefficient=function(r){return arguments.length?e(t=+r):t},r}function f(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function d(t,e){return[3*t/(2*C)*Math.sqrt(C*C/3-e*e),e]}function p(t,e){return[t,1.25*Math.log(Math.tan(C/4+.4*e))]}function m(t){return function(e){var r,n=t*Math.sin(e),i=30;do{e-=r=(e+Math.sin(e)-n)/(1+Math.cos(e))}while(Math.abs(r)>E&&--i>0);return e/2}}function g(t,e){var r=e*e,n=r*r;return[t*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),e*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}function v(t,e){var r,n=Math.min(18,36*Math.abs(e)/C),i=Math.floor(n),a=n-i,o=(r=j[i])[0],s=r[1],l=(r=j[++i])[0],u=r[1],c=(r=j[Math.min(19,++i)])[0],h=r[1];return[t*(l+a*(c-o)/2+a*a*(c-2*l+o)/2),(e>0?I:-I)*(u+a*(h-s)/2+a*a*(h-2*u+s)/2)]}function y(t,e){return[t*Math.cos(e),e]}function b(t,e){var r=Math.cos(e),n=o(l(r*Math.cos(t/=2)));return[2*r*Math.sin(t)*n,Math.sin(e)*n]}function x(t,e){var r=b(t,e);return[(r[0]+t/I)/2,(r[1]+e)/2]}t.geo.project=function(t,e){var n=e.stream;if(!n)throw new Error("not yet supported");return(t&&_.hasOwnProperty(t.type)?_[t.type]:r)(t,n)};var _={Feature:e,FeatureCollection:function(t,r){return{type:"FeatureCollection",features:t.features.map(function(t){return e(t,r)})}}},w=[],M=[],k={point:function(t,e){w.push([t,e])},result:function(){var t=w.length?w.length<2?{type:"Point",coordinates:w[0]}:{type:"MultiPoint",coordinates:w}:null;return w=[],t}},A={lineStart:n,point:function(t,e){w.push([t,e])},lineEnd:function(){w.length&&(M.push(w),w=[])},result:function(){var t=M.length?M.length<2?{type:"LineString",coordinates:M[0]}:{type:"MultiLineString",coordinates:M}:null;return M=[],t}},T={polygonStart:n,lineStart:n,point:function(t,e){w.push([t,e])},lineEnd:function(){var t=w.length;if(t){do{w.push(w[0].slice())}while(++t<4);M.push(w),w=[]}},polygonEnd:n,result:function(){if(!M.length)return null;var t=[],e=[];return M.forEach(function(r){i(r)?t.push([r]):e.push(r)}),e.forEach(function(e){var r=e[0];t.some(function(t){if(a(t[0],r))return t.push(e),!0})||t.push([e])}),M=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},S={Point:k,MultiPoint:k,LineString:A,MultiLineString:A,Polygon:T,MultiPolygon:T,Sphere:T},E=1e-6,L=E*E,C=Math.PI,I=C/2,z=(Math.sqrt(C),C/180),D=180/C,P=t.geo.projection,O=t.geo.projectionMutator;t.geo.interrupt=function(e){function r(t,r){for(var n=r<0?-1:1,i=l[+(r<0)],a=0,o=i.length-1;ai[a][2][0];++a);var s=e(t-i[a][1][0],r);return s[0]+=e(i[a][1][0],n*r>n*i[a][0][1]?i[a][0][1]:r)[0],s}function n(){s=l.map(function(t){return t.map(function(t){var r,n=e(t[0][0],t[0][1])[0],i=e(t[2][0],t[2][1])[0],a=e(t[1][0],t[0][1])[1],o=e(t[1][0],t[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]})})}function i(){for(var e=1e-6,r=[],n=0,i=l[0].length;n=0;--n){var o=l[1][n],s=180*o[0][0]/C,u=180*o[0][1]/C,c=180*o[1][1]/C,h=180*o[2][0]/C,f=180*o[2][1]/C;r.push(a([[h-e,f-e],[h-e,c+e],[s+e,c+e],[s+e,u-e]],30))}return{type:"Polygon",coordinates:[t.merge(r)]}}function a(t,e){for(var r,n,i,a=-1,o=t.length,s=t[0],l=[];++aE&&--i>0);return[t/(.8707+(a=n*n)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),n]},(t.geo.naturalEarth=function(){return P(g)}).raw=g;var j=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];j.forEach(function(t){t[1]*=1.0144}),v.invert=function(t,e){var r=e/I,n=90*r,i=Math.min(18,Math.abs(n/5)),a=Math.max(0,Math.floor(i));do{var o=j[a][1],s=j[a+1][1],l=j[Math.min(19,a+2)][1],u=l-o,c=l-2*s+o,h=2*(Math.abs(r)-s)/u,f=c/u,d=h*(1-f*h*(1-2*f*h));if(d>=0||1===a){n=(e>=0?5:-5)*(d+i);var p,m=50;do{i=Math.min(18,Math.abs(n)/5),a=Math.floor(i),d=i-a,o=j[a][1],s=j[a+1][1],l=j[Math.min(19,a+2)][1],n-=(p=(e>=0?I:-I)*(s+d*(l-o)/2+d*d*(l-2*s+o)/2)-e)*D}while(Math.abs(p)>L&&--m>0);break}}while(--a>=0);var g=j[a][0],v=j[a+1][0],y=j[Math.min(19,a+2)][0];return[t/(v+d*(y-g)/2+d*d*(y-2*v+g)/2),n*z]},(t.geo.robinson=function(){return P(v)}).raw=v,y.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return P(y)}).raw=y,b.invert=function(t,e){if(!(t*t+4*e*e>C*C+E)){var r=t,n=e,i=25;do{var a,o=Math.sin(r),s=Math.sin(r/2),u=Math.cos(r/2),c=Math.sin(n),h=Math.cos(n),f=Math.sin(2*n),d=c*c,p=h*h,m=s*s,g=1-p*u*u,v=g?l(h*u)*Math.sqrt(a=1/g):a=0,y=2*v*h*s-t,b=v*c-e,x=a*(p*m+v*h*u*d),_=a*(.5*o*f-2*v*c*s),w=.25*a*(f*s-v*c*p*o),M=a*(d*u+v*m*h),k=_*w-M*x;if(!k)break;var A=(b*_-y*M)/k,T=(y*w-b*x)/k;r-=A,n-=T}while((Math.abs(A)>E||Math.abs(T)>E)&&--i>0);return[r,n]}},(t.geo.aitoff=function(){return P(b)}).raw=b,x.invert=function(t,e){var r=t,n=e,i=25;do{var a,o=Math.cos(n),s=Math.sin(n),u=Math.sin(2*n),c=s*s,h=o*o,f=Math.sin(r),d=Math.cos(r/2),p=Math.sin(r/2),m=p*p,g=1-h*d*d,v=g?l(o*d)*Math.sqrt(a=1/g):a=0,y=.5*(2*v*o*p+r/I)-t,b=.5*(v*s+n)-e,x=.5*a*(h*m+v*o*d*c)+.5/I,_=a*(f*u/4-v*s*p),w=.125*a*(u*p-v*s*h*f),M=.5*a*(c*d+v*m*o)+.5,k=_*w-M*x,A=(b*_-y*M)/k,T=(y*w-b*x)/k;r-=A,n-=T}while((Math.abs(A)>E||Math.abs(T)>E)&&--i>0);return[r,n]},(t.geo.winkel3=function(){return P(x)}).raw=x}e.exports=n},{}],805:[function(t,e,r){"use strict";function n(t,e){var r=t.projection;return(e._isScoped?o:e._isClipped?l:s)(t,r)}function i(t,e){return w.behavior.zoom().translate(e.translate()).scale(e.scale())}function a(t,e,r){function n(t,e){var r=M.nestedProperty(s,t);r.get()!==e&&(r.set(e),M.nestedProperty(o,t).set(e),l[i+"."+t]=e)}var i=t.id,a=t.graphDiv,o=a.layout[i],s=a._fullLayout[i],l={};r(n),n("projection.scale",e.scale()/t.fitScale),a.emit("plotly_relayout",l)}function o(t,e){function r(){w.select(this).style(T)}function n(){e.scale(w.event.scale).translate(w.event.translate),t.render()}function o(r){var n=e.invert(t.midPt);r("center.lon",n[0]),r("center.lat",n[1])}function s(){w.select(this).style(S),a(t,e,o)}var l=i(t,e);return l.on("zoomstart",r).on("zoom",n).on("zoomend",s),l}function s(t,e){function r(t){return e.invert(t)}function n(t){var n=e(r(t));return Math.abs(n[0]-t[0])>b||Math.abs(n[1]-t[1])>b}function o(){w.select(this).style(T),c=w.mouse(this),h=e.rotate(),f=e.translate(),d=h,p=r(c)}function s(){if(m=w.mouse(this),n(c))return y.scale(e.scale()),void y.translate(e.translate());e.scale(w.event.scale),e.translate([f[0],w.event.translate[1]]),p?r(m)&&(v=r(m),g=[d[0]+(v[0]-p[0]),h[1],h[2]],e.rotate(g),d=g):(c=m,p=r(c)),t.render()}function l(){w.select(this).style(S),a(t,e,u)}function u(r){var n=e.rotate(),i=e.invert(t.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",i[0]),r("center.lat",i[1])}var c,h,f,d,p,m,g,v,y=i(t,e),b=2;return y.on("zoomstart",o).on("zoom",s).on("zoomend",l),y}function l(t,e){function r(t){y++||t({type:"zoomstart"})}function n(t){t({type:"zoom"})}function o(t){--y||t({type:"zoomend"})}function s(t){var r=e.rotate();t("projection.rotation.lon",-r[0]),t("projection.rotation.lat",-r[1])}var l,p={r:e.rotate(),k:e.scale()},m=i(t,e),g=_(m,"zoomstart","zoom","zoomend"),y=0,b=m.on;return m.on("zoomstart",function(){w.select(this).style(T);var t=w.mouse(this),i=e.rotate(),a=i,o=e.translate(),s=c(i);l=u(e,t),b.call(m,"zoom",function(){var r=w.mouse(this);if(e.scale(p.k=w.event.scale),l){if(u(e,r)){e.rotate(i).translate(o);var c=u(e,r),m=f(l,c),y=v(h(s,m)),b=p.r=d(y,l,a);isFinite(b[0])&&isFinite(b[1])&&isFinite(b[2])||(b=a),e.rotate(b),a=b}}else t=r,l=u(e,t);n(g.of(this,arguments))}),r(g.of(this,arguments))}).on("zoomend",function(){w.select(this).style(S),b.call(m,"zoom",null),o(g.of(this,arguments)),a(t,e,s)}).on("zoom.redraw",function(){t.render()}),w.rebind(m,g,"on")}function u(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&y(r)}function c(t){var e=.5*t[0]*k,r=.5*t[1]*k,n=.5*t[2]*k,i=Math.sin(e),a=Math.cos(e),o=Math.sin(r),s=Math.cos(r),l=Math.sin(n),u=Math.cos(n);return[a*s*u+i*o*l,i*s*u-a*o*l,a*o*u+i*s*l,a*s*l-i*o*u]}function h(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=e[0],s=e[1],l=e[2],u=e[3];return[r*o-n*s-i*l-a*u,r*s+n*o+i*u-a*l,r*l-n*u+i*o+a*s,r*u+n*l-i*s+a*o]}function f(t,e){if(t&&e){var r=x(t,e),n=Math.sqrt(b(r,r)),i=.5*Math.acos(Math.max(-1,Math.min(1,b(t,e)))),a=Math.sin(i)/n;return n&&[Math.cos(i),r[2]*a,-r[1]*a,r[0]*a]}}function d(t,e,r){var n=g(e,2,t[0]);n=g(n,1,t[1]),n=g(n,0,t[2]-r[2]);var i,a,o=e[0],s=e[1],l=e[2],u=n[0],c=n[1],h=n[2],f=Math.atan2(s,o)*A,d=Math.sqrt(o*o+s*s);Math.abs(c)>d?(a=(c>0?90:-90)-f,i=0):(a=Math.asin(c/d)*A-f,i=Math.sqrt(d*d-c*c));var m=180-a-2*f,v=(Math.atan2(h,u)-Math.atan2(l,i))*A,y=(Math.atan2(h,u)-Math.atan2(l,-i))*A;return p(r[0],r[1],a,v)<=p(r[0],r[1],m,y)?[a,v,r[2]]:[m,y,r[2]]}function p(t,e,r,n){var i=m(r-t),a=m(n-e);return Math.sqrt(i*i+a*a)}function m(t){return(t%360+540)%360-180}function g(t,e,r){var n=r*k,i=t.slice(),a=0===e?1:0,o=2===e?1:2,s=Math.cos(n),l=Math.sin(n);return i[a]=t[a]*s-t[o]*l,i[o]=t[o]*s+t[a]*l,i}function v(t){return[Math.atan2(2*(t[0]*t[1]+t[2]*t[3]),1-2*(t[1]*t[1]+t[2]*t[2]))*A,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*A,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*A]}function y(t){var e=t[0]*k,r=t[1]*k,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function b(t,e){for(var r=0,n=0,i=t.length;nMath.abs(u)?(h.boxEnd[1]=h.boxStart[1]+Math.abs(s)*w*(u>=0?1:-1),h.boxEnd[1]f[3]&&(h.boxEnd[1]=f[3],h.boxEnd[0]=h.boxStart[0]+(f[3]-h.boxStart[1])/Math.abs(w))):(h.boxEnd[0]=h.boxStart[0]+Math.abs(u)/w*(s>=0?1:-1),h.boxEnd[0]f[2]&&(h.boxEnd[0]=f[2],h.boxEnd[1]=h.boxStart[1]+(f[2]-h.boxStart[0])*Math.abs(w)))}}else h.boxEnabled?(s=h.boxStart[0]!==h.boxEnd[0],u=h.boxStart[1]!==h.boxEnd[1],s||u?(s&&(o(0,h.boxStart[0],h.boxEnd[0]),t.xaxis.autorange=!1),u&&(o(1,h.boxStart[1],h.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),h.boxEnabled=!1,h.boxInited=!1):h.boxInited&&(h.boxInited=!1);break;case"pan":h.boxEnabled=!1,h.boxInited=!1,n?(h.panning||(h.dragStart[0]=i,h.dragStart[1]=a),Math.abs(h.dragStart[0]-i)f[p+2]&&(f[p]=-1,f[p+2]=1),d=this[_[p]],d._length=o.viewBox[p+2]-o.viewBox[p],l.doAutoRange(d),d.setScale();b(s),o.ticks=this.computeTickMarks(),o.dataBox=this.calcDataBox(),o.merge(r),n.update(o),this.glplot.draw()},w.calcDataBox=function(){var t=this.xaxis,e=this.yaxis,r=t.range,n=e.range,i=t.r2l,a=e.r2l;return[i(r[0]),a(n[0]),i(r[1]),a(n[1])]},w.setRanges=function(t){var e=this.xaxis,r=this.yaxis,n=e.l2r,i=r.l2r;e.range=[n(t[0]),n(t[2])],r.range=[i(t[1]),i(t[3])]},w.updateTraces=function(t,e){var r,n,i,a=Object.keys(this.traces);this.fullData=t;t:for(r=0;rMath.abs(e))u.rotate(a,0,0,-t*r*Math.PI*p.rotateSpeed/window.innerWidth);else{var o=-p.zoomSpeed*n*e/window.innerHeight*(a-u.lastT())/20;u.pan(a,0,0,h*(Math.exp(o)-1))}}},!0),p}e.exports=n;var i=t("right-now"),a=t("3d-view"),o=t("mouse-change"),s=t("mouse-wheel"),l=t("mouse-event-offset")},{"3d-view":37,"mouse-change":452,"mouse-event-offset":453,"mouse-wheel":455,"right-now":502}],811:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../components/fx/layout_attributes"),a=t("./scene"),o=t("../plots"),s=t("../../lib"),l=t("../../constants/xmlns_namespaces");r.name="gl3d",r.attr="scene",r.idRoot="scene",r.idRegex=r.attrRegex=s.counterRegex("scene"),r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.baseLayoutAttrOverrides=n({hoverlabel:i.hoverlabel},"plot","nested"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,n=o.getSubplotIds(e,"gl3d"),i=0;i1;s(t,e,r,{type:"gl3d",attributes:u,handleDefaults:n,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:a,paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":604,"../../../lib":728,"../../../registry":846,"../../subplot_defaults":838,"./axis_defaults":814,"./layout_attributes":817}],817:[function(t,e,r){"use strict";function n(t,e,r){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:e,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}var i=t("./axis_attributes"),a=t("../../../lib/extend").extendFlat,o=t("../../../lib").counterRegex;e.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:a(n(0,0,1),{}),center:a(n(0,0,0),{}),eye:a(n(1.25,1.25,1.25),{}),editType:"camera"},domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot"},y:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot"},editType:"plot"},aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:i,yaxis:i,zaxis:i,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],dflt:"turntable",editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":728,"../../../lib/extend":717,"./axis_attributes":813}],818:[function(t,e,r){"use strict";function n(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}function i(t){var e=new n;return e.merge(t),e}var a=t("../../../lib/str2rgbarray"),o=["xaxis","yaxis","zaxis"];n.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[o[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=a(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=i},{"../../../lib/str2rgbarray":749}],819:[function(t,e,r){"use strict";function n(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],i=new Array(n.length),a=0;af[1][o]?d[o]=1:f[1][o]===f[0][o]?d[o]=1:d[o]=1/(f[1][o]-f[0][o]);for(this.dataScale=d,this.convertAnnotations(this),a=0;am[1][a])m[0][a]=-1,m[1][a]=1;else{var A=m[1][a]-m[0][a];m[0][a]-=A/32,m[1][a]+=A/32}}else{var S=l.range;m[0][a]=l.r2l(S[0]),m[1][a]=l.r2l(S[1])}m[0][a]===m[1][a]&&(m[0][a]-=1,m[1][a]+=1),g[a]=m[1][a]-m[0][a],this.glplot.bounds[0][a]=m[0][a]*d[a],this.glplot.bounds[1][a]=m[1][a]*d[a]}var E=[1,1,1];for(a=0;a<3;++a){l=c[T[a]],u=l.type;var L=v[u];E[a]=Math.pow(L.acc,1/L.count)/d[a]}var C;if("auto"===c.aspectmode)C=Math.max.apply(null,E)/Math.min.apply(null,E)<=4?E:[1,1,1];else if("cube"===c.aspectmode)C=[1,1,1];else if("data"===c.aspectmode)C=E;else{if("manual"!==c.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var I=c.aspectratio;C=[I.x,I.y,I.z]}c.aspectratio.x=h.aspectratio.x=C[0],c.aspectratio.y=h.aspectratio.y=C[1],c.aspectratio.z=h.aspectratio.z=C[2],this.glplot.aspect=C;var z=c.domain||null,D=e._size||null;if(z&&D){var P=this.container.style;P.position="absolute",P.left=D.l+z.x[0]*D.w+"px",P.top=D.t+(1-z.y[1])*D.h+"px",P.width=D.w*(z.x[1]-z.x[0])+"px",P.height=D.h*(z.y[1]-z.y[0])+"px"}this.glplot.redraw()}},A.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=this.glplot.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},A.getCamera=function(){return this.glplot.camera.view.recalcMatrix(this.camera.view.lastT()),u(this.glplot.camera)},A.setCamera=function(t){this.glplot.camera.lookAt.apply(this,l(t))},A.saveCamera=function(t){var e=this.getCamera(),r=m.nestedProperty(t,this.id+".camera"),n=r.get(),i=!1;if(void 0===n)i=!0;else for(var a=0;a<3;a++)for(var o=0;o<3;o++)if(!function(t,e,r,n){var i=["up","center","eye"],a=["x","y","z"];return e[i[r]]&&t[i[r]][a[n]]===e[i[r]][a[n]]}(e,n,a,o)){i=!0;break}return i&&r.set(e),i},A.updateFx=function(t,e){var r=this.camera;r&&("orbit"===t?(r.mode="orbit",r.keyBindingMode="rotate"):"turntable"===t?(r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate"):r.keyBindingMode=t),this.fullSceneLayout.hovermode=e},A.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(c),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,n=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*n*4);e.readPixels(0,0,r,n,e.RGBA,e.UNSIGNED_BYTE,i);for(var a=0,o=n-1;a0}function a(t){var e={},r={};switch(t.type){case"circle":s.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":s.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity});break;case"fill":s.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var n=t.symbol,i=l(n.textposition,n.iconsize);s.extendFlat(e,{"icon-image":n.icon+"-15","icon-size":n.iconsize/10,"text-field":n.text,"text-size":n.textfont.size,"text-anchor":i.anchor,"text-offset":i.offset}),s.extendFlat(r,{"icon-color":t.color,"text-color":n.textfont.color,"text-opacity":t.opacity})}return{layout:e,paint:r}}function o(t){var e,r=t.sourcetype,n=t.source,i={type:r},a="string"==typeof n;return"geojson"===r?e="data":"vector"===r&&(e=a?"url":"tiles"),i[e]=n,i}var s=t("../../lib"),l=t("./convert_text_opts"),u=n.prototype;u.update=function(t){this.visible?this.needsNewSource(t)?(this.updateLayer(t),this.updateSource(t)):this.needsNewLayer(t)&&this.updateLayer(t):(this.updateSource(t),this.updateLayer(t)),this.updateStyle(t),this.visible=i(t)},u.needsNewSource=function(t){return this.sourceType!==t.sourcetype||this.source!==t.source||this.layerType!==t.type},u.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==t.below},u.updateSource=function(t){var e=this.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,i(t)){var r=o(t);e.addSource(this.idSource,r)}},u.updateLayer=function(t){var e=this.map;if(e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer),this.layerType=t.type,i(t)){e.addLayer({id:this.idLayer,source:this.idSource,"source-layer":t.sourcelayer||"",type:t.type},t.below);var r={visibility:"visible"};this.mapbox.setOptions(this.idLayer,"setLayoutProperty",r)}},u.updateStyle=function(t){var e=a(t);i(t)&&(this.mapbox.setOptions(this.idLayer,"setLayoutProperty",e.layout),this.mapbox.setOptions(this.idLayer,"setPaintProperty",e.paint))},u.dispose=function(){var t=this.map;t.removeLayer(this.idLayer),t.removeSource(this.idSource)},e.exports=function(t,e,r){var i=new n(t,e);return i.update(r),i}},{"../../lib":728,"./convert_text_opts":824}],827:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color").defaultLine,a=t("../font_attributes"),o=t("../../traces/scatter/attributes").textposition,s=t("../../plot_api/edit_types").overrideAll,l=a({});l.family.dflt="Open Sans Regular, Arial Unicode MS Regular",e.exports=s({_arrayAttrRegexps:[n.counterRegex("mapbox",".layers",!0)],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]}},accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],dflt:"basic"},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},layers:{_isLinkedToArray:"layer",sourcetype:{valType:"enumerated",values:["geojson","vector"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},type:{valType:"enumerated",values:["circle","line","fill","symbol"],dflt:"circle"},below:{valType:"string",dflt:""},color:{valType:"color",dflt:i},opacity:{valType:"number",min:0,max:1,dflt:1},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2}},fill:{outlinecolor:{valType:"color",dflt:i}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},textfont:l,textposition:n.extendFlat({},o,{arrayOk:!1})}}},"plot","from-root")},{"../../components/color":604,"../../lib":728,"../../plot_api/edit_types":756,"../../traces/scatter/attributes":1031,"../font_attributes":796}],828:[function(t,e,r){"use strict";function n(t,e,r){r("accesstoken"),r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch"),i(t,e),e._input=t}function i(t,e){function r(t,e){return a.coerce(n,i,s.layers,t,e)}for(var n,i,o=t.layers||[],l=e.layers=[],u=0;u=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),r.attr(a);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),u=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&n(t,o),s.text(o.text()&&u.text()?" - ":"")}},g.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=l.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return n.append("input").attr({type:"text",name:"data"}).node().value=g.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},g.supplyDefaults=function(t){var e,r=t._fullLayout||{},n=t._fullLayout={},a=t.layout||{},o=t._fullData||[],s=t._fullData=[],l=t.data||[];if(t._transitionData||g.createTransitionData(t),r._initialAutoSizeIsDone){var u=r.width,h=r.height;g.supplyLayoutGlobalDefaults(a,n),a.width||(n.width=u),a.height||(n.height=h)}else{g.supplyLayoutGlobalDefaults(a,n);var f=!a.width||!a.height,d=n.autosize,p=t._context&&t._context.autosizable;f&&(d||p)?g.plotAutoSize(t,a,n):f&&g.sanitizeMargins(t),!d&&f&&(a.width=n.width,a.height=n.height)}n._initialAutoSizeIsDone=!0,n._dataLength=l.length,n._globalTransforms=(t._context||{}).globalTransforms,g.supplyDataDefaults(l,s,a,n),n._has=g._hasPlotType.bind(n);var m=n._modules;for(e=0;e0){var c=o(t._boundingBoxMargins),h=c.left+c.right,f=c.bottom+c.top,p=1-2*s,m=r._container&&r._container.node?r._container.node().getBoundingClientRect():{width:r.width,height:r.height};n=Math.round(p*(m.width-h)),i=Math.round(p*(m.height-f))}else{var v=l?window.getComputedStyle(t):{};n=parseFloat(v.width)||r.width,i=parseFloat(v.height)||r.height}var y=g.layoutAttributes.width.min,b=g.layoutAttributes.height.min;n1,_=!e.height&&Math.abs(r.height-i)>1;(_||x)&&(x&&(r.width=n),_&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),g.sanitizeMargins(r)},g.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a;c.Axes.supplyLayoutDefaults(t,e,r);var o=e._basePlotModules;for(i=0;i.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+i},r:{val:r.x,size:r.r+i},b:{val:r.y,size:r.b+i},t:{val:r.y,size:r.t+i}}}else delete n._pushmargin[e];n._replotting||g.doAutoMargin(t)}},g.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),i=Math.max(e.margin.l||0,0),a=Math.max(e.margin.r||0,0),o=Math.max(e.margin.t||0,0),s=Math.max(e.margin.b||0,0),l=e._pushmargin;if(!1!==e.margin.autoexpand){l.base={l:{val:0,size:i},r:{val:1,size:a},t:{val:1,size:o},b:{val:0,size:s}};for(var h=Object.keys(l),f=0;fg){var k=(v*w+(M-e.width)*g)/(w-g),A=(M*(1-g)+(v-e.width)*(1-w))/(w-g);k>=0&&A>=0&&k+A>i+a&&(i=k,a=A)}}if(u(b)&&l[_].t){var T=l[_].t.val,S=l[_].t.size;if(T>y){var E=(b*T+(S-e.height)*y)/(T-y),L=(S*(1-y)+(b-e.height)*(1-T))/(T-y);E>=0&&L>=0&&E+L>s+o&&(s=E,o=L)}}}}if(r.l=Math.round(i),r.r=Math.round(a),r.t=Math.round(o),r.b=Math.round(s),r.p=Math.round(e.margin.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,!e._replotting&&"{}"!==n&&n!==JSON.stringify(e._size))return c.plot(t)},g.graphJson=function(t,e,r,n,i){function a(t){if("function"==typeof t)return null;if(d.isPlainObject(t)){var e,n,i={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0&&!d.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;i[e]=a(t[e])}return i}return Array.isArray(t)?t.map(a):d.isJSDate(t)?d.ms2DateTimeLocal(+t):t}(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&g.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l=(t._transitionData||{})._frames,u={data:(o||[]).map(function(t){var r=a(t);return e&&delete r.fit,r})};return e||(u.layout=a(s)),t.framework&&t.framework.isPolar&&(u=t.framework.getConfig()),l&&(u.frames=a(l)),"object"===n?u:JSON.stringify(u)},g.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){x=!0}),i.redraw&&t._transitionData._interruptCallbacks.push(function(){return c.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var o,s,l=0,u=0,f=t._fullLayout._basePlotModules,p=!1;if(r)for(s=0;s=0,L=E?f.angularAxis.domain:n.extent(k),C=Math.abs(k[1]-k[0]);T&&!A&&(C=0);var I=L.slice();S&&A&&(I[1]+=C);var z=f.angularAxis.ticksCount||4;z>8&&(z=z/(z/8)+z%8),f.angularAxis.ticksStep&&(z=(I[1]-I[0])/z);var D=f.angularAxis.ticksStep||(I[1]-I[0])/(z*(f.minorTicks+1));M&&(D=Math.max(Math.round(D),1)),I[2]||(I[2]=D);var P=n.range.apply(this,I);if(P=P.map(function(t,e){return parseFloat(t.toPrecision(12))}),l=n.scale.linear().domain(I.slice(0,2)).range("clockwise"===f.direction?[0,360]:[360,0]),h.layout.angularAxis.domain=l.domain(),h.layout.angularAxis.endPadding=S?C:0,void 0===(e=n.select(this).select("svg.chart-root"))||e.empty()){var O=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),R=this.appendChild(this.ownerDocument.importNode(O.documentElement,!0));e=n.select(R)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var F,j=e.select(".chart-group"),N={fill:"none",stroke:f.tickColor},B={"font-size":f.font.size,"font-family":f.font.family,fill:f.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+f.font.outlineColor}).join(",")};if(f.showLegend){F=e.select(".legend-group").attr({transform:"translate("+[x,f.margin.top]+")"}).style({display:"block"});var U=p.map(function(t,e){var r=s.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});s.Legend().config({data:p.map(function(t,e){return t.name||"Element"+e}),legendConfig:a({},s.Legend.defaultConfig().legendConfig,{container:F,elements:U,reverseOrder:f.legend.reverseOrder})})();var V=F.node().getBBox();x=Math.min(f.width-V.width-f.margin.left-f.margin.right,f.height-f.margin.top-f.margin.bottom)/2,x=Math.max(10,x),w=[f.margin.left+x,f.margin.top+x],i.range([0,x]),h.layout.radialAxis.domain=i.domain(),F.attr("transform","translate("+[w[0]+x,w[1]-x]+")")}else F=e.select(".legend-group").style({display:"none"});e.attr({width:f.width,height:f.height}).style({opacity:f.opacity}),j.attr("transform","translate("+w+")").style({cursor:"crosshair"});var H=[(f.width-(f.margin.left+f.margin.right+2*x+(V?V.width:0)))/2,(f.height-(f.margin.top+f.margin.bottom+2*x))/2];if(H[0]=Math.max(0,H[0]),H[1]=Math.max(0,H[1]),e.select(".outer-group").attr("transform","translate("+H+")"),f.title){var q=e.select("g.title-group text").style(B).text(f.title),G=q.node().getBBox();q.attr({x:w[0]-G.width/2,y:w[1]-x-20})}var Y=e.select(".radial.axis-group");if(f.radialAxis.gridLinesVisible){var W=Y.selectAll("circle.grid-circle").data(i.ticks(5));W.enter().append("circle").attr({class:"grid-circle"}).style(N),W.attr("r",i),W.exit().remove()}Y.select("circle.outside-circle").attr({r:x}).style(N);var X=e.select("circle.background-circle").attr({r:x}).style({fill:f.backgroundColor,stroke:f.stroke});if(f.radialAxis.visible){var Z=n.svg.axis().scale(i).ticks(5).tickSize(5);Y.call(Z).attr({transform:"rotate("+f.radialAxis.orientation+")"}),Y.selectAll(".domain").style(N),Y.selectAll("g>text").text(function(t,e){return this.textContent+f.radialAxis.ticksSuffix}).style(B).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===f.radialAxis.tickOrientation?"rotate("+-f.radialAxis.orientation+") translate("+[0,B["font-size"]]+")":"translate("+[0,B["font-size"]]+")"}}),Y.selectAll("g>line").style({stroke:"black"})}var J=e.select(".angular.axis-group").selectAll("g.angular-tick").data(P),K=J.enter().append("g").classed("angular-tick",!0);J.attr({transform:function(t,e){return"rotate("+u(t,e)+")"}}).style({display:f.angularAxis.visible?"block":"none"}),J.exit().remove(),K.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(f.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(f.minorTicks+1)==0)}).style(N),K.selectAll(".minor").style({stroke:f.minorTickColor}),J.select("line.grid-line").attr({x1:f.tickLength?x-f.tickLength:0,x2:x}).style({display:f.angularAxis.gridLinesVisible?"block":"none"}),K.append("text").classed("axis-text",!0).style(B);var Q=J.select("text.axis-text").attr({x:x+f.labelOffset,dy:o+"em",transform:function(t,e){var r=u(t,e),n=x+f.labelOffset,i=f.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:f.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(f.minorTicks+1)!=0?"":M?M[t]+f.angularAxis.ticksSuffix:t+f.angularAxis.ticksSuffix}).style(B);f.angularAxis.rewriteTicks&&Q.text(function(t,e){return e%(f.minorTicks+1)!=0?"":f.angularAxis.rewriteTicks(this.textContent,e)});var $=n.max(j.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));F.attr({transform:"translate("+[x+$,f.margin.top]+")"});var tt=e.select("g.geometry-group").selectAll("g").size()>0,et=e.select("g.geometry-group").selectAll("g.geometry").data(p);if(et.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),et.exit().remove(),p[0]||tt){var rt=[];p.forEach(function(t,e){var r={};r.radialScale=i,r.angularScale=l,r.container=et.filter(function(t,r){return r==e}),r.geometry=t.geometry,r.orientation=f.orientation,r.direction=f.direction,r.index=e,rt.push({data:t,geometryConfig:r})});var nt=n.nest().key(function(t,e){return void 0!==t.data.groupId||"unstacked"}).entries(rt),it=[];nt.forEach(function(t,e){"unstacked"===t.key?it=it.concat(t.values.map(function(t,e){return[t]})):it.push(t.values)}),it.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return a(s[r].defaultConfig(),t)});s[r]().config(n)()})}var at,ot,st=e.select(".guides-group"),lt=e.select(".tooltips-group"),ut=s.tooltipPanel().config({container:lt,fontSize:8})(),ct=s.tooltipPanel().config({container:lt,fontSize:8})(),ht=s.tooltipPanel().config({container:lt,hasTick:!0})();if(!A){var ft=st.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});j.on("mousemove.angular-guide",function(t,e){var r=s.util.getMousePos(X).angle;ft.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-f.orientation)%360;at=l.invert(n);var i=s.util.convertToCartesian(x+12,r+180);ut.text(s.util.round(at)).move([i[0]+w[0],i[1]+w[1]])}).on("mouseout.angular-guide",function(t,e){st.select("line").style({opacity:0})})}var dt=st.select("circle").style({stroke:"grey",fill:"none"});j.on("mousemove.radial-guide",function(t,e){var r=s.util.getMousePos(X).radius;dt.attr({r:r}).style({opacity:.5}),ot=i.invert(s.util.getMousePos(X).radius);var n=s.util.convertToCartesian(r,f.radialAxis.orientation);ct.text(s.util.round(ot)).move([n[0]+w[0],n[1]+w[1]])}).on("mouseout.radial-guide",function(t,e){dt.style({opacity:0}),ht.hide(),ut.hide(),ct.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,r){var i=n.select(this),a=this.style.fill,o="black",l=this.style.opacity||1;if(i.attr({"data-opacity":l}),a&&"none"!==a){i.attr({"data-fill":a}),o=n.hsl(a).darker().toString(),i.style({fill:o,opacity:1});var u={t:s.util.round(t[0]),r:s.util.round(t[1])};A&&(u.t=M[t[0]]);var c="t: "+u.t+", r: "+u.r,h=this.getBoundingClientRect(),f=e.node().getBoundingClientRect(),d=[h.left+h.width/2-H[0]-f.left,h.top+h.height/2-H[1]-f.top];ht.config({color:o}).text(c),ht.move(d)}else a=this.style.stroke||"black",i.attr({"data-stroke":a}),o=n.hsl(a).darker().toString(),i.style({stroke:o,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ht.show()}).on("mouseout.tooltip",function(t,e){ht.hide();var r=n.select(this),i=r.attr("data-fill");i?r.style({fill:i,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})}),d}var e,r,i,l,u={data:[],layout:{}},c={},h={},f=n.dispatch("hover"),d={};return d.render=function(e){return t(e),this},d.config=function(t){if(!arguments.length)return u;var e=s.util.cloneJson(t);return e.data.forEach(function(t,e){u.data[e]||(u.data[e]={}),a(u.data[e],s.Axis.defaultConfig().data[0]),a(u.data[e],t)}),a(u.layout,s.Axis.defaultConfig().layout),a(u.layout,e.layout),this},d.getLiveConfig=function(){return h},d.getinputConfig=function(){return c},d.radialScale=function(t){return i},d.angularScale=function(t){return l},d.svg=function(){return e},n.rebind(d,f,"on"),d},s.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},s.util={},s.DATAEXTENT="dataExtent",s.AREA="AreaChart",s.LINE="LinePlot",s.DOT="DotPlot",s.BAR="BarChart",s.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},s.util._extend=function(t,e){for(var r in t)e[r]=t[r]},s.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},s.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180;return[e,t(n)]})},s.util.dataFromEquation=function(t,e,r){var i=e||6,a=[],o=[];n.range(0,360+i,i).forEach(function(e,r){var n=e*Math.PI/180,i=t(n);a.push(e),o.push(i)});var s={t:a,r:o};return r&&(s.name=r),s},s.util.ensureArray=function(t,e){if(void 0===t)return null;var r=[].concat(t);return n.range(e).map(function(t,e){return r[e]||r[0]})},s.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=s.util.ensureArray(t[e],r)}),t},s.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},s.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},s.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},s.util.arrayLast=function(t){return t[t.length-1]},s.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},s.util.flattenArray=function(t){for(var e=[];!s.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},s.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},s.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},s.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},s.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],i=e[1],a={};return a.x=r,a.y=i,a.pos=e,a.angle=180*(Math.atan2(i,r)+Math.PI)/Math.PI,a.radius=Math.sqrt(r*r+i*i),a},s.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,a=t.length;i0)){var s=n.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({class:"line",d:f(o),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return g.fill(r,i,a)},"fill-opacity":0,stroke:function(t,e){return g.stroke(r,i,a)},"stroke-width":function(t,e){return g["stroke-width"](r,i,a)},"stroke-dasharray":function(t,e){return g["stroke-dasharray"](r,i,a)},opacity:function(t,e){return g.opacity(r,i,a)},display:function(t,e){return g.display(r,i,a)}})}};var d=t.angularScale.range(),p=Math.abs(d[1]-d[0])/l[0].length*Math.PI/180,m=n.svg.arc().startAngle(function(t){return-p/2}).endAngle(function(t){return p/2}).innerRadius(function(e){return t.radialScale(c+(e[2]||0))}).outerRadius(function(e){return t.radialScale(c+(e[2]||0))+t.radialScale(e[1])});h.arc=function(e,r,i){n.select(this).attr({class:"mark arc",d:m,transform:function(e,r){return"rotate("+(t.orientation+u(e[0])+90)+")"}})};var g={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 i[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return void 0===e[n].data.visible||e[n].data.visible?"block":"none"}},v=n.select(this).selectAll("g.layer").data(l);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(g).each(h[t.geometryType]),y.exit().remove(),v.exit().remove()})}var e=[s.PolyChart.defaultConfig()],r=n.dispatch("hover"),i={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,r){e[r]||(e[r]={}),a(e[r],s.PolyChart.defaultConfig()),a(e[r],t)}),this):e},t.getColorScale=function(){},n.rebind(t,r,"on"),t},s.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},s.BarChart=function(){return s.PolyChart()},s.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},s.AreaChart=function(){return s.PolyChart()},s.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},s.DotPlot=function(){return s.PolyChart()},s.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},s.LinePlot=function(){return s.PolyChart()},s.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},s.Legend=function(){function t(){var r=e.legendConfig,i=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var i=a({},r.elements[e]);return i.name=t,i.color=[].concat(r.elements[e].color)[n],i})}),o=n.merge(i);o=o.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||void 0===r.elements[e].visibleInLegend)}),r.reverseOrder&&(o=o.reverse());var s=r.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map(function(t,e){return t.color}),u=r.fontSize,c=null==r.isContinuous?"number"==typeof o[0]:r.isContinuous,h=c?r.height:u*o.length,f=s.classed("legend-group",!0),d=f.selectAll("svg").data([0]),p=d.enter().append("svg").attr({width:300,height:h+u,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 m=n.range(o.length),g=n.scale[c?"linear":"ordinal"]().domain(m).range(l),v=n.scale[c?"linear":"ordinal"]().domain(m)[c?"range":"rangePoints"]([0,h]),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":-1!=n.svg.symbolTypes.indexOf(t)?n.svg.symbol().type(t).size(r)():n.svg.symbol().type("square").size(r)()};if(c){var b=d.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);b.enter().append("stop"),b.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),d.append("rect").classed("legend-mark",!0).attr({height:r.height,width:r.colorBandWidth,fill:"url(#grad1)"})}else{var x=d.select(".legend-marks").selectAll("path.legend-mark").data(o);x.enter().append("path").classed("legend-mark",!0),x.attr({transform:function(t,e){return"translate("+[u/2,v(e)+u/2]+")"},d:function(t,e){var r=t.symbol;return y(r,u)},fill:function(t,e){return g(e)}}),x.exit().remove()}var _=n.svg.axis().scale(v).orient("right"),w=d.select("g.legend-axis").attr({transform:"translate("+[c?r.colorBandWidth:u,u/2]+")"}).call(_);return w.selectAll(".domain").style({fill:"none",stroke:"none"}),w.selectAll("line").style({fill:"none",stroke:c?r.textColor:"none"}),w.selectAll("text").style({fill:r.textColor,"font-size":r.fontSize}).text(function(t,e){return o[e].name}),t}var e=s.Legend.defaultConfig(),r=n.dispatch("hover");return t.config=function(t){return arguments.length?(a(e,t),this):e},n.rebind(t,r,"on"),t},s.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},s.tooltipPanel=function(){var t,e,r,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},o="tooltip-"+s.tooltipPanel.uid++,l=function(){t=i.container.selectAll("g."+o).data([0]);var n=t.enter().append("g").classed(o,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:i.padding+10,dy:.3*+i.fontSize}),l};return l.text=function(a){var o=n.hsl(i.color).l,s=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",c=a||"";e.style({fill:u,"font-size":i.fontSize+"px"}).text(c);var h=i.padding,f=e.node().getBBox(),d={fill:i.color,stroke:s,"stroke-width":"2px"},p=f.width+2*h+10,m=f.height+2*h;return r.attr({d:"M"+[[10,-m/2],[10,-m/4],[i.hasTick?0:10,0],[10,m/4],[10,m/2],[p,m/2],[p,-m/2]].join("L")+"Z"}).style(d),t.attr({transform:"translate("+[10,-m/2+2*h]+")"}),t.style({display:"block"}),l},l.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),l},l.hide=function(){if(t)return t.style({display:"none"}),l},l.show=function(){if(t)return t.style({display:"block"}),l},l.config=function(t){return a(i,t),l},l},s.tooltipPanel.uid=1,s.adapter={},s.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=a({},t);return[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]].forEach(function(t,r){s.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var i=s.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=i.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)})}if(t.layout){var o=a({},t.layout);if([[o,["plot_bgcolor"],["backgroundColor"]],[o,["showlegend"],["showLegend"]],[o,["radialaxis"],["radialAxis"]],[o,["angularaxis"],["angularAxis"]],[o.angularaxis,["showline"],["gridLinesVisible"]],[o.angularaxis,["showticklabels"],["labelsVisible"]],[o.angularaxis,["nticks"],["ticksCount"]],[o.angularaxis,["tickorientation"],["tickOrientation"]],[o.angularaxis,["ticksuffix"],["ticksSuffix"]],[o.angularaxis,["range"],["domain"]],[o.angularaxis,["endpadding"],["endPadding"]],[o.radialaxis,["showline"],["gridLinesVisible"]],[o.radialaxis,["tickorientation"],["tickOrientation"]],[o.radialaxis,["ticksuffix"],["ticksSuffix"]],[o.radialaxis,["range"],["domain"]],[o.angularAxis,["showline"],["gridLinesVisible"]],[o.angularAxis,["showticklabels"],["labelsVisible"]],[o.angularAxis,["nticks"],["ticksCount"]],[o.angularAxis,["tickorientation"],["tickOrientation"]],[o.angularAxis,["ticksuffix"],["ticksSuffix"]],[o.angularAxis,["range"],["domain"]],[o.angularAxis,["endpadding"],["endPadding"]],[o.radialAxis,["showline"],["gridLinesVisible"]],[o.radialAxis,["tickorientation"],["tickOrientation"]],[o.radialAxis,["ticksuffix"],["ticksSuffix"]],[o.radialAxis,["range"],["domain"]],[o.font,["outlinecolor"],["outlineColor"]],[o.legend,["traceorder"],["reverseOrder"]],[o,["labeloffset"],["labelOffset"]],[o,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(t,r){s.util.translator.apply(null,t.concat(e))}),e?(void 0!==o.tickLength&&(o.angularaxis.ticklen=o.tickLength,delete o.tickLength),o.tickColor&&(o.angularaxis.tickcolor=o.tickColor,delete o.tickColor)):(o.angularAxis&&void 0!==o.angularAxis.ticklen&&(o.tickLength=o.angularAxis.ticklen),o.angularAxis&&void 0!==o.angularAxis.tickcolor&&(o.tickColor=o.angularAxis.tickcolor)),o.legend&&"boolean"!=typeof o.legend.reverseOrder&&(o.legend.reverseOrder="normal"!=o.legend.reverseOrder),o.legend&&"boolean"==typeof o.legend.traceorder&&(o.legend.traceorder=o.legend.traceorder?"reversed":"normal",delete o.legend.reverseOrder),o.margin&&void 0!==o.margin.t){var l=["t","r","b","l","pad"],u=["top","right","bottom","left","pad"],c={};n.entries(o.margin).forEach(function(t,e){c[u[l.indexOf(t.key)]]=t.value}),o.margin=c}e&&(delete o.needsEndSpacing,delete o.minorTickColor,delete o.minorTicks,delete o.angularaxis.ticksCount,delete o.angularaxis.ticksCount,delete o.angularaxis.ticksStep,delete o.angularaxis.rewriteTicks,delete o.angularaxis.nticks,delete o.radialaxis.ticksCount,delete o.radialaxis.ticksCount,delete o.radialaxis.ticksStep,delete o.radialaxis.rewriteTicks,delete o.radialaxis.nticks),r.layout=o}return r},t}},{"../../constants/alignment":701,"../../lib":728,d3:122}],836:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=i.extendDeepAll,u=e.exports={};u.framework=function(t){function e(e,i){return i&&(h=i),n.select(n.select(h).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),r=r?l(r,e):e,a||(a=o.Axis()),c=o.adapter.plotly().convert(r),a.config(c).render(h),t.data=r.data,t.layout=r.layout,u.fillLayout(t),r}var r,i,a,c,h,f=new s;return e.isPolar=!0,e.svg=function(){return a.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},e.setUndoPoint=function(){var t=this,e=o.util.cloneJson(r);!function(e,r){f.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,i),i=o.util.cloneJson(e)},e.undo=function(){f.undo()},e.redo=function(){f.redo()},e},u.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),i=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:a.background,_container:e,_paperdiv:r,_paper:i};t._fullLayout=l(o,t.layout)}},{"../../components/color":604,"../../lib":728,"./micropolar":835,"./undo_manager":837,d3:122}],837:[function(t,e,r){"use strict";e.exports=function(){function t(t,e){return t?(i=!0,t[e](),i=!1,this):this}var e,r=[],n=-1,i=!1;return{add:function(t){return i?this:(r.splice(n+1,r.length-n),r.push(t),n=r.length-1,this)},setCallback:function(t){e=t},undo:function(){var i=r[n];return i?(t(i,"undo"),n-=1,e&&e(i.undo),this):this},redo:function(){var i=r[n+1];return i?(t(i,"redo"),n+=1,e&&e(i.redo),this):this},clear:function(){r=[],n=-1},hasUndo:function(){return-1!==n},hasRedo:function(){return n=o&&(d.min=0,p.min=0,m.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}var i=t("../../../components/color"),a=t("../../subplot_defaults"),o=t("./layout_attributes"),s=t("./axis_defaults"),l=["aaxis","baxis","caxis"];e.exports=function(t,e,r){a(t,e,r,{type:"ternary",attributes:o,handleDefaults:n,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../../components/color":604,"../../subplot_defaults":838,"./axis_defaults":842,"./layout_attributes":844}],844:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("./axis_attributes"),a=t("../../../plot_api/edit_types").overrideAll;e.exports=a({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:i,baxis:i,caxis:i},"plot","from-root")},{"../../../components/color/attributes":603,"../../../plot_api/edit_types":756,"./axis_attributes":841}],845:[function(t,e,r){"use strict";function n(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework(e)}function i(t){a.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}var a=t("d3"),o=t("tinycolor2"),s=t("../../plotly"),l=t("../../lib"),u=t("../../components/color"),c=t("../../components/drawing"),h=t("../cartesian/set_convert"),f=t("../../lib/extend").extendFlat,d=t("../plots"),p=t("../cartesian/axes"),m=t("../../components/dragelement"),g=t("../../components/fx"),v=t("../../components/titles"),y=t("../cartesian/select"),b=t("../cartesian/constants");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={},this.layers={}},x.plot=function(t,e){var r=this,n=e[r.id],i=e._size;r._hasClipOnAxisFalse=!1;for(var a=0;a_*b?(a=b,i=a*_):(i=y,a=i/_),o=g*i/y,s=v*a/b,r=e.l+e.w*p-i/2,n=e.t+e.h*(1-m)-a/2,l.x0=r,l.y0=n,l.w=i,l.h=a,l.sum=x,l.xaxis={type:"linear",range:[w+2*k-x,x-w-2*M],domain:[p-o/2,p+o/2],_id:"x"},h(l.xaxis,l.graphDiv._fullLayout),l.xaxis.setScale(),l.xaxis.isPtWithinRange=function(t){return t.a>=l.aaxis.range[0]&&t.a<=l.aaxis.range[1]&&t.b>=l.baxis.range[1]&&t.b<=l.baxis.range[0]&&t.c>=l.caxis.range[1]&&t.c<=l.caxis.range[0]},l.yaxis={type:"linear",range:[w,x-M-k],domain:[m-s/2,m+s/2],_id:"y"},h(l.yaxis,l.graphDiv._fullLayout),l.yaxis.setScale(),l.yaxis.isPtWithinRange=function(){return!0};var A=l.yaxis.domain[0],T=l.aaxis=f({},t.aaxis,{visible:!0,range:[w,x-M-k],side:"left",_counterangle:30,tickangle:(+t.aaxis.tickangle||0)-30,domain:[A,A+s*_],_axislayer:l.layers.aaxis,_gridlayer:l.layers.agrid,_pos:0,_id:"y",_length:i,_gridpath:"M0,0l"+a+",-"+i/2});h(T,l.graphDiv._fullLayout),T.setScale();var S=l.baxis=f({},t.baxis,{visible:!0,range:[x-w-k,M],side:"bottom",_counterangle:30,domain:l.xaxis.domain,_axislayer:l.layers.baxis,_gridlayer:l.layers.bgrid,_counteraxis:l.aaxis,_pos:0,_id:"x",_length:i,_gridpath:"M0,0l-"+i/2+",-"+a});h(S,l.graphDiv._fullLayout),S.setScale(),T._counteraxis=S;var E=l.caxis=f({},t.caxis,{visible:!0,range:[x-w-M,k],side:"right",_counterangle:30,tickangle:(+t.caxis.tickangle||0)+30,domain:[A,A+s*_],_axislayer:l.layers.caxis,_gridlayer:l.layers.cgrid,_counteraxis:l.baxis,_pos:0,_id:"y",_length:i,_gridpath:"M0,0l-"+a+","+i/2});h(E,l.graphDiv._fullLayout),E.setScale();var L="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";l.clipDef.select("path").attr("d",L),l.layers.plotbg.select("path").attr("d",L);var C="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";l.clipDefRelative.select("path").attr("d",C);var I="translate("+r+","+n+")";l.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",I),l.clipDefRelative.select("path").attr("transform",null);var z="translate("+r+","+(n+a)+")";l.layers.baxis.attr("transform",z),l.layers.bgrid.attr("transform",z);var D="translate("+(r+i/2)+","+n+")rotate(30)";l.layers.aaxis.attr("transform",D),l.layers.agrid.attr("transform",D);var P="translate("+(r+i/2)+","+n+")rotate(-30)";l.layers.caxis.attr("transform",P),l.layers.cgrid.attr("transform",P),l.drawAxes(!0),l.plotContainer.selectAll(".crisp").classed("crisp",!1),l.layers.aline.select("path").attr("d",T.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(u.stroke,T.linecolor||"#000").style("stroke-width",(T.linewidth||0)+"px"),l.layers.bline.select("path").attr("d",S.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(u.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),l.layers.cline.select("path").attr("d",E.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(u.stroke,E.linecolor||"#000").style("stroke-width",(E.linewidth||0)+"px"),l.graphDiv._context.staticPlot||l.initInteractions(),c.setClipUrl(l.layers.frontplot,l._hasClipOnAxisFalse?null:l.clipId)},x.drawAxes=function(t){var e=this,r=e.graphDiv,n=e.id.substr(7)+"title",i=e.aaxis,a=e.baxis,o=e.caxis;if(p.doTicks(r,i,!0),p.doTicks(r,a,!0),p.doTicks(r,o,!0),t){var s=Math.max(i.showticklabels?i.tickfont.size/2:0,(o.showticklabels?.75*o.tickfont.size:0)+("outside"===o.ticks?.87*o.ticklen:0));v.draw(r,"a"+n,{propContainer:i,propName:e.id+".aaxis.title",dfltName:"Component A",attributes:{x:e.x0+e.w/2,y:e.y0-i.titlefont.size/3-s,"text-anchor":"middle"}});var l=(a.showticklabels?a.tickfont.size:0)+("outside"===a.ticks?a.ticklen:0)+3;v.draw(r,"b"+n,{propContainer:a,propName:e.id+".baxis.title",dfltName:"Component B",attributes:{x:e.x0-l,y:e.y0+e.h+.83*a.titlefont.size+l,"text-anchor":"middle"}}),v.draw(r,"c"+n,{propContainer:o,propName:e.id+".caxis.title",dfltName:"Component C",attributes:{x:e.x0+e.w+l,y:e.y0+e.h+.83*o.titlefont.size+l,"text-anchor":"middle"}})}};var w=b.MINZOOM/2+.87,M="m-0.87,.5h"+w+"v3h-"+(w+5.2)+"l"+(w/2+2.6)+",-"+(.87*w+4.5)+"l2.6,1.5l-"+w/2+","+.87*w+"Z",k="m0.87,.5h-"+w+"v3h"+(w+5.2)+"l-"+(w/2+2.6)+",-"+(.87*w+4.5)+"l-2.6,1.5l"+w/2+","+.87*w+"Z",A="m0,1l"+w/2+","+.87*w+"l2.6,-1.5l-"+(w/2+2.6)+",-"+(.87*w+4.5)+"l-"+(w/2+2.6)+","+(.87*w+4.5)+"l2.6,1.5l"+w/2+",-"+.87*w+"Z",T=!0;x.initInteractions=function(){function t(t,e,r){var n=F.getBoundingClientRect();w=e-n.left,S=r-n.top,E={a:R.aaxis.range[0],b:R.baxis.range[1],c:R.caxis.range[1]},C=E,L=R.aaxis.range[1]-E.a,I=o(R.graphDiv._fullLayout[R.id].bgcolor).getLuminance(),z="M0,"+R.h+"L"+R.w/2+", 0L"+R.w+","+R.h+"Z",D=!1,P=N.append("path").attr("class","zoombox").attr("transform","translate("+R.x0+", "+R.y0+")").style({fill:I>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",z),O=N.append("path").attr("class","zoombox-corners").attr("transform","translate("+R.x0+", "+R.y0+")").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),v()}function e(t,e){return 1-e/R.h}function r(t,e){return 1-(t+(R.h-e)/Math.sqrt(3))/R.w}function n(t,e){return(t-(R.h-e)/Math.sqrt(3))/R.w}function a(t,i){var a=w+t,o=S+i,s=Math.max(0,Math.min(1,e(w,S),e(a,o))),l=Math.max(0,Math.min(1,r(w,S),r(a,o))),u=Math.max(0,Math.min(1,n(w,S),n(a,o))),c=(s/2+u)*R.w,h=(1-s/2-l)*R.w,f=(c+h)/2,d=h-c,p=(1-s)*R.h,m=p-d/_;d.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),O.transition().style("opacity",1).duration(200),D=!0)}function h(t,e){if(C===E)return 2===e&&x(),i(j);i(j);var r={};r[R.id+".aaxis.min"]=C.a,r[R.id+".baxis.min"]=C.b,r[R.id+".caxis.min"]=C.c,s.relayout(j,r),T&&j.data&&j._context.showTips&&(l.notifier("Double-click to
zoom back out","long"),T=!1)}function f(){E={a:R.aaxis.range[0],b:R.baxis.range[1],c:R.caxis.range[1]},C=E}function d(t,e){var r=t/R.xaxis._m,n=e/R.yaxis._m;C={a:E.a-n,b:E.b+(r+n)/2,c:E.c-(r-n)/2};var i=[C.a,C.b,C.c].sort(),a={a:i.indexOf(C.a),b:i.indexOf(C.b),c:i.indexOf(C.c)};i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),C={a:i[a.a],b:i[a.b],c:i[a.c]},e=(E.a-C.a)*R.yaxis._m,t=(E.c-C.c-E.b+C.b)*R.xaxis._m);var o="translate("+(R.x0+t)+","+(R.y0+e)+")";R.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",o);var s="translate("+-t+","+-e+")";if(R.clipDefRelative.select("path").attr("transform",s),R.aaxis.range=[C.a,R.sum-C.b-C.c],R.baxis.range=[R.sum-C.a-C.c,C.b],R.caxis.range=[R.sum-C.a-C.b,C.c],R.drawAxes(!1),R.plotContainer.selectAll(".crisp").classed("crisp",!1),R._hasClipOnAxisFalse){var l=R.plotContainer.select(".scatterlayer").selectAll(".points");l.selectAll(".point").call(c.hideOutsideRangePoints,R),l.selectAll(".textpoint").call(c.hideOutsideRangePoints,R)}}function p(t,e){if(t){var r={};r[R.id+".aaxis.min"]=C.a,r[R.id+".baxis.min"]=C.b,r[R.id+".caxis.min"]=C.c,s.relayout(j,r)}else 2===e&&x()}function v(){N.selectAll(".select-outline").remove()}function x(){var t={};t[R.id+".aaxis.min"]=0,t[R.id+".baxis.min"]=0,t[R.id+".caxis.min"]=0,j.emit("plotly_doubleclick",null),s.relayout(j,t)}var w,S,E,L,C,I,z,D,P,O,R=this,F=R.layers.plotbg.select("path").node(),j=R.graphDiv,N=j._fullLayout._zoomlayer,B={element:F,gd:j,plotinfo:{xaxis:R.xaxis,yaxis:R.yaxis},doubleclick:x,subplot:R.id,prepFn:function(e,r,n){B.xaxes=[R.xaxis],B.yaxes=[R.yaxis];var i=j._fullLayout.dragmode;e.shiftKey&&(i="pan"===i?"zoom":"pan"),B.minDrag="lasso"===i?1:void 0,"zoom"===i?(B.moveFn=a,B.doneFn=h,t(e,r,n)):"pan"===i?(B.moveFn=d,B.doneFn=p,f(),v()):"select"!==i&&"lasso"!==i||y(e,r,n,B,i)}};F.onmousemove=function(t){g.hover(j,t,R.id),j._fullLayout._lasthover=F,j._fullLayout._hoversubplot=R.id},F.onmouseout=function(t){j._dragging||m.unhover(j,t)},F.onclick=function(t){g.click(j,t,R.id)},m.init(B)}},{"../../components/color":604,"../../components/dragelement":625,"../../components/drawing":628,"../../components/fx":645,"../../components/titles":694,"../../lib":728,"../../lib/extend":717,"../../plotly":767,"../cartesian/axes":772,"../cartesian/constants":777,"../cartesian/select":788,"../cartesian/set_convert":789,"../plots":831,d3:122,tinycolor2:534}],846:[function(t,e,r){"use strict";function n(t){if(t.layoutAttributes){var e=t.layoutAttributes._arrayAttrRegexps;if(e)for(var n=0;n-1}var a=t("../lib"),o=t("../plots/plots"),s=a.extendFlat,l=a.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,a=t.data,u=t.layout,c=l([],a),h=l({},u,n(e.tileClass)),f=t._context||{};if(e.width&&(h.width=e.width),e.height&&(h.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){h.annotations=[];var d=Object.keys(h);for(r=0;r")?"":e.html(t).text()});return e.remove(),r}function i(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}var a=t("d3"),o=t("../lib"),s=t("../components/drawing"),l=t("../components/color"),u=t("../constants/xmlns_namespaces"),c=/"/g,h=new RegExp('("TOBESTRIPPED)|(TOBESTRIPPED")',"g");e.exports=function(t,e,r){var f,d=t._fullLayout,p=d._paper,m=d._toppaper,g=d.width,v=d.height;p.insert("rect",":first-child").call(s.setRect,0,0,g,v).call(l.fill,d.paper_bgcolor);var y=d._basePlotModules||[];for(f=0;f0&&A>0,N=M<=R&&A<=F,B=M<=F&&A<=R,U="h"===v?R>=M*(F/A):F>=A*(R/M);j&&(N||B||U)?b="inside":(b="outside",x.remove(),x=null)}else b="inside";if(!x&&(x=m(e,y,"outside"===b?E:S),_=k.bBox(x.node()),M=_.width,A=_.height,M<=0||A<=0))return void x.remove();var V,H;"outside"===b?(H="both"===g.constraintext||"outside"===g.constraintext,V=a(o,f,d,p,_,v,H)):(H="both"===g.constraintext||"inside"===g.constraintext,V=i(o,f,d,p,_,v,H)),x.attr("transform",V)}}}function i(t,e,r,n,i,a,s){var l,u,c,h,f,d=i.width,p=i.height,m=(i.left+i.right)/2,g=(i.top+i.bottom)/2,v=Math.abs(e-t),y=Math.abs(n-r);v>2*z&&y>2*z?(f=z,v-=2*f,y-=2*f):f=0;var b,x;return d<=v&&p<=y?(b=!1,x=1):d<=y&&p<=v?(b=!0,x=1):dr?(c=(t+e)/2,h=n-f-u/2):(c=(t+e)/2,h=n+f+u/2),o(m,g,c,h,x,b)}function a(t,e,r,n,i,a,s){var l,u="h"===a?Math.abs(n-r):Math.abs(e-t);u>2*z&&(l=z);var c=1;s&&(c="h"===a?Math.min(1,u/i.height):Math.min(1,u/i.width));var h,f,d,p,m=(i.left+i.right)/2,g=(i.top+i.bottom)/2;return h=c*i.width,f=c*i.height,"h"===a?er?(d=(t+e)/2,p=n+l+f/2):(d=(t+e)/2,p=n-l-f/2),o(m,g,d,p,c,!1)}function o(t,e,r,n,i,a){var o,s;return i<1?o="scale("+i+") ":(i=1,o=""),s=a?"rotate("+a+" "+t+" "+e+") ":"","translate("+(r-i*t)+" "+(n-i*e)+")"+o+s}function s(t,e){var r=d(t.text,e);return p(S,r)}function l(t,e){var r=d(t.textposition,e);return m(E,r)}function u(t,e,r){return f(L,t.textfont,e,r)}function c(t,e,r){return f(C,t.insidetextfont,e,r)}function h(t,e,r){return f(I,t.outsidetextfont,e,r)}function f(t,e,r,n){e=e||{};var i=d(e.family,r),a=d(e.size,r),o=d(e.color,r);return{family:p(t.family,i,n.family),size:g(t.size,a,n.size),color:v(t.color,o,n.color)}}function d(t,e){var r;return Array.isArray(t)?ei))return e}return void 0!==r?r:t.dflt}function v(t,e,r){return x(e).isValid()?e:void 0!==r?r:t.dflt}var y=t("d3"),b=t("fast-isnumeric"),x=t("tinycolor2"),_=t("../../lib"),w=t("../../lib/svg_text_utils"),M=t("../../components/color"),k=t("../../components/drawing"),A=t("../../components/errorbars"),T=t("./attributes"),S=T.text,E=T.textposition,L=T.textfont,C=T.insidetextfont,I=T.outsidetextfont,z=3;e.exports=function(t,e,r){var i=e.xaxis,a=e.yaxis,o=t._fullLayout,s=e.plot.select(".barlayer").selectAll("g.trace.bars").data(r);s.enter().append("g").attr("class","trace bars"),s.append("g").attr("class","points").each(function(e){var r=e[0].node3=y.select(this),s=e[0].t,l=e[0].trace,u=s.poffset,c=Array.isArray(u);r.selectAll("g.point").data(_.identity).enter().append("g").classed("point",!0).each(function(r,s){function h(t){return 0===o.bargap&&0===o.bargroupgap?y.round(Math.round(t)-A,2):t}function f(t,e){return Math.abs(t-e)>=2?h(t):t>e?Math.ceil(t):Math.floor(t)}var d,p,m,g,v=r.p+(c?u[s]:u),x=v+r.w,_=r.b,w=_+r.s;if("h"===l.orientation?(m=a.c2p(v,!0),g=a.c2p(x,!0),d=i.c2p(_,!0),p=i.c2p(w,!0),r.ct=[p,(m+g)/2]):(d=i.c2p(v,!0),p=i.c2p(x,!0),m=a.c2p(_,!0),g=a.c2p(w,!0),r.ct=[(d+p)/2,g]),!(b(d)&&b(p)&&b(m)&&b(g)&&d!==p&&m!==g))return void y.select(this).remove();var k=(r.mlw+1||l.marker.line.width+1||(r.trace?r.trace.marker.line.width:0)+1)-1,A=y.round(k/2%1,2);if(!t._context.staticPlot){var T=M.opacity(r.mc||l.marker.color),S=T<1||k>.01?h:f;d=S(d,p),p=S(p,d),m=S(m,g),g=S(g,m)}var E=y.select(this);E.append("path").style("vector-effect","non-scaling-stroke").attr("d","M"+d+","+m+"V"+g+"H"+p+"V"+m+"Z"),n(t,E,e,s,d,p,m,g)})}),s.call(A.plot,e)}},{"../../components/color":604,"../../components/drawing":628,"../../components/errorbars":634,"../../lib":728,"../../lib/svg_text_utils":750,"./attributes":856,d3:122,"fast-isnumeric":131,tinycolor2:534}],864:[function(t,e,r){"use strict";var n=t("../../constants/interactions").DESELECTDIM;e.exports=function(t,e){var r,i=t.cd,a=[],o=i[0].node3;if(!1===e)for(r=0;ru+s||!y(l))&&(h=!0,f(c,t))}for(var i=r.traces,a=v(e),o="fraction"===t._fullLayout.barnorm?1:100,s=o/1e9,l=e.l2c(e.c2l(0)),u="stack"===t._fullLayout.barmode?o:l,c=[l,u],h=!1,d=0;d1||0===s.bargap&&0===s.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,o=r.line,s=a.tryColorscale(r,""),l=a.tryColorscale(r,"line");n.select(this).selectAll("path").each(function(t){var e,a,u=(t.mlw+1||o.width+1)-1,c=n.select(this);e="mc"in t?t.mcc=s(t.mc):Array.isArray(r.color)?i.defaultLine:r.color,c.style("stroke-width",u+"px").call(i.fill,e),u&&(a="mlc"in t?t.mlcc=l(t.mlc):Array.isArray(o.color)?i.defaultLine:o.color,c.call(i.stroke,a))})}),e.call(o.style)}},{"../../components/color":604,"../../components/drawing":628,"../../components/errorbars":634,d3:122}],868:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s){r("marker.color",o),i(t,"marker")&&a(t,e,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),i(t,"marker.line")&&a(t,e,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width")}},{"../../components/color":604,"../../components/colorscale/defaults":613,"../../components/colorscale/has_colorscale":617}],869:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/color/attributes"),a=t("../../lib/extend").extendFlat,o=n.marker,s=o.line;e.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},name:{valType:"string",editType:"calc+clearAxisTypes"},whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calcIfAutorange"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers",editType:"calcIfAutorange"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1,editType:"calcIfAutorange"},jitter:{valType:"number",min:0,max:1,editType:"calcIfAutorange"},pointpos:{valType:"number",min:-2,max:2,editType:"calcIfAutorange"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:a({},o.symbol,{arrayOk:!1,editType:"plot"}),opacity:a({},o.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:a({},o.size,{arrayOk:!1,editType:"calcIfAutorange"}),color:a({},o.color,{arrayOk:!1,editType:"style"}),line:{color:a({},s.color,{arrayOk:!1,dflt:i.defaultLine,editType:"style"}),width:a({},s.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor}},{"../../components/color/attributes":603,"../../lib/extend":717,"../scatter/attributes":1031}],870:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/cartesian/axes");e.exports=function(t,e){var r,o,s,l,u,c,h,f,d,p=a.getFromId(t,e.xaxis||"x"),m=a.getFromId(t,e.yaxis||"y"),g=e.orientation,v=[];"h"===g?(r=p,o="x",u=m,c="y"):(r=m,o="y",u=p,c="x"),s=r.makeCalcdata(e,o),a.expand(r,s,{padded:!0}),h=function(t,e,r,a,o){var s;return r in e?h=a.makeCalcdata(e,r):(s=r+"0"in e?e[r+"0"]:"name"in e&&("category"===a.type||n(e.name)&&-1!==["linear","log"].indexOf(a.type)||i.isDateTime(e.name)&&"date"===a.type)?e.name:t.numboxes,s=a.d2c(s,0,e[r+"calendar"]),h=o.map(function(){return s})),h}(t,e,c,u,s);var y=i.distinctVals(h);return f=y.vals,d=y.minDiff/2,l=function(t,e,r,a,o){var s,l,u,c,h=a.length,f=e.length,d=[],p=[];for(s=0;s=0&&u1,m=r.dPos*(1-c.boxgap)*(1-c.boxgroupgap)/(p?t.numboxes:1),g=p?2*r.dPos*((r.boxnum+.5)/t.numboxes-.5)*(1-c.boxgap):0,v=m*d.whiskerwidth;if(!0!==d.visible||r.emptybox)return void a.select(this).remove();"h"===d.orientation?(l=f,u=h):(l=h,u=f),r.bPos=g,r.bdPos=m,n(),a.select(this).selectAll("path.box").data(o.identity).enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","box").each(function(t){var e=l.c2p(t.pos+g,!0),r=l.c2p(t.pos+g-m,!0),n=l.c2p(t.pos+g+m,!0),i=l.c2p(t.pos+g-v,!0),s=l.c2p(t.pos+g+v,!0),c=u.c2p(t.q1,!0),h=u.c2p(t.q3,!0),f=o.constrain(u.c2p(t.med,!0),Math.min(c,h)+1,Math.max(c,h)-1),p=u.c2p(!1===d.boxpoints?t.min:t.lf,!0),y=u.c2p(!1===d.boxpoints?t.max:t.uf,!0);"h"===d.orientation?a.select(this).attr("d","M"+f+","+r+"V"+n+"M"+c+","+r+"V"+n+"H"+h+"V"+r+"ZM"+c+","+e+"H"+p+"M"+h+","+e+"H"+y+(0===d.whiskerwidth?"":"M"+p+","+i+"V"+s+"M"+y+","+i+"V"+s)):a.select(this).attr("d","M"+r+","+f+"H"+n+"M"+r+","+c+"H"+n+"V"+h+"H"+r+"ZM"+e+","+c+"V"+p+"M"+e+","+h+"V"+y+(0===d.whiskerwidth?"":"M"+i+","+p+"H"+s+"M"+i+","+y+"H"+s))}),d.boxpoints&&a.select(this).selectAll("g.points").data(function(t){return t.forEach(function(t){t.t=r,t.trace=d}),t}).enter().append("g").attr("class","points").selectAll("path").data(function(t){var e,r,n,a,s,l,u,c="all"===d.boxpoints?t.val:t.val.filter(function(e){return et.uf}),h=Math.max((t.max-t.min)/10,t.q3-t.q1),f=1e-9*h,p=.01*h,v=[],y=0;if(d.jitter){if(0===h)for(y=1,v=new Array(c.length),e=0;et.lo&&(n.so=!0),n})}).enter().append("path").classed("point",!0).call(s.translatePoints,h,f),d.boxmean&&a.select(this).selectAll("path.mean").data(o.identity).enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}).each(function(t){var e=l.c2p(t.pos+g,!0),r=l.c2p(t.pos+g-m,!0),n=l.c2p(t.pos+g+m,!0),i=u.c2p(t.mean,!0),o=u.c2p(t.mean-t.sd,!0),s=u.c2p(t.mean+t.sd,!0);"h"===d.orientation?a.select(this).attr("d","M"+i+","+r+"V"+n+("sd"!==d.boxmean?"":"m0,0L"+o+","+e+"L"+i+","+r+"L"+s+","+e+"Z")):a.select(this).attr("d","M"+r+","+i+"H"+n+("sd"!==d.boxmean?"":"m0,0L"+e+","+o+"L"+r+","+i+"L"+e+","+s+"Z"))})})}},{"../../components/drawing":628,"../../lib":728,d3:122}],877:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/cartesian/axes"),a=t("../../lib");e.exports=function(t,e){var r,o,s,l,u=t._fullLayout,c=e.xaxis,h=e.yaxis,f=["v","h"];for(o=0;o=10)return null;for(var r=1/0,i=-1/0,a=t.length,o=0;o0?Math.floor:Math.ceil,z=L>0?Math.ceil:Math.floor,D=L>0?Math.min:Math.max,P=L>0?Math.max:Math.min,O=I(S+C),R=z(E-C);c=T(S);var F=[[c]];for(i=O;i*L=0;i--)a[c-i]=t[h][i],o[c-i]=e[h][i];for(s.push({x:a,y:o,bicubic:l}),i=h,a=[],o=[];i>=0;i--)a[h-i]=t[i][0],o[h-i]=e[i][0];return s.push({x:a,y:o,bicubic:u}),s}},{}],891:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e,r,a){function o(e){var n,i,o,s,l,u,c,h,f,d,p,g,v=[],y=[],b={};if("b"===r)for(i=t.b2j(e),o=Math.floor(Math.max(0,Math.min(P-2,i))),s=i-o,b.length=P,b.crossLength=D,b.xy=function(e){return t.evalxy([],e,i)},b.dxy=function(e,r){return t.dxydi([],e,o,r,s)},n=0;n0&&(f=t.dxydi([],n-1,o,0,s),v.push(l[0]+f[0]/3),y.push(l[1]+f[1]/3),d=t.dxydi([],n-1,o,1,s),v.push(h[0]-d[0]/3),y.push(h[1]-d[1]/3)),v.push(h[0]),y.push(h[1]),l=h;else for(n=t.a2i(e),u=Math.floor(Math.max(0,Math.min(D-2,n))),c=n-u,b.length=D,b.crossLength=P,b.xy=function(e){return t.evalxy([],n,e)},b.dxy=function(e,r){return t.dxydj([],u,e,c,r)},i=0;i0&&(p=t.dxydj([],u,i-1,c,0),v.push(l[0]+p[0]/3),y.push(l[1]+p[1]/3),g=t.dxydj([],u,i-1,c,1),v.push(h[0]-g[0]/3),y.push(h[1]-g[1]/3)),v.push(h[0]),y.push(h[1]),l=h;return b.axisLetter=r,b.axis=M,b.crossAxis=E,b.value=e,b.constvar=a,b.index=m,b.x=v,b.y=y,b.smoothing=E.smoothing,b}function s(e){var n,i,o,s,l,u=[],c=[],h={};if(h.length=w.length,h.crossLength=S.length,"b"===r)for(o=Math.max(0,Math.min(P-2,e)),l=Math.min(1,Math.max(0,e-o)),h.xy=function(r){return t.evalxy([],r,e)},h.dxy=function(e,r){return t.dxydi([],e,o,r,l)},n=0;nw.length-1||k.push(i(s(u),{color:M.gridcolor,width:M.gridwidth}));for(m=d;mw.length-1||y<0||y>w.length-1))for(b=w[c],x=w[y],l=0;lw[w.length-1]||A.push(i(o(v),{color:M.minorgridcolor,width:M.minorgridwidth}));M.startline&&T.push(i(s(0),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&T.push(i(s(w.length-1),{color:M.endlinecolor,width:M.endlinewidth}))}else{for(h=5e-15,f=[Math.floor((w[w.length-1]-M.tick0)/M.dtick*(1+h)),Math.ceil((w[0]-M.tick0)/M.dtick/(1+h))].sort(function(t,e){return t-e}),d=f[0],p=f[1],m=d;m<=p;m++)g=M.tick0+M.dtick*m,k.push(i(o(g),{color:M.gridcolor,width:M.gridwidth}));for(m=d-1;mw[w.length-1]||A.push(i(o(v),{color:M.minorgridcolor,width:M.minorgridwidth}));M.startline&&T.push(i(o(w[0]),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&T.push(i(o(w[w.length-1]),{color:M.endlinecolor,width:M.endlinewidth}))}}},{"../../lib/extend":717,"../../plots/cartesian/axes":772}],892:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e){var r,a,o,s=e._labels=[],l=e._gridlines;for(r=0;re.length&&(t=t.slice(0,e.length)):t=[],n=0;ne.length&&(t=t.slice(0,e.length)):t=[],n=0;ne.length&&(t[n]=t[n].slice(0,e.length)):t[n]=[],i=0;i90&&(d-=180,l=-l),{angle:d,flip:l,p:t.c2p(n,e,r),offsetMultplier:u}}},{}],908:[function(t,e,r){"use strict";function n(t,e,r){var n=t.selectAll(e+"."+r).data([0]);return n.enter().append(e).classed(r,!0),n}function i(t,e,r){var i=r[0],u=r[0].trace,c=e.xaxis,h=e.yaxis,f=u.aaxis,d=u.baxis,p=t._fullLayout,m=e.plot.selectAll(".carpetlayer"),g=p._clips,v=n(m,"g","carpet"+u.uid).classed("trace",!0),y=n(v,"g","minorlayer"),b=n(v,"g","majorlayer"),x=n(v,"g","boundarylayer"),_=n(v,"g","labellayer");v.style("opacity",u.opacity),o(c,h,b,f,"a",f._gridlines),o(c,h,b,d,"b",d._gridlines),o(c,h,y,f,"a",f._minorgridlines),o(c,h,y,d,"b",d._minorgridlines),o(c,h,x,f,"a-boundary",f._boundarylines),o(c,h,x,d,"b-boundary",d._boundarylines),l(t,_,u,i,c,h,s(t,c,h,u,i,_,f._labels,"a-label"),s(t,c,h,u,i,_,d._labels,"b-label")),a(u,i,g,c,h)}function a(t,e,r,i,a){var o,s,l,u,c=r.select("#"+t._clipPathId);c.size()||(c=r.append("clipPath").classed("carpetclip",!0));var h=n(c,"path","carpetboundary"),p=e.clipsegments,m=[];for(u=0;u0?"start":"end","data-notex":1}).call(h.font,i.font).text(i.text).call(m.convertToTspans,t),f=h.bBox(this);l.attr("transform","translate("+a.p[0]+","+a.p[1]+") rotate("+a.angle+")translate("+i.axis.labelpadding*s+","+.3*f.height+")"),u=Math.max(u,f.width+i.axis.labelpadding)}),l.exit().remove(),u}function l(t,e,r,n,i,a,o,s){var l,c,h,f;l=.5*(r.a[0]+r.a[r.a.length-1]),c=r.b[0],h=r.ab2xy(l,c,!0),f=r.dxyda_rough(l,c),u(t,e,r,n,h,f,r.aaxis,i,a,o,"a-title"),l=r.a[0],c=.5*(r.b[0]+r.b[r.b.length-1]),h=r.ab2xy(l,c,!0),f=r.dxydb_rough(l,c),u(t,e,r,n,h,f,r.baxis,i,a,s,"b-title")}function u(t,e,r,n,i,a,o,s,l,u,f){var d=[];o.title&&d.push(o.title);var g=e.selectAll("text."+f).data(d);g.enter().append("text").classed(f,!0),g.each(function(){var e=p(r,s,l,i,a);-1===["start","both"].indexOf(o.showticklabels)&&(u=0),u+=o.titlefont.size+o.titleoffset,c.select(this).text(o.title||"").call(m.convertToTspans,t).attr("transform","translate("+e.p[0]+","+e.p[1]+") rotate("+e.angle+") translate(0,"+u+")").classed("user-select-none",!0).attr("text-anchor","middle").call(h.font,o.titlefont)}),g.exit().remove()}var c=t("d3"),h=t("../../components/drawing"),f=t("./map_1d_array"),d=t("./makepath"),p=t("./orient_text"),m=t("../../lib/svg_text_utils");e.exports=function(t,e,r){for(var n=0;nd&&tm&&ep||eg},h.c2p=function(t){return t},f.c2p=function(t){return t},t.setScale=function(){var e=t.x,r=t.y,n=a(t.xctrl,t.yctrl,e,r,h.smoothing,f.smoothing);t.xctrl=n[0],t.yctrl=n[1],t.evalxy=o([t.xctrl,t.yctrl],u,c,h.smoothing,f.smoothing),t.dxydi=s([t.xctrl,t.yctrl],h.smoothing,f.smoothing),t.dxydj=l([t.xctrl,t.yctrl],h.smoothing,f.smoothing)},t.i2a=function(t){var r=Math.max(0,Math.floor(t[0]),u-2),n=t[0]-r;return(1-n)*e[r]+n*e[r+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),u-2),n=t[1]-e;return(1-n)*r[e]+n*r[e+1]},t.ij2ab=function(e){return[t.i2a(e[0]),t.j2b(e[1])]},t.a2i=function(t){var r=Math.max(0,Math.min(i(t,e),u-2)),n=e[r],a=e[r+1];return Math.max(0,Math.min(u-1,r+(t-n)/(a-n)))},t.b2j=function(t){var e=Math.max(0,Math.min(i(t,r),c-2)),n=r[e],a=r[e+1];return Math.max(0,Math.min(c-1,e+(t-n)/(a-n)))},t.ab2ij=function(e){return[t.a2i(e[0]),t.b2j(e[1])]},t.i2c=function(e,r){return t.evalxy([],e,r)},t.ab2xy=function(n,i,a){if(!a&&(ne[u-1]|ir[c-1]))return[!1,!1];var o=t.a2i(n),s=t.b2j(i),l=t.evalxy([],o,s);if(a){var h,f,d,p,m=0,g=0,v=[];ne[u-1]?(h=u-2,f=1,m=(n-e[u-1])/(e[u-1]-e[u-2])):(h=Math.max(0,Math.min(u-2,Math.floor(o))),f=o-h),ir[c-1]?(d=c-2,p=1,g=(i-r[c-1])/(r[c-1]-r[c-2])):(d=Math.max(0,Math.min(c-2,Math.floor(s))),p=s-d),m&&(t.dxydi(v,h,d,f,p),l[0]+=v[0]*m,l[1]+=v[1]*m),g&&(t.dxydj(v,h,d,f,p),l[0]+=v[0]*g,l[1]+=v[1]*g)}return l},t.c2p=function(t,e,r){return[e.c2p(t[0]),r.c2p(t[1])]},t.p2x=function(t,e,r){return[e.p2c(t[0]),r.p2c(t[1])]},t.dadi=function(t){var r=Math.max(0,Math.min(e.length-2,t));return e[r+1]-e[r]},t.dbdj=function(t){var e=Math.max(0,Math.min(r.length-2,t));return r[e+1]-r[e]},t.dxyda=function(e,r,n,i){var a=t.dxydi(null,e,r,n,i),o=t.dadi(e,n);return[a[0]/o,a[1]/o]},t.dxydb=function(e,r,n,i){var a=t.dxydj(null,e,r,n,i),o=t.dbdj(r,i);return[a[0]/o,a[1]/o]},t.dxyda_rough=function(e,r,n){var i=v*(n||.1),a=t.ab2xy(e+i,r,!0),o=t.ab2xy(e-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dxydb_rough=function(e,r,n){var i=y*(n||.1),a=t.ab2xy(e,r+i,!0),o=t.ab2xy(e,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}},{"../../lib/search":745,"./compute_control_points":895,"./constants":896,"./create_i_derivative_evaluator":897,"./create_j_derivative_evaluator":898,"./create_spline_evaluator":899}],910:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){var i,a,o,s=[],l=[],u=t[0].length,c=t.length,h=0;for(i=0;i0&&void 0!==(n=t[r][e-1])&&(a++,i+=n),e0&&void 0!==(n=t[r-1][e])&&(a++,i+=n),r0&&a0&&i1e-5);return n.log("Smoother converged to",M,"after",k,"iterations"),t}},{"../../lib":728}],911:[function(t,e,r){"use strict";var n=t("./has_columns"),i=t("../heatmap/convert_column_xyz");e.exports=function(t,e,r){var a=[],o=r("x");o&&!n(o)&&a.push("x"),e._cheater=!o;var s=r("y");if(s&&!n(s)&&a.push("y"),o||s)return a.length&&i(e,e.aaxis,e.baxis,"a","b",a),!0}},{"../heatmap/convert_column_xyz":952,"./has_columns":901}],912:[function(t,e,r){"use strict";var n=t("../scattergeo/attributes"),i=t("../../components/colorscale/attributes"),a=t("../../components/colorbar/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend"),l=s.extendFlat,u=s.extendDeepAll,c=n.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:n.locationmode,z:{valType:"data_array",editType:"calc"},text:l({},n.text,{}),marker:{line:{color:c.color,width:l({},c.width,{dflt:1}),editType:"calc"},editType:"calc"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]})},u({},i,{zmax:{editType:"calc"},zmin:{editType:"calc"}}),{colorbar:a})},{"../../components/colorbar/attributes":605,"../../components/colorscale/attributes":609,"../../lib/extend":717,"../../plots/attributes":770,"../scattergeo/attributes":1069}],913:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../constants/numerical").BADNUM,a=t("../../components/colorscale/calc"),o=t("../scatter/arrays_to_calcdata");e.exports=function(t,e){for(var r=e.locations.length,s=new Array(r),l=0;ll&&(e.z=c.slice(0,l)),s("locationmode"),s("text"),s("marker.line.color"),s("marker.line.width"),i(t,e,o,s,{prefix:"",cLetter:"z"})}},{"../../components/colorscale/defaults":613,"../../lib":728,"./attributes":912}],915:[function(t,e,r){"use strict";e.exports=function(t,e){return t.location=e.location,t.z=e.z,t}},{}],916:[function(t,e,r){"use strict";function n(t,e,r,n){var s=r.hi||e.hoverinfo,l="all"===s?a.hoverinfo.flags:s.split("+"),u=-1!==l.indexOf("name"),c=-1!==l.indexOf("location"),h=-1!==l.indexOf("z"),f=-1!==l.indexOf("text"),d=!u&&c,p=[];d?t.nameOverride=r.loc:(u&&(t.nameOverride=e.name),c&&p.push(r.loc)),h&&p.push(function(t){return i.tickText(n,n.c2l(t),"hover").text}(r.z)),f&&o(r,e,p),t.extraText=p.join("
")}var i=t("../../plots/cartesian/axes"),a=t("./attributes"),o=t("../scatter/fill_hover_text");e.exports=function(t,e,r){var i,a,o,s,l=t.cd,u=l[0].trace,c=t.subplot;for(a=0;a0&&t[e+1][0]<0)return e;return null}var r,n,i,a,o=t.geometry,s=o.coordinates,l=t.id,u=[];switch(r="RUS"===l||"FJI"===l?function(t){var r;if(null===e(t))r=t;else for(r=new Array(t.length),a=0;ar?n[i++]=[t[a][0]+360,t[a][1]]:a===r?(n[i++]=t[a],n[i++]=[t[a][0],-90]):n[i++]=t[a];var o=h.tester(n);o.pts.pop(),u.push(o)}:function(t){u.push(h.tester(t))},o.type){case"MultiPolygon":for(n=0;ns.end&&(s.start=s.end=(s.start+s.end)/2),e._input.contours||(e._input.contours={}),a(e._input.contours,{start:s.start,end:s.end,size:s.size}),e._input.autocontour=!0}else{var u=s.start,c=s.end,h=e._input.contours;if(u>c&&(s.start=h.start=c,c=s.end=h.end=u,u=s.start),!(s.size>0)){var f;f=u===c?1:n(u,c,e.ncontours).dtick,h.size=s.size=f}}return r}},{"../../lib":728,"../../plots/cartesian/axes":772,"../heatmap/calc":949}],922:[function(t,e,r){"use strict";var n=t("../../plots/plots"),i=t("../../components/colorbar/draw"),a=t("./make_color_map"),o=t("./end_plus");e.exports=function(t,e){var r=e[0].trace,s="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+s).remove(),!r.showscale)return void n.autoMargin(t,s);var l=i(t,s);e[0].t.cb=l;var u=r.contours,c=r.line,h=u.size||1,f=u.coloring,d=a(r,{isColorbar:!0});"heatmap"===f&&l.filllevels({start:r.zmin,end:r.zmax,size:(r.zmax-r.zmin)/254}),l.fillcolor("fill"===f||"heatmap"===f?d:"").line({color:"lines"===f?d:c.color,width:!1!==u.showlines?c.width:0,dash:c.dash}).levels({start:u.start,end:o(u),size:h}).options(r.colorbar)()}},{"../../components/colorbar/draw":607,"../../plots/plots":831,"./end_plus":926,"./make_color_map":930}],923:[function(t,e,r){"use strict";e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},{}],924:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){var a,o=n.coerce2(t,e,i,"contours.start"),s=n.coerce2(t,e,i,"contours.end"),l=!1===o||!1===s,u=r("contours.size");!(a=l?e.autocontour=!0:r("autocontour",!1))&&u||r("ncontours")}},{"../../lib":728,"./attributes":920}],925:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../heatmap/has_columns"),a=t("../heatmap/xyz_defaults"),o=t("./contours_defaults"),s=t("./style_defaults"),l=t("./attributes");e.exports=function(t,e,r,u){function c(r,i){return n.coerce(t,e,l,r,i)}if(!a(t,e,c,u))return void(e.visible=!1);c("text"),c("connectgaps",i(e)),o(t,e,c),s(t,e,c,u)}},{"../../lib":728,"../heatmap/has_columns":955,"../heatmap/xyz_defaults":963,"./attributes":920,"./contours_defaults":924,"./style_defaults":934}],926:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],927:[function(t,e,r){"use strict";function n(t,e,r,n){return Math.abs(t[0]-e[0])20?(m=u.CHOOSESADDLE[m][(g[0]||g[1])<0?0:1],t.crossings[p]=u.SADDLEREMAINDER[m]):delete t.crossings[p],!(g=u.NEWDELTA[m])){l.log("Found bad marching index:",m,e,t.level);break}v.push(s(t,e,g)),e[0]+=g[0],e[1]+=g[1],n(v[v.length-1],v[v.length-2],a,c)&&v.pop(),p=e.join(",");var _=g[0]&&(e[0]<0||e[0]>x-2)||g[1]&&(e[1]<0||e[1]>b-2);if(p===d&&g.join(",")===y||r&&_)break;m=t.crossings[p]}1e4===f&&l.log("Infinite loop in contour?");var w,M,k,A,T,S,E,L,C,I,z,D=n(v[0],v[v.length-1],a,c),P=0,O=.2*t.smoothing,R=[],F=0;for(f=1;f=F;f--)if((w=R[f])=F&&w+R[M]L&&C--,t.edgepaths[C]=z.concat(v,I));break}B||(t.edgepaths[L]=v.concat(I))}for(L=0;L20&&e?208===t||1114===t?n=0===r[0]?1:-1:i=0===r[1]?1:-1:-1!==u.BOTTOMSTART.indexOf(t)?i=1:-1!==u.LEFTSTART.indexOf(t)?n=1:-1!==u.TOPSTART.indexOf(t)?i=-1:n=-1,[n,i]}function s(t,e,r){var n=e[0]+Math.max(r[0],0),i=e[1]+Math.max(r[1],0),a=t.z[i][n],o=t.xaxis,s=t.yaxis;if(r[1]){var l=(t.level-a)/(t.z[i][n+1]-a);return[o.c2p((1-l)*t.x[n]+l*t.x[n+1],!0),s.c2p(t.y[i],!0),n+l,i]}var u=(t.level-a)/(t.z[i+1][n]-a);return[o.c2p(t.x[n],!0),s.c2p((1-u)*t.y[i]+u*t.y[i+1],!0),n,i+u]}var l=t("../../lib"),u=t("./constants");e.exports=function(t,e,r){var n,i,o,s,u;for(e=e||.01,r=r||.01,o=0;ot?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){return t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208}return 15===r?0:r}var i=t("./constants");e.exports=function(t){var e,r,a,o,s,l,u,c,h,f=t[0].z,d=f.length,p=f[0].length,m=2===d||2===p;for(r=0;r1e3){d.warn("Too many contours, clipping at 1000",t);break}return i}function a(t,e,r){var n=t.selectAll("g.contourbg").data([0]);n.enter().append("g").classed("contourbg",!0);var i=n.selectAll("path").data("fill"===r.coloring?[0]:[]);i.enter().append("path"),i.exit().remove(),i.attr("d","M"+e.join("L")+"Z").style("stroke","none")}function o(t,e,r,n){var i=t.selectAll("g.contourfill").data([0]);i.enter().append("g").classed("contourfill",!0);var a=i.selectAll("path").data("fill"===n.coloring?e:[]);a.enter().append("path"),a.exit().remove(),a.each(function(t){var e=s(t,r);e?f.select(this).attr("d",e).style("stroke","none"):f.select(this).remove()})}function s(t,e){function r(t){return Math.abs(t[0]-e[2][0])<.01}for(var n,i,a,o,s,l,u=Math.min(t.z[0][0],t.z[0][1]),c=t.edgepaths.length||u<=t.level?"":"M"+e.join("L")+"Z",h=0,f=t.edgepaths.map(function(t,e){return e}),m=!0;f.length;){for(l=p.smoothopen(t.edgepaths[h],t.smoothing),c+=m?l:l.replace(/^M/,"L"),f.splice(f.indexOf(h),1),n=t.edgepaths[h][t.edgepaths[h].length-1],o=-1,a=0;a<4;a++){if(!n){d.log("Missing end?",h,t);break}for(!function(t){return Math.abs(t[1]-e[0][1])<.01}(n)||r(n)?!function(t){return Math.abs(t[0]-e[0][0])<.01}(n)?!function(t){return Math.abs(t[1]-e[2][1])<.01}(n)?r(n)&&(i=e[2]):i=e[3]:i=e[0]:i=e[1],s=0;s=0&&(i=g,o=s):Math.abs(n[1]-i[1])<.01?Math.abs(n[1]-g[1])<.01&&(g[0]-n[0])*(i[0]-g[0])>=0&&(i=g,o=s):d.log("endpt to newendpt is not vert. or horz.",n,i,g)}if(n=i,o>=0)break;c+="L"+i}if(o===t.edgepaths.length){d.log("unclosed perimeter path");break}h=o,m=-1===f.indexOf(h),m&&(h=f[0],c+="Z")}for(h=0;hn.center?n.right-o:o-n.left)/(u+Math.abs(Math.sin(l)*a)),f=(s>n.middle?n.bottom-s:s-n.top)/(Math.abs(c)+Math.cos(l)*a);if(h<1||f<1)return 1/0;var p=M.EDGECOST*(1/(h-1)+1/(f-1));p+=M.ANGLECOST*l*l;for(var m=o-u,g=s-c,v=o+u,y=s+c,b=0;b2*M.MAXCOST)break;p&&(o/=2),a=l-o/2,s=a+1.5*o}if(f<=M.MAXCOST)return c},r.addLabelData=function(t,e,r,n){var i=e.width/2,a=e.height/2,o=t.x,s=t.y,l=t.theta,u=Math.sin(l),c=Math.cos(l),h=i*c,f=a*u,d=i*u,p=-a*c,m=[[o-h-f,s-d-p],[o+h-f,s+d-p],[o+h+f,s+d+p],[o-h+f,s-d+p]];r.push({text:e.text,x:o,y:s,dy:e.dy,theta:l,level:e.level,width:e.width,height:e.height}),n.push(m)},r.drawLabels=function(t,e,r,n,i){var a=t.selectAll("text").data(e,function(t){return t.text+","+t.x+","+t.y+","+t.theta});if(a.exit().remove(),a.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each(function(t){var e=t.x+Math.sin(t.theta)*t.dy,n=t.y-Math.cos(t.theta)*t.dy;f.select(this).text(t.text).attr({x:e,y:n,transform:"rotate("+180*t.theta/Math.PI+" "+e+" "+n+")"}).call(m.convertToTspans,r)}),i){for(var o="",s=0;sS){r("a scale is not linear");break}}if(s.length&&"fast"===A){var E=(s[s.length-1]-s[0])/(s.length-1),L=Math.abs(E/100);for(x=0;xL){r("b scale is not linear");break}}}var C=d(b),I="scaled"===e.xtype?"":n,z=g(e,I,i,o,C,w),D="scaled"===e.ytype?"":s,P=g(e,D,v,y,b.length,M),O={a:z,b:P,z:b};return"levels"===e.contours.type&&u(e,b,"","z"),[O]}var a=t("../../lib"),o=t("../../plots/cartesian/axes"),s=t("../../lib").extendFlat,l=t("../../registry"),u=t("../../components/colorscale/calc"),c=t("../heatmap/has_columns"),h=t("../heatmap/convert_column_xyz"),f=t("../heatmap/clean_2d_array"),d=t("../heatmap/max_row_length"),p=t("../heatmap/interp2d"),m=t("../heatmap/find_empties"),g=t("../heatmap/make_bound_array"),v=t("./defaults"),y=t("../carpet/lookup_carpetid");e.exports=function(t,e){var r=e.carpetTrace=y(t,e);if(r&&r.visible&&"legendonly"!==r.visible){if(!e.a||!e.b){var a=t.data[r.index],l=t.data[e.index];l.a||(l.a=a.a),l.b||(l.b=a.b),v(l,e,e._defaultColor,t._fullLayout)}var u=i(t,e),c=e.contours;if(!0===e.autocontour){var h=n(e.zmin,e.zmax,e.ncontours);c.size=h.dtick,c.start=o.tickFirst(h),h.range.reverse(),c.end=o.tickFirst(h),c.start===e.zmin&&(c.start+=c.size),c.end===e.zmax&&(c.end-=c.size),c.start>c.end&&(c.start=c.end=(c.start+c.end)/2),e._input.contours=s({},c)}else{var f=c.start,d=c.end,p=e._input.contours;if(f>d&&(c.start=p.start=d,d=c.end=p.end=f,f=c.start),!(c.size>0)){var m;m=f===d?1:n(f,d,e.ncontours).dtick,p.size=c.size=m}}return u}}},{"../../components/colorscale/calc":610,"../../lib":728,"../../plots/cartesian/axes":772,"../../registry":846,"../carpet/lookup_carpetid":903,"../heatmap/clean_2d_array":950,"../heatmap/convert_column_xyz":952,"../heatmap/find_empties":954,"../heatmap/has_columns":955,"../heatmap/interp2d":958,"../heatmap/make_bound_array":959,"../heatmap/max_row_length":960,"./defaults":942}],937:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i,a,o,s=n.a.length,l=n.b.length,u=n.z,c=-1/0,h=1/0;for(i=0;i":case">=":n.contours.value>c&&(t[0].prefixBoundary=!0);break;case"<":case"<=":n.contours.valuec&&(t[0].prefixBoundary=!0);break;case"][":case")(":a=Math.min.apply(null,n.contours.value),o=Math.max.apply(null,n.contours.value),ac&&(t[0].prefixBoundary=!0)}}},{}],938:[function(t,e,r){"use strict";e.exports={INEQUALITY_OPS:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"]}},{}],939:[function(t,e,r){"use strict";function n(t,e){function r(t){return s(t)?+t:null}var n,i=Array.isArray(e);return-1!==o.INEQUALITY_OPS.indexOf(t)?n=r(i?e[0]:e):-1!==o.INTERVAL_OPS.indexOf(t)?n=i?[r(e[0]),r(e[1])]:[r(e),r(e)]:-1!==o.SET_OPS.indexOf(t)&&(n=i?e.map(r):[r(e)]),n}function i(t){return function(e){e=n(t,e);var r=Math.min(e[0],e[1]),i=Math.max(e[0],e[1]);return{start:r,end:i,size:i-r}}}function a(t){return function(e){return e=n(t,e),{start:e,end:1/0,size:1/0}}}var o=t("./constants"),s=t("fast-isnumeric");e.exports["[]"]=i("[]"),e.exports["()"]=i("()"),e.exports["[)"]=i("[)"),e.exports["(]"]=i("(]"),e.exports["]["]=i("]["),e.exports[")("]=i(")("),e.exports[")["]=i(")["),e.exports["]("]=i("]("),e.exports[">"]=a(">"),e.exports[">="]=a(">="),e.exports["<"]=a("<"),e.exports["<="]=a("<="),e.exports["="]=a("=")},{"./constants":938,"fast-isnumeric":131}],940:[function(t,e,r){"use strict";var n=t("./constraint_mapping"),i=t("fast-isnumeric");e.exports=function(t,e){var r;-1===["=","<","<=",">",">="].indexOf(e.operation)?(t("contours.value",[0,1]),Array.isArray(e.value)?e.value.length>2?e.value=e.value.slice(2):0===e.length?e.value=[0,1]:e.length<2?(r=parseFloat(e.value[0]),e.value=[r,r+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:i(e.value)&&(r=parseFloat(e.value),e.value=[r,r+1])):(t("contours.value",0),i(e.value)||(Array.isArray(e.value)?e.value=parseFloat(e.value[0]):e.value=0));var a=n[e.operation](e.value);e.start=a.start,e.end=a.end,e.size=a.size}},{"./constraint_mapping":939,"fast-isnumeric":131}],941:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r,i,a,o=function(t){return t.reverse()},s=function(t){return t};switch(e){case"][":case")[":case"](":case")(":var l=o;o=s,s=l;case"[]":case"[)":case"(]":case"()":if(2!==t.length)return void n.warn("Contour data invalid for the specified inequality range operation.");for(i=t[0],a=t[1],r=0;r=":case">":if(1!==t.length)return void n.warn("Contour data invalid for the specified inequality operation.");for(i=t[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",t);break}return a}},{"../../lib":728}],944:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../contour/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("../contour/style"),n.moduleType="trace",n.name="contourcarpet",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","carpet","contour","symbols","showLegend","hasLines","carpetDependent"],n.meta={},e.exports=n},{"../../plots/cartesian":782,"../contour/colorbar":922,"../contour/style":933,"./attributes":935,"./calc":936,"./defaults":942,"./plot":947}],945:[function(t,e,r){"use strict";var n=t("../../components/drawing"),i=t("../carpet/axis_aligned_line"),a=t("../../lib");e.exports=function(t,e,r,o,s,l,u,c){function h(t){return Math.abs(t[1]-r[0][1])=0&&(y=L,x=_):Math.abs(v[1]-y[1])=0&&(y=L,x=_):a.log("endpt to newendpt is not vert. or horz.",v,y,L)}if(x>=0)break;M+=m(v,y),v=y}if(x===e.edgepaths.length){a.log("unclosed perimeter path");break}g=x,A=-1===k.indexOf(g),A&&(g=k[0],M+=m(v,y)+"Z",v=null)}for(g=0;g=0;F--)P=s.clipsegments[F],O=f([],P.x,_.c2p),R=f([],P.y,T.c2p),O.reverse(),R.reverse(),N.push(d(O,R,P.bicubic));var B="M"+N.join("L")+"Z";u(j,s.clipsegments,_,T,C,m.coloring),c(a,j,_,T,L,I,n,o,s,m.coloring,B),i(j,L,t,r[0],m,e,o),p.setClipUrl(j,o._clipPathId)}}function i(t,e,r,n,i,o,s){var l=t.selectAll("g.contourlines").data([0]);l.enter().append("g").classed("contourlines",!0);var u=!1!==i.showlines,c=i.showlabels,f=u&&c,d=y.createLines(l,u||c,e),g=y.createLineClip(l,f,r._fullLayout._defs,n.trace.uid),v=t.selectAll("g.contourlabels").data(c?[0]:[]);if(v.exit().remove(),v.enter().append("g").classed("contourlabels",!0),c){var x=o.xaxis,_=o.yaxis,w=x._length,M=_._length,k=[[[0,0],[w,0],[w,M],[0,M]]],A=[];m.clearLocationCache();var T=y.labelFormatter(i,n.t.cb,r._fullLayout),S=p.tester.append("text").attr("data-notex",1).call(p.font,i.labelfont),E={left:0,right:w,center:w/2,top:0,bottom:M,middle:M/2},L=Math.sqrt(w*w+M*M),C=b.LABELDISTANCE*L/Math.max(1,e.length/b.LABELINCREASE);d.each(function(t){var e=y.calcTextOpts(t.level,T,S,r);h.select(this).selectAll("path").each(function(r){var n=this,i=m.getVisibleSegment(n,E,e.height/2);if(i&&(a(n,r,t,i,s,e.height),!(i.len<(e.width+e.height)*b.LABELMIN)))for(var o=Math.min(Math.ceil(i.len/C),b.LABELMAX),l=0;lb&&(n.max=b),n.len=n.max-n.min}}function o(t,e,r){var n=t.getPointAtLength(e),i=t.getPointAtLength(r),a=i.x-n.x,o=i.y-n.y,s=Math.sqrt(a*a+o*o);return[a/s,o/s]}function s(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}function l(t,e){var r=Math.abs(t[0]*e[0]+t[1]*e[1]);return Math.sqrt(1-r*r)/r}function u(t,e,r,n,i,a){var o,s,l,u,c=t.selectAll("g.contourbg").data([0]);c.enter().append("g").classed("contourbg",!0);var h=c.selectAll("path").data("fill"!==a||i?[]:[0]);h.enter().append("path"),h.exit().remove();var p=[];for(u=0;uI){r("x scale is not linear");break}}if(y.length&&"fast"===E){var z=(y[y.length-1]-y[0])/(y.length-1),D=Math.abs(z/100);for(w=0;wD){r("y scale is not linear");break}}}var P=c(_),O="scaled"===e.xtype?"":m,R=p(e,O,g,v,P,M),F="scaled"===e.ytype?"":y,j=p(e,F,b,x,_.length,k);S||(a.expand(M,R),a.expand(k,j));var N={x:R,y:j,z:_,text:e.text};if(s(e,_,"","z"),A&&e.contours&&"heatmap"===e.contours.coloring){var B={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};N.xfill=p(B,O,g,v,P,M),N.yfill=p(B,F,b,x,_.length,k)}return[N]}},{"../../components/colorscale/calc":610,"../../lib":728,"../../plots/cartesian/axes":772,"../../registry":846,"../histogram2d/calc":977,"./clean_2d_array":950,"./convert_column_xyz":952,"./find_empties":954,"./has_columns":955,"./interp2d":958,"./make_bound_array":959,"./max_row_length":960}],950:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){var r,i,a,o,s,l;if(e){for(r=0,s=0;s=0;o--)a=f[o],r=a[0],i=a[1],(s=((h[[r-1,i]]||m)[2]+(h[[r+1,i]]||m)[2]+(h[[r,i-1]]||m)[2]+(h[[r,i+1]]||m)[2])/20)&&(l[a]=[r,i,s],f.splice(o,1),u=!0);if(!u)throw"findEmpties iterated with no new neighbors";for(a in l)h[a]=l[a],c.push(l[a])}return c.sort(function(t,e){return e[2]-t[2]})}},{"./max_row_length":960}],955:[function(t,e,r){"use strict";e.exports=function(t){return!Array.isArray(t.z[0])}},{}],956:[function(t,e,r){"use strict";var n=t("../../components/fx"),i=t("../../lib"),a=n.constants.MAXDIST;e.exports=function(t,e,r,o,s){if(!(t.distance=y[0].length||h<0||h>y.length)return}else{if(n.inbox(e-g[0],e-g[g.length-1])>a||n.inbox(r-v[0],r-v[v.length-1])>a)return;if(s){var w;for(x=[2*g[0]-g[1]],w=1;wm&&(v=Math.max(v,Math.abs(t[i][a]-p)/(g-m))))}return v}var a=t("../../lib"),o=[[-1,0],[1,0],[0,-1],[0,1]];e.exports=function(t,e,r){var o,s,l=1;if(Array.isArray(r))for(o=0;o.01;o++)l=i(t,e,n(l));return l>.01&&a.log("interp2d didn't converge quickly",l),t}},{"../../lib":728}],959:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e,r,i,a,o){var s,l,u,c=[],h=n.traceIs(t,"contour"),f=n.traceIs(t,"histogram"),d=n.traceIs(t,"gl2d");if(Array.isArray(e)&&e.length>1&&!f&&"category"!==o.type){var p=e.length;if(!(p<=a))return h?e.slice(0,a):e.slice(0,a+1);if(h||d)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]],u=1;u0;)b=p.c2p(A[M]),M--;for(b0;)w=m.c2p(T[M]),M--;if(w<_&&(x=_,_=w,w=x,z=!0),S&&(A=r[0].xfill,T=r[0].yfill),"fast"!==E){var D="best"===E?0:.5;y=Math.max(-D*p._length,y),b=Math.min((1+D)*p._length,b),_=Math.max(-D*m._length,_),w=Math.min((1+D)*m._length,w)}var P=Math.round(b-y),O=Math.round(w-_),R=P<=0||O<=0,F=e.plot.select(".imagelayer").selectAll("g.hm."+v).data(R?[]:[0]);if(F.enter().append("g").classed("hm",!0).classed(v,!0),F.exit().remove(),!R){var j,N;"fast"===E?(j=C,N=L):(j=P,N=O);var B=document.createElement("canvas");B.width=j,B.height=N;var U,V,H=B.getContext("2d"),q=s.makeColorScaleFunc(s.extractScale(f.colorscale,f.zmin,f.zmax),{noNumericCheck:!0,returnArray:!0});"fast"===E?(U=I?function(t){return C-1-t}:o.identity,V=z?function(t){return L-1-t}:o.identity):(U=function(t){return o.constrain(Math.round(p.c2p(A[t])-y),0,P)},V=function(t){return o.constrain(Math.round(m.c2p(T[t])-_),0,O)});var G,Y,W,X,Z,J,K,Q=V(0),$=[Q,Q],tt=I?0:1,et=z?0:1,rt=0,nt=0,it=0,at=0;if(E){var ot,st=0;try{ot=new Uint8Array(P*O*4)}catch(t){ot=new Array(P*O*4)}if("best"===E){var lt,ut,ct,ht=new Array(A.length),ft=new Array(T.length),dt=new Array(P);for(M=0;M0&&a0&&s0&&(n=!0);for(var s=0;sa){var o=a-r[t];return r[t]=a,o}}return 0},max:function(t,e,r,i){var a=i[e];if(n(a)){if(a=Number(a),!n(r[t]))return r[t]=a,a;if(r[t]d.size/1.9?d.size:d.size/Math.ceil(d.size/b);var A=d.start+(d.size-b)/2;x=A-b*Math.ceil((A-x)/b)}for(l=0;l=0;a--)i(a);else if("increasing"===e){for(a=1;a=0;a--)t[a]+=t[a+1];"exclude"===r&&(t.push(0),t.shift())}}var u=t("fast-isnumeric"),c=t("../../lib"),h=t("../../plots/cartesian/axes"),f=t("../bar/arrays_to_calcdata"),d=t("./bin_functions"),p=t("./norm_functions"),m=t("./average"),g=t("./clean_bins"),v=t("../../constants/numerical").ONEAVGMONTH;e.exports=function(t,e){if(!0===e.visible){var r,i=[],a=[],o=h.getFromId(t,"h"===e.orientation?e.yaxis||"y":e.xaxis||"x"),s="h"===e.orientation?"y":"x",v={x:"y",y:"x"}[s],y=e[s+"calendar"],b=e.cumulative;g(e,o,s);var x,_,w,M=n(t,e,o,s),k=M[0],A=M[1],T="string"==typeof k.size,S=T?[]:k,E=[],L=[],C=0,I=e.histnorm,z=e.histfunc,D=-1!==I.indexOf("density");b.enabled&&D&&(I=I.replace(/ ?density$/,""),D=!1);var P,O="max"===z||"min"===z,R=O?null:0,F=d.count,j=p[I],N=!1,B=function(t){return o.r2c(t,0,y)};for(Array.isArray(e[v])&&"count"!==z&&(P=e[v],N="avg"===z,F=d[z]),r=B(k.start),_=B(k.end)+(r-h.tickIncrement(r,k.size,!1,y))/1e6;r<_&&i.length<1e6&&(x=h.tickIncrement(r,k.size,!1,y),i.push((r+x)/2),a.push(R),T&&S.push(r),D&&E.push(1/(x-r)),N&&L.push(0),!(x<=r));)r=x;T||"date"!==o.type||(S={start:B(S.start),end:B(S.end),size:S.size});var U=a.length;for(r=0;r=0&&w=q;r--)if(a[r]){G=r;break}for(r=q;r<=G;r++)u(i[r])&&u(a[r])&&H.push({p:i[r],s:a[r],b:0});return 1===H.length&&(H[0].width1=h.tickIncrement(H[0].p,k.size,!1,y)-H[0].p),f(H,e),H}}},{"../../constants/numerical":707,"../../lib":728,"../../plots/cartesian/axes":772,"../bar/arrays_to_calcdata":855,"./average":968,"./bin_functions":970,"./clean_bins":972,"./norm_functions":975,"fast-isnumeric":131}],972:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib").cleanDate,a=t("../../constants/numerical"),o=a.ONEDAY,s=a.BADNUM;e.exports=function(t,e,r){var a=e.type,l=r+"bins",u=t[l];u||(u=t[l]={});var c="date"===a?function(t){return t||0===t?i(t,s,u.calendar):null}:function(t){return n(t)?Number(t):null};u.start=c(u.start),u.end=c(u.end);var h="date"===a?o:1,f=u.size;if(n(f))u.size=f>0?Number(f):h;else if("string"!=typeof f)u.size=h;else{var d=f.charAt(0),p=f.substr(1);p=n(p)?Number(p):0,(p<=0||"date"!==a||"M"!==d||p!==Math.round(p))&&(u.size=h)}var m="autobin"+r;"boolean"!=typeof t[m]&&(t[m]=!((u.start||0===u.start)&&(u.end||0===u.end))),t[m]||delete t["nbins"+r]}},{"../../constants/numerical":707,"../../lib":728,"fast-isnumeric":131}],973:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/color"),o=t("./bin_defaults"),s=t("../bar/style_defaults"),l=t("../../components/errorbars/defaults"),u=t("./attributes");e.exports=function(t,e,r,c){function h(r,n){return i.coerce(t,e,u,r,n)}var f=h("x"),d=h("y");h("cumulative.enabled")&&(h("cumulative.direction"),h("cumulative.currentbin")),h("text");var p=h("orientation",d&&!f?"h":"v"),m=e["v"===p?"x":"y"];if(!m||!m.length)return void(e.visible=!1);n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],c),e["h"===p?"x":"y"]&&h("histfunc"),o(t,e,h,"h"===p?["y"]:["x"]),s(t,e,h,r,c),l(t,e,a.defaultLine,{axis:"y"}),l(t,e,a.defaultLine,{axis:"x",inherit:"y"})}},{"../../components/color":604,"../../components/errorbars/defaults":633,"../../lib":728,"../../registry":846,"../bar/style_defaults":868,"./attributes":967,"./bin_defaults":969}],974:[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.selectPoints=t("../bar/select"),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":782,"../bar/hover":859,"../bar/layout_attributes":861,"../bar/layout_defaults":862,"../bar/plot":863,"../bar/select":864,"../bar/set_positions":865,"../bar/style":867,"../scatter/colorbar":1034,"./attributes":967,"./calc":971,"./defaults":973}],975:[function(t,e,r){"use strict";e.exports={percent:function(t,e){for(var r=t.length,n=100/e,i=0;ik&&m.splice(k,m.length-k),v.length>k&&v.splice(k,v.length-k),!e.autobinx&&e.xbins&&null!==e.xbins.start&&null!==e.xbins.end||(e.xbins=i.autoBin(m,p,e.nbinsx,"2d",y),"histogram2dcontour"===e.type&&(e.xbins.start=w(i.tickIncrement(x(e.xbins.start),e.xbins.size,!0,y)),e.xbins.end=w(i.tickIncrement(x(e.xbins.end),e.xbins.size,!1,y))),e._input.xbins=e.xbins,e._input.autobinx=e.autobinx),!e.autobiny&&e.ybins&&null!==e.ybins.start&&null!==e.ybins.end||(e.ybins=i.autoBin(v,g,e.nbinsy,"2d",b),"histogram2dcontour"===e.type&&(e.ybins.start=M(i.tickIncrement(_(e.ybins.start),e.ybins.size,!0,b)),e.ybins.end=M(i.tickIncrement(_(e.ybins.end),e.ybins.size,!1,b))),e._input.ybins=e.ybins,e._input.autobiny=e.autobiny),f=[];var A,T,S=[],E=[],L="string"==typeof e.xbins.size,C="string"==typeof e.ybins.size,I=L?[]:e.xbins,z=C?[]:e.ybins,D=0,P=[],O=e.histnorm,R=e.histfunc,F=-1!==O.indexOf("density"),j="max"===R||"min"===R,N=j?null:0,B=a.count,U=o[O],V=!1,H=[],q=[],G="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";G&&"count"!==R&&(V="avg"===R,B=a[R]);var Y=e.xbins,W=x(Y.start),X=x(Y.end)+(W-i.tickIncrement(W,Y.size,!1,y))/1e6;for(d=W;d=0&&A=0&&T0)s=h(t.alphahull,l);else{var u=["x","y","z"].indexOf(t.delaunayaxis);s=c(l.map(function(t){return[t[(u+1)%3],t[(u+2)%3]]}))}var p={positions:l,cells:s,lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,contourEnable:t.contour.show,contourColor:d(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading};t.intensity?(this.color="#fff",p.vertexIntensity=t.intensity,p.vertexIntensityBounds=[t.cmin,t.cmax],p.colormap=i(t.colorscale)):t.vertexcolor?(this.color=t.vertexcolor[0],p.vertexColors=a(t.vertexcolor)):t.facecolor?(this.color=t.facecolor[0],p.cellColors=a(t.facecolor)):(this.color=t.color,p.meshColor=d(t.color)),this.mesh.update(p)},p.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=s},{"../../lib/str2rgbarray":749,"alpha-shape":43,"convex-hull":103,"delaunay-triangulate":123,"gl-mesh3d":205,tinycolor2:534}],988:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/colorscale/defaults"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,n){ +return i.coerce(t,e,o,r,n)}function u(t){var e=t.map(function(t){var e=l(t);return e&&Array.isArray(e)?e:null});return e.every(function(t){return t&&t.length===e[0].length})&&e}var c=u(["x","y","z"]),h=u(["i","j","k"]);if(!c)return void(e.visible=!1);h&&h.forEach(function(t){for(var e=0;eo?a=!0:e1)){var h=s.simpleMap(c.x,e.d2c,0,r.xcalendar),f=s.distinctVals(h).minDiff;a=Math.min(a,f)}}for(a===1/0&&(a=1),u=0;u");w.push(o,o,o,o,o,o,null)}(C,p[C],m[C],g[C],v[C]));e.x=x,e.y=_,e.text=w}},{"../../lib":728,"../../plots/cartesian/axes":772,"../../plots/cartesian/axis_ids":775,"./helpers":993,"fast-isnumeric":131}],997:[function(t,e,r){"use strict";var n=t("../../components/colorscale/color_attributes"),i=t("../../components/colorbar/attributes"),a=t("../../components/colorscale/scales"),o=t("../../plots/cartesian/layout_attributes"),s=t("../../plots/font_attributes"),l=t("../../lib/extend"),u=l.extendDeepAll,c=l.extendFlat;e.exports={domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},y:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},editType:"calc"},labelfont:s({editType:"calc"}),tickfont:s({editType:"calc"}),rangefont:s({editType:"calc"}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",editType:"calc"},tickvals:c({},o.tickvals,{editType:"calc"}),ticktext:c({},o.ticktext,{editType:"calc"}),tickformat:{valType:"string",dflt:"3s",editType:"calc"},visible:{valType:"boolean",dflt:!0,editType:"calc"},range:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc"},constraintrange:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc"},values:{valType:"data_array",dflt:[],editType:"calc"},editType:"calc"},line:c(u(n("line","calc"),{colorscale:{dflt:a.Viridis},autocolorscale:{dflt:!1}}),{showscale:{valType:"boolean",dflt:!1,editType:"calc"},colorbar:i,editType:"calc"})}},{"../../components/colorbar/attributes":605,"../../components/colorscale/color_attributes":611,"../../components/colorscale/scales":622,"../../lib/extend":717,"../../plots/cartesian/layout_attributes":783,"../../plots/font_attributes":796}],998:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plots/plots"),a=t("./plot"),o=t("../../constants/xmlns_namespaces"),s=t("./constants");r.name="parcoords",r.attr="type",r.plot=function(t){var e=i.getSubplotCalcData(t.calcdata,"parcoords","parcoords");e.length&&a(t,e)},r.clean=function(t,e,r,n){var i=n._has&&n._has("parcoords"),a=e._has&&e._has("parcoords");i&&!a&&(n._paperdiv.selectAll(".parcoords-line-layers").remove(),n._paperdiv.selectAll(".parcoords-line-layers").remove(),n._paperdiv.selectAll(".parcoords").remove(),n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},r.toSVG=function(t){function e(e){var n=this,i=n.toDataURL("image/png"),a=r.append("svg:image"),l=t._fullLayout._size,u=t._fullData[e.model.key].domain;a.attr({xmlns:o.svg,"xlink:href":i,x:l.l+l.w*u.x[0]-s.overdrag,y:l.t+l.h*(1-u.y[1]),width:(u.x[1]-u.x[0])*l.w+2*s.overdrag,height:(u.y[1]-u.y[0])*l.h,preserveAspectRatio:"none"})}var r=t._fullLayout._glimages,i=n.select(t).selectAll(".svg-container");i.filter(function(t,e){return e===i.size()-1}).selectAll(".parcoords-lines.context, .parcoords-lines.focus").each(e),window.setTimeout(function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}},{"../../constants/xmlns_namespaces":709,"../../plots/plots":831,"./constants":1001,"./plot":1006,d3:122}],999:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),a=t("../../lib"),o=t("../../lib/gup").wrap;e.exports=function(t,e){var r=!!e.line.colorscale&&a.isArray(e.line.color),s=r?e.line.color:Array.apply(0,Array(e.dimensions.reduce(function(t,e){return Math.max(t,e.values.length)},0))).map(function(){return.5}),l=r?e.line.colorscale:[[0,e.line.color],[1,e.line.color]];return n(e,"line")&&i(e,e.line.color,"line","c"),o({lineColor:s,cscale:l})}},{"../../components/colorscale/calc":610,"../../components/colorscale/has_colorscale":617,"../../lib":728,"../../lib/gup":725}],1e3:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l=r.line,u="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+u).remove(),void 0===l||!l.showscale)return void a.autoMargin(t,u);var c=l.color,h=l.cmin,f=l.cmax;n(h)||(h=i.aggNums(Math.min,null,c)),n(f)||(f=i.aggNums(Math.max,null,c));var d=e[0].t.cb=s(t,u),p=o.makeColorScaleFunc(o.extractScale(l.colorscale,h,f),{noNumericCheck:!0});d.fillcolor(p).filllevels({start:h,end:f,size:(f-h)/254}).options(l.colorbar)()}},{"../../components/colorbar/draw":607,"../../components/colorscale":618,"../../lib":728,"../../plots/plots":831,"fast-isnumeric":131}],1001:[function(t,e,r){"use strict";e.exports={maxDimensionCount:60,overdrag:45,verticalPadding:2,tickDistance:50,canvasPixelRatio:1,blockLineCount:5e3,scatter:!1,layers:["contextLineLayer","focusLineLayer","pickLineLayer"],axisTitleOffset:28,axisExtentOffset:10,bar:{width:4,capturewidth:10,fillcolor:"magenta",fillopacity:1,strokecolor:"white",strokeopacity:1,strokewidth:1,handleheight:16,handleopacity:1,handleoverlap:0},cn:{axisExtentText:"axis-extent-text",parcoordsLineLayers:"parcoords-line-layers",parcoordsLineLayer:"parcoords-lines",parcoords:"parcoords",parcoordsControlView:"parcoords-control-view",yAxis:"y-axis",axisOverlays:"axis-overlays",axis:"axis",axisHeading:"axis-heading",axisTitle:"axis-title",axisExtent:"axis-extent",axisExtentTop:"axis-extent-top",axisExtentTopText:"axis-extent-top-text",axisExtentBottom:"axis-extent-bottom",axisExtentBottomText:"axis-extent-bottom-text",axisBrush:"axis-brush"},id:{filterBarPattern:"filter-bar-pattern"}}},{}],1002:[function(t,e,r){"use strict";function n(t,e,r,n,i){i("line.color",r),s(t,"line")&&a.isArray(t.line.color)?(i("line.colorscale"),l(t,e,n,i,{prefix:"line.",cLetter:"c"})):i("line.color",r)}function i(t,e){function r(t,e){return a.coerce(n,i,o.dimensions,t,e)}var n,i,s,l=t.dimensions||[],c=e.dimensions=[],h=1/0;for(l.length>u&&(a.log("parcoords traces support up to "+u+" dimensions at the moment"),l.splice(u)),s=0;s0);d&&(r("label"),r("tickvals"),r("ticktext"),r("tickformat"),r("range"),r("constraintrange"),h=Math.min(h,i.values.length)),i._index=s,c.push(i)}if(isFinite(h))for(s=0;sh&&(i.values=i.values.slice(0,h));return c}var a=t("../../lib"),o=t("./attributes"),s=t("../../components/colorscale/has_colorscale"),l=t("../../components/colorscale/defaults"),u=t("./constants").maxDimensionCount;e.exports=function(t,e,r,s){function l(r,n){return a.coerce(t,e,o,r,n)}var u=i(t,e);n(t,e,r,s,l),l("domain.x"),l("domain.y"),Array.isArray(u)&&u.length||(e.visible=!1);var c={family:s.font.family,size:Math.round(s.font.size*(10/12)),color:s.font.color};a.coerceFont(l,"labelfont",c),a.coerceFont(l,"tickfont",c),a.coerceFont(l,"rangefont",c)}},{"../../components/colorscale/defaults":613,"../../components/colorscale/has_colorscale":617,"../../lib":728,"./attributes":997,"./constants":1001}],1003:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.moduleType="trace",n.name="parcoords",n.basePlotModule=t("./base_plot"),n.categories=["gl","noOpacity"],n.meta={},e.exports=n},{"./attributes":997,"./base_plot":998,"./calc":999,"./colorbar":1e3,"./defaults":1002,"./plot":1006}],1004:[function(t,e,r){"use strict";function n(t){t.read({x:0,y:0,width:1,height:1,data:x})}function i(t,e,r,n,i){var a=t._gl;a.enable(a.SCISSOR_TEST),a.scissor(e,r,n,i),t.clear({color:[0,0,0,0],depth:1})}function a(t,e,r,a,o,s){function l(n){var c;c=Math.min(a,o-n*a),s.offset=v*n*a,s.count=v*c,0===n&&(window.cancelAnimationFrame(r.currentRafs[u]),delete r.currentRafs[u],i(t,s.scissorX,s.scissorY,s.scissorWidth,s.viewBoxSize[1])),r.clearOnly||(e(s),n*a+c>>8*e)%256/255}function u(t,e,r,n){for(var i=[],a=0;a=g-4?l(a,g-2-s):.5);return i}function c(t,e,r){var n,i,a,o=[];for(i=0;if&&(f=t[l].dim2.canvasX,c=l),t[l].dim1.canvasXi)return a;i=o,a=n[r]}return n[n.length-1]}function o(t,e){return function(r,n){if(e){var i=e[n];return null===i||void 0===i?t(r):i}return t(r)}}function s(t,e,r){var n=i(r),a=r.ticktext;return r.tickvals?b.scale.ordinal().domain(r.tickvals.map(o(b.format(r.tickformat),a))).range(r.tickvals.map(function(t){return(t-n[0])/(n[1]-n[0])}).map(function(r){return t-e+r*(e-(t-e))})):b.scale.linear().domain(n).range([t-e,e])}function l(t,e){return b.scale.linear().range([t-e,e])}function u(t){return b.scale.linear().domain(i(t))}function c(t){var e=i(t);return t.tickvals&&b.scale.ordinal().domain(t.tickvals).range(t.tickvals.map(function(t){return(t-e[0])/(e[1]-e[0])}))}function h(t){var e=t.map(function(t){return t[0]}),r=t.map(function(t){return t[1]}),n=r.map(function(t){return b.rgb(t)}),i=function(t){return function(e){return e[t]}},a="rgb".split("").map(function(t){return b.scale.linear().clamp(!0).domain(e).range(n.map(i(t)))});return function(t){return a.map(function(e){return e(t)})}}function f(t,e,r){var i=M(e),a=i.trace,o=i.lineColor,s=i.cscale,l=a.line,c=a.domain,f=a.dimensions,d=t.width,p=a.labelfont,m=a.tickfont,g=a.rangefont,b=y.extendDeep({},l,{color:o.map(u({values:o,range:[l.cmin,l.cmax]})),blockLineCount:v.blockLineCount,canvasOverdrag:v.overdrag*v.canvasPixelRatio}),x=Math.floor(d*(c.x[1]-c.x[0])),_=Math.floor(t.height*(c.y[1]-c.y[0])),w=t.margin||{l:80,r:80,t:100,b:80},k=x,A=_;return{key:r,colCount:f.filter(n).length,dimensions:f,tickDistance:v.tickDistance,unitToColor:h(s),lines:b,labelFont:p,tickFont:m,rangeFont:g,translateX:c.x[0]*d,translateY:t.height-c.y[1]*t.height,pad:w,canvasWidth:k*v.canvasPixelRatio+2*b.canvasOverdrag,canvasHeight:A*v.canvasPixelRatio,width:k,height:A,canvasPixelRatio:v.canvasPixelRatio}}function d(t){var e=t.width,r=t.height,i=t.dimensions,a=t.canvasPixelRatio,o=function(r){return e*r/Math.max(1,t.colCount-1)},h=v.verticalPadding/(r*a),f=1-2*h,d=function(t){return h+f*t},p={key:t.key,xScale:o,model:t},m={};return p.dimensions=i.filter(n).map(function(e,n){var i=u(e),h=m[e.label];return m[e.label]=(h||0)+1,{key:e.label+(h?"__"+h:""),label:e.label,tickFormat:e.tickformat,tickvals:e.tickvals,ticktext:e.ticktext,ordinal:!!e.tickvals,scatter:v.scatter||e.scatter,xIndex:n,crossfilterDimensionIndex:n,visibleIndex:e._index,height:r,values:e.values,paddedUnitValues:e.values.map(i).map(d),xScale:o,x:o(n),canvasX:o(n)*a,unitScale:l(r,v.verticalPadding),domainScale:s(r,v.verticalPadding,e),ordinalScale:c(e),domainToUnitScale:i,filter:e.constraintrange?e.constraintrange.map(i):[0,1],parent:p,model:t}}),p}function p(t){return v.layers.map(function(e){return{key:e,context:"contextLineLayer"===e,pick:"pickLineLayer"===e,viewModel:t,model:t.model}})}function m(t){t.classed(v.cn.axisExtentText,!0).attr("text-anchor","middle").style("cursor","default").style("user-select","none")}var g=t("./lines"),v=t("./constants"),y=t("../../lib"),b=t("d3"),x=t("../../components/drawing"),_=t("../../lib/gup").keyFun,w=t("../../lib/gup").repeat,M=t("../../lib/gup").unwrap;e.exports=function(t,e,r,n,i){function o(t){var e=t.selectAll("defs").data(w,_);e.enter().append("defs");var r=e.selectAll("#"+v.id.filterBarPattern).data(w,_);r.enter().append("pattern").attr("id",v.id.filterBarPattern).attr("patternUnits","userSpaceOnUse"),r.attr("x",-v.bar.width).attr("width",v.bar.capturewidth).attr("height",function(t){return t.model.height});var n=r.selectAll("rect").data(w,_);n.enter().append("rect").attr("shape-rendering","crispEdges"),n.attr("height",function(t){return t.model.height}).attr("width",v.bar.width).attr("x",v.bar.width/2).attr("fill",v.bar.fillcolor).attr("fill-opacity",v.bar.fillopacity).attr("stroke",v.bar.strokecolor).attr("stroke-opacity",v.bar.strokeopacity).attr("stroke-width",v.bar.strokewidth)}function s(t){return t.dimensions.some(function(t){return 0!==t.filter[0]||1!==t.filter[1]})}function l(t,e){for(var r=e.panels||(e.panels=[]),n=t.each(function(t){return t})[e.key].map(function(t){return t.__data__}),i=n.length-1,a=0;a<1;a++)for(var o=0;o=r||s>=n)return;var l=t.lineLayer.readPixel(o,n-1-s),u=0!==l[3],c=u?l[2]+256*(l[1]+256*l[0]):null,h={x:o,y:s,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:c};c!==z&&(u?i.hover(h):i.unhover&&i.unhover(h),z=c)}}),C.style("margin",function(t){var e=t.model.pad;return e.t+"px "+e.r+"px "+e.b+"px "+e.l+"px"}).attr("width",function(t){return t.model.canvasWidth +}).attr("height",function(t){return t.model.canvasHeight}).style("width",function(t){return t.model.width+2*v.overdrag+"px"}).style("height",function(t){return t.model.height+"px"}).style("opacity",function(t){return t.pick?.01:1}),e.style("background","rgba(255, 255, 255, 0)");var D=e.selectAll("."+v.cn.parcoords).data(E,_);D.exit().remove(),D.enter().append("g").classed(v.cn.parcoords,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","none").call(o),D.attr("width",function(t){return t.model.width+t.model.pad.l+t.model.pad.r}).attr("height",function(t){return t.model.height+t.model.pad.t+t.model.pad.b}).attr("transform",function(t){return"translate("+t.model.translateX+","+t.model.translateY+")"});var P=D.selectAll("."+v.cn.parcoordsControlView).data(w,_);P.enter().append("g").classed(v.cn.parcoordsControlView,!0).style("box-sizing","content-box"),P.attr("transform",function(t){return"translate("+t.model.pad.l+","+t.model.pad.t+")"});var O=P.selectAll("."+v.cn.yAxis).data(function(t){return t.dimensions},_);O.enter().append("g").classed(v.cn.yAxis,!0).each(function(t){I.dimensions.push(t)}),P.each(function(t){c(O,t)}),C.each(function(t){t.lineLayer=g(this,t.model.lines,t.model.canvasWidth,t.model.canvasHeight,t.viewModel.dimensions,t.viewModel.panels,t.model.unitToColor,t.context,t.pick,v.scatter),t.viewModel[t.key]=t.lineLayer,I.renderers.push(function(){t.lineLayer.render(t.viewModel.panels,!0)}),t.lineLayer.render(t.viewModel.panels,!t.context)}),O.attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),O.call(b.behavior.drag().origin(function(t){return t}).on("drag",function(t){var e=t.parent;S=!1,T||(t.x=Math.max(-v.overdrag,Math.min(t.model.width+v.overdrag,b.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,O.sort(function(t,e){return t.x-e.x}).each(function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio}),c(O,e),O.filter(function(e){return 0!==Math.abs(t.xIndex-e.xIndex)}).attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),b.select(this).attr("transform","translate("+t.x+", 0)"),O.each(function(r,n,i){i===t.parent.key&&(e.dimensions[n]=r)}),e.contextLineLayer&&e.contextLineLayer.render(e.panels,!1,!s(e)),e.focusLineLayer.render&&e.focusLineLayer.render(e.panels))}).on("dragend",function(t){var e=t.parent;if(T)return void("ending"===T&&(T=!1));t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,c(O,e),b.select(this).attr("transform",function(t){return"translate("+t.x+", 0)"}),e.contextLineLayer&&e.contextLineLayer.render(e.panels,!1,!s(e)),e.focusLineLayer&&e.focusLineLayer.render(e.panels),e.pickLineLayer&&e.pickLineLayer.render(e.panels,!0),S=!0,i&&i.axesMoved&&i.axesMoved(e.key,e.dimensions.map(function(t){return t.crossfilterDimensionIndex}))})),O.exit().remove();var R=O.selectAll("."+v.cn.axisOverlays).data(w,_);R.enter().append("g").classed(v.cn.axisOverlays,!0),R.selectAll("."+v.cn.axis).remove();var F=R.selectAll("."+v.cn.axis).data(w,_);F.enter().append("g").classed(v.cn.axis,!0),F.each(function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,n=r.domain();b.select(this).call(b.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?n:null).tickFormat(t.ordinal?function(t){return t}:null).scale(r)),x.font(F.selectAll("text"),t.model.tickFont)}),F.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),F.selectAll("text").style("text-shadow","1px 1px 1px #fff, -1px -1px 1px #fff, 1px -1px 1px #fff, -1px 1px 1px #fff").style("cursor","default").style("user-select","none");var j=R.selectAll("."+v.cn.axisHeading).data(w,_);j.enter().append("g").classed(v.cn.axisHeading,!0);var N=j.selectAll("."+v.cn.axisTitle).data(w,_);N.enter().append("text").classed(v.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("user-select","none").style("pointer-events","auto"),N.attr("transform","translate(0,"+-v.axisTitleOffset+")").text(function(t){return t.label}).each(function(t){x.font(N,t.model.labelFont)});var B=R.selectAll("."+v.cn.axisExtent).data(w,_);B.enter().append("g").classed(v.cn.axisExtent,!0);var U=B.selectAll("."+v.cn.axisExtentTop).data(w,_);U.enter().append("g").classed(v.cn.axisExtentTop,!0),U.attr("transform","translate(0,"+-v.axisExtentOffset+")");var V=U.selectAll("."+v.cn.axisExtentTopText).data(w,_);V.enter().append("text").classed(v.cn.axisExtentTopText,!0).call(m),V.text(function(t){return h(t)(t.domainScale.domain().slice(-1)[0])}).each(function(t){x.font(V,t.model.rangeFont)});var H=B.selectAll("."+v.cn.axisExtentBottom).data(w,_);H.enter().append("g").classed(v.cn.axisExtentBottom,!0),H.attr("transform",function(t){return"translate(0,"+(t.model.height+v.axisExtentOffset)+")"});var q=H.selectAll("."+v.cn.axisExtentBottomText).data(w,_);q.enter().append("text").classed(v.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(m),q.text(function(t){return h(t)(t.domainScale.domain()[0])}).each(function(t){x.font(q,t.model.rangeFont)});var G=R.selectAll("."+v.cn.axisBrush).data(w,_),Y=G.enter().append("g").classed(v.cn.axisBrush,!0);G.each(function(t){t.brush||(t.brush=b.svg.brush().y(t.unitScale).on("brushstart",y).on("brush",k).on("brushend",A),0===t.filter[0]&&1===t.filter[1]||t.brush.extent(t.filter),b.select(this).call(t.brush))}),Y.selectAll("rect").attr("x",-v.bar.capturewidth/2).attr("width",v.bar.capturewidth),Y.selectAll("rect.extent").attr("fill","url(#"+v.id.filterBarPattern+")").style("cursor","ns-resize").filter(function(t){return 0===t.filter[0]&&1===t.filter[1]}).attr("y",-100),Y.selectAll(".resize rect").attr("height",v.bar.handleheight).attr("opacity",0).style("visibility","visible"),Y.selectAll(".resize.n rect").style("cursor","n-resize").attr("y",v.bar.handleoverlap-v.bar.handleheight),Y.selectAll(".resize.s rect").style("cursor","s-resize").attr("y",v.bar.handleoverlap);var W=!1,X=!1;return I}},{"../../components/drawing":628,"../../lib":728,"../../lib/gup":725,"./constants":1001,"./lines":1004,d3:122}],1006:[function(t,e,r){"use strict";var n=t("./parcoords");e.exports=function(t,e){var r=t._fullLayout,i=r._paper,a=r._paperdiv,o={},s={},l=r._size;e.forEach(function(e,r){o[r]=t.data[r].dimensions,s[r]=t.data[r].dimensions.slice()});var u=function(e,r,n){var i=s[e][r],a=i.constraintrange;a&&2===a.length||(a=i.constraintrange=[]),a[0]=n[0],a[1]=n[1],t.emit("plotly_restyle")},c=function(e){t.emit("plotly_hover",e)},h=function(e){t.emit("plotly_unhover",e)},f=function(e,r){function n(t){return!("visible"in t)||t.visible}function i(t,e,r){var n=e.indexOf(r),i=t.indexOf(n);return-1===i&&(i+=e.length),i}var a=function(t){return function(e,n){return i(r,t,e)-i(r,t,n)}}(s[e].filter(n));o[e].sort(a),s[e].filter(function(t){return!n(t)}).sort(function(t){return s[e].indexOf(t)}).forEach(function(t){o[e].splice(o[e].indexOf(t),1),o[e].splice(s[e].indexOf(t),0,t)}),t.emit("plotly_restyle")};n(a,i,e,{width:l.w,height:l.h,margin:{t:l.t,r:l.r,b:l.b,l:l.l}},{filterChanged:u,hover:c,unhover:h,axesMoved:f})}},{"./parcoords":1005}],1007:[function(t,e,r){"use strict";var n=t("../../components/color/attributes"),i=t("../../plots/font_attributes"),a=t("../../plots/attributes"),o=t("../../lib/extend").extendFlat,s=i({editType:"calc",colorEditType:"style"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:n.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},editType:"calc"},text:{valType:"data_array",editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:o({},a.hoverinfo,{flags:["label","text","value","percent","name"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc"},textfont:o({},s,{}),insidetextfont:o({},s,{}),outsidetextfont:o({},s,{}),domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},y:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},editType:"calc"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"number",min:-360,max:360,dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}},{"../../components/color/attributes":603,"../../lib/extend":717,"../../plots/attributes":770,"../../plots/font_attributes":796}],1008:[function(t,e,r){"use strict";function n(t,e){for(var r=[],n=0;n")}return m};var l},{"../../components/color":604,"./helpers":1011,"fast-isnumeric":131,tinycolor2:534}],1010:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r,a){function o(r,a){return n.coerce(t,e,i,r,a)}var s=n.coerceFont,l=o("values");if(!Array.isArray(l)||!l.length)return void(e.visible=!1);var u=o("labels");Array.isArray(u)||(o("label0"),o("dlabel")),o("marker.line.width")&&o("marker.line.color");var c=o("marker.colors");Array.isArray(c)||(e.marker.colors=[]),o("scalegroup");var h=o("text"),f=o("textinfo",Array.isArray(h)?"text+percent":"percent");if(o("hovertext"),f&&"none"!==f){var d=o("textposition"),p=Array.isArray(d)||"auto"===d,m=p||"inside"===d,g=p||"outside"===d;if(m||g){var v=s(o,"textfont",a.font);m&&s(o,"insidetextfont",v),g&&s(o,"outsidetextfont",v)}}o("domain.x"),o("domain.y"),o("hole"),o("sort"),o("direction"),o("rotation"),o("pull")}},{"../../lib":728,"./attributes":1007}],1011:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)}},{"../../lib":728}],1012:[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":1007,"./base_plot":1008,"./calc":1009,"./defaults":1010,"./layout_attributes":1013,"./layout_defaults":1014,"./plot":1015,"./style":1016,"./style_one":1017}],1013:[function(t,e,r){"use strict";e.exports={hiddenlabels:{valType:"data_array",editType:"calc"}}},{}],1014:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){!function(r,a){n.coerce(t,e,i,r,a)}("hiddenlabels")}},{"../../lib":728,"./layout_attributes":1013}],1015:[function(t,e,r){"use strict";function n(t,e,r){var n=Math.sqrt(t.width*t.width+t.height*t.height),a=t.width/t.height,o=Math.PI*Math.min(e.v/r.vTotal,.5),s=1-r.trace.hole,l=i(e,r),u={scale:l*r.r*2/n,rCenter:1-l,rotate:0};if(u.scale>=1)return u;var c=a+1/(2*Math.tan(o)),h=r.r*Math.min(1/(Math.sqrt(c*c+.5)+c),s/(Math.sqrt(a*a+s/2)+a)),f={scale:2*h/t.height,rCenter:Math.cos(h/r.r)-h*a/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},d=1/a,p=d+1/(2*Math.tan(o)),m=r.r*Math.min(1/(Math.sqrt(p*p+.5)+p),s/(Math.sqrt(d*d+s/2)+d)),g={scale:2*m/t.width,rCenter:Math.cos(m/r.r)-m/a/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},v=g.scale>f.scale?g:f;return u.scale<1&&v.scale>u.scale?v:u}function i(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 a(t,e){var r=e.pxmid[0],n=e.pxmid[1],i=t.width/2,a=t.height/2;return r<0&&(i*=-1),n<0&&(a*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(a)*(i>0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}function o(t,e){function r(t,e){return t.pxmid[1]-e.pxmid[1]}function n(t,e){return e.pxmid[1]-t.pxmid[1]}var i,a,o,s,l,u,c,h,f,d,p,m,g;for(a=0;a<2;a++)for(o=a?r:n,l=a?Math.max:Math.min,c=a?1:-1,i=0;i<2;i++){for(s=i?Math.max:Math.min,u=i?1:-1,h=t[a][i],h.sort(o),f=t[1-a][i],d=f.concat(h),m=[],p=0;p0&&(t.labelExtraY=b),Array.isArray(e.pull))for(i=0;i=e.pull[o.i]||((t.pxmid[1]-o.pxmid[1])*c>0?(h=o.cyFinal+l(o.px0[1],o.px1[1]),(b=h-g-t.labelExtraY)*c>0&&(t.labelExtraY+=b)):(v+t.labelExtraY-y)*c>0&&(n=3*u*Math.abs(i-d.indexOf(t)),f=o.cxFinal+s(o.px0[0],o.px1[0]),(p=f+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*u>0&&(t.labelExtraX+=p)))}(m[p],v)}}}function s(t,e){var r,n,i,a,o,s,l,c,h,f,d=[];for(i=0;ic&&(c=s.pull[a]);o.r=Math.min(r/u(s.tilt,Math.sin(l),s.depth),n/u(s.tilt,Math.cos(l),s.depth))/(2+2*c),o.cx=e.l+e.w*(s.domain.x[1]+s.domain.x[0])/2,o.cy=e.t+e.h*(2-s.domain.y[1]-s.domain.y[0])/2,s.scalegroup&&-1===d.indexOf(s.scalegroup)&&d.push(s.scalegroup)}for(a=0;ah.vTotal/2?1:0)}function u(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 c=t("d3"),h=t("../../components/fx"),f=t("../../components/color"),d=t("../../components/drawing"),p=t("../../lib/svg_text_utils"),m=t("./helpers");e.exports=function(t,e){var r=t._fullLayout;s(e,r._size);var u=r._pielayer.selectAll("g.trace").data(e);u.enter().append("g").attr({"stroke-linejoin":"round",class:"trace"}),u.exit().remove(),u.order(),u.each(function(e){var s=c.select(this),u=e[0],g=u.trace,v=(g.depth||0)*u.r*Math.sin(0)/2,y=g.tiltaxis||0,b=y*Math.PI/180,x=[v*Math.sin(b),v*Math.cos(b)],_=u.r*Math.cos(0),w=s.selectAll("g.part").data(g.tilt?["top","sides"]:["top"]);w.enter().append("g").attr("class",function(t){return t+" part"}),w.exit().remove(),w.order(),l(e),s.selectAll(".top").each(function(){var s=c.select(this).selectAll("g.slice").data(e);s.enter().append("g").classed("slice",!0),s.exit().remove();var l=[[[],[]],[[],[]]],v=!1;s.each(function(e){function o(n){n.originalEvent=c.event;var a=t._fullLayout,o=t._fullData[g.index],s=h.castHoverinfo(o,a,e.i);if("all"===s&&(s="label+text+value+percent+name"),t._dragging||!1===a.hovermode||"none"===s||"skip"===s||!s)return void h.hover(t,n,"pie");var l=i(e,u),f=w+e.pxmid[0]*(1-l),d=M+e.pxmid[1]*(1-l),p=r.separators,v=[];-1!==s.indexOf("label")&&v.push(e.label),-1!==s.indexOf("text")&&(o.hovertext?v.push(Array.isArray(o.hovertext)?o.hovertext[e.i]:o.hovertext):o.text&&o.text[e.i]&&v.push(o.text[e.i])),-1!==s.indexOf("value")&&v.push(m.formatPieValue(e.v,p)),-1!==s.indexOf("percent")&&v.push(m.formatPiePercent(e.v/u.vTotal,p)),h.loneHover({x0:f-l*u.r,x1:f+l*u.r,y:d,text:v.join("
"),name:-1!==s.indexOf("name")?o.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:h.castHoverOption(g,e.i,"bgcolor")||e.color,borderColor:h.castHoverOption(g,e.i,"bordercolor"),fontFamily:h.castHoverOption(g,e.i,"font.family"),fontSize:h.castHoverOption(g,e.i,"font.size"),fontColor:h.castHoverOption(g,e.i,"font.color")},{container:a._hoverlayer.node(),outerContainer:a._paper.node(),gd:t}),h.hover(t,n,"pie"),T=!0}function s(e){e.originalEvent=c.event,t.emit("plotly_unhover",{event:c.event,points:[e]}),T&&(h.loneUnhover(r._hoverlayer.node()),T=!1)}function f(){t._hoverdata=[e],t._hoverdata.trace=u.trace,h.click(t,c.event)}function b(t,r,n,i){return"a"+i*u.r+","+i*_+" "+y+" "+e.largeArc+(n?" 1 ":" 0 ")+i*(r[0]-t[0])+","+i*(r[1]-t[1])}if(e.hidden)return void c.select(this).selectAll("path,g").remove();e.pointNumber=e.i,e.curveNumber=g.index,l[e.pxmid[1]<0?0:1][e.pxmid[0]<0?0:1].push(e);var w=u.cx+x[0],M=u.cy+x[1],k=c.select(this),A=k.selectAll("path.surface").data([e]),T=!1;if(A.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),k.select("path.textline").remove(),k.on("mouseover",o).on("mouseout",s).on("click",f),g.pull){var S=+(Array.isArray(g.pull)?g.pull[e.i]:g.pull)||0;S>0&&(w+=S*e.pxmid[0],M+=S*e.pxmid[1])}e.cxFinal=w,e.cyFinal=M;var E=g.hole;if(e.v===u.vTotal){var L="M"+(w+e.px0[0])+","+(M+e.px0[1])+b(e.px0,e.pxmid,!0,1)+b(e.pxmid,e.px0,!0,1)+"Z";E?A.attr("d","M"+(w+E*e.px0[0])+","+(M+E*e.px0[1])+b(e.px0,e.pxmid,!1,E)+b(e.pxmid,e.px0,!1,E)+"Z"+L):A.attr("d",L)}else{var C=b(e.px0,e.px1,!0,1);if(E){var I=1-E;A.attr("d","M"+(w+E*e.px1[0])+","+(M+E*e.px1[1])+b(e.px1,e.px0,!1,E)+"l"+I*e.px0[0]+","+I*e.px0[1]+C+"Z")}else A.attr("d","M"+w+","+M+"l"+e.px0[0]+","+e.px0[1]+C+"Z")}var z=Array.isArray(g.textposition)?g.textposition[e.i]:g.textposition,D=k.selectAll("g.slicetext").data(e.text&&"none"!==z?[0]:[]);D.enter().append("g").classed("slicetext",!0),D.exit().remove(),D.each(function(){var r=c.select(this).selectAll("text").data([0]);r.enter().append("text").attr("data-notex",1),r.exit().remove(),r.text(e.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(d.font,"outside"===z?g.outsidetextfont:g.insidetextfont).call(p.convertToTspans,t);var i,o=d.bBox(r.node());"outside"===z?i=a(o,e):(i=n(o,e,u),"auto"===z&&i.scale<1&&(r.call(d.font,g.outsidetextfont),g.outsidetextfont.family===g.insidetextfont.family&&g.outsidetextfont.size===g.insidetextfont.size||(o=d.bBox(r.node())),i=a(o,e)));var s=w+e.pxmid[0]*i.rCenter+(i.x||0),l=M+e.pxmid[1]*i.rCenter+(i.y||0);i.outside&&(e.yLabelMin=l-o.height/2,e.yLabelMid=l,e.yLabelMax=l+o.height/2,e.labelExtraX=0,e.labelExtraY=0,v=!0),r.attr("transform","translate("+s+","+l+")"+(i.scale<1?"scale("+i.scale+")":"")+(i.rotate?"rotate("+i.rotate+")":"")+"translate("+-(o.left+o.right)/2+","+-(o.top+o.bottom)/2+")")})}),v&&o(l,g),s.each(function(t){if(t.labelExtraX||t.labelExtraY){var e=c.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],i=t.cyFinal+t.pxmid[1],a="M"+n+","+i,o=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var s=t.labelExtraX*t.pxmid[1]/t.pxmid[0],l=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);Math.abs(s)>Math.abs(l)?a+="l"+l*t.pxmid[0]/t.pxmid[1]+","+l+"H"+(n+t.labelExtraX+o):a+="l"+t.labelExtraX+","+s+"v"+(l-s)+"h"+o}else a+="V"+(t.yLabelMid+t.labelExtraY)+"h"+o;e.append("path").classed("textline",!0).call(f.stroke,g.outsidetextfont.color).attr({"stroke-width":Math.min(2,g.outsidetextfont.size/8),d:a,fill:"none"})}})})}),setTimeout(function(){u.selectAll("tspan").each(function(){var t=c.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{"../../components/color":604,"../../components/drawing":628,"../../components/fx":645,"../../lib/svg_text_utils":750,"./helpers":1011,d3:122}],1016:[function(t,e,r){"use strict";var n=t("d3"),i=t("./style_one");e.exports=function(t){t._fullLayout._pielayer.selectAll(".trace").each(function(t){var e=t[0],r=e.trace,a=n.select(this);a.style({opacity:r.opacity}),a.selectAll(".top path.surface").each(function(t){n.select(this).call(i,t,r)})})}},{"./style_one":1017,d3:122}],1017:[function(t,e,r){"use strict";var n=t("../../components/color");e.exports=function(t,e,r){var i=r.marker.line.color;Array.isArray(i)&&(i=i[e.i]||n.defaultLine);var a=r.marker.line.width||0;Array.isArray(a)&&(a=a[e.i]||0),t.style({"stroke-width":a}).call(n.fill,e.color).call(n.stroke,i)}},{"../../components/color":604}],1018:[function(t,e,r){"use strict";var n=t("../scattergl/attributes");e.exports={x:n.x,y:n.y,xy:{valType:"data_array",editType:"calc"},indices:{valType:"data_array",editType:"calc"},xbounds:{valType:"data_array",editType:"calc"},ybounds:{valType:"data_array",editType:"calc"},text:n.text,marker:{color:{valType:"color",arrayOk:!1,editType:"calc"},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,editType:"calc"},blend:{valType:"boolean",dflt:null,editType:"calc"},sizemin:{valType:"number",min:.1,max:2,dflt:.5,editType:"calc"},sizemax:{valType:"number",min:.1,dflt:20,editType:"calc"},border:{color:{valType:"color",arrayOk:!1,editType:"calc"},arearatio:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},editType:"calc"},editType:"calc"}}},{"../scattergl/attributes":1077}],1019:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.type="pointcloud",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=a(t.glplot,this.pointcloudOptions),this.pointcloud._trace=this}function i(t,e){var r=new n(t,e.uid);return r.update(e),r}var a=t("gl-pointcloud2d"),o=t("../../lib/str2rgbarray"),s=t("../scatter/get_trace_color"),l=["xaxis","yaxis"],u=n.prototype;u.handlePick=function(t){var e=this.idToIndex[t.pointId];return{trace:this,dataCoord:t.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*e],this.pickXYData[2*e+1]]:[this.pickXData[e],this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:this.color,name:this.name,pointIndex:e,hoverinfo:this.hoverinfo}},u.update=function(t){this.index=t.index,this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.updateFast(t),this.color=s(t,{})},u.updateFast=function(t){var e,r,n,i,a,s,l=this.xData=this.pickXData=t.x,u=this.yData=this.pickYData=t.y,c=this.pickXYData=t.xy,h=t.xbounds&&t.ybounds,f=t.indices,d=this.bounds;if(c){if(n=c,e=c.length>>>1,h)d[0]=t.xbounds[0],d[2]=t.xbounds[1],d[1]=t.ybounds[0],d[3]=t.ybounds[1];else for(s=0;sd[2]&&(d[2]=i),ad[3]&&(d[3]=a);if(f)r=f;else for(r=new Int32Array(e),s=0;sd[2]&&(d[2]=i),ad[3]&&(d[3]=a);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var p=o(t.marker.color),m=o(t.marker.border.color),g=t.opacity*t.marker.opacity;p[3]*=g,this.pointcloudOptions.color=p;var v=t.marker.blend;if(null===v){v=l.length<100||u.length<100}this.pointcloudOptions.blend=v,m[3]*=g,this.pointcloudOptions.borderColor=m;var y=t.marker.sizemin,b=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=y,this.pointcloudOptions.sizeMax=b,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions),this.expandAxesFast(d,b/2)},u.expandAxesFast=function(t,e){for(var r,n,i,a=e||.5,o=0;o<2;o++)r=this.scene[l[o]],n=r._min,n||(n=[]),n.push({val:t[o],pad:a}),i=r._max,i||(i=[]),i.push({val:t[o+2],pad:a})},u.dispose=function(){this.pointcloud.dispose()},e.exports=i},{"../../lib/str2rgbarray":749,"../scatter/get_trace_color":1040,"gl-pointcloud2d":230}],1020:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){function a(r,a){return n.coerce(t,e,i,r,a)}a("x"),a("y"),a("xbounds"),a("ybounds"),t.xy&&t.xy instanceof Float32Array&&(e.xy=t.xy),t.indices&&t.indices instanceof Int32Array&&(e.indices=t.indices),a("text"),a("marker.color",r),a("marker.opacity"),a("marker.blend"),a("marker.sizemin"),a("marker.sizemax"),a("marker.border.color",r),a("marker.border.arearatio")}},{"../../lib":728,"./attributes":1018}],1021:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("../scatter3d/calc"),n.plot=t("./convert"),n.moduleType="trace",n.name="pointcloud",n.basePlotModule=t("../../plots/gl2d"),n.categories=["gl2d","showLegend"],n.meta={},e.exports=n},{"../../plots/gl2d":808,"../scatter3d/calc":1056,"./attributes":1018,"./convert":1019,"./defaults":1020}],1022:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/attributes"),a=t("../../components/color/attributes"),o=t("../../components/fx/attributes"),s=t("../../lib/extend").extendFlat,l=t("../../plot_api/edit_types").overrideAll;e.exports=l({hoverinfo:s({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),hoverlabel:o.hoverlabel,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]}},orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s"},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:n({}),node:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20}},link:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]}}},"calc","nested")},{"../../components/color/attributes":603,"../../components/fx/attributes":637,"../../lib/extend":717,"../../plot_api/edit_types":756,"../../plots/attributes":770,"../../plots/font_attributes":796}],1023:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../plots/plots"),a=t("./plot"),o=t("../../components/fx/layout_attributes");r.name="sankey",r.attr="type",r.baseLayoutAttrOverrides=n({hoverlabel:o.hoverlabel},"plot","nested"),r.plot=function(t){var e=i.getSubplotCalcData(t.calcdata,"sankey","sankey");e.length&&a(t,e)},r.clean=function(t,e,r,n){var i=n._has&&n._has("sankey"),a=e._has&&e._has("sankey");i&&!a&&n._paperdiv.selectAll(".sankey").remove()}},{"../../components/fx/layout_attributes":646,"../../plot_api/edit_types":756,"../../plots/plots":831,"./plot":1028}],1024:[function(t,e,r){"use strict";function n(t,e,r){for(var n=t.map(function(){return[]}),a=0;a1})}var i=t("strongly-connected-components"),a=t("../../lib"),o=t("../../lib/gup").wrap;e.exports=function(t,e){return n(e.node.label,e.link.source,e.link.target)&&(a.error("Circularity is present in the Sankey data. Removing all nodes and links."),e.link.label=[],e.link.source=[],e.link.target=[],e.link.value=[],e.link.color=[],e.node.label=[],e.node.color=[]),o({link:e.link,node:e.node})}},{"../../lib":728,"../../lib/gup":725,"strongly-connected-components":528}],1025:[function(t,e,r){"use strict";e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"cubic-in-out",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeCapture:"node-capture",nodeCentered:"node-entered",nodeLabelGuide:"node-label-guide",nodeLabel:"node-label",nodeLabelTextPath:"node-label-text-path"}}},{}],1026:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../components/color/attributes").defaults,o=t("../../components/color"),s=t("tinycolor2");e.exports=function(t,e,r,l){function u(r,a){return n.coerce(t,e,i,r,a)}u("node.label"),u("node.pad"),u("node.thickness"),u("node.line.color"),u("node.line.width");var c=function(t){return a[t%a.length]};u("node.color",e.node.label.map(function(t,e){return o.addOpacity(c(e),.8)})),u("link.label"),u("link.source"),u("link.target"),u("link.value"),u("link.line.color"),u("link.line.width"),u("link.color",e.link.value.map(function(){return s(l.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)"})),u("domain.x"),u("domain.y"),u("orientation"),u("valueformat"),u("valuesuffix"),u("arrangement"),n.coerceFont(u,"textfont",n.extendFlat({},l.font));var h=function(t,r){ +return-1===e.link.source.indexOf(r)&&-1===e.link.target.indexOf(r)};e.node.label.some(h)&&n.warn("Some of the nodes are neither sources nor targets, they will not be displayed.")}},{"../../components/color":604,"../../components/color/attributes":603,"../../lib":728,"./attributes":1022,tinycolor2:534}],1027:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.moduleType="trace",n.name="sankey",n.basePlotModule=t("./base_plot"),n.categories=["noOpacity"],n.meta={},e.exports=n},{"./attributes":1022,"./base_plot":1023,"./calc":1024,"./defaults":1026,"./plot":1028}],1028:[function(t,e,r){"use strict";function n(t){return""!==t}function i(t,e){return t.filter(function(t){return t.key===e.traceId})}function a(t,e){p.select(t).select("path").style("fill-opacity",e),p.select(t).select("rect").style("fill-opacity",e)}function o(t){p.select(t).select("text.name").style("fill","black")}function s(t){return function(e){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function l(t){return function(e){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function u(t,e,r){e&&r&&i(r,e).selectAll("."+b.sankeyLink).filter(s(e)).call(h.bind(0,e,r,!1))}function c(t,e,r){e&&r&&i(r,e).selectAll("."+b.sankeyLink).filter(s(e)).call(f.bind(0,e,r,!1))}function h(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",.4),a&&i(e,t).selectAll("."+b.sankeyLink).filter(function(t){return t.link.label===a}).style("fill-opacity",.4),r&&i(e,t).selectAll("."+b.sankeyNode).filter(l(t)).call(u)}function f(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",function(t){return t.tinyColorAlpha}),a&&i(e,t).selectAll("."+b.sankeyLink).filter(function(t){return t.link.label===a}).style("fill-opacity",function(t){return t.tinyColorAlpha}),r&&i(e,t).selectAll(b.sankeyNode).filter(l(t)).call(c)}function d(t,e){var r=t.hoverlabel||{},n=y.nestedProperty(r,e).get();return!Array.isArray(n)&&n}var p=t("d3"),m=t("./render"),g=t("../../components/fx"),v=t("../../components/color"),y=t("../../lib"),b=t("./constants").cn;e.exports=function(t,e){var r=t._fullLayout,i=r._paper,s=r._size,l=function(e,r){var n=r.link;n.originalEvent=p.event,t._hoverdata=[n],g.click(t,{target:!0})},y=function(e,r,n){var i=r.link;i.originalEvent=p.event,p.select(e).call(h.bind(0,r,n,!0)),g.hover(t,i,"sankey")},x=function(e,i){var s=i.link.trace,l=t._fullLayout._paperdiv.node().getBoundingClientRect(),u=e.getBoundingClientRect(),c=u.left+u.width/2,h=u.top+u.height/2,f=g.loneHover({x:c-l.left,y:h-l.top,name:p.format(i.valueFormat)(i.link.value)+i.valueSuffix,text:[i.link.label||"",["Source:",i.link.source.label].join(" "),["Target:",i.link.target.label].join(" ")].filter(n).join("
"),color:d(s,"bgcolor")||v.addOpacity(i.tinyColorHue,1),borderColor:d(s,"bordercolor"),fontFamily:d(s,"font.family"),fontSize:d(s,"font.size"),fontColor:d(s,"font.color"),idealAlign:p.event.x"),color:d(s,"bgcolor")||i.tinyColorHue,borderColor:d(s,"bordercolor"),fontFamily:d(s,"font.family"),fontSize:d(s,"font.size"),fontColor:d(s,"font.color"),idealAlign:"left"},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t});a(v,.85),o(v)},A=function(e,n,i){p.select(e).call(c,n,i),t.emit("plotly_unhover",{event:p.event,points:[n.node]}),g.loneUnhover(r._hoverlayer.node())};m(i,e,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},{linkEvents:{hover:y,follow:x,unhover:_,select:l},nodeEvents:{hover:M,follow:k,unhover:A,select:w}})}},{"../../components/color":604,"../../components/fx":645,"../../lib":728,"./constants":1025,"./render":1029,d3:122}],1029:[function(t,e,r){"use strict";function n(t){var e,r=[];for(e=0;e1||t.linkLineWidth>0}function v(t){return"translate("+t.translateX+","+t.translateY+")"+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function y(t){return"translate("+(t.horizontal?0:t.labelY)+" "+(t.horizontal?t.labelY:0)+")"}function b(t){return C.svg.line()([[t.horizontal?t.left?-t.sizeAcross:t.visibleWidth+L.nodeTextOffsetHorizontal:L.nodeTextOffsetHorizontal,0],[t.horizontal?t.left?-L.nodeTextOffsetHorizontal:t.sizeAcross:t.visibleHeight-L.nodeTextOffsetHorizontal,0]])}function x(t){return t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)"}function _(t){return t.horizontal?"scale(1 1)":"scale(-1 1)"}function w(t){return t.darkBackground&&!t.horizontal?"rgb(255,255,255)":"rgb(0,0,0)"}function M(t){return t.horizontal&&t.left?"100%":"0%"}function k(t,e,r){t.on(".basic",null).on("mouseover.basic",function(t){t.interactionState.dragInProgress||(r.hover(this,t,e),t.interactionState.hovered=[this,t])}).on("mousemove.basic",function(t){t.interactionState.dragInProgress||(r.follow(this,t),t.interactionState.hovered=[this,t])}).on("mouseout.basic",function(t){t.interactionState.dragInProgress||(r.unhover(this,t,e),t.interactionState.hovered=!1)}).on("click.basic",function(t){t.interactionState.hovered&&(r.unhover(this,t,e),t.interactionState.hovered=!1),t.interactionState.dragInProgress||r.select(this,t,e)})}function A(t,e,r){var n=C.behavior.drag().origin(function(t){return t.node}).on("dragstart",function(n){if("fixed"!==n.arrangement&&(R.raiseToTop(this),n.interactionState.dragInProgress=n.node,i(n.node),n.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,n.interactionState.hovered),n.interactionState.hovered=!1),"snap"===n.arrangement)){var a=n.traceId+"|"+Math.floor(n.node.originalX);n.forceLayouts[a]?n.forceLayouts[a].alpha(1):T(t,a,n),S(t,e,n,a)}}).on("drag",function(r){if("fixed"!==r.arrangement){var n=C.event.x,o=C.event.y;"snap"===r.arrangement?(r.node.x=n,r.node.y=o):("freeform"===r.arrangement&&(r.node.x=n),r.node.y=Math.max(r.node.dy/2,Math.min(r.size-r.node.dy/2,o))),i(r.node),"snap"!==r.arrangement&&(r.sankey.relayout(),p(t.filter(a(r)),e))}}).on("dragend",function(t){t.interactionState.dragInProgress=!1});t.on(".drag",null).call(n)}function T(t,e,r){var n=r.sankey.nodes().filter(function(t){return t.originalX===r.node.originalX});r.forceLayouts[e]=O.forceSimulation(n).alphaDecay(0).force("collide",O.forceCollide().radius(function(t){return t.dy/2+r.nodePad/2}).strength(1).iterations(L.forceIterations)).force("constrain",E(t,e,n,r)).stop()}function S(t,e,r,n){window.requestAnimationFrame(function i(){for(var o=0;o0&&window.requestAnimationFrame(i)})}function E(t,e,r,n){return function(){for(var t=0,i=0;i0&&n.forceLayouts[e].alpha(0)}}var L=t("./constants"),C=t("d3"),I=t("tinycolor2"),z=t("../../components/color"),D=t("../../components/drawing"),P=t("@plotly/d3-sankey").sankey,O=t("d3-force"),R=t("../../lib"),F=t("../../lib/gup").keyFun,j=t("../../lib/gup").repeat,N=t("../../lib/gup").unwrap;e.exports=function(t,e,r,i){var a=t.selectAll("."+L.cn.sankey).data(e.filter(function(t){return N(t).trace.visible}).map(l.bind(null,r)),F);a.exit().remove(),a.enter().append("g").classed(L.cn.sankey,!0).style("box-sizing","content-box").style("position","absolute").style("left",0).style("shape-rendering","geometricPrecision").style("pointer-events","auto").style("box-sizing","content-box").attr("transform",v),a.transition().ease(L.ease).duration(L.duration).attr("transform",v);var o=a.selectAll("."+L.cn.sankeyLinks).data(j,F);o.enter().append("g").classed(L.cn.sankeyLinks,!0).style("fill","none");var s=o.selectAll("."+L.cn.sankeyLink).data(function(t){var e={};return t.sankey.links().filter(function(t){return t.value}).map(u.bind(null,e,t))},F);s.enter().append("path").classed(L.cn.sankeyLink,!0).attr("d",f).call(k,a,i.linkEvents),s.style("stroke",function(t){return g(t)?z.tinyRGB(I(t.linkLineColor)):t.tinyColorHue}).style("stroke-opacity",function(t){return g(t)?z.opacity(t.linkLineColor):t.tinyColorAlpha}).style("stroke-width",function(t){return g(t)?t.linkLineWidth:1}).style("fill",function(t){return t.tinyColorHue}).style("fill-opacity",function(t){return t.tinyColorAlpha}),s.transition().ease(L.ease).duration(L.duration).attr("d",f),s.exit().transition().ease(L.ease).duration(L.duration).style("opacity",0).remove();var d=a.selectAll("."+L.cn.sankeyNodeSet).data(j,F);d.enter().append("g").classed(L.cn.sankeyNodeSet,!0),d.style("cursor",function(t){switch(t.arrangement){case"fixed":return"default";case"perpendicular":return"ns-resize";default:return"move"}});var p=d.selectAll("."+L.cn.sankeyNode).data(function(t){var e=t.sankey.nodes(),r={};return n(e),e.filter(function(t){return t.value}).map(c.bind(null,r,t))},F);p.enter().append("g").classed(L.cn.sankeyNode,!0).call(h).call(k,a,i.nodeEvents),p.call(A,s,i),p.transition().ease(L.ease).duration(L.duration).call(h),p.exit().transition().ease(L.ease).duration(L.duration).style("opacity",0).remove();var T=p.selectAll("."+L.cn.nodeRect).data(j);T.enter().append("rect").classed(L.cn.nodeRect,!0).call(m),T.style("stroke-width",function(t){return t.nodeLineWidth}).style("stroke",function(t){return z.tinyRGB(I(t.nodeLineColor))}).style("stroke-opacity",function(t){return z.opacity(t.nodeLineColor)}).style("fill",function(t){return t.tinyColorHue}).style("fill-opacity",function(t){return t.tinyColorAlpha}),T.transition().ease(L.ease).duration(L.duration).call(m);var S=p.selectAll("."+L.cn.nodeCapture).data(j);S.enter().append("rect").classed(L.cn.nodeCapture,!0).style("fill-opacity",0),S.attr("x",function(t){return t.zoneX}).attr("y",function(t){return t.zoneY}).attr("width",function(t){return t.zoneWidth}).attr("height",function(t){return t.zoneHeight});var E=p.selectAll("."+L.cn.nodeCentered).data(j);E.enter().append("g").classed(L.cn.nodeCentered,!0).attr("transform",y),E.transition().ease(L.ease).duration(L.duration).attr("transform",y);var C=E.selectAll("."+L.cn.nodeLabelGuide).data(j);C.enter().append("path").classed(L.cn.nodeLabelGuide,!0).attr("id",function(t){return t.uniqueNodeLabelPathId}).attr("d",b).attr("transform",x),C.transition().ease(L.ease).duration(L.duration).attr("d",b).attr("transform",x);var P=E.selectAll("."+L.cn.nodeLabel).data(j);P.enter().append("text").classed(L.cn.nodeLabel,!0).attr("transform",_).style("user-select","none").style("cursor","default").style("fill","black"),P.style("text-shadow",function(t){return t.horizontal?"-1px 1px 1px #fff, 1px 1px 1px #fff, 1px -1px 1px #fff, -1px -1px 1px #fff":"none"}).each(function(t){D.font(P,t.textFont)}),P.transition().ease(L.ease).duration(L.duration).attr("transform",_);var O=P.selectAll("."+L.cn.nodeLabelTextPath).data(j);O.enter().append("textPath").classed(L.cn.nodeLabelTextPath,!0).attr("alignment-baseline","middle").attr("xlink:href",function(t){return"#"+t.uniqueNodeLabelPathId}).attr("startOffset",M).style("fill",w),O.text(function(t){return t.horizontal||t.node.dy>5?t.node.label:""}).attr("text-anchor",function(t){return t.horizontal&&t.left?"end":"start"}),O.transition().ease(L.ease).duration(L.duration).attr("startOffset",M).style("fill",w)}},{"../../components/color":604,"../../components/drawing":628,"../../lib":728,"../../lib/gup":725,"./constants":1025,"@plotly/d3-sankey":38,d3:122,"d3-force":118,tinycolor2:534}],1030:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rm&&d.splice(m,d.length-m),p.length>m&&p.splice(m,p.length-m);var g={padded:!0},v={padded:!0};if(o.hasMarkers(e)){if(r=e.marker,u=r.size,Array.isArray(u)){var y={type:"linear"};i.setConvert(y),u=y.makeCalcdata(e.marker,"size"),u.length>m&&u.splice(m,u.length-m)}var b,x=1.6*(e.marker.sizeref||1);b="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=v.ppad=Array.isArray(u)?u.map(b):b(u)}s(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||d[0]===d[m-1]&&p[0]===p[m-1]?e.error_y.visible||-1===["tonexty","tozeroy"].indexOf(e.fill)&&(o.hasMarkers(e)||o.hasText(e))||(g.padded=!1,g.ppad=0):g.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||d[0]===d[m-1]&&p[0]===p[m-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(v.padded=!1):v.tozero=!0,i.expand(h,d,g),i.expand(f,p,v);var _=new Array(m);for(c=0;c=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],1034:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l=r.marker,u="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+u).remove(),void 0===l||!l.showscale)return void a.autoMargin(t,u);var c=l.color,h=l.cmin,f=l.cmax;n(h)||(h=i.aggNums(Math.min,null,c)),n(f)||(f=i.aggNums(Math.max,null,c));var d=e[0].t.cb=s(t,u),p=o.makeColorScaleFunc(o.extractScale(l.colorscale,h,f),{noNumericCheck:!0});d.fillcolor(p).filllevels({start:h,end:f,size:(f-h)/254}).options(l.colorbar)()}},{"../../components/colorbar/draw":607,"../../components/colorscale":618,"../../lib":728,"../../plots/plots":831,"fast-isnumeric":131}],1035:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),a=t("./subtypes");e.exports=function(t){a.hasLines(t)&&n(t,"line")&&i(t,t.line.color,"line","c"),a.hasMarkers(t)&&(n(t,"marker")&&i(t,t.marker.color,"marker","c"),n(t,"marker.line")&&i(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":610,"../../components/colorscale/has_colorscale":617,"./subtypes":1052}],1036:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20}},{}],1037:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("./constants"),o=t("./subtypes"),s=t("./xy_defaults"),l=t("./marker_defaults"),u=t("./line_defaults"),c=t("./line_shape_defaults"),h=t("./text_defaults"),f=t("./fillcolor_defaults"),d=t("../../components/errorbars/defaults");e.exports=function(t,e,r,p){function m(r,a){return n.coerce(t,e,i,r,a)}var g=s(t,e,p,m),v=gH!=O>=H&&(z=C[E-1][0],D=C[E][0],I=z+(D-z)*(H-P)/(O-P),N=Math.min(N,I),B=Math.max(B,I));N=Math.max(N,0),B=Math.min(B,d._length);var q=s.defaultLine;return s.opacity(f.fillcolor)?q=f.fillcolor:s.opacity((f.line||{}).color)&&(q=f.line.color),n.extendFlat(t,{distance:u+10,x0:N,x1:B,y0:H,y1:H,color:q}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":604,"../../components/errorbars":634,"../../components/fx":645,"../../lib":728,"./fill_hover_text":1038,"./get_trace_color":1040}],1042:[function(t,e,r){"use strict";var n={},i=t("./subtypes");n.hasLines=i.hasLines,n.hasMarkers=i.hasMarkers,n.hasText=i.hasText,n.isBubble=i.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","scatter-like"],n.meta={},e.exports=n},{"../../plots/cartesian":782,"./arrays_to_calcdata":1030,"./attributes":1031,"./calc":1032,"./clean_data":1033,"./colorbar":1034,"./defaults":1037,"./hover":1041,"./plot":1049,"./select":1050,"./style":1051,"./subtypes":1052}],1043:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,a,o,s){var l=(t.marker||{}).color;if(o("line.color",r),n(t,"line"))i(t,e,a,o,{prefix:"line.",cLetter:"c"});else{o("line.color",!Array.isArray(l)&&l||r)}o("line.width"),(s||{}).noDash||o("line.dash")}},{"../../components/colorscale/defaults":613,"../../components/colorscale/has_colorscale":617}],1044:[function(t,e,r){"use strict";var n=t("../../constants/numerical").BADNUM,i=t("../../lib"),a=i.segmentsIntersect,o=i.constrain,s=t("./constants");e.exports=function(t,e){function r(e){var r=O.c2p(t[e].x),i=R.c2p(t[e].y);return r!==n&&i!==n&&[r,i]}function l(t){var e=t[0]/O._length,r=t[1]/R._length;return(1+s.toleranceGrowth*Math.max(0,-e,e-1,-r,r-1))*N}function u(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function c(t,e){for(var r=[],n=0,i=0;i<4;i++){var o=it[i],s=a(t[0],t[1],e[0],e[1],o[0],o[1],o[2],o[3]);s&&(!n||Math.abs(s.x-r[0][0])>1||Math.abs(s.y-r[0][1])>1)&&(s=[s.x,s.y],n&&u(s,t)et||t[1]nt)return[o(t[0],tt,et),o(t[1],rt,nt)]}function f(t,e){return t[0]===e[0]&&(t[0]===tt||t[0]===et)||(t[1]===e[1]&&(t[1]===rt||t[1]===nt)||void 0)}function d(t,e){var r=[],n=h(t),i=h(e);return n&&i&&f(n,i)?r:(n&&r.push(n),i&&r.push(i),r)}function p(t,e,r){return function(n,a){var o=h(n),s=h(a),l=[];if(o&&s&&f(o,s))return l;o&&l.push(o),s&&l.push(s);var u=2*i.constrain((n[t]+a[t])/2,e,r)-((o||n)[t]+(s||a)[t]);if(u){var c;c=o&&s?u>0==o[t]>s[t]?o:s:o||s,c[t]+=u}return l}}function m(t,e){var r=e[0]-t[0],n=(e[1]-t[1])/r;return(t[1]*e[0]-e[1]*t[0])/r>0?[n>0?tt:et,nt]:[n>0?et:tt,rt]}function g(t){var e=t[0],r=t[1],n=e===q[G-1][0],i=r===q[G-1][1];if(!n||!i)if(G>1){var a=e===q[G-2][0],o=r===q[G-2][1];n&&(e===tt||e===et)&&a?o?G--:q[G-1]=t:i&&(r===rt||r===nt)&&o?a?G--:q[G-1]=t:q[G++]=t}else q[G++]=t}function v(t){q[G-1][0]!==t[0]&&q[G-1][1]!==t[1]&&g([X,Z]),g(t),J=null,X=Z=0}function y(t){if(Y=t[0]et?et:0,W=t[1]nt?nt:0,Y||W){if(G)if(J){var e=Q(J,t);e.length>1&&(v(e[0]),q[G++]=e[1])}else K=Q(q[G-1],t)[0],q[G++]=K;else q[G++]=[Y||t[0],W||t[1]];var r=q[G-1];Y&&W&&(r[0]!==Y||r[1]!==W)?(J&&(X!==Y&&Z!==W?g(X&&Z?m(J,t):[X||Y,Z||W]):X&&Z&&g([X,Z])),g([Y,W])):X-Y&&Z-W&&g([Y||X,W||Z]),J=t,X=Y,Z=W}else J&&v(Q(J,t)[0]),q[G++]=t}var b,x,_,w,M,k,A,T,S,E,L,C,I,z,D,P,O=e.xaxis,R=e.yaxis,F=e.simplify,j=e.connectGaps,N=e.baseTolerance,B=e.shape,U="linear"===B,V=[],H=s.minTolerance,q=new Array(t.length),G=0;F||(N=H=-1);var Y,W,X,Z,J,K,Q,$=s.maxScreensAway,tt=-O._length*$,et=O._length*(1+$),rt=-R._length*$,nt=R._length*(1+$),it=[[tt,rt,et,rt],[et,rt,et,nt],[et,nt,tt,nt],[tt,nt,tt,rt]];for("linear"===B||"spline"===B?Q=c:"hv"===B||"vh"===B?Q=d:"hvh"===B?Q=p(0,tt,et):"vhv"===B&&(Q=p(1,rt,nt)),b=0;bl(k))break;_=k,I=S[0]*T[0]+S[1]*T[1],I>L?(L=I,w=k,A=!1):I=t.length||!k)break;y(k),x=k}}else y(w)}J&&g([X||J[0],Z||J[1]]),V.push(q.slice(0,G))}return V}},{"../../constants/numerical":707,"../../lib":728,"./constants":1036}],1045:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],1046:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n,i,a=null,o=0;o0?Math.max(e,i):0}}},{"fast-isnumeric":131}],1048:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,u){var c,h=o.isBubble(t),f=(t.line||{}).color;if(u=u||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",h?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noLine||(c=f&&!Array.isArray(f)&&e.marker.color!==f?f:h?n.background:n.defaultLine,l("marker.line.color",c),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",h?1:0)),h&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),u.gradient){"none"!==l("marker.gradient.type")&&l("marker.gradient.color")}}},{"../../components/color":604,"../../components/colorscale/defaults":613,"../../components/colorscale/has_colorscale":617,"./subtypes":1052}],1049:[function(t,e,r){"use strict";function n(t,e,r){var n;e.selectAll("g.trace").each(function(t){var e=o.select(this);if(n=t[0].trace,n._nexttrace){if(n._nextFill=e.select(".js-fill.js-tonext"),!n._nextFill.size()){var i=":first-child";e.select(".js-fill.js-tozero").size()&&(i+=" + *"),n._nextFill=e.insert("path",i).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),n._nextFill=null;n.fill&&("tozero"===n.fill.substr(0,6)||"toself"===n.fill||"to"===n.fill.substr(0,2)&&!n._prevtrace)?(n._ownFill=e.select(".js-fill.js-tozero"),n._ownFill.size()||(n._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),n._ownFill=null),e.selectAll(".js-fill").call(l.setClipUrl,r.layerClipId)})}function i(t,e,r,n,i,f,p){function m(t){return M?t.transition():t}function g(t){return t.filter(function(t){return t.vis})}function v(t){return t.id}function y(t){if(t.ids)return v}function b(){return!1}function x(e){var n,i,a,u=e[0].trace,h=o.select(this),f=c.hasMarkers(u),d=c.hasText(u),p=y(u),v=b,x=b;f&&(v=u.marker.maxdisplayed||u._needsCull?g:s.identity),d&&(x=u.marker.maxdisplayed||u._needsCull?g:s.identity),i=h.selectAll("path.point"),n=i.data(v,p);var _=n.enter().append("path").classed("point",!0);M&&_.call(l.pointStyle,u,t).call(l.translatePoints,k,A).style("opacity",0).transition().style("opacity",1);var w=f&&l.tryColorscale(u.marker,""),T=f&&l.tryColorscale(u.marker,"line");n.order(),n.each(function(e){var n=o.select(this),i=m(n);a=l.translatePoint(e,i,k,A),a?(l.singlePointStyle(e,i,u,w,T,t),r.layerClipId&&l.hideOutsideRangePoint(e,i,k,A),u.customdata&&n.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):i.remove()}),M?n.exit().transition().style("opacity",0).remove():n.exit().remove(),i=h.selectAll("g"),n=i.data(x,p),n.enter().append("g").classed("textpoint",!0).append("text"),n.order(),n.each(function(t){var e=o.select(this),n=m(e.select("text"));a=l.translatePoint(t,n,k,A),a?r.layerClipId&&l.hideOutsideRangePoint(t,e,k,A):e.remove()}),n.selectAll("text").call(l.textPointStyle,u,t).each(function(t){var e=k.c2p(t.x),r=A.c2p(t.y);o.select(this).selectAll("tspan.line").each(function(){m(o.select(this)).attr({x:e,y:r})})}),n.exit().remove()}var _,w;a(t,e,r,n,i);var M=!!p&&p.duration>0,k=r.xaxis,A=r.yaxis,T=n[0].trace,S=T.line,E=o.select(f);if(E.call(u.plot,r,p),!0===T.visible){m(E).style("opacity",T.opacity);var L,C,I=T.fill.charAt(T.fill.length-1);"x"!==I&&"y"!==I&&(I=""),n[0].node3=E;var z="",D=[],P=T._prevtrace;P&&(z=P._prevRevpath||"",C=P._nextFill,D=P._polygons);var O,R,F,j,N,B,U,V,H,q="",G="",Y=[],W=s.noop;if(L=T._ownFill,c.hasLines(T)||"none"!==T.fill){for(C&&C.datum(n),-1!==["hv","vh","hvh","vhv"].indexOf(S.shape)?(F=l.steps(S.shape),j=l.steps(S.shape.split("").reverse().join(""))):F=j="spline"===S.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),S.smoothing):l.smoothopen(t,S.smoothing)}:function(t){return"M"+t.join("L")},N=function(t){return j(t.reverse())},Y=h(n,{xaxis:k,yaxis:A,connectGaps:T.connectgaps,baseTolerance:Math.max(S.width||1,3)/4,shape:S.shape,simplify:S.simplify}),H=T._polygons=new Array(Y.length),w=0;w1){var r=o.select(this);if(r.datum(n),t)m(r.style("opacity",0).attr("d",O).call(l.lineGroupStyle)).style("opacity",1);else{var i=m(r);i.attr("d",O),l.singleLineStyle(n,i)}}}}}var X=E.selectAll(".js-line").data(Y);m(X.exit()).style("opacity",0).remove(),X.each(W(!1)),X.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(W(!0)),l.setClipUrl(X,r.layerClipId),Y.length&&(L?B&&V&&(I?("y"===I?B[1]=V[1]=A.c2p(0,!0):"x"===I&&(B[0]=V[0]=k.c2p(0,!0)),m(L).attr("d","M"+V+"L"+B+"L"+q.substr(1)).call(l.singleFillStyle)):m(L).attr("d",q+"Z").call(l.singleFillStyle)):"tonext"===T.fill.substr(0,6)&&q&&z&&("tonext"===T.fill?m(C).attr("d",q+"Z"+z+"Z").call(l.singleFillStyle):m(C).attr("d",q+"L"+z.substr(1)+"Z").call(l.singleFillStyle),T._polygons=T._polygons.concat(D)),T._prevRevpath=G,T._prevPolygons=H);var Z=E.selectAll(".points");_=Z.data([n]),Z.each(x),_.enter().append("g").classed("points",!0).each(x),_.exit().remove(),_.each(function(t){var e=!1===t[0].trace.cliponaxis;l.setClipUrl(o.select(this),e?null:r.layerClipId)})}}function a(t,e,r,n,i){var a=r.xaxis,l=r.yaxis,u=o.extent(s.simpleMap(a.range,a.r2c)),h=o.extent(s.simpleMap(l.range,l.r2c)),f=n[0].trace;if(c.hasMarkers(f)){var d=f.marker.maxdisplayed;if(0!==d){var p=n.filter(function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=h[0]&&t.y<=h[1]}),m=Math.ceil(p.length/d),g=0;i.forEach(function(t,r){var n=t[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;for(c=p.selectAll("g.trace"),h=c.data(r,function(t){return t[0].trace.uid}),h.enter().append("g").attr("class",function(t){return"trace scatter trace"+t[0].trace.uid}).style("stroke-miterlimit",2),f(t,e,r),n(t,p,e),l=0,u={};lu[e[0].trace.uid]?1:-1}),g){s&&(d=s());o.transition().duration(a.duration).ease(a.easing).each("end",function(){d&&d()}).each("interrupt",function(){d&&d()}).each(function(){p.selectAll("g.trace").each(function(n,o){i(t,o,e,n,r,this,a)})})}else p.selectAll("g.trace").each(function(n,o){i(t,o,e,n,r,this,a)});m&&h.exit().remove(),p.selectAll("path:not([d])").remove()}},{"../../components/drawing":628,"../../components/errorbars":634,"../../lib":728,"../../lib/polygon":739,"./line_points":1044,"./link_traces":1046,"./subtypes":1052,d3:122}],1050:[function(t,e,r){"use strict";var n=t("./subtypes"),i=t("../../constants/interactions").DESELECTDIM;e.exports=function(t,e){var r,a,o,s,l=t.cd,u=t.xaxis,c=t.yaxis,h=[],f=l[0].trace,d=f.marker;if(!n.hasMarkers(f)&&!n.hasText(f))return[];var p=Array.isArray(d.opacity)?1:d.opacity;if(!1===e)for(r=0;r=0&&(e[1]+=1),t.indexOf("top")>=0&&(e[1]-=1),t.indexOf("left")>=0&&(e[0]-=1),t.indexOf("right")>=0&&(e[0]+=1),e)}function s(t,e){return e(4*t)}function l(t){return M[t]}function u(t,e,r,n,i){var a=null;if(Array.isArray(t)){a=[];for(var o=0;o=0){var f=i(l.position,l.delaunayColor,l.delaunayAxis);f.opacity=t.opacity,this.delaunayMesh?this.delaunayMesh.update(f):(f.gl=o,this.delaunayMesh=g(f),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},A.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())},e.exports=f},{"../../constants/gl3d_dashes":704,"../../constants/gl3d_markers":705,"../../lib":728,"../../lib/gl_format_color":724,"../../lib/str2rgbarray":749,"../scatter/make_bubble_size_func":1047,"./calc_errors":1057,"delaunay-triangulate":123,"gl-error3d":161,"gl-line3d":172,"gl-mesh3d":205,"gl-scatter3d":251}],1059:[function(t,e,r){"use strict";function n(t,e,r,n){var a=0,o=r("x"),s=r("y"),l=r("z");return i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],n),o&&s&&l&&(a=Math.min(o.length,s.length,l.length),a=0&&f("surfacecolor",d||p);for(var m=["x","y","z"],g=0;g<3;++g){var v="projection."+m[g];f(v+".show")&&(f(v+".opacity"),f(v+".scale"))}c(t,e,r,{axis:"z"}),c(t,e,r,{axis:"y",inherit:"z"}),c(t,e,r,{axis:"x",inherit:"z"})}},{"../../components/errorbars/defaults":633,"../../lib":728,"../../registry":846,"../scatter/line_defaults":1043,"../scatter/marker_defaults":1048,"../scatter/subtypes":1052,"../scatter/text_defaults":1053,"./attributes":1055}],1060:[function(t,e,r){"use strict";var n={};n.plot=t("./convert"),n.attributes=t("./attributes"),n.markerSymbols=t("../../constants/gl3d_markers"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.moduleType="trace",n.name="scatter3d",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../constants/gl3d_markers":705,"../../plots/gl3d":811,"../scatter/colorbar":1034,"./attributes":1055,"./calc":1056,"./convert":1058,"./defaults":1059}],1061:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../components/colorscale/color_attributes"),o=t("../../components/colorbar/attributes"),s=t("../../lib/extend").extendFlat,l=n.marker,u=n.line,c=l.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:s({},n.mode,{dflt:"markers"}),text:s({},n.text,{}),line:{color:u.color,width:u.width,dash:u.dash,shape:s({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:s({},n.fill,{values:["none","toself","tonext"]}),fillcolor:n.fillcolor,marker:s({symbol:l.symbol,opacity:l.opacity,maxdisplayed:l.maxdisplayed,size:l.size,sizeref:l.sizeref,sizemin:l.sizemin,sizemode:l.sizemode,line:s({width:c.width,editType:"calc"},a("marker".line)),gradient:l.gradient,editType:"calc"},a("marker"),{showscale:l.showscale,colorbar:o}),textfont:n.textfont,textposition:n.textposition,hoverinfo:s({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron}},{"../../components/colorbar/attributes":605,"../../components/colorscale/color_attributes":611,"../../lib/extend":717,"../../plots/attributes":770,"../scatter/attributes":1031}],1062:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/cartesian/axes"),a=t("../scatter/subtypes"),o=t("../scatter/colorscale_calc"),s=t("../scatter/arrays_to_calcdata"),l=t("../carpet/lookup_carpetid");e.exports=function(t,e){var r=e.carpetTrace=l(t,e);if(r&&r.visible&&"legendonly"!==r.visible){var u;e.xaxis=r.xaxis,e.yaxis=r.yaxis;var c,h,f=e.a.length,d=new Array(f),p=!1;for(u=0;uf&&y.splice(f,y.length-f)}return o(e),s(d,e),d}}},{"../../plots/cartesian/axes":772,"../carpet/lookup_carpetid":903,"../scatter/arrays_to_calcdata":1030,"../scatter/colorscale_calc":1035,"../scatter/subtypes":1052,"fast-isnumeric":131}],1063:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/constants"),a=t("../scatter/subtypes"),o=t("../scatter/marker_defaults"),s=t("../scatter/line_defaults"),l=t("../scatter/line_shape_defaults"),u=t("../scatter/text_defaults"),c=t("../scatter/fillcolor_defaults"),h=t("./attributes");e.exports=function(t,e,r,f){function d(r,i){return n.coerce(t,e,h,r,i)}d("carpet"),e.xaxis="x",e.yaxis="y";var p,m=d("a"),g=d("b");if(!(p=Math.min(m.length,g.length)))return void(e.visible=!1);m&&p0?t.labelprefix.replace(/ = $/,""):t._hovertitle,v.push(r+": "+e.toFixed(3)+t.labelsuffix)}var o=n(t,e,r,i);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index){var l=1-s.y0/t.ya._length,u=t.xa._length,c=u*l/2,h=u-c;return s.x0=Math.max(Math.min(s.x0,h),c),s.x1=Math.max(Math.min(s.x1,h),c),o}var f=s.cd[s.index];s.a=f.a,s.b=f.b,s.xLabelVal=void 0,s.yLabelVal=void 0;var d=s.trace,p=d._carpet,m=f.hi||d.hoverinfo,g=m.split("+"),v=[];-1!==g.indexOf("all")&&(g=["a","b"]),-1!==g.indexOf("a")&&a(p.aaxis,f.a),-1!==g.indexOf("b")&&a(p.baxis,f.b);var y=p.ab2ij([f.a,f.b]),b=Math.floor(y[0]),x=y[0]-b,_=Math.floor(y[1]),w=y[1]-_,M=p.evalxy([],b,_,x,w);return v.push("y: "+M[1].toFixed(3)),s.extraText=v.join("
"),o}}},{"../scatter/hover":1041}],1065:[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="scattercarpet",n.basePlotModule=t("../../plots/cartesian"),n.categories=["carpet","symbols","markerColorscale","showLegend","carpetDependent"],n.meta={},e.exports=n},{"../../plots/cartesian":782,"../scatter/colorbar":1034,"./attributes":1061,"./calc":1062,"./defaults":1063,"./hover":1064,"./plot":1066,"./select":1067,"./style":1068}],1066:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../plots/cartesian/axes"),a=t("../../components/drawing");e.exports=function(t,e,r){var o,s,l,u=r[0][0].carpet,c={xaxis:i.getFromId(t,u.xaxis||"x"),yaxis:i.getFromId(t,u.yaxis||"y"),plot:e.plot};for(n(t,c,r),o=0;o")}var i=t("../../components/fx"),a=t("../../plots/cartesian/axes"),o=t("../../constants/numerical").BADNUM,s=t("../scatter/get_trace_color"),l=t("../scatter/fill_hover_text"),u=t("./attributes");e.exports=function(t,e,r){function a(t){var n=t.lonlat;if(n[0]===o)return 1/0;if(d(n))return 1/0;var i=p(n),a=p([e,r]),s=Math.abs(i[0]-a[0]),l=Math.abs(i[1]-a[1]),u=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(s*s+l*l)-u,1-3/u)}var l=t.cd,u=l[0].trace,c=t.xa,h=t.ya,f=t.subplot,d=f.projection.isLonLatOverEdges,p=f.project;if(i.getClosest(l,a,t),!1!==t.index){var m=l[t.index],g=m.lonlat,v=[c.c2p(g),h.c2p(g)],y=m.mrc||1;return t.x0=v[0]-y,t.x1=v[0]+y,t.y0=v[1]-y,t.y1=v[1]+y,t.loc=m.loc,t.lon=g[0],t.lat=g[1],t.color=s(u,m),t.extraText=n(u,m,f.mockAxis),[t]}}},{"../../components/fx":645,"../../constants/numerical":707,"../../plots/cartesian/axes":772,"../scatter/fill_hover_text":1038,"../scatter/get_trace_color":1040,"./attributes":1069}],1074:[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.hoverPoints=t("./hover"),n.eventData=t("./event_data"), +n.selectPoints=t("./select"),n.moduleType="trace",n.name="scattergeo",n.basePlotModule=t("../../plots/geo"),n.categories=["geo","symbols","markerColorscale","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/geo":800,"../scatter/colorbar":1034,"./attributes":1069,"./calc":1070,"./defaults":1071,"./event_data":1072,"./hover":1073,"./plot":1075,"./select":1076}],1075:[function(t,e,r){"use strict";function n(t,e){var r=t[0].trace;if(Array.isArray(r.locations))for(var n=c(r,e),i=r.locationmode,a=0;a=e.length?i:e[a]);return n}function o(t,e,r){return l(O(t,r),P(e,r),r)}function s(t,e,r,n){var i=k(t,e,n);return i=Array.isArray(i[0])?i:a(y.identity,[i],n),l(i,P(r,n),n)}function l(t,e,r){for(var n=new Array(4*r),i=0;iZ?X-Z:0),!q||H.noBorder||H.noFill?c(this.scatter.options.colors,Y,f,B,G):c(this.scatter.options.colors,z,f,0),c(this.scatter.options.borderColors,W,f,B,G);N?(this.scatter.options.positions=null,this.fancyScatter.update(),this.scatter.options.positions=k):this.fancyScatter.update()}else this.fancyScatter.clear();this.scatter.clear(),this.expandAxesFancy(l,h,j)},D.updateLines=function(t,e){var r;if(this.hasLines){var n=e;if(!t.connectgaps){var i=0,a=this.xData,s=this.yData;for(n=new Float64Array(2*a.length),r=0;r")}var i=t("../../components/fx"),a=t("../scatter/get_trace_color"),o=t("../scatter/fill_hover_text"),s=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r){function o(t){var e=t.lonlat;if(e[0]===s)return 1/0;var n=Math.abs(c.c2p(e)-c.c2p([p,e[1]])),i=Math.abs(h.c2p(e)-h.c2p([e[0],r])),a=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(n*n+i*i)-a,1-3/a)}var l=t.cd,u=l[0].trace,c=t.xa,h=t.ya,f=e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360),d=360*f,p=e-d;if(i.getClosest(l,o,t),!1!==t.index){var m=l[t.index],g=m.lonlat,v=[g[0]+d,g[1]],y=c.c2p(v),b=h.c2p(v),x=m.mrc||1;return t.x0=y-x,t.x1=y+x,t.y0=b-x,t.y1=b+x,t.color=a(u,m),t.extraText=n(u,m),[t]}}},{"../../components/fx":645,"../../constants/numerical":707,"../scatter/fill_hover_text":1038,"../scatter/get_trace_color":1040}],1088:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("../scattergeo/calc"),n.plot=t("./plot"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="scattermapbox",n.basePlotModule=t("../../plots/mapbox"),n.categories=["mapbox","gl","symbols","markerColorscale","showLegend","scatterlike"],n.meta={},e.exports=n},{"../../plots/mapbox":825,"../scatter/colorbar":1034,"../scattergeo/calc":1070,"./attributes":1083,"./defaults":1085,"./event_data":1086,"./hover":1087,"./plot":1089,"./select":1090}],1089:[function(t,e,r){"use strict";function n(t,e){this.mapbox=t,this.map=t.map,this.uid=e,this.idSourceFill=e+"-source-fill",this.idSourceLine=e+"-source-line",this.idSourceCircle=e+"-source-circle",this.idSourceSymbol=e+"-source-symbol",this.idLayerFill=e+"-layer-fill",this.idLayerLine=e+"-layer-line",this.idLayerCircle=e+"-layer-circle",this.idLayerSymbol=e+"-layer-symbol",this.mapbox.initSource(this.idSourceFill),this.mapbox.initSource(this.idSourceLine),this.mapbox.initSource(this.idSourceCircle),this.mapbox.initSource(this.idSourceSymbol),this.map.addLayer({id:this.idLayerFill,source:this.idSourceFill,type:"fill"}),this.map.addLayer({id:this.idLayerLine,source:this.idSourceLine,type:"line"}),this.map.addLayer({id:this.idLayerCircle,source:this.idSourceCircle,type:"circle"}),this.map.addLayer({id:this.idLayerSymbol,source:this.idSourceSymbol,type:"symbol"})}function i(t){return"visible"===t.layout.visibility}var a=t("./convert"),o=n.prototype;o.update=function(t){var e=this.mapbox,r=a(t);e.setOptions(this.idLayerFill,"setLayoutProperty",r.fill.layout),e.setOptions(this.idLayerLine,"setLayoutProperty",r.line.layout),e.setOptions(this.idLayerCircle,"setLayoutProperty",r.circle.layout),e.setOptions(this.idLayerSymbol,"setLayoutProperty",r.symbol.layout),i(r.fill)&&(e.setSourceData(this.idSourceFill,r.fill.geojson),e.setOptions(this.idLayerFill,"setPaintProperty",r.fill.paint)),i(r.line)&&(e.setSourceData(this.idSourceLine,r.line.geojson),e.setOptions(this.idLayerLine,"setPaintProperty",r.line.paint)),i(r.circle)&&(e.setSourceData(this.idSourceCircle,r.circle.geojson),e.setOptions(this.idLayerCircle,"setPaintProperty",r.circle.paint)),i(r.symbol)&&(e.setSourceData(this.idSourceSymbol,r.symbol.geojson),e.setOptions(this.idLayerSymbol,"setPaintProperty",r.symbol.paint)),t[0].trace._glTrace=this},o.dispose=function(){var t=this.map;t.removeLayer(this.idLayerFill),t.removeLayer(this.idLayerLine),t.removeLayer(this.idLayerCircle),t.removeLayer(this.idLayerSymbol),t.removeSource(this.idSourceFill),t.removeSource(this.idSourceLine),t.removeSource(this.idSourceCircle),t.removeSource(this.idSourceSymbol)},e.exports=function(t,e){var r=e[0].trace,i=new n(t,r.uid);return i.update(e),i}},{"./convert":1084}],1090:[function(t,e,r){"use strict";var n=t("../scatter/subtypes");e.exports=function(t,e){var r,i,a,o,s,l=t.cd,u=t.xaxis,c=t.yaxis,h=[],f=l[0].trace;if(f._hasDimmedPts=!1,!n.hasMarkers(f))return[];if(!1===e)for(s=0;sk&&S.splice(k,S.length-k)}return o(e),s(A,e),A}},{"../../plots/cartesian/axes":772,"../scatter/arrays_to_calcdata":1030,"../scatter/colorscale_calc":1035,"../scatter/subtypes":1052,"fast-isnumeric":131}],1093:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/constants"),a=t("../scatter/subtypes"),o=t("../scatter/marker_defaults"),s=t("../scatter/line_defaults"),l=t("../scatter/line_shape_defaults"),u=t("../scatter/text_defaults"),c=t("../scatter/fillcolor_defaults"),h=t("./attributes");e.exports=function(t,e,r,f){function d(r,i){return n.coerce(t,e,h,r,i)}var p,m=d("a"),g=d("b"),v=d("c");if(m?(p=m.length,g?(p=Math.min(p,g.length),v&&(p=Math.min(p,v.length))):p=v?Math.min(p,v.length):0):g&&v&&(p=Math.min(g.length,v.length)),!p)return void(e.visible=!1);m&&p"),s}}},{"../../plots/cartesian/axes":772,"../scatter/hover":1041}],1095:[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","scatter-like"],n.meta={},e.exports=n},{"../../plots/ternary":839,"../scatter/colorbar":1034,"./attributes":1091,"./calc":1092,"./defaults":1093,"./hover":1094,"./plot":1096,"./select":1097,"./style":1098}],1096:[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 i={xaxis:t.xaxis,yaxis:t.yaxis,plot:r,layerClipId:t._hasClipOnAxisFalse?t.clipIdRelative:null},a=0;a",uplift:5,goldenRatio:1.618,columnTitleOffset:28,columnExtentOffset:10,transitionEase:"cubic-out",transitionDuration:100,releaseTransitionEase:"cubic-out",releaseTransitionDuration:120,scrollbarWidth:8,scrollbarCaptureWidth:18,scrollbarOffset:5,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}},{}],1109:[function(t,e,r){"use strict";function n(t){return t.calcdata.columns.reduce(function(e,r){return r.xIndex=e||c===t.length-1)&&(n[i]=s,s.key=u++,s.firstRowIndex=l,s.lastRowIndex=c,s=o(),i+=a,l=c+1,a=0);return n}function o(){return{firstRowIndex:null,lastRowIndex:null,rows:[]}}var s=t("./constants"),l=t("../../lib/extend").extendFlat;e.exports=function(t,e){var r=e.header.values.map(function(t){return Array.isArray(t)?t:[t]}),o=e.cells.values,u=e.domain,c=Math.floor(t._fullLayout._size.w*(u.x[1]-u.x[0])),h=Math.floor(t._fullLayout._size.h*(u.y[1]-u.y[0])),f=r.length?r[0].map(function(){return e.header.height}):[],d=o.length?o[0].map(function(){return e.cells.height}):[],p=f.reduce(function(t,e){return t+e},0),m=h-p,g=m+s.uplift,v=a(d,g),y=a(f,p),b=i(y,[]),x=i(v,b),_={},w=e._fullInput.columnorder,M=r.map(function(t,r){return Array.isArray(e.columnwidth)?e.columnwidth[Math.min(r,e.columnwidth.length-1)]:isFinite(e.columnwidth)&&null!==e.columnwidth?e.columnwidth:1}),k=M.reduce(function(t,e){return t+e},0);M=M.map(function(t){return t/k*c});var A={key:e.index,translateX:u.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-u.y[1]),size:t._fullLayout._size,width:c,height:h,columnOrder:w,groupHeight:h,rowBlocks:x,headerRowBlocks:b,scrollY:0,cells:e.cells,headerCells:l({},e.header,{values:r}),gdColumns:r.map(function(t){return t[0]}),gdColumnsOriginalOrder:r.map(function(t){return t[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:r.map(function(t,e){var r=_[t];return _[t]=(r||0)+1,{key:t+"__"+_[t],label:t,specIndex:e,xIndex:w[e],xScale:n,x:void 0,calcdata:void 0,columnWidth:M[e]}})};return A.columns.forEach(function(t){t.calcdata=A,t.x=n(t)}),A}},{"../../lib/extend":717,"./constants":1108}],1110:[function(t,e,r){"use strict";function n(t){var e=t.rowBlocks[t.page],r=e?e.rows[0].rowIndex:0;return[r,e?r+e.rows.length:0]}var i=t("../../lib/extend").extendFlat;r.splitToPanels=function(t){var e=[0,0],r=i({},t,{key:"header",type:"header",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!0,values:t.calcdata.headerCells.values[t.specIndex],rowBlocks:t.calcdata.headerRowBlocks,calcdata:i({},t.calcdata,{cells:t.calcdata.headerCells})});return[i({},t,{key:"cells1",type:"cells",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),i({},t,{key:"cells2",type:"cells",page:1,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),r]},r.splitToCells=function(t){var e=n(t);return t.values.slice(e[0],e[1]).map(function(r,n){return{keyWithinBlock:n+("string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:e[0]+n,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:r}})}},{"../../lib/extend":717}],1111:[function(t,e,r){"use strict";function n(t,e){for(var r=t.columnorder||[],n=t.header.values.length,i=r.slice(0,n),a=i.slice().sort(function(t,e){return t-e}),o=i.map(function(t){return a.indexOf(t)}),s=o.length;s/i),o=!i||a;t.mayHaveMarkup=i&&n.match(/[<&>]/);var s=v(n);t.latex=s;var l,u=s?"":x(t.calcdata.cells.prefix,e,r)||"",c=s?"":x(t.calcdata.cells.suffix,e,r)||"",h=s?null:x(t.calcdata.cells.format,e,r)||null,f=u+(h?N.format(h)(t.value):t.value)+c;t.wrappingNeeded=!t.wrapped&&!o&&!s&&(l=y(f)),t.cellHeightMayIncrease=a||s||t.mayHaveMarkup||(void 0===l?y(f):l),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex;var d;if(t.wrappingNeeded){var p=" "===j.wrapSplitCharacter?f.replace(/
i&&n.push(a),i+=l}return n}function T(t,e,r){var n=a(e)[0];if(void 0!==n){var i=n.rowBlocks,s=n.calcdata,l=D(i,i.length),u=n.calcdata.groupHeight-k(n),c=s.scrollY=Math.max(0,Math.min(l-u,s.scrollY)),h=A(i,c,u);1===h.length&&(h[0]===i.length-1?h.unshift(h[0]-1):h.push(h[0]+1)),h[0]%2&&h.reverse(),e.each(function(t,e){t.page=h[e],t.scrollY=c}),e.attr("transform",function(t){return"translate(0 "+(D(t.rowBlocks,t.page)-t.scrollY)+")"}),t&&(E(t,r,e,h,n.prevPages,n,0),E(t,r,e,h,n.prevPages,n,1),o(r,t))}}function S(t,e,r,n){return function(i){var a=i.calcdata?i.calcdata:i,o=e.filter(function(t){return a.key===t.key}),s=r||a.scrollbarState.dragMultiplier;a.scrollY=void 0===n?a.scrollY+s*N.event.dy:n;var l=o.selectAll("."+j.cn.yColumn).selectAll("."+j.cn.columnBlock).filter(w);T(t,l,o)}}function E(t,e,r,n,i,a,o){n[o]!==i[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout(function(){var a=r.filter(function(t,e){return e===o&&n[e]!==i[e]});s(t,e,a,r),i[o]=n[o]}))}function L(t,e,r){return function(){var n=N.select(e.parentNode);n.each(function(t){var e=t.fragments;n.selectAll("tspan.line").each(function(t,r){e[r].width=this.getComputedTextLength()});var r,i,a=e[e.length-1].width,o=e.slice(0,-1),s=[],l=0,u=t.column.columnWidth-2*j.cellPad;for(t.value="";o.length;)r=o.shift(),i=r.width+a,l+i>u&&(t.value+=s.join(j.wrapSpacer)+j.lineBreaker,s=[],l=0),s.push(r.text),l+=i;l&&(t.value+=s.join(j.wrapSpacer)),t.wrapped=!0}),n.selectAll("tspan.line").remove(),g(n.select("."+j.cn.cellText),r,t),N.select(e.parentNode.parentNode).call(z)}}function C(t,e,r,n,i){return function(){if(!i.settledY){var a=N.select(e.parentNode),s=R(i),l=i.key-s.firstRowIndex,u=s.rows[l].rowHeight,c=i.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*j.cellPad:u,h=Math.max(c,u);h-s.rows[l].rowHeight&&(s.rows[l].rowHeight=h,t.selectAll("."+j.cn.columnCell).call(z),T(null,t.filter(w),0),o(r,n,!0)),a.attr("transform",function(){var t=this,e=t.parentNode,r=e.getBoundingClientRect(),n=N.select(t.parentNode).select("."+j.cn.cellRect).node().getBoundingClientRect(),a=t.transform.baseVal.consolidate(),o=n.top-r.top+(a?a.matrix.f:j.cellPad);return"translate("+I(i,N.select(t.parentNode).select("."+j.cn.cellTextHolder).node().getBoundingClientRect().width)+" "+o+")"}),i.settledY=!0}}}function I(t,e){switch(t.align){case"left":return j.cellPad;case"right":return t.column.columnWidth-(e||0)-j.cellPad;case"center":return(t.column.columnWidth-(e||0))/2;default:return j.cellPad}}function z(t){t.attr("transform",function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce(function(t,e){return t+P(e,1/0)},0);return"translate(0 "+(P(R(t),t.key)+e)+")"}).selectAll("."+j.cn.cellRect).attr("height",function(t){return F(R(t),t.key).rowHeight})}function D(t,e){for(var r=0,n=e-1;n>=0;n--)r+=O(t[n]);return r}function P(t,e){for(var r=0,n=0;na&&(a=u,o=l)}}return a?i(o):h};case"rms":return function(t,e){for(var r=0,a=0,o=0;o":return function(t){return f(t)>i};case">=":return function(t){return f(t)>=i};case"[]":return function(t){var e=f(t);return e>=i[0]&&e<=i[1]};case"()":return function(t){var e=f(t);return e>i[0]&&e=i[0]&&ei[0]&&e<=i[1]};case"][":return function(t){var e=f(t);return e<=i[0]||e>=i[1]};case")(":return function(t){var e=f(t);return ei[1]};case"](":return function(t){var e=f(t);return e<=i[0]||e>i[1]};case")[":return function(t){var e=f(t);return e=i[1]};case"{}":return function(t){return-1!==i.indexOf(f(t))};case"}{":return function(t){return-1===i.indexOf(f(t))}}}var i=t("../lib"),a=t("../registry"),o=t("../plots/cartesian/axes"),s=["=","!=","<",">=",">","<="],l=["[]","()","[)","(]","][",")(","](",")["],u=["{}","}{"];r.moduleType="transform",r.name="filter",r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},target:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},operation:{valType:"enumerated",values:[].concat(s).concat(l).concat(u),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},preservegaps:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc"},r.supplyDefaults=function(t){function e(e,a){return i.coerce(t,n,r.attributes,e,a)}var n={};if(e("enabled")){e("preservegaps"),e("operation"),e("value"),e("target");var o=a.getComponentMethod("calendars","handleDefaults");o(t,n,"valuecalendar",null),o(t,n,"targetcalendar",null)}return n},r.calcTransform=function(t,e,r){function a(t,r){for(var n=0;n1?"%{group} (%{trace})":"%{group}");var l=t.styles,u=s.styles=[];if(l)for(o=0;o i) j--; + pi.edgepaths[j] = edgepathj.concat(pts, edgepathi); } + break; } - }); + } if(!doublemerged) { - pi.edgepaths[edgei] = pts.concat(edgepath); + pi.edgepaths[i] = pts.concat(edgepathi); } } - }); - pi.edgepaths.forEach(function(edgepath, edgei) { - if(!merged && equalPts(edgepath[edgepath.length - 1], pts[0], xtol, ytol)) { - pts.splice(0, 1); - pi.edgepaths[edgei] = edgepath.concat(pts); + } + for(i = 0; i < pi.edgepaths.length; i++) { + if(merged) break; + edgepathi = pi.edgepaths[i]; + if(equalPts(edgepathi[edgepathi.length - 1], pts[0], xtol, ytol)) { + pts.shift(); + pi.edgepaths[i] = edgepathi.concat(pts); merged = true; } - }); + } if(!merged) pi.edgepaths.push(pts); } diff --git a/src/traces/scatter/select.js b/src/traces/scatter/select.js index a529a4c21e6..96cd76fe2d8 100644 --- a/src/traces/scatter/select.js +++ b/src/traces/scatter/select.js @@ -26,7 +26,7 @@ module.exports = function selectPoints(searchInfo, polygon) { // TODO: include lines? that would require per-segment line properties var hasOnlyLines = (!subtypes.hasMarkers(trace) && !subtypes.hasText(trace)); - if(trace.visible !== true || hasOnlyLines) return []; + if(hasOnlyLines) return []; var opacity = Array.isArray(marker.opacity) ? 1 : marker.opacity; diff --git a/src/traces/scattergeo/select.js b/src/traces/scattergeo/select.js index 8cdfc187ef7..aeacd646423 100644 --- a/src/traces/scattergeo/select.js +++ b/src/traces/scattergeo/select.js @@ -22,7 +22,7 @@ module.exports = function selectPoints(searchInfo, polygon) { var di, lonlat, x, y, i; var hasOnlyLines = (!subtypes.hasMarkers(trace) && !subtypes.hasText(trace)); - if(trace.visible !== true || hasOnlyLines) return []; + if(hasOnlyLines) return []; var marker = trace.marker; var opacity = Array.isArray(marker.opacity) ? 1 : marker.opacity; diff --git a/src/traces/scattergl/select.js b/src/traces/scattergl/select.js index e4187fb9eda..498a99ba287 100644 --- a/src/traces/scattergl/select.js +++ b/src/traces/scattergl/select.js @@ -26,7 +26,7 @@ module.exports = function selectPoints(searchInfo, polygon) { var scene = glTrace.scene; var hasOnlyLines = (!subtypes.hasMarkers(trace) && !subtypes.hasText(trace)); - if(trace.visible !== true || hasOnlyLines) return []; + if(hasOnlyLines) return []; // filter out points by visible scatter ones if(polygon === false) { diff --git a/src/traces/scattermapbox/select.js b/src/traces/scattermapbox/select.js index 7e464ae17fd..35eaf523e9a 100644 --- a/src/traces/scattermapbox/select.js +++ b/src/traces/scattermapbox/select.js @@ -24,7 +24,7 @@ module.exports = function selectPoints(searchInfo, polygon) { // to not insert data-driven 'circle-opacity' when we don't need to trace._hasDimmedPts = false; - if(trace.visible !== true || !subtypes.hasMarkers(trace)) return []; + if(!subtypes.hasMarkers(trace)) return []; if(polygon === false) { for(i = 0; i < cd.length; i++) { diff --git a/src/traces/table/attributes.js b/src/traces/table/attributes.js index 947194ba357..4cb37afe919 100644 --- a/src/traces/table/attributes.js +++ b/src/traces/table/attributes.js @@ -48,7 +48,10 @@ module.exports = overrideAll({ arrayOk: true, dflt: null, role: 'style', - description: 'The width of cells.' + description: [ + 'The width of columns expressed as a ratio. Columns fill the available width', + 'in proportion of their specified column widths.' + ].join(' ') }, columnorder: { diff --git a/src/traces/table/data_preparation_helper.js b/src/traces/table/data_preparation_helper.js index 62e07a248cd..5988cdd29e0 100644 --- a/src/traces/table/data_preparation_helper.js +++ b/src/traces/table/data_preparation_helper.js @@ -16,11 +16,12 @@ module.exports = function calc(gd, trace) { var headerValues = trace.header.values.map(function(c) { return Array.isArray(c) ? c : [c]; }); + var cellsValues = trace.cells.values; var domain = trace.domain; var groupWidth = Math.floor(gd._fullLayout._size.w * (domain.x[1] - domain.x[0])); var groupHeight = Math.floor(gd._fullLayout._size.h * (domain.y[1] - domain.y[0])); - var headerRowHeights = headerValues[0].map(function() {return trace.header.height;}); - var rowHeights = trace.cells.values[0].map(function() {return trace.cells.height;}); + var headerRowHeights = headerValues.length ? headerValues[0].map(function() {return trace.header.height;}) : []; + var rowHeights = cellsValues.length ? cellsValues[0].map(function() {return trace.cells.height;}) : []; var headerHeight = headerRowHeights.reduce(function(a, b) {return a + b;}, 0); var scrollHeight = groupHeight - headerHeight; var minimumFillHeight = scrollHeight + c.uplift; diff --git a/src/traces/table/defaults.js b/src/traces/table/defaults.js index 161a8742802..a30a08f9e47 100644 --- a/src/traces/table/defaults.js +++ b/src/traces/table/defaults.js @@ -11,9 +11,9 @@ var Lib = require('../../lib'); var attributes = require('./attributes'); -function defaultColumnOrder(traceIn, coerce) { - var specifiedColumnOrder = traceIn.columnorder || []; - var commonLength = traceIn.header.values.length; +function defaultColumnOrder(traceOut, coerce) { + var specifiedColumnOrder = traceOut.columnorder || []; + var commonLength = traceOut.header.values.length; var truncated = specifiedColumnOrder.slice(0, commonLength); var sorted = truncated.slice().sort(function(a, b) {return a - b;}); var oneStepped = truncated.map(function(d) {return sorted.indexOf(d);}); @@ -28,28 +28,10 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout return Lib.coerce(traceIn, traceOut, attributes, attr, dflt); } - var fontDflt = { - family: layout.font.family, - size: layout.font.size, - color: layout.font.color - }; - coerce('domain.x'); coerce('domain.y'); coerce('columnwidth'); - defaultColumnOrder(traceIn, coerce); - - coerce('cells.values'); - coerce('cells.format'); - coerce('cells.align'); - coerce('cells.prefix'); - coerce('cells.suffix'); - coerce('cells.height'); - coerce('cells.line.width'); - coerce('cells.line.color'); - coerce('cells.fill.color'); - Lib.coerceFont(coerce, 'cells.font', fontDflt); coerce('header.values'); coerce('header.format'); @@ -61,5 +43,18 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout coerce('header.line.width'); coerce('header.line.color'); coerce('header.fill.color'); - Lib.coerceFont(coerce, 'header.font', fontDflt); + Lib.coerceFont(coerce, 'header.font', Lib.extendFlat({}, layout.font)); + + defaultColumnOrder(traceOut, coerce); + + coerce('cells.values'); + coerce('cells.format'); + coerce('cells.align'); + coerce('cells.prefix'); + coerce('cells.suffix'); + coerce('cells.height'); + coerce('cells.line.width'); + coerce('cells.line.color'); + coerce('cells.fill.color'); + Lib.coerceFont(coerce, 'cells.font', Lib.extendFlat({}, layout.font)); }; diff --git a/src/traces/table/index.js b/src/traces/table/index.js index ab5d7080fc1..3eec6ed12e1 100644 --- a/src/traces/table/index.js +++ b/src/traces/table/index.js @@ -18,7 +18,7 @@ Table.plot = require('./plot'); Table.moduleType = 'trace'; Table.name = 'table'; Table.basePlotModule = require('./base_plot'); -Table.categories = []; +Table.categories = ['noOpacity']; Table.meta = { description: [ 'Table view for detailed data viewing.', diff --git a/src/traces/table/plot.js b/src/traces/table/plot.js index efde0afa16f..e3481104215 100644 --- a/src/traces/table/plot.js +++ b/src/traces/table/plot.js @@ -93,6 +93,8 @@ module.exports = function plot(gd, wrappedTraceHolders) { .append('g') .classed(c.cn.yColumn, true); + yColumn.exit().remove(); + yColumn .attr('transform', function(d) {return 'translate(' + d.x + ' 0)';}) .call(d3.behavior.drag() @@ -242,7 +244,7 @@ function renderScrollbarKit(tableControlView, gd, bypassVisibleBar) { function calcTotalHeight(d) { var blocks = d.rowBlocks; - return firstRowAnchor(blocks, blocks.length - 1) + rowsHeight(blocks[blocks.length - 1], Infinity); + return firstRowAnchor(blocks, blocks.length - 1) + (blocks.length ? rowsHeight(blocks[blocks.length - 1], Infinity) : 1); } var scrollbarKit = tableControlView.selectAll('.' + c.cn.scrollbarKit) @@ -288,7 +290,7 @@ function renderScrollbarKit(tableControlView, gd, bypassVisibleBar) { scrollbarSlider .attr('transform', function(d) { - return 'translate(0 ' + d.scrollbarState.topY + ')'; + return 'translate(0 ' + (d.scrollbarState.topY || 0) + ')'; }); var scrollbarGlyph = scrollbarSlider.selectAll('.' + c.cn.scrollbarGlyph) @@ -603,7 +605,7 @@ function headerBlock(d) {return d.type === 'header';} */ function headerHeight(d) { - var headerBlocks = d.rowBlocks[0].auxiliaryBlocks; + var headerBlocks = d.rowBlocks.length ? d.rowBlocks[0].auxiliaryBlocks : []; return headerBlocks.reduce(function(p, n) {return p + rowsHeight(n, Infinity);}, 0); } @@ -643,6 +645,7 @@ function findPagesAndCacheHeights(blocks, scrollY, scrollHeight) { function updateBlockYPosition(gd, cellsColumnBlock, tableControlView) { var d = flatData(cellsColumnBlock)[0]; + if(d === undefined) return; var blocks = d.rowBlocks; var calcdata = d.calcdata; diff --git a/test/image/baselines/contour_doublemerge.png b/test/image/baselines/contour_doublemerge.png new file mode 100644 index 00000000000..c86bc77bde6 Binary files /dev/null and b/test/image/baselines/contour_doublemerge.png differ diff --git a/test/image/mocks/contour_doublemerge.json b/test/image/mocks/contour_doublemerge.json new file mode 100644 index 00000000000..55c831751ca --- /dev/null +++ b/test/image/mocks/contour_doublemerge.json @@ -0,0 +1,60 @@ +{ + "data": [{ + "z": [ + [2.38,2.34,2.36,2.37,2.36,2.37,2.36,2.36,2.34,2.35,2.34,2.36,2.38,2.37,2.35,2.34,2.35,2.36,2.36,2.34,2.33,2.34,2.33,2.37], + [2.38,2.35,2.37,2.38,2.35,2.35,2.36,2.38,2.34,2.35,2.35,2.35,2.38,2.36,2.35,2.35,2.34,2.35,2.35,2.33,2.34,2.34,2.33,2.36], + [2.36,2.33,2.32,2.33,2.34,2.34,2.35,2.31,2.31,2.32,2.30,2.33,2.35,2.33,2.32,2.31,2.35,2.33,2.33,2.31,2.32,2.30,2.31,2.34], + [2.36,2.34,2.32,2.31,2.32,2.34,2.35,2.33,2.31,2.34,2.33,2.33,2.35,2.33,2.32,2.32,2.35,2.33,2.33,2.33,2.33,2.30,2.32,2.34], + [2.35,2.35,2.32,2.31,2.30,2.31,2.32,2.32,2.31,2.31,2.32,2.33,2.32,2.32,2.32,2.29,2.32,2.31,2.31,2.31,2.30,2.31,2.30,2.32], + [2.34,2.33,2.31,2.35,2.31,2.33,2.34,2.34,2.32,2.31,2.32,2.33,2.33,2.32,2.33,2.33,2.33,2.33,2.32,2.32,2.32,2.33,2.33,2.32], + [2.33,2.32,2.32,2.31,2.31,2.32,2.33,2.31,2.32,2.31,2.30,2.31,2.34,2.32,2.32,2.31,2.32,2.32,2.32,2.31,2.31,2.31,2.30,2.34], + [2.34,2.32,2.33,2.33,2.32,2.32,2.32,2.31,2.32,2.30,2.32,2.33,2.33,2.32,2.32,2.32,2.32,2.32,2.33,2.32,2.32,2.31,2.32,2.32], + [2.32,2.32,2.31,2.30,2.31,2.31,2.31,2.29,2.31,2.32,2.30,2.33,2.33,2.29,2.31,2.32,2.31,2.33,2.32,2.31,2.31,2.31,2.30,2.32], + [2.33,2.33,2.32,2.33,2.33,2.33,2.32,2.32,2.32,2.32,2.30,2.32,2.31,2.33,2.32,2.33,2.32,2.33,2.34,2.31,2.32,2.31,2.31,2.32], + [2.33,2.31,2.31,2.30,2.30,2.31,2.32,2.33,2.29,2.29,2.30,2.31,2.32,2.32,2.32,2.31,2.32,2.30,2.32,2.30,2.31,2.29,2.29,2.30], + [2.32,2.31,2.32,2.32,2.31,2.32,2.33,2.33,2.31,2.31,2.32,2.33,2.33,2.32,2.33,2.33,2.30,2.32,2.31,2.30,2.30,2.31,2.31,2.31], + [2.33,2.32,2.32,2.30,2.30,2.30,2.30,2.31,2.30,2.31,2.31,2.30,2.32,2.31,2.29,2.31,2.31,2.31,2.31,2.31,2.31,2.30,2.30,2.32], + [2.33,2.33,2.32,2.32,2.30,2.33,2.31,2.31,2.32,2.32,2.32,2.32,2.34,2.31,2.32,2.32,2.32,2.33,2.32,2.31,2.31,2.31,2.31,2.32], + [2.33,2.33,2.30,2.33,2.31,2.32,2.31,2.31,2.30,2.31,2.30,2.32,2.33,2.32,2.31,2.30,2.31,2.33,2.31,2.32,2.30,2.31,2.31,2.32], + [2.33,2.33,2.31,2.32,2.32,2.33,2.33,2.32,2.32,2.34,2.33,2.33,2.33,2.34,2.32,2.31,2.31,2.32,2.32,2.32,2.30,2.32,2.32,2.32], + [2.32,2.31,2.32,2.33,2.31,2.33,2.32,2.32,2.32,2.31,2.31,2.37,2.32,2.31,2.31,2.30,2.31,2.32,2.31,2.31,2.30,2.31,2.31,2.35], + [2.33,2.32,2.32,2.31,2.34,2.35,2.32,2.33,2.33,2.32,2.33,2.34,2.33,2.33,2.32,2.32,2.33,2.34,2.32,2.32,2.31,2.31,2.32,2.33], + [2.32,2.34,2.30,2.33,2.30,2.32,2.33,2.33,2.32,2.31,2.30,2.31,2.32,2.30,2.31,2.29,2.31,2.31,2.31,2.31,2.30,2.32,2.30,2.31], + [2.32,2.32,2.32,2.32,2.32,2.33,2.34,2.34,2.32,2.32,2.32,2.32,2.34,2.30,2.31,2.34,2.32,2.33,2.32,2.30,2.31,2.34,2.31,2.32], + [2.31,2.30,2.33,2.30,2.29,2.30,2.31,2.32,2.30,2.30,2.32,2.31,2.32,2.32,2.31,2.31,2.30,2.32,2.31,2.31,2.31,2.31,2.30,2.29], + [2.32,2.32,2.31,2.31,2.31,2.34,2.32,2.32,2.33,2.30,2.32,2.33,2.32,2.32,2.31,2.31,2.31,2.32,2.29,2.32,2.31,2.31,2.31,2.32], + [2.32,2.30,2.31,2.31,2.29,2.32,2.32,2.33,2.30,2.31,2.30,2.30,2.31,2.32,2.30,2.30,2.31,2.31,2.32,2.31,2.30,2.31,2.32,2.31], + [2.32,2.31,2.32,2.34,2.32,2.32,2.32,2.32,2.32,2.32,2.32,2.34,2.34,2.32,2.32,2.34,2.31,2.30,2.33,2.31,2.34,2.31,2.33,2.31], + [2.33,2.31,2.29,2.31,2.32,2.30,2.34,2.31,2.31,2.32,2.32,2.31,2.31,2.30,2.31,2.29,2.31,2.31,2.31,2.29,2.31,2.31,2.33,2.30], + [2.33,2.30,2.31,2.31,2.31,2.32,2.35,2.33,2.32,2.31,2.31,2.31,2.32,2.32,2.31,2.32,2.31,2.33,2.31,2.33,2.33,2.33,2.32,2.33], + [2.30,2.30,2.31,2.33,2.30,2.31,2.31,2.31,2.29,2.32,2.29,2.31,2.31,2.31,2.31,2.30,2.29,2.32,2.31,2.31,2.31,2.32,2.32,2.30], + [2.32,2.31,2.31,2.31,2.32,2.33,2.32,2.34,2.30,2.32,2.33,2.31,2.33,2.32,2.31,2.32,2.32,2.32,2.32,2.30,2.32,2.32,2.32,2.32], + [2.34,2.33,2.30,2.30,2.33,2.30,2.31,2.31,2.31,2.30,2.31,2.31,2.35,2.31,2.32,2.32,2.30,2.31,2.32,2.32,2.31,2.31,2.31,2.31], + [2.35,2.32,2.30,2.32,2.31,2.32,2.33,2.34,2.34,2.31,2.33,2.32,2.35,2.36,2.31,2.34,2.33,2.33,2.32,2.33,2.32,2.32,2.33,2.34], + [2.34,2.31,2.30,2.31,2.32,2.34,2.34,2.29,2.29,2.30,2.30,2.32,2.31,2.32,2.32,2.31,2.30,2.31,2.33,2.32,2.33,2.32,2.29,2.32], + [2.33,2.34,2.33,2.33,2.32,2.34,2.34,2.33,2.32,2.33,2.33,2.33,2.33,2.32,2.33,2.33,2.31,2.33,2.33,2.32,2.33,2.34,2.32,2.31], + [2.33,2.32,2.31,2.30,2.32,2.31,2.31,2.32,2.31,2.30,2.29,2.32,2.33,2.31,2.33,2.30,2.30,2.31,2.31,2.31,2.32,2.32,2.34,2.32], + [2.32,2.32,2.31,2.32,2.32,2.32,2.35,2.33,2.33,2.31,2.32,2.34,2.32,2.32,2.36,2.33,2.33,2.33,2.32,2.34,2.36,2.32,2.34,2.32], + [2.32,2.30,2.30,2.32,2.32,2.32,2.31,2.31,2.31,2.29,2.30,2.34,2.32,2.32,2.30,2.31,2.34,2.32,2.32,2.32,2.32,2.30,2.30,2.30], + [2.32,2.30,2.33,2.33,2.34,2.32,2.32,2.31,2.32,2.31,2.33,2.32,2.34,2.33,2.31,2.33,2.33,2.32,2.32,2.31,2.33,2.31,2.31,2.32], + [2.30,2.33,2.30,2.31,2.32,2.30,2.31,2.31,2.31,2.30,2.31,2.33,2.32,2.30,2.30,2.32,2.30,2.31,2.31,2.31,2.30,2.30,2.30,2.31], + [2.34,2.32,2.33,2.34,2.33,2.33,2.33,2.32,2.32,2.32,2.33,2.34,2.32,2.32,2.32,2.31,2.34,2.32,2.31,2.31,2.32,2.31,2.31,2.33], + [2.32,2.32,2.31,2.30,2.31,2.30,2.31,2.30,2.31,2.31,2.30,2.32,2.33,2.31,2.31,2.30,2.31,2.32,2.31,2.31,2.31,2.30,2.31,2.32], + [2.33,2.32,2.33,2.32,2.32,2.33,2.32,2.32,2.33,2.31,2.33,2.32,2.32,2.32,2.33,2.31,2.32,2.34,2.33,2.31,2.33,2.31,2.34,2.34], + [2.34,2.31,2.31,2.32,2.30,2.34,2.32,2.31,2.30,2.30,2.31,2.32,2.33,2.31,2.30,2.32,2.30,2.32,2.32,2.32,2.29,2.32,2.31,2.31], + [2.33,2.33,2.32,2.34,2.34,2.33,2.32,2.31,2.32,2.33,2.33,2.31,2.33,2.32,2.32,2.36,2.31,2.33,2.31,2.32,2.31,2.32,2.33,2.31], + [2.33,2.31,2.30,2.31,2.31,2.31,2.31,2.31,2.31,2.29,2.30,2.31,2.31,2.30,2.29,2.30,2.31,2.31,2.31,2.30,2.31,2.30,2.30,2.33], + [2.32,2.31,2.33,2.29,2.30,2.32,2.31,2.32,2.31,2.30,2.32,2.33,2.32,2.32,2.32,2.33,2.31,2.32,2.32,2.32,2.32,2.32,2.30,2.32], + [2.33,2.32,2.32,2.32,2.30,2.33,2.31,2.32,2.31,2.30,2.31,2.33,2.33,2.32,2.32,2.31,2.31,2.31,2.31,2.31,2.29,2.31,2.31,2.31], + [2.33,2.33,2.33,2.32,2.31,2.33,2.33,2.32,2.34,2.33,2.34,2.34,2.33,2.33,2.31,2.32,2.31,2.33,2.34,2.31,2.32,2.32,2.32,2.33], + [2.35,2.33,2.31,2.32,2.32,2.34,2.35,2.31,2.32,2.30,2.31,2.33,2.33,2.32,2.32,2.32,2.32,2.40,2.33,2.32,2.34,2.31,2.31,2.34], + [2.35,2.33,2.33,2.32,2.33,2.34,2.34,2.32,2.33,2.32,2.33,2.34,2.36,2.33,2.33,2.34,2.34,2.34,2.34,2.34,2.34,2.32,2.34,2.35]], + "type": "contour", + "contours": { + "start": 2.2, + "end": 2.4, + "size": 0.02 + } + }], + "layout": {"width": 400, "height": 600} +} diff --git a/test/jasmine/tests/select_test.js b/test/jasmine/tests/select_test.js index 06f946bcb9b..bf53efe8709 100644 --- a/test/jasmine/tests/select_test.js +++ b/test/jasmine/tests/select_test.js @@ -716,6 +716,13 @@ describe('Test select box and lasso per trace:', function() { fig.layout.geo.scope = 'europe'; addInvisible(fig, false); + // add a trace with no locations which will then make trace invisible, lacking DOM elements + var emptyChoroplethTrace = Lib.extendDeep({}, fig.data[0]); + emptyChoroplethTrace.text = []; + emptyChoroplethTrace.locations = []; + emptyChoroplethTrace.z = []; + fig.data.push(emptyChoroplethTrace); + Plotly.plot(gd, fig) .then(function() { return _run( diff --git a/test/jasmine/tests/table_test.js b/test/jasmine/tests/table_test.js new file mode 100644 index 00000000000..5e936838b1d --- /dev/null +++ b/test/jasmine/tests/table_test.js @@ -0,0 +1,332 @@ +var Plotly = require('@lib/index'); +var Lib = require('@src/lib'); +var Plots = require('@src/plots/plots'); +var Table = require('@src/traces/table'); +var attributes = require('@src/traces/table/attributes'); +var cn = require('@src/traces/table/constants').cn; + +var createGraphDiv = require('../assets/create_graph_div'); +var destroyGraphDiv = require('../assets/destroy_graph_div'); + +var mockMulti = require('@mocks/table_latex_multitrace.json'); + +// mock with two columns; lowest column count of general case +var mock2 = Lib.extendDeep({}, mockMulti); +mock2.data = [mock2.data[2]]; // keep the subplot with two columns + +// mock with one column as special case +var mock1 = Lib.extendDeep({}, mock2); +mock1.data[0].header.values = mock1.data[0].header.values.slice(0, 1); +mock1.data[0].cells.values = mock1.data[0].cells.values.slice(0, 1); + +// mock with zero columns; special case, as no column can be rendered +var mock0 = Lib.extendDeep({}, mock1); +mock0.data[0].header.values = []; +mock0.data[0].cells.values = []; + +var mock = require('@mocks/table_plain_birds.json'); + +describe('table initialization tests', function() { + + 'use strict'; + + describe('table global defaults', function() { + + it('should not coerce trace opacity', function() { + var gd = Lib.extendDeep({}, mock1); + + Plots.supplyDefaults(gd); + + expect(gd._fullData[0].opacity).toBeUndefined(); + }); + + it('should use global font as label, tick and range font defaults', function() { + var gd = Lib.extendDeep({}, mock1); + delete gd.data[0].header.font; + delete gd.data[0].cells.font; + gd.layout.font = { + family: 'Gravitas', + size: 20, + color: 'blue' + }; + + Plots.supplyDefaults(gd); + + var expected = { + family: 'Gravitas', + size: 20, + color: 'blue' + }; + + expect(gd._fullData[0].header.font).toEqual(expected); + expect(gd._fullData[0].cells.font).toEqual(expected); + }); + }); + + describe('table defaults', function() { + + function _supply(traceIn) { + var traceOut = { visible: true }, + defaultColor = '#777', + layout = { font: {family: '"Open Sans", verdana, arial, sans-serif', size: 12, color: '#444'} }; + + Table.supplyDefaults(traceIn, traceOut, defaultColor, layout); + + return traceOut; + } + + it('\'line\' specification should yield a default color', function() { + var fullTrace = _supply({}); + expect(fullTrace.header.fill.color).toEqual(attributes.header.fill.color.dflt); + expect(fullTrace.cells.fill.color).toEqual(attributes.cells.fill.color.dflt); + }); + + it('\'domain\' specification should have a default', function() { + var fullTrace = _supply({}); + expect(fullTrace.domain).toEqual({x: [0, 1], y: [0, 1]}); + }); + + it('\'*.values\' specification should have a default of an empty array', function() { + var fullTrace = _supply({}); + expect(fullTrace.header.values).toEqual([]); + expect(fullTrace.cells.values).toEqual([]); + }); + + it('\'header\' should be used with default values where attributes are not provided', function() { + var fullTrace = _supply({ + header: { + values: ['A'], + alienProperty: 'Alpha Centauri' + }, + cells: { + values: [1, 2], // otherwise header.values will become [] + alienProperty: 'Betelgeuse' + } + }); + expect(fullTrace.header).toEqual({ + values: ['A'], // only one column remains + format: [], + align: 'center', + height: 28, + line: { width: 1, color: 'grey' }, + fill: { color: attributes.header.fill.color.dflt }, + font: {family: '"Open Sans", verdana, arial, sans-serif', size: 12, color: '#444'} + }); + + expect(fullTrace.cells).toEqual({ + values: [1, 2], + format: [], + align: 'center', + height: 20, + line: { width: 1, color: 'grey' }, + fill: { color: attributes.cells.fill.color.dflt }, + font: {family: '"Open Sans", verdana, arial, sans-serif', size: 12, color: '#444'} + }); + }); + }); +}); + +describe('table', function() { + + afterEach(destroyGraphDiv); + + describe('edge cases', function() { + + it('Works with more than one column', function(done) { + + var mockCopy = Lib.extendDeep({}, mock2); + var gd = createGraphDiv(); + Plotly.plot(gd, mockCopy.data, mockCopy.layout).then(function() { + expect(gd.data.length).toEqual(1); + expect(gd.data[0].header.values.length).toEqual(2); + expect(gd.data[0].cells.values.length).toEqual(2); + expect(document.querySelectorAll('.' + cn.yColumn).length).toEqual(2); + done(); + }); + }); + + it('Works with one column', function(done) { + + var mockCopy = Lib.extendDeep({}, mock1); + var gd = createGraphDiv(); + Plotly.plot(gd, mockCopy.data, mockCopy.layout).then(function() { + expect(gd.data.length).toEqual(1); + expect(gd.data[0].header.values.length).toEqual(1); + expect(gd.data[0].cells.values.length).toEqual(1); + expect(document.querySelectorAll('.' + cn.yColumn).length).toEqual(1); + done(); + }); + }); + + it('Does not error with zero columns', function(done) { + + var mockCopy = Lib.extendDeep({}, mock0); + var gd = createGraphDiv(); + + Plotly.plot(gd, mockCopy.data, mockCopy.layout).then(function() { + expect(gd.data.length).toEqual(1); + expect(gd.data[0].header.values.length).toEqual(0); + expect(gd.data[0].cells.values.length).toEqual(0); + expect(document.querySelectorAll('.' + cn.yColumn).length).toEqual(0); + done(); + }); + }); + + it('Does not raise an error with zero lines', function(done) { + + var mockCopy = Lib.extendDeep({}, mock2); + + mockCopy.layout.width = 320; + mockCopy.data[0].header.values = [[], []]; + mockCopy.data[0].cells.values = [[], []]; + + var gd = createGraphDiv(); + Plotly.plot(gd, mockCopy.data, mockCopy.layout).then(function() { + + expect(gd.data.length).toEqual(1); + expect(gd.data[0].header.values.length).toEqual(2); + expect(gd.data[0].cells.values.length).toEqual(2); + expect(document.querySelectorAll('.' + cn.yColumn).length).toEqual(2); + done(); + }); + }); + }); + + describe('basic use and basic data restyling', function() { + var mockCopy, + gd; + + beforeEach(function(done) { + mockCopy = Lib.extendDeep({}, mock); + mockCopy.data[0].domain = { + x: [0.1, 0.9], + y: [0.05, 0.85] + }; + gd = createGraphDiv(); + Plotly.plot(gd, mockCopy.data, mockCopy.layout).then(done); + }); + + it('`Plotly.plot` should have proper fields on `gd.data` on initial rendering', function() { + + expect(gd.data.length).toEqual(1); + expect(gd.data[0].header.values.length).toEqual(7); + expect(gd.data[0].cells.values.length).toEqual(7); + expect(document.querySelectorAll('.' + cn.yColumn).length).toEqual(7); + }); + + it('Calling `Plotly.plot` again should add the new table trace', function(done) { + + var reversedMockCopy = Lib.extendDeep({}, mockCopy); + reversedMockCopy.data[0].header.values = reversedMockCopy.data[0].header.values.slice().reverse(); + reversedMockCopy.data[0].cells.values = reversedMockCopy.data[0].cells.values.slice().reverse(); + reversedMockCopy.data[0].domain.y = [0, 0.3]; + + Plotly.plot(gd, reversedMockCopy.data, reversedMockCopy.layout).then(function() { + expect(gd.data.length).toEqual(2); + expect(document.querySelectorAll('.' + cn.yColumn).length).toEqual(7 * 2); + done(); + }); + + }); + + it('Calling `Plotly.restyle` with a string path should amend the preexisting table', function(done) { + + expect(gd.data.length).toEqual(1); + + Plotly.restyle(gd, 'header.fill.color', 'magenta').then(function() { + + expect(gd.data.length).toEqual(1); + + expect(gd.data[0].header.fill.color).toEqual('magenta'); + expect(gd.data[0].header.values.length).toEqual(7); + expect(gd.data[0].cells.values.length).toEqual(7); + expect(gd.data[0].header.line.color).toEqual('lightgray'); // no change relative to original mock value + expect(gd.data[0].cells.line.color).toEqual(['grey']); // no change relative to original mock value + + done(); + }); + + }); + + it('Calling `Plotly.restyle` for a `header.values` change should amend the preexisting one', function(done) { + + function restyleValues(what, key, setterValue) { + + // array values need to be wrapped in an array; unwrapping here for value comparison + var value = Lib.isArray(setterValue) ? setterValue[0] : setterValue; + + return function() { + return Plotly.restyle(gd, what + '.values[' + key + ']', setterValue).then(function() { + expect(gd.data[0][what].values[key]).toEqual(value, 'for column \'' + key + '\''); + expect(document.querySelectorAll('.' + cn.yColumn).length).toEqual(7); + }); + }; + } + + restyleValues('cells', 0, [['new cell content 1', 'new cell content 2']])() + .then(restyleValues('cells', 2, [[0, 0.1]])) + .then(restyleValues('header', 1, [['Species top', 'Species bottom']])) + .then(done); + }); + + it('Calling `Plotly.relayout` with string should amend the preexisting table', function(done) { + expect(gd.layout.width).toEqual(1000); + Plotly.relayout(gd, 'width', 500).then(function() { + expect(gd.data.length).toEqual(1); + expect(gd.layout.width).toEqual(500); + done(); + }); + }); + + it('Calling `Plotly.relayout` with object should amend the preexisting table', function(done) { + expect(gd.layout.width).toEqual(1000); + Plotly.relayout(gd, {width: 500}).then(function() { + expect(gd.data.length).toEqual(1); + expect(gd.layout.width).toEqual(500); + done(); + }); + }); + }); + + describe('more restyling tests with scenegraph queries', function() { + var mockCopy, + gd; + + beforeEach(function(done) { + mockCopy = Lib.extendDeep({}, mock2); + gd = createGraphDiv(); + Plotly.plot(gd, mockCopy.data, mockCopy.layout).then(done); + }); + + it('Calling `Plotly.restyle` for a `header.values` change should amend the preexisting one', function(done) { + + function restyleValues(what, fun, setterValue) { + + var value = Lib.isArray(setterValue) ? setterValue[0] : setterValue; + + return function() { + return Plotly.restyle(gd, what, setterValue).then(function() { + expect(fun(gd)).toEqual(value, what + ':::' + value); + expect(document.querySelectorAll('.' + cn.yColumn).length).toEqual(2); + expect(document.querySelectorAll('.' + cn.columnBlock).length).toEqual(6); + expect(document.querySelectorAll('.' + cn.columnCell).length).toEqual(6); + expect(document.querySelectorAll('.' + cn.cellRect).length).toEqual(6); + expect(document.querySelectorAll('.' + cn.cellTextHolder).length).toEqual(6); + }); + }; + } + + restyleValues('cells.fill.color', function(gd) {return gd.data[0].cells.fill.color;}, [['green', 'red']])() + .then(restyleValues('cells.line.color', function(gd) {return gd.data[0].cells.line.color;}, [['magenta', 'blue']])) + .then(restyleValues('cells.line.width', function(gd) {return gd.data[0].cells.line.width;}, [[5, 3]])) + .then(restyleValues('cells.format', function(gd) {return gd.data[0].cells.format;}, [['', '']])) + .then(restyleValues('cells.prefix', function(gd) {return gd.data[0].cells.prefix;}, [['p1']])) + .then(restyleValues('cells.suffix', function(gd) {return gd.data[0].cells.suffix;}, [['s1']])) + .then(restyleValues('header.fill.color', function(gd) {return gd.data[0].header.fill.color;}, [['yellow', 'purple']])) + .then(restyleValues('header.line.color', function(gd) {return gd.data[0].header.line.color;}, [['green', 'red']])) + .then(restyleValues('header.line.width', function(gd) {return gd.data[0].header.line.width;}, [[2, 6]])) + .then(restyleValues('header.format', function(gd) {return gd.data[0].header.format;}, [['', '']])) + .then(done); + }); + }); +});