diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000000..16ff240eee5 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,3 @@ +[*.js] +indent_style = space +indent_size = 4 diff --git a/dist/plotly-geo-assets.js b/dist/plotly-geo-assets.js index a7541601693..790d06749e3 100644 --- a/dist/plotly-geo-assets.js +++ b/dist/plotly-geo-assets.js @@ -1,5 +1,5 @@ /** -* plotly.js v1.13.0 +* plotly.js v1.12.0 * Copyright 2012-2016, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -69,7 +69,7 @@ var saneTopojson = require('sane-topojson'); // package version injected by `npm run preprocess` -exports.version = '1.13.0'; +exports.version = '1.12.0'; exports.topojson = saneTopojson; diff --git a/dist/plotly-with-meta.js b/dist/plotly-with-meta.js index e5256ee78b4..3faaf5d5bf9 100644 --- a/dist/plotly-with-meta.js +++ b/dist/plotly-with-meta.js @@ -1,5 +1,5 @@ /** -* plotly.js v1.13.0 +* plotly.js v1.12.0 * Copyright 2012-2016, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -68,7 +68,7 @@ for(var selector in rules) { Plotly.Lib.addStyleRule(fullSelector, rules[selector]); } -},{"../src/plotly":402}],2:[function(require,module,exports){ +},{"../src/plotly":400}],2:[function(require,module,exports){ 'use strict'; module.exports = { @@ -199,7 +199,7 @@ module.exports = { module.exports = require('../src/traces/bar'); -},{"../src/traces/bar":480}],4:[function(require,module,exports){ +},{"../src/traces/bar":478}],4:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -210,7 +210,7 @@ module.exports = require('../src/traces/bar'); module.exports = require('../src/traces/box'); -},{"../src/traces/box":491}],5:[function(require,module,exports){ +},{"../src/traces/box":489}],5:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -221,7 +221,7 @@ module.exports = require('../src/traces/box'); module.exports = require('../src/traces/choropleth'); -},{"../src/traces/choropleth":500}],6:[function(require,module,exports){ +},{"../src/traces/choropleth":498}],6:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -232,7 +232,7 @@ module.exports = require('../src/traces/choropleth'); module.exports = require('../src/traces/contour'); -},{"../src/traces/contour":507}],7:[function(require,module,exports){ +},{"../src/traces/contour":505}],7:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -243,7 +243,7 @@ module.exports = require('../src/traces/contour'); module.exports = require('../src/core'); -},{"../src/core":371}],8:[function(require,module,exports){ +},{"../src/core":370}],8:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -254,7 +254,7 @@ module.exports = require('../src/core'); module.exports = require('../src/traces/heatmap'); -},{"../src/traces/heatmap":519}],9:[function(require,module,exports){ +},{"../src/traces/heatmap":517}],9:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -265,7 +265,7 @@ module.exports = require('../src/traces/heatmap'); module.exports = require('../src/traces/histogram'); -},{"../src/traces/histogram":530}],10:[function(require,module,exports){ +},{"../src/traces/histogram":528}],10:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -276,7 +276,7 @@ module.exports = require('../src/traces/histogram'); module.exports = require('../src/traces/histogram2d'); -},{"../src/traces/histogram2d":535}],11:[function(require,module,exports){ +},{"../src/traces/histogram2d":533}],11:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -287,7 +287,7 @@ module.exports = require('../src/traces/histogram2d'); module.exports = require('../src/traces/histogram2dcontour'); -},{"../src/traces/histogram2dcontour":539}],12:[function(require,module,exports){ +},{"../src/traces/histogram2dcontour":537}],12:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -336,7 +336,7 @@ module.exports = Core; module.exports = require('../src/traces/mesh3d'); -},{"../src/traces/mesh3d":543}],14:[function(require,module,exports){ +},{"../src/traces/mesh3d":541}],14:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -347,7 +347,7 @@ module.exports = require('../src/traces/mesh3d'); module.exports = require('../src/traces/pie'); -},{"../src/traces/pie":549}],15:[function(require,module,exports){ +},{"../src/traces/pie":547}],15:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -358,7 +358,7 @@ module.exports = require('../src/traces/pie'); module.exports = require('../src/traces/scatter3d'); -},{"../src/traces/scatter3d":583}],16:[function(require,module,exports){ +},{"../src/traces/scatter3d":581}],16:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -369,7 +369,7 @@ module.exports = require('../src/traces/scatter3d'); module.exports = require('../src/traces/scattergeo'); -},{"../src/traces/scattergeo":587}],17:[function(require,module,exports){ +},{"../src/traces/scattergeo":585}],17:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -380,7 +380,7 @@ module.exports = require('../src/traces/scattergeo'); module.exports = require('../src/traces/scattergl'); -},{"../src/traces/scattergl":592}],18:[function(require,module,exports){ +},{"../src/traces/scattergl":590}],18:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -391,7 +391,7 @@ module.exports = require('../src/traces/scattergl'); module.exports = require('../src/traces/scatterternary'); -},{"../src/traces/scatterternary":597}],19:[function(require,module,exports){ +},{"../src/traces/scatterternary":595}],19:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -402,7 +402,7 @@ module.exports = require('../src/traces/scatterternary'); module.exports = require('../src/traces/surface'); -},{"../src/traces/surface":606}],20:[function(require,module,exports){ +},{"../src/traces/surface":604}],20:[function(require,module,exports){ 'use strict' module.exports = createFilteredVector @@ -35796,7 +35796,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(255>_inline_31_arg0_||255>_inline_31_arg1_||255>_inline_31_arg2_||255>_inline_31_arg3_){var _inline_31_l=_inline_31_arg4_-_inline_31_arg6_[0],_inline_31_a=_inline_31_arg5_-_inline_31_arg6_[1],_inline_31_f=_inline_31_l*_inline_31_l+_inline_31_a*_inline_31_a;_inline_31_f_inline_34_arg0_||255>_inline_34_arg1_||255>_inline_34_arg2_||255>_inline_34_arg3_){var _inline_34_l=_inline_34_arg4_-_inline_34_arg6_[0],_inline_34_a=_inline_34_arg5_-_inline_34_arg6_[1],_inline_34_f=_inline_34_l*_inline_34_l+_inline_34_a*_inline_34_a;_inline_34_f 0 && !gd._context.staticPlot) { // increase the background and clip-path width // by the scrollbar width and margin @@ -56127,27 +56055,31 @@ module.exports = function draw(gd) { width: legendWidth - 2 * opts.borderwidth + constants.scrollBarWidth + - constants.scrollBarMargin, - height: legendHeight - opts.borderwidth, - x: opts.borderwidth / 2, - y: opts.borderwidth / 2 + constants.scrollBarMargin }); clipPath.select('rect').attr({ width: legendWidth - 2 * opts.borderwidth + constants.scrollBarWidth + - constants.scrollBarMargin, - height: legendHeight - 2 * opts.borderwidth, - x: opts.borderwidth, - y: opts.borderwidth - scrollBoxY + constants.scrollBarMargin }); - scrollBox.call(Drawing.setClipUrl, clipId); + if(gd.firstRender) { + // Move scrollbar to starting position + scrollHandler(constants.scrollBarMargin, 0); + } + + var scrollBarYMax = legendHeight - + constants.scrollBarHeight - + 2 * constants.scrollBarMargin, + scrollBoxYMax = opts.height - legendHeight, + scrollBarY = constants.scrollBarMargin, + scrollBoxY = 0; - if(firstRender) scrollHandler(scrollBarY, scrollBoxY); + scrollHandler(scrollBarY, scrollBoxY); - legend.on('wheel', null); // to be safe, remove previous listeners + legend.on('wheel', null); legend.on('wheel', function() { scrollBoxY = Lib.constrain( scrollBox.attr('data-scroll') - @@ -56159,10 +56091,8 @@ module.exports = function draw(gd) { d3.event.preventDefault(); }); - // to be safe, remove previous listeners scrollBar.on('.drag', null); scrollBox.on('.drag', null); - var drag = d3.behavior.drag().on('drag', function() { scrollBarY = Lib.constrain( d3.event.y - constants.scrollBarHeight / 2, @@ -56175,6 +56105,7 @@ module.exports = function draw(gd) { scrollBar.call(drag); scrollBox.call(drag); + } @@ -56542,7 +56473,7 @@ function expandHorizontalMargin(gd) { }); } -},{"../../lib":382,"../../plotly":402,"../../plots/plots":454,"../color":303,"../dragelement":324,"../drawing":326,"./anchor_utils":339,"./constants":341,"./get_legend_data":344,"./helpers":345,"./style":347,"d3":113}],344:[function(require,module,exports){ +},{"../../lib":381,"../../plotly":400,"../../plots/plots":452,"../color":303,"../dragelement":323,"../drawing":325,"./anchor_utils":338,"./constants":340,"./get_legend_data":343,"./helpers":344,"./style":346,"d3":113}],343:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -56648,7 +56579,7 @@ module.exports = function getLegendData(calcdata, opts) { return legendData; }; -},{"../../plots/plots":454,"./helpers":345}],345:[function(require,module,exports){ +},{"../../plots/plots":452,"./helpers":344}],344:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -56679,7 +56610,7 @@ exports.isReversed = function isReversed(legendLayout) { return (legendLayout.traceorder || '').indexOf('reversed') !== -1; }; -},{"../../plots/plots":454}],346:[function(require,module,exports){ +},{"../../plots/plots":452}],345:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -56702,7 +56633,7 @@ legend.draw = require('./draw'); legend.style = require('./style'); -},{"./attributes":340,"./defaults":342,"./draw":343,"./style":347}],347:[function(require,module,exports){ +},{"./attributes":339,"./defaults":341,"./draw":342,"./style":346}],346:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -56924,7 +56855,7 @@ function stylePies(d) { if(pts.size()) pts.call(stylePie, d[0], trace); } -},{"../../lib":382,"../../plots/plots":454,"../../traces/pie/style_one":554,"../../traces/scatter/subtypes":575,"../color":303,"../drawing":326,"d3":113}],348:[function(require,module,exports){ +},{"../../lib":381,"../../plots/plots":452,"../../traces/pie/style_one":552,"../../traces/scatter/subtypes":573,"../color":303,"../drawing":325,"d3":113}],347:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -57451,7 +57382,7 @@ modeBarButtons.resetViews = { } }; -},{"../../../build/ploticon":2,"../../lib":382,"../../lib/setcursor":391,"../../plotly":402,"../../snapshot/download":469}],349:[function(require,module,exports){ +},{"../../../build/ploticon":2,"../../lib":381,"../../lib/setcursor":389,"../../plotly":400,"../../snapshot/download":467}],348:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -57741,7 +57672,7 @@ function createModeBar(gd, buttons) { module.exports = createModeBar; -},{"../../../build/ploticon":2,"../../lib":382,"d3":113}],350:[function(require,module,exports){ +},{"../../../build/ploticon":2,"../../lib":381,"d3":113}],349:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -57969,7 +57900,7 @@ function fillCustomButton(customButtons) { return customButtons; } -},{"../../plotly":402,"../../traces/scatter/subtypes":575,"./":349,"./buttons":348}],351:[function(require,module,exports){ +},{"../../plotly":400,"../../traces/scatter/subtypes":573,"./":348,"./buttons":347}],350:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -58068,7 +57999,7 @@ module.exports = { } }; -},{"../../lib/extend":377,"../../plots/font_attributes":423,"../color/attributes":302,"./button_attributes":352}],352:[function(require,module,exports){ +},{"../../lib/extend":376,"../../plots/font_attributes":421,"../color/attributes":302,"./button_attributes":351}],351:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -58124,7 +58055,7 @@ module.exports = { } }; -},{}],353:[function(require,module,exports){ +},{}],352:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -58152,7 +58083,7 @@ module.exports = { activeColor: '#d3d3d3' }; -},{}],354:[function(require,module,exports){ +},{}],353:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -58239,7 +58170,7 @@ function getPosDflt(containerOut, layout, counterAxes) { return [containerOut.domain[0], posY + constants.yPad]; } -},{"../../lib":382,"./attributes":351,"./button_attributes":352,"./constants":353}],355:[function(require,module,exports){ +},{"../../lib":381,"./attributes":350,"./button_attributes":351,"./constants":352}],354:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -58514,7 +58445,7 @@ function reposition(gd, buttons, opts, axName) { }); } -},{"../../lib/svg_text_utils":395,"../../plotly":402,"../../plots/cartesian/axis_ids":407,"../../plots/plots":454,"../color":303,"../drawing":326,"../legend/anchor_utils":339,"./constants":353,"./get_update_object":356,"d3":113}],356:[function(require,module,exports){ +},{"../../lib/svg_text_utils":393,"../../plotly":400,"../../plots/cartesian/axis_ids":405,"../../plots/plots":452,"../color":303,"../drawing":325,"../legend/anchor_utils":338,"./constants":352,"./get_update_object":355,"d3":113}],355:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -58572,7 +58503,7 @@ function getXRange(axisLayout, buttonLayout) { return [range0, range1]; } -},{"d3":113}],357:[function(require,module,exports){ +},{"d3":113}],356:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -58590,7 +58521,7 @@ exports.supplyLayoutDefaults = require('./defaults'); exports.draw = require('./draw'); -},{"./attributes":351,"./defaults":354,"./draw":355}],358:[function(require,module,exports){ +},{"./attributes":350,"./defaults":353,"./draw":354}],357:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -58661,7 +58592,7 @@ module.exports = { } }; -},{"../color/attributes":302}],359:[function(require,module,exports){ +},{"../color/attributes":302}],358:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -58957,7 +58888,7 @@ module.exports = function createSlider(gd) { }); }; -},{"../../constants/xmlns_namespaces":370,"../../lib":382,"../../plotly":402,"../../plots/cartesian/axes":405,"./helpers":361,"./range_plot":363}],360:[function(require,module,exports){ +},{"../../constants/xmlns_namespaces":369,"../../lib":381,"../../plotly":400,"../../plots/cartesian/axes":403,"./helpers":360,"./range_plot":362}],359:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -59011,7 +58942,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, axName, coun } }; -},{"../../lib":382,"./attributes":358}],361:[function(require,module,exports){ +},{"../../lib":381,"./attributes":357}],360:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -59037,7 +58968,7 @@ exports.appendChildren = function appendChildren(el, children) { } }; -},{}],362:[function(require,module,exports){ +},{}],361:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -59094,7 +59025,7 @@ function draw(gd) { }); } -},{"../../plots/plots":454,"./create_slider":359,"./defaults":360}],363:[function(require,module,exports){ +},{"../../plots/plots":452,"./create_slider":358,"./defaults":359}],362:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -59107,7 +59038,6 @@ function draw(gd) { var d3 = require('d3'); -var Lib = require('../../lib'); var Symbols = require('../drawing/symbol_defs'); var Drawing = require('../drawing'); @@ -59151,7 +59081,7 @@ module.exports = function rangePlot(gd, w, h) { pointPairs = []; if(allowedTypes.indexOf(trace.type) < 0) { - Lib.warn('Trace type ' + trace.type + ' not supported for range slider!'); + console.log('Trace type ' + trace.type + ' not supported for range slider!'); continue; } @@ -59259,7 +59189,7 @@ function makeScatter(trace, pointPairs, w, h) { break; default: - Lib.warn('Fill type ' + trace.fill + ' not supported for range slider! (yet...)'); + console.log('Fill type ' + trace.fill + ' not supported for range slider! (yet...)'); break; } @@ -59275,7 +59205,7 @@ function makeScatter(trace, pointPairs, w, h) { return [line, markers, fill]; } -},{"../../constants/xmlns_namespaces":370,"../../lib":382,"../drawing":326,"../drawing/symbol_defs":327,"./helpers":361,"d3":113}],364:[function(require,module,exports){ +},{"../../constants/xmlns_namespaces":369,"../drawing":325,"../drawing/symbol_defs":326,"./helpers":360,"d3":113}],363:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -59433,7 +59363,7 @@ module.exports = { } }; -},{"../../lib/extend":377,"../../traces/scatter/attributes":556,"../annotations/attributes":300}],365:[function(require,module,exports){ +},{"../../lib/extend":376,"../../traces/scatter/attributes":554,"../annotations/attributes":300}],364:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -59761,7 +59691,7 @@ function updateShape(gd, index, opt, value) { plotinfo = plots[subplots[i]]; clipAxes = subplots[i]; - if(isShapeInSubplot(gd, options, plotinfo)) { + if(isShapeInSubplot(gd, options, plotinfo.id)) { drawShape(plotinfo.shapelayer); } } @@ -59787,7 +59717,7 @@ function getShapeLayer(gd, index) { shapeLayer = gd._fullLayout._shapeUpperLayer; if(!shape) { - Lib.log('getShapeLayer: undefined shape: index', index); + console.log('getShapeLayer: undefined shape: index', index); } else if(shape.layer === 'below') { shapeLayer = (shape.xref === 'paper' && shape.yref === 'paper') ? @@ -59798,13 +59728,10 @@ function getShapeLayer(gd, index) { return shapeLayer; } -function isShapeInSubplot(gd, shape, plotinfo) { - var xa = Plotly.Axes.getFromId(gd, plotinfo.id, 'x')._id, - ya = Plotly.Axes.getFromId(gd, plotinfo.id, 'y')._id, - isBelow = shape.layer === 'below', - inSuplotAxis = (xa === shape.xref || ya === shape.yref), - isNotAnOverlaidSubplot = !!plotinfo.shapelayer; - return isBelow && inSuplotAxis && isNotAnOverlaidSubplot; +function isShapeInSubplot(gd, shape, subplot) { + var xa = Plotly.Axes.getFromId(gd, subplot, 'x')._id, + ya = Plotly.Axes.getFromId(gd, subplot, 'y')._id; + return shape.layer === 'below' && (xa === shape.xref || ya === shape.yref); } function decodeDate(convertToPx) { @@ -59930,7 +59857,7 @@ shapes.convertPath = function(pathIn, x2p, y2p) { if(paramNumber > nParams) { paramString = paramString.replace(/[\s,]*X.*/, ''); - Lib.log('Ignoring extra params in segment ' + segment); + console.log('ignoring extra params in segment ' + segment); } return segmentType + paramString; @@ -59996,7 +59923,7 @@ function shapeBounds(ax, v0, v1, path, paramsToUse) { if(max >= min) return [min, max]; } -},{"../../lib":382,"../../plotly":402,"../../plots/cartesian/axes":405,"../color":303,"../drawing":326,"./attributes":364,"fast-isnumeric":117}],366:[function(require,module,exports){ +},{"../../lib":381,"../../plotly":400,"../../plots/cartesian/axes":403,"../color":303,"../drawing":325,"./attributes":363,"fast-isnumeric":117}],365:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -60226,7 +60153,7 @@ Titles.draw = function(gd, titleClass, options) { el.classed('js-placeholder', isplaceholder); }; -},{"../../lib":382,"../../lib/svg_text_utils":395,"../../plotly":402,"../../plots/plots":454,"../color":303,"../drawing":326,"d3":113,"fast-isnumeric":117}],367:[function(require,module,exports){ +},{"../../lib":381,"../../lib/svg_text_utils":393,"../../plotly":400,"../../plots/plots":452,"../color":303,"../drawing":325,"d3":113,"fast-isnumeric":117}],366:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -60247,7 +60174,7 @@ module.exports = { longdashdot: [8, 1, 1, 1] }; -},{}],368:[function(require,module,exports){ +},{}],367:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -60268,7 +60195,7 @@ module.exports = { longdashdot: [[0.5, 0.7, 0.8, 1], 10] }; -},{}],369:[function(require,module,exports){ +},{}],368:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -60291,7 +60218,7 @@ module.exports = { x: '❌' }; -},{}],370:[function(require,module,exports){ +},{}],369:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -60315,7 +60242,7 @@ exports.svgAttrs = { 'xmlns:xlink': exports.xlink }; -},{}],371:[function(require,module,exports){ +},{}],370:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -60333,7 +60260,7 @@ exports.svgAttrs = { var Plotly = require('./plotly'); // package version injected by `npm run preprocess` -exports.version = '1.13.0'; +exports.version = '1.12.0'; // plot api exports.plot = Plotly.plot; @@ -60365,7 +60292,7 @@ exports.Queue = Plotly.Queue; // export d3 used in the bundle exports.d3 = require('d3'); -},{"../build/ploticon":2,"./plot_api/set_plot_config":400,"./plot_api/to_image":401,"./plotly":402,"./snapshot/download":469,"d3":113}],372:[function(require,module,exports){ +},{"../build/ploticon":2,"./plot_api/set_plot_config":398,"./plot_api/to_image":399,"./plotly":400,"./snapshot/download":467,"d3":113}],371:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -60398,7 +60325,7 @@ if(typeof MathJax !== 'undefined') { exports.MathJax = false; } -},{}],373:[function(require,module,exports){ +},{}],372:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -60415,7 +60342,7 @@ module.exports = function arrayToCalcItem(traceAttr, calcItem, calcAttr, i) { if(Array.isArray(traceAttr)) calcItem[calcAttr] = traceAttr[i]; }; -},{}],374:[function(require,module,exports){ +},{}],373:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -60728,7 +60655,7 @@ exports.coerceFont = function(coerce, attr, dfltObj) { return out; }; -},{"../components/colorscale/get_scale":315,"../components/colorscale/scales":321,"./nested_property":386,"fast-isnumeric":117,"tinycolor2":274}],375:[function(require,module,exports){ +},{"../components/colorscale/get_scale":314,"../components/colorscale/scales":320,"./nested_property":384,"fast-isnumeric":117,"tinycolor2":274}],374:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -60743,8 +60670,6 @@ exports.coerceFont = function(coerce, attr, dfltObj) { var d3 = require('d3'); var isNumeric = require('fast-isnumeric'); -var Lib = require('../lib'); - /** * dateTime2ms - turn a date object or string s of the form @@ -60855,7 +60780,7 @@ function lpad(val, digits) { */ exports.ms2DateTime = function(ms, r) { if(typeof(d3) === 'undefined') { - Lib.error('d3 is not defined.'); + console.log('d3 is not defined'); return; } @@ -61067,7 +60992,7 @@ exports.parseDate = function(v) { return out; }; -},{"../lib":382,"d3":113,"fast-isnumeric":117}],376:[function(require,module,exports){ +},{"d3":113,"fast-isnumeric":117}],375:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -61201,7 +61126,7 @@ var Events = { module.exports = Events; -},{"events":55}],377:[function(require,module,exports){ +},{"events":55}],376:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -61281,7 +61206,7 @@ function _extend(inputs, isDeep, keepAllKeys) { return target; } -},{"./is_plain_object.js":383}],378:[function(require,module,exports){ +},{"./is_plain_object.js":382}],377:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -61305,7 +61230,7 @@ module.exports = function filterVisible(dataIn) { return dataOut; }; -},{}],379:[function(require,module,exports){ +},{}],378:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -61318,7 +61243,7 @@ module.exports = function filterVisible(dataIn) { 'use strict'; var countryRegex = require('country-regex'); -var Lib = require('../lib'); +var Lib = require('./'); // make list of all country iso3 ids from at runtime @@ -61340,8 +61265,8 @@ exports.locationToFeature = function(locationmode, location, features) { if(feature.id === locationId) return feature; } - Lib.warn([ - 'Location with id', locationId, + console.warn([ + 'location with id', locationId, 'does not have a matching topojson feature at this resolution.' ].join(' ')); }; @@ -61361,10 +61286,10 @@ function countryNameToISO3(countryName) { if(regex.test(countryName.toLowerCase())) return iso3; } - Lib.warn('Unrecognized country name: ' + countryName + '.'); + console.warn('unrecognized country name: ' + countryName + '.'); } -},{"../lib":382,"country-regex":108}],380:[function(require,module,exports){ +},{"./":381,"country-regex":108}],379:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -61443,7 +61368,7 @@ function formatColor(containerIn, opacityIn, len) { module.exports = formatColor; -},{"../components/color/attributes":302,"../components/colorscale/make_scale_function":320,"./str2rgbarray":394,"fast-isnumeric":117,"tinycolor2":274}],381:[function(require,module,exports){ +},{"../components/color/attributes":302,"../components/colorscale/make_scale_function":319,"./str2rgbarray":392,"fast-isnumeric":117,"tinycolor2":274}],380:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -61517,7 +61442,7 @@ function convertHTMLToUnicode(html) { module.exports = convertHTMLToUnicode; -},{"superscript-text":263}],382:[function(require,module,exports){ +},{"superscript-text":263}],381:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -61578,11 +61503,6 @@ lib.extendFlat = extendModule.extendFlat; lib.extendDeep = extendModule.extendDeep; lib.extendDeepAll = extendModule.extendDeepAll; -var loggersModule = require('./loggers'); -lib.log = loggersModule.log; -lib.warn = loggersModule.warn; -lib.error = loggersModule.error; - lib.notifier = require('./notifier'); /** @@ -61617,6 +61537,35 @@ lib.pauseEvent = function(e) { return false; }; +/** + * ------------------------------------------ + * debugging tools + * ------------------------------------------ + */ + +// set VERBOSE to true to get a lot more logging and tracing +lib.VERBOSE = false; + +// first markTime call will return time from page load +lib.TIMER = new Date().getTime(); + +// console.log that only runs if VERBOSE is on +lib.log = function() { + if(lib.VERBOSE) console.log.apply(console, arguments); +}; + +/** + * markTime - for debugging, mark the number of milliseconds + * since the previous call to markTime and log arbitrary info too + */ +lib.markTime = function(v) { + if(!lib.VERBOSE) return; + var t2 = new Date().getTime(); + console.log(v, t2 - lib.TIMER, '(msec)'); + if(lib.VERBOSE === 'trace') console.trace(); + lib.TIMER = t2; +}; + // constrain - restrict a number v to be between v0 and v1 lib.constrain = function(v, v0, v1) { if(v0 > v1) return Math.max(v1, Math.min(v0, v)); @@ -61767,17 +61716,18 @@ lib.syncOrAsync = function(sequence, arg, finalStep) { var ret, fni; function continueAsync() { + lib.markTime('async done ' + fni.name); return lib.syncOrAsync(sequence, arg, finalStep); } - while(sequence.length) { fni = sequence.splice(0, 1)[0]; ret = fni(arg); - + // lib.markTime('done calling '+fni.name) if(ret && ret.then) { return ret.then(continueAsync) .then(undefined, lib.promiseError); } + lib.markTime('sync done ' + fni.name); } return finalStep && finalStep(arg); @@ -61928,7 +61878,7 @@ lib.addStyleRule = function(selector, styleString) { else if(styleSheet.addRule) { styleSheet.addRule(selector, styleString, 0); } - else lib.warn('addStyleRule failed'); + else console.warn('addStyleRule failed'); }; lib.getTranslate = function(element) { @@ -62106,7 +62056,7 @@ lib.numSeparate = function(value, separators) { return x1 + x2; }; -},{"./coerce":374,"./dates":375,"./extend":377,"./is_plain_object":383,"./loggers":384,"./matrix":385,"./nested_property":386,"./notifier":387,"./search":390,"./stats":393,"d3":113}],383:[function(require,module,exports){ +},{"./coerce":373,"./dates":374,"./extend":376,"./is_plain_object":382,"./matrix":383,"./nested_property":384,"./notifier":385,"./search":388,"./stats":391,"d3":113}],382:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -62126,74 +62076,7 @@ module.exports = function isPlainObject(obj) { ); }; -},{}],384:[function(require,module,exports){ -/** -* Copyright 2012-2016, Plotly, Inc. -* All rights reserved. -* -* This source code is licensed under the MIT license found in the -* LICENSE file in the root directory of this source tree. -*/ - -'use strict'; - -var config = require('../plot_api/plot_config'); - -var loggers = module.exports = {}; - -/** - * ------------------------------------------ - * debugging tools - * ------------------------------------------ - */ - -/* eslint-disable no-console */ -loggers.log = function() { - if(config.logging > 1) { - var messages = ['LOG:']; - - for(var i = 0; i < arguments.length; i++) { - messages.push(arguments[i]); - } - - if(console.trace) { - console.trace.apply(console, messages); - } else { - console.log.apply(console, messages); - } - } -}; - -loggers.warn = function() { - if(config.logging > 0) { - var messages = ['WARN:']; - - for(var i = 0; i < arguments.length; i++) { - messages.push(arguments[i]); - } - - if(console.trace) { - console.trace.apply(console, messages); - } else { - console.log.apply(console, messages); - } - } -}; - -loggers.error = function() { - if(config.logging > 0) { - var messages = ['ERROR:']; - - for(var i = 0; i < arguments.length; i++) { - messages.push(arguments[i]); - } - - console.error.apply(console, arguments); - } -}; -/* eslint-enable no-console */ - -},{"../plot_api/plot_config":398}],385:[function(require,module,exports){ +},{}],383:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -62303,7 +62186,7 @@ exports.apply2DTransform2 = function(transform) { }; }; -},{}],386:[function(require,module,exports){ +},{}],384:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -62559,7 +62442,7 @@ function badContainer(container, propStr, propParts) { }; } -},{"fast-isnumeric":117}],387:[function(require,module,exports){ +},{"fast-isnumeric":117}],385:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -62636,7 +62519,7 @@ module.exports = function(text, displayLength) { }); }; -},{"d3":113,"fast-isnumeric":117}],388:[function(require,module,exports){ +},{"d3":113,"fast-isnumeric":117}],386:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -62876,7 +62759,7 @@ polygon.filter = function filter(pts, tolerance) { }; }; -},{"./matrix":385}],389:[function(require,module,exports){ +},{"./matrix":383}],387:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -63079,7 +62962,7 @@ queue.plotDo = function(gd, func, args) { module.exports = queue; -},{"../plotly":402}],390:[function(require,module,exports){ +},{"../plotly":400}],388:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -63093,8 +62976,6 @@ module.exports = queue; var isNumeric = require('fast-isnumeric'); -var Lib = require('../lib'); - /** * findBin - find the bin for val - note that it can return outside the @@ -63129,7 +63010,7 @@ exports.findBin = function(val, bins, linelow) { if(test(bins[n], val)) n1 = n + 1; else n2 = n; } - if(c > 90) Lib.log('Long binary search...'); + if(c > 90) console.log('Long binary search...'); return n1 - 1; } }; @@ -63191,7 +63072,7 @@ exports.roundUp = function(val, arrayIn, reverse) { return arrayIn[low]; }; -},{"../lib":382,"fast-isnumeric":117}],391:[function(require,module,exports){ +},{"fast-isnumeric":117}],389:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -63214,7 +63095,7 @@ module.exports = function setCursor(el3, csr) { if(csr) el3.classed('cursor-' + csr, true); }; -},{}],392:[function(require,module,exports){ +},{}],390:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -63263,7 +63144,7 @@ module.exports = function showWebGlMsg(scene) { return false; }; -},{"../components/color":303}],393:[function(require,module,exports){ +},{"../components/color":303}],391:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -63359,7 +63240,7 @@ exports.interp = function(arr, n) { return frac * arr[Math.ceil(n)] + (1 - frac) * arr[Math.floor(n)]; }; -},{"fast-isnumeric":117}],394:[function(require,module,exports){ +},{"fast-isnumeric":117}],392:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -63381,7 +63262,7 @@ function str2RgbaArray(color) { module.exports = str2RgbaArray; -},{"arraytools":49,"tinycolor2":274}],395:[function(require,module,exports){ +},{"arraytools":49,"tinycolor2":274}],393:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -63398,7 +63279,6 @@ module.exports = str2RgbaArray; var Plotly = require('../plotly'); var d3 = require('d3'); -var Lib = require('../lib'); var xmlnsNamespaces = require('../constants/xmlns_namespaces'); var util = module.exports = {}; @@ -63421,7 +63301,7 @@ d3.selection.prototype.appendSVG = function(_svgString) { childNode = childNode.nextSibling; } if(dom.querySelector('parsererror')) { - Lib.log(dom.querySelector('parsererror div').textContent); + console.log(dom.querySelector('parsererror div').textContent); return null; } return d3.select(this.node().lastChild); @@ -63587,7 +63467,7 @@ function texToSVG(_texString, _config, _callback) { var glyphDefs = d3.select('body').select('#MathJax_SVG_glyphs'); if(tmpDiv.select('.MathJax_SVG').empty() || !tmpDiv.select('svg').node()) { - Lib.log('There was an error in the tex syntax.', _texString); + console.log('There was an error in the tex syntax.', _texString); _callback(); } else { @@ -63865,7 +63745,7 @@ util.makeEditable = function(context, _delegate, options) { return d3.rebind(this, dispatch, 'on'); }; -},{"../constants/xmlns_namespaces":370,"../lib":382,"../plotly":402,"d3":113}],396:[function(require,module,exports){ +},{"../constants/xmlns_namespaces":369,"../plotly":400,"d3":113}],394:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -63901,7 +63781,7 @@ topojsonUtils.getTopojsonFeatures = function(trace, topojson) { return topojsonFeature(topojson, obj).features; }; -},{"../plots/geo/constants":424,"topojson":275}],397:[function(require,module,exports){ +},{"../plots/geo/constants":422,"topojson":275}],395:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -63955,6 +63835,7 @@ var xmlnsNamespaces = require('../constants/xmlns_namespaces'); * */ Plotly.plot = function(gd, data, layout, config) { + Lib.markTime('in plot'); gd = getGraphDiv(gd); @@ -63967,7 +63848,7 @@ Plotly.plot = function(gd, data, layout, config) { // if there's no data or layout, and this isn't yet a plotly plot // container, log a warning to help plotly.js users debug if(!data && !layout && !Lib.isPlotDiv(gd)) { - Lib.warn('Calling Plotly.plot as if redrawing ' + + console.log('Warning: calling Plotly.plot as if redrawing ' + 'but this container doesn\'t yet have a plot.', gd); } @@ -64126,9 +64007,11 @@ Plotly.plot = function(gd, data, layout, config) { } } + Lib.markTime('done with bar/box adjustments'); // calc and autorange for errorbars ErrorBars.calc(gd); + Lib.markTime('done ErrorBars.calc'); // TODO: autosize extra for text markers return Lib.syncOrAsync([ @@ -64183,6 +64066,7 @@ Plotly.plot = function(gd, data, layout, config) { // styling separate from drawing Plots.style(gd); + Lib.markTime('done Plots.style'); // show annotations and shapes Shapes.drawAll(gd); @@ -64212,6 +64096,7 @@ Plotly.plot = function(gd, data, layout, config) { function cleanUp() { // now we're REALLY TRULY done plotting... // so mark it as done and let other procedures call a replot + Lib.markTime('done plot'); gd.emit('plotly_afterplot'); } @@ -64443,7 +64328,7 @@ function cleanLayout(layout) { } if(layout.annotations !== undefined && !Array.isArray(layout.annotations)) { - Lib.warn('Annotations must be an array.'); + console.log('annotations must be an array'); delete layout.annotations; } var annotationsLen = (layout.annotations || []).length; @@ -64465,7 +64350,7 @@ function cleanLayout(layout) { } if(layout.shapes !== undefined && !Array.isArray(layout.shapes)) { - Lib.warn('Shapes must be an array.'); + console.log('shapes must be an array'); delete layout.shapes; } var shapesLen = (layout.shapes || []).length; @@ -64540,7 +64425,9 @@ function cleanLayout(layout) { // sanitize rgb(fractions) and rgba(fractions) that old tinycolor // supported, but new tinycolor does not because they're not valid css + Lib.markTime('finished rest of cleanLayout, starting color'); Color.clean(layout); + Lib.markTime('finished cleanLayout color.clean'); return layout; } @@ -64689,7 +64576,9 @@ function cleanData(data, existingData) { // sanitize rgb(fractions) and rgba(fractions) that old tinycolor // supported, but new tinycolor does not because they're not valid css + Lib.markTime('finished rest of cleanData, starting color'); Color.clean(trace); + Lib.markTime('finished cleanData color.clean'); } } @@ -64718,7 +64607,7 @@ Plotly.redraw = function(gd) { gd = getGraphDiv(gd); if(!Lib.isPlotDiv(gd)) { - Lib.warn('This element is not a Plotly plot.', gd); + console.log('This element is not a Plotly Plot', gd); return; } @@ -64793,6 +64682,7 @@ function doCalcdata(gd) { if(!cd[0].t) cd[0].t = {}; cd[0].trace = trace; + Lib.markTime('done with calcdata for ' + i); calcdata[i] = cd; } } @@ -65449,7 +65339,7 @@ Plotly.restyle = function restyle(gd, astr, val, traces) { if(traces === undefined) traces = val; // the 3-arg form } else { - Lib.warn('Restyle fail.', astr, val, traces); + console.log('restyle fail', astr, val, traces); return Promise.reject(); } @@ -65556,7 +65446,7 @@ Plotly.restyle = function restyle(gd, astr, val, traces) { // to not go through a full replot var doPlotWhiteList = ['cartesian', 'pie', 'ternary']; fullLayout._basePlotModules.forEach(function(_module) { - if(doPlotWhiteList.indexOf(_module.name) === -1) docalc = true; + if(doPlotWhiteList.indexOf(_module.name) === -1) doplot = true; }); // make a new empty vals array for undoit @@ -65993,7 +65883,7 @@ Plotly.relayout = function relayout(gd, astr, val) { if(typeof astr === 'string') aobj[astr] = val; else if(Lib.isPlainObject(astr)) aobj = astr; else { - Lib.warn('Relayout fail.', astr, val); + console.log('relayout fail', astr, val); return Promise.reject(); } @@ -66184,7 +66074,7 @@ Plotly.relayout = function relayout(gd, astr, val) { } else undoit[ai] = obji; } - else Lib.log('???', aobj); + else console.log('???', aobj); } if((refAutorange(obji, 'x') || refAutorange(obji, 'y')) && !Lib.containsAny(ai, ['color', 'opacity', 'align', 'dash'])) { @@ -66194,27 +66084,13 @@ Plotly.relayout = function relayout(gd, astr, val) { // as it is we get separate calls for x and y (or ax and ay) on move objModule.draw(gd, objNum, p.parts.slice(2).join('.'), aobj[ai]); delete aobj[ai]; - } - else if(p.parts[0] === 'images') { - var update = Lib.objectFromPath(ai, vi); + } else if(p.parts[0] === 'images') { + var update = Lib.objectFromPath(astr, vi); Lib.extendDeepAll(gd.layout, update); Images.supplyLayoutDefaults(gd.layout, gd._fullLayout); Images.draw(gd); } - else if(p.parts[0] === 'mapbox' && p.parts[1] === 'layers') { - Lib.extendDeepAll(gd.layout, Lib.objectFromPath(ai, vi)); - - // append empty container to mapbox.layers - // so that relinkPrivateKeys does not complain - - var fullLayers = (gd._fullLayout.mapbox || {}).layers || []; - var diff = (p.parts[2] + 1) - fullLayers.length; - - for(i = 0; i < diff; i++) fullLayers.push({}); - - doplot = true; - } // alter gd.layout else { // check whether we can short-circuit a full redraw @@ -66989,7 +66865,7 @@ function drawMainTitle(gd) { }); } -},{"../components/color":303,"../components/drawing":326,"../components/errorbars":332,"../components/images":338,"../components/legend":346,"../components/modebar/manage":350,"../components/rangeselector":357,"../components/rangeslider":362,"../components/shapes":365,"../components/titles":366,"../constants/xmlns_namespaces":370,"../lib":382,"../lib/events":376,"../lib/queue":389,"../plotly":402,"../plots/cartesian/graph_interact":412,"../plots/plots":454,"d3":113,"fast-isnumeric":117,"gl-mat4/fromQuat":134}],398:[function(require,module,exports){ +},{"../components/color":303,"../components/drawing":325,"../components/errorbars":331,"../components/images":337,"../components/legend":345,"../components/modebar/manage":349,"../components/rangeselector":356,"../components/rangeslider":361,"../components/shapes":364,"../components/titles":365,"../constants/xmlns_namespaces":369,"../lib":381,"../lib/events":375,"../lib/queue":387,"../plotly":400,"../plots/cartesian/graph_interact":410,"../plots/plots":452,"d3":113,"fast-isnumeric":117,"gl-mat4/fromQuat":134}],396:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -66998,9 +66874,8 @@ function drawMainTitle(gd) { * LICENSE file in the root directory of this source tree. */ -'use strict'; -var Lib = require('../lib'); +'use strict'; /** * This will be transfered over to gd and overridden by @@ -67076,14 +66951,8 @@ module.exports = { setBackground: defaultSetBackground, // URL to topojson files used in geo charts - topojsonURL: 'https://cdn.plot.ly/', + topojsonURL: 'https://cdn.plot.ly/' - // Mapbox access token (required to plot mapbox trace types) - mapboxAccessToken: null, - - // Turn all console logging on or off (errors will be thrown) - // This should ONLY be set via Plotly.setPlotConfig - logging: false }; // where and how the background gets set can be overridden by context @@ -67092,10 +66961,10 @@ function defaultSetBackground(gd, bgColor) { try { gd._fullLayout._paper.style('background', bgColor); } - catch(e) { Lib.error(e); } + catch(e) { console.log(e); } } -},{"../lib":382}],399:[function(require,module,exports){ +},{}],397:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -67421,7 +67290,7 @@ function handleLinkedToArray(layoutAttributes) { PlotSchema.crawl(layoutAttributes, callback); } -},{"../lib":382,"../plotly":402,"../plots/plots":454,"../plots/polar/area_attributes":455,"../plots/polar/axis_attributes":456}],400:[function(require,module,exports){ +},{"../lib":381,"../plotly":400,"../plots/plots":452,"../plots/polar/area_attributes":453,"../plots/polar/axis_attributes":454}],398:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -67447,7 +67316,7 @@ module.exports = function setPlotConfig(configObj) { return Lib.extendFlat(Plotly.defaultConfig, configObj); }; -},{"../lib":382,"../plotly":402}],401:[function(require,module,exports){ +},{"../lib":381,"../plotly":400}],399:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -67560,7 +67429,7 @@ function toImage(gd, opts) { module.exports = toImage; -},{"../lib":382,"../plotly":402,"../snapshot":471,"fast-isnumeric":117}],402:[function(require,module,exports){ +},{"../lib":381,"../plotly":400,"../snapshot":469,"fast-isnumeric":117}],400:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -67647,7 +67516,7 @@ exports.PlotSchema = require('./plot_api/plot_schema'); // imaging routines exports.Snapshot = require('./snapshot'); -},{"../build/plotcss":1,"./components/annotations":301,"./components/color":303,"./components/colorbar":308,"./components/colorscale":317,"./components/drawing":326,"./components/errorbars":332,"./components/images":338,"./components/legend":346,"./components/modebar":349,"./components/shapes":365,"./fonts/mathjax_config":372,"./lib":382,"./lib/queue":389,"./lib/svg_text_utils":395,"./plot_api/plot_api":397,"./plot_api/plot_config":398,"./plot_api/plot_schema":399,"./plots/cartesian/axes":405,"./plots/cartesian/graph_interact":412,"./plots/plots":454,"./plots/polar/micropolar":457,"./snapshot":471,"./traces/scatter":565,"es6-promise":116}],403:[function(require,module,exports){ +},{"../build/plotcss":1,"./components/annotations":301,"./components/color":303,"./components/colorbar":308,"./components/colorscale":316,"./components/drawing":325,"./components/errorbars":331,"./components/images":337,"./components/legend":345,"./components/modebar":348,"./components/shapes":364,"./fonts/mathjax_config":371,"./lib":381,"./lib/queue":387,"./lib/svg_text_utils":393,"./plot_api/plot_api":395,"./plot_api/plot_config":396,"./plot_api/plot_schema":397,"./plots/cartesian/axes":403,"./plots/cartesian/graph_interact":410,"./plots/plots":452,"./plots/polar/micropolar":455,"./snapshot":469,"./traces/scatter":563,"es6-promise":116}],401:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -67751,7 +67620,7 @@ module.exports = { } }; -},{}],404:[function(require,module,exports){ +},{}],402:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -67790,7 +67659,7 @@ module.exports = { } }; -},{}],405:[function(require,module,exports){ +},{}],403:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -69205,7 +69074,7 @@ axes.doTicks = function(gd, axid, skipTitle) { }; } else { - Lib.warn('Unrecognized doTicks axis:', axid); + console.log('unrecognized doTicks axis', axid); return; } var axside = ax.side || sides[0], @@ -69763,7 +69632,7 @@ function swapAxisAttrs(layout, key, xFullAxes, yFullAxes) { // rather than built-in % which gives a negative value for negative v function mod(v, d) { return ((v % d) + d) % d; } -},{"../../components/color":303,"../../components/drawing":326,"../../components/titles":366,"../../lib":382,"../../lib/svg_text_utils":395,"../../plotly":402,"./axis_ids":407,"./layout_attributes":414,"./layout_defaults":415,"./set_convert":419,"d3":113,"fast-isnumeric":117}],406:[function(require,module,exports){ +},{"../../components/color":303,"../../components/drawing":325,"../../components/titles":365,"../../lib":381,"../../lib/svg_text_utils":393,"../../plotly":400,"./axis_ids":405,"./layout_attributes":412,"./layout_defaults":413,"./set_convert":417,"d3":113,"fast-isnumeric":117}],404:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -70046,7 +69915,7 @@ function category(a) { return curvecats > curvenums * 2; } -},{"../../components/color/attributes":302,"../../lib":382,"../plots":454,"./axis_ids":407,"./category_order_defaults":408,"./clean_datum":409,"./layout_attributes":414,"./ordered_categories":416,"./set_convert":419,"./tick_label_defaults":420,"./tick_mark_defaults":421,"./tick_value_defaults":422,"fast-isnumeric":117,"tinycolor2":274}],407:[function(require,module,exports){ +},{"../../components/color/attributes":302,"../../lib":381,"../plots":452,"./axis_ids":405,"./category_order_defaults":406,"./clean_datum":407,"./layout_attributes":412,"./ordered_categories":414,"./set_convert":417,"./tick_label_defaults":418,"./tick_mark_defaults":419,"./tick_value_defaults":420,"fast-isnumeric":117,"tinycolor2":274}],405:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -70167,7 +70036,7 @@ exports.getFromTrace = function(gd, fullTrace, type) { return ax; }; -},{"../../lib":382,"../plots":454,"./constants":410}],408:[function(require,module,exports){ +},{"../../lib":381,"../plots":452,"./constants":408}],406:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -70201,7 +70070,7 @@ module.exports = function handleCategoryOrderDefaults(containerIn, containerOut, } }; -},{}],409:[function(require,module,exports){ +},{}],407:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -70234,13 +70103,13 @@ module.exports = function cleanDatum(c) { c = c.toString().replace(/['"%,$# ]/g, ''); } catch(e) { - Lib.error(e, c); + console.log(e, c); } return c; }; -},{"../../lib":382,"fast-isnumeric":117}],410:[function(require,module,exports){ +},{"../../lib":381,"fast-isnumeric":117}],408:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -70318,7 +70187,7 @@ module.exports = { REDRAWDELAY: 50 }; -},{}],411:[function(require,module,exports){ +},{}],409:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -70693,7 +70562,7 @@ module.exports = function dragBox(gd, plotinfo, x, y, w, h, ns, ew) { var wheelDelta = -e.deltaY; if(!isFinite(wheelDelta)) wheelDelta = e.wheelDelta / 10; if(!isFinite(wheelDelta)) { - Lib.log('Did not find wheel motion attributes: ', e); + console.log('did not find wheel motion attributes', e); return; } @@ -70990,7 +70859,7 @@ function removeZoombox(gd) { .remove(); } -},{"../../components/color":303,"../../components/dragelement":324,"../../components/drawing":326,"../../lib":382,"../../lib/setcursor":391,"../../lib/svg_text_utils":395,"../../plotly":402,"./axes":405,"./constants":410,"./select":418,"d3":113,"tinycolor2":274}],412:[function(require,module,exports){ +},{"../../components/color":303,"../../components/dragelement":323,"../../components/drawing":325,"../../lib":381,"../../lib/setcursor":389,"../../lib/svg_text_utils":393,"../../plotly":400,"./axes":403,"./constants":408,"./select":416,"d3":113,"tinycolor2":274}],410:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -71303,50 +71172,27 @@ function hover(gd, evt, subplot) { if(!subplot) subplot = 'xy'; - // if the user passed in an array of subplots, - // use those instead of finding overlayed plots - var subplots = Array.isArray(subplot) ? subplot : [subplot]; - var fullLayout = gd._fullLayout, - plots = fullLayout._plots || [], - plotinfo = plots[subplot]; - - // list of all overlaid subplots to look at - if(plotinfo) { - var overlayedSubplots = plotinfo.overlays.map(function(pi) { - return pi.id; - }); - - subplots = subplots.concat(overlayedSubplots); - } - - var len = subplots.length, - xaArray = new Array(len), - yaArray = new Array(len); - - for(var i = 0; i < len; i++) { - var spId = subplots[i]; - - // 'cartesian' case - var plotObj = plots[spId]; - if(plotObj) { - - // TODO make sure that fullLayout_plots axis refs - // get updated properly so that we don't have - // to use Axes.getFromId in general. - - xaArray[i] = Axes.getFromId(gd, plotObj.xaxis._id); - yaArray[i] = Axes.getFromId(gd, plotObj.yaxis._id); - continue; - } - - // other subplot types - var _subplot = fullLayout[spId]._subplot; - xaArray[i] = _subplot.xaxis; - yaArray[i] = _subplot.yaxis; - } - - var hovermode = evt.hovermode || fullLayout.hovermode; + plotinfo = fullLayout._plots[subplot], + + //If the user passed in an array of subplots, use those instead of finding overlayed plots + subplots = Array.isArray(subplot) ? + subplot : + // list of all overlaid subplots to look at + [subplot].concat(plotinfo.overlays + .map(function(pi) { return pi.id; })), + + xaArray = subplots.map(function(spId) { + var ternary = (gd._fullLayout[spId] || {})._ternary; + if(ternary) return ternary.xaxis; + return Axes.getFromId(gd, spId, 'x'); + }), + yaArray = subplots.map(function(spId) { + var ternary = (gd._fullLayout[spId] || {})._ternary; + if(ternary) return ternary.yaxis; + return Axes.getFromId(gd, spId, 'y'); + }), + hovermode = evt.hovermode || fullLayout.hovermode; if(['x', 'y', 'closest'].indexOf(hovermode) === -1 || !gd.calcdata || gd.querySelector('.zoombox') || gd._dragging) { @@ -71440,7 +71286,7 @@ function hover(gd, evt, subplot) { else yvalArray = p2c(yaArray, ypx); if(!isNumeric(xvalArray[0]) || !isNumeric(yvalArray[0])) { - Lib.warn('Plotly.Fx.hover failed', evt, gd); + console.log('Plotly.Fx.hover failed', evt, gd); return dragElement.unhoverRaw(gd, evt); } } @@ -71527,7 +71373,7 @@ function hover(gd, evt, subplot) { } } else { - Lib.log('Unrecognized trace type in hover:', trace); + console.log('unrecognized trace type in hover', trace); } // in closest mode, remove any existing (farther) points @@ -72337,7 +72183,7 @@ fx.inbox = function(v0, v1) { return Infinity; }; -},{"../../components/color":303,"../../components/dragelement":324,"../../components/drawing":326,"../../lib":382,"../../lib/events":376,"../../lib/svg_text_utils":395,"./axes":405,"./constants":410,"./dragbox":411,"d3":113,"fast-isnumeric":117,"tinycolor2":274}],413:[function(require,module,exports){ +},{"../../components/color":303,"../../components/dragelement":323,"../../components/drawing":325,"../../lib":381,"../../lib/events":375,"../../lib/svg_text_utils":393,"./axes":403,"./constants":408,"./dragbox":409,"d3":113,"fast-isnumeric":117,"tinycolor2":274}],411:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -72349,6 +72195,7 @@ fx.inbox = function(v0, v1) { 'use strict'; +var Lib = require('../../lib'); var Plots = require('../plots'); var constants = require('./constants'); @@ -72420,11 +72267,13 @@ exports.plot = function(gd) { // plot all traces of this type on this subplot at once var cdModule = getCdModule(cdSubplot, _module); _module.plot(gd, subplotInfo, cdModule); + + Lib.markTime('done ' + (cdModule[0] && cdModule[0][0].trace.type)); } } }; -},{"../plots":454,"./attributes":404,"./constants":410}],414:[function(require,module,exports){ +},{"../../lib":381,"../plots":452,"./attributes":402,"./constants":408}],412:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -72607,7 +72456,7 @@ module.exports = { description: [ 'Sets the text displayed at the ticks position via `tickvals`.', 'Only has an effect if `tickmode` is set to *array*.', - 'Used with `tickvals`.' + 'Used with `ticktext`.' ].join(' ') }, ticks: { @@ -72937,7 +72786,7 @@ module.exports = { } }; -},{"../../components/color/attributes":302,"../../components/rangeselector/attributes":351,"../../components/rangeslider/attributes":358,"../../lib/extend":377,"../font_attributes":423,"./constants":410}],415:[function(require,module,exports){ +},{"../../components/color/attributes":302,"../../components/rangeselector/attributes":350,"../../components/rangeslider/attributes":357,"../../lib/extend":376,"../font_attributes":421,"./constants":408}],413:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -73110,7 +72959,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) { }); }; -},{"../../components/color":303,"../../components/rangeselector":357,"../../components/rangeslider":362,"../../lib":382,"../plots":454,"./axis_defaults":406,"./axis_ids":407,"./constants":410,"./layout_attributes":414,"./position_defaults":417}],416:[function(require,module,exports){ +},{"../../components/color":303,"../../components/rangeselector":356,"../../components/rangeslider":361,"../../lib":381,"../plots":452,"./axis_defaults":404,"./axis_ids":405,"./constants":408,"./layout_attributes":412,"./position_defaults":415}],414:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -73189,7 +73038,7 @@ module.exports = function orderedCategories(axisLetter, categoryorder, categorya } }; -},{"d3":113}],417:[function(require,module,exports){ +},{"d3":113}],415:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -73254,7 +73103,7 @@ module.exports = function handlePositionDefaults(containerIn, containerOut, coer return containerOut; }; -},{"../../lib":382,"fast-isnumeric":117}],418:[function(require,module,exports){ +},{"../../lib":381,"fast-isnumeric":117}],416:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -73454,7 +73303,7 @@ module.exports = function prepSelect(e, startX, startY, dragOptions, mode) { }; }; -},{"../../components/color":303,"../../lib/polygon":388,"./axes":405,"./constants":410}],419:[function(require,module,exports){ +},{"../../components/color":303,"../../lib/polygon":386,"./axes":403,"./constants":408}],417:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -73624,7 +73473,7 @@ module.exports = function setConvert(ax) { ax.range[1] = ar1[1]; } } - catch(e) { Lib.error(e, ax.range); } + catch(e) { console.log(e, ax.range); } } } else if(ax.type === 'category') { @@ -73698,7 +73547,7 @@ module.exports = function setConvert(ax) { ax._forceTick0 = null; }; -},{"../../lib":382,"./axis_ids":407,"./clean_datum":409,"./constants":410,"d3":113,"fast-isnumeric":117}],420:[function(require,module,exports){ +},{"../../lib":381,"./axis_ids":405,"./clean_datum":407,"./constants":408,"d3":113,"fast-isnumeric":117}],418:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -73781,7 +73630,7 @@ function getShowAttrDflt(containerIn) { } } -},{"../../lib":382}],421:[function(require,module,exports){ +},{"../../lib":381}],419:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -73814,7 +73663,7 @@ module.exports = function handleTickDefaults(containerIn, containerOut, coerce, } }; -},{"../../lib":382,"./layout_attributes":414}],422:[function(require,module,exports){ +},{"../../lib":381,"./layout_attributes":412}],420:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -73855,7 +73704,7 @@ module.exports = function handleTickValueDefaults(containerIn, containerOut, coe } }; -},{"fast-isnumeric":117}],423:[function(require,module,exports){ +},{"fast-isnumeric":117}],421:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -73897,7 +73746,7 @@ module.exports = { } }; -},{}],424:[function(require,module,exports){ +},{}],422:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -74055,7 +73904,7 @@ params.layerNameToAdjective = { // base layers drawn over choropleth params.baseLayersOverChoropleth = ['rivers', 'lakes']; -},{}],425:[function(require,module,exports){ +},{}],423:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -74549,7 +74398,7 @@ function createMockAxis(fullLayout) { return mockAxis; } -},{"../../components/color":303,"../../components/drawing":326,"../../constants/xmlns_namespaces":370,"../../lib/filter_visible":378,"../../lib/topojson_utils":396,"../../plots/cartesian/axes":405,"./constants":424,"./projections":432,"./set_scale":433,"./zoom":434,"./zoom_reset":435,"d3":113,"topojson":275}],426:[function(require,module,exports){ +},{"../../components/color":303,"../../components/drawing":325,"../../constants/xmlns_namespaces":369,"../../lib/filter_visible":377,"../../lib/topojson_utils":394,"../../plots/cartesian/axes":403,"./constants":422,"./projections":430,"./set_scale":431,"./zoom":432,"./zoom_reset":433,"d3":113,"topojson":275}],424:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -74655,7 +74504,7 @@ exports.toSVG = function(gd) { } }; -},{"../../plots/plots":454,"./geo":425,"./layout/attributes":427,"./layout/defaults":430,"./layout/layout_attributes":431}],427:[function(require,module,exports){ +},{"../../plots/plots":452,"./geo":423,"./layout/attributes":425,"./layout/defaults":428,"./layout/layout_attributes":429}],425:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -74683,7 +74532,7 @@ module.exports = { } }; -},{}],428:[function(require,module,exports){ +},{}],426:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -74746,7 +74595,7 @@ module.exports = { } }; -},{"../../../components/color/attributes":302}],429:[function(require,module,exports){ +},{"../../../components/color/attributes":302}],427:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -74820,7 +74669,7 @@ module.exports = function supplyGeoAxisLayoutDefaults(geoLayoutIn, geoLayoutOut) } }; -},{"../../../lib":382,"../constants":424,"./axis_attributes":428}],430:[function(require,module,exports){ +},{"../../../lib":381,"../constants":422,"./axis_attributes":426}],428:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -74939,7 +74788,7 @@ function handleGeoDefaults(geoLayoutIn, geoLayoutOut, coerce) { ]; } -},{"../../subplot_defaults":460,"../constants":424,"./axis_defaults":429,"./layout_attributes":431}],431:[function(require,module,exports){ +},{"../../subplot_defaults":458,"../constants":422,"./axis_defaults":427,"./layout_attributes":429}],429:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -75198,7 +75047,7 @@ module.exports = { lataxis: geoAxesAttrs }; -},{"../../../components/color/attributes":302,"../constants":424,"./axis_attributes":428}],432:[function(require,module,exports){ +},{"../../../components/color/attributes":302,"../constants":422,"./axis_attributes":426}],430:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -75644,7 +75493,7 @@ function addProjectionsToD3(d3) { module.exports = addProjectionsToD3; -},{}],433:[function(require,module,exports){ +},{}],431:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -75658,7 +75507,7 @@ module.exports = addProjectionsToD3; var d3 = require('d3'); -var clipPad = require('./constants').clipPad; +var clipPad = require('./constants/').clipPad; function createGeoScale(geoLayout, graphSize) { var projLayout = geoLayout.projection, @@ -75795,7 +75644,7 @@ function getBounds(projection, rangeBox) { return d3.geo.path().projection(projection).bounds(rangeBox); } -},{"./constants":424,"d3":113}],434:[function(require,module,exports){ +},{"./constants/":422,"d3":113}],432:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -76222,7 +76071,7 @@ function d3_eventDispatch(target) { return dispatch; } -},{"d3":113}],435:[function(require,module,exports){ +},{"d3":113}],433:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -76257,7 +76106,7 @@ function createGeoZoomReset(geo, geoLayout) { module.exports = createGeoZoomReset; -},{"../cartesian/graph_interact":412}],436:[function(require,module,exports){ +},{"../cartesian/graph_interact":410}],434:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -76412,7 +76261,7 @@ function createCamera(scene) { return result; } -},{"mouse-change":241,"mouse-wheel":245}],437:[function(require,module,exports){ +},{"mouse-change":241,"mouse-wheel":245}],435:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -76655,7 +76504,7 @@ function createAxes2D(scene) { module.exports = createAxes2D; -},{"../../lib/html2unicode":381,"../../lib/str2rgbarray":394,"../../plotly":402}],438:[function(require,module,exports){ +},{"../../lib/html2unicode":380,"../../lib/str2rgbarray":392,"../../plotly":400}],436:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -76768,7 +76617,7 @@ exports.toSVG = function(gd) { } }; -},{"../../constants/xmlns_namespaces":370,"../cartesian/attributes":404,"../plots":454,"./scene2d":439}],439:[function(require,module,exports){ +},{"../../constants/xmlns_namespaces":369,"../cartesian/attributes":402,"../plots":452,"./scene2d":437}],437:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -77305,7 +77154,7 @@ proto.hoverFormatter = function(axisName, val) { return Axes.tickText(axis, axis.c2l(val), 'hover').text; }; -},{"../../lib/html2unicode":381,"../../lib/show_no_webgl_msg":392,"../../plots/cartesian/axes":405,"../../plots/cartesian/graph_interact":412,"./camera":436,"./convert":437,"gl-plot2d":165,"gl-select-box":195,"gl-spikes2d":215}],440:[function(require,module,exports){ +},{"../../lib/html2unicode":380,"../../lib/show_no_webgl_msg":390,"../../plots/cartesian/axes":403,"../../plots/cartesian/graph_interact":410,"./camera":434,"./convert":435,"gl-plot2d":165,"gl-select-box":195,"gl-spikes2d":215}],438:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -77548,7 +77397,7 @@ function createCamera(element, options) { return camera; } -},{"3d-view":39,"mouse-change":241,"mouse-wheel":245,"right-now":255}],441:[function(require,module,exports){ +},{"3d-view":39,"mouse-change":241,"mouse-wheel":245,"right-now":255}],439:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -77682,7 +77531,7 @@ function initAxes(gd, sceneLayout) { } } -},{"../../constants/xmlns_namespaces":370,"../plots":454,"./layout/attributes":442,"./layout/defaults":446,"./layout/layout_attributes":447,"./scene":451,"./set_convert":452}],442:[function(require,module,exports){ +},{"../../constants/xmlns_namespaces":369,"../plots":452,"./layout/attributes":440,"./layout/defaults":444,"./layout/layout_attributes":445,"./scene":449,"./set_convert":450}],440:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -77710,7 +77559,7 @@ module.exports = { } }; -},{}],443:[function(require,module,exports){ +},{}],441:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -77826,7 +77675,7 @@ module.exports = { zerolinewidth: axesAttrs.zerolinewidth }; -},{"../../../components/color":303,"../../../lib/extend":377,"../../cartesian/layout_attributes":414}],444:[function(require,module,exports){ +},{"../../../components/color":303,"../../../lib/extend":376,"../../cartesian/layout_attributes":412}],442:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -77895,7 +77744,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, options) { } }; -},{"../../../lib":382,"../../cartesian/axis_defaults":406,"./axis_attributes":443,"tinycolor2":274}],445:[function(require,module,exports){ +},{"../../../lib":381,"../../cartesian/axis_defaults":404,"./axis_attributes":441,"tinycolor2":274}],443:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -78051,7 +77900,7 @@ function createAxesOptions(plotlyOptions) { module.exports = createAxesOptions; -},{"../../../lib/html2unicode":381,"../../../lib/str2rgbarray":394,"arraytools":49}],446:[function(require,module,exports){ +},{"../../../lib/html2unicode":380,"../../../lib/str2rgbarray":392,"arraytools":49}],444:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -78158,7 +78007,7 @@ function handleGl3dDefaults(sceneLayoutIn, sceneLayoutOut, coerce, opts) { coerce('hovermode', opts.getDfltFromLayout('hovermode')); } -},{"../../../components/color":303,"../../subplot_defaults":460,"./axis_defaults":444,"./layout_attributes":447}],447:[function(require,module,exports){ +},{"../../../components/color":303,"../../subplot_defaults":458,"./axis_defaults":442,"./layout_attributes":445}],445:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -78328,7 +78177,7 @@ module.exports = { } }; -},{"../../../lib/extend":377,"./axis_attributes":443}],448:[function(require,module,exports){ +},{"../../../lib/extend":376,"./axis_attributes":441}],446:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -78374,7 +78223,7 @@ function createSpikeOptions(layout) { module.exports = createSpikeOptions; -},{"../../../lib/str2rgbarray":394}],449:[function(require,module,exports){ +},{"../../../lib/str2rgbarray":392}],447:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -78469,7 +78318,7 @@ function computeTickMarks(scene) { scene.contourLevels = contourLevelsFromTicks(ticks); } -},{"../../../lib/html2unicode":381,"../../../plotly":402}],450:[function(require,module,exports){ +},{"../../../lib/html2unicode":380,"../../../plotly":400}],448:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -78503,7 +78352,7 @@ function project(camera, v) { module.exports = project; -},{}],451:[function(require,module,exports){ +},{}],449:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -78689,7 +78538,7 @@ function initializeGLPlot(scene, fullLayout, canvas, gl) { if(!scene.staticMode) { scene.glplot.canvas.addEventListener('webglcontextlost', function(ev) { - Lib.warn('Lost WebGL context.'); + console.log('lost context'); ev.preventDefault(); }); } @@ -78787,7 +78636,7 @@ proto.recoverContext = function() { return; } if(!initializeGLPlot(scene, scene.fullLayout, canvas, gl)) { - Lib.error('Catastrophic and unrecoverable WebGL error. Context lost.'); + console.error('catastrophic/unrecoverable webgl error. context lost.'); return; } scene.plot.apply(scene, scene.plotArgs); @@ -79232,7 +79081,7 @@ proto.toImage = function(format) { module.exports = Scene; -},{"../../lib":382,"../../lib/show_no_webgl_msg":392,"../../lib/str2rgbarray":394,"../../plots/cartesian/axes":405,"../../plots/cartesian/graph_interact":412,"../../plots/plots":454,"./camera":440,"./layout/convert":445,"./layout/spikes":448,"./layout/tick_marks":449,"./project":450,"./set_convert":452,"gl-plot3d":183}],452:[function(require,module,exports){ +},{"../../lib":381,"../../lib/show_no_webgl_msg":390,"../../lib/str2rgbarray":392,"../../plots/cartesian/axes":403,"../../plots/cartesian/graph_interact":410,"../../plots/plots":452,"./camera":438,"./layout/convert":443,"./layout/spikes":446,"./layout/tick_marks":447,"./project":448,"./set_convert":450,"gl-plot3d":183}],450:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -79254,7 +79103,7 @@ module.exports = function setConvert(containerOut) { containerOut.setScale = noop; }; -},{"../cartesian/axes":405}],453:[function(require,module,exports){ +},{"../cartesian/axes":403}],451:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -79440,12 +79289,11 @@ module.exports = { 'annotations': 'Annotations', 'shapes': 'Shapes', 'images': 'Images', - 'ternary': 'ternary', - 'mapbox': 'mapbox' + 'ternary': 'ternary' } }; -},{"../components/color/attributes":302,"../plotly":402,"./font_attributes":423}],454:[function(require,module,exports){ +},{"../components/color/attributes":302,"../plotly":400,"./font_attributes":421}],452:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -79490,7 +79338,7 @@ plots.fontWeight = 'normal'; */ plots.register = function(_module, thisType, categoriesIn, meta) { if(modules[thisType]) { - Lib.log('Type ' + thisType + ' already registered'); + console.log('type ' + thisType + ' already registered'); return; } @@ -79519,7 +79367,7 @@ function getTraceType(traceType) { plots.getModule = function(trace) { if(trace.r !== undefined) { - Lib.warn('Tried to put a polar trace ' + + console.log('Oops, tried to put a polar trace ' + 'on an incompatible graph of cartesian ' + 'data. Ignoring this dataset.', trace ); @@ -79547,7 +79395,7 @@ plots.traceIs = function traceIs(traceType, category) { if(!_module) { if(traceType !== undefined) { - Lib.log('Unrecognized trace type ' + traceType + '.'); + console.warn('unrecognized trace type ' + traceType); } _module = modules[plots.attributes.type.dflt]; } @@ -79581,7 +79429,7 @@ plots.registerSubplot = function(_module) { var plotType = _module.name; if(subplotsRegistry[plotType]) { - Lib.log('Plot type ' + plotType + ' already registered.'); + console.log('plot type ' + plotType + ' already registered'); return; } @@ -80551,7 +80399,7 @@ plots.graphJson = function(gd, dataonly, mode, output, useDefaults) { return (output === 'object') ? obj : JSON.stringify(obj); }; -},{"../components/color":303,"../lib":382,"../plotly":402,"./attributes":403,"./font_attributes":423,"./layout_attributes":453,"d3":113,"fast-isnumeric":117}],455:[function(require,module,exports){ +},{"../components/color":303,"../lib":381,"../plotly":400,"./attributes":401,"./font_attributes":421,"./layout_attributes":451,"d3":113,"fast-isnumeric":117}],453:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -80576,7 +80424,7 @@ module.exports = { } }; -},{"../../traces/scatter/attributes":556}],456:[function(require,module,exports){ +},{"../../traces/scatter/attributes":554}],454:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -80726,7 +80574,7 @@ module.exports = { } }; -},{"../../lib/extend":377,"../cartesian/layout_attributes":414}],457:[function(require,module,exports){ +},{"../../lib/extend":376,"../cartesian/layout_attributes":412}],455:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -82149,7 +81997,7 @@ var extendDeepAll = Plotly.Lib.extendDeepAll; return exports; }; -},{"../../plotly":402,"./micropolar_manager":458,"d3":113}],458:[function(require,module,exports){ +},{"../../plotly":400,"./micropolar_manager":456,"d3":113}],456:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -82202,9 +82050,11 @@ manager.framework = function(_gd) { (function(_configClone, _previousConfigClone) { undoManager.add({ undo: function() { + //console.log('undo', _previousConfigClone); if(_previousConfigClone) that(_previousConfigClone); }, redo: function() { + //console.log('redo', _configClone); that(_configClone); } }); @@ -82232,7 +82082,7 @@ manager.fillLayout = function(_gd) { _gd._fullLayout = extendDeepAll(dflts, _gd.layout); }; -},{"../../plotly":402,"./undo_manager":459,"d3":113}],459:[function(require,module,exports){ +},{"../../plotly":400,"./undo_manager":457,"d3":113}],457:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -82298,7 +82148,7 @@ module.exports = function UndoManager() { }; }; -},{}],460:[function(require,module,exports){ +},{}],458:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -82373,7 +82223,7 @@ module.exports = function handleSubplotDefaults(layoutIn, layoutOut, fullData, o } }; -},{"../lib":382,"./plots":454}],461:[function(require,module,exports){ +},{"../lib":381,"./plots":452}],459:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -82414,7 +82264,7 @@ exports.plot = function plotTernary(gd) { for(var i = 0; i < ternaryIds.length; i++) { var ternaryId = ternaryIds[i], fullTernaryData = Plots.getSubplotData(fullData, 'ternary', ternaryId), - ternary = fullLayout[ternaryId]._subplot; + ternary = fullLayout[ternaryId]._ternary; // If ternary is not instantiated, create one! if(ternary === undefined) { @@ -82426,7 +82276,7 @@ exports.plot = function plotTernary(gd) { fullLayout ); - fullLayout[ternaryId]._subplot = ternary; + fullLayout[ternaryId]._ternary = ternary; } ternary.plot(fullTernaryData, fullLayout, gd._promises); @@ -82438,7 +82288,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) for(var i = 0; i < oldTernaryKeys.length; i++) { var oldTernaryKey = oldTernaryKeys[i]; - var oldTernary = oldFullLayout[oldTernaryKey]._subplot; + var oldTernary = oldFullLayout[oldTernaryKey]._ternary; if(!newFullLayout[oldTernaryKey] && !!oldTernary) { oldTernary.plotContainer.remove(); @@ -82447,7 +82297,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) } }; -},{"../../plots/plots":454,"./layout/attributes":462,"./layout/defaults":465,"./layout/layout_attributes":466,"./ternary":467}],462:[function(require,module,exports){ +},{"../../plots/plots":452,"./layout/attributes":460,"./layout/defaults":463,"./layout/layout_attributes":464,"./ternary":465}],460:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -82473,7 +82323,7 @@ module.exports = { } }; -},{}],463:[function(require,module,exports){ +},{}],461:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -82537,7 +82387,7 @@ module.exports = { } }; -},{"../../../lib/extend":377,"../../cartesian/layout_attributes":414}],464:[function(require,module,exports){ +},{"../../../lib/extend":376,"../../cartesian/layout_attributes":412}],462:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -82621,7 +82471,7 @@ module.exports = function supplyLayoutDefaults(containerIn, containerOut, option } }; -},{"../../../lib":382,"../../cartesian/tick_label_defaults":420,"../../cartesian/tick_mark_defaults":421,"../../cartesian/tick_value_defaults":422,"./axis_attributes":463,"tinycolor2":274}],465:[function(require,module,exports){ +},{"../../../lib":381,"../../cartesian/tick_label_defaults":418,"../../cartesian/tick_mark_defaults":419,"../../cartesian/tick_value_defaults":420,"./axis_attributes":461,"tinycolor2":274}],463:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -82684,7 +82534,7 @@ function handleTernaryDefaults(ternaryLayoutIn, ternaryLayoutOut, coerce, option } } -},{"../../../components/color":303,"../../subplot_defaults":460,"./axis_defaults":464,"./layout_attributes":466}],466:[function(require,module,exports){ +},{"../../../components/color":303,"../../subplot_defaults":458,"./axis_defaults":462,"./layout_attributes":464}],464:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -82749,7 +82599,7 @@ module.exports = { caxis: ternaryAxesAttrs }; -},{"../../../components/color/attributes":302,"./axis_attributes":463}],467:[function(require,module,exports){ +},{"../../../components/color/attributes":302,"./axis_attributes":461}],465:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -83427,6 +83277,19 @@ proto.initInteractions = function() { dragger.onclick = function(evt) { fx.click(gd, evt); }; + + // make a fake plotinfo for fx.hover + // it hardly uses it, could probably be refactored out... + // but specifying subplot by name does seem nice for js applications + // that want to hook into this. + if(!gd._fullLayout._plots) gd._fullLayout._plots = {}; + gd._fullLayout._plots[_this.id] = { + overlays: [], + xaxis: _this.xaxis, + yaxis: _this.yaxis, + x: function() { return _this.xaxis; }, + y: function() { return _this.yaxis; } + }; }; function removeZoombox(gd) { @@ -83435,7 +83298,7 @@ function removeZoombox(gd) { .remove(); } -},{"../../components/color":303,"../../components/dragelement":324,"../../components/drawing":326,"../../components/titles":366,"../../lib":382,"../../lib/extend":377,"../../lib/filter_visible":378,"../../plotly":402,"../cartesian/axes":405,"../cartesian/constants":410,"../cartesian/graph_interact":412,"../cartesian/select":418,"../cartesian/set_convert":419,"d3":113,"tinycolor2":274}],468:[function(require,module,exports){ +},{"../../components/color":303,"../../components/dragelement":323,"../../components/drawing":325,"../../components/titles":365,"../../lib":381,"../../lib/extend":376,"../../lib/filter_visible":377,"../../plotly":400,"../cartesian/axes":403,"../cartesian/constants":408,"../cartesian/graph_interact":410,"../cartesian/select":416,"../cartesian/set_convert":417,"d3":113,"tinycolor2":274}],466:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -83591,7 +83454,7 @@ module.exports = function clonePlot(graphObj, options) { return plotTile; }; -},{"../plotly":402}],469:[function(require,module,exports){ +},{"../plotly":400}],467:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -83657,7 +83520,7 @@ function downloadImage(gd, opts) { module.exports = downloadImage; -},{"../lib":382,"../plot_api/to_image":401,"./filesaver":470}],470:[function(require,module,exports){ +},{"../lib":381,"../plot_api/to_image":399,"./filesaver":468}],468:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -83725,7 +83588,7 @@ var fileSaver = function(url, name) { module.exports = fileSaver; -},{}],471:[function(require,module,exports){ +},{}],469:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -83770,7 +83633,7 @@ var Snapshot = { module.exports = Snapshot; -},{"./cloneplot":468,"./download":469,"./svgtoimg":472,"./toimage":473,"./tosvg":474}],472:[function(require,module,exports){ +},{"./cloneplot":466,"./download":467,"./svgtoimg":470,"./toimage":471,"./tosvg":472}],470:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -83859,7 +83722,7 @@ function svgToImg(opts) { imgData = canvas.toDataURL('image/webp'); break; case 'svg': - imgData = url; + imgData = svg; break; default: reject(new Error('Image format is not jpeg, png or svg')); @@ -83901,7 +83764,7 @@ function svgToImg(opts) { module.exports = svgToImg; -},{"../lib":382,"events":55}],473:[function(require,module,exports){ +},{"../lib":381,"events":55}],471:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -83980,7 +83843,7 @@ function toImage(gd, opts) { module.exports = toImage; -},{"../lib":382,"../plotly":402,"events":55}],474:[function(require,module,exports){ +},{"../lib":381,"../plotly":400,"events":55}],472:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -84061,12 +83924,24 @@ module.exports = function toSVG(gd, format) { return; } - // Font family styles break things because of quotation marks, - // so we must remove them *after* the SVG DOM has been serialized - // to a string (browsers convert singles back) + // I've seen font-family styles with non-escaped double quotes in them - breaks the + // serialized svg because the style attribute itself is double-quoted! + // Is this an IE thing? Any other attributes or style elements that can have quotes in them? + // TODO: this looks like a noop right now - what happened to it? + + /* + * Font-family styles with double quotes in them breaks the to-image + * step in FF42 because the style attribute itself is wrapped in + * double quotes. See: + * + * - http://codepen.io/etpinard/pen/bEdQWK + * - https://github.com/plotly/plotly.js/pull/104 + * + * for more info. + */ var ff = txt.style('font-family'); if(ff && ff.indexOf('"') !== -1) { - txt.style('font-family', ff.replace(/"/g, 'TOBESTRIPPED')); + txt.style('font-family', ff.replace(/"/g, '\\\'')); } }); @@ -84086,13 +83961,10 @@ module.exports = function toSVG(gd, format) { s = svgTextUtils.html_entity_decode(s); s = svgTextUtils.xml_entity_encode(s); - // Fix quotations around font strings - s = s.replace(/("TOBESTRIPPED)|(TOBESTRIPPED")/g, '\''); - return s; }; -},{"../components/color":303,"../components/drawing":326,"../constants/xmlns_namespaces":370,"../lib/svg_text_utils":395,"d3":113}],475:[function(require,module,exports){ +},{"../components/color":303,"../components/drawing":325,"../constants/xmlns_namespaces":369,"../lib/svg_text_utils":393,"d3":113}],473:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -84120,7 +83992,7 @@ module.exports = function arraysToCalcdata(cd) { mergeArray(markerLine.width, cd, 'mlw'); }; -},{"../../lib":382}],476:[function(require,module,exports){ +},{"../../lib":381}],474:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -84131,12 +84003,10 @@ module.exports = function arraysToCalcdata(cd) { 'use strict'; -var scatterAttrs = require('../scatter/attributes'); -var colorAttributes = require('../../components/colorscale/color_attributes'); -var extendFlat = require('../../lib/extend').extendFlat; +var scatterAttrs = require('../scatter/attributes'), + scatterMarkerAttrs = scatterAttrs.marker, + scatterMarkerLineAttrs = scatterMarkerAttrs.line; -var scatterMarkerAttrs = scatterAttrs.marker; -var scatterMarkerLineAttrs = scatterMarkerAttrs.line; module.exports = { x: scatterAttrs.x, @@ -84156,14 +84026,26 @@ module.exports = { 'along the vertical (horizontal).' ].join(' ') }, - marker: extendFlat({}, { + marker: { + color: scatterMarkerAttrs.color, + colorscale: scatterMarkerAttrs.colorscale, + cauto: scatterMarkerAttrs.cauto, + cmax: scatterMarkerAttrs.cmax, + cmin: scatterMarkerAttrs.cmin, + autocolorscale: scatterMarkerAttrs.autocolorscale, + reversescale: scatterMarkerAttrs.reversescale, showscale: scatterMarkerAttrs.showscale, - line: extendFlat({}, - {width: scatterMarkerLineAttrs.width}, - colorAttributes('marker.line') - )}, - colorAttributes('marker') - ), + line: { + color: scatterMarkerLineAttrs.color, + colorscale: scatterMarkerLineAttrs.colorscale, + cauto: scatterMarkerLineAttrs.cauto, + cmax: scatterMarkerLineAttrs.cmax, + cmin: scatterMarkerLineAttrs.cmin, + width: scatterMarkerLineAttrs.width, + autocolorscale: scatterMarkerLineAttrs.autocolorscale, + reversescale: scatterMarkerLineAttrs.reversescale + } + }, r: scatterAttrs.r, t: scatterAttrs.t, @@ -84184,7 +84066,7 @@ module.exports = { } }; -},{"../../components/colorscale/color_attributes":311,"../../lib/extend":377,"../scatter/attributes":556}],477:[function(require,module,exports){ +},{"../scatter/attributes":554}],475:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -84243,7 +84125,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../../components/colorscale/calc":310,"../../components/colorscale/has_colorscale":316,"../../plots/cartesian/axes":405,"fast-isnumeric":117}],478:[function(require,module,exports){ +},{"../../components/colorscale/calc":310,"../../components/colorscale/has_colorscale":315,"../../plots/cartesian/axes":403,"fast-isnumeric":117}],476:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -84285,7 +84167,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout errorBarsSupplyDefaults(traceIn, traceOut, Color.defaultLine, {axis: 'x', inherit: 'y'}); }; -},{"../../components/color":303,"../../components/errorbars/defaults":331,"../../lib":382,"../bar/style_defaults":486,"../scatter/xy_defaults":577,"./attributes":476}],479:[function(require,module,exports){ +},{"../../components/color":303,"../../components/errorbars/defaults":330,"../../lib":381,"../bar/style_defaults":484,"../scatter/xy_defaults":575,"./attributes":474}],477:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -84376,7 +84258,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) { return [pointData]; }; -},{"../../components/color":303,"../../components/errorbars":332,"../../plots/cartesian/graph_interact":412}],480:[function(require,module,exports){ +},{"../../components/color":303,"../../components/errorbars":331,"../../plots/cartesian/graph_interact":410}],478:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -84417,7 +84299,7 @@ Bar.meta = { module.exports = Bar; -},{"../../plots/cartesian":413,"../scatter/colorbar":559,"./arrays_to_calcdata":475,"./attributes":476,"./calc":477,"./defaults":478,"./hover":479,"./layout_attributes":481,"./layout_defaults":482,"./plot":483,"./set_positions":484,"./style":485}],481:[function(require,module,exports){ +},{"../../plots/cartesian":411,"../scatter/colorbar":557,"./arrays_to_calcdata":473,"./attributes":474,"./calc":475,"./defaults":476,"./hover":477,"./layout_attributes":479,"./layout_defaults":480,"./plot":481,"./set_positions":482,"./style":483}],479:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -84482,7 +84364,7 @@ module.exports = { } }; -},{}],482:[function(require,module,exports){ +},{}],480:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -84540,7 +84422,7 @@ module.exports = function(layoutIn, layoutOut, fullData) { coerce('bargroupgap'); }; -},{"../../lib":382,"../../plots/cartesian/axes":405,"../../plots/plots":454,"./layout_attributes":481}],483:[function(require,module,exports){ +},{"../../lib":381,"../../plots/cartesian/axes":403,"../../plots/plots":452,"./layout_attributes":479}],481:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -84652,7 +84534,7 @@ module.exports = function plot(gd, plotinfo, cdbar) { }; -},{"../../components/color":303,"../../components/errorbars":332,"../../lib":382,"./arrays_to_calcdata":475,"d3":113,"fast-isnumeric":117}],484:[function(require,module,exports){ +},{"../../components/color":303,"../../components/errorbars":331,"../../lib":381,"./arrays_to_calcdata":473,"d3":113,"fast-isnumeric":117}],482:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -84866,7 +84748,7 @@ module.exports = function setPositions(gd, plotinfo) { }); }; -},{"../../lib":382,"../../plots/cartesian/axes":405,"../../plots/plots":454,"fast-isnumeric":117}],485:[function(require,module,exports){ +},{"../../lib":381,"../../plots/cartesian/axes":403,"../../plots/plots":452,"fast-isnumeric":117}],483:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -84945,7 +84827,7 @@ module.exports = function style(gd) { s.call(ErrorBars.style); }; -},{"../../components/color":303,"../../components/drawing":326,"../../components/errorbars":332,"d3":113}],486:[function(require,module,exports){ +},{"../../components/color":303,"../../components/drawing":325,"../../components/errorbars":331,"d3":113}],484:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -84982,7 +84864,7 @@ module.exports = function handleStyleDefaults(traceIn, traceOut, coerce, default coerce('marker.line.width'); }; -},{"../../components/color":303,"../../components/colorscale/defaults":313,"../../components/colorscale/has_colorscale":316}],487:[function(require,module,exports){ +},{"../../components/color":303,"../../components/colorscale/defaults":312,"../../components/colorscale/has_colorscale":315}],485:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -85160,7 +85042,7 @@ module.exports = { fillcolor: scatterAttrs.fillcolor }; -},{"../../components/color/attributes":302,"../../lib/extend":377,"../scatter/attributes":556}],488:[function(require,module,exports){ +},{"../../components/color/attributes":302,"../../lib/extend":376,"../scatter/attributes":554}],486:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -85309,7 +85191,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../../lib":382,"../../plots/cartesian/axes":405,"fast-isnumeric":117}],489:[function(require,module,exports){ +},{"../../lib":381,"../../plots/cartesian/axes":403,"fast-isnumeric":117}],487:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -85378,7 +85260,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor) { } }; -},{"../../components/color":303,"../../lib":382,"./attributes":487}],490:[function(require,module,exports){ +},{"../../components/color":303,"../../lib":381,"./attributes":485}],488:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -85487,7 +85369,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) { return closeData; }; -},{"../../components/color":303,"../../lib":382,"../../plots/cartesian/axes":405,"../../plots/cartesian/graph_interact":412}],491:[function(require,module,exports){ +},{"../../components/color":303,"../../lib":381,"../../plots/cartesian/axes":403,"../../plots/cartesian/graph_interact":410}],489:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -85533,7 +85415,7 @@ Box.meta = { module.exports = Box; -},{"../../plots/cartesian":413,"./attributes":487,"./calc":488,"./defaults":489,"./hover":490,"./layout_attributes":492,"./layout_defaults":493,"./plot":494,"./set_positions":495,"./style":496}],492:[function(require,module,exports){ +},{"../../plots/cartesian":411,"./attributes":485,"./calc":486,"./defaults":487,"./hover":488,"./layout_attributes":490,"./layout_defaults":491,"./plot":492,"./set_positions":493,"./style":494}],490:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -85584,7 +85466,7 @@ module.exports = { } }; -},{}],493:[function(require,module,exports){ +},{}],491:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -85618,7 +85500,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) { coerce('boxgroupgap'); }; -},{"../../lib":382,"../../plots/plots":454,"./layout_attributes":492}],494:[function(require,module,exports){ +},{"../../lib":381,"../../plots/plots":452,"./layout_attributes":490}],492:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -85845,7 +85727,7 @@ module.exports = function plot(gd, plotinfo, cdbox) { }); }; -},{"../../components/drawing":326,"../../lib":382,"d3":113}],495:[function(require,module,exports){ +},{"../../components/drawing":325,"../../lib":381,"d3":113}],493:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -85938,7 +85820,7 @@ module.exports = function setPositions(gd, plotinfo) { } }; -},{"../../lib":382,"../../plots/cartesian/axes":405,"../../plots/plots":454}],496:[function(require,module,exports){ +},{"../../lib":381,"../../plots/cartesian/axes":403,"../../plots/plots":452}],494:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -85977,7 +85859,7 @@ module.exports = function style(gd) { }); }; -},{"../../components/color":303,"../../components/drawing":326,"d3":113}],497:[function(require,module,exports){ +},{"../../components/color":303,"../../components/drawing":325,"d3":113}],495:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -85995,7 +85877,7 @@ var extendFlat = require('../../lib/extend').extendFlat; var ScatterGeoMarkerLineAttrs = ScatterGeoAttrs.marker.line; -module.exports = extendFlat({}, { +module.exports = { locations: { valType: 'data_array', description: [ @@ -86018,17 +85900,22 @@ module.exports = extendFlat({}, { width: ScatterGeoMarkerLineAttrs.width } }, + zauto: colorscaleAttrs.zauto, + zmin: colorscaleAttrs.zmin, + zmax: colorscaleAttrs.zmax, + colorscale: colorscaleAttrs.colorscale, + autocolorscale: colorscaleAttrs.autocolorscale, + reversescale: colorscaleAttrs.reversescale, + showscale: colorscaleAttrs.showscale, hoverinfo: extendFlat({}, plotAttrs.hoverinfo, { flags: ['location', 'z', 'text', 'name'] }), _nestedModules: { 'colorbar': 'Colorbar' } -}, - colorscaleAttrs -); +}; -},{"../../components/colorscale/attributes":309,"../../lib/extend":377,"../../plots/attributes":403,"../scattergeo/attributes":584}],498:[function(require,module,exports){ +},{"../../components/colorscale/attributes":309,"../../lib/extend":376,"../../plots/attributes":401,"../scattergeo/attributes":582}],496:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -86047,7 +85934,7 @@ module.exports = function calc(gd, trace) { colorscaleCalc(trace, trace.z, '', 'z'); }; -},{"../../components/colorscale/calc":310}],499:[function(require,module,exports){ +},{"../../components/colorscale/calc":310}],497:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -86102,7 +85989,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout coerce('hoverinfo', (layout._dataLength === 1) ? 'location+z+text' : undefined); }; -},{"../../components/colorscale/defaults":313,"../../lib":382,"./attributes":497}],500:[function(require,module,exports){ +},{"../../components/colorscale/defaults":312,"../../lib":381,"./attributes":495}],498:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -86137,7 +86024,7 @@ Choropleth.meta = { module.exports = Choropleth; -},{"../../plots/geo":426,"../heatmap/colorbar":514,"./attributes":497,"./calc":498,"./defaults":499,"./plot":501}],501:[function(require,module,exports){ +},{"../../plots/geo":424,"../heatmap/colorbar":512,"./attributes":495,"./calc":496,"./defaults":497,"./plot":499}],499:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -86358,7 +86245,7 @@ function makeEventDataFunc(trace) { }; } -},{"../../components/color":303,"../../components/colorscale/get_scale":315,"../../components/colorscale/make_scale_function":320,"../../components/drawing":326,"../../lib/array_to_calc_item":373,"../../lib/geo_location_utils":379,"../../lib/topojson_utils":396,"../../plots/cartesian/axes":405,"../../plots/cartesian/graph_interact":412,"../../plots/geo/constants":424,"./attributes":497,"d3":113}],502:[function(require,module,exports){ +},{"../../components/color":303,"../../components/colorscale/get_scale":314,"../../components/colorscale/make_scale_function":319,"../../components/drawing":325,"../../lib/array_to_calc_item":372,"../../lib/geo_location_utils":378,"../../lib/topojson_utils":394,"../../plots/cartesian/axes":403,"../../plots/cartesian/graph_interact":410,"../../plots/geo/constants":422,"./attributes":495,"d3":113}],500:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -86371,118 +86258,118 @@ function makeEventDataFunc(trace) { var heatmapAttrs = require('../heatmap/attributes'); var scatterAttrs = require('../scatter/attributes'); -var colorscaleAttrs = require('../../components/colorscale/attributes'); var extendFlat = require('../../lib/extend').extendFlat; var scatterLineAttrs = scatterAttrs.line; -module.exports = extendFlat({}, - { - z: heatmapAttrs.z, - x: heatmapAttrs.x, - x0: heatmapAttrs.x0, - dx: heatmapAttrs.dx, - y: heatmapAttrs.y, - y0: heatmapAttrs.y0, - dy: heatmapAttrs.dy, - text: heatmapAttrs.text, - transpose: heatmapAttrs.transpose, - xtype: heatmapAttrs.xtype, - ytype: heatmapAttrs.ytype, - - connectgaps: heatmapAttrs.connectgaps, - - autocontour: { - valType: 'boolean', - dflt: true, +module.exports = { + z: heatmapAttrs.z, + x: heatmapAttrs.x, + x0: heatmapAttrs.x0, + dx: heatmapAttrs.dx, + y: heatmapAttrs.y, + y0: heatmapAttrs.y0, + dy: heatmapAttrs.dy, + text: heatmapAttrs.text, + transpose: heatmapAttrs.transpose, + xtype: heatmapAttrs.xtype, + ytype: heatmapAttrs.ytype, + + zauto: heatmapAttrs.zauto, + zmin: heatmapAttrs.zmin, + zmax: heatmapAttrs.zmax, + colorscale: heatmapAttrs.colorscale, + autocolorscale: heatmapAttrs.autocolorscale, + reversescale: heatmapAttrs.reversescale, + showscale: heatmapAttrs.showscale, + + connectgaps: heatmapAttrs.connectgaps, + + autocontour: { + valType: 'boolean', + dflt: true, + role: 'style', + description: [ + 'Determines whether of not the contour level attributes at', + 'picked by an algorithm.', + 'If *true*, the number of contour levels can be set in `ncontours`.', + 'If *false*, set the contour level attributes in `contours`.' + ].join(' ') + }, + ncontours: { + valType: 'integer', + dflt: 0, + role: 'style', + description: 'Sets the number of contour levels.' + }, + + contours: { + start: { + valType: 'number', + dflt: null, + role: 'style', + description: 'Sets the starting contour level value.' + }, + end: { + valType: 'number', + dflt: null, + role: 'style', + description: 'Sets the end contour level value.' + }, + size: { + valType: 'number', + dflt: null, + role: 'style', + description: 'Sets the step between each contour level.' + }, + coloring: { + valType: 'enumerated', + values: ['fill', 'heatmap', 'lines', 'none'], + dflt: 'fill', role: 'style', description: [ - 'Determines whether or not the contour level attributes are', - 'picked by an algorithm.', - 'If *true*, the number of contour levels can be set in `ncontours`.', - 'If *false*, set the contour level attributes in `contours`.' + 'Determines the coloring method showing the contour values.', + 'If *fill*, coloring is done evenly between each contour level', + 'If *heatmap*, a heatmap gradient is coloring is applied', + 'between each contour level.', + 'If *lines*, coloring is done on the contour lines.', + 'If *none*, no coloring is applied on this trace.' ].join(' ') }, - ncontours: { - valType: 'integer', - dflt: 0, + showlines: { + valType: 'boolean', + dflt: true, role: 'style', description: [ - 'Sets the number of contour levels.', - 'Has an effect only if `autocontour` is *true*.' + 'Determines whether or not the contour lines are drawn.', + 'Has only an effect if `contours.coloring` is set to *fill*.' ].join(' ') - }, - - contours: { - start: { - valType: 'number', - dflt: null, - role: 'style', - description: 'Sets the starting contour level value.' - }, - end: { - valType: 'number', - dflt: null, - role: 'style', - description: 'Sets the end contour level value.' - }, - size: { - valType: 'number', - dflt: null, - role: 'style', - description: 'Sets the step between each contour level.' - }, - coloring: { - valType: 'enumerated', - values: ['fill', 'heatmap', 'lines', 'none'], - dflt: 'fill', - role: 'style', - description: [ - 'Determines the coloring method showing the contour values.', - 'If *fill*, coloring is done evenly between each contour level', - 'If *heatmap*, a heatmap gradient coloring is applied', - 'between each contour level.', - 'If *lines*, coloring is done on the contour lines.', - 'If *none*, no coloring is applied on this trace.' - ].join(' ') - }, - showlines: { - valType: 'boolean', - dflt: true, - role: 'style', - description: [ - 'Determines whether or not the contour lines are drawn.', - 'Has only an effect if `contours.coloring` is set to *fill*.' - ].join(' ') - } - }, - - line: { - color: extendFlat({}, scatterLineAttrs.color, { - description: [ - 'Sets the color of the contour level.', - 'Has no if `contours.coloring` is set to *lines*.' - ].join(' ') - }), - width: scatterLineAttrs.width, - dash: scatterLineAttrs.dash, - smoothing: extendFlat({}, scatterLineAttrs.smoothing, { - description: [ - 'Sets the amount of smoothing for the contour lines,', - 'where *0* corresponds to no smoothing.' - ].join(' ') - }) - }, - - _nestedModules: { - 'colorbar': 'Colorbar' } }, - colorscaleAttrs, - {autocolorscale: extendFlat({}, colorscaleAttrs.autocolorscale, {dflt: false})} -); -},{"../../components/colorscale/attributes":309,"../../lib/extend":377,"../heatmap/attributes":512,"../scatter/attributes":556}],503:[function(require,module,exports){ + line: { + color: extendFlat({}, scatterLineAttrs.color, { + description: [ + 'Sets the color of the contour level.', + 'Has no if `contours.coloring` is set to *lines*.' + ].join(' ') + }), + width: scatterLineAttrs.width, + dash: scatterLineAttrs.dash, + smoothing: extendFlat({}, scatterLineAttrs.smoothing, { + description: [ + 'Sets the amount of smoothing for the contour lines,', + 'where *0* corresponds to no smoothing.' + ].join(' ') + }) + }, + + _nestedModules: { + 'colorbar': 'Colorbar' + } +}; + +},{"../../lib/extend":376,"../heatmap/attributes":510,"../scatter/attributes":554}],501:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -86535,7 +86422,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../../plots/cartesian/axes":405,"../heatmap/calc":513}],504:[function(require,module,exports){ +},{"../../plots/cartesian/axes":403,"../heatmap/calc":511}],502:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -86596,7 +86483,7 @@ module.exports = function colorbar(gd, cd) { .options(trace.colorbar)(); }; -},{"../../components/colorbar/draw":306,"../../plots/plots":454,"./make_color_map":508}],505:[function(require,module,exports){ +},{"../../components/colorbar/draw":306,"../../plots/plots":452,"./make_color_map":506}],503:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -86640,7 +86527,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout handleStyleDefaults(traceIn, traceOut, coerce, layout); }; -},{"../../lib":382,"../contour/style_defaults":511,"../heatmap/has_columns":517,"../heatmap/xyz_defaults":523,"./attributes":502}],506:[function(require,module,exports){ +},{"../../lib":381,"../contour/style_defaults":509,"../heatmap/has_columns":515,"../heatmap/xyz_defaults":521,"./attributes":500}],504:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -86659,7 +86546,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) { return heatmapHoverPoints(pointData, xval, yval, hovermode, true); }; -},{"../heatmap/hover":518}],507:[function(require,module,exports){ +},{"../heatmap/hover":516}],505:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -86700,7 +86587,7 @@ Contour.meta = { module.exports = Contour; -},{"../../plots/cartesian":413,"./attributes":502,"./calc":503,"./colorbar":504,"./defaults":505,"./hover":506,"./plot":509,"./style":510}],508:[function(require,module,exports){ +},{"../../plots/cartesian":411,"./attributes":500,"./calc":501,"./colorbar":502,"./defaults":503,"./hover":504,"./plot":507,"./style":508}],506:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -86780,7 +86667,7 @@ module.exports = function makeColorMap(trace) { return colorMap; }; -},{"../../components/colorscale/get_scale":315,"d3":113}],509:[function(require,module,exports){ +},{"../../components/colorscale/get_scale":314,"d3":113}],507:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -86834,6 +86721,7 @@ var BOTTOMSTART = [1, 9, 13, 104, 713], SADDLEREMAINDER = {1: 4, 2: 8, 4: 1, 7: 13, 8: 2, 11: 14, 13: 7, 14: 11}; function plotOne(gd, plotinfo, cd) { + Lib.markTime('in Contour.plot'); var trace = cd[0].trace, x = cd[0].x, y = cd[0].y, @@ -86885,6 +86773,8 @@ function plotOne(gd, plotinfo, cd) { makeFills(plotGroup, pathinfo, perimeter, contours); makeLines(plotGroup, pathinfo, contours); clipGaps(plotGroup, plotinfo, cd[0], perimeter); + + Lib.markTime('done Contour.plot'); } function emptyPathinfo(contours, plotinfo, cd0) { @@ -87018,7 +86908,7 @@ function makePath(pi, loc, edgeflag) { marchStep = NEWDELTA[mi]; if(!marchStep) { - Lib.log('Found bad marching index:', mi, loc, pi.level); + console.log('found bad marching index', mi, loc, pi.level); break; } @@ -87042,7 +86932,7 @@ function makePath(pi, loc, edgeflag) { } if(cnt === 10000) { - Lib.log('Infinite loop in contour?'); + console.log('Infinite loop in contour?'); } var closedpath = equalPts(pts[0], pts[pts.length - 1]), totaldist = 0, @@ -87126,7 +87016,7 @@ function makePath(pi, loc, edgeflag) { } else { if(!edgeflag) { - Lib.log('Unclosed interior contour?', + console.log('unclosed interior contour?', pi.level, startLocStr, pts.join('L')); } @@ -87193,7 +87083,7 @@ function findAllPaths(pathinfo) { startLoc = Object.keys(pi.crossings)[0].split(',').map(Number); makePath(pi, startLoc); } - if(cnt === 10000) Lib.log('Infinite loop in contour?'); + if(cnt === 10000) console.log('Infinite loop in contour?'); } } @@ -87328,7 +87218,7 @@ function joinAllPaths(pi, perimeter) { //now loop through sides, moving our endpoint until we find a new start for(cnt = 0; cnt < 4; cnt++) { // just to prevent infinite loops if(!endpt) { - Lib.log('Missing end?', i, pi); + console.log('missing end?', i, pi); break; } @@ -87355,7 +87245,7 @@ function joinAllPaths(pi, perimeter) { } } else { - Lib.log('endpt to newendpt is not vert. or horz.', + console.log('endpt to newendpt is not vert. or horz.', endpt, newendpt, ptNew); } } @@ -87367,7 +87257,7 @@ function joinAllPaths(pi, perimeter) { } if(nexti === pi.edgepaths.length) { - Lib.log('unclosed perimeter path'); + console.log('unclosed perimeter path'); break; } @@ -87490,7 +87380,7 @@ function makeClipMask(cd0) { return z; } -},{"../../components/drawing":326,"../../lib":382,"../heatmap/plot":521,"d3":113}],510:[function(require,module,exports){ +},{"../../components/drawing":325,"../../lib":381,"../heatmap/plot":519,"d3":113}],508:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -87547,7 +87437,7 @@ module.exports = function style(gd) { heatmapStyle(gd); }; -},{"../../components/drawing":326,"../heatmap/style":522,"./make_color_map":508,"d3":113}],511:[function(require,module,exports){ +},{"../../components/drawing":325,"../heatmap/style":520,"./make_color_map":506,"d3":113}],509:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -87583,7 +87473,7 @@ module.exports = function handleStyleDefaults(traceIn, traceOut, coerce, layout) } }; -},{"../../components/colorscale/defaults":313}],512:[function(require,module,exports){ +},{"../../components/colorscale/defaults":312}],510:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -87599,79 +87489,84 @@ var colorscaleAttrs = require('../../components/colorscale/attributes'); var extendFlat = require('../../lib/extend').extendFlat; -module.exports = extendFlat({}, - { - z: { - valType: 'data_array', - description: 'Sets the z data.' - }, - x: scatterAttrs.x, - x0: scatterAttrs.x0, - dx: scatterAttrs.dx, - y: scatterAttrs.y, - y0: scatterAttrs.y0, - dy: scatterAttrs.dy, - text: { - valType: 'data_array', - description: 'Sets the text elements associated with each z value.' - }, - transpose: { - valType: 'boolean', - dflt: false, - role: 'info', - description: 'Transposes the z data.' - }, - xtype: { - valType: 'enumerated', - values: ['array', 'scaled'], - role: 'info', - description: [ - 'If *array*, the heatmap\'s x coordinates are given by *x*', - '(the default behavior when `x` is provided).', - 'If *scaled*, the heatmap\'s x coordinates are given by *x0* and *dx*', - '(the default behavior when `x` is not provided).' - ].join(' ') - }, - ytype: { - valType: 'enumerated', - values: ['array', 'scaled'], - role: 'info', - description: [ - 'If *array*, the heatmap\'s y coordinates are given by *y*', - '(the default behavior when `y` is provided)', - 'If *scaled*, the heatmap\'s y coordinates are given by *y0* and *dy*', - '(the default behavior when `y` is not provided)' - ].join(' ') - }, - zsmooth: { - valType: 'enumerated', - values: ['fast', 'best', false], - dflt: false, - role: 'style', - description: [ - 'Picks a smoothing algorithm use to smooth `z` data.' - ].join(' ') - }, - connectgaps: { - valType: 'boolean', - dflt: false, - role: 'info', - description: [ - 'Determines whether or not gaps', - '(i.e. {nan} or missing values)', - 'in the `z` data are filled in.' - ].join(' ') - }, - _nestedModules: { - 'colorbar': 'Colorbar' - } +module.exports = { + z: { + valType: 'data_array', + description: 'Sets the z data.' + }, + x: scatterAttrs.x, + x0: scatterAttrs.x0, + dx: scatterAttrs.dx, + y: scatterAttrs.y, + y0: scatterAttrs.y0, + dy: scatterAttrs.dy, + text: { + valType: 'data_array', + description: 'Sets the text elements associated with each z value.' + }, + transpose: { + valType: 'boolean', + dflt: false, + role: 'info', + description: 'Transposes the z data.' + }, + xtype: { + valType: 'enumerated', + values: ['array', 'scaled'], + role: 'info', + description: [ + 'If *array*, the heatmap\'s x coordinates are given by *x*', + '(the default behavior when `x` is provided).', + 'If *scaled*, the heatmap\'s x coordinates are given by *x0* and *dx*', + '(the default behavior when `x` is not provided).' + ].join(' ') + }, + ytype: { + valType: 'enumerated', + values: ['array', 'scaled'], + role: 'info', + description: [ + 'If *array*, the heatmap\'s y coordinates are given by *y*', + '(the default behavior when `y` is provided)', + 'If *scaled*, the heatmap\'s y coordinates are given by *y0* and *dy*', + '(the default behavior when `y` is not provided)' + ].join(' ') + }, + zauto: colorscaleAttrs.zauto, + zmin: colorscaleAttrs.zmin, + zmax: colorscaleAttrs.zmax, + colorscale: colorscaleAttrs.colorscale, + autocolorscale: extendFlat({}, colorscaleAttrs.autocolorscale, + {dflt: false}), + reversescale: colorscaleAttrs.reversescale, + showscale: colorscaleAttrs.showscale, + zsmooth: { + valType: 'enumerated', + values: ['fast', 'best', false], + dflt: false, + role: 'style', + description: [ + 'Picks a smoothing algorithm use to smooth `z` data.' + ].join(' ') + }, + connectgaps: { + valType: 'boolean', + dflt: false, + role: 'info', + description: [ + 'Determines whether or not gaps', + '(i.e. {nan} or missing values)', + 'in the `z` data are filled in.' + ].join(' ') }, - colorscaleAttrs, - {autocolorscale: extendFlat({}, colorscaleAttrs.autocolorscale, {dflt: false})} -); -},{"../../components/colorscale/attributes":309,"../../lib/extend":377,"../scatter/attributes":556}],513:[function(require,module,exports){ + _nestedModules: { + 'colorbar': 'Colorbar' + } +}; + +},{"../../components/colorscale/attributes":309,"../../lib/extend":376,"../scatter/attributes":554}],511:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -87697,6 +87592,8 @@ var maxRowLength = require('./max_row_length'); module.exports = function calc(gd, trace) { + Lib.markTime('start convert x&y'); + // prepare the raw data // run makeCalcdata on x and y even for heatmaps, in case of category mappings var xa = Axes.getFromId(gd, trace.xaxis || 'x'), @@ -87717,6 +87614,8 @@ module.exports = function calc(gd, trace) { xa._minDtick = 0; ya._minDtick = 0; + Lib.markTime('done convert x&y'); + if(isHist) { var binned = histogram2dCalc(gd, trace); x = binned.x; @@ -87938,7 +87837,7 @@ function interp2d(z, emptyPoints, savedInterpZ) { correctionOvershoot(maxFractionalChange)); } if(maxFractionalChange > INTERPTHRESHOLD) { - Lib.log('interp2d didn\'t converge quickly', maxFractionalChange); + console.log('interp2d didn\'t converge quickly', maxFractionalChange); } return z; @@ -88107,7 +88006,7 @@ function iterateInterp2d(z, emptyPoints, overshoot) { return maxFractionalChange; } -},{"../../components/colorscale/calc":310,"../../lib":382,"../../plots/cartesian/axes":405,"../../plots/plots":454,"../histogram2d/calc":533,"./convert_column_xyz":515,"./has_columns":517,"./max_row_length":520,"fast-isnumeric":117}],514:[function(require,module,exports){ +},{"../../components/colorscale/calc":310,"../../lib":381,"../../plots/cartesian/axes":403,"../../plots/plots":452,"../histogram2d/calc":531,"./convert_column_xyz":513,"./has_columns":515,"./max_row_length":518,"fast-isnumeric":117}],512:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -88151,9 +88050,11 @@ module.exports = function colorbar(gd, cd) { .range(scl.map(function(v) { return v[1]; }))) .filllevels({start: zmin, end: zmax, size: (zmax - zmin) / 254}) .options(trace.colorbar)(); + + Lib.markTime('done colorbar'); }; -},{"../../components/colorbar/draw":306,"../../components/colorscale/get_scale":315,"../../lib":382,"../../plots/plots":454,"d3":113,"fast-isnumeric":117}],515:[function(require,module,exports){ +},{"../../components/colorbar/draw":306,"../../components/colorscale/get_scale":314,"../../lib":381,"../../plots/plots":452,"d3":113,"fast-isnumeric":117}],513:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -88210,7 +88111,7 @@ module.exports = function convertColumnXYZ(trace, xa, ya) { if(hasColumnText) trace.text = text; }; -},{"../../lib":382}],516:[function(require,module,exports){ +},{"../../lib":381}],514:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -88248,7 +88149,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'}); }; -},{"../../components/colorscale/defaults":313,"../../lib":382,"./attributes":512,"./has_columns":517,"./xyz_defaults":523}],517:[function(require,module,exports){ +},{"../../components/colorscale/defaults":312,"../../lib":381,"./attributes":510,"./has_columns":515,"./xyz_defaults":521}],515:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -88264,7 +88165,7 @@ module.exports = function(trace) { return !Array.isArray(trace.z[0]); }; -},{}],518:[function(require,module,exports){ +},{}],516:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -88305,7 +88206,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode, contour) ny = Math.round(pointData.index[0]); } catch(e) { - Lib.error('Error hovering on heatmap, ' + + console.log('Error hovering on heatmap, ' + 'pointNumber must be [row,col], found:', pointData.index); return; } @@ -88378,7 +88279,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode, contour) })]; }; -},{"../../lib":382,"../../plots/cartesian/graph_interact":412}],519:[function(require,module,exports){ +},{"../../lib":381,"../../plots/cartesian/graph_interact":410}],517:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -88433,7 +88334,7 @@ Heatmap.meta = { module.exports = Heatmap; -},{"../../plots/cartesian":413,"./attributes":512,"./calc":513,"./colorbar":514,"./defaults":516,"./hover":518,"./plot":521,"./style":522}],520:[function(require,module,exports){ +},{"../../plots/cartesian":411,"./attributes":510,"./calc":511,"./colorbar":512,"./defaults":514,"./hover":516,"./plot":519,"./style":520}],518:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -88455,7 +88356,7 @@ module.exports = function maxRowLength(z) { return len; }; -},{}],521:[function(require,module,exports){ +},{}],519:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -88486,6 +88387,8 @@ module.exports = function(gd, plotinfo, cdheatmaps) { // From http://www.xarg.org/2010/03/generate-client-side-png-files-using-javascript/ function plotOne(gd, plotinfo, cd) { + Lib.markTime('in Heatmap.plot'); + var trace = cd[0].trace, uid = trace.uid, xa = plotinfo.x(), @@ -88742,6 +88645,8 @@ function plotOne(gd, plotinfo, cd) { return setColor(z00 + xinterp.frac * dx + yinterp.frac * (dy + xinterp.frac * dxy)); } + Lib.markTime('done init png'); + if(zsmooth) { // best or fast, works fastest with imageData var pxIndex = 0, pixels = new Uint8Array(imageWidth * imageHeight * 4); @@ -88813,6 +88718,8 @@ function plotOne(gd, plotinfo, cd) { } } + Lib.markTime('done filling png'); + rcount = Math.round(rcount / pixcount); gcount = Math.round(gcount / pixcount); bcount = Math.round(bcount / pixcount); @@ -88843,9 +88750,11 @@ function plotOne(gd, plotinfo, cd) { y: top, preserveAspectRatio: 'none' }); + + Lib.markTime('done showing png'); } -},{"../../components/colorscale/get_scale":315,"../../constants/xmlns_namespaces":370,"../../lib":382,"../../plots/plots":454,"./max_row_length":520,"d3":113,"tinycolor2":274}],522:[function(require,module,exports){ +},{"../../components/colorscale/get_scale":314,"../../constants/xmlns_namespaces":369,"../../lib":381,"../../plots/plots":452,"./max_row_length":518,"d3":113,"tinycolor2":274}],520:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -88866,7 +88775,7 @@ module.exports = function style(gd) { }); }; -},{"d3":113}],523:[function(require,module,exports){ +},{"d3":113}],521:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -88955,7 +88864,7 @@ function isValidZ(z) { return (allRowsAreArrays && oneRowIsFilled && hasOneNumber); } -},{"./has_columns":517,"fast-isnumeric":117}],524:[function(require,module,exports){ +},{"./has_columns":515,"fast-isnumeric":117}],522:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -88964,16 +88873,16 @@ function isValidZ(z) { * LICENSE file in the root directory of this source tree. */ + 'use strict'; var barAttrs = require('../bar/attributes'); -var colorAttributes = require('../../components/colorscale/color_attributes'); - -var extendFlat = require('../../lib/extend').extendDeep; +var extendFlat = require('../../lib').extendFlat; var barMarkerAttrs = barAttrs.marker; var barMarkerLineAttrs = barMarkerAttrs.line; + module.exports = { x: { valType: 'data_array', @@ -89040,9 +88949,7 @@ module.exports = { role: 'style', description: [ 'Determines whether or not the x axis bin attributes are picked', - 'by an algorithm. Note that this should be set to false if you', - 'want to manually set the number of bins using the attributes in', - 'xbins.' + 'by an algorithm.' ].join(' ') }, nbinsx: { @@ -89050,11 +88957,7 @@ module.exports = { min: 0, dflt: 0, role: 'style', - description: [ - 'Specifies the maximum number of desired bins. This value will be used', - 'in an algorithm that will decide the optimal bin size such that the', - 'histogram best visualizes the distribution of the data.' - ].join(' ') + description: 'Sets the number of x axis bins.' }, xbins: makeBinsAttr('x'), @@ -89064,9 +88967,7 @@ module.exports = { role: 'style', description: [ 'Determines whether or not the y axis bin attributes are picked', - 'by an algorithm. Note that this should be set to false if you', - 'want to manually set the number of bins using the attributes in', - 'ybins.' + 'by an algorithm.' ].join(' ') }, nbinsy: { @@ -89074,22 +88975,30 @@ module.exports = { min: 0, dflt: 0, role: 'style', - description: [ - 'Specifies the maximum number of desired bins. This value will be used', - 'in an algorithm that will decide the optimal bin size such that the', - 'histogram best visualizes the distribution of the data.' - ].join(' ') + description: 'Sets the number of y axis bins.' }, ybins: makeBinsAttr('y'), - marker: extendFlat({}, { + marker: { + color: barMarkerAttrs.color, + colorscale: barMarkerAttrs.colorscale, + cauto: barMarkerAttrs.cauto, + cmax: barMarkerAttrs.cmax, + cmin: barMarkerAttrs.cmin, + autocolorscale: barMarkerAttrs.autocolorscale, + reversescale: barMarkerAttrs.reversescale, showscale: barMarkerAttrs.showscale, - line: extendFlat({}, - {width: extendFlat({}, barMarkerLineAttrs.width, {dflt: 0})}, - colorAttributes('marker.line')) + line: { + color: barMarkerLineAttrs.color, + colorscale: barMarkerLineAttrs.colorscale, + cauto: barMarkerLineAttrs.cauto, + cmax: barMarkerLineAttrs.cmax, + cmin: barMarkerLineAttrs.cmin, + autocolorscale: barMarkerLineAttrs.autocolorscale, + reversescale: barMarkerLineAttrs.reversescale, + width: extendFlat({}, barMarkerLineAttrs.width, {dflt: 0}) + } }, - colorAttributes('marker') - ), _nestedModules: { 'error_y': 'ErrorBars', @@ -89134,7 +89043,7 @@ function makeBinsAttr(axLetter) { }; } -},{"../../components/colorscale/color_attributes":311,"../../lib/extend":377,"../bar/attributes":476}],525:[function(require,module,exports){ +},{"../../lib":381,"../bar/attributes":474}],523:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -89160,7 +89069,7 @@ module.exports = function doAvg(size, counts) { return total; }; -},{}],526:[function(require,module,exports){ +},{}],524:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -89190,7 +89099,7 @@ module.exports = function handleBinDefaults(traceIn, traceOut, coerce, binDirect return traceOut; }; -},{}],527:[function(require,module,exports){ +},{}],525:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -89264,7 +89173,7 @@ module.exports = { } }; -},{"fast-isnumeric":117}],528:[function(require,module,exports){ +},{"fast-isnumeric":117}],526:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -89394,7 +89303,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../../lib":382,"../../plots/cartesian/axes":405,"./average":525,"./bin_functions":527,"./norm_functions":531,"fast-isnumeric":117}],529:[function(require,module,exports){ +},{"../../lib":381,"../../plots/cartesian/axes":403,"./average":523,"./bin_functions":525,"./norm_functions":529,"fast-isnumeric":117}],527:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -89446,7 +89355,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout errorBarsSupplyDefaults(traceIn, traceOut, Color.defaultLine, {axis: 'x', inherit: 'y'}); }; -},{"../../components/color":303,"../../components/errorbars/defaults":331,"../../lib":382,"../bar/style_defaults":486,"./attributes":524,"./bin_defaults":526}],530:[function(require,module,exports){ +},{"../../components/color":303,"../../components/errorbars/defaults":330,"../../lib":381,"../bar/style_defaults":484,"./attributes":522,"./bin_defaults":524}],528:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -89501,7 +89410,7 @@ Histogram.meta = { module.exports = Histogram; -},{"../../plots/cartesian":413,"../bar/hover":479,"../bar/layout_attributes":481,"../bar/layout_defaults":482,"../bar/plot":483,"../bar/set_positions":484,"../bar/style":485,"../scatter/colorbar":559,"./attributes":524,"./calc":528,"./defaults":529}],531:[function(require,module,exports){ +},{"../../plots/cartesian":411,"../bar/hover":477,"../bar/layout_attributes":479,"../bar/layout_defaults":480,"../bar/plot":481,"../bar/set_positions":482,"../bar/style":483,"../scatter/colorbar":557,"./attributes":522,"./calc":526,"./defaults":527}],529:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -89536,7 +89445,7 @@ module.exports = { } }; -},{}],532:[function(require,module,exports){ +},{}],530:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -89549,46 +89458,47 @@ module.exports = { var histogramAttrs = require('../histogram/attributes'); var heatmapAttrs = require('../heatmap/attributes'); -var colorscaleAttrs = require('../../components/colorscale/attributes'); - -var extendFlat = require('../../lib/extend').extendFlat; -module.exports = extendFlat({}, - { - x: histogramAttrs.x, - y: histogramAttrs.y, +module.exports = { + x: histogramAttrs.x, + y: histogramAttrs.y, - z: { + z: { + valType: 'data_array', + description: 'Sets the aggregation data.' + }, + marker: { + color: { valType: 'data_array', description: 'Sets the aggregation data.' - }, - marker: { - color: { - valType: 'data_array', - description: 'Sets the aggregation data.' - } - }, + } + }, - histnorm: histogramAttrs.histnorm, - histfunc: histogramAttrs.histfunc, - autobinx: histogramAttrs.autobinx, - nbinsx: histogramAttrs.nbinsx, - xbins: histogramAttrs.xbins, - autobiny: histogramAttrs.autobiny, - nbinsy: histogramAttrs.nbinsy, - ybins: histogramAttrs.ybins, + histnorm: histogramAttrs.histnorm, + histfunc: histogramAttrs.histfunc, + autobinx: histogramAttrs.autobinx, + nbinsx: histogramAttrs.nbinsx, + xbins: histogramAttrs.xbins, + autobiny: histogramAttrs.autobiny, + nbinsy: histogramAttrs.nbinsy, + ybins: histogramAttrs.ybins, - zsmooth: heatmapAttrs.zsmooth, + zauto: heatmapAttrs.zauto, + zmin: heatmapAttrs.zmin, + zmax: heatmapAttrs.zmax, + colorscale: heatmapAttrs.colorscale, + autocolorscale: heatmapAttrs.autocolorscale, + reversescale: heatmapAttrs.reversescale, + showscale: heatmapAttrs.showscale, - _nestedModules: { - 'colorbar': 'Colorbar' - } - }, - colorscaleAttrs, - {autocolorscale: extendFlat({}, colorscaleAttrs.autocolorscale, {dflt: false})} -); + zsmooth: heatmapAttrs.zsmooth, -},{"../../components/colorscale/attributes":309,"../../lib/extend":377,"../heatmap/attributes":512,"../histogram/attributes":524}],533:[function(require,module,exports){ + _nestedModules: { + 'colorbar': 'Colorbar' + } +}; + +},{"../heatmap/attributes":510,"../histogram/attributes":522}],531:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -89624,6 +89534,7 @@ module.exports = function calc(gd, trace) { if(x.length > serieslen) x.splice(serieslen, x.length - serieslen); if(y.length > serieslen) y.splice(serieslen, y.length - serieslen); + Lib.markTime('done convert data'); // calculate the bins if(trace.autobinx || !('xbins' in trace)) { @@ -89644,6 +89555,7 @@ module.exports = function calc(gd, trace) { } trace._input.ybins = trace.ybins; } + Lib.markTime('done autoBin'); // make the empty bin array & scale the map z = []; @@ -89727,6 +89639,7 @@ module.exports = function calc(gd, trace) { } + Lib.markTime('done making bins'); // put data into bins for(i = 0; i < serieslen; i++) { n = Lib.findBin(x[i], xbins); @@ -89742,6 +89655,7 @@ module.exports = function calc(gd, trace) { if(normfunc) { for(m = 0; m < ny; m++) normfunc(z[m], total, xinc, yinc[m]); } + Lib.markTime('done binning'); return { x: x, @@ -89754,7 +89668,7 @@ module.exports = function calc(gd, trace) { }; }; -},{"../../lib":382,"../../plots/cartesian/axes":405,"../histogram/average":525,"../histogram/bin_functions":527,"../histogram/norm_functions":531}],534:[function(require,module,exports){ +},{"../../lib":381,"../../plots/cartesian/axes":403,"../histogram/average":523,"../histogram/bin_functions":525,"../histogram/norm_functions":529}],532:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -89787,7 +89701,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, layout) { ); }; -},{"../../components/colorscale/defaults":313,"../../lib":382,"./attributes":532,"./sample_defaults":536}],535:[function(require,module,exports){ +},{"../../components/colorscale/defaults":312,"../../lib":381,"./attributes":530,"./sample_defaults":534}],533:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -89827,7 +89741,7 @@ Histogram2D.meta = { module.exports = Histogram2D; -},{"../../plots/cartesian":413,"../heatmap/calc":513,"../heatmap/colorbar":514,"../heatmap/hover":518,"../heatmap/plot":521,"../heatmap/style":522,"./attributes":532,"./defaults":534}],536:[function(require,module,exports){ +},{"../../plots/cartesian":411,"../heatmap/calc":511,"../heatmap/colorbar":512,"../heatmap/hover":516,"../heatmap/plot":519,"../heatmap/style":520,"./attributes":530,"./defaults":532}],534:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -89863,7 +89777,7 @@ module.exports = function handleSampleDefaults(traceIn, traceOut, coerce) { handleBinDefaults(traceIn, traceOut, coerce, binDirections); }; -},{"../histogram/bin_defaults":526}],537:[function(require,module,exports){ +},{"../histogram/bin_defaults":524}],535:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -89876,11 +89790,8 @@ module.exports = function handleSampleDefaults(traceIn, traceOut, coerce) { var histogram2dAttrs = require('../histogram2d/attributes'); var contourAttrs = require('../contour/attributes'); -var colorscaleAttrs = require('../../components/colorscale/attributes'); -var extendFlat = require('../../lib/extend').extendFlat; - -module.exports = extendFlat({}, { +module.exports = { x: histogram2dAttrs.x, y: histogram2dAttrs.y, z: histogram2dAttrs.z, @@ -89895,6 +89806,14 @@ module.exports = extendFlat({}, { nbinsy: histogram2dAttrs.nbinsy, ybins: histogram2dAttrs.ybins, + zauto: contourAttrs.zauto, + zmin: contourAttrs.zmin, + zmax: contourAttrs.zmax, + colorscale: contourAttrs.colorscale, + autocolorscale: contourAttrs.autocolorscale, + reversescale: contourAttrs.reversescale, + showscale: contourAttrs.showscale, + autocontour: contourAttrs.autocontour, ncontours: contourAttrs.ncontours, contours: contourAttrs.contours, @@ -89903,11 +89822,9 @@ module.exports = extendFlat({}, { _nestedModules: { 'colorbar': 'Colorbar' } -}, - colorscaleAttrs -); +}; -},{"../../components/colorscale/attributes":309,"../../lib/extend":377,"../contour/attributes":502,"../histogram2d/attributes":532}],538:[function(require,module,exports){ +},{"../contour/attributes":500,"../histogram2d/attributes":530}],536:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -89943,7 +89860,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout handleStyleDefaults(traceIn, traceOut, coerce, layout); }; -},{"../../lib":382,"../contour/style_defaults":511,"../histogram2d/sample_defaults":536,"./attributes":537}],539:[function(require,module,exports){ +},{"../../lib":381,"../contour/style_defaults":509,"../histogram2d/sample_defaults":534,"./attributes":535}],537:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -89983,7 +89900,7 @@ Histogram2dContour.meta = { module.exports = Histogram2dContour; -},{"../../plots/cartesian":413,"../contour/calc":503,"../contour/colorbar":504,"../contour/hover":506,"../contour/plot":509,"../contour/style":510,"./attributes":537,"./defaults":538}],540:[function(require,module,exports){ +},{"../../plots/cartesian":411,"../contour/calc":501,"../contour/colorbar":502,"../contour/hover":504,"../contour/plot":507,"../contour/style":508,"./attributes":535,"./defaults":536}],538:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -90002,57 +89919,28 @@ var extendFlat = require('../../lib/extend').extendFlat; module.exports = { x: { valType: 'data_array', - description: [ - 'Sets the X coordinates of the vertices. The nth element of vectors `x`, `y` and `z`', - 'jointly represent the X, Y and Z coordinates of the nth vertex.' - ].join(' ') + description: 'Sets the x coordinates of the vertices' }, y: { valType: 'data_array', - description: [ - 'Sets the Y coordinates of the vertices. The nth element of vectors `x`, `y` and `z`', - 'jointly represent the X, Y and Z coordinates of the nth vertex.' - ].join(' ') + description: 'Sets the y coordinates of the vertices' }, z: { valType: 'data_array', - description: [ - 'Sets the Z coordinates of the vertices. The nth element of vectors `x`, `y` and `z`', - 'jointly represent the X, Y and Z coordinates of the nth vertex.' - ].join(' ') + description: 'Sets the z coordinates of the vertices' }, i: { valType: 'data_array', - description: [ - 'A vector of vertex indices, i.e. integer values between 0 and the length of the vertex', - 'vectors, representing the *first* vertex of a triangle. For example, `{i[m], j[m], k[m]}`', - 'together represent face m (triangle m) in the mesh, where `i[m] = n` points to the triplet', - '`{x[n], y[n], z[n]}` in the vertex arrays. Therefore, each element in `i` represents a', - 'point in space, which is the first vertex of a triangle.' - ].join(' ') + description: 'Sets the indices of x coordinates of the vertices' }, j: { valType: 'data_array', - description: [ - 'A vector of vertex indices, i.e. integer values between 0 and the length of the vertex', - 'vectors, representing the *second* vertex of a triangle. For example, `{i[m], j[m], k[m]}` ', - 'together represent face m (triangle m) in the mesh, where `j[m] = n` points to the triplet', - '`{x[n], y[n], z[n]}` in the vertex arrays. Therefore, each element in `j` represents a', - 'point in space, which is the second vertex of a triangle.' - ].join(' ') - + description: 'Sets the indices of y coordinates of the vertices' }, k: { valType: 'data_array', - description: [ - 'A vector of vertex indices, i.e. integer values between 0 and the length of the vertex', - 'vectors, representing the *third* vertex of a triangle. For example, `{i[m], j[m], k[m]}`', - 'together represent face m (triangle m) in the mesh, where `k[m] = n` points to the triplet ', - '`{x[n], y[n], z[n]}` in the vertex arrays. Therefore, each element in `k` represents a', - 'point in space, which is the third vertex of a triangle.' - ].join(' ') - + description: 'Sets the indices of z coordinates of the vertices' }, delaunayaxis: { @@ -90061,10 +89949,9 @@ module.exports = { values: [ 'x', 'y', 'z' ], dflt: 'z', description: [ - 'Sets the Delaunay axis, which is the axis that is perpendicular to the surface of the', - 'Delaunay triangulation.', - 'It has an effect if `i`, `j`, `k` are not provided and `alphahull` is set to indicate', - 'Delaunay triangulation.' + 'Sets the Delaunay axis from which the triangulation of the mesh', + 'takes place.', + 'An alternative to setting the `i`, `j`, `k` indices triplets.' ].join(' ') }, @@ -90073,24 +89960,11 @@ module.exports = { role: 'style', dflt: -1, description: [ - 'Determines how the mesh surface triangles are derived from the set of', - 'vertices (points) represented by the `x`, `y` and `z` arrays, if', - 'the `i`, `j`, `k` arrays are not supplied.', - 'For general use of `mesh3d` it is preferred that `i`, `j`, `k` are', - 'supplied.', - - 'If *-1*, Delaunay triangulation is used, which is mainly suitable if the', - 'mesh is a single, more or less layer surface that is perpendicular to `delaunayaxis`.', - 'In case the `delaunayaxis` intersects the mesh surface at more than one point', - 'it will result triangles that are very long in the dimension of `delaunayaxis`.', - - 'If *>0*, the alpha-shape algorithm is used. In this case, the positive `alphahull` value', - 'signals the use of the alpha-shape algorithm, _and_ its value', - 'acts as the parameter for the mesh fitting.', - - 'If *0*, the convex-hull algorithm is used. It is suitable for convex bodies', - 'or if the intention is to enclose the `x`, `y` and `z` point set into a convex', - 'hull.' + 'Sets the shape of the mesh', + 'If *-1*, Delaunay triangulation is used', + 'If *>0*, the alpha-shape algorithm is used', + 'If *0*, the convex-hull algorithm is used', + 'An alternative to the `i`, `j`, `k` indices triplets.' ].join(' ') }, @@ -90135,7 +90009,7 @@ module.exports = { dflt: false, description: [ 'Determines whether or not normal smoothing is applied to the meshes,', - 'creating meshes with an angular, low-poly look via flat reflections.' + 'creating meshes with a low-poly look.' ].join(' ') }, @@ -90182,7 +90056,7 @@ module.exports = { } }; -},{"../../components/colorscale/attributes":309,"../../lib/extend":377,"../surface/attributes":601}],541:[function(require,module,exports){ +},{"../../components/colorscale/attributes":309,"../../lib/extend":376,"../surface/attributes":599}],539:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -90344,7 +90218,7 @@ function createMesh3DTrace(scene, data) { module.exports = createMesh3DTrace; -},{"../../lib/str2rgbarray":394,"alpha-shape":40,"convex-hull":102,"delaunay-triangulate":114,"gl-mesh3d":150,"tinycolor2":274}],542:[function(require,module,exports){ +},{"../../lib/str2rgbarray":392,"alpha-shape":40,"convex-hull":102,"delaunay-triangulate":114,"gl-mesh3d":150,"tinycolor2":274}],540:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -90441,7 +90315,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout } }; -},{"../../components/colorbar/defaults":305,"../../lib":382,"./attributes":540}],543:[function(require,module,exports){ +},{"../../components/colorbar/defaults":305,"../../lib":381,"./attributes":538}],541:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -90477,7 +90351,7 @@ Mesh3D.meta = { module.exports = Mesh3D; -},{"../../plots/gl3d":441,"../heatmap/colorbar":514,"./attributes":540,"./convert":541,"./defaults":542}],544:[function(require,module,exports){ +},{"../../plots/gl3d":439,"../heatmap/colorbar":512,"./attributes":538,"./convert":539,"./defaults":540}],542:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -90741,7 +90615,7 @@ module.exports = { } }; -},{"../../components/color/attributes":302,"../../lib/extend":377,"../../plots/attributes":403,"../../plots/font_attributes":423}],545:[function(require,module,exports){ +},{"../../components/color/attributes":302,"../../lib/extend":376,"../../plots/attributes":401,"../../plots/font_attributes":421}],543:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -90788,7 +90662,7 @@ function getCdModule(calcdata, _module) { return cdModule; } -},{"../../plots/plots":454}],546:[function(require,module,exports){ +},{"../../plots/plots":452}],544:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -90940,7 +90814,7 @@ function nextDefaultColor(index) { return pieDefaultColors[index % pieDefaultColors.length]; } -},{"../../components/color":303,"./helpers":548,"fast-isnumeric":117,"tinycolor2":274}],547:[function(require,module,exports){ +},{"../../components/color":303,"./helpers":546,"fast-isnumeric":117,"tinycolor2":274}],545:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -91024,7 +90898,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout coerce('pull'); }; -},{"../../lib":382,"./attributes":544}],548:[function(require,module,exports){ +},{"../../lib":381,"./attributes":542}],546:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -91053,7 +90927,7 @@ exports.formatPieValue = function formatPieValue(v, separators) { return Lib.numSeparate(vRounded, separators); }; -},{"../../lib":382}],549:[function(require,module,exports){ +},{"../../lib":381}],547:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -91089,7 +90963,7 @@ Pie.meta = { module.exports = Pie; -},{"./attributes":544,"./base_plot":545,"./calc":546,"./defaults":547,"./layout_attributes":550,"./layout_defaults":551,"./plot":552,"./style":553,"./style_one":554}],550:[function(require,module,exports){ +},{"./attributes":542,"./base_plot":543,"./calc":544,"./defaults":545,"./layout_attributes":548,"./layout_defaults":549,"./plot":550,"./style":551,"./style_one":552}],548:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -91109,7 +90983,7 @@ module.exports = { hiddenlabels: {valType: 'data_array'} }; -},{}],551:[function(require,module,exports){ +},{}],549:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -91131,7 +91005,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { coerce('hiddenlabels'); }; -},{"../../lib":382,"./layout_attributes":550}],552:[function(require,module,exports){ +},{"../../lib":381,"./layout_attributes":548}],550:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -91826,7 +91700,7 @@ function maxExtent(tilt, tiltAxisFraction, depth) { 2 * Math.sqrt(1 - sinTilt * sinTilt * tiltAxisFraction * tiltAxisFraction)); } -},{"../../components/color":303,"../../components/drawing":326,"../../lib/svg_text_utils":395,"../../plots/cartesian/graph_interact":412,"./helpers":548,"d3":113}],553:[function(require,module,exports){ +},{"../../components/color":303,"../../components/drawing":325,"../../lib/svg_text_utils":393,"../../plots/cartesian/graph_interact":410,"./helpers":546,"d3":113}],551:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -91855,7 +91729,7 @@ module.exports = function style(gd) { }); }; -},{"./style_one":554,"d3":113}],554:[function(require,module,exports){ +},{"./style_one":552,"d3":113}],552:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -91882,7 +91756,7 @@ module.exports = function styleOne(s, pt, trace) { .call(Color.stroke, lineColor); }; -},{"../../components/color":303}],555:[function(require,module,exports){ +},{"../../components/color":303}],553:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -91920,7 +91794,7 @@ module.exports = function arraysToCalcdata(cd) { } }; -},{"../../lib":382}],556:[function(require,module,exports){ +},{"../../lib":381}],554:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -91931,13 +91805,10 @@ module.exports = function arraysToCalcdata(cd) { 'use strict'; -var colorAttributes = require('../../components/colorscale/color_attributes'); - var Drawing = require('../../components/drawing'); var constants = require('./constants'); -var extendFlat = require('../../lib/extend').extendFlat; module.exports = { x: { @@ -92107,7 +91978,7 @@ module.exports = { 'marker color, or marker line color, whichever is available.' ].join(' ') }, - marker: extendFlat({}, { + marker: { symbol: { valType: 'enumerated', values: Drawing.symbolList, @@ -92138,6 +92009,17 @@ module.exports = { role: 'style', description: 'Sets the marker size (in px).' }, + color: { + valType: 'color', + arrayOk: true, + role: 'style', + description: [ + 'Sets the marker color. It accepts either a specific color', + 'or an array of values that are mapped to the colorscale', + 'relative to the max and min values of the array or relative to', + '`cmin` and `cmax` if set.' + ].join(' ') + }, maxdisplayed: { valType: 'number', min: 0, @@ -92179,6 +92061,73 @@ module.exports = { 'to pixels.' ].join(' ') }, + colorscale: { + valType: 'colorscale', + role: 'style', + description: [ + 'Sets the colorscale and only has an effect', + 'if `marker.color` is set to a numerical array.', + 'The colorscale must be an array containing', + 'arrays mapping a normalized value to an', + 'rgb, rgba, hex, hsl, hsv, or named color string.', + 'At minimum, a mapping for the lowest (0) and highest (1)', + 'values are required. For example,', + '`[[0, \'rgb(0,0,255)\', [1, \'rgb(255,0,0)\']]`.', + 'To control the bounds of the colorscale in color space,', + 'use `marker.cmin` and `marker.cmax`.' + ].join(' ') + }, + cauto: { + valType: 'boolean', + dflt: true, + role: 'style', + description: [ + 'Has an effect only if `marker.color` is set to a numerical array.', + 'Determines the whether or not the color domain is computed', + 'automatically.' + ].join(' ') + }, + cmax: { + valType: 'number', + dflt: null, + role: 'info', + description: [ + 'Has an effect only if `marker.color` is set to a numerical array.', + 'Sets the upper bound of the color domain.', + 'Value should be associated to the `marker.color` array index,', + 'and if set, `marker.cmin` must be set as well.' + ].join(' ') + }, + cmin: { + valType: 'number', + dflt: null, + role: 'info', + description: [ + 'Has an effect only if `marker.color` is set to a numerical array.', + 'Sets the lower bound of the color domain.', + 'Value should be associated to the `marker.color` array index,', + 'and if set, `marker.cmax` must be set as well.' + ].join(' ') + }, + autocolorscale: { + valType: 'boolean', + dflt: true, + role: 'style', + description: [ + 'Has an effect only if `marker.color` is set to a numerical array.', + 'Determines whether or not the colorscale is picked using', + 'values inside `marker.color`.' + ].join(' ') + }, + reversescale: { + valType: 'boolean', + role: 'style', + dflt: false, + description: [ + 'Has an effect only if `marker.color` is set to a numerical array.', + 'Reverses the colorscale.' + ].join(' ') + }, showscale: { valType: 'boolean', role: 'info', @@ -92188,20 +92137,94 @@ module.exports = { 'Determines whether or not a colorbar is displayed.' ].join(' ') }, - line: extendFlat({}, { + line: { + color: { + valType: 'color', + arrayOk: true, + role: 'style', + description: [ + 'Sets the marker outline color. It accepts either a specific color', + 'or an array of values that are mapped to the colorscale', + 'relative to the max and min values of the array or relative to', + '`cmin` and `cmax` if set.' + ].join(' ') + }, width: { valType: 'number', min: 0, arrayOk: true, role: 'style', description: 'Sets the width (in px) of the lines bounding the marker points.' + }, + colorscale: { + valType: 'colorscale', + role: 'style', + description: [ + 'Sets the colorscale and only has an effect', + 'if `marker.line.color` is set to a numerical array.', + 'The colorscale must be an array containing', + 'arrays mapping a normalized value to an', + 'rgb, rgba, hex, hsl, hsv, or named color string.', + 'At minimum, a mapping for the lowest (0) and highest (1)', + 'values are required. For example,', + '`[[0, \'rgb(0,0,255)\', [1, \'rgb(255,0,0)\']]`.', + 'To control the bounds of the colorscale in color space,', + 'use `marker.line.cmin` and `marker.line.cmax`.' + ].join(' ') + }, + cauto: { + valType: 'boolean', + dflt: true, + role: 'style', + description: [ + 'Has an effect only if `marker.line.color` is set to a numerical array.', + 'Determines the whether or not the color domain is computed', + 'with respect to the input data.' + ].join(' ') + }, + cmax: { + valType: 'number', + dflt: null, + role: 'info', + description: [ + 'Has an effect only if `marker.line.color` is set to a numerical array.', + 'Sets the upper bound of the color domain.', + 'Value should be associated to the `marker.line.color` array index,', + 'and if set, `marker.line.cmin` must be set as well.' + ].join(' ') + }, + cmin: { + valType: 'number', + dflt: null, + role: 'info', + description: [ + 'Has an effect only if `marker.line.color` is set to a numerical array.', + 'Sets the lower bound of the color domain.', + 'Value should be associated to the `marker.line.color` array index,', + 'and if set, `marker.line.cmax` must be set as well.' + ].join(' ') + }, + autocolorscale: { + valType: 'boolean', + dflt: true, + role: 'style', + description: [ + 'Has an effect only if `marker.line.color` is set to a numerical array.', + 'Determines whether or not the colorscale is picked using', + 'the sign of values inside `marker.line.color`.' + ].join(' ') + }, + reversescale: { + valType: 'boolean', + dflt: false, + role: 'style', + description: [ + 'Has an effect only if `marker.line.color` is set to a numerical array.', + 'Reverses the colorscale.' + ].join(' ') } - }, - colorAttributes('marker.line') - ) + } }, - colorAttributes('marker') - ), textposition: { valType: 'enumerated', values: [ @@ -92259,7 +92282,7 @@ module.exports = { } }; -},{"../../components/colorscale/color_attributes":311,"../../components/drawing":326,"../../lib/extend":377,"./constants":560}],557:[function(require,module,exports){ +},{"../../components/drawing":325,"./constants":558}],555:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -92283,9 +92306,13 @@ var calcMarkerColorscale = require('./marker_colorscale_calc'); module.exports = function calc(gd, trace) { var xa = Axes.getFromId(gd, trace.xaxis || 'x'), ya = Axes.getFromId(gd, trace.yaxis || 'y'); + Lib.markTime('in Scatter.calc'); + + var x = xa.makeCalcdata(trace, 'x'); + Lib.markTime('finished convert x'); - var x = xa.makeCalcdata(trace, 'x'), - y = ya.makeCalcdata(trace, 'y'); + var y = ya.makeCalcdata(trace, 'y'); + Lib.markTime('finished convert y'); var serieslen = Math.min(x.length, y.length), marker, @@ -92369,8 +92396,11 @@ module.exports = function calc(gd, trace) { yOptions.padded = false; } + Lib.markTime('ready for Axes.expand'); Axes.expand(xa, x, xOptions); + Lib.markTime('done expand x'); Axes.expand(ya, y, yOptions); + Lib.markTime('done expand y'); // create the "calculated data" to plot var cd = new Array(serieslen); @@ -92386,7 +92416,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../../lib":382,"../../plots/cartesian/axes":405,"./marker_colorscale_calc":570,"./subtypes":575,"fast-isnumeric":117}],558:[function(require,module,exports){ +},{"../../lib":381,"../../plots/cartesian/axes":403,"./marker_colorscale_calc":568,"./subtypes":573,"fast-isnumeric":117}],556:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -92427,7 +92457,7 @@ module.exports = function cleanData(fullData) { } }; -},{}],559:[function(require,module,exports){ +},{}],557:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -92478,9 +92508,11 @@ module.exports = function colorbar(gd, cd) { .range(scl.map(function(v) { return v[1]; }))) .filllevels({start: cmin, end: cmax, size: (cmax - cmin) / 254}) .options(marker.colorbar)(); + + Lib.markTime('done colorbar'); }; -},{"../../components/colorbar/draw":306,"../../components/colorscale/get_scale":315,"../../lib":382,"../../plots/plots":454,"d3":113,"fast-isnumeric":117}],560:[function(require,module,exports){ +},{"../../components/colorbar/draw":306,"../../components/colorscale/get_scale":314,"../../lib":381,"../../plots/plots":452,"d3":113,"fast-isnumeric":117}],558:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -92496,7 +92528,7 @@ module.exports = { PTS_LINESONLY: 20 }; -},{}],561:[function(require,module,exports){ +},{}],559:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -92566,7 +92598,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout errorBarsSupplyDefaults(traceIn, traceOut, defaultColor, {axis: 'x', inherit: 'y'}); }; -},{"../../components/errorbars/defaults":331,"../../lib":382,"./attributes":556,"./constants":560,"./fillcolor_defaults":562,"./line_defaults":566,"./line_shape_defaults":568,"./marker_defaults":571,"./subtypes":575,"./text_defaults":576,"./xy_defaults":577}],562:[function(require,module,exports){ +},{"../../components/errorbars/defaults":330,"../../lib":381,"./attributes":554,"./constants":558,"./fillcolor_defaults":560,"./line_defaults":564,"./line_shape_defaults":566,"./marker_defaults":569,"./subtypes":573,"./text_defaults":574,"./xy_defaults":575}],560:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -92605,7 +92637,7 @@ module.exports = function fillColorDefaults(traceIn, traceOut, defaultColor, coe )); }; -},{"../../components/color":303}],563:[function(require,module,exports){ +},{"../../components/color":303}],561:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -92658,7 +92690,7 @@ module.exports = function getTraceColor(trace, di) { } }; -},{"../../components/color":303,"./subtypes":575}],564:[function(require,module,exports){ +},{"../../components/color":303,"./subtypes":573}],562:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -92729,7 +92761,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) { return [pointData]; }; -},{"../../components/errorbars":332,"../../plots/cartesian/graph_interact":412,"./get_trace_color":563}],565:[function(require,module,exports){ +},{"../../components/errorbars":331,"../../plots/cartesian/graph_interact":410,"./get_trace_color":561}],563:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -92778,7 +92810,7 @@ Scatter.meta = { module.exports = Scatter; -},{"../../plots/cartesian":413,"./arrays_to_calcdata":555,"./attributes":556,"./calc":557,"./clean_data":558,"./colorbar":559,"./defaults":561,"./hover":564,"./plot":572,"./select":573,"./style":574,"./subtypes":575}],566:[function(require,module,exports){ +},{"../../plots/cartesian":411,"./arrays_to_calcdata":553,"./attributes":554,"./calc":555,"./clean_data":556,"./colorbar":557,"./defaults":559,"./hover":562,"./plot":570,"./select":571,"./style":572,"./subtypes":573}],564:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -92802,7 +92834,7 @@ module.exports = function lineDefaults(traceIn, traceOut, defaultColor, coerce) coerce('line.dash'); }; -},{}],567:[function(require,module,exports){ +},{}],565:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -92971,7 +93003,7 @@ module.exports = function linePoints(d, opts) { return segments; }; -},{"../../plots/cartesian/axes":405}],568:[function(require,module,exports){ +},{"../../plots/cartesian/axes":403}],566:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -92990,7 +93022,7 @@ module.exports = function handleLineShapeDefaults(traceIn, traceOut, coerce) { if(shape === 'spline') coerce('line.smoothing'); }; -},{}],569:[function(require,module,exports){ +},{}],567:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -93032,7 +93064,7 @@ module.exports = function makeBubbleSizeFn(trace) { }; }; -},{"fast-isnumeric":117}],570:[function(require,module,exports){ +},{"fast-isnumeric":117}],568:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -93066,7 +93098,7 @@ module.exports = function calcMarkerColorscale(trace) { } }; -},{"../../components/colorscale/calc":310,"../../components/colorscale/has_colorscale":316,"./subtypes":575}],571:[function(require,module,exports){ +},{"../../components/colorscale/calc":310,"../../components/colorscale/has_colorscale":315,"./subtypes":573}],569:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -93129,7 +93161,7 @@ module.exports = function markerDefaults(traceIn, traceOut, defaultColor, layout } }; -},{"../../components/color":303,"../../components/colorscale/defaults":313,"../../components/colorscale/has_colorscale":316,"./subtypes":575}],572:[function(require,module,exports){ +},{"../../components/color":303,"../../components/colorscale/defaults":312,"../../components/colorscale/has_colorscale":315,"./subtypes":573}],570:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -93403,7 +93435,7 @@ function selectMarkers(gd, plotinfo, cdscatter) { }); } -},{"../../components/drawing":326,"../../components/errorbars":332,"../../lib":382,"./arrays_to_calcdata":555,"./line_points":567,"./subtypes":575,"d3":113}],573:[function(require,module,exports){ +},{"../../components/drawing":325,"../../components/errorbars":331,"../../lib":381,"./arrays_to_calcdata":553,"./line_points":565,"./subtypes":573,"d3":113}],571:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -93473,7 +93505,7 @@ module.exports = function selectPoints(searchInfo, polygon) { return selection; }; -},{"./subtypes":575}],574:[function(require,module,exports){ +},{"./subtypes":573}],572:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -93515,7 +93547,7 @@ module.exports = function style(gd) { s.call(ErrorBars.style); }; -},{"../../components/drawing":326,"../../components/errorbars":332,"d3":113}],575:[function(require,module,exports){ +},{"../../components/drawing":325,"../../components/errorbars":331,"d3":113}],573:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -93549,7 +93581,7 @@ module.exports = { } }; -},{}],576:[function(require,module,exports){ +},{}],574:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -93570,7 +93602,7 @@ module.exports = function(traceIn, traceOut, layout, coerce) { Lib.coerceFont(coerce, 'textfont', layout.font); }; -},{"../../lib":382}],577:[function(require,module,exports){ +},{"../../lib":381}],575:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -93615,7 +93647,7 @@ module.exports = function handleXYDefaults(traceIn, traceOut, coerce) { return len; }; -},{}],578:[function(require,module,exports){ +},{}],576:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -93624,11 +93656,10 @@ module.exports = function handleXYDefaults(traceIn, traceOut, coerce) { * LICENSE file in the root directory of this source tree. */ + 'use strict'; var scatterAttrs = require('../scatter/attributes'); -var colorAttributes = require('../../components/colorscale/color_attributes'); - var MARKER_SYMBOLS = require('../../constants/gl_markers'); var extendFlat = require('../../lib/extend').extendFlat; @@ -93720,7 +93751,8 @@ module.exports = { width: scatterLineAttrs.width, dash: scatterLineAttrs.dash }, - marker: extendFlat({}, { // Parity with scatter.js? + marker: { // Parity with scatter.js? + color: scatterMarkerAttrs.color, symbol: { valType: 'enumerated', values: Object.keys(MARKER_SYMBOLS), @@ -93744,14 +93776,24 @@ module.exports = { 'to an rgba color and use its alpha channel.' ].join(' ') }), + colorscale: scatterMarkerAttrs.colorscale, + cauto: scatterMarkerAttrs.cauto, + cmax: scatterMarkerAttrs.cmax, + cmin: scatterMarkerAttrs.cmin, + autocolorscale: scatterMarkerAttrs.autocolorscale, + reversescale: scatterMarkerAttrs.reversescale, showscale: scatterMarkerAttrs.showscale, - line: extendFlat({}, - {width: extendFlat({}, scatterMarkerLineAttrs.width, {arrayOk: false})}, - colorAttributes('marker.line') - ) + line: { + color: scatterMarkerLineAttrs.color, + width: extendFlat({}, scatterMarkerLineAttrs.width, {arrayOk: false}), + colorscale: scatterMarkerLineAttrs.colorscale, + cauto: scatterMarkerLineAttrs.cauto, + cmax: scatterMarkerLineAttrs.cmax, + cmin: scatterMarkerLineAttrs.cmin, + autocolorscale: scatterMarkerLineAttrs.autocolorscale, + reversescale: scatterMarkerLineAttrs.reversescale + } }, - colorAttributes('marker') - ), textposition: extendFlat({}, scatterAttrs.textposition, {dflt: 'top center'}), textfont: scatterAttrs.textfont, _nestedModules: { @@ -93762,7 +93804,7 @@ module.exports = { } }; -},{"../../components/colorscale/color_attributes":311,"../../constants/gl_markers":369,"../../lib/extend":377,"../scatter/attributes":556}],579:[function(require,module,exports){ +},{"../../constants/gl_markers":368,"../../lib/extend":376,"../scatter/attributes":554}],577:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -93791,7 +93833,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../scatter/arrays_to_calcdata":555,"../scatter/marker_colorscale_calc":570}],580:[function(require,module,exports){ +},{"../scatter/arrays_to_calcdata":553,"../scatter/marker_colorscale_calc":568}],578:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -93862,7 +93904,7 @@ function calculateErrors(data, scaleFactor) { module.exports = calculateErrors; -},{"../../components/errorbars/compute_error":330}],581:[function(require,module,exports){ +},{"../../components/errorbars/compute_error":329}],579:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -94321,7 +94363,7 @@ function createLineWithMarkers(scene, data) { module.exports = createLineWithMarkers; -},{"../../constants/gl3d_dashes":368,"../../constants/gl_markers":369,"../../lib":382,"../../lib/gl_format_color":380,"../../lib/str2rgbarray":394,"../scatter/make_bubble_size_func":569,"./calc_errors":580,"delaunay-triangulate":114,"gl-error3d":121,"gl-line3d":127,"gl-mesh3d":150,"gl-scatter3d":193}],582:[function(require,module,exports){ +},{"../../constants/gl3d_dashes":367,"../../constants/gl_markers":368,"../../lib":381,"../../lib/gl_format_color":379,"../../lib/str2rgbarray":392,"../scatter/make_bubble_size_func":567,"./calc_errors":578,"delaunay-triangulate":114,"gl-error3d":121,"gl-line3d":127,"gl-mesh3d":150,"gl-scatter3d":193}],580:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -94406,7 +94448,7 @@ function handleXYZDefaults(traceIn, traceOut, coerce) { return len; } -},{"../../components/errorbars/defaults":331,"../../lib":382,"../scatter/line_defaults":566,"../scatter/marker_defaults":571,"../scatter/subtypes":575,"../scatter/text_defaults":576,"./attributes":578}],583:[function(require,module,exports){ +},{"../../components/errorbars/defaults":330,"../../lib":381,"../scatter/line_defaults":564,"../scatter/marker_defaults":569,"../scatter/subtypes":573,"../scatter/text_defaults":574,"./attributes":576}],581:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -94444,7 +94486,7 @@ Scatter3D.meta = { module.exports = Scatter3D; -},{"../../constants/gl_markers":369,"../../plots/gl3d":441,"../scatter/colorbar":559,"./attributes":578,"./calc":579,"./convert":581,"./defaults":582}],584:[function(require,module,exports){ +},{"../../constants/gl_markers":368,"../../plots/gl3d":439,"../scatter/colorbar":557,"./attributes":576,"./calc":577,"./convert":579,"./defaults":580}],582:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -94457,14 +94499,13 @@ module.exports = Scatter3D; var scatterAttrs = require('../scatter/attributes'); var plotAttrs = require('../../plots/attributes'); -var colorAttributes = require('../../components/colorscale/color_attributes'); - var extendFlat = require('../../lib/extend').extendFlat; var scatterMarkerAttrs = scatterAttrs.marker, scatterLineAttrs = scatterAttrs.line, scatterMarkerLineAttrs = scatterMarkerAttrs.line; + module.exports = { lon: { valType: 'data_array', @@ -94508,21 +94549,32 @@ module.exports = { width: scatterLineAttrs.width, dash: scatterLineAttrs.dash }, - marker: extendFlat({}, { + marker: { symbol: scatterMarkerAttrs.symbol, opacity: scatterMarkerAttrs.opacity, size: scatterMarkerAttrs.size, sizeref: scatterMarkerAttrs.sizeref, sizemin: scatterMarkerAttrs.sizemin, sizemode: scatterMarkerAttrs.sizemode, + color: scatterMarkerAttrs.color, + colorscale: scatterMarkerAttrs.colorscale, + cauto: scatterMarkerAttrs.cauto, + cmax: scatterMarkerAttrs.cmax, + cmin: scatterMarkerAttrs.cmin, + autocolorscale: scatterMarkerAttrs.autocolorscale, + reversescale: scatterMarkerAttrs.reversescale, showscale: scatterMarkerAttrs.showscale, - line: extendFlat({}, - {width: scatterMarkerLineAttrs.width}, - colorAttributes('marker.line') - ) + line: { + color: scatterMarkerLineAttrs.color, + width: scatterMarkerLineAttrs.width, + colorscale: scatterMarkerLineAttrs.colorscale, + cauto: scatterMarkerLineAttrs.cauto, + cmax: scatterMarkerLineAttrs.cmax, + cmin: scatterMarkerLineAttrs.cmin, + autocolorscale: scatterMarkerLineAttrs.autocolorscale, + reversescale: scatterMarkerLineAttrs.reversescale + } }, - colorAttributes('marker') - ), textfont: scatterAttrs.textfont, textposition: scatterAttrs.textposition, hoverinfo: extendFlat({}, plotAttrs.hoverinfo, { @@ -94533,7 +94585,7 @@ module.exports = { } }; -},{"../../components/colorscale/color_attributes":311,"../../lib/extend":377,"../../plots/attributes":403,"../scatter/attributes":556}],585:[function(require,module,exports){ +},{"../../lib/extend":376,"../../plots/attributes":401,"../scatter/attributes":554}],583:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -94556,7 +94608,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../scatter/marker_colorscale_calc":570}],586:[function(require,module,exports){ +},{"../scatter/marker_colorscale_calc":568}],584:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -94629,7 +94681,7 @@ function handleLonLatLocDefaults(traceIn, traceOut, coerce) { return len; } -},{"../../lib":382,"../scatter/line_defaults":566,"../scatter/marker_defaults":571,"../scatter/subtypes":575,"../scatter/text_defaults":576,"./attributes":584}],587:[function(require,module,exports){ +},{"../../lib":381,"../scatter/line_defaults":564,"../scatter/marker_defaults":569,"../scatter/subtypes":573,"../scatter/text_defaults":574,"./attributes":582}],585:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -94664,7 +94716,7 @@ ScatterGeo.meta = { module.exports = ScatterGeo; -},{"../../plots/geo":426,"../scatter/colorbar":559,"./attributes":584,"./calc":585,"./defaults":586,"./plot":588}],588:[function(require,module,exports){ +},{"../../plots/geo":424,"../scatter/colorbar":557,"./attributes":582,"./calc":583,"./defaults":584,"./plot":586}],586:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -94964,7 +95016,7 @@ function makeEventDataFunc(trace) { }; } -},{"../../components/color":303,"../../components/drawing":326,"../../lib/array_to_calc_item":373,"../../lib/geo_location_utils":379,"../../lib/topojson_utils":396,"../../plots/cartesian/axes":405,"../../plots/cartesian/graph_interact":412,"../scatter/subtypes":575,"./attributes":584,"d3":113}],589:[function(require,module,exports){ +},{"../../components/color":303,"../../components/drawing":325,"../../lib/array_to_calc_item":372,"../../lib/geo_location_utils":378,"../../lib/topojson_utils":394,"../../plots/cartesian/axes":403,"../../plots/cartesian/graph_interact":410,"../scatter/subtypes":573,"./attributes":582,"d3":113}],587:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -94976,12 +95028,9 @@ function makeEventDataFunc(trace) { 'use strict'; var scatterAttrs = require('../scatter/attributes'); -var colorAttributes = require('../../components/colorscale/color_attributes'); - var DASHES = require('../../constants/gl2d_dashes'); var MARKERS = require('../../constants/gl_markers'); var extendFlat = require('../../lib/extend').extendFlat; -var extendDeep = require('../../lib/extend').extendDeep; var scatterLineAttrs = scatterAttrs.line, scatterMarkerAttrs = scatterAttrs.marker, @@ -95023,7 +95072,8 @@ module.exports = { description: 'Sets the style of the lines.' } }, - marker: extendDeep({}, colorAttributes('marker'), { + marker: { + color: scatterMarkerAttrs.color, symbol: { valType: 'enumerated', values: Object.keys(MARKERS), @@ -95037,11 +95087,24 @@ module.exports = { sizemin: scatterMarkerAttrs.sizemin, sizemode: scatterMarkerAttrs.sizemode, opacity: scatterMarkerAttrs.opacity, + colorscale: scatterMarkerAttrs.colorscale, + cauto: scatterMarkerAttrs.cauto, + cmax: scatterMarkerAttrs.cmax, + cmin: scatterMarkerAttrs.cmin, + autocolorscale: scatterMarkerAttrs.autocolorscale, + reversescale: scatterMarkerAttrs.reversescale, showscale: scatterMarkerAttrs.showscale, - line: extendDeep({}, colorAttributes('marker.line'), { - width: scatterMarkerLineAttrs.width - }) - }), + line: { + color: scatterMarkerLineAttrs.color, + width: scatterMarkerLineAttrs.width, + colorscale: scatterMarkerLineAttrs.colorscale, + cauto: scatterMarkerLineAttrs.cauto, + cmax: scatterMarkerLineAttrs.cmax, + cmin: scatterMarkerLineAttrs.cmin, + autocolorscale: scatterMarkerLineAttrs.autocolorscale, + reversescale: scatterMarkerLineAttrs.reversescale + } + }, connectgaps: scatterAttrs.connectgaps, fill: extendFlat({}, scatterAttrs.fill, { values: ['none', 'tozeroy', 'tozerox'] @@ -95054,7 +95117,7 @@ module.exports = { } }; -},{"../../components/colorscale/color_attributes":311,"../../constants/gl2d_dashes":367,"../../constants/gl_markers":369,"../../lib/extend":377,"../scatter/attributes":556}],590:[function(require,module,exports){ +},{"../../constants/gl2d_dashes":366,"../../constants/gl_markers":368,"../../lib/extend":376,"../scatter/attributes":554}],588:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -95164,7 +95227,6 @@ var proto = LineWithMarkers.prototype; proto.handlePick = function(pickResult) { var index = pickResult.pointId; - if(pickResult.object !== this.line || this.connectgaps) { index = this.idToIndex[pickResult.pointId]; } @@ -95194,20 +95256,19 @@ proto.isFancy = function(options) { if(!options.x || !options.y) return true; - if(this.hasMarkers) { - var marker = options.marker || {}; + var marker = options.marker || {}; + if(Array.isArray(marker.symbol) || + marker.symbol !== 'circle' || + Array.isArray(marker.size) || + Array.isArray(marker.line.width) || + Array.isArray(marker.opacity) + ) return true; - if(Array.isArray(marker.symbol) || - marker.symbol !== 'circle' || - Array.isArray(marker.size) || - Array.isArray(marker.color) || - Array.isArray(marker.line.width) || - Array.isArray(marker.line.color) || - Array.isArray(marker.opacity) - ) return true; - } + var markerColor = marker.color; + if(Array.isArray(markerColor)) return true; - if(this.hasLines && !this.connectgaps) return true; + var lineColor = Array.isArray(marker.line.color); + if(Array.isArray(lineColor)) return true; if(this.hasErrorX) return true; if(this.hasErrorY) return true; @@ -95530,10 +95591,8 @@ proto.updateFancy = function(options) { proto.updateLines = function(options, positions) { var i; - if(this.hasLines) { var linePositions = positions; - if(!options.connectgaps) { var p = 0; var x = this.xData; @@ -95545,11 +95604,12 @@ proto.updateLines = function(options, positions) { linePositions[p++] = y[i]; } } - this.lineOptions.positions = linePositions; - var lineColor = convertColor(options.line.color, options.opacity, 1), - lineWidth = Math.round(0.5 * this.lineOptions.width), + var lineColor = str2RGBArray(options.line.color); + if(this.hasMarkers) lineColor[3] *= options.marker.opacity; + + var lineWidth = Math.round(0.5 * this.lineOptions.width), dashes = (DASHES[options.line.dash] || [1]).slice(); for(i = 0; i < dashes.length; ++i) dashes[i] *= lineWidth; @@ -95646,7 +95706,7 @@ function createLineWithMarkers(scene, data) { module.exports = createLineWithMarkers; -},{"../../components/errorbars":332,"../../constants/gl2d_dashes":367,"../../constants/gl_markers":369,"../../lib":382,"../../lib/gl_format_color":380,"../../lib/str2rgbarray":394,"../../plots/cartesian/axes":405,"../scatter/get_trace_color":563,"../scatter/make_bubble_size_func":569,"../scatter/subtypes":575,"fast-isnumeric":117,"gl-error2d":119,"gl-line2d":125,"gl-scatter2d":190,"gl-scatter2d-fancy":185}],591:[function(require,module,exports){ +},{"../../components/errorbars":331,"../../constants/gl2d_dashes":366,"../../constants/gl_markers":368,"../../lib":381,"../../lib/gl_format_color":379,"../../lib/str2rgbarray":392,"../../plots/cartesian/axes":403,"../scatter/get_trace_color":561,"../scatter/make_bubble_size_func":567,"../scatter/subtypes":573,"fast-isnumeric":117,"gl-error2d":119,"gl-line2d":125,"gl-scatter2d":190,"gl-scatter2d-fancy":185}],589:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -95703,7 +95763,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout errorBarsSupplyDefaults(traceIn, traceOut, defaultColor, {axis: 'x', inherit: 'y'}); }; -},{"../../components/errorbars/defaults":331,"../../lib":382,"../scatter/constants":560,"../scatter/fillcolor_defaults":562,"../scatter/line_defaults":566,"../scatter/marker_defaults":571,"../scatter/subtypes":575,"../scatter/xy_defaults":577,"./attributes":589}],592:[function(require,module,exports){ +},{"../../components/errorbars/defaults":330,"../../lib":381,"../scatter/constants":558,"../scatter/fillcolor_defaults":560,"../scatter/line_defaults":564,"../scatter/marker_defaults":569,"../scatter/subtypes":573,"../scatter/xy_defaults":575,"./attributes":587}],590:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -95739,7 +95799,7 @@ ScatterGl.meta = { module.exports = ScatterGl; -},{"../../plots/gl2d":438,"../scatter/colorbar":559,"../scatter3d/calc":579,"./attributes":589,"./convert":590,"./defaults":591}],593:[function(require,module,exports){ +},{"../../plots/gl2d":436,"../scatter/colorbar":557,"../scatter3d/calc":577,"./attributes":587,"./convert":588,"./defaults":589}],591:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -95752,14 +95812,13 @@ module.exports = ScatterGl; var scatterAttrs = require('../scatter/attributes'); var plotAttrs = require('../../plots/attributes'); -var colorAttributes = require('../../components/colorscale/color_attributes'); - var extendFlat = require('../../lib/extend').extendFlat; var scatterMarkerAttrs = scatterAttrs.marker, scatterLineAttrs = scatterAttrs.line, scatterMarkerLineAttrs = scatterMarkerAttrs.line; + module.exports = { a: { valType: 'data_array', @@ -95838,7 +95897,7 @@ module.exports = { ].join(' ') }), fillcolor: scatterAttrs.fillcolor, - marker: extendFlat({}, { + marker: { symbol: scatterMarkerAttrs.symbol, opacity: scatterMarkerAttrs.opacity, maxdisplayed: scatterMarkerAttrs.maxdisplayed, @@ -95846,14 +95905,25 @@ module.exports = { sizeref: scatterMarkerAttrs.sizeref, sizemin: scatterMarkerAttrs.sizemin, sizemode: scatterMarkerAttrs.sizemode, + color: scatterMarkerAttrs.color, + colorscale: scatterMarkerAttrs.colorscale, + cauto: scatterMarkerAttrs.cauto, + cmax: scatterMarkerAttrs.cmax, + cmin: scatterMarkerAttrs.cmin, + autocolorscale: scatterMarkerAttrs.autocolorscale, + reversescale: scatterMarkerAttrs.reversescale, showscale: scatterMarkerAttrs.showscale, - line: extendFlat({}, - {width: scatterMarkerLineAttrs.width}, - colorAttributes('marker'.line) - ) + line: { + color: scatterMarkerLineAttrs.color, + width: scatterMarkerLineAttrs.width, + colorscale: scatterMarkerLineAttrs.colorscale, + cauto: scatterMarkerLineAttrs.cauto, + cmax: scatterMarkerLineAttrs.cmax, + cmin: scatterMarkerLineAttrs.cmin, + autocolorscale: scatterMarkerLineAttrs.autocolorscale, + reversescale: scatterMarkerLineAttrs.reversescale + } }, - colorAttributes('marker') - ), textfont: scatterAttrs.textfont, textposition: scatterAttrs.textposition, hoverinfo: extendFlat({}, plotAttrs.hoverinfo, { @@ -95864,7 +95934,7 @@ module.exports = { } }; -},{"../../components/colorscale/color_attributes":311,"../../lib/extend":377,"../../plots/attributes":403,"../scatter/attributes":556}],594:[function(require,module,exports){ +},{"../../lib/extend":376,"../../plots/attributes":401,"../scatter/attributes":554}],592:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -95963,7 +96033,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../../lib":382,"../../plots/cartesian/axes":405,"../scatter/marker_colorscale_calc":570,"../scatter/subtypes":575,"fast-isnumeric":117}],595:[function(require,module,exports){ +},{"../../lib":381,"../../plots/cartesian/axes":403,"../scatter/marker_colorscale_calc":568,"../scatter/subtypes":573,"fast-isnumeric":117}],593:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -96060,7 +96130,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout coerce('hoverinfo', (layout._dataLength === 1) ? 'a+b+c+text' : undefined); }; -},{"../../lib":382,"../scatter/constants":560,"../scatter/fillcolor_defaults":562,"../scatter/line_defaults":566,"../scatter/line_shape_defaults":568,"../scatter/marker_defaults":571,"../scatter/subtypes":575,"../scatter/text_defaults":576,"./attributes":593}],596:[function(require,module,exports){ +},{"../../lib":381,"../scatter/constants":558,"../scatter/fillcolor_defaults":560,"../scatter/line_defaults":564,"../scatter/line_shape_defaults":566,"../scatter/marker_defaults":569,"../scatter/subtypes":573,"../scatter/text_defaults":574,"./attributes":591}],594:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -96110,7 +96180,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) { return scatterPointData; }; -},{"../../plots/cartesian/axes":405,"../scatter/hover":564}],597:[function(require,module,exports){ +},{"../../plots/cartesian/axes":403,"../scatter/hover":562}],595:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -96146,7 +96216,7 @@ ScatterTernary.meta = { module.exports = ScatterTernary; -},{"../../plots/ternary":461,"../scatter/colorbar":559,"./attributes":593,"./calc":594,"./defaults":595,"./hover":596,"./plot":598,"./select":599,"./style":600}],598:[function(require,module,exports){ +},{"../../plots/ternary":459,"../scatter/colorbar":557,"./attributes":591,"./calc":592,"./defaults":593,"./hover":594,"./plot":596,"./select":597,"./style":598}],596:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -96162,16 +96232,11 @@ var scatterPlot = require('../scatter/plot'); module.exports = function plot(ternary, data) { - var plotContainer = ternary.plotContainer; - - // remove all nodes inside the scatter layer - plotContainer.select('.scatterlayer').selectAll('*').remove(); - // mimic cartesian plotinfo var plotinfo = { x: function() { return ternary.xaxis; }, y: function() { return ternary.yaxis; }, - plot: plotContainer + plot: ternary.plotContainer }; var calcdata = new Array(data.length), @@ -96192,7 +96257,7 @@ module.exports = function plot(ternary, data) { scatterPlot(ternary.graphDiv, plotinfo, calcdata); }; -},{"../scatter/plot":572}],599:[function(require,module,exports){ +},{"../scatter/plot":570}],597:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -96227,7 +96292,7 @@ module.exports = function selectPoints(searchInfo, polygon) { return selection; }; -},{"../scatter/select":573}],600:[function(require,module,exports){ +},{"../scatter/select":571}],598:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -96256,7 +96321,7 @@ module.exports = function style(gd) { scatterStyle(gd); }; -},{"../scatter/style":574}],601:[function(require,module,exports){ +},{"../scatter/style":572}],599:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -96265,12 +96330,14 @@ module.exports = function style(gd) { * LICENSE file in the root directory of this source tree. */ + 'use strict'; var Color = require('../../components/color'); var colorscaleAttrs = require('../../components/colorscale/attributes'); var extendFlat = require('../../lib/extend').extendFlat; + function makeContourProjAttr(axLetter) { return { valType: 'boolean', @@ -96378,7 +96445,6 @@ module.exports = { ].join(' ') }, - // Todo this block has a structure of colorscale/attributes.js but with colorscale/color_attributes.js names cauto: colorscaleAttrs.zauto, cmin: colorscaleAttrs.zmin, cmax: colorscaleAttrs.zmax, @@ -96419,7 +96485,7 @@ module.exports = { role: 'style', min: -1e5, max: 1e5, - dflt: 1e4, + dflt: 1e5, description: 'Numeric vector, representing the Y coordinate for each vertex.' }, z: { @@ -96504,7 +96570,7 @@ module.exports = { } }; -},{"../../components/color":303,"../../components/colorscale/attributes":309,"../../lib/extend":377}],602:[function(require,module,exports){ +},{"../../components/color":303,"../../components/colorscale/attributes":309,"../../lib/extend":376}],600:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -96528,7 +96594,7 @@ module.exports = function calc(gd, trace) { } }; -},{"../../components/colorscale/calc":310}],603:[function(require,module,exports){ +},{"../../components/colorscale/calc":310}],601:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -96573,9 +96639,11 @@ module.exports = function colorbar(gd, cd) { .range(scl.map(function(v) { return v[1]; }))) .filllevels({start: zmin, end: zmax, size: (zmax - zmin) / 254}) .options(trace.colorbar)(); + + Lib.markTime('done colorbar'); }; -},{"../../components/colorbar/draw":306,"../../components/colorscale/get_scale":315,"../../lib":382,"../../plots/plots":454,"d3":113,"fast-isnumeric":117}],604:[function(require,module,exports){ +},{"../../components/colorbar/draw":306,"../../components/colorscale/get_scale":314,"../../lib":381,"../../plots/plots":452,"d3":113,"fast-isnumeric":117}],602:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -96913,7 +96981,13 @@ proto.update = function(data) { } if('lightposition' in data) { - surface.lightPosition = [data.lightposition.x, data.lightposition.y, data.lightposition.z]; + if(surface.lightPosition === void(0)) { + surface.lightPosition = [data.lightposition.x, data.lightposition.y, data.lightposition.z]; + } else { + surface.lightPosition.x = data.lightposition.x; + surface.lightPosition.y = data.lightposition.y; + surface.lightPosition.z = data.lightposition.z; + } } if(alpha && alpha < 1) { @@ -96938,7 +97012,7 @@ function createSurfaceTrace(scene, data) { module.exports = createSurfaceTrace; -},{"../../lib/str2rgbarray":394,"gl-surface3d":221,"ndarray":253,"ndarray-fill":246,"ndarray-homography":251,"ndarray-ops":252,"tinycolor2":274}],605:[function(require,module,exports){ +},{"../../lib/str2rgbarray":392,"gl-surface3d":221,"ndarray":253,"ndarray-fill":246,"ndarray-homography":251,"ndarray-ops":252,"tinycolor2":274}],603:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -97055,7 +97129,7 @@ function mapLegacy(traceIn, oldAttr, newAttr) { } } -},{"../../components/colorscale/defaults":313,"../../lib":382,"./attributes":601}],606:[function(require,module,exports){ +},{"../../components/colorscale/defaults":312,"../../lib":381,"./attributes":599}],604:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -97098,5 +97172,5 @@ Surface.meta = { module.exports = Surface; -},{"../../plots/gl3d":441,"./attributes":601,"./calc":602,"./colorbar":603,"./convert":604,"./defaults":605}]},{},[12])(12) +},{"../../plots/gl3d":439,"./attributes":599,"./calc":600,"./colorbar":601,"./convert":602,"./defaults":603}]},{},[12])(12) }); \ No newline at end of file diff --git a/dist/plotly.js b/dist/plotly.js index 6f895d0fe5e..c2e25d5b350 100644 --- a/dist/plotly.js +++ b/dist/plotly.js @@ -1,5 +1,5 @@ /** -* plotly.js v1.13.0 +* plotly.js v1.12.0 * Copyright 2012-2016, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -68,7 +68,7 @@ for(var selector in rules) { Plotly.Lib.addStyleRule(fullSelector, rules[selector]); } -},{"../src/plotly":402}],2:[function(require,module,exports){ +},{"../src/plotly":400}],2:[function(require,module,exports){ 'use strict'; module.exports = { @@ -199,7 +199,7 @@ module.exports = { module.exports = require('../src/traces/bar'); -},{"../src/traces/bar":480}],4:[function(require,module,exports){ +},{"../src/traces/bar":478}],4:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -210,7 +210,7 @@ module.exports = require('../src/traces/bar'); module.exports = require('../src/traces/box'); -},{"../src/traces/box":491}],5:[function(require,module,exports){ +},{"../src/traces/box":489}],5:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -221,7 +221,7 @@ module.exports = require('../src/traces/box'); module.exports = require('../src/traces/choropleth'); -},{"../src/traces/choropleth":500}],6:[function(require,module,exports){ +},{"../src/traces/choropleth":498}],6:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -232,7 +232,7 @@ module.exports = require('../src/traces/choropleth'); module.exports = require('../src/traces/contour'); -},{"../src/traces/contour":507}],7:[function(require,module,exports){ +},{"../src/traces/contour":505}],7:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -243,7 +243,7 @@ module.exports = require('../src/traces/contour'); module.exports = require('../src/core'); -},{"../src/core":371}],8:[function(require,module,exports){ +},{"../src/core":370}],8:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -254,7 +254,7 @@ module.exports = require('../src/core'); module.exports = require('../src/traces/heatmap'); -},{"../src/traces/heatmap":519}],9:[function(require,module,exports){ +},{"../src/traces/heatmap":517}],9:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -265,7 +265,7 @@ module.exports = require('../src/traces/heatmap'); module.exports = require('../src/traces/histogram'); -},{"../src/traces/histogram":530}],10:[function(require,module,exports){ +},{"../src/traces/histogram":528}],10:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -276,7 +276,7 @@ module.exports = require('../src/traces/histogram'); module.exports = require('../src/traces/histogram2d'); -},{"../src/traces/histogram2d":535}],11:[function(require,module,exports){ +},{"../src/traces/histogram2d":533}],11:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -287,7 +287,7 @@ module.exports = require('../src/traces/histogram2d'); module.exports = require('../src/traces/histogram2dcontour'); -},{"../src/traces/histogram2dcontour":539}],12:[function(require,module,exports){ +},{"../src/traces/histogram2dcontour":537}],12:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -336,7 +336,7 @@ module.exports = Core; module.exports = require('../src/traces/mesh3d'); -},{"../src/traces/mesh3d":543}],14:[function(require,module,exports){ +},{"../src/traces/mesh3d":541}],14:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -347,7 +347,7 @@ module.exports = require('../src/traces/mesh3d'); module.exports = require('../src/traces/pie'); -},{"../src/traces/pie":549}],15:[function(require,module,exports){ +},{"../src/traces/pie":547}],15:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -358,7 +358,7 @@ module.exports = require('../src/traces/pie'); module.exports = require('../src/traces/scatter3d'); -},{"../src/traces/scatter3d":583}],16:[function(require,module,exports){ +},{"../src/traces/scatter3d":581}],16:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -369,7 +369,7 @@ module.exports = require('../src/traces/scatter3d'); module.exports = require('../src/traces/scattergeo'); -},{"../src/traces/scattergeo":587}],17:[function(require,module,exports){ +},{"../src/traces/scattergeo":585}],17:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -380,7 +380,7 @@ module.exports = require('../src/traces/scattergeo'); module.exports = require('../src/traces/scattergl'); -},{"../src/traces/scattergl":592}],18:[function(require,module,exports){ +},{"../src/traces/scattergl":590}],18:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -391,7 +391,7 @@ module.exports = require('../src/traces/scattergl'); module.exports = require('../src/traces/scatterternary'); -},{"../src/traces/scatterternary":597}],19:[function(require,module,exports){ +},{"../src/traces/scatterternary":595}],19:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -402,7 +402,7 @@ module.exports = require('../src/traces/scatterternary'); module.exports = require('../src/traces/surface'); -},{"../src/traces/surface":606}],20:[function(require,module,exports){ +},{"../src/traces/surface":604}],20:[function(require,module,exports){ 'use strict' module.exports = createFilteredVector @@ -35796,7 +35796,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(255>_inline_34_arg0_||255>_inline_34_arg1_||255>_inline_34_arg2_||255>_inline_34_arg3_){var _inline_34_l=_inline_34_arg4_-_inline_34_arg6_[0],_inline_34_a=_inline_34_arg5_-_inline_34_arg6_[1],_inline_34_f=_inline_34_l*_inline_34_l+_inline_34_a*_inline_34_a;_inline_34_f_inline_31_arg0_||255>_inline_31_arg1_||255>_inline_31_arg2_||255>_inline_31_arg3_){var _inline_31_l=_inline_31_arg4_-_inline_31_arg6_[0],_inline_31_a=_inline_31_arg5_-_inline_31_arg6_[1],_inline_31_f=_inline_31_l*_inline_31_l+_inline_31_a*_inline_31_a;_inline_31_f 0 && !gd._context.staticPlot) { // increase the background and clip-path width // by the scrollbar width and margin @@ -55840,27 +55805,31 @@ module.exports = function draw(gd) { width: legendWidth - 2 * opts.borderwidth + constants.scrollBarWidth + - constants.scrollBarMargin, - height: legendHeight - opts.borderwidth, - x: opts.borderwidth / 2, - y: opts.borderwidth / 2 + constants.scrollBarMargin }); clipPath.select('rect').attr({ width: legendWidth - 2 * opts.borderwidth + constants.scrollBarWidth + - constants.scrollBarMargin, - height: legendHeight - 2 * opts.borderwidth, - x: opts.borderwidth, - y: opts.borderwidth - scrollBoxY + constants.scrollBarMargin }); - scrollBox.call(Drawing.setClipUrl, clipId); + if(gd.firstRender) { + // Move scrollbar to starting position + scrollHandler(constants.scrollBarMargin, 0); + } + + var scrollBarYMax = legendHeight - + constants.scrollBarHeight - + 2 * constants.scrollBarMargin, + scrollBoxYMax = opts.height - legendHeight, + scrollBarY = constants.scrollBarMargin, + scrollBoxY = 0; - if(firstRender) scrollHandler(scrollBarY, scrollBoxY); + scrollHandler(scrollBarY, scrollBoxY); - legend.on('wheel', null); // to be safe, remove previous listeners + legend.on('wheel', null); legend.on('wheel', function() { scrollBoxY = Lib.constrain( scrollBox.attr('data-scroll') - @@ -55872,10 +55841,8 @@ module.exports = function draw(gd) { d3.event.preventDefault(); }); - // to be safe, remove previous listeners scrollBar.on('.drag', null); scrollBox.on('.drag', null); - var drag = d3.behavior.drag().on('drag', function() { scrollBarY = Lib.constrain( d3.event.y - constants.scrollBarHeight / 2, @@ -55888,6 +55855,7 @@ module.exports = function draw(gd) { scrollBar.call(drag); scrollBox.call(drag); + } @@ -56255,7 +56223,7 @@ function expandHorizontalMargin(gd) { }); } -},{"../../lib":382,"../../plotly":402,"../../plots/plots":454,"../color":303,"../dragelement":324,"../drawing":326,"./anchor_utils":339,"./constants":341,"./get_legend_data":344,"./helpers":345,"./style":347,"d3":113}],344:[function(require,module,exports){ +},{"../../lib":381,"../../plotly":400,"../../plots/plots":452,"../color":303,"../dragelement":323,"../drawing":325,"./anchor_utils":338,"./constants":340,"./get_legend_data":343,"./helpers":344,"./style":346,"d3":113}],343:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -56361,7 +56329,7 @@ module.exports = function getLegendData(calcdata, opts) { return legendData; }; -},{"../../plots/plots":454,"./helpers":345}],345:[function(require,module,exports){ +},{"../../plots/plots":452,"./helpers":344}],344:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -56392,7 +56360,7 @@ exports.isReversed = function isReversed(legendLayout) { return (legendLayout.traceorder || '').indexOf('reversed') !== -1; }; -},{"../../plots/plots":454}],346:[function(require,module,exports){ +},{"../../plots/plots":452}],345:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -56415,7 +56383,7 @@ legend.draw = require('./draw'); legend.style = require('./style'); -},{"./attributes":340,"./defaults":342,"./draw":343,"./style":347}],347:[function(require,module,exports){ +},{"./attributes":339,"./defaults":341,"./draw":342,"./style":346}],346:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -56637,7 +56605,7 @@ function stylePies(d) { if(pts.size()) pts.call(stylePie, d[0], trace); } -},{"../../lib":382,"../../plots/plots":454,"../../traces/pie/style_one":554,"../../traces/scatter/subtypes":575,"../color":303,"../drawing":326,"d3":113}],348:[function(require,module,exports){ +},{"../../lib":381,"../../plots/plots":452,"../../traces/pie/style_one":552,"../../traces/scatter/subtypes":573,"../color":303,"../drawing":325,"d3":113}],347:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -57164,7 +57132,7 @@ modeBarButtons.resetViews = { } }; -},{"../../../build/ploticon":2,"../../lib":382,"../../lib/setcursor":391,"../../plotly":402,"../../snapshot/download":469}],349:[function(require,module,exports){ +},{"../../../build/ploticon":2,"../../lib":381,"../../lib/setcursor":389,"../../plotly":400,"../../snapshot/download":467}],348:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -57454,7 +57422,7 @@ function createModeBar(gd, buttons) { module.exports = createModeBar; -},{"../../../build/ploticon":2,"../../lib":382,"d3":113}],350:[function(require,module,exports){ +},{"../../../build/ploticon":2,"../../lib":381,"d3":113}],349:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -57682,7 +57650,7 @@ function fillCustomButton(customButtons) { return customButtons; } -},{"../../plotly":402,"../../traces/scatter/subtypes":575,"./":349,"./buttons":348}],351:[function(require,module,exports){ +},{"../../plotly":400,"../../traces/scatter/subtypes":573,"./":348,"./buttons":347}],350:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -57766,7 +57734,7 @@ module.exports = { } }; -},{"../../lib/extend":377,"../../plots/font_attributes":423,"../color/attributes":302,"./button_attributes":352}],352:[function(require,module,exports){ +},{"../../lib/extend":376,"../../plots/font_attributes":421,"../color/attributes":302,"./button_attributes":351}],351:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -57807,7 +57775,7 @@ module.exports = { } }; -},{}],353:[function(require,module,exports){ +},{}],352:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -57835,7 +57803,7 @@ module.exports = { activeColor: '#d3d3d3' }; -},{}],354:[function(require,module,exports){ +},{}],353:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -57922,7 +57890,7 @@ function getPosDflt(containerOut, layout, counterAxes) { return [containerOut.domain[0], posY + constants.yPad]; } -},{"../../lib":382,"./attributes":351,"./button_attributes":352,"./constants":353}],355:[function(require,module,exports){ +},{"../../lib":381,"./attributes":350,"./button_attributes":351,"./constants":352}],354:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -58197,7 +58165,7 @@ function reposition(gd, buttons, opts, axName) { }); } -},{"../../lib/svg_text_utils":395,"../../plotly":402,"../../plots/cartesian/axis_ids":407,"../../plots/plots":454,"../color":303,"../drawing":326,"../legend/anchor_utils":339,"./constants":353,"./get_update_object":356,"d3":113}],356:[function(require,module,exports){ +},{"../../lib/svg_text_utils":393,"../../plotly":400,"../../plots/cartesian/axis_ids":405,"../../plots/plots":452,"../color":303,"../drawing":325,"../legend/anchor_utils":338,"./constants":352,"./get_update_object":355,"d3":113}],355:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -58255,7 +58223,7 @@ function getXRange(axisLayout, buttonLayout) { return [range0, range1]; } -},{"d3":113}],357:[function(require,module,exports){ +},{"d3":113}],356:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -58273,7 +58241,7 @@ exports.supplyLayoutDefaults = require('./defaults'); exports.draw = require('./draw'); -},{"./attributes":351,"./defaults":354,"./draw":355}],358:[function(require,module,exports){ +},{"./attributes":350,"./defaults":353,"./draw":354}],357:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -58331,7 +58299,7 @@ module.exports = { } }; -},{"../color/attributes":302}],359:[function(require,module,exports){ +},{"../color/attributes":302}],358:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -58627,7 +58595,7 @@ module.exports = function createSlider(gd) { }); }; -},{"../../constants/xmlns_namespaces":370,"../../lib":382,"../../plotly":402,"../../plots/cartesian/axes":405,"./helpers":361,"./range_plot":363}],360:[function(require,module,exports){ +},{"../../constants/xmlns_namespaces":369,"../../lib":381,"../../plotly":400,"../../plots/cartesian/axes":403,"./helpers":360,"./range_plot":362}],359:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -58681,7 +58649,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, axName, coun } }; -},{"../../lib":382,"./attributes":358}],361:[function(require,module,exports){ +},{"../../lib":381,"./attributes":357}],360:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -58707,7 +58675,7 @@ exports.appendChildren = function appendChildren(el, children) { } }; -},{}],362:[function(require,module,exports){ +},{}],361:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -58764,7 +58732,7 @@ function draw(gd) { }); } -},{"../../plots/plots":454,"./create_slider":359,"./defaults":360}],363:[function(require,module,exports){ +},{"../../plots/plots":452,"./create_slider":358,"./defaults":359}],362:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -58777,7 +58745,6 @@ function draw(gd) { var d3 = require('d3'); -var Lib = require('../../lib'); var Symbols = require('../drawing/symbol_defs'); var Drawing = require('../drawing'); @@ -58821,7 +58788,7 @@ module.exports = function rangePlot(gd, w, h) { pointPairs = []; if(allowedTypes.indexOf(trace.type) < 0) { - Lib.warn('Trace type ' + trace.type + ' not supported for range slider!'); + console.log('Trace type ' + trace.type + ' not supported for range slider!'); continue; } @@ -58929,7 +58896,7 @@ function makeScatter(trace, pointPairs, w, h) { break; default: - Lib.warn('Fill type ' + trace.fill + ' not supported for range slider! (yet...)'); + console.log('Fill type ' + trace.fill + ' not supported for range slider! (yet...)'); break; } @@ -58945,7 +58912,7 @@ function makeScatter(trace, pointPairs, w, h) { return [line, markers, fill]; } -},{"../../constants/xmlns_namespaces":370,"../../lib":382,"../drawing":326,"../drawing/symbol_defs":327,"./helpers":361,"d3":113}],364:[function(require,module,exports){ +},{"../../constants/xmlns_namespaces":369,"../drawing":325,"../drawing/symbol_defs":326,"./helpers":360,"d3":113}],363:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -59036,7 +59003,7 @@ module.exports = { } }; -},{"../../lib/extend":377,"../../traces/scatter/attributes":556,"../annotations/attributes":300}],365:[function(require,module,exports){ +},{"../../lib/extend":376,"../../traces/scatter/attributes":554,"../annotations/attributes":300}],364:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -59364,7 +59331,7 @@ function updateShape(gd, index, opt, value) { plotinfo = plots[subplots[i]]; clipAxes = subplots[i]; - if(isShapeInSubplot(gd, options, plotinfo)) { + if(isShapeInSubplot(gd, options, plotinfo.id)) { drawShape(plotinfo.shapelayer); } } @@ -59390,7 +59357,7 @@ function getShapeLayer(gd, index) { shapeLayer = gd._fullLayout._shapeUpperLayer; if(!shape) { - Lib.log('getShapeLayer: undefined shape: index', index); + console.log('getShapeLayer: undefined shape: index', index); } else if(shape.layer === 'below') { shapeLayer = (shape.xref === 'paper' && shape.yref === 'paper') ? @@ -59401,13 +59368,10 @@ function getShapeLayer(gd, index) { return shapeLayer; } -function isShapeInSubplot(gd, shape, plotinfo) { - var xa = Plotly.Axes.getFromId(gd, plotinfo.id, 'x')._id, - ya = Plotly.Axes.getFromId(gd, plotinfo.id, 'y')._id, - isBelow = shape.layer === 'below', - inSuplotAxis = (xa === shape.xref || ya === shape.yref), - isNotAnOverlaidSubplot = !!plotinfo.shapelayer; - return isBelow && inSuplotAxis && isNotAnOverlaidSubplot; +function isShapeInSubplot(gd, shape, subplot) { + var xa = Plotly.Axes.getFromId(gd, subplot, 'x')._id, + ya = Plotly.Axes.getFromId(gd, subplot, 'y')._id; + return shape.layer === 'below' && (xa === shape.xref || ya === shape.yref); } function decodeDate(convertToPx) { @@ -59533,7 +59497,7 @@ shapes.convertPath = function(pathIn, x2p, y2p) { if(paramNumber > nParams) { paramString = paramString.replace(/[\s,]*X.*/, ''); - Lib.log('Ignoring extra params in segment ' + segment); + console.log('ignoring extra params in segment ' + segment); } return segmentType + paramString; @@ -59599,7 +59563,7 @@ function shapeBounds(ax, v0, v1, path, paramsToUse) { if(max >= min) return [min, max]; } -},{"../../lib":382,"../../plotly":402,"../../plots/cartesian/axes":405,"../color":303,"../drawing":326,"./attributes":364,"fast-isnumeric":117}],366:[function(require,module,exports){ +},{"../../lib":381,"../../plotly":400,"../../plots/cartesian/axes":403,"../color":303,"../drawing":325,"./attributes":363,"fast-isnumeric":117}],365:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -59829,7 +59793,7 @@ Titles.draw = function(gd, titleClass, options) { el.classed('js-placeholder', isplaceholder); }; -},{"../../lib":382,"../../lib/svg_text_utils":395,"../../plotly":402,"../../plots/plots":454,"../color":303,"../drawing":326,"d3":113,"fast-isnumeric":117}],367:[function(require,module,exports){ +},{"../../lib":381,"../../lib/svg_text_utils":393,"../../plotly":400,"../../plots/plots":452,"../color":303,"../drawing":325,"d3":113,"fast-isnumeric":117}],366:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -59850,7 +59814,7 @@ module.exports = { longdashdot: [8, 1, 1, 1] }; -},{}],368:[function(require,module,exports){ +},{}],367:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -59871,7 +59835,7 @@ module.exports = { longdashdot: [[0.5, 0.7, 0.8, 1], 10] }; -},{}],369:[function(require,module,exports){ +},{}],368:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -59894,7 +59858,7 @@ module.exports = { x: '❌' }; -},{}],370:[function(require,module,exports){ +},{}],369:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -59918,7 +59882,7 @@ exports.svgAttrs = { 'xmlns:xlink': exports.xlink }; -},{}],371:[function(require,module,exports){ +},{}],370:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -59936,7 +59900,7 @@ exports.svgAttrs = { var Plotly = require('./plotly'); // package version injected by `npm run preprocess` -exports.version = '1.13.0'; +exports.version = '1.12.0'; // plot api exports.plot = Plotly.plot; @@ -59968,7 +59932,7 @@ exports.Queue = Plotly.Queue; // export d3 used in the bundle exports.d3 = require('d3'); -},{"../build/ploticon":2,"./plot_api/set_plot_config":400,"./plot_api/to_image":401,"./plotly":402,"./snapshot/download":469,"d3":113}],372:[function(require,module,exports){ +},{"../build/ploticon":2,"./plot_api/set_plot_config":398,"./plot_api/to_image":399,"./plotly":400,"./snapshot/download":467,"d3":113}],371:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -60001,7 +59965,7 @@ if(typeof MathJax !== 'undefined') { exports.MathJax = false; } -},{}],373:[function(require,module,exports){ +},{}],372:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -60018,7 +59982,7 @@ module.exports = function arrayToCalcItem(traceAttr, calcItem, calcAttr, i) { if(Array.isArray(traceAttr)) calcItem[calcAttr] = traceAttr[i]; }; -},{}],374:[function(require,module,exports){ +},{}],373:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -60282,7 +60246,7 @@ exports.coerceFont = function(coerce, attr, dfltObj) { return out; }; -},{"../components/colorscale/get_scale":315,"../components/colorscale/scales":321,"./nested_property":386,"fast-isnumeric":117,"tinycolor2":274}],375:[function(require,module,exports){ +},{"../components/colorscale/get_scale":314,"../components/colorscale/scales":320,"./nested_property":384,"fast-isnumeric":117,"tinycolor2":274}],374:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -60297,8 +60261,6 @@ exports.coerceFont = function(coerce, attr, dfltObj) { var d3 = require('d3'); var isNumeric = require('fast-isnumeric'); -var Lib = require('../lib'); - /** * dateTime2ms - turn a date object or string s of the form @@ -60409,7 +60371,7 @@ function lpad(val, digits) { */ exports.ms2DateTime = function(ms, r) { if(typeof(d3) === 'undefined') { - Lib.error('d3 is not defined.'); + console.log('d3 is not defined'); return; } @@ -60621,7 +60583,7 @@ exports.parseDate = function(v) { return out; }; -},{"../lib":382,"d3":113,"fast-isnumeric":117}],376:[function(require,module,exports){ +},{"d3":113,"fast-isnumeric":117}],375:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -60755,7 +60717,7 @@ var Events = { module.exports = Events; -},{"events":55}],377:[function(require,module,exports){ +},{"events":55}],376:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -60835,7 +60797,7 @@ function _extend(inputs, isDeep, keepAllKeys) { return target; } -},{"./is_plain_object.js":383}],378:[function(require,module,exports){ +},{"./is_plain_object.js":382}],377:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -60859,7 +60821,7 @@ module.exports = function filterVisible(dataIn) { return dataOut; }; -},{}],379:[function(require,module,exports){ +},{}],378:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -60872,7 +60834,7 @@ module.exports = function filterVisible(dataIn) { 'use strict'; var countryRegex = require('country-regex'); -var Lib = require('../lib'); +var Lib = require('./'); // make list of all country iso3 ids from at runtime @@ -60894,8 +60856,8 @@ exports.locationToFeature = function(locationmode, location, features) { if(feature.id === locationId) return feature; } - Lib.warn([ - 'Location with id', locationId, + console.warn([ + 'location with id', locationId, 'does not have a matching topojson feature at this resolution.' ].join(' ')); }; @@ -60915,10 +60877,10 @@ function countryNameToISO3(countryName) { if(regex.test(countryName.toLowerCase())) return iso3; } - Lib.warn('Unrecognized country name: ' + countryName + '.'); + console.warn('unrecognized country name: ' + countryName + '.'); } -},{"../lib":382,"country-regex":108}],380:[function(require,module,exports){ +},{"./":381,"country-regex":108}],379:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -60997,7 +60959,7 @@ function formatColor(containerIn, opacityIn, len) { module.exports = formatColor; -},{"../components/color/attributes":302,"../components/colorscale/make_scale_function":320,"./str2rgbarray":394,"fast-isnumeric":117,"tinycolor2":274}],381:[function(require,module,exports){ +},{"../components/color/attributes":302,"../components/colorscale/make_scale_function":319,"./str2rgbarray":392,"fast-isnumeric":117,"tinycolor2":274}],380:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -61071,7 +61033,7 @@ function convertHTMLToUnicode(html) { module.exports = convertHTMLToUnicode; -},{"superscript-text":263}],382:[function(require,module,exports){ +},{"superscript-text":263}],381:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -61132,11 +61094,6 @@ lib.extendFlat = extendModule.extendFlat; lib.extendDeep = extendModule.extendDeep; lib.extendDeepAll = extendModule.extendDeepAll; -var loggersModule = require('./loggers'); -lib.log = loggersModule.log; -lib.warn = loggersModule.warn; -lib.error = loggersModule.error; - lib.notifier = require('./notifier'); /** @@ -61171,6 +61128,35 @@ lib.pauseEvent = function(e) { return false; }; +/** + * ------------------------------------------ + * debugging tools + * ------------------------------------------ + */ + +// set VERBOSE to true to get a lot more logging and tracing +lib.VERBOSE = false; + +// first markTime call will return time from page load +lib.TIMER = new Date().getTime(); + +// console.log that only runs if VERBOSE is on +lib.log = function() { + if(lib.VERBOSE) console.log.apply(console, arguments); +}; + +/** + * markTime - for debugging, mark the number of milliseconds + * since the previous call to markTime and log arbitrary info too + */ +lib.markTime = function(v) { + if(!lib.VERBOSE) return; + var t2 = new Date().getTime(); + console.log(v, t2 - lib.TIMER, '(msec)'); + if(lib.VERBOSE === 'trace') console.trace(); + lib.TIMER = t2; +}; + // constrain - restrict a number v to be between v0 and v1 lib.constrain = function(v, v0, v1) { if(v0 > v1) return Math.max(v1, Math.min(v0, v)); @@ -61321,17 +61307,18 @@ lib.syncOrAsync = function(sequence, arg, finalStep) { var ret, fni; function continueAsync() { + lib.markTime('async done ' + fni.name); return lib.syncOrAsync(sequence, arg, finalStep); } - while(sequence.length) { fni = sequence.splice(0, 1)[0]; ret = fni(arg); - + // lib.markTime('done calling '+fni.name) if(ret && ret.then) { return ret.then(continueAsync) .then(undefined, lib.promiseError); } + lib.markTime('sync done ' + fni.name); } return finalStep && finalStep(arg); @@ -61482,7 +61469,7 @@ lib.addStyleRule = function(selector, styleString) { else if(styleSheet.addRule) { styleSheet.addRule(selector, styleString, 0); } - else lib.warn('addStyleRule failed'); + else console.warn('addStyleRule failed'); }; lib.getTranslate = function(element) { @@ -61660,7 +61647,7 @@ lib.numSeparate = function(value, separators) { return x1 + x2; }; -},{"./coerce":374,"./dates":375,"./extend":377,"./is_plain_object":383,"./loggers":384,"./matrix":385,"./nested_property":386,"./notifier":387,"./search":390,"./stats":393,"d3":113}],383:[function(require,module,exports){ +},{"./coerce":373,"./dates":374,"./extend":376,"./is_plain_object":382,"./matrix":383,"./nested_property":384,"./notifier":385,"./search":388,"./stats":391,"d3":113}],382:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -61680,74 +61667,7 @@ module.exports = function isPlainObject(obj) { ); }; -},{}],384:[function(require,module,exports){ -/** -* Copyright 2012-2016, Plotly, Inc. -* All rights reserved. -* -* This source code is licensed under the MIT license found in the -* LICENSE file in the root directory of this source tree. -*/ - -'use strict'; - -var config = require('../plot_api/plot_config'); - -var loggers = module.exports = {}; - -/** - * ------------------------------------------ - * debugging tools - * ------------------------------------------ - */ - -/* eslint-disable no-console */ -loggers.log = function() { - if(config.logging > 1) { - var messages = ['LOG:']; - - for(var i = 0; i < arguments.length; i++) { - messages.push(arguments[i]); - } - - if(console.trace) { - console.trace.apply(console, messages); - } else { - console.log.apply(console, messages); - } - } -}; - -loggers.warn = function() { - if(config.logging > 0) { - var messages = ['WARN:']; - - for(var i = 0; i < arguments.length; i++) { - messages.push(arguments[i]); - } - - if(console.trace) { - console.trace.apply(console, messages); - } else { - console.log.apply(console, messages); - } - } -}; - -loggers.error = function() { - if(config.logging > 0) { - var messages = ['ERROR:']; - - for(var i = 0; i < arguments.length; i++) { - messages.push(arguments[i]); - } - - console.error.apply(console, arguments); - } -}; -/* eslint-enable no-console */ - -},{"../plot_api/plot_config":398}],385:[function(require,module,exports){ +},{}],383:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -61857,7 +61777,7 @@ exports.apply2DTransform2 = function(transform) { }; }; -},{}],386:[function(require,module,exports){ +},{}],384:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -62113,7 +62033,7 @@ function badContainer(container, propStr, propParts) { }; } -},{"fast-isnumeric":117}],387:[function(require,module,exports){ +},{"fast-isnumeric":117}],385:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -62190,7 +62110,7 @@ module.exports = function(text, displayLength) { }); }; -},{"d3":113,"fast-isnumeric":117}],388:[function(require,module,exports){ +},{"d3":113,"fast-isnumeric":117}],386:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -62430,7 +62350,7 @@ polygon.filter = function filter(pts, tolerance) { }; }; -},{"./matrix":385}],389:[function(require,module,exports){ +},{"./matrix":383}],387:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -62633,7 +62553,7 @@ queue.plotDo = function(gd, func, args) { module.exports = queue; -},{"../plotly":402}],390:[function(require,module,exports){ +},{"../plotly":400}],388:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -62647,8 +62567,6 @@ module.exports = queue; var isNumeric = require('fast-isnumeric'); -var Lib = require('../lib'); - /** * findBin - find the bin for val - note that it can return outside the @@ -62683,7 +62601,7 @@ exports.findBin = function(val, bins, linelow) { if(test(bins[n], val)) n1 = n + 1; else n2 = n; } - if(c > 90) Lib.log('Long binary search...'); + if(c > 90) console.log('Long binary search...'); return n1 - 1; } }; @@ -62745,7 +62663,7 @@ exports.roundUp = function(val, arrayIn, reverse) { return arrayIn[low]; }; -},{"../lib":382,"fast-isnumeric":117}],391:[function(require,module,exports){ +},{"fast-isnumeric":117}],389:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -62768,7 +62686,7 @@ module.exports = function setCursor(el3, csr) { if(csr) el3.classed('cursor-' + csr, true); }; -},{}],392:[function(require,module,exports){ +},{}],390:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -62817,7 +62735,7 @@ module.exports = function showWebGlMsg(scene) { return false; }; -},{"../components/color":303}],393:[function(require,module,exports){ +},{"../components/color":303}],391:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -62913,7 +62831,7 @@ exports.interp = function(arr, n) { return frac * arr[Math.ceil(n)] + (1 - frac) * arr[Math.floor(n)]; }; -},{"fast-isnumeric":117}],394:[function(require,module,exports){ +},{"fast-isnumeric":117}],392:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -62935,7 +62853,7 @@ function str2RgbaArray(color) { module.exports = str2RgbaArray; -},{"arraytools":49,"tinycolor2":274}],395:[function(require,module,exports){ +},{"arraytools":49,"tinycolor2":274}],393:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -62952,7 +62870,6 @@ module.exports = str2RgbaArray; var Plotly = require('../plotly'); var d3 = require('d3'); -var Lib = require('../lib'); var xmlnsNamespaces = require('../constants/xmlns_namespaces'); var util = module.exports = {}; @@ -62975,7 +62892,7 @@ d3.selection.prototype.appendSVG = function(_svgString) { childNode = childNode.nextSibling; } if(dom.querySelector('parsererror')) { - Lib.log(dom.querySelector('parsererror div').textContent); + console.log(dom.querySelector('parsererror div').textContent); return null; } return d3.select(this.node().lastChild); @@ -63141,7 +63058,7 @@ function texToSVG(_texString, _config, _callback) { var glyphDefs = d3.select('body').select('#MathJax_SVG_glyphs'); if(tmpDiv.select('.MathJax_SVG').empty() || !tmpDiv.select('svg').node()) { - Lib.log('There was an error in the tex syntax.', _texString); + console.log('There was an error in the tex syntax.', _texString); _callback(); } else { @@ -63419,7 +63336,7 @@ util.makeEditable = function(context, _delegate, options) { return d3.rebind(this, dispatch, 'on'); }; -},{"../constants/xmlns_namespaces":370,"../lib":382,"../plotly":402,"d3":113}],396:[function(require,module,exports){ +},{"../constants/xmlns_namespaces":369,"../plotly":400,"d3":113}],394:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -63455,7 +63372,7 @@ topojsonUtils.getTopojsonFeatures = function(trace, topojson) { return topojsonFeature(topojson, obj).features; }; -},{"../plots/geo/constants":424,"topojson":275}],397:[function(require,module,exports){ +},{"../plots/geo/constants":422,"topojson":275}],395:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -63509,6 +63426,7 @@ var xmlnsNamespaces = require('../constants/xmlns_namespaces'); * */ Plotly.plot = function(gd, data, layout, config) { + Lib.markTime('in plot'); gd = getGraphDiv(gd); @@ -63521,7 +63439,7 @@ Plotly.plot = function(gd, data, layout, config) { // if there's no data or layout, and this isn't yet a plotly plot // container, log a warning to help plotly.js users debug if(!data && !layout && !Lib.isPlotDiv(gd)) { - Lib.warn('Calling Plotly.plot as if redrawing ' + + console.log('Warning: calling Plotly.plot as if redrawing ' + 'but this container doesn\'t yet have a plot.', gd); } @@ -63680,9 +63598,11 @@ Plotly.plot = function(gd, data, layout, config) { } } + Lib.markTime('done with bar/box adjustments'); // calc and autorange for errorbars ErrorBars.calc(gd); + Lib.markTime('done ErrorBars.calc'); // TODO: autosize extra for text markers return Lib.syncOrAsync([ @@ -63737,6 +63657,7 @@ Plotly.plot = function(gd, data, layout, config) { // styling separate from drawing Plots.style(gd); + Lib.markTime('done Plots.style'); // show annotations and shapes Shapes.drawAll(gd); @@ -63766,6 +63687,7 @@ Plotly.plot = function(gd, data, layout, config) { function cleanUp() { // now we're REALLY TRULY done plotting... // so mark it as done and let other procedures call a replot + Lib.markTime('done plot'); gd.emit('plotly_afterplot'); } @@ -63997,7 +63919,7 @@ function cleanLayout(layout) { } if(layout.annotations !== undefined && !Array.isArray(layout.annotations)) { - Lib.warn('Annotations must be an array.'); + console.log('annotations must be an array'); delete layout.annotations; } var annotationsLen = (layout.annotations || []).length; @@ -64019,7 +63941,7 @@ function cleanLayout(layout) { } if(layout.shapes !== undefined && !Array.isArray(layout.shapes)) { - Lib.warn('Shapes must be an array.'); + console.log('shapes must be an array'); delete layout.shapes; } var shapesLen = (layout.shapes || []).length; @@ -64094,7 +64016,9 @@ function cleanLayout(layout) { // sanitize rgb(fractions) and rgba(fractions) that old tinycolor // supported, but new tinycolor does not because they're not valid css + Lib.markTime('finished rest of cleanLayout, starting color'); Color.clean(layout); + Lib.markTime('finished cleanLayout color.clean'); return layout; } @@ -64243,7 +64167,9 @@ function cleanData(data, existingData) { // sanitize rgb(fractions) and rgba(fractions) that old tinycolor // supported, but new tinycolor does not because they're not valid css + Lib.markTime('finished rest of cleanData, starting color'); Color.clean(trace); + Lib.markTime('finished cleanData color.clean'); } } @@ -64272,7 +64198,7 @@ Plotly.redraw = function(gd) { gd = getGraphDiv(gd); if(!Lib.isPlotDiv(gd)) { - Lib.warn('This element is not a Plotly plot.', gd); + console.log('This element is not a Plotly Plot', gd); return; } @@ -64347,6 +64273,7 @@ function doCalcdata(gd) { if(!cd[0].t) cd[0].t = {}; cd[0].trace = trace; + Lib.markTime('done with calcdata for ' + i); calcdata[i] = cd; } } @@ -65003,7 +64930,7 @@ Plotly.restyle = function restyle(gd, astr, val, traces) { if(traces === undefined) traces = val; // the 3-arg form } else { - Lib.warn('Restyle fail.', astr, val, traces); + console.log('restyle fail', astr, val, traces); return Promise.reject(); } @@ -65110,7 +65037,7 @@ Plotly.restyle = function restyle(gd, astr, val, traces) { // to not go through a full replot var doPlotWhiteList = ['cartesian', 'pie', 'ternary']; fullLayout._basePlotModules.forEach(function(_module) { - if(doPlotWhiteList.indexOf(_module.name) === -1) docalc = true; + if(doPlotWhiteList.indexOf(_module.name) === -1) doplot = true; }); // make a new empty vals array for undoit @@ -65547,7 +65474,7 @@ Plotly.relayout = function relayout(gd, astr, val) { if(typeof astr === 'string') aobj[astr] = val; else if(Lib.isPlainObject(astr)) aobj = astr; else { - Lib.warn('Relayout fail.', astr, val); + console.log('relayout fail', astr, val); return Promise.reject(); } @@ -65738,7 +65665,7 @@ Plotly.relayout = function relayout(gd, astr, val) { } else undoit[ai] = obji; } - else Lib.log('???', aobj); + else console.log('???', aobj); } if((refAutorange(obji, 'x') || refAutorange(obji, 'y')) && !Lib.containsAny(ai, ['color', 'opacity', 'align', 'dash'])) { @@ -65748,27 +65675,13 @@ Plotly.relayout = function relayout(gd, astr, val) { // as it is we get separate calls for x and y (or ax and ay) on move objModule.draw(gd, objNum, p.parts.slice(2).join('.'), aobj[ai]); delete aobj[ai]; - } - else if(p.parts[0] === 'images') { - var update = Lib.objectFromPath(ai, vi); + } else if(p.parts[0] === 'images') { + var update = Lib.objectFromPath(astr, vi); Lib.extendDeepAll(gd.layout, update); Images.supplyLayoutDefaults(gd.layout, gd._fullLayout); Images.draw(gd); } - else if(p.parts[0] === 'mapbox' && p.parts[1] === 'layers') { - Lib.extendDeepAll(gd.layout, Lib.objectFromPath(ai, vi)); - - // append empty container to mapbox.layers - // so that relinkPrivateKeys does not complain - - var fullLayers = (gd._fullLayout.mapbox || {}).layers || []; - var diff = (p.parts[2] + 1) - fullLayers.length; - - for(i = 0; i < diff; i++) fullLayers.push({}); - - doplot = true; - } // alter gd.layout else { // check whether we can short-circuit a full redraw @@ -66543,7 +66456,7 @@ function drawMainTitle(gd) { }); } -},{"../components/color":303,"../components/drawing":326,"../components/errorbars":332,"../components/images":338,"../components/legend":346,"../components/modebar/manage":350,"../components/rangeselector":357,"../components/rangeslider":362,"../components/shapes":365,"../components/titles":366,"../constants/xmlns_namespaces":370,"../lib":382,"../lib/events":376,"../lib/queue":389,"../plotly":402,"../plots/cartesian/graph_interact":412,"../plots/plots":454,"d3":113,"fast-isnumeric":117,"gl-mat4/fromQuat":134}],398:[function(require,module,exports){ +},{"../components/color":303,"../components/drawing":325,"../components/errorbars":331,"../components/images":337,"../components/legend":345,"../components/modebar/manage":349,"../components/rangeselector":356,"../components/rangeslider":361,"../components/shapes":364,"../components/titles":365,"../constants/xmlns_namespaces":369,"../lib":381,"../lib/events":375,"../lib/queue":387,"../plotly":400,"../plots/cartesian/graph_interact":410,"../plots/plots":452,"d3":113,"fast-isnumeric":117,"gl-mat4/fromQuat":134}],396:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -66552,9 +66465,8 @@ function drawMainTitle(gd) { * LICENSE file in the root directory of this source tree. */ -'use strict'; -var Lib = require('../lib'); +'use strict'; /** * This will be transfered over to gd and overridden by @@ -66630,14 +66542,8 @@ module.exports = { setBackground: defaultSetBackground, // URL to topojson files used in geo charts - topojsonURL: 'https://cdn.plot.ly/', - - // Mapbox access token (required to plot mapbox trace types) - mapboxAccessToken: null, + topojsonURL: 'https://cdn.plot.ly/' - // Turn all console logging on or off (errors will be thrown) - // This should ONLY be set via Plotly.setPlotConfig - logging: false }; // where and how the background gets set can be overridden by context @@ -66646,10 +66552,10 @@ function defaultSetBackground(gd, bgColor) { try { gd._fullLayout._paper.style('background', bgColor); } - catch(e) { Lib.error(e); } + catch(e) { console.log(e); } } -},{"../lib":382}],399:[function(require,module,exports){ +},{}],397:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -66972,7 +66878,7 @@ function handleLinkedToArray(layoutAttributes) { PlotSchema.crawl(layoutAttributes, callback); } -},{"../lib":382,"../plotly":402,"../plots/plots":454,"../plots/polar/area_attributes":455,"../plots/polar/axis_attributes":456}],400:[function(require,module,exports){ +},{"../lib":381,"../plotly":400,"../plots/plots":452,"../plots/polar/area_attributes":453,"../plots/polar/axis_attributes":454}],398:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -66998,7 +66904,7 @@ module.exports = function setPlotConfig(configObj) { return Lib.extendFlat(Plotly.defaultConfig, configObj); }; -},{"../lib":382,"../plotly":402}],401:[function(require,module,exports){ +},{"../lib":381,"../plotly":400}],399:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -67111,7 +67017,7 @@ function toImage(gd, opts) { module.exports = toImage; -},{"../lib":382,"../plotly":402,"../snapshot":471,"fast-isnumeric":117}],402:[function(require,module,exports){ +},{"../lib":381,"../plotly":400,"../snapshot":469,"fast-isnumeric":117}],400:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -67198,7 +67104,7 @@ exports.PlotSchema = require('./plot_api/plot_schema'); // imaging routines exports.Snapshot = require('./snapshot'); -},{"../build/plotcss":1,"./components/annotations":301,"./components/color":303,"./components/colorbar":308,"./components/colorscale":317,"./components/drawing":326,"./components/errorbars":332,"./components/images":338,"./components/legend":346,"./components/modebar":349,"./components/shapes":365,"./fonts/mathjax_config":372,"./lib":382,"./lib/queue":389,"./lib/svg_text_utils":395,"./plot_api/plot_api":397,"./plot_api/plot_config":398,"./plot_api/plot_schema":399,"./plots/cartesian/axes":405,"./plots/cartesian/graph_interact":412,"./plots/plots":454,"./plots/polar/micropolar":457,"./snapshot":471,"./traces/scatter":565,"es6-promise":116}],403:[function(require,module,exports){ +},{"../build/plotcss":1,"./components/annotations":301,"./components/color":303,"./components/colorbar":308,"./components/colorscale":316,"./components/drawing":325,"./components/errorbars":331,"./components/images":337,"./components/legend":345,"./components/modebar":348,"./components/shapes":364,"./fonts/mathjax_config":371,"./lib":381,"./lib/queue":387,"./lib/svg_text_utils":393,"./plot_api/plot_api":395,"./plot_api/plot_config":396,"./plot_api/plot_schema":397,"./plots/cartesian/axes":403,"./plots/cartesian/graph_interact":410,"./plots/plots":452,"./plots/polar/micropolar":455,"./snapshot":469,"./traces/scatter":563,"es6-promise":116}],401:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -67279,7 +67185,7 @@ module.exports = { } }; -},{}],404:[function(require,module,exports){ +},{}],402:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -67306,7 +67212,7 @@ module.exports = { } }; -},{}],405:[function(require,module,exports){ +},{}],403:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -68721,7 +68627,7 @@ axes.doTicks = function(gd, axid, skipTitle) { }; } else { - Lib.warn('Unrecognized doTicks axis:', axid); + console.log('unrecognized doTicks axis', axid); return; } var axside = ax.side || sides[0], @@ -69279,7 +69185,7 @@ function swapAxisAttrs(layout, key, xFullAxes, yFullAxes) { // rather than built-in % which gives a negative value for negative v function mod(v, d) { return ((v % d) + d) % d; } -},{"../../components/color":303,"../../components/drawing":326,"../../components/titles":366,"../../lib":382,"../../lib/svg_text_utils":395,"../../plotly":402,"./axis_ids":407,"./layout_attributes":414,"./layout_defaults":415,"./set_convert":419,"d3":113,"fast-isnumeric":117}],406:[function(require,module,exports){ +},{"../../components/color":303,"../../components/drawing":325,"../../components/titles":365,"../../lib":381,"../../lib/svg_text_utils":393,"../../plotly":400,"./axis_ids":405,"./layout_attributes":412,"./layout_defaults":413,"./set_convert":417,"d3":113,"fast-isnumeric":117}],404:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -69562,7 +69468,7 @@ function category(a) { return curvecats > curvenums * 2; } -},{"../../components/color/attributes":302,"../../lib":382,"../plots":454,"./axis_ids":407,"./category_order_defaults":408,"./clean_datum":409,"./layout_attributes":414,"./ordered_categories":416,"./set_convert":419,"./tick_label_defaults":420,"./tick_mark_defaults":421,"./tick_value_defaults":422,"fast-isnumeric":117,"tinycolor2":274}],407:[function(require,module,exports){ +},{"../../components/color/attributes":302,"../../lib":381,"../plots":452,"./axis_ids":405,"./category_order_defaults":406,"./clean_datum":407,"./layout_attributes":412,"./ordered_categories":414,"./set_convert":417,"./tick_label_defaults":418,"./tick_mark_defaults":419,"./tick_value_defaults":420,"fast-isnumeric":117,"tinycolor2":274}],405:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -69683,7 +69589,7 @@ exports.getFromTrace = function(gd, fullTrace, type) { return ax; }; -},{"../../lib":382,"../plots":454,"./constants":410}],408:[function(require,module,exports){ +},{"../../lib":381,"../plots":452,"./constants":408}],406:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -69717,7 +69623,7 @@ module.exports = function handleCategoryOrderDefaults(containerIn, containerOut, } }; -},{}],409:[function(require,module,exports){ +},{}],407:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -69750,13 +69656,13 @@ module.exports = function cleanDatum(c) { c = c.toString().replace(/['"%,$# ]/g, ''); } catch(e) { - Lib.error(e, c); + console.log(e, c); } return c; }; -},{"../../lib":382,"fast-isnumeric":117}],410:[function(require,module,exports){ +},{"../../lib":381,"fast-isnumeric":117}],408:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -69834,7 +69740,7 @@ module.exports = { REDRAWDELAY: 50 }; -},{}],411:[function(require,module,exports){ +},{}],409:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -70209,7 +70115,7 @@ module.exports = function dragBox(gd, plotinfo, x, y, w, h, ns, ew) { var wheelDelta = -e.deltaY; if(!isFinite(wheelDelta)) wheelDelta = e.wheelDelta / 10; if(!isFinite(wheelDelta)) { - Lib.log('Did not find wheel motion attributes: ', e); + console.log('did not find wheel motion attributes', e); return; } @@ -70506,7 +70412,7 @@ function removeZoombox(gd) { .remove(); } -},{"../../components/color":303,"../../components/dragelement":324,"../../components/drawing":326,"../../lib":382,"../../lib/setcursor":391,"../../lib/svg_text_utils":395,"../../plotly":402,"./axes":405,"./constants":410,"./select":418,"d3":113,"tinycolor2":274}],412:[function(require,module,exports){ +},{"../../components/color":303,"../../components/dragelement":323,"../../components/drawing":325,"../../lib":381,"../../lib/setcursor":389,"../../lib/svg_text_utils":393,"../../plotly":400,"./axes":403,"./constants":408,"./select":416,"d3":113,"tinycolor2":274}],410:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -70814,50 +70720,27 @@ function hover(gd, evt, subplot) { if(!subplot) subplot = 'xy'; - // if the user passed in an array of subplots, - // use those instead of finding overlayed plots - var subplots = Array.isArray(subplot) ? subplot : [subplot]; - var fullLayout = gd._fullLayout, - plots = fullLayout._plots || [], - plotinfo = plots[subplot]; - - // list of all overlaid subplots to look at - if(plotinfo) { - var overlayedSubplots = plotinfo.overlays.map(function(pi) { - return pi.id; - }); - - subplots = subplots.concat(overlayedSubplots); - } - - var len = subplots.length, - xaArray = new Array(len), - yaArray = new Array(len); - - for(var i = 0; i < len; i++) { - var spId = subplots[i]; - - // 'cartesian' case - var plotObj = plots[spId]; - if(plotObj) { - - // TODO make sure that fullLayout_plots axis refs - // get updated properly so that we don't have - // to use Axes.getFromId in general. - - xaArray[i] = Axes.getFromId(gd, plotObj.xaxis._id); - yaArray[i] = Axes.getFromId(gd, plotObj.yaxis._id); - continue; - } - - // other subplot types - var _subplot = fullLayout[spId]._subplot; - xaArray[i] = _subplot.xaxis; - yaArray[i] = _subplot.yaxis; - } - - var hovermode = evt.hovermode || fullLayout.hovermode; + plotinfo = fullLayout._plots[subplot], + + //If the user passed in an array of subplots, use those instead of finding overlayed plots + subplots = Array.isArray(subplot) ? + subplot : + // list of all overlaid subplots to look at + [subplot].concat(plotinfo.overlays + .map(function(pi) { return pi.id; })), + + xaArray = subplots.map(function(spId) { + var ternary = (gd._fullLayout[spId] || {})._ternary; + if(ternary) return ternary.xaxis; + return Axes.getFromId(gd, spId, 'x'); + }), + yaArray = subplots.map(function(spId) { + var ternary = (gd._fullLayout[spId] || {})._ternary; + if(ternary) return ternary.yaxis; + return Axes.getFromId(gd, spId, 'y'); + }), + hovermode = evt.hovermode || fullLayout.hovermode; if(['x', 'y', 'closest'].indexOf(hovermode) === -1 || !gd.calcdata || gd.querySelector('.zoombox') || gd._dragging) { @@ -70951,7 +70834,7 @@ function hover(gd, evt, subplot) { else yvalArray = p2c(yaArray, ypx); if(!isNumeric(xvalArray[0]) || !isNumeric(yvalArray[0])) { - Lib.warn('Plotly.Fx.hover failed', evt, gd); + console.log('Plotly.Fx.hover failed', evt, gd); return dragElement.unhoverRaw(gd, evt); } } @@ -71038,7 +70921,7 @@ function hover(gd, evt, subplot) { } } else { - Lib.log('Unrecognized trace type in hover:', trace); + console.log('unrecognized trace type in hover', trace); } // in closest mode, remove any existing (farther) points @@ -71848,7 +71731,7 @@ fx.inbox = function(v0, v1) { return Infinity; }; -},{"../../components/color":303,"../../components/dragelement":324,"../../components/drawing":326,"../../lib":382,"../../lib/events":376,"../../lib/svg_text_utils":395,"./axes":405,"./constants":410,"./dragbox":411,"d3":113,"fast-isnumeric":117,"tinycolor2":274}],413:[function(require,module,exports){ +},{"../../components/color":303,"../../components/dragelement":323,"../../components/drawing":325,"../../lib":381,"../../lib/events":375,"../../lib/svg_text_utils":393,"./axes":403,"./constants":408,"./dragbox":409,"d3":113,"fast-isnumeric":117,"tinycolor2":274}],411:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -71860,6 +71743,7 @@ fx.inbox = function(v0, v1) { 'use strict'; +var Lib = require('../../lib'); var Plots = require('../plots'); var constants = require('./constants'); @@ -71931,11 +71815,13 @@ exports.plot = function(gd) { // plot all traces of this type on this subplot at once var cdModule = getCdModule(cdSubplot, _module); _module.plot(gd, subplotInfo, cdModule); + + Lib.markTime('done ' + (cdModule[0] && cdModule[0][0].trace.type)); } } }; -},{"../plots":454,"./attributes":404,"./constants":410}],414:[function(require,module,exports){ +},{"../../lib":381,"../plots":452,"./attributes":402,"./constants":408}],412:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -72280,7 +72166,7 @@ module.exports = { } }; -},{"../../components/color/attributes":302,"../../components/rangeselector/attributes":351,"../../components/rangeslider/attributes":358,"../../lib/extend":377,"../font_attributes":423,"./constants":410}],415:[function(require,module,exports){ +},{"../../components/color/attributes":302,"../../components/rangeselector/attributes":350,"../../components/rangeslider/attributes":357,"../../lib/extend":376,"../font_attributes":421,"./constants":408}],413:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -72453,7 +72339,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) { }); }; -},{"../../components/color":303,"../../components/rangeselector":357,"../../components/rangeslider":362,"../../lib":382,"../plots":454,"./axis_defaults":406,"./axis_ids":407,"./constants":410,"./layout_attributes":414,"./position_defaults":417}],416:[function(require,module,exports){ +},{"../../components/color":303,"../../components/rangeselector":356,"../../components/rangeslider":361,"../../lib":381,"../plots":452,"./axis_defaults":404,"./axis_ids":405,"./constants":408,"./layout_attributes":412,"./position_defaults":415}],414:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -72532,7 +72418,7 @@ module.exports = function orderedCategories(axisLetter, categoryorder, categorya } }; -},{"d3":113}],417:[function(require,module,exports){ +},{"d3":113}],415:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -72597,7 +72483,7 @@ module.exports = function handlePositionDefaults(containerIn, containerOut, coer return containerOut; }; -},{"../../lib":382,"fast-isnumeric":117}],418:[function(require,module,exports){ +},{"../../lib":381,"fast-isnumeric":117}],416:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -72797,7 +72683,7 @@ module.exports = function prepSelect(e, startX, startY, dragOptions, mode) { }; }; -},{"../../components/color":303,"../../lib/polygon":388,"./axes":405,"./constants":410}],419:[function(require,module,exports){ +},{"../../components/color":303,"../../lib/polygon":386,"./axes":403,"./constants":408}],417:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -72967,7 +72853,7 @@ module.exports = function setConvert(ax) { ax.range[1] = ar1[1]; } } - catch(e) { Lib.error(e, ax.range); } + catch(e) { console.log(e, ax.range); } } } else if(ax.type === 'category') { @@ -73041,7 +72927,7 @@ module.exports = function setConvert(ax) { ax._forceTick0 = null; }; -},{"../../lib":382,"./axis_ids":407,"./clean_datum":409,"./constants":410,"d3":113,"fast-isnumeric":117}],420:[function(require,module,exports){ +},{"../../lib":381,"./axis_ids":405,"./clean_datum":407,"./constants":408,"d3":113,"fast-isnumeric":117}],418:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -73124,7 +73010,7 @@ function getShowAttrDflt(containerIn) { } } -},{"../../lib":382}],421:[function(require,module,exports){ +},{"../../lib":381}],419:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -73157,7 +73043,7 @@ module.exports = function handleTickDefaults(containerIn, containerOut, coerce, } }; -},{"../../lib":382,"./layout_attributes":414}],422:[function(require,module,exports){ +},{"../../lib":381,"./layout_attributes":412}],420:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -73198,7 +73084,7 @@ module.exports = function handleTickValueDefaults(containerIn, containerOut, coe } }; -},{"fast-isnumeric":117}],423:[function(require,module,exports){ +},{"fast-isnumeric":117}],421:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -73229,7 +73115,7 @@ module.exports = { } }; -},{}],424:[function(require,module,exports){ +},{}],422:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -73387,7 +73273,7 @@ params.layerNameToAdjective = { // base layers drawn over choropleth params.baseLayersOverChoropleth = ['rivers', 'lakes']; -},{}],425:[function(require,module,exports){ +},{}],423:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -73881,7 +73767,7 @@ function createMockAxis(fullLayout) { return mockAxis; } -},{"../../components/color":303,"../../components/drawing":326,"../../constants/xmlns_namespaces":370,"../../lib/filter_visible":378,"../../lib/topojson_utils":396,"../../plots/cartesian/axes":405,"./constants":424,"./projections":432,"./set_scale":433,"./zoom":434,"./zoom_reset":435,"d3":113,"topojson":275}],426:[function(require,module,exports){ +},{"../../components/color":303,"../../components/drawing":325,"../../constants/xmlns_namespaces":369,"../../lib/filter_visible":377,"../../lib/topojson_utils":394,"../../plots/cartesian/axes":403,"./constants":422,"./projections":430,"./set_scale":431,"./zoom":432,"./zoom_reset":433,"d3":113,"topojson":275}],424:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -73987,7 +73873,7 @@ exports.toSVG = function(gd) { } }; -},{"../../plots/plots":454,"./geo":425,"./layout/attributes":427,"./layout/defaults":430,"./layout/layout_attributes":431}],427:[function(require,module,exports){ +},{"../../plots/plots":452,"./geo":423,"./layout/attributes":425,"./layout/defaults":428,"./layout/layout_attributes":429}],425:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -74008,7 +73894,7 @@ module.exports = { } }; -},{}],428:[function(require,module,exports){ +},{}],426:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -74063,7 +73949,7 @@ module.exports = { } }; -},{"../../../components/color/attributes":302}],429:[function(require,module,exports){ +},{"../../../components/color/attributes":302}],427:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -74137,7 +74023,7 @@ module.exports = function supplyGeoAxisLayoutDefaults(geoLayoutIn, geoLayoutOut) } }; -},{"../../../lib":382,"../constants":424,"./axis_attributes":428}],430:[function(require,module,exports){ +},{"../../../lib":381,"../constants":422,"./axis_attributes":426}],428:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -74256,7 +74142,7 @@ function handleGeoDefaults(geoLayoutIn, geoLayoutOut, coerce) { ]; } -},{"../../subplot_defaults":460,"../constants":424,"./axis_defaults":429,"./layout_attributes":431}],431:[function(require,module,exports){ +},{"../../subplot_defaults":458,"../constants":422,"./axis_defaults":427,"./layout_attributes":429}],429:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -74489,7 +74375,7 @@ module.exports = { lataxis: geoAxesAttrs }; -},{"../../../components/color/attributes":302,"../constants":424,"./axis_attributes":428}],432:[function(require,module,exports){ +},{"../../../components/color/attributes":302,"../constants":422,"./axis_attributes":426}],430:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -74935,7 +74821,7 @@ function addProjectionsToD3(d3) { module.exports = addProjectionsToD3; -},{}],433:[function(require,module,exports){ +},{}],431:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -74949,7 +74835,7 @@ module.exports = addProjectionsToD3; var d3 = require('d3'); -var clipPad = require('./constants').clipPad; +var clipPad = require('./constants/').clipPad; function createGeoScale(geoLayout, graphSize) { var projLayout = geoLayout.projection, @@ -75086,7 +74972,7 @@ function getBounds(projection, rangeBox) { return d3.geo.path().projection(projection).bounds(rangeBox); } -},{"./constants":424,"d3":113}],434:[function(require,module,exports){ +},{"./constants/":422,"d3":113}],432:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -75513,7 +75399,7 @@ function d3_eventDispatch(target) { return dispatch; } -},{"d3":113}],435:[function(require,module,exports){ +},{"d3":113}],433:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -75548,7 +75434,7 @@ function createGeoZoomReset(geo, geoLayout) { module.exports = createGeoZoomReset; -},{"../cartesian/graph_interact":412}],436:[function(require,module,exports){ +},{"../cartesian/graph_interact":410}],434:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -75703,7 +75589,7 @@ function createCamera(scene) { return result; } -},{"mouse-change":241,"mouse-wheel":245}],437:[function(require,module,exports){ +},{"mouse-change":241,"mouse-wheel":245}],435:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -75946,7 +75832,7 @@ function createAxes2D(scene) { module.exports = createAxes2D; -},{"../../lib/html2unicode":381,"../../lib/str2rgbarray":394,"../../plotly":402}],438:[function(require,module,exports){ +},{"../../lib/html2unicode":380,"../../lib/str2rgbarray":392,"../../plotly":400}],436:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -76059,7 +75945,7 @@ exports.toSVG = function(gd) { } }; -},{"../../constants/xmlns_namespaces":370,"../cartesian/attributes":404,"../plots":454,"./scene2d":439}],439:[function(require,module,exports){ +},{"../../constants/xmlns_namespaces":369,"../cartesian/attributes":402,"../plots":452,"./scene2d":437}],437:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -76596,7 +76482,7 @@ proto.hoverFormatter = function(axisName, val) { return Axes.tickText(axis, axis.c2l(val), 'hover').text; }; -},{"../../lib/html2unicode":381,"../../lib/show_no_webgl_msg":392,"../../plots/cartesian/axes":405,"../../plots/cartesian/graph_interact":412,"./camera":436,"./convert":437,"gl-plot2d":165,"gl-select-box":195,"gl-spikes2d":215}],440:[function(require,module,exports){ +},{"../../lib/html2unicode":380,"../../lib/show_no_webgl_msg":390,"../../plots/cartesian/axes":403,"../../plots/cartesian/graph_interact":410,"./camera":434,"./convert":435,"gl-plot2d":165,"gl-select-box":195,"gl-spikes2d":215}],438:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -76839,7 +76725,7 @@ function createCamera(element, options) { return camera; } -},{"3d-view":39,"mouse-change":241,"mouse-wheel":245,"right-now":255}],441:[function(require,module,exports){ +},{"3d-view":39,"mouse-change":241,"mouse-wheel":245,"right-now":255}],439:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -76973,7 +76859,7 @@ function initAxes(gd, sceneLayout) { } } -},{"../../constants/xmlns_namespaces":370,"../plots":454,"./layout/attributes":442,"./layout/defaults":446,"./layout/layout_attributes":447,"./scene":451,"./set_convert":452}],442:[function(require,module,exports){ +},{"../../constants/xmlns_namespaces":369,"../plots":452,"./layout/attributes":440,"./layout/defaults":444,"./layout/layout_attributes":445,"./scene":449,"./set_convert":450}],440:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -76994,7 +76880,7 @@ module.exports = { } }; -},{}],443:[function(require,module,exports){ +},{}],441:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -77100,7 +76986,7 @@ module.exports = { zerolinewidth: axesAttrs.zerolinewidth }; -},{"../../../components/color":303,"../../../lib/extend":377,"../../cartesian/layout_attributes":414}],444:[function(require,module,exports){ +},{"../../../components/color":303,"../../../lib/extend":376,"../../cartesian/layout_attributes":412}],442:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -77169,7 +77055,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, options) { } }; -},{"../../../lib":382,"../../cartesian/axis_defaults":406,"./axis_attributes":443,"tinycolor2":274}],445:[function(require,module,exports){ +},{"../../../lib":381,"../../cartesian/axis_defaults":404,"./axis_attributes":441,"tinycolor2":274}],443:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -77325,7 +77211,7 @@ function createAxesOptions(plotlyOptions) { module.exports = createAxesOptions; -},{"../../../lib/html2unicode":381,"../../../lib/str2rgbarray":394,"arraytools":49}],446:[function(require,module,exports){ +},{"../../../lib/html2unicode":380,"../../../lib/str2rgbarray":392,"arraytools":49}],444:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -77432,7 +77318,7 @@ function handleGl3dDefaults(sceneLayoutIn, sceneLayoutOut, coerce, opts) { coerce('hovermode', opts.getDfltFromLayout('hovermode')); } -},{"../../../components/color":303,"../../subplot_defaults":460,"./axis_defaults":444,"./layout_attributes":447}],447:[function(require,module,exports){ +},{"../../../components/color":303,"../../subplot_defaults":458,"./axis_defaults":442,"./layout_attributes":445}],445:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -77560,7 +77446,7 @@ module.exports = { } }; -},{"../../../lib/extend":377,"./axis_attributes":443}],448:[function(require,module,exports){ +},{"../../../lib/extend":376,"./axis_attributes":441}],446:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -77606,7 +77492,7 @@ function createSpikeOptions(layout) { module.exports = createSpikeOptions; -},{"../../../lib/str2rgbarray":394}],449:[function(require,module,exports){ +},{"../../../lib/str2rgbarray":392}],447:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -77701,7 +77587,7 @@ function computeTickMarks(scene) { scene.contourLevels = contourLevelsFromTicks(ticks); } -},{"../../../lib/html2unicode":381,"../../../plotly":402}],450:[function(require,module,exports){ +},{"../../../lib/html2unicode":380,"../../../plotly":400}],448:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -77735,7 +77621,7 @@ function project(camera, v) { module.exports = project; -},{}],451:[function(require,module,exports){ +},{}],449:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -77921,7 +77807,7 @@ function initializeGLPlot(scene, fullLayout, canvas, gl) { if(!scene.staticMode) { scene.glplot.canvas.addEventListener('webglcontextlost', function(ev) { - Lib.warn('Lost WebGL context.'); + console.log('lost context'); ev.preventDefault(); }); } @@ -78019,7 +77905,7 @@ proto.recoverContext = function() { return; } if(!initializeGLPlot(scene, scene.fullLayout, canvas, gl)) { - Lib.error('Catastrophic and unrecoverable WebGL error. Context lost.'); + console.error('catastrophic/unrecoverable webgl error. context lost.'); return; } scene.plot.apply(scene, scene.plotArgs); @@ -78464,7 +78350,7 @@ proto.toImage = function(format) { module.exports = Scene; -},{"../../lib":382,"../../lib/show_no_webgl_msg":392,"../../lib/str2rgbarray":394,"../../plots/cartesian/axes":405,"../../plots/cartesian/graph_interact":412,"../../plots/plots":454,"./camera":440,"./layout/convert":445,"./layout/spikes":448,"./layout/tick_marks":449,"./project":450,"./set_convert":452,"gl-plot3d":183}],452:[function(require,module,exports){ +},{"../../lib":381,"../../lib/show_no_webgl_msg":390,"../../lib/str2rgbarray":392,"../../plots/cartesian/axes":403,"../../plots/cartesian/graph_interact":410,"../../plots/plots":452,"./camera":438,"./layout/convert":443,"./layout/spikes":446,"./layout/tick_marks":447,"./project":448,"./set_convert":450,"gl-plot3d":183}],450:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -78486,7 +78372,7 @@ module.exports = function setConvert(containerOut) { containerOut.setScale = noop; }; -},{"../cartesian/axes":405}],453:[function(require,module,exports){ +},{"../cartesian/axes":403}],451:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -78645,12 +78531,11 @@ module.exports = { 'annotations': 'Annotations', 'shapes': 'Shapes', 'images': 'Images', - 'ternary': 'ternary', - 'mapbox': 'mapbox' + 'ternary': 'ternary' } }; -},{"../components/color/attributes":302,"../plotly":402,"./font_attributes":423}],454:[function(require,module,exports){ +},{"../components/color/attributes":302,"../plotly":400,"./font_attributes":421}],452:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -78695,7 +78580,7 @@ plots.fontWeight = 'normal'; */ plots.register = function(_module, thisType, categoriesIn, meta) { if(modules[thisType]) { - Lib.log('Type ' + thisType + ' already registered'); + console.log('type ' + thisType + ' already registered'); return; } @@ -78724,7 +78609,7 @@ function getTraceType(traceType) { plots.getModule = function(trace) { if(trace.r !== undefined) { - Lib.warn('Tried to put a polar trace ' + + console.log('Oops, tried to put a polar trace ' + 'on an incompatible graph of cartesian ' + 'data. Ignoring this dataset.', trace ); @@ -78752,7 +78637,7 @@ plots.traceIs = function traceIs(traceType, category) { if(!_module) { if(traceType !== undefined) { - Lib.log('Unrecognized trace type ' + traceType + '.'); + console.warn('unrecognized trace type ' + traceType); } _module = modules[plots.attributes.type.dflt]; } @@ -78786,7 +78671,7 @@ plots.registerSubplot = function(_module) { var plotType = _module.name; if(subplotsRegistry[plotType]) { - Lib.log('Plot type ' + plotType + ' already registered.'); + console.log('plot type ' + plotType + ' already registered'); return; } @@ -79756,7 +79641,7 @@ plots.graphJson = function(gd, dataonly, mode, output, useDefaults) { return (output === 'object') ? obj : JSON.stringify(obj); }; -},{"../components/color":303,"../lib":382,"../plotly":402,"./attributes":403,"./font_attributes":423,"./layout_attributes":453,"d3":113,"fast-isnumeric":117}],455:[function(require,module,exports){ +},{"../components/color":303,"../lib":381,"../plotly":400,"./attributes":401,"./font_attributes":421,"./layout_attributes":451,"d3":113,"fast-isnumeric":117}],453:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -79781,7 +79666,7 @@ module.exports = { } }; -},{"../../traces/scatter/attributes":556}],456:[function(require,module,exports){ +},{"../../traces/scatter/attributes":554}],454:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -79896,7 +79781,7 @@ module.exports = { } }; -},{"../../lib/extend":377,"../cartesian/layout_attributes":414}],457:[function(require,module,exports){ +},{"../../lib/extend":376,"../cartesian/layout_attributes":412}],455:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -81319,7 +81204,7 @@ var extendDeepAll = Plotly.Lib.extendDeepAll; return exports; }; -},{"../../plotly":402,"./micropolar_manager":458,"d3":113}],458:[function(require,module,exports){ +},{"../../plotly":400,"./micropolar_manager":456,"d3":113}],456:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -81372,9 +81257,11 @@ manager.framework = function(_gd) { (function(_configClone, _previousConfigClone) { undoManager.add({ undo: function() { + //console.log('undo', _previousConfigClone); if(_previousConfigClone) that(_previousConfigClone); }, redo: function() { + //console.log('redo', _configClone); that(_configClone); } }); @@ -81402,7 +81289,7 @@ manager.fillLayout = function(_gd) { _gd._fullLayout = extendDeepAll(dflts, _gd.layout); }; -},{"../../plotly":402,"./undo_manager":459,"d3":113}],459:[function(require,module,exports){ +},{"../../plotly":400,"./undo_manager":457,"d3":113}],457:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -81468,7 +81355,7 @@ module.exports = function UndoManager() { }; }; -},{}],460:[function(require,module,exports){ +},{}],458:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -81543,7 +81430,7 @@ module.exports = function handleSubplotDefaults(layoutIn, layoutOut, fullData, o } }; -},{"../lib":382,"./plots":454}],461:[function(require,module,exports){ +},{"../lib":381,"./plots":452}],459:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -81584,7 +81471,7 @@ exports.plot = function plotTernary(gd) { for(var i = 0; i < ternaryIds.length; i++) { var ternaryId = ternaryIds[i], fullTernaryData = Plots.getSubplotData(fullData, 'ternary', ternaryId), - ternary = fullLayout[ternaryId]._subplot; + ternary = fullLayout[ternaryId]._ternary; // If ternary is not instantiated, create one! if(ternary === undefined) { @@ -81596,7 +81483,7 @@ exports.plot = function plotTernary(gd) { fullLayout ); - fullLayout[ternaryId]._subplot = ternary; + fullLayout[ternaryId]._ternary = ternary; } ternary.plot(fullTernaryData, fullLayout, gd._promises); @@ -81608,7 +81495,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) for(var i = 0; i < oldTernaryKeys.length; i++) { var oldTernaryKey = oldTernaryKeys[i]; - var oldTernary = oldFullLayout[oldTernaryKey]._subplot; + var oldTernary = oldFullLayout[oldTernaryKey]._ternary; if(!newFullLayout[oldTernaryKey] && !!oldTernary) { oldTernary.plotContainer.remove(); @@ -81617,7 +81504,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) } }; -},{"../../plots/plots":454,"./layout/attributes":462,"./layout/defaults":465,"./layout/layout_attributes":466,"./ternary":467}],462:[function(require,module,exports){ +},{"../../plots/plots":452,"./layout/attributes":460,"./layout/defaults":463,"./layout/layout_attributes":464,"./ternary":465}],460:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -81638,7 +81525,7 @@ module.exports = { } }; -},{}],463:[function(require,module,exports){ +},{}],461:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -81697,7 +81584,7 @@ module.exports = { } }; -},{"../../../lib/extend":377,"../../cartesian/layout_attributes":414}],464:[function(require,module,exports){ +},{"../../../lib/extend":376,"../../cartesian/layout_attributes":412}],462:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -81781,7 +81668,7 @@ module.exports = function supplyLayoutDefaults(containerIn, containerOut, option } }; -},{"../../../lib":382,"../../cartesian/tick_label_defaults":420,"../../cartesian/tick_mark_defaults":421,"../../cartesian/tick_value_defaults":422,"./axis_attributes":463,"tinycolor2":274}],465:[function(require,module,exports){ +},{"../../../lib":381,"../../cartesian/tick_label_defaults":418,"../../cartesian/tick_mark_defaults":419,"../../cartesian/tick_value_defaults":420,"./axis_attributes":461,"tinycolor2":274}],463:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -81844,7 +81731,7 @@ function handleTernaryDefaults(ternaryLayoutIn, ternaryLayoutOut, coerce, option } } -},{"../../../components/color":303,"../../subplot_defaults":460,"./axis_defaults":464,"./layout_attributes":466}],466:[function(require,module,exports){ +},{"../../../components/color":303,"../../subplot_defaults":458,"./axis_defaults":462,"./layout_attributes":464}],464:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -81900,7 +81787,7 @@ module.exports = { caxis: ternaryAxesAttrs }; -},{"../../../components/color/attributes":302,"./axis_attributes":463}],467:[function(require,module,exports){ +},{"../../../components/color/attributes":302,"./axis_attributes":461}],465:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -82578,6 +82465,19 @@ proto.initInteractions = function() { dragger.onclick = function(evt) { fx.click(gd, evt); }; + + // make a fake plotinfo for fx.hover + // it hardly uses it, could probably be refactored out... + // but specifying subplot by name does seem nice for js applications + // that want to hook into this. + if(!gd._fullLayout._plots) gd._fullLayout._plots = {}; + gd._fullLayout._plots[_this.id] = { + overlays: [], + xaxis: _this.xaxis, + yaxis: _this.yaxis, + x: function() { return _this.xaxis; }, + y: function() { return _this.yaxis; } + }; }; function removeZoombox(gd) { @@ -82586,7 +82486,7 @@ function removeZoombox(gd) { .remove(); } -},{"../../components/color":303,"../../components/dragelement":324,"../../components/drawing":326,"../../components/titles":366,"../../lib":382,"../../lib/extend":377,"../../lib/filter_visible":378,"../../plotly":402,"../cartesian/axes":405,"../cartesian/constants":410,"../cartesian/graph_interact":412,"../cartesian/select":418,"../cartesian/set_convert":419,"d3":113,"tinycolor2":274}],468:[function(require,module,exports){ +},{"../../components/color":303,"../../components/dragelement":323,"../../components/drawing":325,"../../components/titles":365,"../../lib":381,"../../lib/extend":376,"../../lib/filter_visible":377,"../../plotly":400,"../cartesian/axes":403,"../cartesian/constants":408,"../cartesian/graph_interact":410,"../cartesian/select":416,"../cartesian/set_convert":417,"d3":113,"tinycolor2":274}],466:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -82742,7 +82642,7 @@ module.exports = function clonePlot(graphObj, options) { return plotTile; }; -},{"../plotly":402}],469:[function(require,module,exports){ +},{"../plotly":400}],467:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -82808,7 +82708,7 @@ function downloadImage(gd, opts) { module.exports = downloadImage; -},{"../lib":382,"../plot_api/to_image":401,"./filesaver":470}],470:[function(require,module,exports){ +},{"../lib":381,"../plot_api/to_image":399,"./filesaver":468}],468:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -82876,7 +82776,7 @@ var fileSaver = function(url, name) { module.exports = fileSaver; -},{}],471:[function(require,module,exports){ +},{}],469:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -82921,7 +82821,7 @@ var Snapshot = { module.exports = Snapshot; -},{"./cloneplot":468,"./download":469,"./svgtoimg":472,"./toimage":473,"./tosvg":474}],472:[function(require,module,exports){ +},{"./cloneplot":466,"./download":467,"./svgtoimg":470,"./toimage":471,"./tosvg":472}],470:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -83010,7 +82910,7 @@ function svgToImg(opts) { imgData = canvas.toDataURL('image/webp'); break; case 'svg': - imgData = url; + imgData = svg; break; default: reject(new Error('Image format is not jpeg, png or svg')); @@ -83052,7 +82952,7 @@ function svgToImg(opts) { module.exports = svgToImg; -},{"../lib":382,"events":55}],473:[function(require,module,exports){ +},{"../lib":381,"events":55}],471:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -83131,7 +83031,7 @@ function toImage(gd, opts) { module.exports = toImage; -},{"../lib":382,"../plotly":402,"events":55}],474:[function(require,module,exports){ +},{"../lib":381,"../plotly":400,"events":55}],472:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -83212,12 +83112,24 @@ module.exports = function toSVG(gd, format) { return; } - // Font family styles break things because of quotation marks, - // so we must remove them *after* the SVG DOM has been serialized - // to a string (browsers convert singles back) + // I've seen font-family styles with non-escaped double quotes in them - breaks the + // serialized svg because the style attribute itself is double-quoted! + // Is this an IE thing? Any other attributes or style elements that can have quotes in them? + // TODO: this looks like a noop right now - what happened to it? + + /* + * Font-family styles with double quotes in them breaks the to-image + * step in FF42 because the style attribute itself is wrapped in + * double quotes. See: + * + * - http://codepen.io/etpinard/pen/bEdQWK + * - https://github.com/plotly/plotly.js/pull/104 + * + * for more info. + */ var ff = txt.style('font-family'); if(ff && ff.indexOf('"') !== -1) { - txt.style('font-family', ff.replace(/"/g, 'TOBESTRIPPED')); + txt.style('font-family', ff.replace(/"/g, '\\\'')); } }); @@ -83237,13 +83149,10 @@ module.exports = function toSVG(gd, format) { s = svgTextUtils.html_entity_decode(s); s = svgTextUtils.xml_entity_encode(s); - // Fix quotations around font strings - s = s.replace(/("TOBESTRIPPED)|(TOBESTRIPPED")/g, '\''); - return s; }; -},{"../components/color":303,"../components/drawing":326,"../constants/xmlns_namespaces":370,"../lib/svg_text_utils":395,"d3":113}],475:[function(require,module,exports){ +},{"../components/color":303,"../components/drawing":325,"../constants/xmlns_namespaces":369,"../lib/svg_text_utils":393,"d3":113}],473:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -83271,7 +83180,7 @@ module.exports = function arraysToCalcdata(cd) { mergeArray(markerLine.width, cd, 'mlw'); }; -},{"../../lib":382}],476:[function(require,module,exports){ +},{"../../lib":381}],474:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -83282,12 +83191,10 @@ module.exports = function arraysToCalcdata(cd) { 'use strict'; -var scatterAttrs = require('../scatter/attributes'); -var colorAttributes = require('../../components/colorscale/color_attributes'); -var extendFlat = require('../../lib/extend').extendFlat; +var scatterAttrs = require('../scatter/attributes'), + scatterMarkerAttrs = scatterAttrs.marker, + scatterMarkerLineAttrs = scatterMarkerAttrs.line; -var scatterMarkerAttrs = scatterAttrs.marker; -var scatterMarkerLineAttrs = scatterMarkerAttrs.line; module.exports = { x: scatterAttrs.x, @@ -83303,14 +83210,26 @@ module.exports = { values: ['v', 'h'], }, - marker: extendFlat({}, { + marker: { + color: scatterMarkerAttrs.color, + colorscale: scatterMarkerAttrs.colorscale, + cauto: scatterMarkerAttrs.cauto, + cmax: scatterMarkerAttrs.cmax, + cmin: scatterMarkerAttrs.cmin, + autocolorscale: scatterMarkerAttrs.autocolorscale, + reversescale: scatterMarkerAttrs.reversescale, showscale: scatterMarkerAttrs.showscale, - line: extendFlat({}, - {width: scatterMarkerLineAttrs.width}, - colorAttributes('marker.line') - )}, - colorAttributes('marker') - ), + line: { + color: scatterMarkerLineAttrs.color, + colorscale: scatterMarkerLineAttrs.colorscale, + cauto: scatterMarkerLineAttrs.cauto, + cmax: scatterMarkerLineAttrs.cmax, + cmin: scatterMarkerLineAttrs.cmin, + width: scatterMarkerLineAttrs.width, + autocolorscale: scatterMarkerLineAttrs.autocolorscale, + reversescale: scatterMarkerLineAttrs.reversescale + } + }, r: scatterAttrs.r, t: scatterAttrs.t, @@ -83331,7 +83250,7 @@ module.exports = { } }; -},{"../../components/colorscale/color_attributes":311,"../../lib/extend":377,"../scatter/attributes":556}],477:[function(require,module,exports){ +},{"../scatter/attributes":554}],475:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -83390,7 +83309,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../../components/colorscale/calc":310,"../../components/colorscale/has_colorscale":316,"../../plots/cartesian/axes":405,"fast-isnumeric":117}],478:[function(require,module,exports){ +},{"../../components/colorscale/calc":310,"../../components/colorscale/has_colorscale":315,"../../plots/cartesian/axes":403,"fast-isnumeric":117}],476:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -83432,7 +83351,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout errorBarsSupplyDefaults(traceIn, traceOut, Color.defaultLine, {axis: 'x', inherit: 'y'}); }; -},{"../../components/color":303,"../../components/errorbars/defaults":331,"../../lib":382,"../bar/style_defaults":486,"../scatter/xy_defaults":577,"./attributes":476}],479:[function(require,module,exports){ +},{"../../components/color":303,"../../components/errorbars/defaults":330,"../../lib":381,"../bar/style_defaults":484,"../scatter/xy_defaults":575,"./attributes":474}],477:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -83523,7 +83442,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) { return [pointData]; }; -},{"../../components/color":303,"../../components/errorbars":332,"../../plots/cartesian/graph_interact":412}],480:[function(require,module,exports){ +},{"../../components/color":303,"../../components/errorbars":331,"../../plots/cartesian/graph_interact":410}],478:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -83559,7 +83478,7 @@ Bar.meta = { module.exports = Bar; -},{"../../plots/cartesian":413,"../scatter/colorbar":559,"./arrays_to_calcdata":475,"./attributes":476,"./calc":477,"./defaults":478,"./hover":479,"./layout_attributes":481,"./layout_defaults":482,"./plot":483,"./set_positions":484,"./style":485}],481:[function(require,module,exports){ +},{"../../plots/cartesian":411,"../scatter/colorbar":557,"./arrays_to_calcdata":473,"./attributes":474,"./calc":475,"./defaults":476,"./hover":477,"./layout_attributes":479,"./layout_defaults":480,"./plot":481,"./set_positions":482,"./style":483}],479:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -83603,7 +83522,7 @@ module.exports = { } }; -},{}],482:[function(require,module,exports){ +},{}],480:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -83661,7 +83580,7 @@ module.exports = function(layoutIn, layoutOut, fullData) { coerce('bargroupgap'); }; -},{"../../lib":382,"../../plots/cartesian/axes":405,"../../plots/plots":454,"./layout_attributes":481}],483:[function(require,module,exports){ +},{"../../lib":381,"../../plots/cartesian/axes":403,"../../plots/plots":452,"./layout_attributes":479}],481:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -83773,7 +83692,7 @@ module.exports = function plot(gd, plotinfo, cdbar) { }; -},{"../../components/color":303,"../../components/errorbars":332,"../../lib":382,"./arrays_to_calcdata":475,"d3":113,"fast-isnumeric":117}],484:[function(require,module,exports){ +},{"../../components/color":303,"../../components/errorbars":331,"../../lib":381,"./arrays_to_calcdata":473,"d3":113,"fast-isnumeric":117}],482:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -83987,7 +83906,7 @@ module.exports = function setPositions(gd, plotinfo) { }); }; -},{"../../lib":382,"../../plots/cartesian/axes":405,"../../plots/plots":454,"fast-isnumeric":117}],485:[function(require,module,exports){ +},{"../../lib":381,"../../plots/cartesian/axes":403,"../../plots/plots":452,"fast-isnumeric":117}],483:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -84066,7 +83985,7 @@ module.exports = function style(gd) { s.call(ErrorBars.style); }; -},{"../../components/color":303,"../../components/drawing":326,"../../components/errorbars":332,"d3":113}],486:[function(require,module,exports){ +},{"../../components/color":303,"../../components/drawing":325,"../../components/errorbars":331,"d3":113}],484:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -84103,7 +84022,7 @@ module.exports = function handleStyleDefaults(traceIn, traceOut, coerce, default coerce('marker.line.width'); }; -},{"../../components/color":303,"../../components/colorscale/defaults":313,"../../components/colorscale/has_colorscale":316}],487:[function(require,module,exports){ +},{"../../components/color":303,"../../components/colorscale/defaults":312,"../../components/colorscale/has_colorscale":315}],485:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -84234,7 +84153,7 @@ module.exports = { fillcolor: scatterAttrs.fillcolor }; -},{"../../components/color/attributes":302,"../../lib/extend":377,"../scatter/attributes":556}],488:[function(require,module,exports){ +},{"../../components/color/attributes":302,"../../lib/extend":376,"../scatter/attributes":554}],486:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -84383,7 +84302,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../../lib":382,"../../plots/cartesian/axes":405,"fast-isnumeric":117}],489:[function(require,module,exports){ +},{"../../lib":381,"../../plots/cartesian/axes":403,"fast-isnumeric":117}],487:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -84452,7 +84371,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor) { } }; -},{"../../components/color":303,"../../lib":382,"./attributes":487}],490:[function(require,module,exports){ +},{"../../components/color":303,"../../lib":381,"./attributes":485}],488:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -84561,7 +84480,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) { return closeData; }; -},{"../../components/color":303,"../../lib":382,"../../plots/cartesian/axes":405,"../../plots/cartesian/graph_interact":412}],491:[function(require,module,exports){ +},{"../../components/color":303,"../../lib":381,"../../plots/cartesian/axes":403,"../../plots/cartesian/graph_interact":410}],489:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -84594,7 +84513,7 @@ Box.meta = { module.exports = Box; -},{"../../plots/cartesian":413,"./attributes":487,"./calc":488,"./defaults":489,"./hover":490,"./layout_attributes":492,"./layout_defaults":493,"./plot":494,"./set_positions":495,"./style":496}],492:[function(require,module,exports){ +},{"../../plots/cartesian":411,"./attributes":485,"./calc":486,"./defaults":487,"./hover":488,"./layout_attributes":490,"./layout_defaults":491,"./plot":492,"./set_positions":493,"./style":494}],490:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -84632,7 +84551,7 @@ module.exports = { } }; -},{}],493:[function(require,module,exports){ +},{}],491:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -84666,7 +84585,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) { coerce('boxgroupgap'); }; -},{"../../lib":382,"../../plots/plots":454,"./layout_attributes":492}],494:[function(require,module,exports){ +},{"../../lib":381,"../../plots/plots":452,"./layout_attributes":490}],492:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -84893,7 +84812,7 @@ module.exports = function plot(gd, plotinfo, cdbox) { }); }; -},{"../../components/drawing":326,"../../lib":382,"d3":113}],495:[function(require,module,exports){ +},{"../../components/drawing":325,"../../lib":381,"d3":113}],493:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -84986,7 +84905,7 @@ module.exports = function setPositions(gd, plotinfo) { } }; -},{"../../lib":382,"../../plots/cartesian/axes":405,"../../plots/plots":454}],496:[function(require,module,exports){ +},{"../../lib":381,"../../plots/cartesian/axes":403,"../../plots/plots":452}],494:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -85025,7 +84944,7 @@ module.exports = function style(gd) { }); }; -},{"../../components/color":303,"../../components/drawing":326,"d3":113}],497:[function(require,module,exports){ +},{"../../components/color":303,"../../components/drawing":325,"d3":113}],495:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -85043,7 +84962,7 @@ var extendFlat = require('../../lib/extend').extendFlat; var ScatterGeoMarkerLineAttrs = ScatterGeoAttrs.marker.line; -module.exports = extendFlat({}, { +module.exports = { locations: { valType: 'data_array', @@ -85063,17 +84982,22 @@ module.exports = extendFlat({}, { width: ScatterGeoMarkerLineAttrs.width } }, + zauto: colorscaleAttrs.zauto, + zmin: colorscaleAttrs.zmin, + zmax: colorscaleAttrs.zmax, + colorscale: colorscaleAttrs.colorscale, + autocolorscale: colorscaleAttrs.autocolorscale, + reversescale: colorscaleAttrs.reversescale, + showscale: colorscaleAttrs.showscale, hoverinfo: extendFlat({}, plotAttrs.hoverinfo, { flags: ['location', 'z', 'text', 'name'] }), _nestedModules: { 'colorbar': 'Colorbar' } -}, - colorscaleAttrs -); +}; -},{"../../components/colorscale/attributes":309,"../../lib/extend":377,"../../plots/attributes":403,"../scattergeo/attributes":584}],498:[function(require,module,exports){ +},{"../../components/colorscale/attributes":309,"../../lib/extend":376,"../../plots/attributes":401,"../scattergeo/attributes":582}],496:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -85092,7 +85016,7 @@ module.exports = function calc(gd, trace) { colorscaleCalc(trace, trace.z, '', 'z'); }; -},{"../../components/colorscale/calc":310}],499:[function(require,module,exports){ +},{"../../components/colorscale/calc":310}],497:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -85147,7 +85071,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout coerce('hoverinfo', (layout._dataLength === 1) ? 'location+z+text' : undefined); }; -},{"../../components/colorscale/defaults":313,"../../lib":382,"./attributes":497}],500:[function(require,module,exports){ +},{"../../components/colorscale/defaults":312,"../../lib":381,"./attributes":495}],498:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -85177,7 +85101,7 @@ Choropleth.meta = { module.exports = Choropleth; -},{"../../plots/geo":426,"../heatmap/colorbar":514,"./attributes":497,"./calc":498,"./defaults":499,"./plot":501}],501:[function(require,module,exports){ +},{"../../plots/geo":424,"../heatmap/colorbar":512,"./attributes":495,"./calc":496,"./defaults":497,"./plot":499}],499:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -85398,7 +85322,7 @@ function makeEventDataFunc(trace) { }; } -},{"../../components/color":303,"../../components/colorscale/get_scale":315,"../../components/colorscale/make_scale_function":320,"../../components/drawing":326,"../../lib/array_to_calc_item":373,"../../lib/geo_location_utils":379,"../../lib/topojson_utils":396,"../../plots/cartesian/axes":405,"../../plots/cartesian/graph_interact":412,"../../plots/geo/constants":424,"./attributes":497,"d3":113}],502:[function(require,module,exports){ +},{"../../components/color":303,"../../components/colorscale/get_scale":314,"../../components/colorscale/make_scale_function":319,"../../components/drawing":325,"../../lib/array_to_calc_item":372,"../../lib/geo_location_utils":378,"../../lib/topojson_utils":394,"../../plots/cartesian/axes":403,"../../plots/cartesian/graph_interact":410,"../../plots/geo/constants":422,"./attributes":495,"d3":113}],500:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -85411,94 +85335,97 @@ function makeEventDataFunc(trace) { var heatmapAttrs = require('../heatmap/attributes'); var scatterAttrs = require('../scatter/attributes'); -var colorscaleAttrs = require('../../components/colorscale/attributes'); var extendFlat = require('../../lib/extend').extendFlat; var scatterLineAttrs = scatterAttrs.line; -module.exports = extendFlat({}, - { - z: heatmapAttrs.z, - x: heatmapAttrs.x, - x0: heatmapAttrs.x0, - dx: heatmapAttrs.dx, - y: heatmapAttrs.y, - y0: heatmapAttrs.y0, - dy: heatmapAttrs.dy, - text: heatmapAttrs.text, - transpose: heatmapAttrs.transpose, - xtype: heatmapAttrs.xtype, - ytype: heatmapAttrs.ytype, - - connectgaps: heatmapAttrs.connectgaps, - - autocontour: { - valType: 'boolean', - dflt: true, +module.exports = { + z: heatmapAttrs.z, + x: heatmapAttrs.x, + x0: heatmapAttrs.x0, + dx: heatmapAttrs.dx, + y: heatmapAttrs.y, + y0: heatmapAttrs.y0, + dy: heatmapAttrs.dy, + text: heatmapAttrs.text, + transpose: heatmapAttrs.transpose, + xtype: heatmapAttrs.xtype, + ytype: heatmapAttrs.ytype, + + zauto: heatmapAttrs.zauto, + zmin: heatmapAttrs.zmin, + zmax: heatmapAttrs.zmax, + colorscale: heatmapAttrs.colorscale, + autocolorscale: heatmapAttrs.autocolorscale, + reversescale: heatmapAttrs.reversescale, + showscale: heatmapAttrs.showscale, + + connectgaps: heatmapAttrs.connectgaps, + + autocontour: { + valType: 'boolean', + dflt: true, + + + }, + ncontours: { + valType: 'integer', + dflt: 0, + + + }, + + contours: { + start: { + valType: 'number', + dflt: null, }, - ncontours: { - valType: 'integer', - dflt: 0, + end: { + valType: 'number', + dflt: null, }, - - contours: { - start: { - valType: 'number', - dflt: null, - - - }, - end: { - valType: 'number', - dflt: null, - - - }, - size: { - valType: 'number', - dflt: null, - - - }, - coloring: { - valType: 'enumerated', - values: ['fill', 'heatmap', 'lines', 'none'], - dflt: 'fill', - - - }, - showlines: { - valType: 'boolean', - dflt: true, - - - } + size: { + valType: 'number', + dflt: null, + + }, - - line: { - color: extendFlat({}, scatterLineAttrs.color, { - - }), - width: scatterLineAttrs.width, - dash: scatterLineAttrs.dash, - smoothing: extendFlat({}, scatterLineAttrs.smoothing, { - - }) + coloring: { + valType: 'enumerated', + values: ['fill', 'heatmap', 'lines', 'none'], + dflt: 'fill', + + }, - - _nestedModules: { - 'colorbar': 'Colorbar' + showlines: { + valType: 'boolean', + dflt: true, + + } }, - colorscaleAttrs, - {autocolorscale: extendFlat({}, colorscaleAttrs.autocolorscale, {dflt: false})} -); -},{"../../components/colorscale/attributes":309,"../../lib/extend":377,"../heatmap/attributes":512,"../scatter/attributes":556}],503:[function(require,module,exports){ + line: { + color: extendFlat({}, scatterLineAttrs.color, { + + }), + width: scatterLineAttrs.width, + dash: scatterLineAttrs.dash, + smoothing: extendFlat({}, scatterLineAttrs.smoothing, { + + }) + }, + + _nestedModules: { + 'colorbar': 'Colorbar' + } +}; + +},{"../../lib/extend":376,"../heatmap/attributes":510,"../scatter/attributes":554}],501:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -85551,7 +85478,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../../plots/cartesian/axes":405,"../heatmap/calc":513}],504:[function(require,module,exports){ +},{"../../plots/cartesian/axes":403,"../heatmap/calc":511}],502:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -85612,7 +85539,7 @@ module.exports = function colorbar(gd, cd) { .options(trace.colorbar)(); }; -},{"../../components/colorbar/draw":306,"../../plots/plots":454,"./make_color_map":508}],505:[function(require,module,exports){ +},{"../../components/colorbar/draw":306,"../../plots/plots":452,"./make_color_map":506}],503:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -85656,7 +85583,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout handleStyleDefaults(traceIn, traceOut, coerce, layout); }; -},{"../../lib":382,"../contour/style_defaults":511,"../heatmap/has_columns":517,"../heatmap/xyz_defaults":523,"./attributes":502}],506:[function(require,module,exports){ +},{"../../lib":381,"../contour/style_defaults":509,"../heatmap/has_columns":515,"../heatmap/xyz_defaults":521,"./attributes":500}],504:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -85675,7 +85602,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) { return heatmapHoverPoints(pointData, xval, yval, hovermode, true); }; -},{"../heatmap/hover":518}],507:[function(require,module,exports){ +},{"../heatmap/hover":516}],505:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -85707,7 +85634,7 @@ Contour.meta = { module.exports = Contour; -},{"../../plots/cartesian":413,"./attributes":502,"./calc":503,"./colorbar":504,"./defaults":505,"./hover":506,"./plot":509,"./style":510}],508:[function(require,module,exports){ +},{"../../plots/cartesian":411,"./attributes":500,"./calc":501,"./colorbar":502,"./defaults":503,"./hover":504,"./plot":507,"./style":508}],506:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -85787,7 +85714,7 @@ module.exports = function makeColorMap(trace) { return colorMap; }; -},{"../../components/colorscale/get_scale":315,"d3":113}],509:[function(require,module,exports){ +},{"../../components/colorscale/get_scale":314,"d3":113}],507:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -85841,6 +85768,7 @@ var BOTTOMSTART = [1, 9, 13, 104, 713], SADDLEREMAINDER = {1: 4, 2: 8, 4: 1, 7: 13, 8: 2, 11: 14, 13: 7, 14: 11}; function plotOne(gd, plotinfo, cd) { + Lib.markTime('in Contour.plot'); var trace = cd[0].trace, x = cd[0].x, y = cd[0].y, @@ -85892,6 +85820,8 @@ function plotOne(gd, plotinfo, cd) { makeFills(plotGroup, pathinfo, perimeter, contours); makeLines(plotGroup, pathinfo, contours); clipGaps(plotGroup, plotinfo, cd[0], perimeter); + + Lib.markTime('done Contour.plot'); } function emptyPathinfo(contours, plotinfo, cd0) { @@ -86025,7 +85955,7 @@ function makePath(pi, loc, edgeflag) { marchStep = NEWDELTA[mi]; if(!marchStep) { - Lib.log('Found bad marching index:', mi, loc, pi.level); + console.log('found bad marching index', mi, loc, pi.level); break; } @@ -86049,7 +85979,7 @@ function makePath(pi, loc, edgeflag) { } if(cnt === 10000) { - Lib.log('Infinite loop in contour?'); + console.log('Infinite loop in contour?'); } var closedpath = equalPts(pts[0], pts[pts.length - 1]), totaldist = 0, @@ -86133,7 +86063,7 @@ function makePath(pi, loc, edgeflag) { } else { if(!edgeflag) { - Lib.log('Unclosed interior contour?', + console.log('unclosed interior contour?', pi.level, startLocStr, pts.join('L')); } @@ -86200,7 +86130,7 @@ function findAllPaths(pathinfo) { startLoc = Object.keys(pi.crossings)[0].split(',').map(Number); makePath(pi, startLoc); } - if(cnt === 10000) Lib.log('Infinite loop in contour?'); + if(cnt === 10000) console.log('Infinite loop in contour?'); } } @@ -86335,7 +86265,7 @@ function joinAllPaths(pi, perimeter) { //now loop through sides, moving our endpoint until we find a new start for(cnt = 0; cnt < 4; cnt++) { // just to prevent infinite loops if(!endpt) { - Lib.log('Missing end?', i, pi); + console.log('missing end?', i, pi); break; } @@ -86362,7 +86292,7 @@ function joinAllPaths(pi, perimeter) { } } else { - Lib.log('endpt to newendpt is not vert. or horz.', + console.log('endpt to newendpt is not vert. or horz.', endpt, newendpt, ptNew); } } @@ -86374,7 +86304,7 @@ function joinAllPaths(pi, perimeter) { } if(nexti === pi.edgepaths.length) { - Lib.log('unclosed perimeter path'); + console.log('unclosed perimeter path'); break; } @@ -86497,7 +86427,7 @@ function makeClipMask(cd0) { return z; } -},{"../../components/drawing":326,"../../lib":382,"../heatmap/plot":521,"d3":113}],510:[function(require,module,exports){ +},{"../../components/drawing":325,"../../lib":381,"../heatmap/plot":519,"d3":113}],508:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -86554,7 +86484,7 @@ module.exports = function style(gd) { heatmapStyle(gd); }; -},{"../../components/drawing":326,"../heatmap/style":522,"./make_color_map":508,"d3":113}],511:[function(require,module,exports){ +},{"../../components/drawing":325,"../heatmap/style":520,"./make_color_map":506,"d3":113}],509:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -86590,7 +86520,7 @@ module.exports = function handleStyleDefaults(traceIn, traceOut, coerce, layout) } }; -},{"../../components/colorscale/defaults":313}],512:[function(require,module,exports){ +},{"../../components/colorscale/defaults":312}],510:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -86606,63 +86536,68 @@ var colorscaleAttrs = require('../../components/colorscale/attributes'); var extendFlat = require('../../lib/extend').extendFlat; -module.exports = extendFlat({}, - { - z: { - valType: 'data_array', - - }, - x: scatterAttrs.x, - x0: scatterAttrs.x0, - dx: scatterAttrs.dx, - y: scatterAttrs.y, - y0: scatterAttrs.y0, - dy: scatterAttrs.dy, - text: { - valType: 'data_array', - - }, - transpose: { - valType: 'boolean', - dflt: false, - - - }, - xtype: { - valType: 'enumerated', - values: ['array', 'scaled'], - - - }, - ytype: { - valType: 'enumerated', - values: ['array', 'scaled'], - - - }, - zsmooth: { - valType: 'enumerated', - values: ['fast', 'best', false], - dflt: false, - - - }, - connectgaps: { - valType: 'boolean', - dflt: false, - - - }, - _nestedModules: { - 'colorbar': 'Colorbar' - } +module.exports = { + z: { + valType: 'data_array', + + }, + x: scatterAttrs.x, + x0: scatterAttrs.x0, + dx: scatterAttrs.dx, + y: scatterAttrs.y, + y0: scatterAttrs.y0, + dy: scatterAttrs.dy, + text: { + valType: 'data_array', + + }, + transpose: { + valType: 'boolean', + dflt: false, + + + }, + xtype: { + valType: 'enumerated', + values: ['array', 'scaled'], + + + }, + ytype: { + valType: 'enumerated', + values: ['array', 'scaled'], + + }, - colorscaleAttrs, - {autocolorscale: extendFlat({}, colorscaleAttrs.autocolorscale, {dflt: false})} -); + zauto: colorscaleAttrs.zauto, + zmin: colorscaleAttrs.zmin, + zmax: colorscaleAttrs.zmax, + colorscale: colorscaleAttrs.colorscale, + autocolorscale: extendFlat({}, colorscaleAttrs.autocolorscale, + {dflt: false}), + reversescale: colorscaleAttrs.reversescale, + showscale: colorscaleAttrs.showscale, + zsmooth: { + valType: 'enumerated', + values: ['fast', 'best', false], + dflt: false, + + + }, + connectgaps: { + valType: 'boolean', + dflt: false, + + + }, + + _nestedModules: { + 'colorbar': 'Colorbar' + } +}; -},{"../../components/colorscale/attributes":309,"../../lib/extend":377,"../scatter/attributes":556}],513:[function(require,module,exports){ +},{"../../components/colorscale/attributes":309,"../../lib/extend":376,"../scatter/attributes":554}],511:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -86688,6 +86623,8 @@ var maxRowLength = require('./max_row_length'); module.exports = function calc(gd, trace) { + Lib.markTime('start convert x&y'); + // prepare the raw data // run makeCalcdata on x and y even for heatmaps, in case of category mappings var xa = Axes.getFromId(gd, trace.xaxis || 'x'), @@ -86708,6 +86645,8 @@ module.exports = function calc(gd, trace) { xa._minDtick = 0; ya._minDtick = 0; + Lib.markTime('done convert x&y'); + if(isHist) { var binned = histogram2dCalc(gd, trace); x = binned.x; @@ -86929,7 +86868,7 @@ function interp2d(z, emptyPoints, savedInterpZ) { correctionOvershoot(maxFractionalChange)); } if(maxFractionalChange > INTERPTHRESHOLD) { - Lib.log('interp2d didn\'t converge quickly', maxFractionalChange); + console.log('interp2d didn\'t converge quickly', maxFractionalChange); } return z; @@ -87098,7 +87037,7 @@ function iterateInterp2d(z, emptyPoints, overshoot) { return maxFractionalChange; } -},{"../../components/colorscale/calc":310,"../../lib":382,"../../plots/cartesian/axes":405,"../../plots/plots":454,"../histogram2d/calc":533,"./convert_column_xyz":515,"./has_columns":517,"./max_row_length":520,"fast-isnumeric":117}],514:[function(require,module,exports){ +},{"../../components/colorscale/calc":310,"../../lib":381,"../../plots/cartesian/axes":403,"../../plots/plots":452,"../histogram2d/calc":531,"./convert_column_xyz":513,"./has_columns":515,"./max_row_length":518,"fast-isnumeric":117}],512:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -87142,9 +87081,11 @@ module.exports = function colorbar(gd, cd) { .range(scl.map(function(v) { return v[1]; }))) .filllevels({start: zmin, end: zmax, size: (zmax - zmin) / 254}) .options(trace.colorbar)(); + + Lib.markTime('done colorbar'); }; -},{"../../components/colorbar/draw":306,"../../components/colorscale/get_scale":315,"../../lib":382,"../../plots/plots":454,"d3":113,"fast-isnumeric":117}],515:[function(require,module,exports){ +},{"../../components/colorbar/draw":306,"../../components/colorscale/get_scale":314,"../../lib":381,"../../plots/plots":452,"d3":113,"fast-isnumeric":117}],513:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -87201,7 +87142,7 @@ module.exports = function convertColumnXYZ(trace, xa, ya) { if(hasColumnText) trace.text = text; }; -},{"../../lib":382}],516:[function(require,module,exports){ +},{"../../lib":381}],514:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -87239,7 +87180,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'}); }; -},{"../../components/colorscale/defaults":313,"../../lib":382,"./attributes":512,"./has_columns":517,"./xyz_defaults":523}],517:[function(require,module,exports){ +},{"../../components/colorscale/defaults":312,"../../lib":381,"./attributes":510,"./has_columns":515,"./xyz_defaults":521}],515:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -87255,7 +87196,7 @@ module.exports = function(trace) { return !Array.isArray(trace.z[0]); }; -},{}],518:[function(require,module,exports){ +},{}],516:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -87296,7 +87237,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode, contour) ny = Math.round(pointData.index[0]); } catch(e) { - Lib.error('Error hovering on heatmap, ' + + console.log('Error hovering on heatmap, ' + 'pointNumber must be [row,col], found:', pointData.index); return; } @@ -87369,7 +87310,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode, contour) })]; }; -},{"../../lib":382,"../../plots/cartesian/graph_interact":412}],519:[function(require,module,exports){ +},{"../../lib":381,"../../plots/cartesian/graph_interact":410}],517:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -87401,7 +87342,7 @@ Heatmap.meta = { module.exports = Heatmap; -},{"../../plots/cartesian":413,"./attributes":512,"./calc":513,"./colorbar":514,"./defaults":516,"./hover":518,"./plot":521,"./style":522}],520:[function(require,module,exports){ +},{"../../plots/cartesian":411,"./attributes":510,"./calc":511,"./colorbar":512,"./defaults":514,"./hover":516,"./plot":519,"./style":520}],518:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -87423,7 +87364,7 @@ module.exports = function maxRowLength(z) { return len; }; -},{}],521:[function(require,module,exports){ +},{}],519:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -87454,6 +87395,8 @@ module.exports = function(gd, plotinfo, cdheatmaps) { // From http://www.xarg.org/2010/03/generate-client-side-png-files-using-javascript/ function plotOne(gd, plotinfo, cd) { + Lib.markTime('in Heatmap.plot'); + var trace = cd[0].trace, uid = trace.uid, xa = plotinfo.x(), @@ -87710,6 +87653,8 @@ function plotOne(gd, plotinfo, cd) { return setColor(z00 + xinterp.frac * dx + yinterp.frac * (dy + xinterp.frac * dxy)); } + Lib.markTime('done init png'); + if(zsmooth) { // best or fast, works fastest with imageData var pxIndex = 0, pixels = new Uint8Array(imageWidth * imageHeight * 4); @@ -87781,6 +87726,8 @@ function plotOne(gd, plotinfo, cd) { } } + Lib.markTime('done filling png'); + rcount = Math.round(rcount / pixcount); gcount = Math.round(gcount / pixcount); bcount = Math.round(bcount / pixcount); @@ -87811,9 +87758,11 @@ function plotOne(gd, plotinfo, cd) { y: top, preserveAspectRatio: 'none' }); + + Lib.markTime('done showing png'); } -},{"../../components/colorscale/get_scale":315,"../../constants/xmlns_namespaces":370,"../../lib":382,"../../plots/plots":454,"./max_row_length":520,"d3":113,"tinycolor2":274}],522:[function(require,module,exports){ +},{"../../components/colorscale/get_scale":314,"../../constants/xmlns_namespaces":369,"../../lib":381,"../../plots/plots":452,"./max_row_length":518,"d3":113,"tinycolor2":274}],520:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -87834,7 +87783,7 @@ module.exports = function style(gd) { }); }; -},{"d3":113}],523:[function(require,module,exports){ +},{"d3":113}],521:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -87923,7 +87872,7 @@ function isValidZ(z) { return (allRowsAreArrays && oneRowIsFilled && hasOneNumber); } -},{"./has_columns":517,"fast-isnumeric":117}],524:[function(require,module,exports){ +},{"./has_columns":515,"fast-isnumeric":117}],522:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -87932,16 +87881,16 @@ function isValidZ(z) { * LICENSE file in the root directory of this source tree. */ + 'use strict'; var barAttrs = require('../bar/attributes'); -var colorAttributes = require('../../components/colorscale/color_attributes'); - -var extendFlat = require('../../lib/extend').extendDeep; +var extendFlat = require('../../lib').extendFlat; var barMarkerAttrs = barAttrs.marker; var barMarkerLineAttrs = barMarkerAttrs.line; + module.exports = { x: { valType: 'data_array', @@ -88000,14 +87949,26 @@ module.exports = { }, ybins: makeBinsAttr('y'), - marker: extendFlat({}, { + marker: { + color: barMarkerAttrs.color, + colorscale: barMarkerAttrs.colorscale, + cauto: barMarkerAttrs.cauto, + cmax: barMarkerAttrs.cmax, + cmin: barMarkerAttrs.cmin, + autocolorscale: barMarkerAttrs.autocolorscale, + reversescale: barMarkerAttrs.reversescale, showscale: barMarkerAttrs.showscale, - line: extendFlat({}, - {width: extendFlat({}, barMarkerLineAttrs.width, {dflt: 0})}, - colorAttributes('marker.line')) + line: { + color: barMarkerLineAttrs.color, + colorscale: barMarkerLineAttrs.colorscale, + cauto: barMarkerLineAttrs.cauto, + cmax: barMarkerLineAttrs.cmax, + cmin: barMarkerLineAttrs.cmin, + autocolorscale: barMarkerLineAttrs.autocolorscale, + reversescale: barMarkerLineAttrs.reversescale, + width: extendFlat({}, barMarkerLineAttrs.width, {dflt: 0}) + } }, - colorAttributes('marker') - ), _nestedModules: { 'error_y': 'ErrorBars', @@ -88043,7 +88004,7 @@ function makeBinsAttr(axLetter) { }; } -},{"../../components/colorscale/color_attributes":311,"../../lib/extend":377,"../bar/attributes":476}],525:[function(require,module,exports){ +},{"../../lib":381,"../bar/attributes":474}],523:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -88069,7 +88030,7 @@ module.exports = function doAvg(size, counts) { return total; }; -},{}],526:[function(require,module,exports){ +},{}],524:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -88099,7 +88060,7 @@ module.exports = function handleBinDefaults(traceIn, traceOut, coerce, binDirect return traceOut; }; -},{}],527:[function(require,module,exports){ +},{}],525:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -88173,7 +88134,7 @@ module.exports = { } }; -},{"fast-isnumeric":117}],528:[function(require,module,exports){ +},{"fast-isnumeric":117}],526:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -88303,7 +88264,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../../lib":382,"../../plots/cartesian/axes":405,"./average":525,"./bin_functions":527,"./norm_functions":531,"fast-isnumeric":117}],529:[function(require,module,exports){ +},{"../../lib":381,"../../plots/cartesian/axes":403,"./average":523,"./bin_functions":525,"./norm_functions":529,"fast-isnumeric":117}],527:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -88355,7 +88316,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout errorBarsSupplyDefaults(traceIn, traceOut, Color.defaultLine, {axis: 'x', inherit: 'y'}); }; -},{"../../components/color":303,"../../components/errorbars/defaults":331,"../../lib":382,"../bar/style_defaults":486,"./attributes":524,"./bin_defaults":526}],530:[function(require,module,exports){ +},{"../../components/color":303,"../../components/errorbars/defaults":330,"../../lib":381,"../bar/style_defaults":484,"./attributes":522,"./bin_defaults":524}],528:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -88404,7 +88365,7 @@ Histogram.meta = { module.exports = Histogram; -},{"../../plots/cartesian":413,"../bar/hover":479,"../bar/layout_attributes":481,"../bar/layout_defaults":482,"../bar/plot":483,"../bar/set_positions":484,"../bar/style":485,"../scatter/colorbar":559,"./attributes":524,"./calc":528,"./defaults":529}],531:[function(require,module,exports){ +},{"../../plots/cartesian":411,"../bar/hover":477,"../bar/layout_attributes":479,"../bar/layout_defaults":480,"../bar/plot":481,"../bar/set_positions":482,"../bar/style":483,"../scatter/colorbar":557,"./attributes":522,"./calc":526,"./defaults":527}],529:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -88439,7 +88400,7 @@ module.exports = { } }; -},{}],532:[function(require,module,exports){ +},{}],530:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -88452,46 +88413,47 @@ module.exports = { var histogramAttrs = require('../histogram/attributes'); var heatmapAttrs = require('../heatmap/attributes'); -var colorscaleAttrs = require('../../components/colorscale/attributes'); - -var extendFlat = require('../../lib/extend').extendFlat; -module.exports = extendFlat({}, - { - x: histogramAttrs.x, - y: histogramAttrs.y, +module.exports = { + x: histogramAttrs.x, + y: histogramAttrs.y, - z: { + z: { + valType: 'data_array', + + }, + marker: { + color: { valType: 'data_array', - }, - marker: { - color: { - valType: 'data_array', - - } - }, + } + }, - histnorm: histogramAttrs.histnorm, - histfunc: histogramAttrs.histfunc, - autobinx: histogramAttrs.autobinx, - nbinsx: histogramAttrs.nbinsx, - xbins: histogramAttrs.xbins, - autobiny: histogramAttrs.autobiny, - nbinsy: histogramAttrs.nbinsy, - ybins: histogramAttrs.ybins, + histnorm: histogramAttrs.histnorm, + histfunc: histogramAttrs.histfunc, + autobinx: histogramAttrs.autobinx, + nbinsx: histogramAttrs.nbinsx, + xbins: histogramAttrs.xbins, + autobiny: histogramAttrs.autobiny, + nbinsy: histogramAttrs.nbinsy, + ybins: histogramAttrs.ybins, - zsmooth: heatmapAttrs.zsmooth, + zauto: heatmapAttrs.zauto, + zmin: heatmapAttrs.zmin, + zmax: heatmapAttrs.zmax, + colorscale: heatmapAttrs.colorscale, + autocolorscale: heatmapAttrs.autocolorscale, + reversescale: heatmapAttrs.reversescale, + showscale: heatmapAttrs.showscale, - _nestedModules: { - 'colorbar': 'Colorbar' - } - }, - colorscaleAttrs, - {autocolorscale: extendFlat({}, colorscaleAttrs.autocolorscale, {dflt: false})} -); + zsmooth: heatmapAttrs.zsmooth, + + _nestedModules: { + 'colorbar': 'Colorbar' + } +}; -},{"../../components/colorscale/attributes":309,"../../lib/extend":377,"../heatmap/attributes":512,"../histogram/attributes":524}],533:[function(require,module,exports){ +},{"../heatmap/attributes":510,"../histogram/attributes":522}],531:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -88527,6 +88489,7 @@ module.exports = function calc(gd, trace) { if(x.length > serieslen) x.splice(serieslen, x.length - serieslen); if(y.length > serieslen) y.splice(serieslen, y.length - serieslen); + Lib.markTime('done convert data'); // calculate the bins if(trace.autobinx || !('xbins' in trace)) { @@ -88547,6 +88510,7 @@ module.exports = function calc(gd, trace) { } trace._input.ybins = trace.ybins; } + Lib.markTime('done autoBin'); // make the empty bin array & scale the map z = []; @@ -88630,6 +88594,7 @@ module.exports = function calc(gd, trace) { } + Lib.markTime('done making bins'); // put data into bins for(i = 0; i < serieslen; i++) { n = Lib.findBin(x[i], xbins); @@ -88645,6 +88610,7 @@ module.exports = function calc(gd, trace) { if(normfunc) { for(m = 0; m < ny; m++) normfunc(z[m], total, xinc, yinc[m]); } + Lib.markTime('done binning'); return { x: x, @@ -88657,7 +88623,7 @@ module.exports = function calc(gd, trace) { }; }; -},{"../../lib":382,"../../plots/cartesian/axes":405,"../histogram/average":525,"../histogram/bin_functions":527,"../histogram/norm_functions":531}],534:[function(require,module,exports){ +},{"../../lib":381,"../../plots/cartesian/axes":403,"../histogram/average":523,"../histogram/bin_functions":525,"../histogram/norm_functions":529}],532:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -88690,7 +88656,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, layout) { ); }; -},{"../../components/colorscale/defaults":313,"../../lib":382,"./attributes":532,"./sample_defaults":536}],535:[function(require,module,exports){ +},{"../../components/colorscale/defaults":312,"../../lib":381,"./attributes":530,"./sample_defaults":534}],533:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -88723,7 +88689,7 @@ Histogram2D.meta = { module.exports = Histogram2D; -},{"../../plots/cartesian":413,"../heatmap/calc":513,"../heatmap/colorbar":514,"../heatmap/hover":518,"../heatmap/plot":521,"../heatmap/style":522,"./attributes":532,"./defaults":534}],536:[function(require,module,exports){ +},{"../../plots/cartesian":411,"../heatmap/calc":511,"../heatmap/colorbar":512,"../heatmap/hover":516,"../heatmap/plot":519,"../heatmap/style":520,"./attributes":530,"./defaults":532}],534:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -88759,7 +88725,7 @@ module.exports = function handleSampleDefaults(traceIn, traceOut, coerce) { handleBinDefaults(traceIn, traceOut, coerce, binDirections); }; -},{"../histogram/bin_defaults":526}],537:[function(require,module,exports){ +},{"../histogram/bin_defaults":524}],535:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -88772,11 +88738,8 @@ module.exports = function handleSampleDefaults(traceIn, traceOut, coerce) { var histogram2dAttrs = require('../histogram2d/attributes'); var contourAttrs = require('../contour/attributes'); -var colorscaleAttrs = require('../../components/colorscale/attributes'); -var extendFlat = require('../../lib/extend').extendFlat; - -module.exports = extendFlat({}, { +module.exports = { x: histogram2dAttrs.x, y: histogram2dAttrs.y, z: histogram2dAttrs.z, @@ -88791,6 +88754,14 @@ module.exports = extendFlat({}, { nbinsy: histogram2dAttrs.nbinsy, ybins: histogram2dAttrs.ybins, + zauto: contourAttrs.zauto, + zmin: contourAttrs.zmin, + zmax: contourAttrs.zmax, + colorscale: contourAttrs.colorscale, + autocolorscale: contourAttrs.autocolorscale, + reversescale: contourAttrs.reversescale, + showscale: contourAttrs.showscale, + autocontour: contourAttrs.autocontour, ncontours: contourAttrs.ncontours, contours: contourAttrs.contours, @@ -88799,11 +88770,9 @@ module.exports = extendFlat({}, { _nestedModules: { 'colorbar': 'Colorbar' } -}, - colorscaleAttrs -); +}; -},{"../../components/colorscale/attributes":309,"../../lib/extend":377,"../contour/attributes":502,"../histogram2d/attributes":532}],538:[function(require,module,exports){ +},{"../contour/attributes":500,"../histogram2d/attributes":530}],536:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -88839,7 +88808,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout handleStyleDefaults(traceIn, traceOut, coerce, layout); }; -},{"../../lib":382,"../contour/style_defaults":511,"../histogram2d/sample_defaults":536,"./attributes":537}],539:[function(require,module,exports){ +},{"../../lib":381,"../contour/style_defaults":509,"../histogram2d/sample_defaults":534,"./attributes":535}],537:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -88872,7 +88841,7 @@ Histogram2dContour.meta = { module.exports = Histogram2dContour; -},{"../../plots/cartesian":413,"../contour/calc":503,"../contour/colorbar":504,"../contour/hover":506,"../contour/plot":509,"../contour/style":510,"./attributes":537,"./defaults":538}],540:[function(require,module,exports){ +},{"../../plots/cartesian":411,"../contour/calc":501,"../contour/colorbar":502,"../contour/hover":504,"../contour/plot":507,"../contour/style":508,"./attributes":535,"./defaults":536}],538:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -88909,12 +88878,10 @@ module.exports = { j: { valType: 'data_array', - }, k: { valType: 'data_array', - }, delaunayaxis: { @@ -89006,7 +88973,7 @@ module.exports = { } }; -},{"../../components/colorscale/attributes":309,"../../lib/extend":377,"../surface/attributes":601}],541:[function(require,module,exports){ +},{"../../components/colorscale/attributes":309,"../../lib/extend":376,"../surface/attributes":599}],539:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -89168,7 +89135,7 @@ function createMesh3DTrace(scene, data) { module.exports = createMesh3DTrace; -},{"../../lib/str2rgbarray":394,"alpha-shape":40,"convex-hull":102,"delaunay-triangulate":114,"gl-mesh3d":150,"tinycolor2":274}],542:[function(require,module,exports){ +},{"../../lib/str2rgbarray":392,"alpha-shape":40,"convex-hull":102,"delaunay-triangulate":114,"gl-mesh3d":150,"tinycolor2":274}],540:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -89265,7 +89232,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout } }; -},{"../../components/colorbar/defaults":305,"../../lib":382,"./attributes":540}],543:[function(require,module,exports){ +},{"../../components/colorbar/defaults":305,"../../lib":381,"./attributes":538}],541:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -89294,7 +89261,7 @@ Mesh3D.meta = { module.exports = Mesh3D; -},{"../../plots/gl3d":441,"../heatmap/colorbar":514,"./attributes":540,"./convert":541,"./defaults":542}],544:[function(require,module,exports){ +},{"../../plots/gl3d":439,"../heatmap/colorbar":512,"./attributes":538,"./convert":539,"./defaults":540}],542:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -89514,7 +89481,7 @@ module.exports = { } }; -},{"../../components/color/attributes":302,"../../lib/extend":377,"../../plots/attributes":403,"../../plots/font_attributes":423}],545:[function(require,module,exports){ +},{"../../components/color/attributes":302,"../../lib/extend":376,"../../plots/attributes":401,"../../plots/font_attributes":421}],543:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -89561,7 +89528,7 @@ function getCdModule(calcdata, _module) { return cdModule; } -},{"../../plots/plots":454}],546:[function(require,module,exports){ +},{"../../plots/plots":452}],544:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -89713,7 +89680,7 @@ function nextDefaultColor(index) { return pieDefaultColors[index % pieDefaultColors.length]; } -},{"../../components/color":303,"./helpers":548,"fast-isnumeric":117,"tinycolor2":274}],547:[function(require,module,exports){ +},{"../../components/color":303,"./helpers":546,"fast-isnumeric":117,"tinycolor2":274}],545:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -89797,7 +89764,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout coerce('pull'); }; -},{"../../lib":382,"./attributes":544}],548:[function(require,module,exports){ +},{"../../lib":381,"./attributes":542}],546:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -89826,7 +89793,7 @@ exports.formatPieValue = function formatPieValue(v, separators) { return Lib.numSeparate(vRounded, separators); }; -},{"../../lib":382}],549:[function(require,module,exports){ +},{"../../lib":381}],547:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -89858,7 +89825,7 @@ Pie.meta = { module.exports = Pie; -},{"./attributes":544,"./base_plot":545,"./calc":546,"./defaults":547,"./layout_attributes":550,"./layout_defaults":551,"./plot":552,"./style":553,"./style_one":554}],550:[function(require,module,exports){ +},{"./attributes":542,"./base_plot":543,"./calc":544,"./defaults":545,"./layout_attributes":548,"./layout_defaults":549,"./plot":550,"./style":551,"./style_one":552}],548:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -89878,7 +89845,7 @@ module.exports = { hiddenlabels: {valType: 'data_array'} }; -},{}],551:[function(require,module,exports){ +},{}],549:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -89900,7 +89867,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { coerce('hiddenlabels'); }; -},{"../../lib":382,"./layout_attributes":550}],552:[function(require,module,exports){ +},{"../../lib":381,"./layout_attributes":548}],550:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -90595,7 +90562,7 @@ function maxExtent(tilt, tiltAxisFraction, depth) { 2 * Math.sqrt(1 - sinTilt * sinTilt * tiltAxisFraction * tiltAxisFraction)); } -},{"../../components/color":303,"../../components/drawing":326,"../../lib/svg_text_utils":395,"../../plots/cartesian/graph_interact":412,"./helpers":548,"d3":113}],553:[function(require,module,exports){ +},{"../../components/color":303,"../../components/drawing":325,"../../lib/svg_text_utils":393,"../../plots/cartesian/graph_interact":410,"./helpers":546,"d3":113}],551:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -90624,7 +90591,7 @@ module.exports = function style(gd) { }); }; -},{"./style_one":554,"d3":113}],554:[function(require,module,exports){ +},{"./style_one":552,"d3":113}],552:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -90651,7 +90618,7 @@ module.exports = function styleOne(s, pt, trace) { .call(Color.stroke, lineColor); }; -},{"../../components/color":303}],555:[function(require,module,exports){ +},{"../../components/color":303}],553:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -90689,7 +90656,7 @@ module.exports = function arraysToCalcdata(cd) { } }; -},{"../../lib":382}],556:[function(require,module,exports){ +},{"../../lib":381}],554:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -90700,13 +90667,10 @@ module.exports = function arraysToCalcdata(cd) { 'use strict'; -var colorAttributes = require('../../components/colorscale/color_attributes'); - var Drawing = require('../../components/drawing'); var constants = require('./constants'); -var extendFlat = require('../../lib/extend').extendFlat; module.exports = { x: { @@ -90813,7 +90777,7 @@ module.exports = { }, - marker: extendFlat({}, { + marker: { symbol: { valType: 'enumerated', values: Drawing.symbolList, @@ -90837,6 +90801,12 @@ module.exports = { arrayOk: true, + }, + color: { + valType: 'color', + arrayOk: true, + + }, maxdisplayed: { valType: 'number', @@ -90864,6 +90834,41 @@ module.exports = { dflt: 'diameter', + }, + colorscale: { + valType: 'colorscale', + + + }, + cauto: { + valType: 'boolean', + dflt: true, + + + }, + cmax: { + valType: 'number', + dflt: null, + + + }, + cmin: { + valType: 'number', + dflt: null, + + + }, + autocolorscale: { + valType: 'boolean', + dflt: true, + + + }, + reversescale: { + valType: 'boolean', + + dflt: false, + }, showscale: { valType: 'boolean', @@ -90871,20 +90876,57 @@ module.exports = { dflt: false, }, - line: extendFlat({}, { + line: { + color: { + valType: 'color', + arrayOk: true, + + + }, width: { valType: 'number', min: 0, arrayOk: true, + }, + colorscale: { + valType: 'colorscale', + + + }, + cauto: { + valType: 'boolean', + dflt: true, + + + }, + cmax: { + valType: 'number', + dflt: null, + + + }, + cmin: { + valType: 'number', + dflt: null, + + + }, + autocolorscale: { + valType: 'boolean', + dflt: true, + + + }, + reversescale: { + valType: 'boolean', + dflt: false, + + } - }, - colorAttributes('marker.line') - ) + } }, - colorAttributes('marker') - ), textposition: { valType: 'enumerated', values: [ @@ -90933,7 +90975,7 @@ module.exports = { } }; -},{"../../components/colorscale/color_attributes":311,"../../components/drawing":326,"../../lib/extend":377,"./constants":560}],557:[function(require,module,exports){ +},{"../../components/drawing":325,"./constants":558}],555:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -90957,9 +90999,13 @@ var calcMarkerColorscale = require('./marker_colorscale_calc'); module.exports = function calc(gd, trace) { var xa = Axes.getFromId(gd, trace.xaxis || 'x'), ya = Axes.getFromId(gd, trace.yaxis || 'y'); + Lib.markTime('in Scatter.calc'); - var x = xa.makeCalcdata(trace, 'x'), - y = ya.makeCalcdata(trace, 'y'); + var x = xa.makeCalcdata(trace, 'x'); + Lib.markTime('finished convert x'); + + var y = ya.makeCalcdata(trace, 'y'); + Lib.markTime('finished convert y'); var serieslen = Math.min(x.length, y.length), marker, @@ -91043,8 +91089,11 @@ module.exports = function calc(gd, trace) { yOptions.padded = false; } + Lib.markTime('ready for Axes.expand'); Axes.expand(xa, x, xOptions); + Lib.markTime('done expand x'); Axes.expand(ya, y, yOptions); + Lib.markTime('done expand y'); // create the "calculated data" to plot var cd = new Array(serieslen); @@ -91060,7 +91109,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../../lib":382,"../../plots/cartesian/axes":405,"./marker_colorscale_calc":570,"./subtypes":575,"fast-isnumeric":117}],558:[function(require,module,exports){ +},{"../../lib":381,"../../plots/cartesian/axes":403,"./marker_colorscale_calc":568,"./subtypes":573,"fast-isnumeric":117}],556:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -91101,7 +91150,7 @@ module.exports = function cleanData(fullData) { } }; -},{}],559:[function(require,module,exports){ +},{}],557:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -91152,9 +91201,11 @@ module.exports = function colorbar(gd, cd) { .range(scl.map(function(v) { return v[1]; }))) .filllevels({start: cmin, end: cmax, size: (cmax - cmin) / 254}) .options(marker.colorbar)(); + + Lib.markTime('done colorbar'); }; -},{"../../components/colorbar/draw":306,"../../components/colorscale/get_scale":315,"../../lib":382,"../../plots/plots":454,"d3":113,"fast-isnumeric":117}],560:[function(require,module,exports){ +},{"../../components/colorbar/draw":306,"../../components/colorscale/get_scale":314,"../../lib":381,"../../plots/plots":452,"d3":113,"fast-isnumeric":117}],558:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -91170,7 +91221,7 @@ module.exports = { PTS_LINESONLY: 20 }; -},{}],561:[function(require,module,exports){ +},{}],559:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -91240,7 +91291,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout errorBarsSupplyDefaults(traceIn, traceOut, defaultColor, {axis: 'x', inherit: 'y'}); }; -},{"../../components/errorbars/defaults":331,"../../lib":382,"./attributes":556,"./constants":560,"./fillcolor_defaults":562,"./line_defaults":566,"./line_shape_defaults":568,"./marker_defaults":571,"./subtypes":575,"./text_defaults":576,"./xy_defaults":577}],562:[function(require,module,exports){ +},{"../../components/errorbars/defaults":330,"../../lib":381,"./attributes":554,"./constants":558,"./fillcolor_defaults":560,"./line_defaults":564,"./line_shape_defaults":566,"./marker_defaults":569,"./subtypes":573,"./text_defaults":574,"./xy_defaults":575}],560:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -91279,7 +91330,7 @@ module.exports = function fillColorDefaults(traceIn, traceOut, defaultColor, coe )); }; -},{"../../components/color":303}],563:[function(require,module,exports){ +},{"../../components/color":303}],561:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -91332,7 +91383,7 @@ module.exports = function getTraceColor(trace, di) { } }; -},{"../../components/color":303,"./subtypes":575}],564:[function(require,module,exports){ +},{"../../components/color":303,"./subtypes":573}],562:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -91403,7 +91454,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) { return [pointData]; }; -},{"../../components/errorbars":332,"../../plots/cartesian/graph_interact":412,"./get_trace_color":563}],565:[function(require,module,exports){ +},{"../../components/errorbars":331,"../../plots/cartesian/graph_interact":410,"./get_trace_color":561}],563:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -91446,7 +91497,7 @@ Scatter.meta = { module.exports = Scatter; -},{"../../plots/cartesian":413,"./arrays_to_calcdata":555,"./attributes":556,"./calc":557,"./clean_data":558,"./colorbar":559,"./defaults":561,"./hover":564,"./plot":572,"./select":573,"./style":574,"./subtypes":575}],566:[function(require,module,exports){ +},{"../../plots/cartesian":411,"./arrays_to_calcdata":553,"./attributes":554,"./calc":555,"./clean_data":556,"./colorbar":557,"./defaults":559,"./hover":562,"./plot":570,"./select":571,"./style":572,"./subtypes":573}],564:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -91470,7 +91521,7 @@ module.exports = function lineDefaults(traceIn, traceOut, defaultColor, coerce) coerce('line.dash'); }; -},{}],567:[function(require,module,exports){ +},{}],565:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -91639,7 +91690,7 @@ module.exports = function linePoints(d, opts) { return segments; }; -},{"../../plots/cartesian/axes":405}],568:[function(require,module,exports){ +},{"../../plots/cartesian/axes":403}],566:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -91658,7 +91709,7 @@ module.exports = function handleLineShapeDefaults(traceIn, traceOut, coerce) { if(shape === 'spline') coerce('line.smoothing'); }; -},{}],569:[function(require,module,exports){ +},{}],567:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -91700,7 +91751,7 @@ module.exports = function makeBubbleSizeFn(trace) { }; }; -},{"fast-isnumeric":117}],570:[function(require,module,exports){ +},{"fast-isnumeric":117}],568:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -91734,7 +91785,7 @@ module.exports = function calcMarkerColorscale(trace) { } }; -},{"../../components/colorscale/calc":310,"../../components/colorscale/has_colorscale":316,"./subtypes":575}],571:[function(require,module,exports){ +},{"../../components/colorscale/calc":310,"../../components/colorscale/has_colorscale":315,"./subtypes":573}],569:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -91797,7 +91848,7 @@ module.exports = function markerDefaults(traceIn, traceOut, defaultColor, layout } }; -},{"../../components/color":303,"../../components/colorscale/defaults":313,"../../components/colorscale/has_colorscale":316,"./subtypes":575}],572:[function(require,module,exports){ +},{"../../components/color":303,"../../components/colorscale/defaults":312,"../../components/colorscale/has_colorscale":315,"./subtypes":573}],570:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -92071,7 +92122,7 @@ function selectMarkers(gd, plotinfo, cdscatter) { }); } -},{"../../components/drawing":326,"../../components/errorbars":332,"../../lib":382,"./arrays_to_calcdata":555,"./line_points":567,"./subtypes":575,"d3":113}],573:[function(require,module,exports){ +},{"../../components/drawing":325,"../../components/errorbars":331,"../../lib":381,"./arrays_to_calcdata":553,"./line_points":565,"./subtypes":573,"d3":113}],571:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -92141,7 +92192,7 @@ module.exports = function selectPoints(searchInfo, polygon) { return selection; }; -},{"./subtypes":575}],574:[function(require,module,exports){ +},{"./subtypes":573}],572:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -92183,7 +92234,7 @@ module.exports = function style(gd) { s.call(ErrorBars.style); }; -},{"../../components/drawing":326,"../../components/errorbars":332,"d3":113}],575:[function(require,module,exports){ +},{"../../components/drawing":325,"../../components/errorbars":331,"d3":113}],573:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -92217,7 +92268,7 @@ module.exports = { } }; -},{}],576:[function(require,module,exports){ +},{}],574:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -92238,7 +92289,7 @@ module.exports = function(traceIn, traceOut, layout, coerce) { Lib.coerceFont(coerce, 'textfont', layout.font); }; -},{"../../lib":382}],577:[function(require,module,exports){ +},{"../../lib":381}],575:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -92283,7 +92334,7 @@ module.exports = function handleXYDefaults(traceIn, traceOut, coerce) { return len; }; -},{}],578:[function(require,module,exports){ +},{}],576:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -92292,11 +92343,10 @@ module.exports = function handleXYDefaults(traceIn, traceOut, coerce) { * LICENSE file in the root directory of this source tree. */ + 'use strict'; var scatterAttrs = require('../scatter/attributes'); -var colorAttributes = require('../../components/colorscale/color_attributes'); - var MARKER_SYMBOLS = require('../../constants/gl_markers'); var extendFlat = require('../../lib/extend').extendFlat; @@ -92372,7 +92422,8 @@ module.exports = { width: scatterLineAttrs.width, dash: scatterLineAttrs.dash }, - marker: extendFlat({}, { // Parity with scatter.js? + marker: { // Parity with scatter.js? + color: scatterMarkerAttrs.color, symbol: { valType: 'enumerated', values: Object.keys(MARKER_SYMBOLS), @@ -92389,14 +92440,24 @@ module.exports = { arrayOk: false, }), + colorscale: scatterMarkerAttrs.colorscale, + cauto: scatterMarkerAttrs.cauto, + cmax: scatterMarkerAttrs.cmax, + cmin: scatterMarkerAttrs.cmin, + autocolorscale: scatterMarkerAttrs.autocolorscale, + reversescale: scatterMarkerAttrs.reversescale, showscale: scatterMarkerAttrs.showscale, - line: extendFlat({}, - {width: extendFlat({}, scatterMarkerLineAttrs.width, {arrayOk: false})}, - colorAttributes('marker.line') - ) + line: { + color: scatterMarkerLineAttrs.color, + width: extendFlat({}, scatterMarkerLineAttrs.width, {arrayOk: false}), + colorscale: scatterMarkerLineAttrs.colorscale, + cauto: scatterMarkerLineAttrs.cauto, + cmax: scatterMarkerLineAttrs.cmax, + cmin: scatterMarkerLineAttrs.cmin, + autocolorscale: scatterMarkerLineAttrs.autocolorscale, + reversescale: scatterMarkerLineAttrs.reversescale + } }, - colorAttributes('marker') - ), textposition: extendFlat({}, scatterAttrs.textposition, {dflt: 'top center'}), textfont: scatterAttrs.textfont, _nestedModules: { @@ -92407,7 +92468,7 @@ module.exports = { } }; -},{"../../components/colorscale/color_attributes":311,"../../constants/gl_markers":369,"../../lib/extend":377,"../scatter/attributes":556}],579:[function(require,module,exports){ +},{"../../constants/gl_markers":368,"../../lib/extend":376,"../scatter/attributes":554}],577:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -92436,7 +92497,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../scatter/arrays_to_calcdata":555,"../scatter/marker_colorscale_calc":570}],580:[function(require,module,exports){ +},{"../scatter/arrays_to_calcdata":553,"../scatter/marker_colorscale_calc":568}],578:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -92507,7 +92568,7 @@ function calculateErrors(data, scaleFactor) { module.exports = calculateErrors; -},{"../../components/errorbars/compute_error":330}],581:[function(require,module,exports){ +},{"../../components/errorbars/compute_error":329}],579:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -92966,7 +93027,7 @@ function createLineWithMarkers(scene, data) { module.exports = createLineWithMarkers; -},{"../../constants/gl3d_dashes":368,"../../constants/gl_markers":369,"../../lib":382,"../../lib/gl_format_color":380,"../../lib/str2rgbarray":394,"../scatter/make_bubble_size_func":569,"./calc_errors":580,"delaunay-triangulate":114,"gl-error3d":121,"gl-line3d":127,"gl-mesh3d":150,"gl-scatter3d":193}],582:[function(require,module,exports){ +},{"../../constants/gl3d_dashes":367,"../../constants/gl_markers":368,"../../lib":381,"../../lib/gl_format_color":379,"../../lib/str2rgbarray":392,"../scatter/make_bubble_size_func":567,"./calc_errors":578,"delaunay-triangulate":114,"gl-error3d":121,"gl-line3d":127,"gl-mesh3d":150,"gl-scatter3d":193}],580:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -93051,7 +93112,7 @@ function handleXYZDefaults(traceIn, traceOut, coerce) { return len; } -},{"../../components/errorbars/defaults":331,"../../lib":382,"../scatter/line_defaults":566,"../scatter/marker_defaults":571,"../scatter/subtypes":575,"../scatter/text_defaults":576,"./attributes":578}],583:[function(require,module,exports){ +},{"../../components/errorbars/defaults":330,"../../lib":381,"../scatter/line_defaults":564,"../scatter/marker_defaults":569,"../scatter/subtypes":573,"../scatter/text_defaults":574,"./attributes":576}],581:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -93082,7 +93143,7 @@ Scatter3D.meta = { module.exports = Scatter3D; -},{"../../constants/gl_markers":369,"../../plots/gl3d":441,"../scatter/colorbar":559,"./attributes":578,"./calc":579,"./convert":581,"./defaults":582}],584:[function(require,module,exports){ +},{"../../constants/gl_markers":368,"../../plots/gl3d":439,"../scatter/colorbar":557,"./attributes":576,"./calc":577,"./convert":579,"./defaults":580}],582:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -93095,14 +93156,13 @@ module.exports = Scatter3D; var scatterAttrs = require('../scatter/attributes'); var plotAttrs = require('../../plots/attributes'); -var colorAttributes = require('../../components/colorscale/color_attributes'); - var extendFlat = require('../../lib/extend').extendFlat; var scatterMarkerAttrs = scatterAttrs.marker, scatterLineAttrs = scatterAttrs.line, scatterMarkerLineAttrs = scatterMarkerAttrs.line; + module.exports = { lon: { valType: 'data_array', @@ -93132,21 +93192,32 @@ module.exports = { width: scatterLineAttrs.width, dash: scatterLineAttrs.dash }, - marker: extendFlat({}, { + marker: { symbol: scatterMarkerAttrs.symbol, opacity: scatterMarkerAttrs.opacity, size: scatterMarkerAttrs.size, sizeref: scatterMarkerAttrs.sizeref, sizemin: scatterMarkerAttrs.sizemin, sizemode: scatterMarkerAttrs.sizemode, + color: scatterMarkerAttrs.color, + colorscale: scatterMarkerAttrs.colorscale, + cauto: scatterMarkerAttrs.cauto, + cmax: scatterMarkerAttrs.cmax, + cmin: scatterMarkerAttrs.cmin, + autocolorscale: scatterMarkerAttrs.autocolorscale, + reversescale: scatterMarkerAttrs.reversescale, showscale: scatterMarkerAttrs.showscale, - line: extendFlat({}, - {width: scatterMarkerLineAttrs.width}, - colorAttributes('marker.line') - ) + line: { + color: scatterMarkerLineAttrs.color, + width: scatterMarkerLineAttrs.width, + colorscale: scatterMarkerLineAttrs.colorscale, + cauto: scatterMarkerLineAttrs.cauto, + cmax: scatterMarkerLineAttrs.cmax, + cmin: scatterMarkerLineAttrs.cmin, + autocolorscale: scatterMarkerLineAttrs.autocolorscale, + reversescale: scatterMarkerLineAttrs.reversescale + } }, - colorAttributes('marker') - ), textfont: scatterAttrs.textfont, textposition: scatterAttrs.textposition, hoverinfo: extendFlat({}, plotAttrs.hoverinfo, { @@ -93157,7 +93228,7 @@ module.exports = { } }; -},{"../../components/colorscale/color_attributes":311,"../../lib/extend":377,"../../plots/attributes":403,"../scatter/attributes":556}],585:[function(require,module,exports){ +},{"../../lib/extend":376,"../../plots/attributes":401,"../scatter/attributes":554}],583:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -93180,7 +93251,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../scatter/marker_colorscale_calc":570}],586:[function(require,module,exports){ +},{"../scatter/marker_colorscale_calc":568}],584:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -93253,7 +93324,7 @@ function handleLonLatLocDefaults(traceIn, traceOut, coerce) { return len; } -},{"../../lib":382,"../scatter/line_defaults":566,"../scatter/marker_defaults":571,"../scatter/subtypes":575,"../scatter/text_defaults":576,"./attributes":584}],587:[function(require,module,exports){ +},{"../../lib":381,"../scatter/line_defaults":564,"../scatter/marker_defaults":569,"../scatter/subtypes":573,"../scatter/text_defaults":574,"./attributes":582}],585:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -93284,7 +93355,7 @@ ScatterGeo.meta = { module.exports = ScatterGeo; -},{"../../plots/geo":426,"../scatter/colorbar":559,"./attributes":584,"./calc":585,"./defaults":586,"./plot":588}],588:[function(require,module,exports){ +},{"../../plots/geo":424,"../scatter/colorbar":557,"./attributes":582,"./calc":583,"./defaults":584,"./plot":586}],586:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -93584,7 +93655,7 @@ function makeEventDataFunc(trace) { }; } -},{"../../components/color":303,"../../components/drawing":326,"../../lib/array_to_calc_item":373,"../../lib/geo_location_utils":379,"../../lib/topojson_utils":396,"../../plots/cartesian/axes":405,"../../plots/cartesian/graph_interact":412,"../scatter/subtypes":575,"./attributes":584,"d3":113}],589:[function(require,module,exports){ +},{"../../components/color":303,"../../components/drawing":325,"../../lib/array_to_calc_item":372,"../../lib/geo_location_utils":378,"../../lib/topojson_utils":394,"../../plots/cartesian/axes":403,"../../plots/cartesian/graph_interact":410,"../scatter/subtypes":573,"./attributes":582,"d3":113}],587:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -93596,12 +93667,9 @@ function makeEventDataFunc(trace) { 'use strict'; var scatterAttrs = require('../scatter/attributes'); -var colorAttributes = require('../../components/colorscale/color_attributes'); - var DASHES = require('../../constants/gl2d_dashes'); var MARKERS = require('../../constants/gl_markers'); var extendFlat = require('../../lib/extend').extendFlat; -var extendDeep = require('../../lib/extend').extendDeep; var scatterLineAttrs = scatterAttrs.line, scatterMarkerAttrs = scatterAttrs.marker, @@ -93635,7 +93703,8 @@ module.exports = { } }, - marker: extendDeep({}, colorAttributes('marker'), { + marker: { + color: scatterMarkerAttrs.color, symbol: { valType: 'enumerated', values: Object.keys(MARKERS), @@ -93649,11 +93718,24 @@ module.exports = { sizemin: scatterMarkerAttrs.sizemin, sizemode: scatterMarkerAttrs.sizemode, opacity: scatterMarkerAttrs.opacity, + colorscale: scatterMarkerAttrs.colorscale, + cauto: scatterMarkerAttrs.cauto, + cmax: scatterMarkerAttrs.cmax, + cmin: scatterMarkerAttrs.cmin, + autocolorscale: scatterMarkerAttrs.autocolorscale, + reversescale: scatterMarkerAttrs.reversescale, showscale: scatterMarkerAttrs.showscale, - line: extendDeep({}, colorAttributes('marker.line'), { - width: scatterMarkerLineAttrs.width - }) - }), + line: { + color: scatterMarkerLineAttrs.color, + width: scatterMarkerLineAttrs.width, + colorscale: scatterMarkerLineAttrs.colorscale, + cauto: scatterMarkerLineAttrs.cauto, + cmax: scatterMarkerLineAttrs.cmax, + cmin: scatterMarkerLineAttrs.cmin, + autocolorscale: scatterMarkerLineAttrs.autocolorscale, + reversescale: scatterMarkerLineAttrs.reversescale + } + }, connectgaps: scatterAttrs.connectgaps, fill: extendFlat({}, scatterAttrs.fill, { values: ['none', 'tozeroy', 'tozerox'] @@ -93666,7 +93748,7 @@ module.exports = { } }; -},{"../../components/colorscale/color_attributes":311,"../../constants/gl2d_dashes":367,"../../constants/gl_markers":369,"../../lib/extend":377,"../scatter/attributes":556}],590:[function(require,module,exports){ +},{"../../constants/gl2d_dashes":366,"../../constants/gl_markers":368,"../../lib/extend":376,"../scatter/attributes":554}],588:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -93776,7 +93858,6 @@ var proto = LineWithMarkers.prototype; proto.handlePick = function(pickResult) { var index = pickResult.pointId; - if(pickResult.object !== this.line || this.connectgaps) { index = this.idToIndex[pickResult.pointId]; } @@ -93806,20 +93887,19 @@ proto.isFancy = function(options) { if(!options.x || !options.y) return true; - if(this.hasMarkers) { - var marker = options.marker || {}; + var marker = options.marker || {}; + if(Array.isArray(marker.symbol) || + marker.symbol !== 'circle' || + Array.isArray(marker.size) || + Array.isArray(marker.line.width) || + Array.isArray(marker.opacity) + ) return true; - if(Array.isArray(marker.symbol) || - marker.symbol !== 'circle' || - Array.isArray(marker.size) || - Array.isArray(marker.color) || - Array.isArray(marker.line.width) || - Array.isArray(marker.line.color) || - Array.isArray(marker.opacity) - ) return true; - } + var markerColor = marker.color; + if(Array.isArray(markerColor)) return true; - if(this.hasLines && !this.connectgaps) return true; + var lineColor = Array.isArray(marker.line.color); + if(Array.isArray(lineColor)) return true; if(this.hasErrorX) return true; if(this.hasErrorY) return true; @@ -94142,10 +94222,8 @@ proto.updateFancy = function(options) { proto.updateLines = function(options, positions) { var i; - if(this.hasLines) { var linePositions = positions; - if(!options.connectgaps) { var p = 0; var x = this.xData; @@ -94157,11 +94235,12 @@ proto.updateLines = function(options, positions) { linePositions[p++] = y[i]; } } - this.lineOptions.positions = linePositions; - var lineColor = convertColor(options.line.color, options.opacity, 1), - lineWidth = Math.round(0.5 * this.lineOptions.width), + var lineColor = str2RGBArray(options.line.color); + if(this.hasMarkers) lineColor[3] *= options.marker.opacity; + + var lineWidth = Math.round(0.5 * this.lineOptions.width), dashes = (DASHES[options.line.dash] || [1]).slice(); for(i = 0; i < dashes.length; ++i) dashes[i] *= lineWidth; @@ -94258,7 +94337,7 @@ function createLineWithMarkers(scene, data) { module.exports = createLineWithMarkers; -},{"../../components/errorbars":332,"../../constants/gl2d_dashes":367,"../../constants/gl_markers":369,"../../lib":382,"../../lib/gl_format_color":380,"../../lib/str2rgbarray":394,"../../plots/cartesian/axes":405,"../scatter/get_trace_color":563,"../scatter/make_bubble_size_func":569,"../scatter/subtypes":575,"fast-isnumeric":117,"gl-error2d":119,"gl-line2d":125,"gl-scatter2d":190,"gl-scatter2d-fancy":185}],591:[function(require,module,exports){ +},{"../../components/errorbars":331,"../../constants/gl2d_dashes":366,"../../constants/gl_markers":368,"../../lib":381,"../../lib/gl_format_color":379,"../../lib/str2rgbarray":392,"../../plots/cartesian/axes":403,"../scatter/get_trace_color":561,"../scatter/make_bubble_size_func":567,"../scatter/subtypes":573,"fast-isnumeric":117,"gl-error2d":119,"gl-line2d":125,"gl-scatter2d":190,"gl-scatter2d-fancy":185}],589:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -94315,7 +94394,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout errorBarsSupplyDefaults(traceIn, traceOut, defaultColor, {axis: 'x', inherit: 'y'}); }; -},{"../../components/errorbars/defaults":331,"../../lib":382,"../scatter/constants":560,"../scatter/fillcolor_defaults":562,"../scatter/line_defaults":566,"../scatter/marker_defaults":571,"../scatter/subtypes":575,"../scatter/xy_defaults":577,"./attributes":589}],592:[function(require,module,exports){ +},{"../../components/errorbars/defaults":330,"../../lib":381,"../scatter/constants":558,"../scatter/fillcolor_defaults":560,"../scatter/line_defaults":564,"../scatter/marker_defaults":569,"../scatter/subtypes":573,"../scatter/xy_defaults":575,"./attributes":587}],590:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -94346,7 +94425,7 @@ ScatterGl.meta = { module.exports = ScatterGl; -},{"../../plots/gl2d":438,"../scatter/colorbar":559,"../scatter3d/calc":579,"./attributes":589,"./convert":590,"./defaults":591}],593:[function(require,module,exports){ +},{"../../plots/gl2d":436,"../scatter/colorbar":557,"../scatter3d/calc":577,"./attributes":587,"./convert":588,"./defaults":589}],591:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -94359,14 +94438,13 @@ module.exports = ScatterGl; var scatterAttrs = require('../scatter/attributes'); var plotAttrs = require('../../plots/attributes'); -var colorAttributes = require('../../components/colorscale/color_attributes'); - var extendFlat = require('../../lib/extend').extendFlat; var scatterMarkerAttrs = scatterAttrs.marker, scatterLineAttrs = scatterAttrs.line, scatterMarkerLineAttrs = scatterMarkerAttrs.line; + module.exports = { a: { valType: 'data_array', @@ -94405,7 +94483,7 @@ module.exports = { }), fillcolor: scatterAttrs.fillcolor, - marker: extendFlat({}, { + marker: { symbol: scatterMarkerAttrs.symbol, opacity: scatterMarkerAttrs.opacity, maxdisplayed: scatterMarkerAttrs.maxdisplayed, @@ -94413,14 +94491,25 @@ module.exports = { sizeref: scatterMarkerAttrs.sizeref, sizemin: scatterMarkerAttrs.sizemin, sizemode: scatterMarkerAttrs.sizemode, + color: scatterMarkerAttrs.color, + colorscale: scatterMarkerAttrs.colorscale, + cauto: scatterMarkerAttrs.cauto, + cmax: scatterMarkerAttrs.cmax, + cmin: scatterMarkerAttrs.cmin, + autocolorscale: scatterMarkerAttrs.autocolorscale, + reversescale: scatterMarkerAttrs.reversescale, showscale: scatterMarkerAttrs.showscale, - line: extendFlat({}, - {width: scatterMarkerLineAttrs.width}, - colorAttributes('marker'.line) - ) + line: { + color: scatterMarkerLineAttrs.color, + width: scatterMarkerLineAttrs.width, + colorscale: scatterMarkerLineAttrs.colorscale, + cauto: scatterMarkerLineAttrs.cauto, + cmax: scatterMarkerLineAttrs.cmax, + cmin: scatterMarkerLineAttrs.cmin, + autocolorscale: scatterMarkerLineAttrs.autocolorscale, + reversescale: scatterMarkerLineAttrs.reversescale + } }, - colorAttributes('marker') - ), textfont: scatterAttrs.textfont, textposition: scatterAttrs.textposition, hoverinfo: extendFlat({}, plotAttrs.hoverinfo, { @@ -94431,7 +94520,7 @@ module.exports = { } }; -},{"../../components/colorscale/color_attributes":311,"../../lib/extend":377,"../../plots/attributes":403,"../scatter/attributes":556}],594:[function(require,module,exports){ +},{"../../lib/extend":376,"../../plots/attributes":401,"../scatter/attributes":554}],592:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -94530,7 +94619,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../../lib":382,"../../plots/cartesian/axes":405,"../scatter/marker_colorscale_calc":570,"../scatter/subtypes":575,"fast-isnumeric":117}],595:[function(require,module,exports){ +},{"../../lib":381,"../../plots/cartesian/axes":403,"../scatter/marker_colorscale_calc":568,"../scatter/subtypes":573,"fast-isnumeric":117}],593:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -94627,7 +94716,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout coerce('hoverinfo', (layout._dataLength === 1) ? 'a+b+c+text' : undefined); }; -},{"../../lib":382,"../scatter/constants":560,"../scatter/fillcolor_defaults":562,"../scatter/line_defaults":566,"../scatter/line_shape_defaults":568,"../scatter/marker_defaults":571,"../scatter/subtypes":575,"../scatter/text_defaults":576,"./attributes":593}],596:[function(require,module,exports){ +},{"../../lib":381,"../scatter/constants":558,"../scatter/fillcolor_defaults":560,"../scatter/line_defaults":564,"../scatter/line_shape_defaults":566,"../scatter/marker_defaults":569,"../scatter/subtypes":573,"../scatter/text_defaults":574,"./attributes":591}],594:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -94677,7 +94766,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) { return scatterPointData; }; -},{"../../plots/cartesian/axes":405,"../scatter/hover":564}],597:[function(require,module,exports){ +},{"../../plots/cartesian/axes":403,"../scatter/hover":562}],595:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -94710,7 +94799,7 @@ ScatterTernary.meta = { module.exports = ScatterTernary; -},{"../../plots/ternary":461,"../scatter/colorbar":559,"./attributes":593,"./calc":594,"./defaults":595,"./hover":596,"./plot":598,"./select":599,"./style":600}],598:[function(require,module,exports){ +},{"../../plots/ternary":459,"../scatter/colorbar":557,"./attributes":591,"./calc":592,"./defaults":593,"./hover":594,"./plot":596,"./select":597,"./style":598}],596:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -94726,16 +94815,11 @@ var scatterPlot = require('../scatter/plot'); module.exports = function plot(ternary, data) { - var plotContainer = ternary.plotContainer; - - // remove all nodes inside the scatter layer - plotContainer.select('.scatterlayer').selectAll('*').remove(); - // mimic cartesian plotinfo var plotinfo = { x: function() { return ternary.xaxis; }, y: function() { return ternary.yaxis; }, - plot: plotContainer + plot: ternary.plotContainer }; var calcdata = new Array(data.length), @@ -94756,7 +94840,7 @@ module.exports = function plot(ternary, data) { scatterPlot(ternary.graphDiv, plotinfo, calcdata); }; -},{"../scatter/plot":572}],599:[function(require,module,exports){ +},{"../scatter/plot":570}],597:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -94791,7 +94875,7 @@ module.exports = function selectPoints(searchInfo, polygon) { return selection; }; -},{"../scatter/select":573}],600:[function(require,module,exports){ +},{"../scatter/select":571}],598:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -94820,7 +94904,7 @@ module.exports = function style(gd) { scatterStyle(gd); }; -},{"../scatter/style":574}],601:[function(require,module,exports){ +},{"../scatter/style":572}],599:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -94829,12 +94913,14 @@ module.exports = function style(gd) { * LICENSE file in the root directory of this source tree. */ + 'use strict'; var Color = require('../../components/color'); var colorscaleAttrs = require('../../components/colorscale/attributes'); var extendFlat = require('../../lib/extend').extendFlat; + function makeContourProjAttr(axLetter) { return { valType: 'boolean', @@ -94922,7 +95008,6 @@ module.exports = { }, - // Todo this block has a structure of colorscale/attributes.js but with colorscale/color_attributes.js names cauto: colorscaleAttrs.zauto, cmin: colorscaleAttrs.zmin, cmax: colorscaleAttrs.zmax, @@ -94958,7 +95043,7 @@ module.exports = { min: -1e5, max: 1e5, - dflt: 1e4, + dflt: 1e5, }, z: { @@ -95040,7 +95125,7 @@ module.exports = { } }; -},{"../../components/color":303,"../../components/colorscale/attributes":309,"../../lib/extend":377}],602:[function(require,module,exports){ +},{"../../components/color":303,"../../components/colorscale/attributes":309,"../../lib/extend":376}],600:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -95064,7 +95149,7 @@ module.exports = function calc(gd, trace) { } }; -},{"../../components/colorscale/calc":310}],603:[function(require,module,exports){ +},{"../../components/colorscale/calc":310}],601:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -95109,9 +95194,11 @@ module.exports = function colorbar(gd, cd) { .range(scl.map(function(v) { return v[1]; }))) .filllevels({start: zmin, end: zmax, size: (zmax - zmin) / 254}) .options(trace.colorbar)(); + + Lib.markTime('done colorbar'); }; -},{"../../components/colorbar/draw":306,"../../components/colorscale/get_scale":315,"../../lib":382,"../../plots/plots":454,"d3":113,"fast-isnumeric":117}],604:[function(require,module,exports){ +},{"../../components/colorbar/draw":306,"../../components/colorscale/get_scale":314,"../../lib":381,"../../plots/plots":452,"d3":113,"fast-isnumeric":117}],602:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -95449,7 +95536,13 @@ proto.update = function(data) { } if('lightposition' in data) { - surface.lightPosition = [data.lightposition.x, data.lightposition.y, data.lightposition.z]; + if(surface.lightPosition === void(0)) { + surface.lightPosition = [data.lightposition.x, data.lightposition.y, data.lightposition.z]; + } else { + surface.lightPosition.x = data.lightposition.x; + surface.lightPosition.y = data.lightposition.y; + surface.lightPosition.z = data.lightposition.z; + } } if(alpha && alpha < 1) { @@ -95474,7 +95567,7 @@ function createSurfaceTrace(scene, data) { module.exports = createSurfaceTrace; -},{"../../lib/str2rgbarray":394,"gl-surface3d":221,"ndarray":253,"ndarray-fill":246,"ndarray-homography":251,"ndarray-ops":252,"tinycolor2":274}],605:[function(require,module,exports){ +},{"../../lib/str2rgbarray":392,"gl-surface3d":221,"ndarray":253,"ndarray-fill":246,"ndarray-homography":251,"ndarray-ops":252,"tinycolor2":274}],603:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -95591,7 +95684,7 @@ function mapLegacy(traceIn, oldAttr, newAttr) { } } -},{"../../components/colorscale/defaults":313,"../../lib":382,"./attributes":601}],606:[function(require,module,exports){ +},{"../../components/colorscale/defaults":312,"../../lib":381,"./attributes":599}],604:[function(require,module,exports){ /** * Copyright 2012-2016, Plotly, Inc. * All rights reserved. @@ -95621,5 +95714,5 @@ Surface.meta = { module.exports = Surface; -},{"../../plots/gl3d":441,"./attributes":601,"./calc":602,"./colorbar":603,"./convert":604,"./defaults":605}]},{},[12])(12) +},{"../../plots/gl3d":439,"./attributes":599,"./calc":600,"./colorbar":601,"./convert":602,"./defaults":603}]},{},[12])(12) }); \ No newline at end of file diff --git a/dist/plotly.min.js b/dist/plotly.min.js index 3dfca5ec0ac..d15e36dbd86 100644 --- a/dist/plotly.min.js +++ b/dist/plotly.min.js @@ -1,10 +1,10 @@ /** -* plotly.js v1.13.0 +* plotly.js v1.12.0 * Copyright 2012-2016, Plotly, Inc. * All rights reserved. * Licensed under the MIT license */ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Plotly=t()}}(function(){var t;return function e(t,r,n){function i(o,s){if(!r[o]){if(!t[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[o]={exports:{}};t[o][0].call(u.exports,function(e){var r=t[o][1][e];return i(r?r:e)},u,u.exports,e,t,r,n)}return r[o].exports}for(var a="function"==typeof require&&require,o=0;or;++r)e[r]=0;return e}function o(t,e,r){switch(arguments.length){case 0:return new i([0],[0],0);case 1:if("number"==typeof t){var n=a(t);return new i(n,n,0)}return new i(t,a(t.length),0);case 2:if("number"==typeof e){var n=a(t.length);return new i(t,n,+e)}r=0;case 3:if(t.length!==e.length)throw new Error("state and velocity lengths must match");return new i(t,e,r)}}e.exports=o;var s=t("cubic-hermite"),l=t("binary-search-bounds"),c=i.prototype;c.flush=function(t){var e=l.gt(this._time,t)-1;0>=e||(this._time.splice(0,e),this._state.splice(0,e*this.dimension),this._velocity.splice(0,e*this.dimension))},c.curve=function(t){var e=this._time,r=e.length,i=l.le(e,t),a=this._scratch[0],o=this._state,c=this._velocity,u=this.dimension,f=this.bounds;if(0>i)for(var h=u-1,d=0;u>d;++d,--h)a[d]=o[h];else if(i>=r-1)for(var h=o.length-1,p=t-e[r-1],d=0;u>d;++d,--h)a[d]=o[h]+p*c[h];else{for(var h=u*(i+1)-1,g=e[i],v=e[i+1],m=v-g||1,y=this._scratch[1],b=this._scratch[2],x=this._scratch[3],_=this._scratch[4],w=!0,d=0;u>d;++d,--h)y[d]=o[h],x[d]=c[h]*m,b[d]=o[h+u],_[d]=c[h+u]*m,w=w&&y[d]===b[d]&&x[d]===_[d]&&0===x[d];if(w)for(var d=0;u>d;++d)a[d]=y[d];else s(y,x,b,_,(t-g)/m,a)}for(var k=f[0],A=f[1],d=0;u>d;++d)a[d]=n(k[d],A[d],a[d]);return a},c.dcurve=function(t){var e=this._time,r=e.length,n=l.le(e,t),i=this._scratch[0],a=this._state,o=this._velocity,c=this.dimension;if(n>=r-1)for(var u=a.length-1,f=(t-e[r-1],0);c>f;++f,--u)i[f]=o[u];else{for(var u=c*(n+1)-1,h=e[n],d=e[n+1],p=d-h||1,g=this._scratch[1],v=this._scratch[2],m=this._scratch[3],y=this._scratch[4],b=!0,f=0;c>f;++f,--u)g[f]=a[u],m[f]=o[u]*p,v[f]=a[u+c],y[f]=o[u+c]*p,b=b&&g[f]===v[f]&&m[f]===y[f]&&0===m[f];if(b)for(var f=0;c>f;++f)i[f]=0;else{s.derivative(g,m,v,y,(t-h)/p,i);for(var f=0;c>f;++f)i[f]/=p}}return i},c.lastT=function(){var t=this._time;return t[t.length-1]},c.stable=function(){for(var t=this._velocity,e=t.length,r=this.dimension-1;r>=0;--r)if(t[--e])return!1;return!0},c.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(e>t||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=this.bounds,l=s[0],c=s[1];this._time.push(e,t);for(var u=0;2>u;++u)for(var f=0;r>f;++f)i.push(i[o++]),a.push(0);this._time.push(t);for(var f=r;f>0;--f)i.push(n(l[f-1],c[f-1],arguments[f])),a.push(0)}},c.push=function(t){var e=this.lastT(),r=this.dimension;if(!(e>t||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=t-e,l=this.bounds,c=l[0],u=l[1],f=s>1e-6?1/s:0;this._time.push(t);for(var h=r;h>0;--h){var d=n(c[h-1],u[h-1],arguments[h]);i.push(d),a.push((d-i[o++])*f)}}},c.set=function(t){var e=this.dimension;if(!(t0;--l)r.push(n(o[l-1],s[l-1],arguments[l])),i.push(0)}},c.move=function(t){var e=this.lastT(),r=this.dimension;if(!(e>=t||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=this.bounds,l=s[0],c=s[1],u=t-e,f=u>1e-6?1/u:0;this._time.push(t);for(var h=r;h>0;--h){var d=arguments[h];i.push(n(l[h-1],c[h-1],i[o++]+d)),a.push(d*f)}}},c.idle=function(t){var e=this.lastT();if(!(e>t)){var r=this.dimension,i=this._state,a=this._velocity,o=i.length-r,s=this.bounds,l=s[0],c=s[1],u=t-e;this._time.push(t);for(var f=r-1;f>=0;--f)i.push(n(l[f],c[f],i[o]+u*a[o])),a.push(0),o+=1}}},{"binary-search-bounds":21,"cubic-hermite":22}],21:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){var o=["function ",t,"(a,l,h,",n.join(","),"){",a?"":"var i=",r?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a",i?".get(m)":"[m]"];return a?e.indexOf("c")<0?o.push(";if(x===y){return m}else if(x<=y){"):o.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):o.push(";if(",e,"){i=m;"),r?o.push("l=m+1}else{h=m-1}"):o.push("h=m-1}else{l=m+1}"),o.push("}"),a?o.push("return -1};"):o.push("return i};"),o.join("")}function i(t,e,r,i){var a=new Function([n("A","x"+t+"y",e,["y"],!1,i),n("B","x"+t+"y",e,["y"],!0,i),n("P","c(x,y)"+t+"0",e,["y","c"],!1,i),n("Q","c(x,y)"+t+"0",e,["y","c"],!0,i),"function dispatchBsearch",r,"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch",r].join(""));return a()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],22:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,c=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var u=t.length-1;u>=0;--u)a[u]=o*t[u]+s*e[u]+l*r[u]+c*n[u];return a}return o*t+s*e+l*r[u]+c*n}function i(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,c=(1+2*i)*l,u=i*l,f=s*(3-2*i),h=s*o;if(t.length){a||(a=new Array(t.length));for(var d=t.length-1;d>=0;--d)a[d]=c*t[d]+u*e[d]+f*r[d]+h*n[d];return a}return c*t+u*e+f*r+h*n}e.exports=i,e.exports.derivative=n},{}],23:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t}e.exports=n},{}],24:[function(t,e,r){function n(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}e.exports=n},{}],25:[function(t,e,r){function n(t){var e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}e.exports=n},{}],26:[function(t,e,r){function n(t,e,r,n){var i=e[0],a=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t}e.exports=n},{}],27:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}e.exports=n},{}],28:[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){t=t||{};var e=t.matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return new n(e)}var a=t("binary-search-bounds"),o=t("mat4-interpolate"),s=t("gl-mat4/invert"),l=t("gl-mat4/rotateX"),c=t("gl-mat4/rotateY"),u=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(!(0>r)){var i=this._components;if(r===e.length-1)for(var l=16*r,c=0;16>c;++c)n[c]=i[l++];else{for(var u=e[r+1]-e[r],l=16*r,f=this.prevMatrix,h=!0,c=0;16>c;++c)f[c]=i[l++];for(var p=this.nextMatrix,c=0;16>c;++c)p[c]=i[l++],h=h&&f[c]===p[c];if(1e-6>u||h)for(var c=0;16>c;++c)n[c]=f[c];else o(n,f,p,(t-e[r])/u)}var g=this.computedUp;g[0]=n[1],g[1]=n[5],g[2]=n[6],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]),c=0;3>c;++c)b[c]=m[c]-n[2+4*c]*x}},g.idle=function(t){if(!(tn;++n)e.push(e[r++]);this._time.push(t)}},g.flush=function(t){var e=a.gt(this._time,t)-2;0>e||(this._time.slice(0,e),this._components.slice(0,16*e))},g.lastT=function(){return this._time[this._time.length-1]},g.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||p,n=n||this.computedUp,this.setMatrix(t,f(this.computedMatrix,e,r,n));for(var i=0,a=0;3>a;++a)i+=Math.pow(r[a]-e[a],2);i=Math.log(Math.sqrt(i)),this.computedRadius[0]=i},g.rotate=function(t,e,r,n){this.recalcMatrix(t);var i=this.computedInverse;e&&c(i,i,e),r&&l(i,i,r),n&&u(i,i,n),this.setMatrix(t,s(this.computedMatrix,i))};var v=[0,0,0];g.pan=function(t,e,r,n){v[0]=-(e||0),v[1]=-(r||0),v[2]=-(n||0),this.recalcMatrix(t);var i=this.computedInverse;h(i,i,v),this.setMatrix(t,s(i,i))},g.translate=function(t,e,r,n){v[0]=e||0,v[1]=r||0,v[2]=n||0,this.recalcMatrix(t);var i=this.computedMatrix;h(i,i,v),this.setMatrix(t,i)},g.setMatrix=function(t,e){if(!(tr;++r)this._components.push(e[r])}},g.setDistance=function(t,e){this.computedRadius[0]=e},g.setDistanceLimits=function(t,e){var r=this._limits;r[0]=t,r[1]=e},g.getDistanceLimits=function(t){var e=this._limits;return t?(t[0]=e[0],t[1]=e[1],t):e}},{"binary-search-bounds":29,"gl-mat4/invert":137,"gl-mat4/lookAt":138,"gl-mat4/rotateX":142,"gl-mat4/rotateY":143,"gl-mat4/rotateZ":144,"gl-mat4/scale":145,"gl-mat4/translate":146,"gl-vec3/normalize":27,"mat4-interpolate":30}],29:[function(t,e,r){arguments[4][21][0].apply(r,arguments)},{dup:21}],30:[function(t,e,r){function n(t,e,r,n){if(0===u(e)||0===u(r))return!1;var i=c(e,h.translate,h.scale,h.skew,h.perspective,h.quaternion),a=c(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):!1}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"),c=t("mat4-decompose"),u=t("gl-mat4/determinant"),f=t("quat-slerp"),h=i(),d=i(),p=i();e.exports=n},{"gl-mat4/determinant":133,"gl-vec3/lerp":26,"mat4-decompose":31,"mat4-recompose":33,"quat-slerp":34}],31:[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}function i(t,e){t[0][0]=e[0],t[0][1]=e[1],t[0][2]=e[2],t[1][0]=e[4],t[1][1]=e[5],t[1][2]=e[6],t[2][0]=e[8],t[2][1]=e[9],t[2][2]=e[10]}function a(t,e,r,n,i){t[0]=e[0]*n+r[0]*i,t[1]=e[1]*n+r[1]*i,t[2]=e[2]*n+r[2]*i}var o=t("./normalize"),s=t("gl-mat4/create"),l=t("gl-mat4/clone"),c=t("gl-mat4/determinant"),u=t("gl-mat4/invert"),f=t("gl-mat4/transpose"),h={length:t("gl-vec3/length"),normalize:t("gl-vec3/normalize"),dot:t("gl-vec3/dot"),cross:t("gl-vec3/cross")},d=s(),p=s(),g=[0,0,0,0],v=[[0,0,0],[0,0,0],[0,0,0]],m=[0,0,0];e.exports=function(t,e,r,s,y,b){if(e||(e=[0,0,0]),r||(r=[0,0,0]),s||(s=[0,0,0]),y||(y=[0,0,0,1]),b||(b=[0,0,0,1]),!o(d,t))return!1;if(l(p,d),p[3]=0,p[7]=0,p[11]=0,p[15]=1,Math.abs(c(p)<1e-8))return!1;var x=d[3],_=d[7],w=d[11],k=d[12],A=d[13],M=d[14],T=d[15];if(0!==x||0!==_||0!==w){g[0]=x,g[1]=_,g[2]=w,g[3]=T;var E=u(p,p);if(!E)return!1;f(p,p),n(y,g,p)}else y[0]=y[1]=y[2]=0,y[3]=1;if(e[0]=k,e[1]=A,e[2]=M,i(v,d),r[0]=h.length(v[0]),h.normalize(v[0],v[0]),s[0]=h.dot(v[0],v[1]),a(v[1],v[1],v[0],1,-s[0]),r[1]=h.length(v[1]),h.normalize(v[1],v[1]),s[0]/=r[1],s[1]=h.dot(v[0],v[2]),a(v[2],v[2],v[0],1,-s[1]),s[2]=h.dot(v[1],v[2]),a(v[2],v[2],v[1],1,-s[2]),r[2]=h.length(v[2]),h.normalize(v[2],v[2]),s[1]/=r[2],s[2]/=r[2],h.cross(m,v[1],v[2]),h.dot(v[0],m)<0)for(var L=0;3>L;L++)r[L]*=-1,v[L][0]*=-1,v[L][1]*=-1,v[L][2]*=-1;return b[0]=.5*Math.sqrt(Math.max(1+v[0][0]-v[1][1]-v[2][2],0)),b[1]=.5*Math.sqrt(Math.max(1-v[0][0]+v[1][1]-v[2][2],0)),b[2]=.5*Math.sqrt(Math.max(1-v[0][0]-v[1][1]+v[2][2],0)),b[3]=.5*Math.sqrt(Math.max(1+v[0][0]+v[1][1]+v[2][2],0)),v[2][1]>v[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":32,"gl-mat4/clone":131,"gl-mat4/create":132,"gl-mat4/determinant":133,"gl-mat4/invert":137,"gl-mat4/transpose":147,"gl-vec3/cross":23,"gl-vec3/dot":24,"gl-vec3/length":25,"gl-vec3/normalize":27}],32:[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;16>i;i++)t[i]=e[i]*n;return!0}},{}],33:[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":132,"gl-mat4/fromRotationTranslation":135,"gl-mat4/identity":136,"gl-mat4/multiply":139,"gl-mat4/scale":145,"gl-mat4/translate":146}],34:[function(t,e,r){e.exports=t("gl-quat/slerp")},{"gl-quat/slerp":35}],35:[function(t,e,r){function n(t,e,r,n){var i,a,o,s,l,c=e[0],u=e[1],f=e[2],h=e[3],d=r[0],p=r[1],g=r[2],v=r[3];return a=c*d+u*p+f*g+h*v,0>a&&(a=-a,d=-d,p=-p,g=-g,v=-v),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*c+l*d,t[1]=s*u+l*p,t[2]=s*f+l*g,t[3]=s*h+l*v,t}e.exports=n},{}],36:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,c){var u=e+a+c;if(f>0){var f=Math.sqrt(u+1);t[0]=.5*(o-l)/f,t[1]=.5*(s-n)/f,t[2]=.5*(r-a)/f,t[3]=.5*f}else{var h=Math.max(e,a,c),f=Math.sqrt(2*h-u+1);e>=h?(t[0]=.5*f,t[1]=.5*(i+r)/f,t[2]=.5*(s+n)/f,t[3]=.5*(o-l)/f):a>=h?(t[0]=.5*(r+i)/f,t[1]=.5*f,t[2]=.5*(l+o)/f,t[3]=.5*(s-n)/f):(t[0]=.5*(n+s)/f,t[1]=.5*(o+l)/f,t[2]=.5*f,t[3]=.5*(r-i)/f)}return t}e.exports=n},{}],37:[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"),c=t("gl-mat4/lookAt"),u=t("gl-mat4/fromQuat"),f=t("gl-mat4/invert"),h=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;u(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;3>l;++l){for(var c=0,f=0;3>f;++f)c+=r[l+4*f]*i[f];r[12+l]=-c}},d.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;16>n;++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],c=n(o,s,l);o/=c,s/=c,l/=c;var u=a[0],f=a[4],h=a[8],d=u*o+f*s+h*l;u-=o*d,f-=s*d,h-=l*d;var p=n(u,f,h);u/=p,f/=p,h/=p;var g=a[2],v=a[6],m=a[10],y=g*o+v*s+m*l,b=g*u+v*f+m*h;g-=y*o+b*u,v-=y*s+b*f,m-=y*l+b*h;var x=n(g,v,m);g/=x,v/=x,m/=x;var _=u*e+o*r,w=f*e+s*r,k=h*e+l*r;this.center.move(t,_,w,k);var A=Math.exp(this.computedRadius[0]);A=Math.max(1e-4,A+i),this.radius.set(t,Math.log(A))},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],c=o[8],u=o[1],f=o[5],h=o[9],d=o[2],p=o[6],g=o[10],v=e*s+r*u,m=e*l+r*f,y=e*c+r*h,b=-(p*y-g*m),x=-(g*v-d*y),_=-(d*m-p*v),w=Math.sqrt(Math.max(0,1-Math.pow(b,2)-Math.pow(x,2)-Math.pow(_,2))),k=i(b,x,_,w);k>1e-6?(b/=k,x/=k,_/=k,w/=k):(b=x=_=0,w=1);var A=this.computedRotation,M=A[0],T=A[1],E=A[2],L=A[3],S=M*w+L*b+T*_-E*x,C=T*w+L*x+E*b-M*_,z=E*w+L*_+M*x-T*b,P=L*w-M*b-T*x-E*_;if(a){b=d,x=p,_=g;var R=Math.sin(a)/n(b,x,_);b*=R,x*=R,_*=R,w=Math.cos(e),S=S*w+P*b+C*_-z*x,C=C*w+P*x+z*b-S*_,z=z*w+P*_+S*x-C*b,P=P*w-S*b-C*x-z*_}var O=i(S,C,z,P);O>1e-6?(S/=O,C/=O,z/=O,P/=O):(S=C=z=0,P=1),this.rotation.set(t,S,C,z,P)},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;c(i,e,r,n);var o=this.computedRotation;h(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;3>l;++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;h(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;f(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 c=Math.exp(this.computedRadius[0]);this.center.set(t,o-n[2]*c,s-n[6]*c,l-n[10]*c),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; +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Plotly=t()}}(function(){var t;return function e(t,r,n){function i(o,s){if(!r[o]){if(!t[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[o]={exports:{}};t[o][0].call(u.exports,function(e){var r=t[o][1][e];return i(r?r:e)},u,u.exports,e,t,r,n)}return r[o].exports}for(var a="function"==typeof require&&require,o=0;or;++r)e[r]=0;return e}function o(t,e,r){switch(arguments.length){case 0:return new i([0],[0],0);case 1:if("number"==typeof t){var n=a(t);return new i(n,n,0)}return new i(t,a(t.length),0);case 2:if("number"==typeof e){var n=a(t.length);return new i(t,n,+e)}r=0;case 3:if(t.length!==e.length)throw new Error("state and velocity lengths must match");return new i(t,e,r)}}e.exports=o;var s=t("cubic-hermite"),l=t("binary-search-bounds"),c=i.prototype;c.flush=function(t){var e=l.gt(this._time,t)-1;0>=e||(this._time.splice(0,e),this._state.splice(0,e*this.dimension),this._velocity.splice(0,e*this.dimension))},c.curve=function(t){var e=this._time,r=e.length,i=l.le(e,t),a=this._scratch[0],o=this._state,c=this._velocity,u=this.dimension,f=this.bounds;if(0>i)for(var h=u-1,d=0;u>d;++d,--h)a[d]=o[h];else if(i>=r-1)for(var h=o.length-1,p=t-e[r-1],d=0;u>d;++d,--h)a[d]=o[h]+p*c[h];else{for(var h=u*(i+1)-1,g=e[i],v=e[i+1],m=v-g||1,y=this._scratch[1],b=this._scratch[2],x=this._scratch[3],_=this._scratch[4],w=!0,d=0;u>d;++d,--h)y[d]=o[h],x[d]=c[h]*m,b[d]=o[h+u],_[d]=c[h+u]*m,w=w&&y[d]===b[d]&&x[d]===_[d]&&0===x[d];if(w)for(var d=0;u>d;++d)a[d]=y[d];else s(y,x,b,_,(t-g)/m,a)}for(var k=f[0],A=f[1],d=0;u>d;++d)a[d]=n(k[d],A[d],a[d]);return a},c.dcurve=function(t){var e=this._time,r=e.length,n=l.le(e,t),i=this._scratch[0],a=this._state,o=this._velocity,c=this.dimension;if(n>=r-1)for(var u=a.length-1,f=(t-e[r-1],0);c>f;++f,--u)i[f]=o[u];else{for(var u=c*(n+1)-1,h=e[n],d=e[n+1],p=d-h||1,g=this._scratch[1],v=this._scratch[2],m=this._scratch[3],y=this._scratch[4],b=!0,f=0;c>f;++f,--u)g[f]=a[u],m[f]=o[u]*p,v[f]=a[u+c],y[f]=o[u+c]*p,b=b&&g[f]===v[f]&&m[f]===y[f]&&0===m[f];if(b)for(var f=0;c>f;++f)i[f]=0;else{s.derivative(g,m,v,y,(t-h)/p,i);for(var f=0;c>f;++f)i[f]/=p}}return i},c.lastT=function(){var t=this._time;return t[t.length-1]},c.stable=function(){for(var t=this._velocity,e=t.length,r=this.dimension-1;r>=0;--r)if(t[--e])return!1;return!0},c.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(e>t||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=this.bounds,l=s[0],c=s[1];this._time.push(e,t);for(var u=0;2>u;++u)for(var f=0;r>f;++f)i.push(i[o++]),a.push(0);this._time.push(t);for(var f=r;f>0;--f)i.push(n(l[f-1],c[f-1],arguments[f])),a.push(0)}},c.push=function(t){var e=this.lastT(),r=this.dimension;if(!(e>t||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=t-e,l=this.bounds,c=l[0],u=l[1],f=s>1e-6?1/s:0;this._time.push(t);for(var h=r;h>0;--h){var d=n(c[h-1],u[h-1],arguments[h]);i.push(d),a.push((d-i[o++])*f)}}},c.set=function(t){var e=this.dimension;if(!(t0;--l)r.push(n(o[l-1],s[l-1],arguments[l])),i.push(0)}},c.move=function(t){var e=this.lastT(),r=this.dimension;if(!(e>=t||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=this.bounds,l=s[0],c=s[1],u=t-e,f=u>1e-6?1/u:0;this._time.push(t);for(var h=r;h>0;--h){var d=arguments[h];i.push(n(l[h-1],c[h-1],i[o++]+d)),a.push(d*f)}}},c.idle=function(t){var e=this.lastT();if(!(e>t)){var r=this.dimension,i=this._state,a=this._velocity,o=i.length-r,s=this.bounds,l=s[0],c=s[1],u=t-e;this._time.push(t);for(var f=r-1;f>=0;--f)i.push(n(l[f],c[f],i[o]+u*a[o])),a.push(0),o+=1}}},{"binary-search-bounds":21,"cubic-hermite":22}],21:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){var o=["function ",t,"(a,l,h,",n.join(","),"){",a?"":"var i=",r?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a",i?".get(m)":"[m]"];return a?e.indexOf("c")<0?o.push(";if(x===y){return m}else if(x<=y){"):o.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):o.push(";if(",e,"){i=m;"),r?o.push("l=m+1}else{h=m-1}"):o.push("h=m-1}else{l=m+1}"),o.push("}"),a?o.push("return -1};"):o.push("return i};"),o.join("")}function i(t,e,r,i){var a=new Function([n("A","x"+t+"y",e,["y"],!1,i),n("B","x"+t+"y",e,["y"],!0,i),n("P","c(x,y)"+t+"0",e,["y","c"],!1,i),n("Q","c(x,y)"+t+"0",e,["y","c"],!0,i),"function dispatchBsearch",r,"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch",r].join(""));return a()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],22:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,c=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var u=t.length-1;u>=0;--u)a[u]=o*t[u]+s*e[u]+l*r[u]+c*n[u];return a}return o*t+s*e+l*r[u]+c*n}function i(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,c=(1+2*i)*l,u=i*l,f=s*(3-2*i),h=s*o;if(t.length){a||(a=new Array(t.length));for(var d=t.length-1;d>=0;--d)a[d]=c*t[d]+u*e[d]+f*r[d]+h*n[d];return a}return c*t+u*e+f*r+h*n}e.exports=i,e.exports.derivative=n},{}],23:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t}e.exports=n},{}],24:[function(t,e,r){function n(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}e.exports=n},{}],25:[function(t,e,r){function n(t){var e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}e.exports=n},{}],26:[function(t,e,r){function n(t,e,r,n){var i=e[0],a=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t}e.exports=n},{}],27:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}e.exports=n},{}],28:[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){t=t||{};var e=t.matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return new n(e)}var a=t("binary-search-bounds"),o=t("mat4-interpolate"),s=t("gl-mat4/invert"),l=t("gl-mat4/rotateX"),c=t("gl-mat4/rotateY"),u=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(!(0>r)){var i=this._components;if(r===e.length-1)for(var l=16*r,c=0;16>c;++c)n[c]=i[l++];else{for(var u=e[r+1]-e[r],l=16*r,f=this.prevMatrix,h=!0,c=0;16>c;++c)f[c]=i[l++];for(var p=this.nextMatrix,c=0;16>c;++c)p[c]=i[l++],h=h&&f[c]===p[c];if(1e-6>u||h)for(var c=0;16>c;++c)n[c]=f[c];else o(n,f,p,(t-e[r])/u)}var g=this.computedUp;g[0]=n[1],g[1]=n[5],g[2]=n[6],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]),c=0;3>c;++c)b[c]=m[c]-n[2+4*c]*x}},g.idle=function(t){if(!(tn;++n)e.push(e[r++]);this._time.push(t)}},g.flush=function(t){var e=a.gt(this._time,t)-2;0>e||(this._time.slice(0,e),this._components.slice(0,16*e))},g.lastT=function(){return this._time[this._time.length-1]},g.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||p,n=n||this.computedUp,this.setMatrix(t,f(this.computedMatrix,e,r,n));for(var i=0,a=0;3>a;++a)i+=Math.pow(r[a]-e[a],2);i=Math.log(Math.sqrt(i)),this.computedRadius[0]=i},g.rotate=function(t,e,r,n){this.recalcMatrix(t);var i=this.computedInverse;e&&c(i,i,e),r&&l(i,i,r),n&&u(i,i,n),this.setMatrix(t,s(this.computedMatrix,i))};var v=[0,0,0];g.pan=function(t,e,r,n){v[0]=-(e||0),v[1]=-(r||0),v[2]=-(n||0),this.recalcMatrix(t);var i=this.computedInverse;h(i,i,v),this.setMatrix(t,s(i,i))},g.translate=function(t,e,r,n){v[0]=e||0,v[1]=r||0,v[2]=n||0,this.recalcMatrix(t);var i=this.computedMatrix;h(i,i,v),this.setMatrix(t,i)},g.setMatrix=function(t,e){if(!(tr;++r)this._components.push(e[r])}},g.setDistance=function(t,e){this.computedRadius[0]=e},g.setDistanceLimits=function(t,e){var r=this._limits;r[0]=t,r[1]=e},g.getDistanceLimits=function(t){var e=this._limits;return t?(t[0]=e[0],t[1]=e[1],t):e}},{"binary-search-bounds":29,"gl-mat4/invert":137,"gl-mat4/lookAt":138,"gl-mat4/rotateX":142,"gl-mat4/rotateY":143,"gl-mat4/rotateZ":144,"gl-mat4/scale":145,"gl-mat4/translate":146,"gl-vec3/normalize":27,"mat4-interpolate":30}],29:[function(t,e,r){arguments[4][21][0].apply(r,arguments)},{dup:21}],30:[function(t,e,r){function n(t,e,r,n){if(0===u(e)||0===u(r))return!1;var i=c(e,h.translate,h.scale,h.skew,h.perspective,h.quaternion),a=c(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):!1}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"),c=t("mat4-decompose"),u=t("gl-mat4/determinant"),f=t("quat-slerp"),h=i(),d=i(),p=i();e.exports=n},{"gl-mat4/determinant":133,"gl-vec3/lerp":26,"mat4-decompose":31,"mat4-recompose":33,"quat-slerp":34}],31:[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}function i(t,e){t[0][0]=e[0],t[0][1]=e[1],t[0][2]=e[2],t[1][0]=e[4],t[1][1]=e[5],t[1][2]=e[6],t[2][0]=e[8],t[2][1]=e[9],t[2][2]=e[10]}function a(t,e,r,n,i){t[0]=e[0]*n+r[0]*i,t[1]=e[1]*n+r[1]*i,t[2]=e[2]*n+r[2]*i}var o=t("./normalize"),s=t("gl-mat4/create"),l=t("gl-mat4/clone"),c=t("gl-mat4/determinant"),u=t("gl-mat4/invert"),f=t("gl-mat4/transpose"),h={length:t("gl-vec3/length"),normalize:t("gl-vec3/normalize"),dot:t("gl-vec3/dot"),cross:t("gl-vec3/cross")},d=s(),p=s(),g=[0,0,0,0],v=[[0,0,0],[0,0,0],[0,0,0]],m=[0,0,0];e.exports=function(t,e,r,s,y,b){if(e||(e=[0,0,0]),r||(r=[0,0,0]),s||(s=[0,0,0]),y||(y=[0,0,0,1]),b||(b=[0,0,0,1]),!o(d,t))return!1;if(l(p,d),p[3]=0,p[7]=0,p[11]=0,p[15]=1,Math.abs(c(p)<1e-8))return!1;var x=d[3],_=d[7],w=d[11],k=d[12],A=d[13],M=d[14],T=d[15];if(0!==x||0!==_||0!==w){g[0]=x,g[1]=_,g[2]=w,g[3]=T;var E=u(p,p);if(!E)return!1;f(p,p),n(y,g,p)}else y[0]=y[1]=y[2]=0,y[3]=1;if(e[0]=k,e[1]=A,e[2]=M,i(v,d),r[0]=h.length(v[0]),h.normalize(v[0],v[0]),s[0]=h.dot(v[0],v[1]),a(v[1],v[1],v[0],1,-s[0]),r[1]=h.length(v[1]),h.normalize(v[1],v[1]),s[0]/=r[1],s[1]=h.dot(v[0],v[2]),a(v[2],v[2],v[0],1,-s[1]),s[2]=h.dot(v[1],v[2]),a(v[2],v[2],v[1],1,-s[2]),r[2]=h.length(v[2]),h.normalize(v[2],v[2]),s[1]/=r[2],s[2]/=r[2],h.cross(m,v[1],v[2]),h.dot(v[0],m)<0)for(var L=0;3>L;L++)r[L]*=-1,v[L][0]*=-1,v[L][1]*=-1,v[L][2]*=-1;return b[0]=.5*Math.sqrt(Math.max(1+v[0][0]-v[1][1]-v[2][2],0)),b[1]=.5*Math.sqrt(Math.max(1-v[0][0]+v[1][1]-v[2][2],0)),b[2]=.5*Math.sqrt(Math.max(1-v[0][0]-v[1][1]+v[2][2],0)),b[3]=.5*Math.sqrt(Math.max(1+v[0][0]+v[1][1]+v[2][2],0)),v[2][1]>v[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":32,"gl-mat4/clone":131,"gl-mat4/create":132,"gl-mat4/determinant":133,"gl-mat4/invert":137,"gl-mat4/transpose":147,"gl-vec3/cross":23,"gl-vec3/dot":24,"gl-vec3/length":25,"gl-vec3/normalize":27}],32:[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;16>i;i++)t[i]=e[i]*n;return!0}},{}],33:[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":132,"gl-mat4/fromRotationTranslation":135,"gl-mat4/identity":136,"gl-mat4/multiply":139,"gl-mat4/scale":145,"gl-mat4/translate":146}],34:[function(t,e,r){e.exports=t("gl-quat/slerp")},{"gl-quat/slerp":35}],35:[function(t,e,r){function n(t,e,r,n){var i,a,o,s,l,c=e[0],u=e[1],f=e[2],h=e[3],d=r[0],p=r[1],g=r[2],v=r[3];return a=c*d+u*p+f*g+h*v,0>a&&(a=-a,d=-d,p=-p,g=-g,v=-v),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*c+l*d,t[1]=s*u+l*p,t[2]=s*f+l*g,t[3]=s*h+l*v,t}e.exports=n},{}],36:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,c){var u=e+a+c;if(f>0){var f=Math.sqrt(u+1);t[0]=.5*(o-l)/f,t[1]=.5*(s-n)/f,t[2]=.5*(r-a)/f,t[3]=.5*f}else{var h=Math.max(e,a,c),f=Math.sqrt(2*h-u+1);e>=h?(t[0]=.5*f,t[1]=.5*(i+r)/f,t[2]=.5*(s+n)/f,t[3]=.5*(o-l)/f):a>=h?(t[0]=.5*(r+i)/f,t[1]=.5*f,t[2]=.5*(l+o)/f,t[3]=.5*(s-n)/f):(t[0]=.5*(n+s)/f,t[1]=.5*(o+l)/f,t[2]=.5*f,t[3]=.5*(r-i)/f)}return t}e.exports=n},{}],37:[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"),c=t("gl-mat4/lookAt"),u=t("gl-mat4/fromQuat"),f=t("gl-mat4/invert"),h=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;u(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;3>l;++l){for(var c=0,f=0;3>f;++f)c+=r[l+4*f]*i[f];r[12+l]=-c}},d.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;16>n;++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],c=n(o,s,l);o/=c,s/=c,l/=c;var u=a[0],f=a[4],h=a[8],d=u*o+f*s+h*l;u-=o*d,f-=s*d,h-=l*d;var p=n(u,f,h);u/=p,f/=p,h/=p;var g=a[2],v=a[6],m=a[10],y=g*o+v*s+m*l,b=g*u+v*f+m*h;g-=y*o+b*u,v-=y*s+b*f,m-=y*l+b*h;var x=n(g,v,m);g/=x,v/=x,m/=x;var _=u*e+o*r,w=f*e+s*r,k=h*e+l*r;this.center.move(t,_,w,k);var A=Math.exp(this.computedRadius[0]);A=Math.max(1e-4,A+i),this.radius.set(t,Math.log(A))},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],c=o[8],u=o[1],f=o[5],h=o[9],d=o[2],p=o[6],g=o[10],v=e*s+r*u,m=e*l+r*f,y=e*c+r*h,b=-(p*y-g*m),x=-(g*v-d*y),_=-(d*m-p*v),w=Math.sqrt(Math.max(0,1-Math.pow(b,2)-Math.pow(x,2)-Math.pow(_,2))),k=i(b,x,_,w);k>1e-6?(b/=k,x/=k,_/=k,w/=k):(b=x=_=0,w=1);var A=this.computedRotation,M=A[0],T=A[1],E=A[2],L=A[3],S=M*w+L*b+T*_-E*x,C=T*w+L*x+E*b-M*_,z=E*w+L*_+M*x-T*b,P=L*w-M*b-T*x-E*_;if(a){b=d,x=p,_=g;var R=Math.sin(a)/n(b,x,_);b*=R,x*=R,_*=R,w=Math.cos(e),S=S*w+P*b+C*_-z*x,C=C*w+P*x+z*b-S*_,z=z*w+P*_+S*x-C*b,P=P*w-S*b-C*x-z*_}var O=i(S,C,z,P);O>1e-6?(S/=O,C/=O,z/=O,P/=O):(S=C=z=0,P=1),this.rotation.set(t,S,C,z,P)},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;c(i,e,r,n);var o=this.computedRotation;h(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;3>l;++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;h(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;f(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 c=Math.exp(this.computedRadius[0]);this.center.set(t,o-n[2]*c,s-n[6]*c,l-n[10]*c),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":36,"filtered-vector":20,"gl-mat4/fromQuat":134,"gl-mat4/invert":137,"gl-mat4/lookAt":138}],38:[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){return Math.min(1,Math.max(-1,t))}function a(t){var e=Math.abs(t[0]),r=Math.abs(t[1]),n=Math.abs(t[2]),i=[0,0,0];e>Math.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,s=0;3>s;++s)a+=t[s]*t[s],o+=i[s]*t[s];for(var s=0;3>s;++s)i[s]-=o/a*t[s];return h(i,i),i}function o(t,e,r,n,i,a,o,s){this.center=l(r),this.up=l(n),this.right=l(i),this.radius=l([a]),this.angle=l([o,s]),this.angle.bounds=[[-(1/0),-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(t,e),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var c=0;16>c;++c)this.computedMatrix[c]=.5;this.recalcMatrix(0)}function s(t){t=t||{};var e=t.center||[0,0,0],r=t.up||[0,1,0],i=t.right||a(r),s=t.radius||1,l=t.theta||0,c=t.phi||0;if(e=[].slice.call(e,0,3),r=[].slice.call(r,0,3),h(r,r),i=[].slice.call(i,0,3),h(i,i),"eye"in t){var u=t.eye,p=[u[0]-e[0],u[1]-e[1],u[2]-e[2]];f(i,p,r),n(i[0],i[1],i[2])<1e-6?i=a(r):h(i,i),s=n(p[0],p[1],p[2]);var g=d(r,p)/s,v=d(i,p)/s;c=Math.acos(g),l=Math.acos(v)}return s=Math.log(s),new o(t.zoomMin,t.zoomMax,e,r,i,s,l,c)}e.exports=s;var l=t("filtered-vector"),c=t("gl-mat4/invert"),u=t("gl-mat4/rotate"),f=t("gl-vec3/cross"),h=t("gl-vec3/normalize"),d=t("gl-vec3/dot"),p=o.prototype;p.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},p.getDistanceLimits=function(t){var e=this.radius.bounds[0];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])]},p.recalcMatrix=function(t){this.center.curve(t),this.up.curve(t),this.right.curve(t),this.radius.curve(t),this.angle.curve(t);for(var e=this.computedUp,r=this.computedRight,i=0,a=0,o=0;3>o;++o)a+=e[o]*r[o],i+=e[o]*e[o];for(var s=Math.sqrt(i),l=0,o=0;3>o;++o)r[o]-=e[o]*a/i,l+=r[o]*r[o],e[o]/=s;for(var c=Math.sqrt(l),o=0;3>o;++o)r[o]/=c;var u=this.computedToward;f(u,e,r),h(u,u);for(var d=Math.exp(this.computedRadius[0]),p=this.computedAngle[0],g=this.computedAngle[1],v=Math.cos(p),m=Math.sin(p),y=Math.cos(g),b=Math.sin(g),x=this.computedCenter,_=v*y,w=m*y,k=b,A=-v*b,M=-m*b,T=y,E=this.computedEye,L=this.computedMatrix,o=0;3>o;++o){var S=_*r[o]+w*u[o]+k*e[o];L[4*o+1]=A*r[o]+M*u[o]+T*e[o],L[4*o+2]=S,L[4*o+3]=0}var C=L[1],z=L[5],P=L[9],R=L[2],O=L[6],I=L[10],N=z*I-P*O,j=P*R-C*I,F=C*O-z*R,D=n(N,j,F);N/=D,j/=D,F/=D,L[0]=N,L[4]=j,L[8]=F;for(var o=0;3>o;++o)E[o]=x[o]+L[2+4*o]*d;for(var o=0;3>o;++o){for(var l=0,B=0;3>B;++B)l+=L[o+4*B]*E[B];L[12+o]=-l}L[15]=1},p.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;16>n;++n)e[n]=r[n];return e}return r};var g=[0,0,0];p.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var i=this.computedMatrix;g[0]=i[2],g[1]=i[6],g[2]=i[10];for(var a=this.computedUp,o=this.computedRight,s=this.computedToward,l=0;3>l;++l)i[4*l]=a[l],i[4*l+1]=o[l],i[4*l+2]=s[l];u(i,i,n,g);for(var l=0;3>l;++l)a[l]=i[4*l],o[l]=i[4*l+1];this.up.set(t,a[0],a[1],a[2]),this.right.set(t,o[0],o[1],o[2])}},p.pan=function(t,e,r,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=(Math.exp(this.computedRadius[0]),a[1]),s=a[5],l=a[9],c=n(o,s,l);o/=c,s/=c,l/=c;var u=a[0],f=a[4],h=a[8],d=u*o+f*s+h*l;u-=o*d,f-=s*d,h-=l*d;var p=n(u,f,h);u/=p,f/=p,h/=p;var g=u*e+o*r,v=f*e+s*r,m=h*e+l*r;this.center.move(t,g,v,m);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+i),this.radius.set(t,Math.log(y))},p.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},p.setMatrix=function(t,e,r,a){var o=1;"number"==typeof r&&(o=0|r),(0>o||o>3)&&(o=1);var s=(o+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var l=e[o],u=e[o+4],f=e[o+8];if(a){var h=Math.abs(l),d=Math.abs(u),p=Math.abs(f),g=Math.max(h,d,p);h===g?(l=0>l?-1:1,u=f=0):p===g?(f=0>f?-1:1,l=u=0):(u=0>u?-1:1,l=f=0)}else{var v=n(l,u,f);l/=v,u/=v,f/=v}var m=e[s],y=e[s+4],b=e[s+8],x=m*l+y*u+b*f;m-=l*x,y-=u*x,b-=f*x;var _=n(m,y,b);m/=_,y/=_,b/=_;var w=u*b-f*y,k=f*m-l*b,A=l*y-u*m,M=n(w,k,A);w/=M,k/=M,A/=M,this.center.jump(t,H,G,Y),this.radius.idle(t),this.up.jump(t,l,u,f),this.right.jump(t,m,y,b);var T,E;if(2===o){var L=e[1],S=e[5],C=e[9],z=L*m+S*y+C*b,P=L*w+S*k+C*A;T=0>N?-Math.PI/2:Math.PI/2,E=Math.atan2(P,z)}else{var R=e[2],O=e[6],I=e[10],N=R*l+O*u+I*f,j=R*m+O*y+I*b,F=R*w+O*k+I*A;T=Math.asin(i(N)),E=Math.atan2(F,j)}this.angle.jump(t,E,T),this.recalcMatrix(t);var D=e[2],B=e[6],U=e[10],V=this.computedMatrix;c(V,e);var q=V[15],H=V[12]/q,G=V[13]/q,Y=V[14]/q,X=Math.exp(this.computedRadius[0]);this.center.jump(t,H-D*X,G-B*X,Y-U*X)},p.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},p.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},p.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},p.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},p.lookAt=function(t,e,r,a){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter,a=a||this.computedUp;var o=a[0],s=a[1],l=a[2],c=n(o,s,l);if(!(1e-6>c)){o/=c,s/=c,l/=c;var u=e[0]-r[0],f=e[1]-r[1],h=e[2]-r[2],d=n(u,f,h);if(!(1e-6>d)){u/=d,f/=d,h/=d;var p=this.computedRight,g=p[0],v=p[1],m=p[2],y=o*g+s*v+l*m;g-=y*o,v-=y*s,m-=y*l;var b=n(g,v,m);if(!(.01>b&&(g=s*h-l*f,v=l*u-o*h,m=o*f-s*u,b=n(g,v,m),1e-6>b))){g/=b,v/=b,m/=b,this.up.set(t,o,s,l),this.right.set(t,g,v,m),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(d));var x=s*m-l*v,_=l*g-o*m,w=o*v-s*g,k=n(x,_,w);x/=k,_/=k,w/=k;var A=o*u+s*f+l*h,M=g*u+v*f+m*h,T=x*u+_*f+w*h,E=Math.asin(i(A)),L=Math.atan2(T,M),S=this.angle._state,C=S[S.length-1],z=S[S.length-2];C%=2*Math.PI;var P=Math.abs(C+2*Math.PI-L),R=Math.abs(C-L),O=Math.abs(C-2*Math.PI-L);R>P&&(C+=2*Math.PI),R>O&&(C-=2*Math.PI),this.angle.jump(this.angle.lastT(),C,z),this.angle.set(t,L,E)}}}}},{"filtered-vector":20,"gl-mat4/invert":137,"gl-mat4/rotate":141,"gl-vec3/cross":23,"gl-vec3/dot":24,"gl-vec3/normalize":27}],39:[function(t,e,r){"use strict";function n(t,e){this._controllerNames=Object.keys(t),this._controllerList=this._controllerNames.map(function(e){return t[e]}),this._mode=e,this._active=t[e],this._active||(this._mode="turntable",this._active=t.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}function i(t){t=t||{};var e=t.eye||[0,0,1],r=t.center||[0,0,0],i=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],c=t.mode||"turntable",u=a(),f=o(),h=s();return u.setDistanceLimits(l[0],l[1]),u.lookAt(0,e,r,i),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,r,i),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,i),new n({turntable:u,orbit:f,matrix:h},c)}e.exports=i;var a=t("turntable-camera-controller"),o=t("orbit-camera-controller"),s=t("matrix-camera-controller"),l=n.prototype,c=[["flush",1],["idle",1],["lookAt",4],["rotate",4],["pan",4],["translate",4],["setMatrix",2],["setDistanceLimits",2],["setDistance",2]];c.forEach(function(t){for(var e=t[0],r=[],n=0;ne)){var r=this._active,n=this._controllerList[e],i=Math.max(r.lastT(),n.lastT());r.recalcMatrix(i),n.setMatrix(i,r.computedMatrix),this._active=n,this._mode=t,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}}},l.getMode=function(){return this._mode}},{"matrix-camera-controller":28,"orbit-camera-controller":37,"turntable-camera-controller":38}],40:[function(t,e,r){function n(t,e){return a(i(t,e))}e.exports=n;var i=t("alpha-complex"),a=t("simplicial-complex-boundary")},{"alpha-complex":41,"simplicial-complex-boundary":44}],41:[function(t,e,r){"use strict";function n(t,e){return i(e).filter(function(r){for(var n=new Array(r.length),i=0;ii;++i)r+=t[i]*e[i];return r}function i(t){var e=t.length;if(0===e)return[];var r=(t[0].length,o([t.length+1,t.length+1],1)),i=o([t.length+1],1);r[e][e]=0;for(var a=0;e>a;++a){for(var l=0;a>=l;++l)r[l][a]=r[a][l]=2*n(t[a],t[l]);i[a]=n(t[a],t[a])}for(var c=s(r,i),u=0,f=c[e+1],a=0;aa;++a){for(var f=c[a],d=0,l=0;ls;++s)r[s]+=t[a][s]*n[a];return r}var o=t("dup"),s=t("robust-linear-solve");a.barycenetric=i,e.exports=a},{dup:115,"robust-linear-solve":256}],44:[function(t,e,r){"use strict";function n(t){return a(i(t))}e.exports=n;var i=t("boundary-cells"),a=t("reduce-simplicial-complex")},{"boundary-cells":45,"reduce-simplicial-complex":48}],45:[function(t,e,r){"use strict";function n(t){for(var e=t.length,r=0,n=0;e>n;++n)r+=t[n].length;for(var i=new Array(r),a=0,n=0;e>n;++n)for(var o=t[n],s=o.length,l=0;s>l;++l)for(var c=i[a++]=new Array(s-1),u=1;s>u;++u)c[u-1]=o[(l+u)%s];return i}e.exports=n},{}],46:[function(t,e,r){"use strict";function n(t){for(var e=1,r=1;rn;++n)if(t[r]n;++n){var s=t[n],l=o(s);if(0!==l){if(r>0){var c=t[r-1];if(0===i(s,c)&&o(c)!==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":46,"compare-cell":101,"compare-oriented-cell":47}],49:[function(t,e,r){"use strict";var n=function(){function t(t){return!Array.isArray(t)&&null!==t&&"object"==typeof t}function e(t,e,r){for(var n=(e-t)/Math.max(r-1,1),i=[],a=0;r>a;a++)i.push(t+a*n);return i}function r(){for(var t=[].slice.call(arguments),e=t.map(function(t){return t.length}),r=Math.min.apply(null,e),n=[],i=0;r>i;i++){n[i]=[];for(var a=0;aa;a++)i.push([t[a],e[a],r[a]]);return i}function i(t){function e(t){for(var n=0;n>16&255,r[1]=n>>8&255,r[2]=255&n):f.test(t)&&(n=t.match(h),r[0]=parseInt(n[1]),r[1]=parseInt(n[2]),r[2]=parseInt(n[3])),!e)for(var i=0;3>i;++i)r[i]=r[i]/255;return r}function c(t,e){var r,n;if("string"!=typeof t)return t;if(r=[],"#"===t[0]?(t=t.substr(1),3===t.length&&(t+=t),n=parseInt(t,16),r[0]=n>>16&255,r[1]=n>>8&255,r[2]=255&n):f.test(t)&&(n=t.match(h),r[0]=parseInt(n[1]),r[1]=parseInt(n[2]),r[2]=parseInt(n[3]),n[4]?r[3]=parseFloat(n[4]):r[3]=1),!e)for(var i=0;3>i;++i)r[i]=r[i]/255;return r}var u={},f=/^rgba?\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*(,.*)?\)$/,h=/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,?\s*(.*)?\)$/;return u.isPlainObject=t,u.linspace=e,u.zip3=n,u.sum=i,u.zip=r,u.isEqual=s,u.copy2D=a,u.copy1D=o,u.str2RgbArray=l,u.str2RgbaArray=c,u};e.exports=n()},{}],50:[function(t,e,r){"use strict";"use restrict";function n(t){var e=32;return t&=-t,t&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}var i=32;r.INT_BITS=i,r.INT_MAX=2147483647,r.INT_MIN=-1<0)-(0>t)},r.abs=function(t){var e=t>>i-1;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(e>t)},r.max=function(t,e){return t^(t^e)&-(e>t)},r.isPow2=function(t){return!(t&t-1||!t)},r.log2=function(t){var e,r;return e=(t>65535)<<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,e|t>>1},r.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},r.popCount=function(t){return t-=t>>>1&1431655765,t=(858993459&t)+(t>>>2&858993459),16843009*(t+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,t&=15,27030>>>t&1};var a=new Array(256);!function(t){for(var e=0;256>e;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|a[t>>>16&255]<<8|a[t>>>24&255]},r.interleave2=function(t,e){return t&=65535,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e&=65535,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1},r.deinterleave2=function(t,e){return t=t>>>e&1431655765,t=858993459&(t|t>>>1),t=252645135&(t|t>>>2),t=16711935&(t|t>>>4),t=65535&(t|t>>>16),t<<16>>16},r.interleave3=function(t,e,r){return t&=1023,t=4278190335&(t|t<<16),t=251719695&(t|t<<8),t=3272356035&(t|t<<4),t=1227133513&(t|t<<2),e&=1023,e=4278190335&(e|e<<16),e=251719695&(e|e<<8),e=3272356035&(e|e<<4),e=1227133513&(e|e<<2),t|=e<<1,r&=1023,r=4278190335&(r|r<<16),r=251719695&(r|r<<8),r=3272356035&(r|r<<4),r=1227133513&(r|r<<2),t|r<<2},r.deinterleave3=function(t,e){return t=t>>>e&1227133513,t=3272356035&(t|t>>>2),t=251719695&(t|t>>>4),t=4278190335&(t|t>>>8),t=1023&(t|t>>>16),t<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],51:[function(t,e,r){(function(e){"use strict";function n(){try{var t=new Uint8Array(1);return t.foo=function(){return 42},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(e){return!1}}function i(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t){return this instanceof a?(a.TYPED_ARRAY_SUPPORT||(this.length=0,this.parent=void 0),"number"==typeof t?o(this,t):"string"==typeof t?s(this,t,arguments.length>1?arguments[1]:"utf8"):l(this,t)):arguments.length>1?new a(t,arguments[1]):new a(t)}function o(t,e){if(t=g(t,0>e?0:0|v(e)),!a.TYPED_ARRAY_SUPPORT)for(var r=0;e>r;r++)t[r]=0;return t}function s(t,e,r){"string"==typeof r&&""!==r||(r="utf8");var n=0|y(e,r);return t=g(t,n),t.write(e,r),t}function l(t,e){if(a.isBuffer(e))return c(t,e);if(K(e))return u(t,e);if(null==e)throw new TypeError("must start with number, buffer, array or string");if("undefined"!=typeof ArrayBuffer){if(e.buffer instanceof ArrayBuffer)return f(t,e);if(e instanceof ArrayBuffer)return h(t,e)}return e.length?d(t,e):p(t,e)}function c(t,e){var r=0|v(e.length);return t=g(t,r),e.copy(t,0,0,r),t}function u(t,e){var r=0|v(e.length);t=g(t,r);for(var n=0;r>n;n+=1)t[n]=255&e[n];return t}function f(t,e){var r=0|v(e.length);t=g(t,r);for(var n=0;r>n;n+=1)t[n]=255&e[n];return t}function h(t,e){return e.byteLength,a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=a.prototype):t=f(t,new Uint8Array(e)),t}function d(t,e){var r=0|v(e.length);t=g(t,r);for(var n=0;r>n;n+=1)t[n]=255&e[n];return t}function p(t,e){var r,n=0;"Buffer"===e.type&&K(e.data)&&(r=e.data,n=0|v(r.length)),t=g(t,n);for(var i=0;n>i;i+=1)t[i]=255&r[i];return t}function g(t,e){a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=a.prototype):t.length=e;var r=0!==e&&e<=a.poolSize>>>1;return r&&(t.parent=$),t}function v(t){if(t>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function m(t,e){if(!(this instanceof m))return new m(t,e);var r=new a(t,e);return delete r.parent,r}function y(t,e){"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"binary":case"raw":case"raws":return r;case"utf8":case"utf-8":return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Y(t).length;default:if(n)return q(t).length;e=(""+e).toLowerCase(),n=!0}}function b(t,e,r){var n=!1;if(e=0|e,r=void 0===r||r===1/0?this.length:0|r,t||(t="utf8"),0>e&&(e=0),r>this.length&&(r=this.length),e>=r)return"";for(;;)switch(t){case"hex":return z(this,e,r);case"utf8":case"utf-8":return E(this,e,r);case"ascii":return S(this,e,r);case"binary":return C(this,e,r);case"base64":return T(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function x(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var a=e.length;if(a%2!==0)throw new Error("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;n>o;o++){var s=parseInt(e.substr(2*o,2),16);if(isNaN(s))throw new Error("Invalid hex string");t[r+o]=s}return o}function _(t,e,r,n){return X(q(e,t.length-r),t,r,n)}function w(t,e,r,n){return X(H(e),t,r,n)}function k(t,e,r,n){return w(t,e,r,n)}function A(t,e,r,n){return X(Y(e),t,r,n)}function M(t,e,r,n){return X(G(e,t.length-r),t,r,n)}function T(t,e,r){return 0===e&&r===t.length?W.fromByteArray(t):W.fromByteArray(t.slice(e,r))}function E(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;r>i;){var a=t[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(r>=i+s){var l,c,u,f;switch(s){case 1:128>a&&(o=a);break;case 2:l=t[i+1],128===(192&l)&&(f=(31&a)<<6|63&l,f>127&&(o=f));break;case 3:l=t[i+1],c=t[i+2],128===(192&l)&&128===(192&c)&&(f=(15&a)<<12|(63&l)<<6|63&c,f>2047&&(55296>f||f>57343)&&(o=f));break;case 4:l=t[i+1],c=t[i+2],u=t[i+3],128===(192&l)&&128===(192&c)&&128===(192&u)&&(f=(15&a)<<18|(63&l)<<12|(63&c)<<6|63&u,f>65535&&1114112>f&&(o=f))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return L(n)}function L(t){var e=t.length;if(Q>=e)return String.fromCharCode.apply(String,t);for(var r="",n=0;e>n;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Q));return r}function S(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;r>i;i++)n+=String.fromCharCode(127&t[i]);return n}function C(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;r>i;i++)n+=String.fromCharCode(t[i]);return n}function z(t,e,r){var n=t.length;(!e||0>e)&&(e=0),(!r||0>r||r>n)&&(r=n);for(var i="",a=e;r>a;a++)i+=V(t[a]);return i}function P(t,e,r){for(var n=t.slice(e,r),i="",a=0;at)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,r,n,i,o){if(!a.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");if(e>i||o>e)throw new RangeError("value is out of bounds");if(r+n>t.length)throw new RangeError("index out of range")}function I(t,e,r,n){0>e&&(e=65535+e+1);for(var i=0,a=Math.min(t.length-r,2);a>i;i++)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function N(t,e,r,n){0>e&&(e=4294967295+e+1);for(var i=0,a=Math.min(t.length-r,4);a>i;i++)t[r+i]=e>>>8*(n?i:3-i)&255}function j(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError("index out of range");if(0>r)throw new RangeError("index out of range")}function F(t,e,r,n,i){return i||j(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),Z.write(t,e,r,n,23,4),r+4}function D(t,e,r,n,i){return i||j(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),Z.write(t,e,r,n,52,8),r+8}function B(t){if(t=U(t).replace(J,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function U(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function V(t){return 16>t?"0"+t.toString(16):t.toString(16)}function q(t,e){e=e||1/0;for(var r,n=t.length,i=null,a=[],o=0;n>o;o++){if(r=t.charCodeAt(o),r>55295&&57344>r){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(56320>r){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,128>r){if((e-=1)<0)break;a.push(r)}else if(2048>r){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(65536>r){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(1114112>r))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function H(t){for(var e=[],r=0;r>8,i=r%256,a.push(i),a.push(n);return a}function Y(t){return W.toByteArray(B(t))}function X(t,e,r,n){for(var i=0;n>i&&!(i+r>=e.length||i>=t.length);i++)e[i+r]=t[i];return i}var W=t("base64-js"),Z=t("ieee754"),K=t("isarray");r.Buffer=a,r.SlowBuffer=m,r.INSPECT_MAX_BYTES=50,a.poolSize=8192;var $={};a.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:n(),a._augment=function(t){return t.__proto__=a.prototype,t},a.TYPED_ARRAY_SUPPORT?(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})):(a.prototype.length=void 0,a.prototype.parent=void 0),a.isBuffer=function(t){return!(null==t||!t._isBuffer)},a.compare=function(t,e){if(!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);o>i&&t[i]===e[i];)++i;return i!==o&&(r=t[i],n=e[i]),n>r?-1:r>n?1:0},a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(t,e){if(!K(t))throw new TypeError("list argument must be an Array of Buffers.");if(0===t.length)return new a(0);var r;if(void 0===e)for(e=0,r=0;r0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},a.prototype.compare=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?0:a.compare(this,t)},a.prototype.indexOf=function(t,e){function r(t,e,r){for(var n=-1,i=0;r+i2147483647?e=2147483647:-2147483648>e&&(e=-2147483648),e>>=0,0===this.length)return-1;if(e>=this.length)return-1;if(0>e&&(e=Math.max(this.length+e,0)),"string"==typeof t)return 0===t.length?-1:String.prototype.indexOf.call(this,t,e);if(a.isBuffer(t))return r(this,t,e);if("number"==typeof t)return a.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,t,e):r(this,[t],e);throw new TypeError("val must be string, number or Buffer")},a.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else if(isFinite(e))e=0|e,isFinite(r)?(r=0|r,void 0===n&&(n="utf8")):(n=r,r=void 0);else{var i=n;n=e,e=0|r,r=i}var a=this.length-e;if((void 0===r||r>a)&&(r=a),t.length>0&&(0>r||0>e)||e>this.length)throw new RangeError("attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return x(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":return w(this,t,e,r);case"binary":return k(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Q=4096;a.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,0>t?(t+=r,0>t&&(t=0)):t>r&&(t=r),0>e?(e+=r,0>e&&(e=0)):e>r&&(e=r),t>e&&(e=t);var n;if(a.TYPED_ARRAY_SUPPORT)n=this.subarray(t,e),n.__proto__=a.prototype;else{var i=e-t;n=new a(i,void 0);for(var o=0;i>o;o++)n[o]=this[o+t]}return n.length&&(n.parent=this.parent||this),n},a.prototype.readUIntLE=function(t,e,r){t=0|t,e=0|e,r||R(t,e,this.length);for(var n=this[t],i=1,a=0;++a0&&(i*=256);)n+=this[t+--e]*i;return n},a.prototype.readUInt8=function(t,e){return e||R(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return e||R(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return e||R(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return e||R(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,r){t=0|t,e=0|e,r||R(t,e,this.length);for(var n=this[t],i=1,a=0;++a=i&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t=0|t,e=0|e,r||R(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a},a.prototype.readInt8=function(t,e){return e||R(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){e||R(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){e||R(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,e){return e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return e||R(t,4,this.length),Z.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return e||R(t,4,this.length),Z.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return e||R(t,8,this.length),Z.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return e||R(t,8,this.length),Z.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,r,n){t=+t,e=0|e,r=0|r,n||O(this,t,e,r,Math.pow(2,8*r),0);var i=1,a=0;for(this[e]=255&t;++a=0&&(a*=256);)this[e+i]=t/a&255;return e+r},a.prototype.writeUInt8=function(t,e,r){return t=+t,e=0|e,r||O(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e=0|e,r||O(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e=0|e,r||O(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e=0|e,r||O(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):N(this,t,e,!0),e+4},a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e=0|e,r||O(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e=0|e,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var a=0,o=1,s=0>t?1:0;for(this[e]=255&t;++a>0)-s&255;return e+r},a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e=0|e,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var a=r-1,o=1,s=0>t?1:0;for(this[e+a]=255&t;--a>=0&&(o*=256);)this[e+a]=(t/o>>0)-s&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e=0|e,r||O(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),0>t&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e=0|e,r||O(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e=0|e,r||O(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e=0|e,r||O(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):N(this,t,e,!0),e+4},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e=0|e,r||O(this,t,e,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},a.prototype.writeFloatLE=function(t,e,r){return F(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return F(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&r>n&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(0>e)throw new RangeError("targetStart out of bounds");if(0>r||r>=this.length)throw new RangeError("sourceStart out of bounds");if(0>n)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length), t.length-er&&n>e)for(i=o-1;i>=0;i--)t[i+e]=this[i+r];else if(1e3>o||!a.TYPED_ARRAY_SUPPORT)for(i=0;o>i;i++)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o},a.prototype.fill=function(t,e,r){if(t||(t=0),e||(e=0),r||(r=this.length),e>r)throw new RangeError("end < start");if(r!==e&&0!==this.length){if(0>e||e>=this.length)throw new RangeError("start out of bounds");if(0>r||r>this.length)throw new RangeError("end out of bounds");var n;if("number"==typeof t)for(n=e;r>n;n++)this[n]=t;else{var i=q(t.toString()),a=i.length;for(n=e;r>n;n++)this[n]=i[n%a]}return this}};var J=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":52,ieee754:53,isarray:54}],52:[function(t,e,r){"use strict";function n(){var t,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=e.length;for(t=0;r>t;t++)l[t]=e[t];for(t=0;r>t;++t)c[e.charCodeAt(t)]=t;c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63}function i(t){var e,r,n,i,a,o,s=t.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a="="===t[s-2]?2:"="===t[s-1]?1:0,o=new u(3*s/4-a),n=a>0?s-4:s;var l=0;for(e=0,r=0;n>e;e+=4,r+=3)i=c[t.charCodeAt(e)]<<18|c[t.charCodeAt(e+1)]<<12|c[t.charCodeAt(e+2)]<<6|c[t.charCodeAt(e+3)],o[l++]=(16711680&i)>>16,o[l++]=(65280&i)>>8,o[l++]=255&i;return 2===a?(i=c[t.charCodeAt(e)]<<2|c[t.charCodeAt(e+1)]>>4,o[l++]=255&i):1===a&&(i=c[t.charCodeAt(e)]<<10|c[t.charCodeAt(e+1)]<<4|c[t.charCodeAt(e+2)]>>2,o[l++]=i>>8&255,o[l++]=255&i),o}function a(t){return l[t>>18&63]+l[t>>12&63]+l[t>>6&63]+l[63&t]}function o(t,e,r){for(var n,i=[],o=e;r>o;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(a(n));return i.join("")}function s(t){for(var e,r=t.length,n=r%3,i="",a=[],s=16383,c=0,u=r-n;u>c;c+=s)a.push(o(t,c,c+s>u?u:c+s));return 1===n?(e=t[r-1],i+=l[e>>2],i+=l[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=l[e>>10],i+=l[e>>4&63],i+=l[e<<2&63],i+="="),a.push(i),a.join("")}r.toByteArray=i,r.fromByteArray=s;var l=[],c=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array;n()},{}],53:[function(t,e,r){r.read=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<>1,u=-7,f=r?i-1:0,h=r?-1:1,d=t[e+f];for(f+=h,a=d&(1<<-u)-1,d>>=-u,u+=s;u>0;a=256*a+t[e+f],f+=h,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+f],f+=h,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:(d?-1:1)*(1/0);o+=Math.pow(2,n),a-=c}return(d?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,g=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=u):(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>=u?(s=0,o=u):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,c-=8);t[r+d-p]|=128*g}},{}],54:[function(t,e,r){var n={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},{}],55:[function(t,e,r){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(t){return"function"==typeof t}function a(t){return"number"==typeof t}function o(t){return"object"==typeof t&&null!==t}function s(t){return void 0===t}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!a(t)||0>t||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,r,n,a,l,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;throw TypeError('Uncaught, unspecified "error" event.')}if(r=this._events[t],s(r))return!1;if(i(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),r.apply(this,a)}else if(o(r))for(a=Array.prototype.slice.call(arguments,1),c=r.slice(),n=c.length,l=0;n>l;l++)c[l].apply(this,a);return!0},n.prototype.addListener=function(t,e){var r;if(!i(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,i(e.listener)?e.listener:e),this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,o(this._events[t])&&!this._events[t].warned&&(r=s(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,r&&r>0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var n=!1;return r.listener=e,this.on(t,r),this},n.prototype.removeListener=function(t,e){var r,n,a,s;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],a=r.length,n=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(r)){for(s=a;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){n=s;break}if(0>n)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],i(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){var e;return e=this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],56:[function(t,e,r){function n(){u=!1,s.length?c=s.concat(c):f=-1,c.length&&i()}function i(){if(!u){var t=setTimeout(n);u=!0;for(var e=c.length;e;){for(s=c,c=[];++f1)for(var r=1;rs)){if(n>i){var l=n;n=i,i=l,l=o,o=s,s=l}e.isConstraint(n,i)||a(t[n],t[i],t[o],t[s])<0&&r.push(n,i)}}function i(t,e){for(var r=[],i=t.length,o=e.stars,s=0;i>s;++s)for(var l=o[s],c=1;cu||e.isConstraint(s,u))){for(var f=l[c-1],h=-1,d=1;dh||a(t[s],t[u],t[f],t[h])<0&&r.push(s,u)}}for(;r.length>0;){for(var u=r.pop(),s=r.pop(),f=-1,h=-1,l=o[s],p=1;pf||0>h||a(t[s],t[u],t[f],t[h])>=0||(e.flip(s,u),n(t,e,r,f,s,h),n(t,e,r,s,h,f),n(t,e,r,h,u,f),n(t,e,r,u,f,h))}}var a=t("robust-in-sphere")[4];t("binary-search-bounds");e.exports=i},{"binary-search-bounds":62,"robust-in-sphere":63}],59:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=i,this.next=a,this.boundary=o}function i(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}function a(t,e){for(var r=t.cells(),a=r.length,o=0;a>o;++o){var s=r[o],l=s[0],c=s[1],u=s[2];u>c?l>c&&(s[0]=c,s[1]=u,s[2]=l):l>u&&(s[0]=u,s[1]=l,s[2]=c)}r.sort(i);for(var f=new Array(a),o=0;oo;++o)for(var s=r[o],y=0;3>y;++y){var l=s[y],c=s[(y+1)%3],b=p[3*o+y]=m.locate(c,l,t.opposite(c,l)),x=g[3*o+y]=t.isConstraint(l,c);0>b&&(x?d.push(o):(h.push(o),f[o]=1),e&&v.push([c,l,-1]))}return m}function o(t,e,r){for(var n=0,i=0;i0||l.length>0;){for(;s.length>0;){var d=s.pop();if(c[d]!==-i){c[d]=i;for(var p=(u[d],0);3>p;++p){var g=h[3*d+p];g>=0&&0===c[g]&&(f[3*d+p]?l.push(g):(s.push(g),c[g]=i))}}}var v=l;l=s,s=v,l.length=0,i=-i}var m=o(u,c,e);return r?m.concat(n.boundary):m}var l=t("binary-search-bounds");e.exports=s;var c=n.prototype;c.locate=function(){var t=[0,0,0];return function(e,r,n){var a=e,o=r,s=n;return n>r?e>r&&(a=r,o=n,s=e):e>n&&(a=n,o=e,s=r),0>a?-1:(t[0]=a,t[1]=o,t[2]=s,l.eq(this.cells,t,i))}}()},{"binary-search-bounds":62}],60:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.a=t,this.b=e,this.idx=r,this.lowerIds=n,this.upperIds=i}function i(t,e,r,n){this.a=t,this.b=e,this.type=r,this.idx=n}function a(t,e){var r=t.a[0]-e.a[0]||t.a[1]-e.a[1]||t.type-e.type;return r?r:t.type!==p&&(r=d(t.a,t.b,e.b))?r:t.idx-e.idx}function o(t,e){return d(t.a,t.b,e)}function s(t,e,r,n,i){for(var a=h.lt(e,n,o),s=h.gt(e,n,o),l=a;s>l;++l){for(var c=e[l],u=c.lowerIds,f=u.length;f>1&&d(r[u[f-2]],r[u[f-1]],n)>0;)t.push([u[f-1],u[f-2],i]),f-=1;u.length=f,u.push(i);for(var p=c.upperIds,f=p.length;f>1&&d(r[p[f-2]],r[p[f-1]],n)<0;)t.push([p[f-2],p[f-1],i]),f-=1;p.length=f,p.push(i)}}function l(t,e){var r;return(r=t.a[0]f;++f)l.push(new i(t[f],null,p,f));for(var f=0;o>f;++f){var h=e[f],d=t[h[0]],m=t[h[1]];d[0]m[0]&&l.push(new i(m,d,v,f),new i(d,m,g,f))}l.sort(a);for(var y=l[0].a[0]-(1+Math.abs(l[0].a[0]))*Math.pow(2,-52),b=[new n([y,1],[y,0],-1,[],[],[],[])],x=[],f=0,_=l.length;_>f;++f){var w=l[f],k=w.type;k===p?s(x,b,t,w.a,w.idx):k===v?c(b,t,w):u(b,t,w)}return x}var h=t("binary-search-bounds"),d=t("robust-orientation")[3],p=0,g=1,v=2;e.exports=f},{"binary-search-bounds":62,"robust-orientation":259}],61:[function(t,e,r){"use strict";function n(t,e){this.stars=t,this.edges=e}function i(t,e,r){for(var n=1,i=t.length;i>n;n+=2)if(t[n-1]===e&&t[n]===r)return t[n-1]=t[i-2],t[n]=t[i-1],void(t.length=i-2)}function a(t,e){for(var r=new Array(t),i=0;t>i;++i)r[i]=[];return new n(r,e)}var o=t("binary-search-bounds");e.exports=a;var s=n.prototype;s.isConstraint=function(){function t(t,e){return t[0]-e[0]||t[1]-e[1]}var e=[0,0];return function(r,n){return e[0]=Math.min(r,n),e[1]=Math.max(r,n),o.eq(this.edges,e,t)>=0}}(),s.removeTriangle=function(t,e,r){var n=this.stars;i(n[t],e,r),i(n[e],r,t),i(n[r],t,e)},s.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},s.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;i>n;n+=2)if(r[n]===t)return r[n-1];return-1},s.flip=function(t,e){var r=this.opposite(t,e),n=this.opposite(e,t);this.removeTriangle(t,e,r),this.removeTriangle(e,t,n),this.addTriangle(t,n,r),this.addTriangle(e,r,n)},s.edges=function(){for(var t=this.stars,e=[],r=0,n=t.length;n>r;++r)for(var i=t[r],a=0,o=i.length;o>a;a+=2)e.push([i[a],i[a+1]]);return e},s.cells=function(){for(var t=this.stars,e=[],r=0,n=t.length;n>r;++r)for(var i=t[r],a=0,o=i.length;o>a;a+=2){var s=i[a],l=i[a+1];r>>1,x=a[m]"];return i?e.indexOf("c")<0?a.push(";if(x===y){return m}else if(x<=y){"):a.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):a.push(";if(",e,"){i=m;"),r?a.push("l=m+1}else{h=m-1}"):a.push("h=m-1}else{l=m+1}"),a.push("}"),i?a.push("return -1};"):a.push("return i};"),a.join("")}function i(t,e,r,i){var a=new Function([n("A","x"+t+"y",e,["y"],i),n("P","c(x,y)"+t+"0",e,["y","c"],i),"function dispatchBsearch",r,"(a,y,c,l,h){if(typeof(c)==='function'){return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c)}else{return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y)}}return dispatchBsearch",r].join(""));return a()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],63:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(t.length-1),n=1;nr;++r){e[r]=new Array(t);for(var n=0;t>n;++n)e[r][n]=["m",n,"[",t-r-2,"]"].join("")}return e}function a(t){if(1===t.length)return t[0];if(2===t.length)return["sum(",t[0],",",t[1],")"].join("");var e=t.length>>1;return["sum(",a(t.slice(0,e)),",",a(t.slice(e)),")"].join("")}function o(t,e){if("m"===t.charAt(0)){if("w"===e.charAt(0)){var r=t.split("[");return["w",e.substr(1),"m",r[0].substr(1)].join("")}return["prod(",t,",",e,")"].join("")}return o(e,t)}function s(t){return t&!0?"-":""}function l(t){if(2===t.length)return[["diff(",o(t[0][0],t[1][1]),",",o(t[1][0],t[0][1]),")"].join("")];for(var e=[],r=0;rn;++n)r.push(["prod(m",t,"[",n,"],m",t,"[",n,"])"].join(""));return a(r)}function u(t){for(var e=[],r=[],o=i(t),s=0;t>s;++s)o[0][s]="1",o[t-1][s]="w"+s;for(var s=0;t>s;++s)0===(1&s)?e.push.apply(e,l(n(o,s))):r.push.apply(r,l(n(o,s)));for(var u=a(e),f=a(r),h="exactInSphere"+t,d=[],s=0;t>s;++s)d.push("m"+s);for(var p=["function ",h,"(",d.join(),"){"],s=0;t>s;++s){p.push("var w",s,"=",c(s,t),";");for(var g=0;t>g;++g)g!==s&&p.push("var w",s,"m",g,"=scale(w",s,",m",g,"[0]);")}p.push("var p=",u,",n=",f,",d=diff(p,n);return d[d.length-1];}return ",h);var x=new Function("sum","diff","prod","scale",p.join(""));return x(m,y,v,b)}function f(){return 0}function h(){return 0}function d(){return 0}function p(t){var e=_[t.length];return e||(e=_[t.length]=u(t.length)),e.apply(void 0,t)}function g(){for(;_.length<=x;)_.push(u(_.length));for(var t=[],r=["slow"],n=0;x>=n;++n)t.push("a"+n),r.push("o"+n);for(var i=["function testInSphere(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"],n=2;x>=n;++n)i.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i=n;++n)e.exports[n]=_[n]}var v=t("two-product"),m=t("robust-sum"),y=t("robust-subtract"),b=t("robust-scale"),x=6,_=[f,h,d];g()},{"robust-scale":260,"robust-subtract":261,"robust-sum":262,"two-product":276}],64:[function(t,e,r){"use strict";function n(t){var e=x(t),r=b(y(e),t);return 0>r?[e,w(e,1/0)]:r>0?[w(e,-(1/0)),e]:[e,e]}function i(t,e){for(var r=new Array(e.length),n=0;n=t.length)return o[e-t.length];var r=t[e];return[y(r[0]),y(r[1])]}for(var o=[],s=0;s=0;--s){var g=n[s],c=g[0],v=e[c],m=v[0],x=v[1],w=t[m],A=t[x];if((w[0]-A[0]||w[1]-A[1])<0){var M=m;m=x,x=M}v[0]=m;var T,E=v[1]=g[1];for(i&&(T=v[2]);s>0&&n[s-1][0]===c;){var g=n[--s],L=g[1];i?e.push([E,L,T]):e.push([E,L]),E=L}i?e.push([E,x,T]):e.push([E,x])}return o}function c(t,e,r){for(var i=t.length+e.length,a=new g(i),o=r,s=0;ss;++s){var p=a.find(s);p===s?(d[s]=f,t[f++]=t[s]):(h=!1,d[s]=-1)}if(t.length=f,h)return null;for(var s=0;i>s;++s)d[s]<0&&(d[s]=d[a.find(s)]);return d}function u(t,e){return t[0]-e[0]||t[1]-e[1]}function f(t,e){var r=t[0]-e[0]||t[1]-e[1];return r?r:t[2]e[2]?1:0}function h(t,e,r){if(0!==t.length){if(e)for(var n=0;n0||d.length>0}function p(t,e,r){var n,i=!1;if(r){n=e;for(var a=new Array(e.length),o=0;o0?r=r.shln(f):0>f&&(u=u.shln(-f)),l(r,u)}var i=t("./is-rat"),a=t("./lib/is-bn"),o=t("./lib/num-to-bn"),s=t("./lib/str-to-bn"),l=t("./lib/rationalize"),c=t("./div");e.exports=n},{"./div":68,"./is-rat":70,"./lib/is-bn":74,"./lib/num-to-bn":75,"./lib/rationalize":76,"./lib/str-to-bn":77}],70:[function(t,e,r){"use strict";function n(t){return Array.isArray(t)&&2===t.length&&i(t[0])&&i(t[1])}var i=t("./lib/is-bn");e.exports=n},{"./lib/is-bn":74}],71:[function(t,e,r){"use strict";function n(t){return t.cmp(new i(0))}var i=t("bn.js");e.exports=n},{"bn.js":79}],72:[function(t,e,r){"use strict";function n(t){var e=t.length,r=t.words,n=0;if(1===e)n=r[0];else if(2===e)n=r[0]+67108864*r[1];else for(var n=0,i=0;e>i;i++){var a=r[i];n+=a*Math.pow(67108864,i)}return t.sign?-n:n}e.exports=n},{}],73:[function(t,e,r){"use strict";function n(t){var e=a(i.lo(t));if(32>e)return e;var r=a(i.hi(t));return r>20?52:r+32}var i=t("double-bits"),a=t("bit-twiddle").countTrailingZeros;e.exports=n},{"bit-twiddle":50,"double-bits":90}],74:[function(t,e,r){"use strict";function n(t){return t&&"object"==typeof t&&Boolean(t.words)}t("bn.js");e.exports=n},{"bn.js":79}],75:[function(t,e,r){"use strict";function n(t){var e=a.exponent(t);return 52>e?new i(t):new i(t*Math.pow(2,52-e)).shln(e-52)}var i=t("bn.js"),a=t("double-bits");e.exports=n},{"bn.js":79,"double-bits":90}],76:[function(t,e,r){"use strict";function n(t,e){var r=a(t),n=a(e);if(0===r)return[i(0),i(1)];if(0===n)return[i(0),i(0)];0>n&&(t=t.neg(),e=e.neg());var o=t.gcd(e);return o.cmpn(1)?[t.div(o),e.div(o)]:[t,e]}var i=t("./num-to-bn"),a=t("./bn-sign");e.exports=n},{"./bn-sign":71,"./num-to-bn":75}],77:[function(t,e,r){"use strict";function n(t){return new i(t)}var i=t("bn.js");e.exports=n},{"bn.js":79}],78:[function(t,e,r){"use strict";function n(t,e){return i(t[0].mul(e[0]),t[1].mul(e[1]))}var i=t("./lib/rationalize");e.exports=n},{"./lib/rationalize":76}],79:[function(t,e,r){!function(t,e){"use strict";function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function i(t,e,r){return null!==t&&"object"==typeof t&&Array.isArray(t.words)?t:(this.sign=!1,this.words=null,this.length=0,this.red=null,"le"!==e&&"be"!==e||(r=e,e=10),void(null!==t&&this._init(t||0,e||10,r||"be")))}function a(t,e,r){for(var n=0,i=Math.min(t.length,r),a=e;i>a;a++){var o=t.charCodeAt(a)-48;n<<=4,n|=o>=49&&54>=o?o-49+10:o>=17&&22>=o?o-17+10:15&o}return n}function o(t,e,r,n){for(var i=0,a=Math.min(t.length,r),o=e;a>o;o++){var s=t.charCodeAt(o)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}function s(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).ishln(this.n).isub(this.p),this.tmp=this._tmp()}function l(){s.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function c(){s.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function u(){s.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function f(){s.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function h(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else this.m=t,this.prime=null}function d(t){h.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).ishln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv.sign=!0,this.minv=this.minv.mod(this.r)}"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26,i.prototype._init=function(t,e,n){if("number"==typeof t)return this._initNumber(t,e,n);if("object"==typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&36>=e),t=t.toString().replace(/\s+/g,"");var i=0;"-"===t[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.sign=!0),this.strip(),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initNumber=function(t,e,n){0>t&&(this.sign=!0,t=-t),67108864>t?(this.words=[67108863&t],this.length=1):4503599627370496>t?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(9007199254740992>t),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initArray=function(t,e,n){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3){var s=t[i]|t[i-1]<<8|t[i-2]<<16;this.words[o]|=s<>>26-a&67108863,a+=24,a>=26&&(a-=26,o++)}else if("le"===n)for(var i=0,o=0;i>>26-a&67108863,a+=24,a>=26&&(a-=26,o++)}return this.strip()},i.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6){var o=a(t,r,r+6);this.words[i]|=o<>>26-n&4194303,n+=24,n>=26&&(n-=26,i++)}if(r+6!==e){var o=a(t,e,r+6);this.words[i]|=o<>>26-n&4194303}this.strip()},i.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;67108863>=i;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,s=a%n,l=Math.min(a,a-s)+r,c=0,u=r;l>u;u+=n)c=o(t,u,u+n,e),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==s){for(var f=1,c=o(t,u,t.length,e),u=0;s>u;u++)f*=e;this.imuln(f),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}},i.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.sign=!1),this},i.prototype.inspect=function(){return(this.red?""};var p=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],g=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],v=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(t,e){if(t=t||10,16===t||"hex"===t){for(var n="",i=0,e=0|e||1,a=0,o=0;o>>24-i&16777215,n=0!==a||o!==this.length-1?p[6-l.length]+l+n:l+n,i+=2,i>=26&&(i-=26,o--)}for(0!==a&&(n=a.toString(16)+n);n.length%e!==0;)n="0"+n;return this.sign&&(n="-"+n),n}if(t===(0|t)&&t>=2&&36>=t){var c=g[t],u=v[t],n="",f=this.clone();for(f.sign=!1;0!==f.cmpn(0);){var h=f.modn(u).toString(t);f=f.idivn(u),n=0!==f.cmpn(0)?p[c-h.length]+h+n:h+n}return 0===this.cmpn(0)&&(n="0"+n),this.sign&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toArray=function(t){this.strip();var e=new Array(this.byteLength());e[0]=0;var r=this.clone();if("le"!==t)for(var n=0;0!==r.cmpn(0);n++){var i=r.andln(255);r.ishrn(8),e[e.length-n-1]=i}else for(var n=0;0!==r.cmpn(0);n++){var i=r.andln(255);r.ishrn(8),e[n]=i}return e},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},i.prototype.bitLength=function(){var t=0,e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(0===this.cmpn(0))return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.iand=function(t){this.sign=this.sign&&t.sign;var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.ixor=function(t){this.sign=this.sign||t.sign;var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);for(var n=t/26|0,i=t%26;this.length<=n;)this.words[this.length++]=0;return e?this.words[n]=this.words[n]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a>>26}for(;0!==i&&a>>26}if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;at.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(t.sign){t.sign=!1;var e=this.iadd(t);return t.sign=!0,e._normSign()}if(this.sign)return this.sign=!1,this.iadd(t),this.sign=!0,this._normSign();var r=this.cmp(t);if(0===r)return this.sign=!1,this.length=1,this.words[0]=0,this;var n,i;r>0?(n=this,i=t):(n=t,i=this);for(var a=0,o=0;o>26,this.words[o]=67108863&e}for(;0!==a&&o>26,this.words[o]=67108863&e}if(0===a&&o>>26,a=67108863&r,o=Math.min(n,t.length-1),s=Math.max(0,n-this.length+1);o>=s;s++){var l=n-s,c=0|this.words[l],u=0|t.words[s],f=c*u,h=67108863&f;i=i+(f/67108864|0)|0,h=h+a|0,a=67108863&h,i=i+(h>>>26)|0}e.words[n]=a,r=i}return 0!==r?e.words[n]=r:e.length--,e.strip()},i.prototype._bigMulTo=function(t,e){e.sign=t.sign!==this.sign,e.length=this.length+t.length;for(var r=0,n=0,i=0;i=l;l++){var c=i-l,u=0|this.words[c],f=0|t.words[l],h=u*f,d=67108863&h;a=a+(h/67108864|0)|0,d=d+o|0,o=67108863&d,a=a+(d>>>26)|0,n+=a>>>26,a&=67108863}e.words[i]=o,r=a,a=n}return 0!==r?e.words[i]=r:e.length--,e.strip()},i.prototype.mulTo=function(t,e){var r;return r=this.length+t.length<63?this._smallMulTo(t,e):this._bigMulTo(t,e)},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.imul=function(t){if(0===this.cmpn(0)||0===t.cmpn(0))return this.words[0]=0,this.length=1,this;var e=this.length,r=t.length;this.sign=t.sign!==this.sign,this.length=this.length+t.length,this.words[this.length-1]=0;for(var n=this.length-2;n>=0;n--){for(var i=0,a=0,o=Math.min(n,r-1),s=Math.max(0,n-e+1);o>=s;s++){var l=n-s,c=this.words[l],u=t.words[s],f=c*u,h=67108863&f;i+=f/67108864|0,h+=a,a=67108863&h,i+=h>>>26}this.words[n]=a,this.words[n+1]+=i,i=0}for(var i=0,l=1;l>>26}return this.strip()},i.prototype.imuln=function(t){r("number"==typeof t);for(var e=0,n=0;n>=26,e+=i/67108864|0,e+=a>>>26,this.words[n]=67108863&a}return 0!==e&&(this.words[n]=e,this.length++),this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.mul(this)},i.prototype.ishln=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=67108863>>>26-e<<26-e;if(0!==e){for(var a=0,o=0;o>>26-e}a&&(this.words[o]=a,this.length++)}if(0!==n){for(var o=this.length-1;o>=0;o--)this.words[o+n]=this.words[o];for(var o=0;n>o;o++)this.words[o]=0;this.length+=n}return this.strip()},i.prototype.ishrn=function(t,e,n){r("number"==typeof t&&t>=0);var i;i=e?(e-e%26)/26:0;var a=t%26,o=Math.min((t-a)/26,this.length),s=67108863^67108863>>>a<c;c++)l.words[c]=this.words[c];l.length=o}if(0===o);else if(this.length>o){this.length-=o;for(var c=0;c=0&&(0!==u||c>=i);c--){var f=this.words[c];this.words[c]=u<<26-a|f>>>a,u=f&s}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip(),this},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=1<=0);var e=t%26,n=(t-e)/26;if(r(!this.sign,"imaskn works only with positive numbers"),0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var i=67108863^67108863>>>e<t?this.isubn(-t):this.sign?1===this.length&&this.words[0]=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(r("number"==typeof t),0>t)return this.iaddn(-t);if(this.sign)return this.sign=!1,this.iaddn(t),this.sign=!0,this;this.words[0]-=t;for(var e=0;e>26)-(c/67108864|0),this.words[i+n]=67108863&l}for(;i>26,this.words[i+n]=67108863&l}if(0===s)return this.strip();r(-1===s),s=0;for(var i=0;i>26,this.words[i]=67108863&l}return this.sign=!0,this.strip()},i.prototype._wordDiv=function(t,e){var r=this.length-t.length,n=this.clone(),a=t,o=a.words[a.length-1],s=this._countBits(o);r=26-s,0!==r&&(a=a.shln(r),n.ishln(r),o=a.words[a.length-1]);var l,c=n.length-a.length;if("mod"!==e){l=new i(null),l.length=c+1,l.words=new Array(l.length);for(var u=0;u=0;h--){var d=67108864*n.words[a.length+h]+n.words[a.length+h-1];for(d=Math.min(d/o|0,67108863),n._ishlnsubmul(a,d,h);n.sign;)d--,n.sign=!1,n._ishlnsubmul(a,1,h),0!==n.cmpn(0)&&(n.sign=!n.sign);l&&(l.words[h]=d)}return l&&l.strip(),n.strip(),"div"!==e&&0!==r&&n.ishrn(r),{div:l?l:null,mod:n}},i.prototype.divmod=function(t,e){if(r(0!==t.cmpn(0)),this.sign&&!t.sign){var n,a,o=this.neg().divmod(t,e);return"mod"!==e&&(n=o.div.neg()),"div"!==e&&(a=0===o.mod.cmpn(0)?o.mod:t.sub(o.mod)),{div:n,mod:a}}if(!this.sign&&t.sign){var n,o=this.divmod(t.neg(),e);return"mod"!==e&&(n=o.div.neg()),{div:n,mod:o.mod}}return this.sign&&t.sign?this.neg().divmod(t.neg(),e):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modn(t.words[0]))}:this._wordDiv(t,e)},i.prototype.div=function(t){return this.divmod(t,"div").div},i.prototype.mod=function(t){return this.divmod(t,"mod").mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(0===e.mod.cmpn(0))return e.div;var r=e.div.sign?e.mod.isub(t):e.mod,n=t.shrn(1),i=t.andln(1),a=r.cmp(n);return 0>a||1===i&&0===a?e.div:e.div.sign?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modn=function(t){r(67108863>=t);for(var e=(1<<26)%t,n=0,i=this.length-1;i>=0;i--)n=(e*n+this.words[i])%t;return n},i.prototype.idivn=function(t){r(67108863>=t);for(var e=0,n=this.length-1;n>=0;n--){var i=this.words[n]+67108864*e;this.words[n]=i/t|0,e=i%t}return this.strip()},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){r(!t.sign),r(0!==t.cmpn(0));var e=this,n=t.clone();e=e.sign?e.mod(t):e.clone();for(var a=new i(1),o=new i(0),s=new i(0),l=new i(1),c=0;e.isEven()&&n.isEven();)e.ishrn(1),n.ishrn(1),++c;for(var u=n.clone(),f=e.clone();0!==e.cmpn(0);){for(;e.isEven();)e.ishrn(1),a.isEven()&&o.isEven()?(a.ishrn(1),o.ishrn(1)):(a.iadd(u).ishrn(1),o.isub(f).ishrn(1));for(;n.isEven();)n.ishrn(1),s.isEven()&&l.isEven()?(s.ishrn(1),l.ishrn(1)):(s.iadd(u).ishrn(1),l.isub(f).ishrn(1));e.cmp(n)>=0?(e.isub(n),a.isub(s),o.isub(l)):(n.isub(e),s.isub(a),l.isub(o))}return{a:s,b:l,gcd:n.ishln(c)}},i.prototype._invmp=function(t){r(!t.sign),r(0!==t.cmpn(0));var e=this,n=t.clone();e=e.sign?e.mod(t):e.clone();for(var a=new i(1),o=new i(0),s=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(;e.isEven();)e.ishrn(1),a.isEven()?a.ishrn(1):a.iadd(s).ishrn(1);for(;n.isEven();)n.ishrn(1),o.isEven()?o.ishrn(1):o.iadd(s).ishrn(1);e.cmp(n)>=0?(e.isub(n),a.isub(o)):(n.isub(e),o.isub(a))}return 0===e.cmpn(1)?a:o},i.prototype.gcd=function(t){if(0===this.cmpn(0))return t.clone();if(0===t.cmpn(0))return this.clone();var e=this.clone(),r=t.clone();e.sign=!1,r.sign=!1;for(var n=0;e.isEven()&&r.isEven();n++)e.ishrn(1),r.ishrn(1);for(;;){for(;e.isEven();)e.ishrn(1);for(;r.isEven();)r.ishrn(1);var i=e.cmp(r);if(0>i){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.ishln(n)},i.prototype.invm=function(t){return this.egcd(t).a.mod(t)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,n=(t-e)/26,i=1<a;a++)this.words[a]=0;return this.words[n]|=i,this.length=n+1,this}for(var o=i,a=n;0!==o&&a>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.cmpn=function(t){var e=0>t;if(e&&(t=-t),this.sign&&!e)return-1;if(!this.sign&&e)return 1;t&=67108863,this.strip();var r;if(this.length>1)r=1;else{var n=this.words[0];r=n===t?0:t>n?-1:1}return this.sign&&(r=-r),r},i.prototype.cmp=function(t){if(this.sign&&!t.sign)return-1;if(!this.sign&&t.sign)return 1;var e=this.ucmp(t);return this.sign?-e:e},i.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length=0;r--){var n=this.words[r],i=t.words[r];if(n!==i){i>n?e=-1:n>i&&(e=1);break}}return e},i.red=function(t){return new h(t)},i.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(!this.sign,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};s.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},s.prototype.ireduce=function(t){var e,r=t;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),e=r.bitLength();while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},s.prototype.split=function(t,e){t.ishrn(this.n,0,e)},s.prototype.imulK=function(t){return t.imul(this.k)},n(l,s),l.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;n>i;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var a=t.words[9];e.words[e.length++]=a&r;for(var i=10;i>>22,a=o}t.words[i-10]=a>>>22,t.length-=9},l.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e,r=0,n=0;n>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function y(t){if(m[t])return m[t];var y;if("k256"===t)y=new l;else if("p224"===t)y=new c;else if("p192"===t)y=new u;else{if("p25519"!==t)throw new Error("Unknown prime "+t);y=new f}return m[t]=y,y},h.prototype._verify1=function(t){r(!t.sign,"red works only with positives"),r(t.red,"red works only with red numbers")},h.prototype._verify2=function(t,e){r(!t.sign&&!e.sign,"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},h.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.mod(this.m)._forceRed(this)},h.prototype.neg=function(t){var e=t.clone();return e.sign=!e.sign,e.iadd(this.m)._forceRed(this)},h.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},h.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},h.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},h.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},h.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.shln(e))},h.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},h.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},h.prototype.isqr=function(t){return this.imul(t,t)},h.prototype.sqr=function(t){return this.mul(t,t)},h.prototype.sqrt=function(t){if(0===t.cmpn(0))return t.clone();var e=this.m.andln(3);if(r(e%2===1),3===e){var n=this.m.add(new i(1)).ishrn(2),a=this.pow(t,n);return a}for(var o=this.m.subn(1),s=0;0!==o.cmpn(0)&&0===o.andln(1);)s++,o.ishrn(1);r(0!==o.cmpn(0));var l=new i(1).toRed(this),c=l.redNeg(),u=this.m.subn(1).ishrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,u).cmp(c);)f.redIAdd(c);for(var h=this.pow(f,o),a=this.pow(t,o.addn(1).ishrn(1)),d=this.pow(t,o),p=s;0!==d.cmp(l);){for(var g=d,v=0;0!==g.cmp(l);v++)g=g.redSqr();r(p>v);var m=this.pow(h,new i(1).ishln(p-v-1));a=a.redMul(m),h=m.redSqr(),d=d.redMul(h),p=v}return a},h.prototype.invm=function(t){var e=t._invmp(this.m);return e.sign?(e.sign=!1,this.imod(e).redNeg()):this.imod(e)},h.prototype.pow=function(t,e){var r=[];if(0===e.cmpn(0))return new i(1);for(var n=e.clone();0!==n.cmpn(0);)r.push(n.andln(1)),n.ishrn(1);for(var a=t,o=0;o=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},d.prototype.mul=function(t,e){if(0===t.cmpn(0)||0===e.cmpn(0))return new i(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).ishrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},d.prototype.invm=function(t){var e=this.imod(t._invmp(this.m).mul(this.r2));return e._forceRed(this)}}("undefined"==typeof e||e,this)},{}],80:[function(t,e,r){"use strict";function n(t){return i(t[0])*i(t[1])}var i=t("./lib/bn-sign");e.exports=n},{"./lib/bn-sign":71}],81:[function(t,e,r){"use strict";function n(t,e){return i(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}var i=t("./lib/rationalize");e.exports=n},{"./lib/rationalize":76}],82:[function(t,e,r){"use strict";function n(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var n=e.divmod(r),o=n.div,s=i(o),l=n.mod;if(0===l.cmpn(0))return s;if(s){var c=a(s)+4,u=i(l.shln(c).divRound(r));return 0>s&&(u=-u),s+u*Math.pow(2,-c)}var f=r.bitLength()-l.bitLength()+53,u=i(l.shln(f).divRound(r));return 1023>f?u*Math.pow(2,-f):(u*=Math.pow(2,-1023),u*Math.pow(2,1023-f))}var i=t("./lib/bn-to-num"),a=t("./lib/ctz");e.exports=n},{"./lib/bn-to-num":72,"./lib/ctz":73}],83:[function(t,e,r){"use strict";function n(t,e){for(var r=0;t>r;++r)if(!(e[r]<=e[r+t]))return!0;return!1}function i(t,e,r,i){for(var a=0,o=0,s=0,l=t.length;l>s;++s){var c=t[s];if(!n(e,c)){for(var u=0;2*e>u;++u)r[a++]=c[u];i[o++]=s}}return o}function a(t,e,r,n){var a=t.length,o=e.length;if(!(0>=a||0>=o)){var s=t[0].length>>>1;if(!(0>=s)){var l,c=f.mallocDouble(2*s*a),u=f.mallocInt32(a);if(a=i(t,s,c,u),a>0){if(1===s&&n)h.init(a),l=h.sweepComplete(s,r,0,a,c,u,0,a,c,u);else{var p=f.mallocDouble(2*s*o),g=f.mallocInt32(o);o=i(e,s,p,g),o>0&&(h.init(a+o),l=1===s?h.sweepBipartite(s,r,0,a,c,u,0,o,p,g):d(s,r,n,a,c,u,o,p,g),f.free(p),f.free(g))}f.free(c),f.free(u)}return l}}}function o(t,e){u.push([t,e])}function s(t){return u=[],a(t,t,o,!0),u}function l(t,e){return u=[],a(t,e,o,!1),u}function c(t,e,r){switch(arguments.length){case 1:return s(t);case 2:return"function"==typeof e?a(t,t,e,!0):l(t,e);case 3:return a(t,e,r,!1);default:throw new Error("box-intersect: Invalid arguments")}}e.exports=c;var u,f=t("typedarray-pool"),h=t("./lib/sweep"),d=t("./lib/intersect")},{"./lib/intersect":85,"./lib/sweep":89,"typedarray-pool":278}],84:[function(t,e,r){"use strict";function n(t,e,r){var n="bruteForce"+(t?"Red":"Blue")+(e?"Flip":"")+(r?"Full":""),i=["function ",n,"(",w.join(),"){","var ",c,"=2*",a,";"],l="for(var i="+u+","+p+"="+c+"*"+u+";i<"+f+";++i,"+p+"+="+c+"){var x0="+h+"["+o+"+"+p+"],x1="+h+"["+o+"+"+p+"+"+a+"],xi="+d+"[i];",k="for(var j="+g+","+b+"="+c+"*"+g+";j<"+v+";++j,"+b+"+="+c+"){var y0="+m+"["+o+"+"+b+"],"+(r?"y1="+m+"["+o+"+"+b+"+"+a+"],":"")+"yi="+y+"[j];";return t?i.push(l,_,":",k):i.push(k,_,":",l),r?i.push("if(y1"+v+"-"+g+"){"),t?(e(!0,!1),o.push("}else{"),e(!1,!1)):(o.push("if("+l+"){"),e(!0,!0),o.push("}else{"),e(!0,!1),o.push("}}else{if("+l+"){"),e(!1,!0),o.push("}else{"),e(!1,!1),o.push("}")),o.push("}}return "+r);var s=i.join("")+o.join(""),c=new Function(s);return c()}var a="d",o="ax",s="vv",l="fp",c="es",u="rs",f="re",h="rb",d="ri",p="rp",g="bs",v="be",m="bb",y="bi",b="bp",x="rv",_="Q",w=[a,o,s,u,f,h,d,g,v,m,y];r.partial=i(!1),r.full=i(!0)},{}],85:[function(t,e,r){"use strict";function n(t,e){var r=8*c.log2(e+1)*(t+1)|0,n=c.nextPow2(M*r);L.lengthS&&(l.free(S),S=l.mallocDouble(i))}function i(t,e,r,n,i,a,o,s,l){var c=M*t;L[c]=e,L[c+1]=r,L[c+2]=n,L[c+3]=i,L[c+4]=a,L[c+5]=o;var u=T*t;S[u]=s,S[u+1]=l}function a(t,e,r,n,i,a,o,s,l,c,u){var f=2*t,h=l*f,d=c[h+e];t:for(var p=i,g=i*f;a>p;++p,g+=f){var v=o[g+e],m=o[g+e+t];if(!(v>d||d>m||n&&d===v)){for(var y=s[p],b=e+1;t>b;++b){var v=o[g+b],m=o[g+b+t],x=c[h+b],_=c[h+b+t];if(x>m||v>_)continue t}var w;if(w=n?r(u,y):r(y,u),void 0!==w)return w}}}function o(t,e,r,n,i,a,o,s,l,c){var u=2*t,f=s*u,h=l[f+e];t:for(var d=n,p=n*u;i>d;++d,p+=u){var g=o[d];if(g!==c){var v=a[p+e],m=a[p+e+t];if(!(v>h||h>m)){for(var y=e+1;t>y;++y){var v=a[p+y],m=a[p+y+t],b=l[f+y],x=l[f+y+t];if(b>m||v>x)continue t}var _=r(g,c);if(void 0!==_)return _}}}}function s(t,e,r,s,l,c,u,g,E){n(t,s+u);var C,z=0,P=2*t;for(i(z++,0,0,s,0,u,r?16:0,-(1/0),1/0),r||i(z++,0,0,u,0,s,1,-(1/0),1/0);z>0;){z-=1;var R=z*M,O=L[R],I=L[R+1],N=L[R+2],j=L[R+3],F=L[R+4],D=L[R+5],B=z*T,U=S[B],V=S[B+1],q=1&D,H=!!(16&D),G=l,Y=c,X=g,W=E;if(q&&(G=g,Y=E,X=l,W=c),!(2&D&&(N=_(t,O,I,N,G,Y,V),I>=N)||4&D&&(I=w(t,O,I,N,G,Y,U),I>=N))){var Z=N-I,K=F-j;if(H){if(y>t*Z*(Z+K)){if(C=d.scanComplete(t,O,e,I,N,G,Y,j,F,X,W),void 0!==C)return C;continue}}else{if(t*Math.min(Z,K)t*Z*K){if(C=d.scanBipartite(t,O,e,q,I,N,G,Y,j,F,X,W),void 0!==C)return C;continue}}var $=b(t,O,I,N,G,Y,U,V);if($>I)if(v>t*($-I)){if(C=h(t,O+1,e,I,$,G,Y,j,F,X,W),void 0!==C)return C}else if(O===t-2){if(C=q?d.sweepBipartite(t,e,j,F,X,W,I,$,G,Y):d.sweepBipartite(t,e,I,$,G,Y,j,F,X,W),void 0!==C)return C}else i(z++,O+1,I,$,j,F,q,-(1/0),1/0),i(z++,O+1,j,F,I,$,1^q,-(1/0),1/0);if(N>$){var Q=p(t,O,j,F,X,W),J=X[P*Q+O],tt=x(t,O,Q,F,X,W,J);if(F>tt&&i(z++,O,$,N,tt,F,(4|q)+(H?16:0),J,V),Q>j&&i(z++,O,$,N,j,Q,(2|q)+(H?16:0),U,J),Q+1===tt){if(C=H?o(t,O,e,$,N,G,Y,Q,X,W[Q]):a(t,O,e,q,$,N,G,Y,Q,X,W[Q]),void 0!==C)return C}else if(tt>Q){var et;if(H){if(et=k(t,O,$,N,G,Y,J),et>$){var rt=x(t,O,$,et,G,Y,J);if(O===t-2){if(rt>$&&(C=d.sweepComplete(t,e,$,rt,G,Y,Q,tt,X,W),void 0!==C))return C;if(et>rt&&(C=d.sweepBipartite(t,e,rt,et,G,Y,Q,tt,X,W),void 0!==C))return C}else rt>$&&i(z++,O+1,$,rt,Q,tt,16,-(1/0),1/0),et>rt&&(i(z++,O+1,rt,et,Q,tt,0,-(1/0),1/0),i(z++,O+1,Q,tt,rt,et,1,-(1/0),1/0))}}else et=q?A(t,O,$,N,G,Y,J):k(t,O,$,N,G,Y,J),et>$&&(O===t-2?C=q?d.sweepBipartite(t,e,Q,tt,X,W,$,et,G,Y):d.sweepBipartite(t,e,$,et,G,Y,Q,tt,X,W):(i(z++,O+1,$,et,Q,tt,q,-(1/0),1/0),i(z++,O+1,Q,tt,$,et,1^q,-(1/0),1/0)))}}}}}e.exports=s;var l=t("typedarray-pool"),c=t("bit-twiddle"),u=t("./brute"),f=u.partial,h=u.full,d=t("./sweep"),p=t("./median"),g=t("./partition"),v=128,m=1<<22,y=1<<22,b=g("!(lo>=p0)&&!(p1>=hi)",["p0","p1"]),x=g("lo===p0",["p0"]),_=g("lol;++l,s+=o)for(var c=i[s],u=l,f=o*(l-1);u>r&&i[f+e]>c;--u,f-=o){for(var h=f,d=f+o,p=0;o>p;++p,++h,++d){var g=i[h];i[h]=i[d],i[d]=g}var v=a[u];a[u]=a[u-1],a[u-1]=v}}function i(t,e,r,i,a,l){if(r+1>=i)return r;for(var c=r,u=i,f=i+r>>>1,h=2*t,d=f,p=a[h*f+e];u>c;){if(s>u-c){n(t,e,c,u,a,l),p=a[h*f+e];break}var g=u-c,v=Math.random()*g+c|0,m=a[h*v+e],y=Math.random()*g+c|0,b=a[h*y+e],x=Math.random()*g+c|0,_=a[h*x+e];b>=m?_>=b?(d=y,p=b):m>=_?(d=v,p=m):(d=x,p=_):b>=_?(d=y,p=b):_>=m?(d=v,p=m):(d=x,p=_);for(var w=h*(u-1),k=h*d,A=0;h>A;++A,++w,++k){var M=a[w];a[w]=a[k],a[k]=M}var T=l[u-1];l[u-1]=l[d],l[d]=T,d=o(t,e,c,u-1,a,l,p);for(var w=h*(u-1),k=h*d,A=0;h>A;++A,++w,++k){var M=a[w];a[w]=a[k],a[k]=M}var T=l[u-1];if(l[u-1]=l[d],l[d]=T,d>f){for(u=d-1;u>c&&a[h*(u-1)+e]===p;)u-=1;u+=1}else{if(!(f>d))break;for(c=d+1;u>c&&a[h*c+e]===p;)c+=1}}return o(t,e,r,f,a,l,a[h*f+e])}e.exports=i;var a=t("./partition"),o=a("lo=0&&n.push("lo=e[k+n]"),t.indexOf("hi")>=0&&n.push("hi=e[k+o]"),r.push(i.replace("_",n.join()).replace("$",t)),Function.apply(void 0,r)}e.exports=n;var i="for(var j=2*a,k=j*c,l=k,m=c,n=b,o=a+b,p=c;d>p;++p,k+=j){var _;if($)if(m===p)m+=1,l+=j;else{for(var s=0;j>s;++s){var t=e[k+s];e[k+s]=e[l],e[l++]=t}var u=f[p];f[p]=f[m],f[m++]=u}}return m"},{}],88:[function(t,e,r){"use strict";function n(t,e){4*h>=e?i(0,e-1,t):f(0,e-1,t)}function i(t,e,r){for(var n=2*(t+1),i=t+1;e>=i;++i){for(var a=r[n++],o=r[n++],s=i,l=n-2;s-- >t;){var c=r[l-2],u=r[l-1];if(a>c)break;if(c===a&&o>u)break;r[l]=c,r[l+1]=u,l-=2}r[l]=a,r[l+1]=o}}function a(t,e,r){t*=2,e*=2;var n=r[t],i=r[t+1];r[t]=r[e],r[t+1]=r[e+1],r[e]=n,r[e+1]=i}function o(t,e,r){t*=2,e*=2,r[t]=r[e],r[t+1]=r[e+1]}function s(t,e,r,n){t*=2,e*=2,r*=2;var i=n[t],a=n[t+1];n[t]=n[e],n[t+1]=n[e+1],n[e]=n[r],n[e+1]=n[r+1],n[r]=i,n[r+1]=a}function l(t,e,r,n,i){t*=2,e*=2,i[t]=i[e],i[e]=r,i[t+1]=i[e+1],i[e+1]=n}function c(t,e,r){t*=2,e*=2;var n=r[t],i=r[e];return i>n?!1:n===i?r[t+1]>r[e+1]:!0}function u(t,e,r,n){t*=2;var i=n[t];return e>i?!0:i===e?n[t+1]>1,v=g-n,m=g+n,y=d,b=v,x=g,_=m,w=p,k=t+1,A=e-1,M=0;c(y,b,r)&&(M=y,y=b,b=M),c(_,w,r)&&(M=_,_=w,w=M),c(y,x,r)&&(M=y,y=x,x=M),c(b,x,r)&&(M=b,b=x,x=M),c(y,_,r)&&(M=y,y=_,_=M),c(x,_,r)&&(M=x,x=_,_=M),c(b,w,r)&&(M=b,b=w,w=M),c(b,x,r)&&(M=b,b=x,x=M),c(_,w,r)&&(M=_,_=w,w=M);for(var T=r[2*b],E=r[2*b+1],L=r[2*_],S=r[2*_+1],C=2*y,z=2*x,P=2*w,R=2*d,O=2*g,I=2*p,N=0;2>N;++N){var j=r[C+N],F=r[z+N],D=r[P+N];r[R+N]=j,r[O+N]=F,r[I+N]=D}o(v,t,r),o(m,e,r);for(var B=k;A>=B;++B)if(u(B,T,E,r))B!==k&&a(B,k,r),++k;else if(!u(B,L,S,r))for(;;){if(u(A,L,S,r)){u(A,T,E,r)?(s(B,k,A,r),++k,--A):(a(B,A,r),--A);break}if(--A=k-2-t?i(t,k-2,r):f(t,k-2,r),h>=e-(A+2)?i(A+2,e,r):f(A+2,e,r),h>=A-k?i(k,A,r):f(k,A,r)}e.exports=n;var h=32},{}],89:[function(t,e,r){"use strict";function n(t){var e=f.nextPow2(t);g.lengthk;++k){var A=s[k],M=b*k;_[p++]=o[M+x],_[p++]=-(A+1),_[p++]=o[M+w],_[p++]=A}for(var k=l;c>k;++k){var A=f[k]+d,T=b*k;_[p++]=u[T+x],_[p++]=-A,_[p++]=u[T+w],_[p++]=A}var E=p>>>1;h(_,E);for(var L=0,S=0,k=0;E>k;++k){var C=0|_[2*k+1];if(C>=d)C=C-d|0,i(m,y,S--,C);else if(C>=0)i(g,v,L--,C);else if(-d>=C){C=-C-d|0;for(var z=0;L>z;++z){var P=e(g[z],C);if(void 0!==P)return P}a(m,y,S++,C)}else{C=-C-1|0;for(var z=0;S>z;++z){var P=e(C,m[z]);if(void 0!==P)return P}a(g,v,L++,C)}}}function s(t,e,r,n,o,s,l,c,u,f){for(var d=0,p=2*t,w=t-1,k=p-1,A=r;n>A;++A){var M=s[A]+1<<1,T=p*A;_[d++]=o[T+w],_[d++]=-M,_[d++]=o[T+k],_[d++]=M}for(var A=l;c>A;++A){var M=f[A]+1<<1,E=p*A;_[d++]=u[E+w],_[d++]=1|-M,_[d++]=u[E+k],_[d++]=1|M}var L=d>>>1;h(_,L);for(var S=0,C=0,z=0,A=0;L>A;++A){var P=0|_[2*A+1],R=1&P;if(L-1>A&&P>>1===_[2*A+3]>>1&&(R=2,A+=1),0>P){for(var O=-(P>>1)-1,I=0;z>I;++I){var N=e(b[I],O);if(void 0!==N)return N}if(0!==R)for(var I=0;S>I;++I){var N=e(g[I],O);if(void 0!==N)return N}if(1!==R)for(var I=0;C>I;++I){var N=e(m[I],O);if(void 0!==N)return N}0===R?a(g,v,S++,O):1===R?a(m,y,C++,O):2===R&&a(b,x,z++,O)}else{var O=(P>>1)-1;0===R?i(g,v,S--,O):1===R?i(m,y,C--,O):2===R&&i(b,x,z--,O)}}}function l(t,e,r,n,o,s,l,c,u,f,p,m){var y=0,b=2*t,x=e,w=e+t,k=1,A=1;n?A=d:k=d;for(var M=o;s>M;++M){var T=M+k,E=b*M;_[y++]=l[E+x],_[y++]=-T,_[y++]=l[E+w],_[y++]=T}for(var M=u;f>M;++M){var T=M+A,L=b*M;_[y++]=p[L+x],_[y++]=-T}var S=y>>>1;h(_,S);for(var C=0,M=0;S>M;++M){var z=0|_[2*M+1];if(0>z){var T=-z,P=!1;if(T>=d?(P=!n,T-=d):(P=!!n,T-=1),P)a(g,v,C++,T);else{var R=m[T],O=b*T,I=p[O+e+1],N=p[O+e+1+t];t:for(var j=0;C>j;++j){var F=g[j],D=b*F;if(!(NB;++B)if(p[O+B+t]y;++y){var b=y+d,x=p*y;_[f++]=a[x+v],_[f++]=-b,_[f++]=a[x+m],_[f++]=b}for(var y=s;l>y;++y){var b=y+1,w=p*y;_[f++]=c[w+v],_[f++]=-b}var k=f>>>1;h(_,k);for(var A=0,y=0;k>y;++y){var M=0|_[2*y+1];if(0>M){var b=-M;if(b>=d)g[A++]=b-d;else{b-=1;var T=u[b],E=p*b,L=c[E+e+1],S=c[E+e+1+t];t:for(var C=0;A>C;++C){var z=g[C],P=o[z];if(P===T)break;var R=p*z;if(!(SO;++O)if(c[E+O+t]=0;--C)if(g[C]===b){for(var O=C+1;A>O;++O)g[O-1]=g[O];break}--A}}}e.exports={init:n,sweepBipartite:o,sweepComplete:s,scanBipartite:l,scanComplete:c};var u=t("typedarray-pool"),f=t("bit-twiddle"),h=t("./sort"),d=1<<28,p=1024,g=u.mallocInt32(p),v=u.mallocInt32(p),m=u.mallocInt32(p),y=u.mallocInt32(p),b=u.mallocInt32(p),x=u.mallocInt32(p),_=u.mallocDouble(8*p)},{"./sort":88,"bit-twiddle":50,"typedarray-pool":278}],90:[function(t,e,r){(function(t){function r(t,e){return d[0]=t,d[1]=e,h[0]}function n(t){return h[0]=t,d[0]}function i(t){return h[0]=t,d[1]}function a(t,e){return d[1]=t,d[0]=e,h[0]}function o(t){return h[0]=t,d[1]}function s(t){return h[0]=t,d[0]}function l(t,e){return p.writeUInt32LE(t,0,!0),p.writeUInt32LE(e,4,!0),p.readDoubleLE(0,!0)}function c(t){return p.writeDoubleLE(t,0,!0),p.readUInt32LE(0,!0)}function u(t){return p.writeDoubleLE(t,0,!0),p.readUInt32LE(4,!0)}var f=!1;if("undefined"!=typeof Float64Array){var h=new Float64Array(1),d=new Uint32Array(h.buffer);h[0]=1,f=!0,1072693248===d[1]?(e.exports=function(t){return h[0]=t,[d[0],d[1]]},e.exports.pack=r,e.exports.lo=n,e.exports.hi=i):1072693248===d[0]?(e.exports=function(t){return h[0]=t, @@ -19,26 +19,27 @@ var x,_;Array.isArray(o[0])?(x=o[e-1],_=o[e]):x=_=o,3===x.length&&(x=[x[0],x[1], return 0>y?0:y}var i=new Float64Array(4),a=new Float64Array(4),o=new Float64Array(4);e.exports=n},{}],154:[function(t,e,r){"use strict";function n(t){for(var e=t.length,r=0,n=0;e>n;++n)r=0|Math.max(r,t[n].length);return r-1}function i(t,e){for(var r=t.length,n=f.mallocUint8(r),i=0;r>i;++i)n[i]=t[i]o;++o)for(var s=t[o],e=s.length,l=0;e>l;++l)for(var c=0;l>c;++c){var d=s[c],p=s[l];i[a++]=0|Math.min(d,p),i[a++]=0|Math.max(d,p)}var g=a/2|0;h(u(i,[g,2]));for(var v=2,o=2;a>o;o+=2)i[o-2]===i[o]&&i[o-1]===i[o+1]||(i[v++]=i[o],i[v++]=i[o+1]);return u(i,[v/2|0,2])}function o(t,e,r,n){for(var i=t.data,a=t.shape[0],o=f.mallocDouble(a),s=0,l=0;a>l;++l){var c=i[2*l],h=i[2*l+1];if(r[c]!==r[h]){var d=e[c],p=e[h];i[2*s]=c,i[2*s+1]=h,o[s++]=(p-n)/(p-d)}}return t.shape[0]=s,u(o,[s])}function s(t,e){var r=f.mallocInt32(2*e),n=t.shape[0],i=t.data;r[0]=0;for(var a=0,o=0;n>o;++o){var s=i[2*o];if(s!==a){for(r[2*a+1]=o;++ai;++i)n[i]=[r[2*i],r[2*i+1]];return n}function c(t,e,r,c){r=r||0,"undefined"==typeof c&&(c=n(t));var u=t.length;if(0===u||1>c)return{cells:[],vertexIds:[],vertexWeights:[]};var h=i(e,+r),p=a(t,c),g=o(p,e,h,+r),v=s(p,0|e.length),m=d(c)(t,p.data,v,h),y=l(p),b=[].slice.call(g.data,0,g.shape[0]);return f.free(h),f.free(p.data),f.free(g.data),f.free(v),{cells:m,vertexIds:y,vertexWeights:b}}e.exports=c;var u=t("ndarray"),f=t("typedarray-pool"),h=t("ndarray-sort"),d=t("./lib/codegen")},{"./lib/codegen":155,ndarray:253,"ndarray-sort":158,"typedarray-pool":278}],155:[function(t,e,r){"use strict";function n(t){function e(t){if(!(t.length<=0)){c.push("R.push(");for(var e=0;e0&&c.push(","),c.push("[");for(var n=0;n0&&c.push(","),c.push("B(C,E,c[",i[0],"],c[",i[1],"])")}c.push("]")}c.push(");")}}var r=0,n=new Array(t+1);n[0]=[[]];for(var i=1;t>=i;++i)for(var s=n[i]=o(i),l=0;l>1,v=E[2*m+1];","if(v===b){return m}","if(b1;--i){t+1>i&&c.push("else "),c.push("if(l===",i,"){");for(var u=[],l=0;i>l;++l)u.push("(S[c["+l+"]]<<"+l+")");c.push("var M=",u.join("+"),";if(M===0||M===",(1<i;++i)n[i]=0,i===e&&(n[i]+=.5),i===r&&(n[i]+=.5);return n}function i(t,e){if(0===e||e===(1<=a;++a)if(e&1<=s;++s)~e&1<n;++n)r[n]=i(t,n);return r}e.exports=a;var o=t("convex-hull")},{"convex-hull":102}],157:[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;t>r;++r)e.push("s"+r);for(var r=0;t>r;++r)e.push("n"+r);for(var r=1;t>r;++r)e.push("d"+r);for(var r=1;t>r;++r)e.push("e"+r);for(var r=1;t>r;++r)e.push("f"+r);return e}function a(t,e){function r(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function a(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}var o=["'use strict'"],s=["ndarrayInsertionSort",t.join("d"),e].join(""),l=["left","right","data","offset"].concat(i(t.length)),c=n(e),u=["i,j,cptr,ptr=left*s0+offset"];if(t.length>1){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,"left){","dptr=0","sptr=cptr-s0");for(var h=1;hb){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,"left)&&("+r("cptr-s0")+">scratch)){",a("cptr",r("cptr-s0")),"cptr-=s0","}",a("cptr","scratch"));if(o.push("}"),t.length>1&&c&&o.push("free(scratch)"),o.push("} return "+s),c){var p=new Function("malloc","free",o.join("\n"));return p(c[0],c[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 u(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 f(){t.length>1&&A&&_.push("free(pivot1)","free(pivot2)")}function h(e,r){var n="el"+e,i="el"+r;if(t.length>1){var s="__l"+ ++M;u(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"+ ++M;u(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 g(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 v(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 m(t,e){g(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,")<=",c,"){\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",++M,":while(true){"].join("")),l([e],!0,["if(",o("ptr0"),"!==pivot",r,"[pivot_ptr]){break __l",M,"}"].join("")),_.push(n,"}")):_.push(["while(",o(a(e)),"===pivot",r,"){",n,"}"].join(""))}var _=["'use strict'"],w=["ndarrayQuickSort",t.join("d"),e].join(""),k=["left","right","data","offset"].concat(i(t.length)),A=n(e),M=0;_.push(["function ",w,"(",k.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 E=[],L=1;LL;++L)T.push("b_ptr"+L);T.push("ptr3","ptr4","ptr5","ptr6","ptr7","pivot_ptr","ptr_shift","elementSize="+E.join("*")),A?T.push("pivot1=malloc(elementSize)","pivot2=malloc(elementSize)"):T.push("pivot1=new Array(elementSize),pivot2=new Array(elementSize)")}else T.push("pivot1","pivot2");if(_.push("var "+T.join(",")),h(1,2),h(4,5),h(1,3),h(2,3),h(1,4),h(3,4),h(2,5),h(2,3),h(4,5),t.length>1?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){"),g("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){"),v("k","less","great"),_.push("break"),_.push("}else{"),m("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){"),g("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){"),g("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&&A){var S=new Function("insertionSort","malloc","free",_.join("\n"));return S(r,A[0],A[1])}var S=new Function("insertionSort",_.join("\n"));return S(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"],u=0;u0?l.push(["d",v,"=s",v,"-d",p,"*n",p].join("")):l.push(["d",v,"=s",v].join("")),p=v);var d=t.length-1-u;0!==d&&(g>0?l.push(["e",d,"=s",d,"-e",g,"*n",g,",f",d,"=",f[d],"-f",g,"*n",g].join("")):l.push(["e",d,"=s",d,",f",d,"=",f[d]].join("")),g=d)}r.push("var "+l.join(","));var m=["0","n0-1","data","offset"].concat(i(t.length));r.push(["if(n0<=",c,"){","insertionSort(",m.join(","),")}else{","quickSort(",m.join(","),")}"].join("")),r.push("}return "+n);var y=new Function("insertionSort","quickSort",r.join("\n")),b=a(t,e),x=o(t,e,b);return y(b,x)}var l=t("typedarray-pool"),c=32;e.exports=s},{"typedarray-pool":278}],158:[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":157}],159:[function(t,e,r){"use strict";function n(t,e,r){this.plot=t,this.vbo=e,this.shader=r}function i(t){var e=t.gl,r=a(e,[0,0,0,1,1,0,1,1]),i=o(e,s.boxVert,s.lineFrag);return new n(t,r,i)}e.exports=i;var a=t("gl-buffer"),o=t("gl-shader"),s=t("./shaders"),l=n.prototype;l.bind=function(){var t=this.shader;this.vbo.bind(),this.shader.bind(),t.attributes.coord.pointer(),t.uniforms.screenBox=this.plot.screenBox},l.drawBox=function(){var t=[0,0],e=[0,0];return function(r,n,i,a,o){var s=this.plot,l=this.shader,c=s.gl;t[0]=r,t[1]=n,e[0]=i,e[1]=a,l.uniforms.lo=t,l.uniforms.hi=e,l.uniforms.color=o,c.drawArrays(c.TRIANGLE_STRIP,0,4)}}(),l.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{"./shaders":162,"gl-buffer":118,"gl-shader":197}],160:[function(t,e,r){"use strict";function n(t,e,r,n){this.plot=t,this.vbo=e,this.shader=r,this.tickShader=n,this.ticks=[[],[]]}function i(t,e){return t-e}function a(t){var e=t.gl,r=o(e),i=s(e,c.gridVert,c.gridFrag),a=s(e,c.tickVert,c.gridFrag),l=new n(t,r,i,a);return l}e.exports=a;var o=t("gl-buffer"),s=t("gl-shader"),l=t("binary-search-bounds"),c=t("./shaders"),u=n.prototype;u.draw=function(){var t=[0,0],e=[0,0],r=[0,0];return function(){for(var n=this.plot,i=this.vbo,a=this.shader,o=this.ticks,s=n.gl,l=n._tickBounds,c=n.dataBox,u=n.viewBox,f=n.gridLineWidth,h=n.gridLineColor,d=n.gridLineEnable,p=n.pixelRatio,g=0;2>g;++g){var v=l[g],m=l[g+2],y=m-v,b=.5*(c[g+2]+c[g]),x=c[g+2]-c[g];e[g]=2*y/x,t[g]=2*(v-b)/x}a.bind(),i.bind(),a.attributes.dataCoord.pointer(),a.uniforms.dataShift=t,a.uniforms.dataScale=e;for(var _=0,g=0;2>g;++g){r[0]=r[1]=0,r[g]=1,a.uniforms.dataAxis=r,a.uniforms.lineWidth=f[g]/(u[g+2]-u[g])*p,a.uniforms.color=h[g];var w=6*o[g].length;d[g]&&w&&s.drawArrays(s.TRIANGLES,_,w),_+=w}}}(),u.drawTickMarks=function(){var t=[0,0],e=[0,0],r=[1,0],n=[0,1],a=[0,0],o=[0,0];return function(){for(var s=this.plot,c=this.vbo,u=this.tickShader,f=this.ticks,h=s.gl,d=s._tickBounds,p=s.dataBox,g=s.viewBox,v=s.pixelRatio,m=s.screenBox,y=m[2]-m[0],b=m[3]-m[1],x=g[2]-g[0],_=g[3]-g[1],w=0;2>w;++w){var k=d[w],A=d[w+2],M=A-k,T=.5*(p[w+2]+p[w]),E=p[w+2]-p[w];e[w]=2*M/E,t[w]=2*(k-T)/E}e[0]*=x/y,t[0]*=x/y,e[1]*=_/b,t[1]*=_/b,u.bind(),c.bind(),u.attributes.dataCoord.pointer();var L=u.uniforms;L.dataShift=t,L.dataScale=e;var S=s.tickMarkLength,C=s.tickMarkWidth,z=s.tickMarkColor,P=0,R=6*f[0].length,O=Math.min(l.ge(f[0],(p[0]-d[0])/(d[2]-d[0]),i),f[0].length),I=Math.min(l.gt(f[0],(p[2]-d[0])/(d[2]-d[0]),i),f[0].length),N=P+6*O,j=6*Math.max(0,I-O),F=Math.min(l.ge(f[1],(p[1]-d[1])/(d[3]-d[1]),i),f[1].length),D=Math.min(l.gt(f[1],(p[3]-d[1])/(d[3]-d[1]),i),f[1].length),B=R+6*F,U=6*Math.max(0,D-F);a[0]=2*(g[0]-S[1])/y-1,a[1]=(g[3]+g[1])/b-1,o[0]=S[1]*v/y,o[1]=C[1]*v/b,U&&(L.color=z[1],L.tickScale=o,L.dataAxis=n,L.screenOffset=a,h.drawArrays(h.TRIANGLES,B,U)),a[0]=(g[2]+g[0])/y-1,a[1]=2*(g[1]-S[0])/b-1,o[0]=C[0]*v/y,o[1]=S[0]*v/b,j&&(L.color=z[0],L.tickScale=o,L.dataAxis=r,L.screenOffset=a,h.drawArrays(h.TRIANGLES,N,j)),a[0]=2*(g[2]+S[3])/y-1,a[1]=(g[3]+g[1])/b-1,o[0]=S[3]*v/y,o[1]=C[3]*v/b,U&&(L.color=z[3],L.tickScale=o,L.dataAxis=n,L.screenOffset=a,h.drawArrays(h.TRIANGLES,B,U)),a[0]=(g[2]+g[0])/y-1,a[1]=2*(g[3]+S[2])/b-1,o[0]=C[2]*v/y,o[1]=S[2]*v/b,j&&(L.color=z[2],L.tickScale=o,L.dataAxis=r,L.screenOffset=a,h.drawArrays(h.TRIANGLES,N,j))}}(),u.update=function(){var t=[1,1,-1,-1,1,-1],e=[1,-1,1,1,-1,-1];return function(r){for(var n=r.ticks,i=r.bounds,a=new Float32Array(18*(n[0].length+n[1].length)),o=(this.plot.zeroLineEnable,0),s=[[],[]],l=0;2>l;++l)for(var c=s[l],u=n[l],f=i[l],h=i[l+2],d=0;dg;++g)a[o++]=p,a[o++]=t[g],a[o++]=e[g]}this.ticks=s,this.vbo.update(a)}}(),u.dispose=function(){this.vbo.dispose(),this.shader.dispose(),this.tickShader.dispose()}},{"./shaders":162,"binary-search-bounds":164,"gl-buffer":118,"gl-shader":197}],161:[function(t,e,r){"use strict";function n(t,e,r){this.plot=t,this.vbo=e,this.shader=r}function i(t){var e=t.gl,r=a(e,[-1,-1,-1,1,1,-1,1,1]),i=o(e,s.lineVert,s.lineFrag),l=new n(t,r,i);return l}e.exports=i;var a=t("gl-buffer"),o=t("gl-shader"),s=t("./shaders"),l=n.prototype;l.bind=function(){var t=this.shader;this.vbo.bind(),this.shader.bind(),t.attributes.coord.pointer(),t.uniforms.screenBox=this.plot.screenBox},l.drawLine=function(){var t=[0,0],e=[0,0];return function(r,n,i,a,o,s){var l=this.plot,c=this.shader,u=l.gl;t[0]=r,t[1]=n,e[0]=i,e[1]=a,c.uniforms.start=t,c.uniforms.end=e,c.uniforms.width=o*l.pixelRatio,c.uniforms.color=s,u.drawArrays(u.TRIANGLE_STRIP,0,4)}}(),l.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{"./shaders":162,"gl-buffer":118,"gl-shader":197}],162:[function(t,e,r){"use strict";var n="precision lowp float;\n#define GLSLIFY 1\nuniform vec4 color;\nvoid main() {\n gl_FragColor = vec4(color.xyz * color.w, color.w);\n}\n";e.exports={lineVert:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 coord;\n\nuniform vec4 screenBox;\nuniform vec2 start, end;\nuniform float width;\n\nvec2 perp(vec2 v) {\n return vec2(v.y, -v.x);\n}\n\nvec2 screen(vec2 v) {\n return 2.0 * (v - screenBox.xy) / (screenBox.zw - screenBox.xy) - 1.0;\n}\n\nvoid main() {\n vec2 delta = normalize(perp(start - end));\n vec2 offset = mix(start, end, 0.5 * (coord.y+1.0));\n gl_Position = vec4(screen(offset + 0.5 * width * delta * coord.x), 0, 1);\n}\n",lineFrag:n,textVert:"#define GLSLIFY 1\nattribute vec3 textCoordinate;\n\nuniform vec2 dataScale, dataShift, dataAxis, screenOffset, textScale;\nuniform float angle;\n\nvoid main() {\n float dataOffset = textCoordinate.z;\n vec2 glyphOffset = textCoordinate.xy;\n mat2 glyphMatrix = mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\n vec2 screenCoordinate = dataAxis * (dataScale * dataOffset + dataShift) +\n glyphMatrix * glyphOffset * textScale + screenOffset;\n gl_Position = vec4(screenCoordinate, 0, 1);\n}\n",textFrag:n,gridVert:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 dataCoord;\n\nuniform vec2 dataAxis, dataShift, dataScale;\nuniform float lineWidth;\n\nvoid main() {\n vec2 pos = dataAxis * (dataScale * dataCoord.x + dataShift);\n pos += 10.0 * dataCoord.y * vec2(dataAxis.y, -dataAxis.x) + dataCoord.z * lineWidth;\n gl_Position = vec4(pos, 0, 1);\n}\n",gridFrag:n,boxVert:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 coord;\n\nuniform vec4 screenBox;\nuniform vec2 lo, hi;\n\nvec2 screen(vec2 v) {\n return 2.0 * (v - screenBox.xy) / (screenBox.zw - screenBox.xy) - 1.0;\n}\n\nvoid main() {\n gl_Position = vec4(screen(mix(lo, hi, coord)), 0, 1);\n}\n",tickVert:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 dataCoord;\n\nuniform vec2 dataAxis, dataShift, dataScale, screenOffset, tickScale;\n\nvoid main() {\n vec2 pos = dataAxis * (dataScale * dataCoord.x + dataShift);\n gl_Position = vec4(pos + tickScale*dataCoord.yz + screenOffset, 0, 1);\n}\n"}},{}],163:[function(t,e,r){"use strict";function n(t,e,r){this.plot=t,this.vbo=e,this.shader=r,this.tickOffset=[[],[]],this.tickX=[[],[]],this.labelOffset=[0,0],this.labelCount=[0,0]}function i(t){var e=t.gl,r=a(e),i=o(e,c.textVert,c.textFrag),s=new n(t,r,i);return s}e.exports=i;var a=t("gl-buffer"),o=t("gl-shader"),s=t("text-cache"),l=t("binary-search-bounds"),c=t("./shaders"),u=n.prototype;u.drawTicks=function(){var t=[0,0],e=[0,0],r=[0,0];return function(n){var i=this.plot,a=this.shader,o=this.tickX[n],s=this.tickOffset[n],c=i.gl,u=i.viewBox,f=i.dataBox,h=i.screenBox,d=i.pixelRatio,p=i.tickEnable,g=i.tickPad,v=i.tickColor,m=i.tickAngle,y=(i.tickMarkLength,i.labelEnable),b=i.labelPad,x=i.labelColor,_=i.labelAngle,w=this.labelOffset[n],k=this.labelCount[n],A=l.lt(o,f[n]),M=l.le(o,f[n+2]);t[0]=t[1]=0,t[n]=1,e[n]=(u[2+n]+u[n])/(h[2+n]-h[n])-1;var T=2/h[2+(1^n)]-h[1^n];e[1^n]=T*u[1^n]-1,p[n]&&(e[1^n]-=T*d*g[n],M>A&&s[M]>s[A]&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=v[n],a.uniforms.angle=m[n],c.drawArrays(c.TRIANGLES,s[A],s[M]-s[A]))),y[n]&&k&&(e[1^n]-=T*d*b[n],a.uniforms.dataAxis=r,a.uniforms.screenOffset=e,a.uniforms.color=x[n],a.uniforms.angle=_[n],c.drawArrays(c.TRIANGLES,w,k)),e[1^n]=T*u[2+(1^n)]-1,p[n+2]&&(e[1^n]+=T*d*g[n+2],M>A&&s[M]>s[A]&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=v[n+2],a.uniforms.angle=m[n+2],c.drawArrays(c.TRIANGLES,s[A],s[M]-s[A]))),y[n+2]&&k&&(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],c.drawArrays(c.TRIANGLES,w,k))}}(),u.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,o=r.titleCenter,c=r.pixelRatio;if(this.titleCount){for(var u=0;2>u;++u)e[u]=2*(o[u]*c-a[u])/(a[2+u]-a[u])-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)}}}(),u.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 c=0;2>c;++c){var u=a[c],f=a[c+2],h=f-u,d=.5*(o[c+2]+o[c]),p=o[c+2]-o[c],g=l[c],v=l[c+2],m=v-g,y=s[c],b=s[c+2],x=b-y;e[c]=2*h/p*m/x,t[c]=2*(u-d)/p*m/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()}}(),u.update=function(t){for(var e=[],r=t.ticks,n=t.bounds,i=0;2>i;++i){for(var a=[Math.floor(e.length/3)],o=[-(1/0)],l=r[i],c=0;ci;++i){this.labelOffset[i]=Math.floor(e.length/3);for(var g=s(t.labelFont[i],t.labels[i]).data,p=t.labelSize[i],c=0;cp;++p)if(f[p]&&n[p]<=0&&n[p+2]>=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;pp;++p)s.drawTicks(p);this.titleEnable&&s.drawTitle();for(var b=this.overlays,p=0;pc;++c){var u=s[c].slice(0);0!==u.length&&(u.sort(a),l[c]=Math.min(l[c],u[0].x),l[c+2]=Math.max(l[c+2],u[u.length-1].x))}this.grid.update({bounds:l,ticks:s}),this.text.update({bounds:l,ticks:s,labels:t.labels||["x","y"],labelSize:t.labelSize||[12,12],labelFont:t.labelFont||["sans-serif","sans-serif"],title:t.title||"",titleSize:t.titleSize||18,titleFont:t.titleFont||"sans-serif"}),this.setDirty()},h.dispose=function(){this.box.dispose(),this.grid.dispose(),this.text.dispose(),this.line.dispose();for(var t=this.objects.length-1;t>=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;rh;++h)o=o&&l[h]===s[h],l[h]=s[h];var d=t.clientWidth===u&&t.clientHeight===f;return u=t.clientWidth,f=t.clientHeight,o?!d:(c=Math.exp(n.computedRadius[0]),!0)},lookAt:function(t,e,r){n.lookAt(n.lastT(),t,e,r)},rotate:function(t,e,r){n.rotate(n.lastT(),t,e,r)},pan:function(t,e,r){n.pan(n.lastT(),t,e,r)},translate:function(t,e,r){n.translate(n.lastT(),t,e,r)}};Object.defineProperties(h,{matrix:{get:function(){return n.computedMatrix},set:function(t){return n.setMatrix(n.lastT(),t),n.computedMatrix},enumerable:!0},mode:{get:function(){return n.getMode()},set:function(t){return n.setMode(t),n.getMode()},enumerable:!0},center:{get:function(){return n.computedCenter},set:function(t){return n.lookAt(n.lastT(),t),n.computedCenter},enumerable:!0},eye:{get:function(){return n.computedEye},set:function(t){return n.lookAt(n.lastT(),null,t),n.computedEye},enumerable:!0},up:{get:function(){return n.computedUp},set:function(t){return n.lookAt(n.lastT(),null,null,t),n.computedUp},enumerable:!0},distance:{get:function(){return c},set:function(t){return n.setDistance(n.lastT(),t),t},enumerable:!0},distanceLimits:{get:function(){return n.getDistanceLimits(r)},set:function(t){return n.setDistanceLimits(t),t},enumerable:!0}}),t.addEventListener("contextmenu",function(t){return t.preventDefault(),!1});var d=0,p=0;return o(t,function(e,r,a,o){var s=1/t.clientHeight,l=s*(r-d),u=s*(a-p),f=h.flipX?1:-1,g=h.flipY?1:-1,v=Math.PI*h.rotateSpeed,m=i();if(1&e)o.shift?n.rotate(m,0,0,-l*v):n.rotate(m,f*v*l,-g*v*u,0);else if(2&e)n.pan(m,-h.translateSpeed*l*c,h.translateSpeed*u*c,0);else if(4&e){var y=h.zoomSpeed*u/window.innerHeight*(m-n.lastT())*50;n.pan(m,0,0,c*(Math.exp(y)-1))}d=r,p=a}),s(t,function(t,e,r){var a=h.flipX?1:-1,o=h.flipY?1:-1,s=i();if(Math.abs(t)>Math.abs(e))n.rotate(s,0,0,-t*a*Math.PI*h.rotateSpeed/window.innerWidth);else{var l=h.zoomSpeed*o*e/window.innerHeight*(s-n.lastT())/100;n.pan(s,0,0,c*(Math.exp(l)-1))}},!0),h}e.exports=n;var i=t("right-now"),a=t("3d-view"),o=t("mouse-change"),s=t("mouse-wheel")},{"3d-view":39,"mouse-change":241,"mouse-wheel":245,"right-now":255}],168:[function(t,e,r){!function(){"use strict";function t(e){e.permitHostObjects___&&e.permitHostObjects___(t)}function r(t){return!(t.substr(0,d.length)==d&&"___"===t.substr(t.length-3))}function n(t){if(t!==Object(t))throw new TypeError("Not an object: "+t);var e=t[p];if(e&&e.key===t)return e;if(h(t)){e={key:t};try{return f(t,p,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(r){return}}}function i(t){return t.prototype=null,Object.freeze(t)}function a(){y||"undefined"==typeof console||(y=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}if("undefined"==typeof ses||!ses.ok||ses.ok()){"undefined"!=typeof ses&&(ses.weakMapPermitHostObjects=t);var o=!1;if("function"==typeof WeakMap){var s=WeakMap;if("undefined"!=typeof navigator&&/Firefox/.test(navigator.userAgent));else{var l=new s,c=Object.freeze({});if(l.set(c,1),1===l.get(c))return void(e.exports=WeakMap);o=!0}}var u=(Object.prototype.hasOwnProperty,Object.getOwnPropertyNames),f=Object.defineProperty,h=Object.isExtensible,d="weakmap:",p=d+"ident:"+Math.random()+"___";if("undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues&&"function"==typeof ArrayBuffer&&"function"==typeof Uint8Array){var g=new ArrayBuffer(25),v=new Uint8Array(g);crypto.getRandomValues(v),p=d+"rand:"+Array.prototype.map.call(v,function(t){return(t%36).toString(36)}).join("")+"___"}if(f(Object,"getOwnPropertyNames",{value:function(t){return u(t).filter(r)}}),"getPropertyNames"in Object){var m=Object.getPropertyNames;f(Object,"getPropertyNames",{value:function(t){return m(t).filter(r)}})}!function(){var t=Object.freeze;f(Object,"freeze",{value:function(e){return n(e),t(e)}});var e=Object.seal;f(Object,"seal",{value:function(t){return n(t),e(t)}});var r=Object.preventExtensions;f(Object,"preventExtensions",{value:function(t){return n(t),r(t)}})}();var y=!1,b=0,x=function(){function t(t,e){var r,i=n(t);return i?c in i?i[c]:e:(r=s.indexOf(t),r>=0?l[r]:e)}function e(t){var e=n(t);return e?c in e:s.indexOf(t)>=0}function r(t,e){var r,i=n(t);return i?i[c]=e:(r=s.indexOf(t),r>=0?l[r]=e:(r=s.length,l[r]=e,s[r]=t)),this}function o(t){var e,r,i=n(t);return i?c in i&&delete i[c]:(e=s.indexOf(t),0>e?!1:(r=s.length-1,s[e]=void 0,l[e]=l[r],s[e]=s[r],s.length=r,l.length=r,!0))}this instanceof x||a();var s=[],l=[],c=b++;return Object.create(x.prototype,{get___:{value:i(t)},has___:{value:i(e)},set___:{value:i(r)},delete___:{value:i(o)}})};x.prototype=Object.create(Object.prototype,{get:{value:function(t,e){return this.get___(t,e)},writable:!0,configurable:!0},has:{value:function(t){return this.has___(t)},writable:!0,configurable:!0},set:{value:function(t,e){return this.set___(t,e)},writable:!0,configurable:!0},"delete":{value:function(t){return this.delete___(t)},writable:!0,configurable:!0}}),"function"==typeof s?!function(){function r(){function e(t,e){return u?c.has(t)?c.get(t):u.get___(t,e):c.get(t,e)}function r(t){return c.has(t)||(u?u.has___(t):!1)}function n(t){var e=!!c.delete(t);return u?u.delete___(t)||e:e}this instanceof x||a();var l,c=new s,u=void 0,f=!1;return l=o?function(t,e){return c.set(t,e),c.has(t)||(u||(u=new x),u.set(t,e)),this}:function(t,e){if(f)try{c.set(t,e)}catch(r){u||(u=new x),u.set___(t,e)}else c.set(t,e);return this},Object.create(x.prototype,{get___:{value:i(e)},has___:{value:i(r)},set___:{value:i(l)},delete___:{value:i(n)},permitHostObjects___:{value:i(function(e){if(e!==t)throw new Error("bogus call to permitHostObjects___");f=!0})}})}o&&"undefined"!=typeof Proxy&&(Proxy=void 0),r.prototype=x.prototype,e.exports=r,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),e.exports=x)}}()},{}],169:[function(t,e,r){"use strict";function n(t){var e=s.get(t);if(!e||!t.isBuffer(e._triangleBuffer.buffer)){var r=a(t,new Float32Array([-1,-1,-1,4,4,-1]));e=o(t,[{buffer:r,type:t.FLOAT,size:2}]),e._triangleBuffer=r,s.set(t,e)}e.bind(),t.drawArrays(t.TRIANGLES,0,3),e.unbind()}var i="undefined"==typeof WeakMap?t("weak-map"):WeakMap,a=t("gl-buffer"),o=t("gl-vao"),s=new i;e.exports=n},{"gl-buffer":118,"gl-vao":226,"weak-map":168}],170:[function(t,e,r){"use strict";function n(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function i(t){this.gl=t,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont="sans-serif",this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=u(t)}function a(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}function o(t,e,r,n,i){for(var a=t.primalOffset,o=t.primalMinor,s=t.mirrorOffset,l=t.mirrorMinor,c=n[e],u=0;3>u;++u)if(e!==u){var f=a,h=s,d=o,p=l;c&1<0?(d[u]=-1,p[u]=0):(d[u]=0,p[u]=1)}}function s(t,e){var r=new i(t);return r.update(e),r}e.exports=s;var l=t("./lib/text.js"),c=t("./lib/lines.js"),u=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;3>s;++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,u=!1;if("bounds"in t)for(var f=t.bounds,d=0;2>d;++d)for(var p=0;3>p;++p)f[d][p]!==this.bounds[d][p]&&(u=!0),this.bounds[d][p]=f[d][p];if("ticks"in t){r=t.ticks,s=!0,this.autoTicks=!1;for(var d=0;3>d;++d)this.tickSpacing[d]=0}else n("tickSpacing")&&(this.autoTicks=!0,u=!0);if(this._firstInit&&("ticks"in t||"tickSpacing"in t||(this.autoTicks=!0),u=!0,s=!0,this._firstInit=!1),u&&this.autoTicks&&(r=h.create(this.bounds,this.tickSpacing),s=!0),s){for(var d=0;3>d;++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=c(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),c=l.cubeEdges,u=l.axis,h=i[12],p=i[13],_=i[14],w=i[15],k=this.pixelRatio*(a[3]*h+a[7]*p+a[11]*_+a[15]*w)/e.drawingBufferHeight,A=0;3>A;++A)this.lastCubeProps.cubeEdges[A]=c[A],this.lastCubeProps.axis[A]=u[A];for(var M=g,A=0;3>A;++A)o(g[A],A,this.bounds,c,u);for(var e=this.gl,T=v,A=0;3>A;++A)this.backgroundEnable[A]?T[A]=u[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;3>A;++A){var E=[0,0,0];u[A]>0?E[A]=s[1][A]:E[A]=s[0][A];for(var L=0;2>L;++L){var S=(A+1+L)%3,C=(A+1+(1^L))%3;this.gridEnable[S]&&this._lines.drawGrid(S,C,this.bounds,E,this.gridColor[S],this.gridWidth[S]*this.pixelRatio)}for(var L=0;2>L;++L){var S=(A+1+L)%3,C=(A+1+(1^L))%3;this.zeroEnable[C]&&s[0][C]<=0&&s[1][C]>=0&&this._lines.drawZero(S,C,this.bounds,E,this.zeroLineColor[C],this.zeroLineWidth[C]*this.pixelRatio)}}for(var A=0;3>A;++A){this.lineEnable[A]&&this._lines.drawAxisLine(A,this.bounds,M[A].primalOffset,this.lineColor[A],this.lineWidth[A]*this.pixelRatio),this.lineMirror[A]&&this._lines.drawAxisLine(A,this.bounds,M[A].mirrorOffset,this.lineColor[A],this.lineWidth[A]*this.pixelRatio);for(var z=n(y,M[A].primalMinor),P=n(b,M[A].mirrorMinor),R=this.lineTickLength,L=0;3>L;++L){var O=k/r[5*L];z[L]*=R[L]*O,P[L]*=R[L]*O}this.lineTickEnable[A]&&this._lines.drawAxisTicks(A,M[A].primalOffset,z,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio),this.lineTickMirror[A]&&this._lines.drawAxisTicks(A,M[A].mirrorOffset,P,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio)}this._text.bind(r,i,a,this.pixelRatio);for(var A=0;3>A;++A){for(var I=M[A].primalMinor,N=n(x,M[A].primalOffset),L=0;3>L;++L)this.lineTickEnable[A]&&(N[L]+=k*I[L]*Math.max(this.lineTickLength[L],0)/r[5*L]);if(this.tickEnable[A]){for(var L=0;3>L;++L)N[L]+=k*I[L]*this.tickPad[L]/r[5*L];this._text.drawTicks(A,this.tickSize[A],this.tickAngle[A],N,this.tickColor[A])}if(this.labelEnable[A]){for(var L=0;3>L;++L)N[L]+=k*I[L]*this.labelPad[L]/r[5*L];N[A]+=.5*(s[0][A]+s[1][A]),this._text.drawLabel(A,this.labelSize[A],this.labelAngle[A],N,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":171,"./lib/cube.js":172,"./lib/lines.js":173,"./lib/text.js":175,"./lib/ticks.js":176}],171:[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;3>l;++l)for(var c=(l+1)%3,u=(l+2)%3,f=[0,0,0],h=[0,0,0],d=-1;1>=d;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;1>=p;p+=2){f[c]=p;for(var g=-1;1>=g;g+=2)f[u]=g,e.push(f[0],f[1],f[2],h[0],h[1],h[2]),i+=1}var v=c;c=u,u=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;3>s;++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":174,"gl-buffer":118,"gl-vao":226}],172:[function(t,e,r){"use strict";function n(t,e,r){for(var n=0;4>n;++n){t[n]=r[12+n];for(var i=0;3>i;++i)t[n]+=e[i]*r[4*i+n]}}function i(t){for(var e=0;eg;++g){d[2]=a[g][2];for(var b=0;2>b;++b){d[1]=a[b][1];for(var x=0;2>x;++x)d[0]=a[x][0],n(f[l],d,u),l+=1}}for(var _=-1,g=0;8>g;++g){for(var w=f[g][3],k=0;3>k;++k)h[g][k]=f[g][k]/w;0>w&&(0>_?_=g:h[g][2]_){_=0;for(var A=0;3>A;++A){for(var M=(A+2)%3,T=(A+1)%3,E=-1,L=-1,S=0;2>S;++S){var C=S<E||0>L)L>E&&(_|=1<S;++S){var C=S<E&&(_|=1<g;++g)g!==_&&g!==O&&(0>I?I=g:h[I][1]>h[g][1]&&(I=g));for(var N=-1,g=0;3>g;++g){var j=I^1<N&&(N=j);var T=h[j];T[0]g;++g){var j=I^1<F&&(F=j);var T=h[j];T[0]>h[F][0]&&(F=j)}}var D=v;D[0]=D[1]=D[2]=0,D[o.log2(N^I)]=I&N,D[o.log2(I^F)]=I&F;var B=7^F;B===_||B===O?(B=7^N,D[o.log2(F^B)]=B&F):D[o.log2(N^B)]=B&N;for(var U=m,V=_,A=0;3>A;++A)V&1<t;++t)f[t]=[1,1,1,1],h[t]=[1,1,1]}();var g=[[0,0,1,0,0],[0,0,-1,1,0],[0,-1,0,1,0],[0,1,0,1,0],[-1,0,0,1,0],[1,0,0,1,0]],v=[1,1,1],m=[0,0,0],y={cubeEdges:v,axis:m}},{"bit-twiddle":50,"gl-mat4/invert":137,"gl-mat4/multiply":139,"robust-orientation":259,"split-polygon":178}],173:[function(t,e,r){"use strict";function n(t){return t[0]=t[1]=t[2]=0,t}function i(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function a(t,e,r,n,i,a,o,s){this.gl=t,this.vertBuffer=e,this.vao=r,this.shader=n,this.tickCount=i,this.tickOffset=a,this.gridCount=o,this.gridOffset=s}function o(t,e,r){var n=[],i=[0,0,0],o=[0,0,0],u=[0,0,0],f=[0,0,0];n.push(0,0,1,0,1,1,0,0,-1,0,0,-1,0,1,1,0,1,-1);for(var h=0;3>h;++h){for(var d=n.length/3|0,p=0;ph;++h)for(var p=u[h],g=2;g>=0;--g){var v=c[p[g]];s.push(l*v[0],-l*v[1],t)}}for(var s=(this.gl,[]),l=[0,0,0],c=[0,0,0],u=[0,0,0],d=[0,0,0],p=0;3>p;++p){u[p]=s.length/h|0,o(.5*(t[0][p]+t[1][p]),e[p],r),d[p]=(s.length/h|0)-u[p],l[p]=s.length/h|0;for(var g=0;g=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,c=o%a;0>o?(l=0|-Math.ceil(l),c=0|-c):(l=0|Math.floor(l),c=0|c);var u=""+l;if(0>o&&(u="-"+u),i){for(var f=""+c;f.lengthi;++i){for(var a=[],o=(.5*(t[0][i]+t[1][i]),0);o*e[i]<=t[1][i];++o)a.push({x:o*e[i],text:n(e[i],o)});for(var o=-1;o*e[i]>=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;3>r;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;na?a=0:a>1&&(a=1);for(var o=1-a,s=t.length,l=new Array(s),c=0;s>c;++c)l[c]=a*t[c]+o*r[c];return l}function a(t,e){for(var r=[],a=[],o=n(t[t.length-1],e),s=t[t.length-1],l=t[0],c=0;co&&u>0||o>0&&0>u){var f=i(s,u,l,o);r.push(f),a.push(f.slice())}0>u?a.push(l.slice()):u>0?r.push(l.slice()):(r.push(l.slice()),a.push(l.slice())),o=u}return{positive:r,negative:a}}function o(t,e){for(var r=[],a=n(t[t.length-1],e),o=t[t.length-1],s=t[0],l=0;la&&c>0||a>0&&0>c)&&r.push(i(o,c,s,a)),c>=0&&r.push(s.slice()),a=c}return r}function s(t,e){for(var r=[],a=n(t[t.length-1],e),o=t[t.length-1],s=t[0],l=0;la&&c>0||a>0&&0>c)&&r.push(i(o,c,s,a)),0>=c&&r.push(s.slice()),a=c}return r}var l=t("robust-dot-product"),c=t("robust-sum");e.exports=a,e.exports.positive=o,e.exports.negative=s},{"robust-dot-product":179,"robust-sum":262}],179:[function(t,e,r){"use strict";function n(t,e){for(var r=i(t[0],e[0]),n=1;na;++a){for(var o=p,s=g,l=0;3>l;++l)s[l]=o[l]=r[l];s[3]=o[3]=1,s[a]+=1,f(s,s,e),s[3]<0&&(t[a]=1/0),o[a]-=1,f(o,o,e),o[3]<0&&(t[a]=1/0);var c=(o[0]/o[3]-s[0]/s[3])*n,u=(o[1]/o[3]-s[1]/s[3])*i;t[a]=.25*Math.sqrt(c*c+u*u)}return t}function a(t,e,r,n,a){var f=e.model||h,p=e.view||h,g=e.projection||h,y=t.bounds,a=a||l(f,p,g,y),b=a.axis;a.edges;c(d,p,f),c(d,g,d);for(var x=v,_=0;3>_;++_)x[_].lo=1/0,x[_].hi=-(1/0),x[_].pixelsPerDataUnit=1/0;var w=o(u(d,d));u(d,d);for(var k=0;3>k;++k){var A=(k+1)%3,M=(k+2)%3,T=m;t:for(var _=0;2>_;++_){var E=[];if(b[k]<0!=!!_){T[k]=y[_][k];for(var L=0;2>L;++L){T[A]=y[L^_][A];for(var S=0;2>S;++S)T[M]=y[S^L^_][M],E.push(T.slice())}for(var L=0;LS;++S)x[S].lo=Math.min(x[S].lo,M[S]),x[S].hi=Math.max(x[S].hi,M[S]),S!==k&&(x[S].pixelsPerDataUnit=Math.min(x[S].pixelsPerDataUnit,Math.abs(C[S])))}}}return x}e.exports=a;var o=t("extract-frustum-planes"),s=t("split-polygon"),l=t("./lib/cube.js"),c=t("gl-mat4/multiply"),u=t("gl-mat4/transpose"),f=t("gl-vec4/transformMat4"),h=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),d=new Float32Array(16),p=[0,0,0,1],g=[0,0,0,1],v=[new n(1/0,-(1/0),1/0),new n(1/0,-(1/0),1/0),new n(1/0,-(1/0),1/0)],m=[0,0,0]},{"./lib/cube.js":172,"extract-frustum-planes":177,"gl-mat4/multiply":139,"gl-mat4/transpose":147,"gl-vec4/transformMat4":227,"split-polygon":178}],181:[function(t,e,r){"use strict";var n=t("gl-shader"),i="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",a="precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}"; e.exports=function(t){return n(t,i,a,null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},{"gl-shader":197}],182:[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),c=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}]),u=s(t);u.attributes.position.location=0,u.attributes.color.location=1,u.attributes.weight.location=2;var f=new n(t,l,c,u);return f.update(e),f}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],c=n.prototype,u=[0,0,0],f=[0,0,0],h=[0,0];c.isTransparent=function(){return!1},c.drawTransparent=function(t){},c.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 c=u,d=f,p=0;3>p;++p)i&&i[p]<0?(c[p]=this.bounds[0][p],d[p]=this.bounds[1][p]):(c[p]=this.bounds[1][p],d[p]=this.bounds[0][p]);h[0]=e.drawingBufferWidth,h[1]=e.drawingBufferHeight,n.uniforms.model=a,n.uniforms.view=o,n.uniforms.projection=s,n.uniforms.coordinates=[this.position,c,d],n.uniforms.colors=this.colors,n.uniforms.screenShape=h;for(var p=0;3>p;++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()},c.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))},c.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders/index":181,"gl-buffer":118,"gl-vao":226}],183:[function(t,e,r){"use strict";function n(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function i(t,e){var r=null;try{r=t.getContext("webgl",e),r||(r=t.getContext("experimental-webgl",e))}catch(n){return null}return r}function a(t){var e=Math.round(Math.log(Math.abs(t))/Math.log(10));if(0>e){var r=Math.round(Math.pow(10,-e));return Math.ceil(t*r)/r}if(e>0){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:!0}function s(t){function e(){if(!_&&H.autoResize){var t=w.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*H.pixelRatio),i=0|Math.ceil(r*H.pixelRatio);if(n!==w.width||i!==w.height){w.width=n,w.height=i;var a=w.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=O.length,e=j.length,r=0;e>r;++r)N[r]=0;t:for(var r=0;t>r;++r){var n=O[r],i=n.pickSlots;if(i){for(var a=0;e>a;++a)if(N[a]+i<255){I[r]=a,n.setPickBase(N[a]+1),N[a]+=i;continue t}var o=h(A,q);I[r]=e,j.push(o),N.push(i),n.setPickBase(1),e+=1}else I[r]=-1}for(;e>0&&0===N[e-1];)N.pop(),j.pop().dispose()}function s(){return H.contextLost?!0:void(A.isContextLost()&&(H.contextLost=!0,H.mouseListener.enabled=!1,H.selection.object=null,H.oncontextloss&&H.oncontextloss()))}function y(){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;e>r;++r){var n=j[r];n.shape=G,n.begin();for(var i=0;t>i;++i)if(I[i]===r){var a=O[i];a.drawPick&&(a.pixelRatio=1,a.drawPick(V))}n.end()}}}function b(){if(!s()){e();var t=H.camera.tick();V.view=H.camera.matrix,F=F||t,D=D||t,z.pixelRatio=H.pixelRatio,R.pixelRatio=H.pixelRatio;var r=O.length,n=W[0],i=W[1];n[0]=n[1]=n[2]=1/0,i[0]=i[1]=i[2]=-(1/0);for(var o=0;r>o;++o){var l=O[o];l.pixelRatio=H.pixelRatio,l.axes=H.axes,F=F||!!l.dirty,D=D||!!l.dirty;var c=l.bounds;if(c)for(var f=c[0],h=c[1],d=0;3>d;++d)n[d]=Math.min(n[d],f[d]),i[d]=Math.max(i[d],h[d])}var g=H.bounds;if(H.autoBounds)for(var d=0;3>d;++d){if(i[d]d;++d)b=b||Z[0][d]!==g[0][d]||Z[1][d]!==g[1][d],Z[0][d]=g[0][d],Z[1][d]=g[1][d];if(b){for(var x=[0,0,0],o=0;3>o;++o)x[o]=a((g[1][o]-g[0][o])/10);z.autoTicks?z.update({bounds:g,tickSpacing:x}):z.update({bounds:g})}D=D||b,F=F||b;var _=A.drawingBufferWidth,w=A.drawingBufferHeight;q[0]=_,q[1]=w,G[0]=0|Math.max(_/H.pixelRatio,1),G[1]=0|Math.max(w/H.pixelRatio,1),v(B,H.fovy,_/w,H.zNear,H.zFar);for(var o=0;16>o;++o)U[o]=0;U[15]=1;for(var k=0,o=0;3>o;++o)k=Math.max(k,g[1][o]-g[0][o]);for(var o=0;3>o;++o)H.autoScale?U[5*o]=H.aspect[o]/(g[1][o]-g[0][o]):U[5*o]=1/k,H.autoCenter&&(U[12+o]=.5*-U[5*o]*(g[0][o]+g[1][o]));for(var o=0;r>o;++o){var l=O[o];l.axesBounds=g,H.clipToBounds&&(l.clipBounds=g)}if(T.object&&(H.snapToData?R.position=T.dataCoordinate:R.position=T.dataPosition,R.bounds=g),D&&(D=!1,y()),F){H.axesPixels=u(H.axes,V,_,w),H.onrender&&H.onrender(),A.bindFramebuffer(A.FRAMEBUFFER,null),A.viewport(0,0,_,w);var M=H.clearColor;A.clearColor(M[0],M[1],M[2],M[3]),A.clear(A.COLOR_BUFFER_BIT|A.DEPTH_BUFFER_BIT),A.depthMask(!0),A.colorMask(!0,!0,!0,!0),A.enable(A.DEPTH_TEST),A.depthFunc(A.LEQUAL),A.disable(A.BLEND),A.disable(A.CULL_FACE);var S=!1;z.enable&&(S=S||z.isTransparent(),z.draw(V)),R.axes=z,T.object&&R.draw(V),A.disable(A.CULL_FACE);for(var o=0;r>o;++o){var l=O[o];l.axes=z,l.pixelRatio=H.pixelRatio,l.isOpaque&&l.isOpaque()&&l.draw(V),l.isTransparent&&l.isTransparent()&&(S=!0)}if(S){E.shape=q,E.bind(),A.clear(A.DEPTH_BUFFER_BIT),A.colorMask(!1,!1,!1,!1),A.depthMask(!0),A.depthFunc(A.LESS),z.enable&&z.isTransparent()&&z.drawTransparent(V);for(var o=0;r>o;++o){var l=O[o];l.isOpaque&&l.isOpaque()&&l.draw(V)}A.enable(A.BLEND),A.blendEquation(A.FUNC_ADD),A.blendFunc(A.ONE,A.ONE_MINUS_SRC_ALPHA),A.colorMask(!0,!0,!0,!0),A.depthMask(!1),A.clearColor(0,0,0,0),A.clear(A.COLOR_BUFFER_BIT),z.isTransparent()&&z.drawTransparent(V);for(var o=0;r>o;++o){var l=O[o];l.isTransparent&&l.isTransparent()&&l.drawTransparent(V)}A.bindFramebuffer(A.FRAMEBUFFER,null),A.blendFunc(A.ONE,A.ONE_MINUS_SRC_ALPHA),A.disable(A.DEPTH_TEST),L.bind(),E.color[0].bind(0),L.uniforms.accumBuffer=0,p(A),A.disable(A.BLEND)}F=!1;for(var o=0;r>o;++o)O[o].dirty=!1}}}function x(){_||H.contextLost||(requestAnimationFrame(x),b())}t=t||{};var _=!1,w=(t.pixelRatio||parseFloat(window.devicePixelRatio),t.canvas);if(!w)if(w=document.createElement("canvas"),t.container){var k=t.container;k.appendChild(w)}else document.body.appendChild(w);var A=t.gl;if(A||(A=i(w,t.glOptions||{premultipliedAlpha:!0,antialias:!0})),!A)throw new Error("webgl not supported");var M=t.bounds||[[-10,-10,-10],[10,10,10]],T=new n,E=d(A,[A.drawingBufferWidth,A.drawingBufferHeight],{preferFloat:!0}),L=m(A),S=t.camera||{eye:[2,0,0],center:[0,0,0],up:[0,1,0],zoomMin:.1,zoomMax:100,mode:"turntable"},C=t.axes||{},z=c(A,C);z.enable=!C.disable;var P=t.spikes||{},R=f(A,P),O=[],I=[],N=[],j=[],F=!0,D=!0,B=new Array(16),U=new Array(16),V={view:null,projection:B,model:U},D=!0,q=[A.drawingBufferWidth,A.drawingBufferHeight],H={gl:A,contextLost:!1,pixelRatio:t.pixelRatio||parseFloat(window.devicePixelRatio),canvas:w,selection:T,camera:l(w,S),axes:z,axesPixels:null,spikes:R,bounds:M,objects:O,shape:q,aspect:t.aspectRatio||[1,1,1],pickRadius:t.pickRadius||10,zNear:t.zNear||.01,zFar:t.zFar||1e3,fovy:t.fovy||Math.PI/4,clearColor:t.clearColor||[0,0,0,0],autoResize:o(t.autoResize),autoBounds:o(t.autoBounds),autoScale:!!t.autoScale,autoCenter:o(t.autoCenter),clipToBounds:o(t.clipToBounds),snapToData:!!t.snapToData,onselect:t.onselect||null,onrender:t.onrender||null,onclick:t.onclick||null,cameraParams:V,oncontextloss:null,mouseListener:null},G=[A.drawingBufferWidth/H.pixelRatio|0,A.drawingBufferHeight/H.pixelRatio|0];H.autoResize&&e(),window.addEventListener("resize",e),H.update=function(t){_||(t=t||{},F=!0,D=!0)},H.add=function(t){_||(t.axes=z,O.push(t),I.push(-1),F=!0,D=!0,r())},H.remove=function(t){if(!_){var e=O.indexOf(t);0>e||(O.splice(e,1),I.pop(),F=!0,D=!0,r())}},H.dispose=function(){if(!_&&(_=!0,window.removeEventListener("resize",e),w.removeEventListener("webglcontextlost",s),H.mouseListener.enabled=!1,!H.contextLost)){z.dispose(),R.dispose();for(var t=0;ts;++s){var l=j[s].query(e,G[1]-r-1,H.pickRadius);if(l){if(l.distance>T.distance)continue;for(var c=0;i>c;++c){var u=O[c];if(I[c]===s){var f=u.pick(l);f&&(T.buttons=t,T.screen=l.coord,T.distance=l.distance,T.object=u,T.index=f.distance,T.dataPosition=f.position,T.dataCoordinate=f.dataCoordinate,T.data=f,o=!0)}}}}}a&&a!==T.object&&(a.highlight&&a.highlight(null),F=!0),T.object&&(T.object.highlight&&T.object.highlight(T.data),F=!0),o=o||T.object!==a,o&&H.onselect&&H.onselect(T),1&t&&!(1&X)&&H.onclick&&H.onclick(T),X=t}}),w.addEventListener("webglcontextlost",s);var W=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],Z=[W[0].slice(),W[1].slice()];return x(),H.redraw=function(){_||(F=!0,b())},H}e.exports=s;var l=t("3d-view-controls"),c=t("gl-axes3d"),u=t("gl-axes3d/properties"),f=t("gl-spikes3d"),h=t("gl-select-static"),d=t("gl-fbo"),p=t("a-big-triangle"),g=t("mouse-change"),v=t("gl-mat4/perspective"),m=t("./lib/shader")},{"./lib/shader":166,"3d-view-controls":167,"a-big-triangle":169,"gl-axes3d":170,"gl-axes3d/properties":180,"gl-fbo":123,"gl-mat4/perspective":140,"gl-select-static":196,"gl-spikes3d":182,"mouse-change":241}],184:[function(t,e,r){"use strict";e.exports={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\nattribute vec2 offset;\nattribute vec4 color;\n\nuniform mat3 viewTransform;\nuniform vec2 pixelScale;\n\nvarying vec4 fragColor;\n\nvec4 computePosition_1_0(vec2 position, vec2 offset, mat3 view, vec2 scale) {\n vec3 xposition = view * vec3(position, 1.0);\n return vec4(\n xposition.xy + scale * offset * xposition.z,\n 0,\n xposition.z);\n}\n\n\n\n\nvoid main() {\n fragColor = color;\n\n gl_Position = computePosition_1_0(\n position,\n offset,\n viewTransform,\n pixelScale);\n}\n",fragment:"precision lowp float;\n#define GLSLIFY 1\nvarying vec4 fragColor;\nvoid main() {\n gl_FragColor = vec4(fragColor.rgb * fragColor.a, fragColor.a);\n}\n",pickVertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\nattribute vec2 offset;\nattribute vec4 id;\n\nuniform mat3 viewTransform;\nuniform vec2 pixelScale;\nuniform vec4 pickOffset;\n\nvarying vec4 fragColor;\n\nvec4 computePosition_1_0(vec2 position, vec2 offset, mat3 view, vec2 scale) {\n vec3 xposition = view * vec3(position, 1.0);\n return vec4(\n xposition.xy + scale * offset * xposition.z,\n 0,\n xposition.z);\n}\n\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_Position = computePosition_1_0(\n position,\n offset,\n viewTransform,\n pixelScale);\n}\n",pickFragment:"precision lowp float;\n#define GLSLIFY 1\nvarying vec4 fragColor;\nvoid main() {\n gl_FragColor = fragColor;\n}\n"}},{}],185:[function(t,e,r){"use strict";function n(t){if(t in h)return h[t];var e=u(t,{polygons:!0,font:"sans-serif",textAlign:"left",textBaseline:"alphabetic"}),r=[],n=[];e.forEach(function(t){t.forEach(function(t){for(var e=0;eo;++o)i[o]=Math.min(i[o],r[a+o]),i[2+o]=Math.max(i[2+o],r[a+o]);return h[t]={coords:r,normals:n,bounds:i}}function i(t,e,r,n,i,a,o){this.plot=t,this.shader=e,this.pickShader=r,this.positionBuffer=n,this.offsetBuffer=i,this.colorBuffer=a,this.idBuffer=o,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.numPoints=0,this.numVertices=0,this.pickOffset=0,this.points=null}function a(t,e){var r=t.gl,n=o(r,f.vertex,f.fragment),a=o(r,f.pickVertex,f.pickFragment),l=s(r),c=s(r),u=s(r),h=s(r),d=new i(t,n,a,l,c,u,h);return d.update(e),t.addObject(d),d}e.exports=a;var o=t("gl-shader"),s=t("gl-buffer"),l=t("text-cache"),c=t("typedarray-pool"),u=t("vectorize-text"),f=t("./lib/shaders"),h={},d=i.prototype;!function(){function t(){var t=this.plot,n=this.bounds,i=t.viewBox,a=t.dataBox,o=t.pixelRatio,s=n[2]-n[0],l=n[3]-n[1],c=a[2]-a[0],u=a[3]-a[1];e[0]=2*s/c,e[4]=2*l/u,e[6]=2*(n[0]-a[0])/c-1,e[7]=2*(n[1]-a[1])/u-1;var f=i[2]-i[0],h=i[3]-i[1];r[0]=2*o/f,r[1]=2*o/h}var e=[1,0,0,0,1,0,0,0,1],r=[1,1];d.draw=function(){var n=this.plot,i=this.shader,a=this.numVertices;if(a){var o=n.gl;t.call(this),i.bind(),i.uniforms.pixelScale=r,i.uniforms.viewTransform=e,this.positionBuffer.bind(),i.attributes.position.pointer(),this.offsetBuffer.bind(),i.attributes.offset.pointer(),this.colorBuffer.bind(),i.attributes.color.pointer(o.UNSIGNED_BYTE,!0),o.drawArrays(o.TRIANGLES,0,a)}};var n=[0,0,0,0];d.drawPick=function(i){var a=this.plot,o=this.pickShader,s=this.numVertices,l=a.gl;if(this.pickOffset=i,!s)return i;for(var c=0;4>c;++c)n[c]=i>>8*c&255;return t.call(this),o.bind(),o.uniforms.pixelScale=r,o.uniforms.viewTransform=e,o.uniforms.pickOffset=n,this.positionBuffer.bind(),o.attributes.position.pointer(),this.offsetBuffer.bind(),o.attributes.offset.pointer(),this.idBuffer.bind(),o.attributes.id.pointer(l.UNSIGNED_BYTE,!1),l.drawArrays(l.TRIANGLES,0,s),i+this.numPoints}}(),d.pick=function(t,e,r){var n=this.pickOffset,i=this.numPoints;if(n>r||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]]}},d.update=function(t){t=t||{};var e=t.positions||[],r=t.colors||[],i=t.glyphs||[],a=t.sizes||[],o=t.borderWidths||[],s=t.borderColors||[];this.points=e;for(var u=this.bounds=[1/0,1/0,-(1/0),-(1/0)],f=0,h=0;h>1;for(var d=0;2>d;++d)u[d]=Math.min(u[d],e[2*h+d]),u[2+d]=Math.max(u[2+d],e[2*h+d])}u[0]===u[2]&&(u[2]+=1),u[3]===u[1]&&(u[3]+=1);for(var p=1/(u[2]-u[0]),g=1/(u[3]-u[1]),v=u[0],m=u[1],y=c.mallocFloat32(2*f),b=c.mallocFloat32(2*f),x=c.mallocUint8(4*f),_=c.mallocUint32(f),w=0,h=0;h=a?i(0,a-1,t,e,r,n):f(0,a-1,t,e,r,n)}function i(t,e,r,n,i,a){for(var o=t+1;e>=o;++o){for(var s=r[o],l=n[2*o],c=n[2*o+1],u=i[o],f=a[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],i[h]=i[h-1],a[h]=a[h-1],h-=1}r[h]=s,n[2*h]=l,n[2*h+1]=c,i[h]=u,a[h]=f}}function a(t,e,r,n,i,a){var o=r[t],s=n[2*t],l=n[2*t+1],c=i[t],u=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]=c,a[e]=u}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],c=i[2*t+1],u=a[t],f=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]=c,a[r]=u,o[r]=f}function l(t,e,r,n,i,a,o,s,l,c,u){s[t]=s[e],l[2*t]=l[2*e],l[2*t+1]=l[2*e+1],c[t]=c[e],u[t]=u[e],s[e]=r,l[2*e]=n,l[2*e+1]=i,c[e]=a,u[e]=o}function c(t,e,r,n,i){return(r[t]-r[e]||n[2*e]-n[2*t]||i[t]-i[e])<0}function u(t,e,r,n,i,a,o,s){return(e-a[t]||o[2*t]-r||i-s[t])<0}function f(t,e,r,n,d,p){var g=(e-t+1)/6|0,v=t+g,m=e-g,y=t+e>>1,b=y-g,x=y+g,_=v,w=b,k=y,A=x,M=m,T=t+1,E=e-1,L=0;c(_,w,r,n,d,p)&&(L=_,_=w,w=L),c(A,M,r,n,d,p)&&(L=A,A=M,M=L),c(_,k,r,n,d,p)&&(L=_,_=k,k=L),c(w,k,r,n,d,p)&&(L=w,w=k,k=L),c(_,A,r,n,d,p)&&(L=_,_=A,A=L),c(k,A,r,n,d,p)&&(L=k,k=A,A=L),c(w,M,r,n,d,p)&&(L=w,w=M,M=L),c(w,k,r,n,d,p)&&(L=w,w=k,k=L),c(A,M,r,n,d,p)&&(L=A,A=M,M=L);var S=r[w],C=n[2*w],z=n[2*w+1],P=d[w],R=p[w],O=r[A],I=n[2*A],N=n[2*A+1],j=d[A],F=p[A],D=_,B=k,U=M,V=v,q=y,H=m,G=r[D],Y=r[B],X=r[U];r[V]=G,r[q]=Y,r[H]=X;for(var W=0;2>W;++W){var Z=n[2*D+W],K=n[2*B+W],$=n[2*U+W];n[2*V+W]=Z,n[2*q+W]=K,n[2*H+W]=$}var Q=d[D],J=d[B],tt=d[U];d[V]=Q,d[q]=J,d[H]=tt;var et=p[D],rt=p[B],nt=p[U];p[V]=et,p[q]=rt,p[H]=nt,o(b,t,r,n,d,p),o(x,e,r,n,d,p);for(var it=T;E>=it;++it)if(u(it,S,C,z,P,r,n,d))it!==T&&a(it,T,r,n,d,p),++T;else if(!u(it,O,I,N,j,r,n,d))for(;;){if(u(E,O,I,N,j,r,n,d)){u(E,S,C,z,P,r,n,d)?(s(it,T,E,r,n,d,p),++T,--E):(a(it,E,r,n,d,p),--E);break}if(--E=T-2-t?i(t,T-2,r,n,d,p):f(t,T-2,r,n,d,p),h>=e-(E+2)?i(E+2,e,r,n,d,p):f(E+2,e,r,n,d,p),h>=E-T?i(T,E,r,n,d,p):f(T,E,r,n,d,p)}e.exports=n;var h=32},{}],189:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s){for(var l=r,c=r;n>c;++c){var u=t[2*c],f=t[2*c+1],h=e[c];u>=i&&o>=u&&f>=a&&s>=f&&(c===l?l+=1:(t[2*c]=t[2*l],t[2*c+1]=t[2*l+1],e[c]=e[l],t[2*l]=u,t[2*l+1]=f,e[l]=h,l+=1))}return l}function i(t,e,r){this.pixelSize=t,this.offset=e,this.count=r}function a(t,e,r,a){function l(i,a,o,s,c,u){var f=.5*o,h=s+1,d=c-s;r[_]=d,x[_++]=u;for(var p=0;2>p;++p)for(var g=0;2>g;++g){var v=i+p*f,m=a+g*f,y=n(t,e,h,c,v,m,v+f,m+f);if(y!==h){if(y-h>=Math.max(.9*d,32)){var b=c+s>>>1;l(v,m,f,h,b,u+1),h=b}l(v,m,f,h,y,u+1),h=y}}}var c=t.length>>>1;if(1>c)return[];for(var u=1/0,f=1/0,h=-(1/0),d=-(1/0),p=0;c>p;++p){var g=t[2*p],v=t[2*p+1];u=Math.min(u,g),h=Math.max(h,g),f=Math.min(f,v),d=Math.max(d,v),e[p]=p}u===h&&(h+=1+Math.abs(h)),f===d&&(d+=1+Math.abs(h));var m=1/(h-u),y=1/(d-f),b=Math.max(h-u,d-f);a=a||[0,0,0,0],a[0]=u,a[1]=f,a[2]=h,a[3]=d;var x=o.mallocInt32(c),_=0;l(u,f,b,0,c,0),s(x,t,e,r,c);for(var w=[],k=0,A=c,_=c-1;_>=0;--_){t[2*_]=(t[2*_]-u)*m,t[2*_+1]=(t[2*_+1]-f)*y;var M=x[_];M!==k&&(w.push(new i(b*Math.pow(.5,M),_+1,A-(_+1))),A=_+1,k=M)}return w.push(new i(b*Math.pow(.5,M+1),0,A)),o.free(x),w}var o=t("typedarray-pool"),s=t("./lib/sort");e.exports=a},{"./lib/sort":188,"typedarray-pool":278}],190:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){this.plot=t,this.offsetBuffer=e,this.pickBuffer=r,this.weightBuffer=n,this.shader=i,this.pickShader=a,this.scales=[],this.size=12,this.borderSize=1,this.pointCount=0,this.color=[1,0,0,1],this.borderColor=[0,0,0,1],this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.pickOffset=0,this.points=null,this.xCoords=null}function i(t,e){var r=t.gl,i=o(r),s=o(r),l=o(r),c=a(r,u.pointVertex,u.pointFragment),f=a(r,u.pickVertex,u.pickFragment),h=new n(t,i,s,l,c,f);return h.update(e),t.addObject(h),h}var a=t("gl-shader"),o=t("gl-buffer"),s=t("binary-search-bounds"),l=t("snap-points-2d"),c=t("typedarray-pool"),u=t("./lib/shader");e.exports=i;var f=n.prototype;f.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.xCoords&&c.free(this.xCoords),this.plot.removeObject(this)},f.update=function(t){function e(e,r){return e in t?t[e]:r}t=t||{},this.size=e("size",12),this.color=e("color",[1,0,0,1]).slice(),this.borderSize=e("borderSize",1),this.borderColor=e("borderColor",[0,0,0,1]).slice(),this.xCoords&&c.free(this.xCoords);var r=t.positions,n=c.mallocFloat32(r.length),i=c.mallocInt32(r.length>>>1);n.set(r);var a=c.mallocFloat32(r.length);this.points=r,this.scales=l(n,i,a,this.bounds),this.offsetBuffer.update(n),this.pickBuffer.update(i),this.weightBuffer.update(a);for(var o=c.mallocFloat32(r.length>>>1),s=0,u=0;s>>1,this.pickOffset=0},f.drawPick=function(){var t=[1,0,0,0,1,0,0,0,1],e=[0,0,0,0];return function(r){var n=this.plot,i=this.pickShader,a=this.scales,o=this.offsetBuffer,l=this.pickBuffer,c=this.bounds,u=this.size,f=this.borderSize,h=n.gl,d=n.pickPixelRatio,p=n.viewBox,g=n.dataBox;if(0===this.pointCount)return r;var v=c[2]-c[0],m=c[3]-c[1],y=g[2]-g[0],b=g[3]-g[1],x=(p[2]-p[0])*d/n.pixelRatio,_=(p[3]-p[1])*d/n.pixelRatio,w=Math.min(y/x,b/_);t[0]=2*v/y,t[4]=2*m/b,t[6]=2*(c[0]-g[0])/y-1,t[7]=2*(c[1]-g[1])/b-1,this.pickOffset=r,e[0]=255&r,e[1]=r>>8&255,e[2]=r>>16&255,e[3]=r>>24&255,i.bind(),i.uniforms.matrix=t,i.uniforms.color=this.color,i.uniforms.borderColor=this.borderColor,i.uniforms.pointSize=d*(u+f),i.uniforms.pickOffset=e,0===this.borderSize?i.uniforms.centerFraction=2:i.uniforms.centerFraction=u/(u+f+1.25),o.bind(),i.attributes.position.pointer(),l.bind(),i.attributes.pickId.pointer(h.UNSIGNED_BYTE);for(var k=this.xCoords,A=(g[0]-c[0]-w*u*d)/v,M=(g[2]-c[0]+w*u*d)/v,T=a.length-1;T>=0;--T){var E=a[T];if(!(E.pixelSize1)){var L=E.offset,S=E.count+L,C=s.ge(k,A,L,S-1),z=s.lt(k,M,C,S-1)+1;z>C&&h.drawArrays(h.POINTS,C,z-C)}}return r+this.pointCount}}(),f.draw=function(){var t=[1,0,0,0,1,0,0,0,1];return function(){var e=this.plot,r=this.shader,n=this.scales,i=this.offsetBuffer,a=this.bounds,o=this.size,l=this.borderSize,c=e.gl,u=e.pixelRatio,f=e.viewBox,h=e.dataBox;if(0!==this.pointCount){var d=a[2]-a[0],p=a[3]-a[1],g=h[2]-h[0],v=h[3]-h[1],m=f[2]-f[0],y=f[3]-f[1],b=Math.min(g/m,v/y);t[0]=2*d/g,t[4]=2*p/v,t[6]=2*(a[0]-h[0])/g-1,t[7]=2*(a[1]-h[1])/v-1,r.bind(),r.uniforms.matrix=t,r.uniforms.color=this.color,r.uniforms.borderColor=this.borderColor,r.uniforms.pointSize=u*(o+l),r.uniforms.useWeight=1,0===this.borderSize?r.uniforms.centerFraction=2:r.uniforms.centerFraction=o/(o+l+1.25),i.bind(),r.attributes.position.pointer(),this.weightBuffer.bind(),r.attributes.weight.pointer();for(var x=this.xCoords,_=(h[0]-a[0]-b*o*u)/d,w=(h[2]-a[0]+b*o*u)/d,k=!0,A=n.length-1;A>=0;--A){var M=n[A];if(!(M.pixelSize1)){var T=M.offset,E=M.count+T,L=s.ge(x,_,T,E-1),S=s.lt(x,w,L,E-1)+1;S>L&&c.drawArrays(c.POINTS,L,S-L),k&&(k=!1,r.uniforms.useWeight=0)}}}}}(),f.pick=function(t,e,r){var n=this.pickOffset,i=this.pointCount;if(n>r||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":186,"binary-search-bounds":187,"gl-buffer":118,"gl-shader":197,"snap-points-2d":189,"typedarray-pool":278}],191:[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;lu;++u)s[0][u]=Math.min(s[0][u],c[u]),s[1][u]=Math.max(s[1][u],c[u]);return r[t]=[o,n,s]}var i=t("vectorize-text");e.exports=n;var a={}},{"vectorize-text":280}],192:[function(t,e,r){function n(t,e){var r=i(t,e),n=r.attributes;return n.position.location=0,n.color.location=1,n.glyph.location=2,n.id.location=3,r}var i=t("gl-shader"),a="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\n\nuniform vec4 highlightId;\nuniform float highlightScale;\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\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 float scale = 1.0;\n if(distance(highlightId, id) < 0.0001) {\n scale = highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1);\n vec4 viewPosition = view * worldPosition;\n viewPosition = viewPosition / viewPosition.w;\n vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));\n \n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}",o="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float highlightScale, pixelRatio;\nuniform vec4 highlightId;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = pixelRatio;\n if(distance(highlightId.bgr, id.bgr) < 0.001) {\n scale *= highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1.0);\n vec4 viewPosition = view * worldPosition;\n vec4 clipPosition = projection * viewPosition;\n clipPosition /= clipPosition.w;\n \n gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}",s="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform float highlightScale;\nuniform vec4 highlightId;\nuniform vec3 axes[2];\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float scale, pixelRatio;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\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 float lscale = pixelRatio * scale;\n if(distance(highlightId, id) < 0.0001) {\n lscale *= highlightScale;\n }\n\n vec4 clipCenter = projection * view * model * vec4(position, 1);\n vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;\n vec4 clipPosition = projection * view * model * vec4(dataPosition, 1);\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = dataPosition;\n }\n}\n",l="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if(any(lessThan(dataCoordinate, fragClipBounds[0])) ||\n any(greaterThan(dataCoordinate, fragClipBounds[1])) ) {\n discard;\n } else {\n gl_FragColor = interpColor * opacity;\n }\n}\n",c="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if(any(lessThan(dataCoordinate, fragClipBounds[0])) || \n any(greaterThan(dataCoordinate, fragClipBounds[1])) ) {\n discard;\n } else {\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n }\n}",u=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],f={vertex:a,fragment:l,attributes:u},h={vertex:o,fragment:l,attributes:u},d={vertex:s,fragment:l,attributes:u},p={vertex:a,fragment:c,attributes:u},g={vertex:o,fragment:c,attributes:u},v={vertex:s,fragment:c,attributes:u};r.createPerspective=function(t){return n(t,f)},r.createOrtho=function(t){return n(t,h)},r.createProject=function(t){return n(t,d)},r.createPickPerspective=function(t){return n(t,p)},r.createPickOrtho=function(t){return n(t,g)},r.createPickProject=function(t){return n(t,v)}},{"gl-shader":197}],193:[function(t,e,r){"use strict";function n(t,e){var r=t[0],n=t[1],i=t[2],a=t[3];return t[0]=e[0]*r+e[4]*n+e[8]*i+e[12]*a,t[1]=e[1]*r+e[5]*n+e[9]*i+e[13]*a,t[2]=e[2]*r+e[6]*n+e[10]*i+e[14]*a,t[3]=e[3]*r+e[7]*n+e[11]*i+e[15]*a, -t}function i(t,e,r,i){return n(i,i,r),n(i,i,e),n(i,i,t)}function a(t,e){this.index=t,this.dataCoordinate=this.position=e}function o(t,e,r,n,i,o,s,l,c,u,f,h){this.gl=t,this.pixelRatio=1,this.shader=e,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=o,this.glyphBuffer=s,this.idBuffer=l,this.vao=c,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.pickId=0,this.pickPerspectiveShader=u,this.pickOrthoShader=f,this.pickProjectShader=h,this.points=[],this._selectResult=new a(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.dirty=!0}function s(t){return t[0]=t[1]=t[2]=0,t}function l(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t}function c(t,e,r,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[r]=n,t}function u(t){for(var e=S,r=0;2>r;++r)for(var n=0;3>n;++n)e[r][n]=Math.max(Math.min(t[r][n],1e8),-1e8);return e}function f(t,e,r,n,a){var o,f=e.axesProject,h=e.gl,d=t.uniforms,p=r.model||x,g=r.view||x,v=r.projection||x,y=e.axesBounds,b=u(e.clipBounds);o=e.axes?e.axes.lastCubeProps.axis:[1,1,1],w[0]=2/h.drawingBufferWidth,w[1]=2/h.drawingBufferHeight,t.bind(),d.view=g,d.projection=v,d.screenSize=w,d.highlightId=e.highlightId,d.highlightScale=e.highlightScale,d.clipBounds=b,d.pickGroup=e.pickId/255,d.pixelRatio=e.pixelRatio;for(var _=0;3>_;++_)if(f[_]&&e.projectOpacity[_]<1===n){d.scale=e.projectScale[_],d.opacity=e.projectOpacity[_];for(var S=E,C=0;16>C;++C)S[C]=0;for(var C=0;4>C;++C)S[5*C]=1;S[5*_]=0,o[_]<0?S[12+_]=y[0][_]:S[12+_]=y[1][_],m(S,p,S),d.model=S;var z=(_+1)%3,P=(_+2)%3,R=s(k),O=s(A);R[z]=1,O[P]=1;var I=i(v,g,p,l(M,R)),N=i(v,g,p,l(T,O));if(Math.abs(I[1])>Math.abs(N[1])){var j=I;I=N,N=j,j=R,R=O,O=j;var F=z;z=P,P=F}I[0]<0&&(R[z]=-1),N[1]>0&&(O[P]=-1);for(var D=0,B=0,C=0;4>C;++C)D+=Math.pow(p[4*z+C],2),B+=Math.pow(p[4*P+C],2);R[z]/=Math.sqrt(D),O[P]/=Math.sqrt(B),d.axes[0]=R,d.axes[1]=O,d.fragClipBounds[0]=c(L,b[0],_,-1e8),d.fragClipBounds[1]=c(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=P,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),c=p(e),u=p(e),f=p(e),h=p(e),d=g(e,[{buffer:c,size:3,type:e.FLOAT},{buffer:u,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,c,u,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;3>t;++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;3>t;++t)if(this.axesProject[t]&&this.projectOpacity[t]>=1)return!0;return!1};var w=[0,0],k=[0,0,0],A=[0,0,0],M=[0,0,0,1],T=[0,0,0,1],E=x.slice(),L=[0,0,0],S=[[0,0,0],[0,0,0]],C=[-1e8,-1e8,-1e8],z=[1e8,1e8,1e8],P=[C,z];_.draw=function(t){var e=this.useOrtho?this.orthoShader:this.shader;h(e,this.projectShader,this,t,!1,!1)},_.drawTransparent=function(t){var e=this.useOrtho?this.orthoShader:this.shader;h(e,this.projectShader,this,t,!0,!1)},_.drawPick=function(t){var e=this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader;h(e,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||0>e)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;3>i;++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,c=t.color,u=t.size,f=t.angle,h=t.lineColor,d=0,p=0,g=0,m=n.length;t:for(var y=0;m>y;++y){for(var x=n[y],_=0;3>_;++_)if(isNaN(x[_])||!isFinite(x[_]))continue t;var w;w=Array.isArray(l)?b(l[y],i):l?b(l,i):b("\u25cf",i);var k=w[0],A=w[1],M=w[2];p+=3*k.cells.length,g+=2*A.edges.length}var T=p+g,E=v.mallocFloat(3*T),L=v.mallocFloat(4*T),S=v.mallocFloat(2*T),C=v.mallocUint32(T),z=[0,a[1]],P=0,R=p,O=[0,0,0,1],I=[0,0,0,1],N=Array.isArray(c)&&Array.isArray(c[0]),j=Array.isArray(h)&&Array.isArray(h[0]);t:for(var y=0;m>y;++y){for(var x=n[y],_=0;3>_;++_){if(isNaN(x[_])||!isFinite(x[_])){d+=1;continue t}s[_]=Math.max(s[_],x[_]),o[_]=Math.min(o[_],x[_])}var w;w=Array.isArray(l)?b(l[y],i):l?b(l,i):b("\u25cf",i);var k=w[0],A=w[1],M=w[2];if(Array.isArray(c)){var F;if(F=N?c[y]:c,3===F.length){for(var _=0;3>_;++_)O[_]=F[_];O[3]=1}else if(4===F.length)for(var _=0;4>_;++_)O[_]=F[_]}else O[0]=O[1]=O[2]=0,O[3]=1;if(Array.isArray(h)){var F;if(F=j?h[y]:h,3===F.length){for(var _=0;3>_;++_)I[_]=F[_];I[_]=1}else if(4===F.length)for(var _=0;4>_;++_)I[_]=F[_]}else I[0]=I[1]=I[2]=0,I[3]=1;var D=.5;Array.isArray(u)?D=+u[y]:u?D=+u:this.useOrtho&&(D=12);var B=0;Array.isArray(f)?B=+f[y]:f&&(B=+f);for(var U=Math.cos(B),V=Math.sin(B),x=n[y],_=0;3>_;++_)s[_]=Math.max(s[_],x[_]),o[_]=Math.min(o[_],x[_]);a[0]<0?z[0]=a[0]*(1+M[1][0]):a[0]>0&&(z[0]=-a[0]*(1+M[0][0]));for(var q=k.cells,H=k.positions,_=0;_Y;++Y){for(var X=0;3>X;++X)E[3*P+X]=x[X];for(var X=0;4>X;++X)L[4*P+X]=O[X];C[P]=d;var W=H[G[Y]];S[2*P]=D*(U*W[0]-V*W[1]+z[0]),S[2*P+1]=D*(V*W[0]+U*W[1]+z[1]),P+=1}for(var q=A.edges,H=A.positions,_=0;_Y;++Y){for(var X=0;3>X;++X)E[3*R+X]=x[X];for(var X=0;4>X;++X)L[4*R+X]=I[X];C[R]=d;var W=H[G[Y]];S[2*R]=D*(U*W[0]-V*W[1]+z[0]),S[2*R+1]=D*(V*W[0]+U*W[1]+z[1]),R+=1}d+=1}this.vertexCount=p,this.lineVertexCount=g,this.pointBuffer.update(E),this.colorBuffer.update(L),this.glyphBuffer.update(S),this.idBuffer.update(new Uint32Array(C)),v.free(E),v.free(L),v.free(S),v.free(C),this.bounds=[o,s],this.points=n,this.pointCount=n.length}},_.dispose=function(){this.shader.dispose(),this.orthoShader.dispose(),this.pickPerspectiveShader.dispose(),this.pickOrthoShader.dispose(),this.vao.dispose(),this.pointBuffer.dispose(),this.colorBuffer.dispose(),this.glyphBuffer.dispose(),this.idBuffer.dispose()}},{"./lib/glyphs":191,"./lib/shaders":192,"gl-buffer":118,"gl-mat4/multiply":139,"gl-vao":226,"typedarray-pool":278}],194:[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"},{}],195:[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 i(t,e){var r=t.gl,i=o(r,[0,0,0,1,1,0,1,1]),l=a(r,s.boxVertex,s.boxFragment),c=new n(t,i,l);return c.update(e),t.addOverlay(c),c}var a=t("gl-shader"),o=t("gl-buffer"),s=t("./lib/shaders");e.exports=i;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),i=(this.outerFill,this.outerColor),a=this.borderColor,o=t.box,s=t.screenBox,l=t.dataBox,c=t.viewBox,u=t.pixelRatio,f=(e[0]-l[0])*(c[2]-c[0])/(l[2]-l[0])+c[0],h=(e[1]-l[1])*(c[3]-c[1])/(l[3]-l[1])+c[1],d=(e[2]-l[0])*(c[2]-c[0])/(l[2]-l[0])+c[0],p=(e[3]-l[1])*(c[3]-c[1])/(l[3]-l[1])+c[1];if(f=Math.max(f,c[0]),h=Math.max(h,c[1]),d=Math.min(d,c[2]),p=Math.min(p,c[3]),!(f>d||h>p)){o.bind();var g=s[2]-s[0],v=s[3]-s[1];if(this.outerFill&&(o.drawBox(0,0,g,h,i),o.drawBox(0,h,f,p,i),o.drawBox(0,p,g,v,i),o.drawBox(d,h,g,p,i)),this.innerFill&&o.drawBox(f,h,d,p,n),r>0){var m=r*u;o.drawBox(f-m,h-m,d+m,h+m,a),o.drawBox(f-m,p-m,d+m,p+m,a),o.drawBox(f-m,h-m,f+m,p+m,a),o.drawBox(d-m,h-m,d+m,p+m,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":194,"gl-buffer":118,"gl-shader":197}],196:[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){var r=o(t,e),n=s.mallocUint8(e[0]*e[1]*4);return new i(t,r,n)}e.exports=a;var o=t("gl-fbo"),s=t("typedarray-pool"),l=t("ndarray"),c=t("bit-twiddle").nextPow2,u=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(255>_inline_34_arg0_||255>_inline_34_arg1_||255>_inline_34_arg2_||255>_inline_34_arg3_){var _inline_34_l=_inline_34_arg4_-_inline_34_arg6_[0],_inline_34_a=_inline_34_arg5_-_inline_34_arg6_[1],_inline_34_f=_inline_34_l*_inline_34_l+_inline_34_a*_inline_34_a;_inline_34_fthis.buffer.length){s.free(this.buffer);for(var n=this.buffer=s.mallocUint8(c(r*e*4)),i=0;r*e*4>i;++i)n[i]=255}return t}}}),f.begin=function(){var t=this.gl;this.shape;t&&(this.fbo.bind(),t.clearColor(1,1,1,1),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT))},f.end=function(){var t=this.gl;t&&(t.bindFramebuffer(t.FRAMEBUFFER,null),this._readTimeout||clearTimeout(this._readTimeout),this._readTimeout=setTimeout(this._readCallback,1))},f.query=function(t,e,r){if(!this.gl)return null;var i=this.fbo.shape.slice();t=0|t,e=0|e,"number"!=typeof r&&(r=1);var a=0|Math.min(Math.max(t-r,0),i[0]),o=0|Math.min(Math.max(t+r,0),i[0]),s=0|Math.min(Math.max(e-r,0),i[1]),c=0|Math.min(Math.max(e+r,0),i[1]);if(a>=o||s>=c)return null;var f=[o-a,c-s],h=l(this.buffer,[f[0],f[1],4],[4,4*i[0],1],4*(a+i[0]*s)),d=u(h.hi(f[0],f[1],1),r,r),p=d[0],g=d[1];if(0>p||Math.pow(this.radius,2)=0){for(var A=0|k.type.charAt(k.type.length-1),M=new Array(A),T=0;A>T;++T)M[T]=_.length,x.push(k.name+"["+T+"]"),"number"==typeof k.location?_.push(k.location+T):Array.isArray(k.location)&&k.location.length===A&&"number"==typeof k.location[T]?_.push(0|k.location[T]):_.push(-1);b.push({name:k.name,type:k.type,locations:M})}else b.push({name:k.name,type:k.type,locations:[_.length]}),x.push(k.name),"number"==typeof k.location?_.push(0|k.location):_.push(-1)}for(var E=0,w=0;w<_.length;++w)if(_[w]<0){for(;_.indexOf(E)>=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":198,"./lib/create-attributes":199,"./lib/create-uniforms":200,"./lib/reflect":201,"./lib/runtime-reflect":202,"./lib/shader-cache":203}],198:[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},{}],199:[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"],c=[],u=0;a>u;++u)l.push("x"+u),c.push("x"+u);l.push("if(x0.length===void 0){return gl.vertexAttrib"+a+"f(v,"+c.join()+")}else{return gl.vertexAttrib"+a+"fv(v,x0)}");var f=Function.apply(null,l),h=new n(t,e,r,i,a,f);Object.defineProperty(o,s,{set:function(e){return t.disableVertexAttribArray(i[r]),f(t,i[r],e),e},get:function(){return h},enumerable:!0})}function a(t,e,r,n,a,o,s){for(var l=new Array(a),c=new Array(a),u=0;a>u;++u)i(t,e,r[u],n,a,l,u),c[u]=l[u];Object.defineProperty(l,"location",{set:function(t){if(Array.isArray(t))for(var e=0;a>e;++e)c[e].location=t[e];else for(var e=0;a>e;++e)c[e].location=t+e;return t},get:function(){for(var t=new Array(a),e=0;a>e;++e)t[e]=n[r[e]];return t},enumerable:!0}),l.pointer=function(e,i,o,s){e=e||t.FLOAT,i=!!i,o=o||a*a,s=s||0;for(var l=0;a>l;++l){var c=n[r[l]];t.vertexAttribPointer(c,a,e,i,o,s+l*a),t.enableVertexAttribArray(c)}};var f=new Array(a),h=t["vertexAttrib"+a+"fv"];Object.defineProperty(o,s,{set:function(e){for(var i=0;a>i;++i){var o=n[r[i]];if(t.disableVertexAttribArray(o),Array.isArray(e[0]))h.call(t,o,e[i]);else{for(var s=0;a>s;++s)f[s]=e[a*i+s];h.call(t,o,f)}}return e},get:function(){return l},enumerable:!0})}function o(t,e,r,n){for(var o={},l=0,c=r.length;c>l;++l){var u=r[l],f=u.name,h=u.type,d=u.locations;switch(h){case"bool":case"int":case"float":i(t,e,d[0],n,1,o,f);break;default:if(h.indexOf("vec")>=0){var p=h.charCodeAt(h.length-1)-48;if(2>p||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(2>p||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":198}],200:[function(t,e,r){"use strict";function n(t){var e=new Function("y","return function(){return y}");return e(t)}function i(t,e){for(var r=new Array(t),n=0;t>n;++n)r[n]=e;return r}function a(t,e,r,a){function l(r){var n=new Function("gl","wrapper","locations","return function(){return gl.getUniform(wrapper.program,locations["+r+"])}");return n(t,e,a)}function c(t,e,r){switch(r){case"bool":case"int":case"sampler2D":case"samplerCube":return"gl.uniform1i(locations["+e+"],obj"+t+")";case"float":return"gl.uniform1f(locations["+e+"],obj"+t+")";default:var n=r.indexOf("vec");if(!(n>=0&&1>=n&&r.length===4+n)){if(0===r.indexOf("mat")&&4===r.length){var i=r.charCodeAt(r.length-1)-48;if(2>i||i>4)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(2>i||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 u(t,e){if("object"!=typeof e)return[[t,e]];var r=[];for(var n in e){var i=e[n],a=t;a+=parseInt(n)+""===n?"["+n+"]":"."+n,"object"==typeof i?r.push.apply(r,u(a,i)):r.push([a,i])}return r}function f(e){for(var n=["return function updateProperty(obj){"],i=u("",e),o=0;o=0&&1>=e&&t.length===4+e){var r=t.charCodeAt(t.length-1)-48;if(2>r||r>4)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(2>r||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 c=1;ca;++a){var o=t.getActiveUniform(e,a);if(o){var s=n(t,o.type);if(o.size>1)for(var l=0;la;++a){var o=t.getActiveAttrib(e,a);o&&i.push({name:o.name,type:n(t,o.type)})}return i}r.uniforms=i,r.attributes=a;var o={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},s=null},{}],203:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o){this.id=t,this.src=e,this.type=r,this.shader=n,this.count=a,this.programs=[],this.cache=o}function i(t){this.gl=t,this.shaders=[{},{}],this.programs={}}function a(t,e,r){var n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS)){var i=t.getShaderInfoLog(n);try{var a=f(i,r,e)}catch(o){throw console.warn("Failed to format compiler error: "+o),new u(i,"Error compiling shader:\n"+i)}throw new u(i,a.short,a.long)}return n}function o(t,e,r,n,i){var a=t.createProgram();t.attachShader(a,e),t.attachShader(a,r);for(var o=0;on;++n){var a=t.programs[r[n]];a&&(delete t.programs[n],e.deleteProgram(a))}e.deleteShader(this.shader),delete t.shaders[this.type===e.FRAGMENT_SHADER|0][this.src]}};var g=i.prototype;g.getShaderReference=function(t,e){var r=this.gl,i=this.shaders[t===r.FRAGMENT_SHADER|0],o=i[e];if(o&&r.isShader(o.shader))o.count+=1;else{var s=a(r,t,e);o=i[e]=new n(p++,e,t,s,[],1,this)}return o},g.getProgram=function(t,e,r,n){var i=[t.id,e.id,r.join(":"),n.join(":")].join("@"),a=this.programs[i];return a&&this.gl.isProgram(a)||(this.programs[i]=a=o(this.gl,t.shader,e.shader,r,n),t.programs.push(i),e.programs.push(i)),a}},{"./GLError":198,"gl-format-compiler-error":204,"weakmap-shim":214}],204:[function(t,e,r){function n(t,e,r){"use strict";var n=o(e)||"of unknown name (see npm glsl-shader-name)",l="unknown type";void 0!==r&&(l=r===a.FRAGMENT_SHADER?"fragment":"vertex");for(var c=i("Error compiling %s shader %s:\n",l,n),u=i("%s%s",c,t),f=t.split("\n"),h={},d=0;dr;++r)for(var n=0;3>n;++n)e[r][n]=Math.max(Math.min(t[r][n],1e8),-1e8);return e}function f(t,e,r,n,a){var o,f=e.axesProject,h=e.gl,d=t.uniforms,p=r.model||x,g=r.view||x,v=r.projection||x,y=e.axesBounds,b=u(e.clipBounds);o=e.axes?e.axes.lastCubeProps.axis:[1,1,1],w[0]=2/h.drawingBufferWidth,w[1]=2/h.drawingBufferHeight,t.bind(),d.view=g,d.projection=v,d.screenSize=w,d.highlightId=e.highlightId,d.highlightScale=e.highlightScale,d.clipBounds=b,d.pickGroup=e.pickId/255,d.pixelRatio=e.pixelRatio;for(var _=0;3>_;++_)if(f[_]&&e.projectOpacity[_]<1===n){d.scale=e.projectScale[_],d.opacity=e.projectOpacity[_];for(var S=E,C=0;16>C;++C)S[C]=0;for(var C=0;4>C;++C)S[5*C]=1;S[5*_]=0,o[_]<0?S[12+_]=y[0][_]:S[12+_]=y[1][_],m(S,p,S),d.model=S;var z=(_+1)%3,P=(_+2)%3,R=s(k),O=s(A);R[z]=1,O[P]=1;var I=i(v,g,p,l(M,R)),N=i(v,g,p,l(T,O));if(Math.abs(I[1])>Math.abs(N[1])){var j=I;I=N,N=j,j=R,R=O,O=j;var F=z;z=P,P=F}I[0]<0&&(R[z]=-1),N[1]>0&&(O[P]=-1);for(var D=0,B=0,C=0;4>C;++C)D+=Math.pow(p[4*z+C],2),B+=Math.pow(p[4*P+C],2);R[z]/=Math.sqrt(D),O[P]/=Math.sqrt(B),d.axes[0]=R,d.axes[1]=O,d.fragClipBounds[0]=c(L,b[0],_,-1e8),d.fragClipBounds[1]=c(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=P,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),c=p(e),u=p(e),f=p(e),h=p(e),d=g(e,[{buffer:c,size:3,type:e.FLOAT},{buffer:u,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,c,u,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;3>t;++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;3>t;++t)if(this.axesProject[t]&&this.projectOpacity[t]>=1)return!0;return!1};var w=[0,0],k=[0,0,0],A=[0,0,0],M=[0,0,0,1],T=[0,0,0,1],E=x.slice(),L=[0,0,0],S=[[0,0,0],[0,0,0]],C=[-1e8,-1e8,-1e8],z=[1e8,1e8,1e8],P=[C,z];_.draw=function(t){var e=this.useOrtho?this.orthoShader:this.shader;h(e,this.projectShader,this,t,!1,!1)},_.drawTransparent=function(t){var e=this.useOrtho?this.orthoShader:this.shader;h(e,this.projectShader,this,t,!0,!1)},_.drawPick=function(t){var e=this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader;h(e,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||0>e)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;3>i;++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,c=t.color,u=t.size,f=t.angle,h=t.lineColor,d=0,p=0,g=0,m=n.length;t:for(var y=0;m>y;++y){for(var x=n[y],_=0;3>_;++_)if(isNaN(x[_])||!isFinite(x[_]))continue t;var w;w=Array.isArray(l)?b(l[y],i):l?b(l,i):b("\u25cf",i);var k=w[0],A=w[1],M=w[2];p+=3*k.cells.length,g+=2*A.edges.length}var T=p+g,E=v.mallocFloat(3*T),L=v.mallocFloat(4*T),S=v.mallocFloat(2*T),C=v.mallocUint32(T),z=[0,a[1]],P=0,R=p,O=[0,0,0,1],I=[0,0,0,1],N=Array.isArray(c)&&Array.isArray(c[0]),j=Array.isArray(h)&&Array.isArray(h[0]);t:for(var y=0;m>y;++y){for(var x=n[y],_=0;3>_;++_){if(isNaN(x[_])||!isFinite(x[_])){d+=1;continue t}s[_]=Math.max(s[_],x[_]),o[_]=Math.min(o[_],x[_])}var w;w=Array.isArray(l)?b(l[y],i):l?b(l,i):b("\u25cf",i);var k=w[0],A=w[1],M=w[2];if(Array.isArray(c)){var F;if(F=N?c[y]:c,3===F.length){for(var _=0;3>_;++_)O[_]=F[_];O[3]=1}else if(4===F.length)for(var _=0;4>_;++_)O[_]=F[_]}else O[0]=O[1]=O[2]=0,O[3]=1;if(Array.isArray(h)){var F;if(F=j?h[y]:h,3===F.length){for(var _=0;3>_;++_)I[_]=F[_];I[_]=1}else if(4===F.length)for(var _=0;4>_;++_)I[_]=F[_]}else I[0]=I[1]=I[2]=0,I[3]=1;var D=.5;Array.isArray(u)?D=+u[y]:u?D=+u:this.useOrtho&&(D=12);var B=0;Array.isArray(f)?B=+f[y]:f&&(B=+f);for(var U=Math.cos(B),V=Math.sin(B),x=n[y],_=0;3>_;++_)s[_]=Math.max(s[_],x[_]),o[_]=Math.min(o[_],x[_]);a[0]<0?z[0]=a[0]*(1+M[1][0]):a[0]>0&&(z[0]=-a[0]*(1+M[0][0]));for(var q=k.cells,H=k.positions,_=0;_Y;++Y){for(var X=0;3>X;++X)E[3*P+X]=x[X];for(var X=0;4>X;++X)L[4*P+X]=O[X];C[P]=d;var W=H[G[Y]];S[2*P]=D*(U*W[0]-V*W[1]+z[0]),S[2*P+1]=D*(V*W[0]+U*W[1]+z[1]),P+=1}for(var q=A.edges,H=A.positions,_=0;_Y;++Y){for(var X=0;3>X;++X)E[3*R+X]=x[X];for(var X=0;4>X;++X)L[4*R+X]=I[X];C[R]=d;var W=H[G[Y]];S[2*R]=D*(U*W[0]-V*W[1]+z[0]),S[2*R+1]=D*(V*W[0]+U*W[1]+z[1]),R+=1}d+=1}this.vertexCount=p,this.lineVertexCount=g,this.pointBuffer.update(E),this.colorBuffer.update(L),this.glyphBuffer.update(S),this.idBuffer.update(new Uint32Array(C)),v.free(E),v.free(L),v.free(S),v.free(C),this.bounds=[o,s],this.points=n,this.pointCount=n.length}},_.dispose=function(){this.shader.dispose(),this.orthoShader.dispose(),this.pickPerspectiveShader.dispose(),this.pickOrthoShader.dispose(),this.vao.dispose(),this.pointBuffer.dispose(),this.colorBuffer.dispose(),this.glyphBuffer.dispose(),this.idBuffer.dispose()}},{"./lib/glyphs":191,"./lib/shaders":192,"gl-buffer":118,"gl-mat4/multiply":139,"gl-vao":226,"typedarray-pool":278}],194:[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"},{}],195:[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 i(t,e){var r=t.gl,i=o(r,[0,0,0,1,1,0,1,1]),l=a(r,s.boxVertex,s.boxFragment),c=new n(t,i,l);return c.update(e),t.addOverlay(c),c}var a=t("gl-shader"),o=t("gl-buffer"),s=t("./lib/shaders");e.exports=i;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),i=(this.outerFill,this.outerColor),a=this.borderColor,o=t.box,s=t.screenBox,l=t.dataBox,c=t.viewBox,u=t.pixelRatio,f=(e[0]-l[0])*(c[2]-c[0])/(l[2]-l[0])+c[0],h=(e[1]-l[1])*(c[3]-c[1])/(l[3]-l[1])+c[1],d=(e[2]-l[0])*(c[2]-c[0])/(l[2]-l[0])+c[0],p=(e[3]-l[1])*(c[3]-c[1])/(l[3]-l[1])+c[1];if(f=Math.max(f,c[0]),h=Math.max(h,c[1]),d=Math.min(d,c[2]),p=Math.min(p,c[3]),!(f>d||h>p)){o.bind();var g=s[2]-s[0],v=s[3]-s[1];if(this.outerFill&&(o.drawBox(0,0,g,h,i),o.drawBox(0,h,f,p,i),o.drawBox(0,p,g,v,i),o.drawBox(d,h,g,p,i)),this.innerFill&&o.drawBox(f,h,d,p,n),r>0){var m=r*u;o.drawBox(f-m,h-m,d+m,h+m,a),o.drawBox(f-m,p-m,d+m,p+m,a),o.drawBox(f-m,h-m,f+m,p+m,a),o.drawBox(d-m,h-m,d+m,p+m,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":194,"gl-buffer":118,"gl-shader":197}],196:[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){var r=o(t,e),n=s.mallocUint8(e[0]*e[1]*4);return new i(t,r,n)}e.exports=a;var o=t("gl-fbo"),s=t("typedarray-pool"),l=t("ndarray"),c=t("bit-twiddle").nextPow2,u=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(255>_inline_31_arg0_||255>_inline_31_arg1_||255>_inline_31_arg2_||255>_inline_31_arg3_){var _inline_31_l=_inline_31_arg4_-_inline_31_arg6_[0],_inline_31_a=_inline_31_arg5_-_inline_31_arg6_[1],_inline_31_f=_inline_31_l*_inline_31_l+_inline_31_a*_inline_31_a;_inline_31_fthis.buffer.length){s.free(this.buffer);for(var n=this.buffer=s.mallocUint8(c(r*e*4)),i=0;r*e*4>i;++i)n[i]=255}return t}}}),f.begin=function(){var t=this.gl;this.shape;t&&(this.fbo.bind(),t.clearColor(1,1,1,1),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT))},f.end=function(){var t=this.gl;t&&(t.bindFramebuffer(t.FRAMEBUFFER,null),this._readTimeout||clearTimeout(this._readTimeout),this._readTimeout=setTimeout(this._readCallback,1))},f.query=function(t,e,r){if(!this.gl)return null;var i=this.fbo.shape.slice();t=0|t,e=0|e,"number"!=typeof r&&(r=1);var a=0|Math.min(Math.max(t-r,0),i[0]),o=0|Math.min(Math.max(t+r,0),i[0]),s=0|Math.min(Math.max(e-r,0),i[1]),c=0|Math.min(Math.max(e+r,0),i[1]);if(a>=o||s>=c)return null;var f=[o-a,c-s],h=l(this.buffer,[f[0],f[1],4],[4,4*i[0],1],4*(a+i[0]*s)),d=u(h.hi(f[0],f[1],1),r,r),p=d[0],g=d[1];if(0>p||Math.pow(this.radius,2)=0){for(var A=0|k.type.charAt(k.type.length-1),M=new Array(A),T=0;A>T;++T)M[T]=_.length,x.push(k.name+"["+T+"]"),"number"==typeof k.location?_.push(k.location+T):Array.isArray(k.location)&&k.location.length===A&&"number"==typeof k.location[T]?_.push(0|k.location[T]):_.push(-1);b.push({name:k.name,type:k.type,locations:M})}else b.push({name:k.name,type:k.type,locations:[_.length]}),x.push(k.name),"number"==typeof k.location?_.push(0|k.location):_.push(-1)}for(var E=0,w=0;w<_.length;++w)if(_[w]<0){for(;_.indexOf(E)>=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":198,"./lib/create-attributes":199,"./lib/create-uniforms":200,"./lib/reflect":201,"./lib/runtime-reflect":202,"./lib/shader-cache":203}],198:[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},{}],199:[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"],c=[],u=0;a>u;++u)l.push("x"+u),c.push("x"+u);l.push("if(x0.length===void 0){return gl.vertexAttrib"+a+"f(v,"+c.join()+")}else{return gl.vertexAttrib"+a+"fv(v,x0)}");var f=Function.apply(null,l),h=new n(t,e,r,i,a,f);Object.defineProperty(o,s,{set:function(e){return t.disableVertexAttribArray(i[r]),f(t,i[r],e),e},get:function(){return h},enumerable:!0})}function a(t,e,r,n,a,o,s){for(var l=new Array(a),c=new Array(a),u=0;a>u;++u)i(t,e,r[u],n,a,l,u),c[u]=l[u];Object.defineProperty(l,"location",{set:function(t){if(Array.isArray(t))for(var e=0;a>e;++e)c[e].location=t[e];else for(var e=0;a>e;++e)c[e].location=t+e;return t},get:function(){for(var t=new Array(a),e=0;a>e;++e)t[e]=n[r[e]];return t},enumerable:!0}),l.pointer=function(e,i,o,s){e=e||t.FLOAT,i=!!i,o=o||a*a,s=s||0;for(var l=0;a>l;++l){var c=n[r[l]];t.vertexAttribPointer(c,a,e,i,o,s+l*a),t.enableVertexAttribArray(c)}};var f=new Array(a),h=t["vertexAttrib"+a+"fv"];Object.defineProperty(o,s,{set:function(e){for(var i=0;a>i;++i){var o=n[r[i]];if(t.disableVertexAttribArray(o),Array.isArray(e[0]))h.call(t,o,e[i]);else{for(var s=0;a>s;++s)f[s]=e[a*i+s];h.call(t,o,f)}}return e},get:function(){return l},enumerable:!0})}function o(t,e,r,n){for(var o={},l=0,c=r.length;c>l;++l){var u=r[l],f=u.name,h=u.type,d=u.locations;switch(h){case"bool":case"int":case"float":i(t,e,d[0],n,1,o,f);break;default:if(h.indexOf("vec")>=0){var p=h.charCodeAt(h.length-1)-48;if(2>p||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(2>p||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":198}],200:[function(t,e,r){"use strict";function n(t){var e=new Function("y","return function(){return y}");return e(t)}function i(t,e){for(var r=new Array(t),n=0;t>n;++n)r[n]=e;return r}function a(t,e,r,a){function l(r){var n=new Function("gl","wrapper","locations","return function(){return gl.getUniform(wrapper.program,locations["+r+"])}");return n(t,e,a)}function c(t,e,r){switch(r){case"bool":case"int":case"sampler2D":case"samplerCube":return"gl.uniform1i(locations["+e+"],obj"+t+")";case"float":return"gl.uniform1f(locations["+e+"],obj"+t+")";default:var n=r.indexOf("vec");if(!(n>=0&&1>=n&&r.length===4+n)){if(0===r.indexOf("mat")&&4===r.length){var i=r.charCodeAt(r.length-1)-48;if(2>i||i>4)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(2>i||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 u(t,e){if("object"!=typeof e)return[[t,e]];var r=[];for(var n in e){var i=e[n],a=t;a+=parseInt(n)+""===n?"["+n+"]":"."+n,"object"==typeof i?r.push.apply(r,u(a,i)):r.push([a,i])}return r}function f(e){for(var n=["return function updateProperty(obj){"],i=u("",e),o=0;o=0&&1>=e&&t.length===4+e){var r=t.charCodeAt(t.length-1)-48;if(2>r||r>4)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(2>r||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 c=1;ca;++a){var o=t.getActiveUniform(e,a);if(o){var s=n(t,o.type);if(o.size>1)for(var l=0;la;++a){var o=t.getActiveAttrib(e,a);o&&i.push({name:o.name,type:n(t,o.type)})}return i}r.uniforms=i,r.attributes=a;var o={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},s=null},{}],203:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o){this.id=t,this.src=e,this.type=r,this.shader=n,this.count=a,this.programs=[],this.cache=o}function i(t){this.gl=t,this.shaders=[{},{}],this.programs={}}function a(t,e,r){var n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS)){var i=t.getShaderInfoLog(n);try{var a=f(i,r,e)}catch(o){throw console.warn("Failed to format compiler error: "+o),new u(i,"Error compiling shader:\n"+i)}throw new u(i,a.short,a.long)}return n}function o(t,e,r,n,i){var a=t.createProgram();t.attachShader(a,e),t.attachShader(a,r);for(var o=0;on;++n){var a=t.programs[r[n]];a&&(delete t.programs[n],e.deleteProgram(a))}e.deleteShader(this.shader),delete t.shaders[this.type===e.FRAGMENT_SHADER|0][this.src]}};var g=i.prototype;g.getShaderReference=function(t,e){var r=this.gl,i=this.shaders[t===r.FRAGMENT_SHADER|0],o=i[e];if(o&&r.isShader(o.shader))o.count+=1;else{var s=a(r,t,e);o=i[e]=new n(p++,e,t,s,[],1,this)}return o},g.getProgram=function(t,e,r,n){var i=[t.id,e.id,r.join(":"),n.join(":")].join("@"),a=this.programs[i];return a&&this.gl.isProgram(a)||(this.programs[i]=a=o(this.gl,t.shader,e.shader,r,n),t.programs.push(i),e.programs.push(i)),a}},{"./GLError":198,"gl-format-compiler-error":204,"weakmap-shim":214}],204:[function(t,e,r){function n(t,e,r){"use strict";var n=o(e)||"of unknown name (see npm glsl-shader-name)",l="unknown type";void 0!==r&&(l=r===a.FRAGMENT_SHADER?"fragment":"vertex");for(var c=i("Error compiling %s shader %s:\n",l,n),u=i("%s%s",c,t),f=t.split("\n"),h={},d=0;ds;s++)if(g=i(t[s]),"string"===g)v[v.length]=t[s];else if("array"===g){if(c=t[s],c[2])for(n=e[d],l=0;l=0),c[8]){case"b":n=n.toString(2);break;case"c":n=String.fromCharCode(n);break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,c[6]?parseInt(c[6]):0);break;case"e":n=c[7]?n.toExponential(c[7]):n.toExponential();break;case"f":n=c[7]?parseFloat(n).toFixed(c[7]):parseFloat(n);break;case"g":n=c[7]?parseFloat(n).toPrecision(c[7]):parseFloat(n);break;case"o":n=n.toString(8);break;case"s":n=(n=String(n))&&c[7]?n.substring(0,c[7]):n;break;case"u":n>>>=0;break;case"x":n=n.toString(16);break;case"X":n=n.toString(16).toUpperCase()}o.json.test(c[8])?v[v.length]=n:(!o.number.test(c[8])||m&&!c[3]?y="":(y=m?"+":"-",n=n.toString().replace(o.sign,"")),f=c[4]?"0"===c[4]?"0":c[4].charAt(1):" ",h=c[6]-(y+n).length,u=c[6]&&h>0?a(f,h):"",v[v.length]=c[5]?y+n+u:"0"===f?y+u+n:u+y+n)}return v.join("")},r.cache={},r.parse=function(t){for(var e=t,r=[],n=[],i=0;e;){if(null!==(r=o.text.exec(e)))n[n.length]=r[0];else if(null!==(r=o.modulo.exec(e)))n[n.length]="%";else{if(null===(r=o.placeholder.exec(e)))throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){i|=1;var a=[],s=r[2],l=[];if(null===(l=o.key.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(a[a.length]=l[1];""!==(s=s.substring(l[0].length));)if(null!==(l=o.key_access.exec(s)))a[a.length]=l[1];else{if(null===(l=o.index_access.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");a[a.length]=l[1]}r[2]=a}else i|=2;if(3===i)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n[n.length]=r}e=e.substring(r[0].length)}return n};var s=function(t,e,n){return n=(e||[]).slice(0),n.splice(0,0,t),r.apply(null,n)};"undefined"!=typeof n?(n.sprintf=r,n.vsprintf=s):(e.sprintf=r,e.vsprintf=s,"function"==typeof t&&t.amd&&t(function(){return{sprintf:r,vsprintf:s}}))}("undefined"==typeof window?this:window)},{}],212:[function(t,e,r){function n(){var t={};return function(e){if(("object"!=typeof e||null===e)&&"function"!=typeof e)throw new Error("Weakmap-shim: Key must be object");var r=e.valueOf(t);return r&&r.identity===t?r:i(e,t)}}var i=t("./hidden-store.js");e.exports=n},{"./hidden-store.js":213}],213:[function(t,e,r){function n(t,e){var r={identity:e},n=t.valueOf;return Object.defineProperty(t,"valueOf",{value:function(t){return t!==e?n.apply(this,arguments):r},writable:!0}),r}e.exports=n},{}],214:[function(t,e,r){function n(){var t=i();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){t(e).value=r},has:function(e){return"value"in t(e)},"delete":function(e){return delete t(e).value}}}var i=t("./create-store.js");e.exports=n},{"./create-store.js":212}],215:[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]),c=s[1]+(n[1]-o[1])/(o[3]-o[1])*(s[3]-s[1]);t[0]&&a.drawLine(l,c,s[0],c,e[0],r[0]),t[1]&&a.drawLine(l,c,l,s[1],e[1],r[1]),t[2]&&a.drawLine(l,c,s[2],c,e[2],r[2]),t[3]&&a.drawLine(l,c,l,s[3],e[3],r[3])}},a.dispose=function(){this.plot.removeOverlay(this)}},{}],216:[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;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\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 //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;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\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 = beckmannSpecular_1_1(L, V, N, roughness);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = texture2D(colormap, vec2(value, value));\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;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\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 //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":197}],217:[function(t,e,r){arguments[4][21][0].apply(r,arguments)},{dup:21}],218:[function(t,e,r){"use strict";function n(t){if(t in l)return l[t];for(var e=[],r=0;t>r;++r)e.push("out",r,"s=0.5*(inp",r,"l-inp",r,"r);");for(var n=["array"],i=["junk"],r=0;t>r;++r){n.push("array"),i.push("out"+r+"s");var a=o(t);a[r]=-1,n.push({array:0,offset:a.slice()}),a[r]=1,n.push({array:0,offset:a.slice()}),i.push("inp"+r+"l","inp"+r+"r")}return l[t]=s({args:n,pre:u,post:u,body:{body:e.join(""),args:i.map(function(t){return{name:t,lvalue:0===t.indexOf("out"),rvalue:0===t.indexOf("inp"),count:"junk"!==t|0}}),thisVars:[],localVars:[]},funcName:"fdTemplate"+t})}function i(t){function e(e){for(var r=a-e.length,n=[],i=[],s=[],l=0;a>l;++l)e.indexOf(l+1)>=0?s.push("0"):e.indexOf(-(l+1))>=0?s.push("s["+l+"]-1"):(s.push("-1"),n.push("1"),i.push("s["+l+"]-2"));var c=".lo("+n.join()+").hi("+i.join()+")";if(0===n.length&&(c=""),r>0){o.push("if(1");for(var l=0;a>l;++l)e.indexOf(l+1)>=0||e.indexOf(-(l+1))>=0||o.push("&&s[",l,"]>2");o.push("){grad",r,"(src.pick(",s.join(),")",c);for(var l=0;a>l;++l)e.indexOf(l+1)>=0||e.indexOf(-(l+1))>=0||o.push(",dst.pick(",s.join(),",",l,")",c);o.push(");")}for(var l=0;l1){dst.set(",s.join(),",",u,",0.5*(src.get(",h.join(),")-src.get(",d.join(),")))}else{dst.set(",s.join(),",",u,",0)};"):o.push("if(s[",u,"]>1){diff(",f,",src.pick(",h.join(),")",c,",src.pick(",d.join(),")",c,");}else{zero(",f,");};");break;case"mirror":0===r?o.push("dst.set(",s.join(),",",u,",0);"):o.push("zero(",f,");");break;case"wrap":var p=s.slice(),g=s.slice();e[l]<0?(p[u]="s["+u+"]-2",g[u]="0"):(p[u]="s["+u+"]-1",g[u]="1"),0===r?o.push("if(s[",u,"]>2){dst.set(",s.join(),",",u,",0.5*(src.get(",p.join(),")-src.get(",g.join(),")))}else{dst.set(",s.join(),",",u,",0)};"):o.push("if(s[",u,"]>2){diff(",f,",src.pick(",p.join(),")",c,",src.pick(",g.join(),")",c,");}else{zero(",f,");};");break;default:throw new Error("ndarray-gradient: Invalid boundary condition")}}r>0&&o.push("};")}var r=t.join(),i=c[r];if(i)return i;for(var a=t.length,o=["function gradient(dst,src){var s=src.shape.slice();"],s=0;1<s;++s){for(var u=[],d=0;a>d;++d)s&1<=s;++s)v.push("grad"+s),m.push(n(s));v.push(o.join(""));var y=Function.apply(void 0,v),i=y.apply(void 0,m);return l[r]=i,i}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;nr;++r)for(o=o||e.surfaceProject[r],n=0;3>n;++n)s=s||e.contourProject[r][n];for(r=0;3>r;++r){var l=D.projections[r];for(n=0;16>n;++n)l[n]=0;for(n=0;4>n;++n)l[5*n]=1;l[5*r]=0,l[12+r]=e.axesBounds[+(a[r]>0)][r],k(l,t.model,l);var c=D.clipBounds[r];for(i=0;2>i;++i)for(n=0;3>n;++n)c[i][n]=t.clipBounds[i][n];c[0][r]=-1e8,c[1][r]=1e8}return D.showSurface=o,D.showContour=s,D}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||R,n.view=t.view||R,n.projection=t.projection||R,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;2>i;++i)for(var a=n.clipBounds[i],s=0;3>s;++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;var l=U;for(k(l,n.view,n.model),k(l,n.projection,l),A(l,l),i=0;3>i;++i)n.eyePosition[i]=l[12+i]/l[15];var c=l[15];for(i=0;3>i;++i)c+=this.lightPosition[i]*l[4*i+3];for(i=0;3>i;++i){var u=l[12+i];for(s=0;3>s;++s)u+=l[4*s+i]*this.lightPosition[s];n.lightPosition[i]=u/c}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;3>i;++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;3>i;++i)for(h.uniforms.permutation=I[i],r.lineWidth(this.contourWidth[i]),s=0;si;++i)for(h.uniforms.model=f.projections[i],h.uniforms.clipBounds=f.clipBounds[i],s=0;3>s;++s)if(this.contourProject[i][s]){h.uniforms.permutation=I[s],r.lineWidth(this.contourWidth[s]);for(var p=0;pi;++i)if(0!==this._dynamicCounts[i])for(h.uniforms.model=n.model,h.uniforms.clipBounds=n.clipBounds,h.uniforms.permutation=I[i],r.lineWidth(this.dynamicWidth[i]),h.uniforms.contourColor=this.dynamicColor[i],h.uniforms.contourTint=this.dynamicTint[i],h.uniforms.height=this.dynamicLevel[i],d.draw(r.LINES,this._dynamicCounts[i],this._dynamicOffsets[i]),s=0;3>s;++s)this.contourProject[s][i]&&(h.uniforms.model=f.projections[s],h.uniforms.clipBounds=f.clipBounds[s],d.draw(r.LINES,this._dynamicCounts[i],this._dynamicOffsets[i]));d.unbind()}}function l(t,e){var r=e.shape.slice(),n=t.shape.slice();b.assign(t.lo(1,1).hi(r[0],r[1]),e),b.assign(t.lo(1).hi(r[0],1),e.hi(r[0],1)),b.assign(t.lo(1,n[1]-1).hi(r[0],1),e.lo(0,r[1]-1).hi(r[0],1)),b.assign(t.lo(0,1).hi(1,r[1]),e.hi(1)),b.assign(t.lo(n[0]-1,1).hi(1,r[1]),e.lo(r[0]-1)),t.set(0,0,e.get(0,0)),t.set(0,n[1]-1,e.get(0,r[1]-1)),t.set(n[0]-1,0,e.get(r[0]-1,0)),t.set(n[0]-1,n[1]-1,e.get(r[0]-1,r[1]-1))}function c(t,e){return Array.isArray(t)?[e(t[0]),e(t[1]),e(t[2])]:[e(t),e(t),e(t)]}function u(t){return Array.isArray(t)?3===t.length?[t[0],t[1],t[2],1]:[t[0],t[1],t[2],t[3]]:[0,0,0,1]}function f(t){if(Array.isArray(t)){if(Array.isArray(t))return[u(t[0]),u(t[1]),u(t[2])];var e=u(t);return[e.slice(),e.slice(),e.slice()]}}function h(t){var e=t.gl,r=L(e),n=C(e),i=S(e),o=z(e),s=p(e),l=g(e,[{buffer:s,size:4,stride:P,offset:0},{buffer:s,size:3,stride:P,offset:16},{buffer:s,size:3,stride:P,offset:28}]),c=p(e),u=g(e,[{buffer:c,size:4,stride:20,offset:0},{buffer:c,size:1,stride:20,offset:16}]),f=p(e),h=g(e,[{buffer:f,size:2,type:e.FLOAT}]),d=v(e,1,N,e.RGBA,e.UNSIGNED_BYTE);d.minFilter=e.LINEAR,d.magFilter=e.LINEAR;var m=new a(e,[0,0],[[0,0,0],[0,0,0]],r,n,s,l,d,i,o,c,u,f,h),y={levels:[[],[],[]]};for(var b in t)y[b]=t[b];return y.colormap=y.colormap||"jet",m.update(y),m}e.exports=h;var d=t("bit-twiddle"),p=t("gl-buffer"),g=t("gl-vao"),v=t("gl-texture2d"),m=t("typedarray-pool"),y=t("colormap"),b=t("ndarray-ops"),x=t("ndarray-pack"),_=t("ndarray"),w=t("surface-nets"),k=t("gl-mat4/multiply"),A=t("gl-mat4/invert"),M=t("binary-search-bounds"),T=t("ndarray-gradient"),E=t("./lib/shaders"),L=E.createShader,S=E.createContourShader,C=E.createPickShader,z=E.createPickContourShader,P=40,R=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],O=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],I=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];!function(){for(var t=0;3>t;++t){var e=I[t],r=(t+1)%3,n=(t+2)%3;e[r+0]=1,e[n+3]=1,e[t+6]=1}}();var N=265,j=a.prototype;j.isTransparent=function(){return this.opacity<1},j.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;3>t;++t)if(this._contourCounts[t].length>0||this._dynamicCounts[t]>0)return!0;return!1},j.pickSlots=1,j.setPickBase=function(t){this.pickId=t};var F=[0,0,0],D={showSurface:!1,showContour:!1,projections:[R.slice(),R.slice(),R.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]},B={model:R,view:R,projection:R,inverseModel:R.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},U=R.slice(),V=[1,0,0,0,1,0,0,0,1];j.draw=function(t){return s.call(this,t,!1)},j.drawTransparent=function(t){return s.call(this,t,!0)};var q={model:R,view:R,projection:R,inverseModel:R,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]};j.drawPick=function(t){t=t||{};var e=this.gl;e.disable(e.CULL_FACE);var r=q;r.model=t.model||R,r.view=t.view||R,r.projection=t.projection||R,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;2>n;++n)for(var i=r.clipBounds[n],a=0;3>a;++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;3>n;++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 c=this._contourVAO;for(c.bind(),a=0;3>a;++a)for(e.lineWidth(this.contourWidth[a]),l.uniforms.permutation=I[a],n=0;nn;++n)for(l.uniforms.model=s.projections[n],l.uniforms.clipBounds=s.clipBounds[n],a=0;3>a;++a)if(this.contourProject[n][a]){l.uniforms.permutation=I[a],e.lineWidth(this.contourWidth[a]);for(var u=0;u>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 c=r.position;c[0]=c[1]=c[2]=0;for(var u=0;2>u;++u)for(var f=u?a:1-a,h=0;2>h;++h)for(var d=h?l:1-l,p=i+u,g=s+h,v=f*d,m=0;3>m;++m)c[m]+=this._field[m].get(p,g)*v;for(var y=this._pickResult.level,b=0;3>b;++b)if(y[b]=M.le(this.contourLevels[b],c[b]),y[b]<0)this.contourLevels[b].length>0&&(y[b]=0);else if(y[b]Math.abs(_-c[b])&&(y[b]+=1)}for(r.index[0]=.5>a?i:i+1,r.index[1]=.5>l?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],m=0;3>m;++m)r.dataCoordinate[m]=this._field[m].get(r.index[0],r.index[1]);return r},j.update=function(t){t=t||{},this.dirty=!0,"contourWidth"in t&&(this.contourWidth=c(t.contourWidth,Number)),"showContour"in t&&(this.showContour=c(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=c(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=f(t.contourColor)),"contourProject"in t&&(this.contourProject=c(t.contourProject,function(t){return c(t,Boolean)})),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=f(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=c(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=c(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"colorBounds"in t&&(this.colorBounds=t.colorBounds);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;2>o;++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;2>o;++o){var u=s[o];for(y=0;2>y;++y)if(u.shape[y]!==a[y])throw new Error("gl-surface: coords have incorrect shape");l(this._field[o],u)}}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;2>o;++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;2>o;++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;yo;++o)T(x.pick(o),b[o],"mirror");var k=_(m.mallocFloat(3*b[2].size),[a[0]+2,a[1]+2,3]);for(o=0;oI?(I=Math.max(Math.abs(z),Math.abs(P),Math.abs(R)),1e-8>I?(R=1,P=z=0,I=1):I=1/I):I=1/Math.sqrt(I),k.set(o,y,0,z*I),k.set(o,y,1,P*I),k.set(o,y,2,R*I)}m.free(x.data);var N=[1/0,1/0,1/0],j=[-(1/0),-(1/0),-(1/0)],F=1/0,D=-(1/0),B=(a[0]-1)*(a[1]-1)*6,U=m.mallocFloat(d.nextPow2(10*B)),V=0,q=0;for(o=0;oH;++H)for(var G=0;2>G;++G)for(var Y=0;3>Y;++Y){var X=this._field[Y].get(1+o+H,1+y+G);if(isNaN(X)||!isFinite(X))continue t}for(Y=0;6>Y;++Y){var W=o+O[Y][0],Z=y+O[Y][1],K=this._field[0].get(W+1,Z+1),$=this._field[1].get(W+1,Z+1);X=this._field[2].get(W+1,Z+1);var Q=X;z=k.get(W+1,Z+1,0),P=k.get(W+1,Z+1,1),R=k.get(W+1,Z+1,2),t.intensity&&(Q=t.intensity.get(W,Z)),U[V++]=W,U[V++]=Z,U[V++]=K,U[V++]=$,U[V++]=X,U[V++]=0,U[V++]=Q,U[V++]=z,U[V++]=P,U[V++]=R,N[0]=Math.min(N[0],K),N[1]=Math.min(N[1],$),N[2]=Math.min(N[2],X),F=Math.min(F,Q),j[0]=Math.max(j[0],K),j[1]=Math.max(j[1],$),j[2]=Math.max(j[2],X),D=Math.max(D,Q),q+=1}}for(t.intensityBounds&&(F=+t.intensityBounds[0],D=+t.intensityBounds[1]),o=6;V>o;o+=10)U[o]=(U[o]-F)/(D-F);this._vertexCount=q,this._coordinateBuffer.update(U.subarray(0,V)),m.freeFloat(U),m.free(k.data),this.bounds=[N,j],this.intensity=t.intensity||this._field[2],this.intensityBounds[0]===F&&this.intensityBounds[1]===D||(r=!0),this.intensityBounds=[F,D]}if("levels"in t){var J=t.levels;for(J=Array.isArray(J[0])?J.slice():[[],[],J],o=0;3>o;++o)J[o]=J[o].slice(),J.sort(function(t,e){return t-e});t:for(o=0;3>o;++o){if(J[o].length!==this.contourLevels[o].length){r=!0;break}for(y=0;yet;++et){J=this.contourLevels[et];var rt=[],nt=[],it=[0,0,0];for(o=0;oY;++Y){var st=at.positions[ot[Y]],lt=st[0],ct=0|Math.floor(lt),ut=lt-ct,ft=st[1],ht=0|Math.floor(ft),dt=ft-ht,pt=!1; e:for(var gt=0;3>gt;++gt){it[gt]=0;var vt=(et+gt+1)%3;for(H=0;2>H;++H){var mt=H?ut:1-ut;for(W=0|Math.min(Math.max(ct+H,0),a[0]),G=0;2>G;++G){var yt=G?dt:1-dt;if(Z=0|Math.min(Math.max(ht+G,0),a[1]),X=2>gt?this._field[vt].get(W,Z):(this.intensity.get(W,Z)-this.intensityBounds[0])/(this.intensityBounds[1]-this.intensityBounds[0]),!isFinite(X)||isNaN(X)){pt=!0;break e}var bt=mt*yt;it[gt]+=bt*X}}}if(pt){if(Y>0){for(var xt=0;5>xt;++xt)tt.pop();q-=1}continue t}tt.push(it[0],it[1],st[0],st[1],it[2]),q+=1}}nt.push(q)}this._contourOffsets[et]=rt,this._contourCounts[et]=nt}var _t=m.mallocFloat(tt.length);for(o=0;ot;++t)m.freeFloat(this._field[t].data)},j.highlight=function(t){if(!t)return this._dynamicCounts=[0,0,0],this.dyanamicLevel=[NaN,NaN,NaN],void(this.highlightLevel=[-1,-1,-1]);for(var e=0;3>e;++e)this.enableHighlight[e]?this.highlightLevel[e]=t.level[e]:this.highlightLevel[e]=-1;var r;if(r=this.snapToData?t.dataCoordinate:t.position,this.enableDynamic[0]&&r[0]!==this.dynamicLevel[0]||this.enableDynamic[1]&&r[1]!==this.dynamicLevel[1]||this.enableDynamic[2]&&r[2]!==this.dynamicLevel[2]){for(var n=0,i=this.shape,a=m.mallocFloat(12*i[0]*i[1]),o=0;3>o;++o)if(this.enableDynamic[o]){this.dynamicLevel[o]=r[o];var s=(o+1)%3,l=(o+2)%3,c=this._field[o],u=this._field[s],f=this._field[l],h=(this.intensity,w(c,r[o])),d=h.cells,p=h.positions;for(this._dynamicOffsets[o]=n,e=0;ev;++v){var y=p[g[v]],b=+y[0],x=0|b,_=0|Math.min(x+1,i[0]),k=b-x,A=1-k,M=+y[1],T=0|M,E=0|Math.min(T+1,i[1]),L=M-T,S=1-L,C=A*S,z=A*L,P=k*S,R=k*L,O=C*u.get(x,T)+z*u.get(x,E)+P*u.get(_,T)+R*u.get(_,E),I=C*f.get(x,T)+z*f.get(x,E)+P*f.get(_,T)+R*f.get(_,E);if(isNaN(O)||isNaN(I)){v&&(n-=1);break}a[2*n+0]=O,a[2*n+1]=I,n+=1}this._dynamicCounts[o]=n-this._dynamicOffsets[o]}else this.dynamicLevel[o]=NaN,this._dynamicCounts[o]=0;this._dynamicBuffer.update(a.subarray(0,2*n)),m.freeFloat(a)}}},{"./lib/shaders":216,"binary-search-bounds":217,"bit-twiddle":50,colormap:100,"gl-buffer":118,"gl-mat4/invert":137,"gl-mat4/multiply":139,"gl-texture2d":222,"gl-vao":226,ndarray:253,"ndarray-gradient":218,"ndarray-ops":252,"ndarray-pack":219,"surface-nets":272,"typedarray-pool":278}],222:[function(t,e,r){"use strict";function n(t){v=[t.LINEAR,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_NEAREST],m=[t.NEAREST,t.LINEAR,t.NEAREST_MIPMAP_NEAREST,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_LINEAR],y=[t.REPEAT,t.CLAMP_TO_EDGE,t.MIRRORED_REPEAT]}function i(t,e,r){var n=t.gl,i=n.getParameter(n.MAX_TEXTURE_SIZE);if(0>e||e>i||0>r||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 a(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 o(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 s(t,e,r,n,i,a,s,l){var c=l.dtype,u=l.shape.slice();if(u.length<2||u.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var f=0,h=0,v=o(u,l.stride.slice());"float32"===c?f=t.FLOAT:"float64"===c?(f=t.FLOAT,v=!1,c="float32"):"uint8"===c?f=t.UNSIGNED_BYTE:(f=t.UNSIGNED_BYTE,v=!1,c="uint8");var m=1;if(2===u.length)h=t.LUMINANCE,u=[u[0],u[1],1],l=d(l.data,u,[l.stride[0],l.stride[1],1],l.offset);else{if(3!==u.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===u[2])h=t.ALPHA;else if(2===u[2])h=t.LUMINANCE_ALPHA;else if(3===u[2])h=t.RGB;else{if(4!==u[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");h=t.RGBA}m=u[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 y=l.size,x=s.indexOf(n)<0;if(x&&s.push(n),f===a&&v)0===l.offset&&l.data.length===y?x?t.texImage2D(t.TEXTURE_2D,n,i,u[0],u[1],0,i,a,l.data):t.texSubImage2D(t.TEXTURE_2D,n,e,r,u[0],u[1],i,a,l.data):x?t.texImage2D(t.TEXTURE_2D,n,i,u[0],u[1],0,i,a,l.data.subarray(l.offset,l.offset+y)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,u[0],u[1],i,a,l.data.subarray(l.offset,l.offset+y));else{var _;_=a===t.FLOAT?g.mallocFloat32(y):g.mallocUint8(y);var w=d(_,u,[u[2],u[2]*u[0],1]);f===t.FLOAT&&a===t.UNSIGNED_BYTE?b(w,l):p.assign(w,l),x?t.texImage2D(t.TEXTURE_2D,n,i,u[0],u[1],0,i,a,_.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,u[0],u[1],i,a,_.subarray(0,y)),a===t.FLOAT?g.freeFloat32(_):g.freeUint8(_)}}function l(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 o=t.getParameter(t.MAX_TEXTURE_SIZE);if(0>e||e>o||0>r||r>o)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=l(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new a(t,s,e,r,n,i)}function u(t,e,r,n){var i=l(t);return t.texImage2D(t.TEXTURE_2D,0,r,r,n,e),new a(t,i,0|e.width,0|e.height,r,n)}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 s=o(n,e.stride.slice()),c=0;"float32"===r?c=t.FLOAT:"float64"===r?(c=t.FLOAT,s=!1,r="float32"):"uint8"===r?c=t.UNSIGNED_BYTE:(c=t.UNSIGNED_BYTE,s=!1,r="uint8");var u=0;if(2===n.length)u=t.LUMINANCE,n=[n[0],n[1],1],e=d(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])u=t.ALPHA;else if(2===n[2])u=t.LUMINANCE_ALPHA;else if(3===n[2])u=t.RGB;else{if(4!==n[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");u=t.RGBA}}c!==t.FLOAT||t.getExtension("OES_texture_float")||(c=t.UNSIGNED_BYTE,s=!1);var f,h,v=e.size;if(s)f=0===e.offset&&e.data.length===v?e.data:e.data.subarray(e.offset,e.offset+v);else{var m=[n[2],n[2]*n[0],1];h=g.malloc(v,r);var y=d(h,n,m,0);"float32"!==r&&"float64"!==r||c!==t.UNSIGNED_BYTE?p.assign(y,e):b(y,e),f=h.subarray(0,v)}var x=l(t);return t.texImage2D(t.TEXTURE_2D,0,u,n[0],n[1],0,u,c,f),s||g.free(h),new a(t,x,n[0],n[1],u,c)}function h(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];if(e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof HTMLVideoElement||e instanceof ImageData)return u(t,e,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 d=t("ndarray"),p=t("ndarray-ops"),g=t("typedarray-pool");e.exports=h;var v=null,m=null,y=null,b=function(t,e){p.muls(t,e,255)},x=a.prototype;Object.defineProperties(x,{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)),m.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)),m.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=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(),y.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(),y.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;2>e;++e)if(y.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|t,i(this,t,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t=0|t,i(this,this._shape[0],t),t}}}),x.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},x.dispose=function(){this.gl.deleteTexture(this.handle)},x.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)},x.setPixels=function(t,e,r,n){var i=this.gl;if(this.bind(),Array.isArray(e)?(n=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),n=n||0,t instanceof HTMLCanvasElement||t instanceof ImageData||t instanceof HTMLImageElement||t instanceof HTMLVideoElement){var a=this._mipLevels.indexOf(n)<0;a?(i.texImage2D(i.TEXTURE_2D,0,this.format,this.format,this.type,t),this._mipLevels.push(n)):i.texSubImage2D(i.TEXTURE_2D,n,e,r,this.format,this.type,t)}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||0>e||0>r)throw new Error("gl-texture2d: Texture dimensions are out of bounds");s(i,e,r,n,this.format,this.type,this._mipLevels,t)}}},{ndarray:253,"ndarray-ops":252,"typedarray-pool":278}],223:[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;ii;++i)t.disableVertexAttribArray(i)}else{t.bindBuffer(t.ARRAY_BUFFER,null);for(var i=0;n>i;++i)t.disableVertexAttribArray(i)}}e.exports=n},{}],224:[function(t,e,r){"use strict";function n(t){this.gl=t,this._elements=null,this._attributes=null,this._elementsType=t.UNSIGNED_SHORT}function i(t){return new n(t)}var a=t("./do-bind.js");n.prototype.bind=function(){a(this.gl,this._elements,this._attributes)},n.prototype.update=function(t,e,r){this._elements=e,this._attributes=t,this._elementsType=r||this.gl.UNSIGNED_SHORT},n.prototype.dispose=function(){},n.prototype.unbind=function(){},n.prototype.draw=function(t,e,r){r=r||0;var n=this.gl;this._elements?n.drawElements(t,e,this._elementsType,r):n.drawArrays(t,r,e)},e.exports=i},{"./do-bind.js":223}],225:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){this.location=t,this.dimension=e,this.a=r,this.b=n,this.c=i,this.d=a}function i(t,e,r){this.gl=t,this._ext=e,this.handle=r,this._attribs=[],this._useElements=!1,this._elementsType=t.UNSIGNED_SHORT}function a(t,e){return new i(t,e,e.createVertexArrayOES())}var o=t("./do-bind.js");n.prototype.bind=function(t){switch(this.dimension){case 1:t.vertexAttrib1f(this.location,this.a);break;case 2:t.vertexAttrib2f(this.location,this.a,this.b);break;case 3:t.vertexAttrib3f(this.location,this.a,this.b,this.c);break;case 4:t.vertexAttrib4f(this.location,this.a,this.b,this.c,this.d)}},i.prototype.bind=function(){this._ext.bindVertexArrayOES(this.handle);for(var t=0;tF;){switch(e=F,B){case f:F=L();break;case h:F=E();break;case d:F=T();break;case p:F=S();break;case g:F=P();break;case w:F=z();break;case v:F=R();break;case u:F=O();break;case x:F=M();break;case c:F=A()}if(e!==F)switch(W[e]){case"\n":H=0,++q;break;default:++H}}return D+=F,W=W.slice(F),V}function n(t){return U.length&&e(U.join("")),B=_,e("(eof)"),V}function A(){return U=U.length?[]:U,"/"===N&&"*"===I?(G=D+F-1,B=f,N=I,F+1):"/"===N&&"/"===I?(G=D+F-1,B=h,N=I,F+1):"#"===I?(B=d,G=D+F,F):/\s/.test(I)?(B=x,G=D+F,F):(Y=/\d/.test(I),X=/[^\w_]/.test(I),G=D+F,B=Y?g:X?p:u,F)}function M(){return/[^\s]/g.test(I)?(e(U.join("")),B=c,F):(U.push(I),N=I,F+1)}function T(){return"\n"===I&&"\\"!==N?(e(U.join("")),B=c,F):(U.push(I),N=I,F+1)}function E(){return T()}function L(){return"/"===I&&"*"===N?(U.push(I),e(U.join("")),B=c,F+1):(U.push(I),N=I,F+1)}function S(){if("."===N&&/\d/.test(I))return B=v,F;if("/"===N&&"*"===I)return B=f,F;if("/"===N&&"/"===I)return B=h,F;if("."===I&&U.length){for(;C(U););return B=v,F}if(";"===I||")"===I||"("===I){if(U.length)for(;C(U););return e(I),B=c,F+1}var t=2===U.length&&"="!==I;if(/[\w_\d\s]/.test(I)||t){for(;C(U););return B=c,F}return U.push(I),N=I,F+1}function C(t){for(var r,n,i=0;;){if(r=a.indexOf(t.slice(0,t.length+i).join("")),n=a[r],-1===r){if(i--+t.length>0)continue;n=t.slice(0,1).join("")}return e(n),G+=n.length,U=U.slice(n.length),U.length}}function z(){return/[^a-fA-F0-9]/.test(I)?(e(U.join("")),B=c,F):(U.push(I),N=I,F+1)}function P(){return"."===I?(U.push(I),B=v,N=I,F+1):/[eE]/.test(I)?(U.push(I),B=v,N=I,F+1):"x"===I&&1===U.length&&"0"===U[0]?(B=w,U.push(I),N=I,F+1):/[^\d]/.test(I)?(e(U.join("")),B=c,F):(U.push(I),N=I,F+1)}function R(){return"f"===I&&(U.push(I),N=I,F+=1),/[eE]/.test(I)?(U.push(I),N=I,F+1):"-"===I&&/[eE]/.test(N)?(U.push(I),N=I,F+1):/[^\d]/.test(I)?(e(U.join("")),B=c,F):(U.push(I),N=I,F+1)}function O(){if(/[^\d\w_]/.test(I)){var t=U.join("");return B=K.indexOf(t)>-1?b:Z.indexOf(t)>-1?y:m,e(U.join("")),B=c,F}return U.push(I),N=I,F+1}var I,N,j,F=0,D=0,B=c,U=[],V=[],q=1,H=0,G=0,Y=!1,X=!1,W="";t=t||{};var Z=o,K=i;return"300 es"===t.version&&(Z=l,K=s),function(t){return V=[],null!==t?r(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"),c=999,u=9999,f=0,h=1,d=2,p=3,g=4,v=5,m=6,y=7,b=8,x=9,_=10,w=11,k=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":230,"./lib/builtins-300es":229,"./lib/literals":232,"./lib/literals-300es":231,"./lib/operators":233}],229:[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":230}],230:[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"]},{}],231:[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":232}],232:[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"]},{}],233:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],234:[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":228}],235:[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 u(t.vertices,e.vertices)}function o(t){for(var e=["function orient(){var tuple=this.tuple;return test("],r=0;t>=r;++r)r>0&&e.push(","),e.push("tuple[",r,"]");e.push(")}return orient");var n=new Function("test",e.join("")),i=c[t+1];return i||(i=c),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;t>=n;++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(i>=r)throw new Error("Must input at least d+1 points");var a=t.slice(0,i+1),o=c.apply(void 0,a);if(0===o)throw new Error("Input not in general position");for(var l=new Array(i+1),u=0;i>=u;++u)l[u]=u;0>o&&(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),u=0;i>=u;++u){for(var p=l.slice(),g=0;i>=g;++g)g===u&&(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[u]=m,d[u]=m}d[i+1]=f;for(var u=0;i>=u;++u)for(var p=h[u].vertices,y=h[u].adjacent,g=0;i>=g;++g){var b=p[g];if(0>b)y[g]=f;else for(var x=0;i>=x;++x)h[x].vertices.indexOf(b)<0&&(y[g]=h[x])}for(var _=new s(i,a,d),w=!!e,u=i+1;r>u;++u)_.insert(t[u],w);return _.boundary()}e.exports=l;var c=t("robust-orientation"),u=t("simplicial-complex").compareCells;n.prototype.flip=function(){var t=this.vertices[0];this.vertices[0]=this.vertices[1],this.vertices[1]=t;var e=this.adjacent[0];this.adjacent[0]=this.adjacent[1],this.adjacent[1]=e};var f=[],h=s.prototype;h.handleBoundaryDegeneracy=function(t,e){var r=this.dimension,n=this.vertices.length-1,i=this.tuple,a=this.vertices,o=[t];for(t.lastVisited=-n;o.length>0;){t=o.pop();for(var s=(t.vertices,t.adjacent),l=0;r>=l;++l){var c=s[l];if(c.boundary&&!(c.lastVisited<=-n)){for(var u=c.vertices,f=0;r>=f;++f){var h=u[f];0>h?i[f]=e:i[f]=a[h]}var d=this.orient();if(d>0)return c;c.lastVisited=-n,0===d&&o.push(c)}}}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,c=s.adjacent,u=0;n>=u;++u)a[u]=i[l[u]];s.lastVisited=r;for(var u=0;n>=u;++u){var f=c[u];if(!(f.lastVisited>=r)){var h=a[u];a[u]=t;var d=this.orient();if(a[u]=h,0>d){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,c=this.interior,u=this.simplices,f=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,c.push(e);for(var h=[];f.length>0;){var e=f.pop(),d=e.vertices,p=e.adjacent,g=d.indexOf(r);if(!(0>g))for(var v=0;o>=v;++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;o>=x;++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,c.push(m),f.push(m),m.lastVisited=r;continue}m.lastVisited=-r}var w=m.adjacent,k=d.slice(),A=p.slice(),M=new n(k,A,!0);u.push(M);var T=w.indexOf(e);if(!(0>T)){w[T]=M,A[g]=m,k[v]=-1,A[v]=e,p[v]=M,M.flip();for(var x=0;o>=x;++x){var E=k[x];if(!(0>E||E===r)){for(var L=new Array(o-1),S=0,C=0;o>=C;++C){var z=k[C];0>z||C===x||(L[S++]=z)}h.push(new i(L,M,x))}}}}}}h.sort(a);for(var v=0;v+1O||0>I||(P.cell.adjacent[P.index]=R.cell,R.cell.adjacent[R.index]=P.cell)}},h.insert=function(t,e){var r=this.vertices;r.push(t);var n=this.walk(t,e);if(n){for(var i=this.dimension,a=this.tuple,o=0;i>=o;++o){var s=n.vertices[o];0>s?a[o]=t:a[o]=r[s]}var l=this.orient(a);0>l||(0!==l||(n=this.handleBoundaryDegeneracy(n,t)))&&this.addPeaks(t,n)}},h.boundary=function(){for(var t=this.dimension,e=[],r=this.simplices,n=r.length,i=0;n>i;++i){var a=r[i];if(a.boundary){for(var o=new Array(t),s=a.vertices,l=0,c=0,u=0;t>=u;++u)s[u]>=0?o[l++]=s[u]:c=1&u;if(c===(1&t)){var f=o[0];o[0]=o[1],o[1]=f}e.push(o)}}return e}},{"robust-orientation":259,"simplicial-complex":238}],236:[function(t,e,r){arguments[4][50][0].apply(r,arguments)},{dup:50}],237:[function(t,e,r){arguments[4][97][0].apply(r,arguments)},{dup:97}],238:[function(t,e,r){"use strict";"use restrict";function n(t){for(var e=0,r=Math.max,n=0,i=t.length;i>n;++n)e=r(e,t[n].length);return e-1}function i(t){for(var e=-1,r=Math.max,n=0,i=t.length;i>n;++n)for(var a=t[n],o=0,s=a.length;s>o;++o)e=r(e,a[o]);return e+1}function a(t){for(var e=new Array(t.length),r=0,n=t.length;n>r;++r)e[r]=t[r].slice(0);return e}function o(t,e){var r=t.length,n=t.length-e.length,i=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:var a=t[0]+t[1]-e[0]-e[1];return a?a:i(t[0],t[1])-i(e[0],e[1]);case 3:var o=t[0]+t[1],s=e[0]+e[1];if(a=o+t[2]-(s+e[2]))return a;var l=i(t[0],t[1]),c=i(e[0],e[1]),a=i(l,t[2])-i(c,e[2]);return a?a:i(l+t[2],o)-i(c+e[2],s);default:var u=t.slice(0);u.sort();var f=e.slice(0);f.sort();for(var h=0;r>h;++h)if(n=u[h]-f[h])return n;return 0}}function s(t,e){return o(t[0],e[0])}function l(t,e){if(e){for(var r=t.length,n=new Array(r),i=0;r>i;++i)n[i]=[t[i],e[i]];n.sort(s);for(var i=0;r>i;++i)t[i]=n[i][0],e[i]=n[i][1];return t}return t.sort(o),t}function c(t){if(0===t.length)return[];for(var e=1,r=t.length,n=1;r>n;++n){var i=t[n];if(o(i,t[n-1])){if(n===e){e++;continue}t[e++]=i}}return t.length=e,t}function u(t,e){for(var r=0,n=t.length-1,i=-1;n>=r;){var a=r+n>>1,s=o(t[a],e);0>=s?(0===s&&(i=a),r=a+1):s>0&&(n=a-1)}return i}function f(t,e){for(var r=new Array(t.length),n=0,i=r.length;i>n;++n)r[n]=[];for(var a=[],n=0,s=e.length;s>n;++n)for(var l=e[n],c=l.length,f=1,h=1<f;++f){a.length=b.popCount(f);for(var d=0,p=0;c>p;++p)f&1<g))for(;;)if(r[g++].push(n),g>=t.length||0!==o(t[g],a))break}return r}function h(t,e){if(!e)return f(c(p(t,0)),t,0);for(var r=new Array(e),n=0;e>n;++n)r[n]=[];for(var n=0,i=t.length;i>n;++n)for(var a=t[n],o=0,s=a.length;s>o;++o)r[a[o]].push(n);return r}function d(t){for(var e=[],r=0,n=t.length;n>r;++r)for(var i=t[r],a=0|i.length,o=1,s=1<o;++o){for(var c=[],u=0;a>u;++u)o>>>u&1&&c.push(i[u]);e.push(c)}return l(e)}function p(t,e){if(0>e)return[];for(var r=[],n=(1<r;++r)for(var i=t[r],a=0,o=i.length;o>a;++a){for(var s=new Array(i.length-1),c=0,u=0;o>c;++c)c!==a&&(s[u++]=i[c]);e.push(s)}return l(e)}function v(t,e){for(var r=new x(e),n=0;nr;++r)e[r]=r;return e}e.exports=n},{}],240:[function(t,e,r){e.exports=function(t){return!(null==t||!(t._isBuffer||t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)))}},{}],241:[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!==h||a!==d||o!==p||r(n))&&(h=0|t,d=a||0,p=o||0,e(h,d,p,g))}function a(t){n(0,t)}function o(){(h||d||p||g.shift||g.alt||g.meta||g.control)&&(d=p=0,h=0,g.shift=g.alt=g.control=g.meta=!1,e(0,0,0,g))}function s(t){r(t)&&e(h,d,p,g)}function l(t){0===i.buttons(t)?n(0,t):n(h,t)}function c(t){n(h|i.buttons(t),t)}function u(t){n(h&~i.buttons(t),t)}function f(){v||(v=!0,t.addEventListener("mousemove",l),t.addEventListener("mousedown",c),t.addEventListener("mouseup",u),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)))}e||(e=t,t=window);var h=0,d=0,p=0,g={shift:!1,alt:!1,control:!1,meta:!1},v=!1;f();var m={element:t};return Object.defineProperties(m,{enabled:{get:function(){return v},set:function(t){t&&f()},enumerable:!0},buttons:{get:function(){return h},enumerable:!0},x:{get:function(){return d},enumerable:!0},y:{get:function(){return p},enumerable:!0},mods:{get:function(){return g},enumerable:!0}}),m}e.exports=n;var i=t("mouse-event")},{"mouse-event":242}],242:[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&&r=0&&r+1=0&&n=0&&n+1=0&&s=0&&s+1=0&&i=0&&i+1=0&&l=0&&l+1=0&&h=0&&h+1e;++e)r=+arguments[e+1],i[e]=Math.floor(r),a[e]=r-i[e],o[e]=0<=i[e]&&i[e]e;++e){for(c=1,u=t.offset,l=0;n>l;++l)if(e&1<r;++r){t[r]=o[(n+1)*n+r];for(var i=0;n>i;++i)t[r]+=o[(n+1)*i+r]*e[i]}for(var a=o[(n+1)*(n+1)-1],i=0;n>i;++i)a+=o[(n+1)*i+n]*e[i];for(var s=1/a,r=0;n>r;++r)t[r]*=s;return t}),t}var i=t("ndarray-warp"),a=t("gl-matrix-invert");e.exports=n},{"gl-matrix-invert":247,"ndarray-warp":250}],252:[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]=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 c={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in c){var e=c[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 u={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in u){var e=u[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":109}],253:[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;te&&(r="View_Nil"+t);var n="generic"===t;if(-1===e){var a="function "+r+"(a){this.data=a;};var proto="+r+".prototype;proto.dtype='"+t+"';proto.index=function(){return -1};proto.size=0;proto.dimension=-1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function(){return new "+r+"(this.data);};proto.get=proto.set=function(){};proto.pick=function(){return null};return function construct_"+r+"(a){return new "+r+"(a);}",o=new Function(a);return o()}if(0===e){var a="function "+r+"(a,d) {this.data = a;this.offset = d};var proto="+r+".prototype;proto.dtype='"+t+"';proto.index=function(){return this.offset};proto.dimension=0;proto.size=1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function "+r+"_copy() {return new "+r+"(this.data,this.offset)};proto.pick=function "+r+"_pick(){return TrivialArray(this.data);};proto.valueOf=proto.get=function "+r+"_get(){return "+(n?"this.data.get(this.offset)":"this.data[this.offset]")+"};proto.set=function "+r+"_set(v){return "+(n?"this.data.set(this.offset,v)":"this.data[this.offset]=v")+"};return function construct_"+r+"(a,b,c,d){return new "+r+"(a,d)}",o=new Function("TrivialArray",a);return o(f[t][0])}var a=["'use strict'"],s=l(e),c=s.map(function(t){return"i"+t}),u="this.offset+"+s.map(function(t){return"this.stride["+t+"]*i"+t}).join("+"),h=s.map(function(t){return"b"+t}).join(","),d=s.map(function(t){return"c"+t}).join(",");a.push("function "+r+"(a,"+h+","+d+",d){this.data=a","this.shape=["+h+"]","this.stride=["+d+"]","this.offset=d|0}","var proto="+r+".prototype","proto.dtype='"+t+"'","proto.dimension="+e),a.push("Object.defineProperty(proto,'size',{get:function "+r+"_size(){return "+s.map(function(t){return"this.shape["+t+"]"}).join("*"),"}})"),1===e?a.push("proto.order=[0]"):(a.push("Object.defineProperty(proto,'order',{get:"),4>e?(a.push("function "+r+"_order(){"),2===e?a.push("return (Math.abs(this.stride[0])>Math.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("+c.join(",")+",v){"),n?a.push("return this.data.set("+u+",v)}"):a.push("return this.data["+u+"]=v}"),a.push("proto.get=function "+r+"_get("+c.join(",")+"){"),n?a.push("return this.data.get("+u+")}"):a.push("return this.data["+u+"]}"),a.push("proto.index=function "+r+"_index(",c.join(),"){return "+u+"}"),a.push("proto.hi=function "+r+"_hi("+c.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+"]"});a.push("proto.lo=function "+r+"_lo("+c.join(",")+"){var b=this.offset,d=0,"+p.join(",")+","+g.join(","));for(var v=0;e>v;++v)a.push("if(typeof i"+v+"==='number'&&i"+v+">=0){d=i"+v+"|0;b+=c"+v+"*d;a"+v+"-=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("+c.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 v=0;e>v;++v)a.push("if(typeof i"+v+"==='number'){d=i"+v+"|0;if(d<0){c+=b"+v+"*(a"+v+"-1);a"+v+"=ceil(-a"+v+"/d)}else{a"+v+"=ceil(a"+v+"/d)}b"+v+"*=d}");a.push("return new "+r+"(this.data,"+s.map(function(t){return"a"+t}).join(",")+","+s.map(function(t){return"b"+t}).join(",")+",c)}");for(var m=new Array(e),y=new Array(e),v=0;e>v;++v)m[v]="a[i"+v+"]",y[v]="b[i"+v+"]";a.push("proto.transpose=function "+r+"_transpose("+c+"){"+c.map(function(t,e){return t+"=("+t+"===undefined?"+e+":"+t+"|0)"}).join(";"),"var a=this.shape,b=this.stride;return new "+r+"(this.data,"+m.join(",")+","+y.join(",")+",this.offset)}"),a.push("proto.pick=function "+r+"_pick("+c+"){var a=[],b=[],c=this.offset");for(var v=0;e>v;++v)a.push("if(typeof i"+v+"==='number'&&i"+v+">=0){c=(c+this.stride["+v+"]*i"+v+")|0}else{a.push(this.shape["+v+"]);b.push(this.stride["+v+"])}");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(f[t],i)}function o(t){if(c(t))return"buffer";if(u)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=f.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,c=1;l>=0;--l)r[l]=c,c*=e[l]}if(void 0===n){n=0;for(var l=0;s>l;++l)r[l]<0&&(n-=(e[l]-1)*r[l])}for(var u=o(t),h=f[u];h.length<=s+1;)h.push(a(u,h.length-1));var i=h[s+1];return i(t,e,r,n)}var l=t("iota-array"),c=t("is-buffer"),u="undefined"!=typeof Float64Array,f={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};e.exports=s},{"iota-array":239,"is-buffer":240}],254:[function(t,e,r){"use strict";function n(t,e){if("string"!=typeof t)throw new TypeError("repeat-string expects a string.");if(1===e)return t;if(2===e)return t+t;var r=t.length*e;for(i===t&&"undefined"!=typeof i||(i=t,a="");r>a.length&&e>0&&(1&e&&(a+=t),e>>=1);)t+=t;return a.substr(0,r)}var i,a="";e.exports=n},{}],255:[function(t,e,r){(function(t){e.exports=t.performance&&t.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],256:[function(t,e,r){"use strict";function n(t){for(var e="robustLinearSolve"+t+"d",r=["function ",e,"(A,b){return ["],n=0;t>n;++n){r.push("det([");for(var i=0;t>i;++i){i>0&&r.push(","),r.push("[");for(var a=0;t>a;++a)a>0&&r.push(","),a===n?r.push("+b[",i,"]"):r.push("+A[",i,"][",a,"]");r.push("]")}r.push("]),")}r.push("det(A)]}return ",e);var o=new Function("det",r.join(""));return o(6>t?s[t]:s)}function i(){return[0]}function a(t,e){return[[e[0]],[t[0][0]]]}function o(){for(;c.lengthi;++i)t.push("s"+i),r.push("case ",i,":return s",i,"(A,b);");r.push("}var s=CACHE[A.length];if(!s)s=CACHE[A.length]=g(A.length);return s(A,b)}return dispatchLinearSolve"),t.push("CACHE","g",r.join(""));var a=Function.apply(void 0,t);e.exports=a.apply(void 0,c.concat([c,n]));for(var i=0;l>i;++i)e.exports[i]=c[i]}var s=t("robust-determinant"),l=6,c=[i,a];o()},{"robust-determinant":258}],257:[function(t,e,r){"use strict";function n(t){for(var e=t.length,r=t[t.length-1],n=e,i=e-2;i>=0;--i){var a=r,o=t[i];r=a+o;var s=r-a,l=o-s;l&&(t[--n]=r,r=l)}for(var c=0,i=n;e>i;++i){var a=t[i],o=r;r=a+o;var s=r-a,l=o-s;l&&(t[c++]=l)}return t[c++]=r,t.length=c,t}e.exports=n},{}],258:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(t.length-1),n=1;nr;++r){e[r]=new Array(t);for(var n=0;t>n;++n)e[r][n]=["m[",r,"][",n,"]"].join("")}return e}function a(t){return 1&t?"-":""}function o(t){if(1===t.length)return t[0];if(2===t.length)return["sum(",t[0],",",t[1],")"].join("");var e=t.length>>1;return["sum(",o(t.slice(0,e)),",",o(t.slice(e)),")"].join("")}function s(t){if(2===t.length)return["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("");for(var e=[],r=0;rn;++n)t.push("det"+n),r.push("case ",n,":return det",n,"(m);");r.push("}var det=CACHE[m.length];if(!det)det=CACHE[m.length]=gen(m.length);return det(m);}return robustDeterminant"),t.push("CACHE","gen",r.join(""));var i=Function.apply(void 0,t);e.exports=i.apply(void 0,g.concat([g,l]));for(var n=0;nr;++r){e[r]=new Array(t);for(var n=0;t>n;++n)e[r][n]=["m",n,"[",t-r-1,"]"].join("")}return e}function a(t){return 1&t?"-":""}function o(t){if(1===t.length)return t[0];if(2===t.length)return["sum(",t[0],",",t[1],")"].join("");var e=t.length>>1;return["sum(",o(t.slice(0,e)),",",o(t.slice(e)),")"].join("")}function s(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],r=0;rc;++c)0===(1&c)?e.push.apply(e,s(n(a,c))):r.push.apply(r,s(n(a,c))),l.push("m"+c);var u=o(e),g=o(r),v="orientation"+t+"Exact",m=["function ",v,"(",l.join(),"){var p=",u,",n=",g,",d=sub(p,n);return d[d.length-1];};return ",v].join(""),y=new Function("sum","prod","scale","sub",m);return y(h,f,d,p)}function c(t){var e=_[t.length];return e||(e=_[t.length]=l(t.length)),e.apply(void 0,t)}function u(){for(;_.length<=g;)_.push(l(_.length));for(var t=[],r=["slow"],n=0;g>=n;++n)t.push("a"+n),r.push("o"+n);for(var i=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"],n=2;g>=n;++n)i.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i=n;++n)e.exports[n]=_[n]}var f=t("two-product"),h=t("robust-sum"),d=t("robust-scale"),p=t("robust-subtract"),g=5,v=1.1102230246251565e-16,m=(3+16*v)*v,y=(7+56*v)*v,b=l(3),x=l(4),_=[function(){return 0},function(){return 0},function(t,e){return e[0]-t[0]},function(t,e,r){var n,i=(t[1]-r[1])*(e[0]-r[0]),a=(t[0]-r[0])*(e[1]-r[1]),o=i-a;if(i>0){if(0>=a)return o;n=i+a}else{if(!(0>i))return o;if(a>=0)return o;n=-(i+a)}var s=m*n;return o>=s||-s>=o?o:b(t,e,r)},function(t,e,r,n){ -var i=t[0]-n[0],a=e[0]-n[0],o=r[0]-n[0],s=t[1]-n[1],l=e[1]-n[1],c=r[1]-n[1],u=t[2]-n[2],f=e[2]-n[2],h=r[2]-n[2],d=a*c,p=o*l,g=o*s,v=i*c,m=i*l,b=a*s,_=u*(d-p)+f*(g-v)+h*(m-b),w=(Math.abs(d)+Math.abs(p))*Math.abs(u)+(Math.abs(g)+Math.abs(v))*Math.abs(f)+(Math.abs(m)+Math.abs(b))*Math.abs(h),k=y*w;return _>k||-_>k?_:x(t,e,r,n)}];u()},{"robust-scale":260,"robust-subtract":261,"robust-sum":262,"two-product":276}],260:[function(t,e,r){"use strict";function n(t,e){var r=t.length;if(1===r){var n=i(t[0],e);return n[0]?n:[n[1]]}var o=new Array(2*r),s=[.1,.1],l=[.1,.1],c=0;i(t[0],e,s),s[0]&&(o[c++]=s[0]);for(var u=1;r>u;++u){i(t[u],e,l);var f=s[1];a(f,l[0],s),s[0]&&(o[c++]=s[0]);var h=l[1],d=s[1],p=h+d,g=p-h,v=d-g;s[1]=p,v&&(o[c++]=v)}return s[1]&&(o[c++]=s[1]),0===c&&(o[c++]=0),o.length=c,o}var i=t("two-product"),a=t("two-sum");e.exports=n},{"two-product":276,"two-sum":277}],261:[function(t,e,r){"use strict";function n(t,e){var r=t+e,n=r-t,i=r-n,a=e-n,o=t-i,s=o+a;return s?[s,r]:[r]}function i(t,e){var r=0|t.length,i=0|e.length;if(1===r&&1===i)return n(t[0],-e[0]);var a,o,s=r+i,l=new Array(s),c=0,u=0,f=0,h=Math.abs,d=t[u],p=h(d),g=-e[f],v=h(g);v>p?(o=d,u+=1,r>u&&(d=t[u],p=h(d))):(o=g,f+=1,i>f&&(g=-e[f],v=h(g))),r>u&&v>p||f>=i?(a=d,u+=1,r>u&&(d=t[u],p=h(d))):(a=g,f+=1,i>f&&(g=-e[f],v=h(g)));for(var m,y,b,x,_,w=a+o,k=w-a,A=o-k,M=A,T=w;r>u&&i>f;)v>p?(a=d,u+=1,r>u&&(d=t[u],p=h(d))):(a=g,f+=1,i>f&&(g=-e[f],v=h(g))),o=M,w=a+o,k=w-a,A=o-k,A&&(l[c++]=A),m=T+w,y=m-T,b=m-y,x=w-y,_=T-b,M=_+x,T=m;for(;r>u;)a=d,o=M,w=a+o,k=w-a,A=o-k,A&&(l[c++]=A),m=T+w,y=m-T,b=m-y,x=w-y,_=T-b,M=_+x,T=m,u+=1,r>u&&(d=t[u]);for(;i>f;)a=g,o=M,w=a+o,k=w-a,A=o-k,A&&(l[c++]=A),m=T+w,y=m-T,b=m-y,x=w-y,_=T-b,M=_+x,T=m,f+=1,i>f&&(g=-e[f]);return M&&(l[c++]=M),T&&(l[c++]=T),c||(l[c++]=0),l.length=c,l}e.exports=i},{}],262:[function(t,e,r){"use strict";function n(t,e){var r=t+e,n=r-t,i=r-n,a=e-n,o=t-i,s=o+a;return s?[s,r]:[r]}function i(t,e){var r=0|t.length,i=0|e.length;if(1===r&&1===i)return n(t[0],e[0]);var a,o,s=r+i,l=new Array(s),c=0,u=0,f=0,h=Math.abs,d=t[u],p=h(d),g=e[f],v=h(g);v>p?(o=d,u+=1,r>u&&(d=t[u],p=h(d))):(o=g,f+=1,i>f&&(g=e[f],v=h(g))),r>u&&v>p||f>=i?(a=d,u+=1,r>u&&(d=t[u],p=h(d))):(a=g,f+=1,i>f&&(g=e[f],v=h(g)));for(var m,y,b,x,_,w=a+o,k=w-a,A=o-k,M=A,T=w;r>u&&i>f;)v>p?(a=d,u+=1,r>u&&(d=t[u],p=h(d))):(a=g,f+=1,i>f&&(g=e[f],v=h(g))),o=M,w=a+o,k=w-a,A=o-k,A&&(l[c++]=A),m=T+w,y=m-T,b=m-y,x=w-y,_=T-b,M=_+x,T=m;for(;r>u;)a=d,o=M,w=a+o,k=w-a,A=o-k,A&&(l[c++]=A),m=T+w,y=m-T,b=m-y,x=w-y,_=T-b,M=_+x,T=m,u+=1,r>u&&(d=t[u]);for(;i>f;)a=g,o=M,w=a+o,k=w-a,A=o-k,A&&(l[c++]=A),m=T+w,y=m-T,b=m-y,x=w-y,_=T-b,M=_+x,T=m,f+=1,i>f&&(g=e[f]);return M&&(l[c++]=M),T&&(l[c++]=T),c||(l[c++]=0),l.length=c,l}e.exports=i},{}],263:[function(t,e,r){"use strict";function n(t){return t.split("").map(function(t){return t in i?i[t]:""}).join("")}e.exports=n;var i={" ":" ",0:"\u2070",1:"\xb9",2:"\xb2",3:"\xb3",4:"\u2074",5:"\u2075",6:"\u2076",7:"\u2077",8:"\u2078",9:"\u2079","+":"\u207a","-":"\u207b",a:"\u1d43",b:"\u1d47",c:"\u1d9c",d:"\u1d48",e:"\u1d49",f:"\u1da0",g:"\u1d4d",h:"\u02b0",i:"\u2071",j:"\u02b2",k:"\u1d4f",l:"\u02e1",m:"\u1d50",n:"\u207f",o:"\u1d52",p:"\u1d56",r:"\u02b3",s:"\u02e2",t:"\u1d57",u:"\u1d58",v:"\u1d5b",w:"\u02b7",x:"\u02e3",y:"\u02b8",z:"\u1dbb"}},{}],264:[function(t,e,r){"use strict";function n(t){return"a"+t}function i(t){return"d"+t}function a(t,e){return"c"+t+"_"+e}function o(t){return"s"+t}function s(t,e){return"t"+t+"_"+e}function l(t){return"o"+t}function c(t){return"x"+t}function u(t){return"p"+t}function f(t,e){return"d"+t+"_"+e}function h(t){return"i"+t}function d(t,e){return"u"+t+"_"+e}function p(t){return"b"+t}function g(t){return"y"+t}function v(t){return"e"+t}function m(t){return"v"+t}function y(t,e,r){for(var n=0,i=0;t>i;++i)e&1<e;++e)F.push(u(e),"+=",d(e,x[t]),";");F.push("}")}function z(t){for(var e=t-1;e>=0;--e)S(e,0);for(var r=[],e=0;I>e;++e)L[e]?r.push(i(e)+".get("+u(e)+")"):r.push(i(e)+"["+u(e)+"]");for(var e=0;b>e;++e)r.push(c(e));F.push(k,"[",T,"++]=phase(",r.join(),");");for(var e=0;t>e;++e)C(e);for(var n=0;I>n;++n)F.push(u(n),"+=",d(n,x[t]),";")}function P(t){for(var e=0;I>e;++e)L[e]?F.push(a(e,0),"=",i(e),".get(",u(e),");"):F.push(a(e,0),"=",i(e),"[",u(e),"];");for(var r=[],e=0;I>e;++e)r.push(a(e,0));for(var e=0;b>e;++e)r.push(c(e));F.push(p(0),"=",k,"[",T,"]=phase(",r.join(),");");for(var n=1;1<n;++n)F.push(p(n),"=",k,"[",T,"+",v(n),"];");for(var o=[],n=1;1<n;++n)o.push("("+p(0)+"!=="+p(n)+")");F.push("if(",o.join("||"),"){");for(var s=[],e=0;N>e;++e)s.push(h(e));for(var e=0;I>e;++e){s.push(a(e,0));for(var n=1;1<n;++n)L[e]?F.push(a(e,n),"=",i(e),".get(",u(e),"+",f(e,n),");"):F.push(a(e,n),"=",i(e),"[",u(e),"+",f(e,n),"];"),s.push(a(e,n))}for(var e=0;1<e;++e)s.push(p(e));for(var e=0;b>e;++e)s.push(c(e));F.push("vertex(",s.join(),");",m(0),"=",w,"[",T,"]=",A,"++;");for(var l=(1<n;++n)if(0===(t&~(1<0;_=_-1&g)x.push(w+"["+T+"+"+v(_)+"]");x.push(m(0));for(var _=0;I>_;++_)1&n?x.push(a(_,l),a(_,g)):x.push(a(_,g),a(_,l));1&n?x.push(d,y):x.push(y,d);for(var _=0;b>_;++_)x.push(c(_));F.push("if(",d,"!==",y,"){","face(",x.join(),")}")}F.push("}",T,"+=1;")}function R(){for(var t=1;1<t;++t)F.push(E,"=",v(t),";",v(t),"=",g(t),";",g(t),"=",E,";")}function O(t,e){if(0>t)return void P(e);z(t),F.push("if(",o(x[t]),">0){",h(x[t]),"=1;"),O(t-1,e|1<r;++r)F.push(u(r),"+=",d(r,x[t]),";");t===N-1&&(F.push(T,"=0;"),R()),S(t,2),O(t-1,e),t===N-1&&(F.push("if(",h(x[N-1]),"&1){",T,"=0;}"),R()),C(t),F.push("}")}var I=L.length,N=x.length;if(2>N)throw new Error("ndarray-extract-contour: Dimension must be at least 2");for(var j="extractContour"+x.join("_"),F=[],D=[],B=[],U=0;I>U;++U)B.push(n(U));for(var U=0;b>U;++U)B.push(c(U));for(var U=0;N>U;++U)D.push(o(U)+"="+n(0)+".shape["+U+"]|0");for(var U=0;I>U;++U){D.push(i(U)+"="+n(U)+".data",l(U)+"="+n(U)+".offset|0");for(var V=0;N>V;++V)D.push(s(U,V)+"="+n(U)+".stride["+V+"]|0")}for(var U=0;I>U;++U){D.push(u(U)+"="+l(U)),D.push(a(U,0));for(var V=1;1<V;++V){for(var q=[],H=0;N>H;++H)V&1<U;++U)for(var V=0;N>V;++V){var G=[s(U,x[V])];V>0&&G.push(s(U,x[V-1])+"*"+o(x[V-1])),D.push(d(U,x[V])+"=("+G.join("-")+")|0")}for(var U=0;N>U;++U)D.push(h(U)+"=0");D.push(A+"=0");for(var Y=["2"],U=N-2;U>=0;--U)Y.push(o(x[U]));D.push(M+"=("+Y.join("*")+")|0",k+"=mallocUint32("+M+")",w+"=mallocUint32("+M+")",T+"=0"),D.push(p(0)+"=0");for(var V=1;1<V;++V){for(var X=[],W=[],H=0;N>H;++H)V&1<n&&e("Must have at least one array argument");var i=t.scalarArguments||0;0>i&&e("Scalar arg count must be > 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;n>s;++s)a.indexOf(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",k="P",A="N",M="Q",T="X",E="T"},{"typedarray-pool":278}],265:[function(t,e,r){function n(t){if(0>t)return Number("0/0");for(var e=s[0],r=s.length-1;r>0;--r)e+=s[r]/(t+r);var n=t+o+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}var i=7,a=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],o=607/128,s=[.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 l(t){if(.5>t)return Math.PI/(Math.sin(Math.PI*t)*l(1-t));if(t>100)return Math.exp(n(t));t-=1;for(var e=a[0],r=1;i+2>r;r++)e+=a[r]/(t+r);var o=t+i+.5;return Math.sqrt(2*Math.PI)*Math.pow(o,t+.5)*Math.exp(-o)*e},e.exports.log=n},{}],266:[function(t,e,r){"use strict";function n(t){var e=t.length;if(i>e){for(var r=1,n=0;e>n;++n)for(var o=0;n>o;++o)if(t[n]n;++n)s[n]=0;for(var r=1,n=0;e>n;++n)if(!s[n]){var l=1;s[n]=1;for(var o=t[n];o!==n;o=t[o]){if(s[o])return a.freeUint8(s),0;l+=1,s[o]=1}1&l||(r=-r)}return a.freeUint8(s),r}e.exports=n;var i=32,a=t("typedarray-pool")},{"typedarray-pool":278}],267:[function(t,e,r){"use strict";function n(t){var e=t.length;switch(e){case 0:case 1:return 0;case 2:return t[1]}var r,n,i,s=a.mallocUint32(e),l=a.mallocUint32(e),c=0;for(o(t,l),i=0;e>i;++i)s[i]=t[i];for(i=e-1;i>0;--i)n=l[i],r=s[i],s[i]=s[n],s[n]=r,l[i]=l[r],l[r]=n,c=(c+r)*i;return a.freeUint32(l),a.freeUint32(s),c}function i(t,e,r){switch(t){case 0:return r?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;t>a;++a)r[a]=a,o=o*a|0;for(a=t-1;a>0;--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":268,"typedarray-pool":278}],268:[function(t,e,r){"use strict";function n(t,e){e=e||new Array(t.length);for(var r=0;rt)return[];if(0===t)return[[0]];for(var e=0|Math.round(o(t+1)),r=[],n=0;e>n;++n){for(var s=i.unrank(t,n),l=[0],c=0,u=0;u= 0) !== (_inline_1_db >= 0)) {\n _inline_1_arg2_.push(_inline_1_arg4_[0] + 0.5 + 0.5 * (_inline_1_da + _inline_1_db) / (_inline_1_da - _inline_1_db))\n }\n }",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg3_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:["_inline_1_da","_inline_1_db"]},funcName:"zeroCrossings"})},{"cwise-compiler":109}],271:[function(t,e,r){"use strict";function n(t,e){var r=[];return e=+e||0,i(t.hi(t.shape[0]-1),r,e),r}e.exports=n;var i=t("./lib/zc-core")},{"./lib/zc-core":270}],272:[function(t,e,r){"use strict";function n(t,e){var r=t.length,n=["'use strict';"],i="surfaceNets"+t.join("_")+"d"+e;n.push("var contour=genContour({","order:[",t.join(),"],","scalarArguments: 3,","phase:function phaseFunc(p,a,b,c) { return (p > c)|0 },"),"generic"===e&&n.push("getters:[0],");for(var a=[],l=[],c=0;r>c;++c)a.push("d"+c),l.push("d"+c);for(var c=0;1<c;++c)a.push("v"+c),l.push("v"+c);for(var c=0;1<c;++c)a.push("p"+c),l.push("p"+c);a.push("a","b","c"),l.push("a","c"),n.push("vertex:function vertexFunc(",a.join(),"){");for(var u=[],c=0;1<c;++c)u.push("(p"+c+"<<"+c+")");n.push("var m=(",u.join("+"),")|0;if(m===0||m===",(1<<(1<=1<<(1<>>7){");for(var c=0;1<<(1<c;++c){if(1<<(1<128&&c%128===0){f.length>0&&h.push("}}");var d="vExtra"+f.length;n.push("case ",c>>>7,":",d,"(m&0x7f,",l.join(),");break;"),h=["function ",d,"(m,",l.join(),"){switch(m){"],f.push(h)}h.push("case ",127&c,":");for(var p=new Array(r),g=new Array(r),v=new Array(r),m=new Array(r),y=0,b=0;r>b;++b)p[b]=[],g[b]=[],v[b]=0,m[b]=0;for(var b=0;1<b;++b)for(var x=0;r>x;++x){var _=b^1<b)&&!(c&1<<_)!=!(c&1<w?(p[x].push("-v"+b+"-v"+_),v[x]+=2):(p[x].push("v"+b+"+v"+_),v[x]-=2),y+=1;for(var k=0;r>k;++k)k!==x&&(_&1<x;++x)if(0===p[x].length)A.push("d"+x+"-0.5");else{var M="";v[x]<0?M=v[x]+"*c":v[x]>0&&(M="+"+v[x]+"*c");var T=.5*(p[x].length/y),E=.5+.5*(m[x]/y);A.push("d"+x+"-"+E+"-"+T+"*("+p[x].join("+")+M+")/("+g[x].join("+")+")")}h.push("a.push([",A.join(),"]);","break;")}n.push("}},"),f.length>0&&h.push("}}");for(var L=[],c=0;1<c;++c)L.push("v"+c);L.push("c0","c1","p0","p1","a","b","c"),n.push("cell:function cellFunc(",L.join(),"){");var S=s(r-1);n.push("if(p0){b.push(",S.map(function(t){return"["+t.map(function(t){return"v"+t})+"]"}).join(),")}else{b.push(",S.map(function(t){var e=t.slice();return e.reverse(),"["+e.map(function(t){return"v"+t})+"]"}).join(),")}}});function ",i,"(array,level){var verts=[],cells=[];contour(array,verts,cells,level);return {positions:verts,cells:cells};} return ",i,";");for(var c=0;co;++o)i[o]=[r[o]],a[o]=[o];return{positions:i,cells:a}}function a(t,e){if(t.dimension<=0)return{positions:[],cells:[]};if(1===t.dimension)return i(t,e);var r=t.order.join()+"-"+t.dtype,a=c[r],e=+e||0;return a||(a=c[r]=n(t.order,t.dtype)),a(t,e)}e.exports=a;var o=t("ndarray-extract-contour"),s=t("triangulate-hypercube"),l=t("zero-crossings"),c={}},{"ndarray-extract-contour":264,"triangulate-hypercube":269,"zero-crossings":271}],273:[function(t,e,r){(function(r){"use strict";function n(t){for(var e=t.cells,r=t.positions,n=new Float32Array(6*e.length),i=0,a=0,o=0;ol;++l){var c=r[s[l]];n[i++]=c[0],n[i++]=c[1]+1.4,a=Math.max(c[0],a)}return{data:n,shape:a}}function i(t,e){var r=s[t];r||(r=s[t]={" ":{data:new Float32Array(0),shape:.2}});var o=r[e];if(!o)if(e.length<=1||!/\d/.test(e))o=r[e]=n(a(e,{triangles:!0,font:t,textAlign:"left",textBaseline:"alphabetic"}));else{for(var l=e.split(/(\d|\s)/),c=new Array(l.length),u=0,f=0,h=0;h0&&(f+=.02);for(var d=new Float32Array(u),p=0,g=-.5*f,h=0;h.5?l/(2-a-o):l/(a+o),a){case t:n=(e-r)/l+(r>e?6:0);break;case e:n=(r-t)/l+2;break;case r:n=(t-e)/l+4}n/=6}return{h:n,s:i,l:s}}function o(t,e,r){function n(t,e,r){return 0>r&&(r+=1),r>1&&(r-=1),1/6>r?t+6*(e-t)*r:.5>r?e:2/3>r?t+(e-t)*(2/3-r)*6:t}var i,a,o;if(t=T(t,360),e=T(e,100),r=T(r,100),0===e)i=a=o=r;else{var s=.5>r?r*(1+e):r+e-r*e,l=2*r-s;i=n(l,s,t+1/3),a=n(l,s,t),o=n(l,s,t-1/3)}return{r:255*i,g:255*a,b:255*o}}function s(t,e,r){t=T(t,255),e=T(e,255),r=T(r,255);var n,i,a=q(t,e,r),o=V(t,e,r),s=a,l=a-o;if(i=0===a?0:l/a,a==o)n=0;else{switch(a){case t:n=(e-r)/l+(r>e?6:0);break;case e:n=(r-t)/l+2;break;case r:n=(t-e)/l+4}n/=6}return{h:n,s:i,v:s}}function l(t,e,r){t=6*T(t,360),e=T(e,100),r=T(r,100);var n=B.floor(t),i=t-n,a=r*(1-e),o=r*(1-i*e),s=r*(1-(1-i)*e),l=n%6,c=[r,o,a,a,s,r][l],u=[s,r,r,o,a,a][l],f=[a,a,s,r,r,o][l];return{r:255*c,g:255*u,b:255*f}}function c(t,e,r,n){var i=[z(U(t).toString(16)),z(U(e).toString(16)),z(U(r).toString(16))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function u(t,e,r,n){var i=[z(R(n)),z(U(t).toString(16)),z(U(e).toString(16)),z(U(r).toString(16))];return i.join("")}function f(t,r){r=0===r?0:r||10;var n=e(t).toHsl();return n.s-=r/100,n.s=E(n.s),e(n)}function h(t,r){r=0===r?0:r||10;var n=e(t).toHsl();return n.s+=r/100,n.s=E(n.s),e(n)}function d(t){return e(t).desaturate(100)}function p(t,r){r=0===r?0:r||10;var n=e(t).toHsl();return n.l+=r/100,n.l=E(n.l),e(n)}function g(t,r){r=0===r?0:r||10;var n=e(t).toRgb();return n.r=q(0,V(255,n.r-U(255*-(r/100)))),n.g=q(0,V(255,n.g-U(255*-(r/100)))),n.b=q(0,V(255,n.b-U(255*-(r/100)))),e(n)}function v(t,r){r=0===r?0:r||10;var n=e(t).toHsl();return n.l-=r/100,n.l=E(n.l),e(n)}function m(t,r){var n=e(t).toHsl(),i=(U(n.h)+r)%360;return n.h=0>i?360+i:i,e(n)}function y(t){var r=e(t).toHsl();return r.h=(r.h+180)%360,e(r)}function b(t){var r=e(t).toHsl(),n=r.h;return[e(t),e({h:(n+120)%360,s:r.s,l:r.l}),e({h:(n+240)%360,s:r.s,l:r.l})]}function x(t){var r=e(t).toHsl(),n=r.h;return[e(t),e({h:(n+90)%360,s:r.s,l:r.l}),e({h:(n+180)%360,s:r.s,l:r.l}),e({h:(n+270)%360,s:r.s,l:r.l})]}function _(t){var r=e(t).toHsl(),n=r.h;return[e(t),e({h:(n+72)%360,s:r.s,l:r.l}),e({h:(n+216)%360,s:r.s,l:r.l})]}function w(t,r,n){r=r||6,n=n||30;var i=e(t).toHsl(),a=360/n,o=[e(t)];for(i.h=(i.h-(a*r>>1)+720)%360;--r;)i.h=(i.h+a)%360,o.push(e(i));return o}function k(t,r){r=r||6;for(var n=e(t).toHsv(),i=n.h,a=n.s,o=n.v,s=[],l=1/r;r--;)s.push(e({h:i,s:a,v:o})),o=(o+l)%1;return s}function A(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}function M(t){return t=parseFloat(t),(isNaN(t)||0>t||t>1)&&(t=1),t}function T(t,e){S(t)&&(t="100%");var r=C(t);return t=V(e,q(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),B.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function E(t){return V(1,q(0,t))}function L(t){return parseInt(t,16)}function S(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)}function C(t){return"string"==typeof t&&-1!=t.indexOf("%")}function z(t){return 1==t.length?"0"+t:""+t}function P(t){return 1>=t&&(t=100*t+"%"),t}function R(t){return Math.round(255*parseFloat(t)).toString(16)}function O(t){return L(t)/255}function I(t){t=t.replace(j,"").replace(F,"").toLowerCase();var e=!1;if(G[t])t=G[t],e=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=X.rgb.exec(t))?{r:r[1],g:r[2],b:r[3]}:(r=X.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=X.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=X.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=X.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=X.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=X.hex8.exec(t))?{a:O(r[1]),r:L(r[2]),g:L(r[3]),b:L(r[4]),format:e?"name":"hex8"}:(r=X.hex6.exec(t))?{r:L(r[1]),g:L(r[2]),b:L(r[3]),format:e?"name":"hex"}:(r=X.hex3.exec(t))?{r:L(r[1]+""+r[1]),g:L(r[2]+""+r[2]),b:L(r[3]+""+r[3]),format:e?"name":"hex"}:!1}function N(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:e,size:r}}var j=/^\s+/,F=/\s+$/,D=0,B=Math,U=B.round,V=B.min,q=B.max,H=B.random;e.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,r,n,i,a,o=this.toRgb();return t=o.r/255,e=o.g/255,r=o.b/255,n=.03928>=t?t/12.92:Math.pow((t+.055)/1.055,2.4),i=.03928>=e?e/12.92:Math.pow((e+.055)/1.055,2.4),a=.03928>=r?r/12.92:Math.pow((r+.055)/1.055,2.4),.2126*n+.7152*i+.0722*a},setAlpha:function(t){return this._a=M(t),this._roundA=U(100*this._a)/100,this},toHsv:function(){var t=s(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=s(this._r,this._g,this._b),e=U(360*t.h),r=U(100*t.s),n=U(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=a(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=a(this._r,this._g,this._b),e=U(360*t.h),r=U(100*t.s),n=U(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return c(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(){return u(this._r,this._g,this._b,this._a)},toHex8String:function(){return"#"+this.toHex8()},toRgb:function(){return{r:U(this._r),g:U(this._g),b:U(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+U(this._r)+", "+U(this._g)+", "+U(this._b)+")":"rgba("+U(this._r)+", "+U(this._g)+", "+U(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:U(100*T(this._r,255))+"%",g:U(100*T(this._g,255))+"%",b:U(100*T(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+U(100*T(this._r,255))+"%, "+U(100*T(this._g,255))+"%, "+U(100*T(this._b,255))+"%)":"rgba("+U(100*T(this._r,255))+"%, "+U(100*T(this._g,255))+"%, "+U(100*T(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":this._a<1?!1:Y[c(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var r="#"+u(this._r,this._g,this._b,this._a),n=r,i=this._gradientType?"GradientType = 1, ":"";if(t){var a=e(t);n=a.toHex8String()}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+r+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0,i=!e&&n&&("hex"===t||"hex6"===t||"hex3"===t||"name"===t);return i?"name"===t&&0===this._a?this.toName():this.toRgbString():("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return e(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(p,arguments)},brighten:function(){return this._applyModification(g,arguments)},darken:function(){return this._applyModification(v,arguments)},desaturate:function(){return this._applyModification(f,arguments)},saturate:function(){return this._applyModification(h,arguments)},greyscale:function(){return this._applyModification(d,arguments)},spin:function(){return this._applyModification(m,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(w,arguments)},complement:function(){return this._applyCombination(y,arguments)},monochromatic:function(){return this._applyCombination(k,arguments)},splitcomplement:function(){return this._applyCombination(_,arguments)},triad:function(){return this._applyCombination(b,arguments)},tetrad:function(){return this._applyCombination(x,arguments)}},e.fromRatio=function(t,r){if("object"==typeof t){var n={};for(var i in t)t.hasOwnProperty(i)&&("a"===i?n[i]=t[i]:n[i]=P(t[i]));t=n}return e(t,r)},e.equals=function(t,r){return t&&r?e(t).toRgbString()==e(r).toRgbString():!1},e.random=function(){return e.fromRatio({r:H(),g:H(),b:H()})},e.mix=function(t,r,n){n=0===n?0:n||50;var i,a=e(t).toRgb(),o=e(r).toRgb(),s=n/100,l=2*s-1,c=o.a-a.a;i=l*c==-1?l:(l+c)/(1+l*c),i=(i+1)/2;var u=1-i,f={r:o.r*i+a.r*u,g:o.g*i+a.g*u,b:o.b*i+a.b*u,a:o.a*s+a.a*(1-s)};return e(f)},e.readability=function(t,r){var n=e(t),i=e(r);return(Math.max(n.getLuminance(),i.getLuminance())+.05)/(Math.min(n.getLuminance(),i.getLuminance())+.05)},e.isReadable=function(t,r,n){var i,a,o=e.readability(t,r);switch(a=!1,i=N(n),i.level+i.size){case"AAsmall":case"AAAlarge":a=o>=4.5;break;case"AAlarge":a=o>=3;break;case"AAAsmall":a=o>=7}return a},e.mostReadable=function(t,r,n){var i,a,o,s,l=null,c=0;n=n||{},a=n.includeFallbackColors,o=n.level,s=n.size;for(var u=0;uc&&(c=i,l=e(r[u]));return e.isReadable(t,l,{level:o,size:s})||!a?l:(n.includeFallbackColors=!1,e.mostReadable(t,["#fff","#000"],n))};var G=e.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Y=e.hexNames=A(G),X=function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",r="(?:"+e+")|(?:"+t+")",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();"undefined"!=typeof r&&r.exports?r.exports=e:"function"==typeof t&&t.amd?t(function(){return e}):window.tinycolor=e}()},{}],275:[function(e,r,n){!function(e,i){"object"==typeof n&&"undefined"!=typeof r?i(n):"function"==typeof t&&t.amd?t(["exports"],i):i(e.topojson={})}(this,function(t){"use strict";function e(){}function r(t){if(!t)return e;var r,n,i=t.scale[0],a=t.scale[1],o=t.translate[0],s=t.translate[1];return function(t,e){e||(r=n=0),t[0]=(r+=t[0])*i+o,t[1]=(n+=t[1])*a+s}}function n(t){if(!t)return e;var r,n,i=t.scale[0],a=t.scale[1],o=t.translate[0],s=t.translate[1];return function(t,e){e||(r=n=0);var l=(t[0]-o)/i|0,c=(t[1]-s)/a|0;t[0]=l-r,t[1]=c-n,r=l,n=c}}function i(t,e){for(var r,n=t.length,i=n-e;i<--n;)r=t[i],t[i++]=t[n],t[n]=r}function a(t,e){for(var r=0,n=t.length;n>r;){var i=r+n>>>1;t[i]t?~t:t],a=0,o=n.length;o>a;++a)e.push(r=n[a].slice()),u(r,a);0>t&&i(e,o)}function a(t){return t=t.slice(),u(t,0),t}function o(t){for(var e=[],r=0,i=t.length;i>r;++r)n(t[r],e);return e.length<2&&e.push(e[0].slice()),e}function s(t){for(var e=o(t);e.length<4;)e.push(e[0].slice());return e}function l(t){return t.map(s)}function c(t){var e=t.type;return"GeometryCollection"===e?{type:e,geometries:t.geometries.map(c)}:e in h?{type:e,coordinates:h[e](t)}:null}var u=r(t.transform),f=t.arcs,h={Point:function(t){return a(t.coordinates)},MultiPoint:function(t){return t.coordinates.map(a)},LineString:function(t){return o(t.arcs)},MultiLineString:function(t){return t.arcs.map(o)},Polygon:function(t){return l(t.arcs)},MultiPolygon:function(t){return t.arcs.map(l)}};return c(e)}function c(t,e){function r(e){var r,n=t.arcs[0>e?~e:e],i=n[0];return t.transform?(r=[0,0],n.forEach(function(t){r[0]+=t[0],r[1]+=t[1]})):r=n[n.length-1],0>e?[r,i]:[i,r]}function n(t,e){for(var r in t){var n=t[r];delete e[n.start],delete n.start,delete n.end,n.forEach(function(t){i[0>t?~t:t]=1}),s.push(n)}}var i={},a={},o={},s=[],l=-1;return e.forEach(function(r,n){ -var i,a=t.arcs[0>r?~r:r];a.length<3&&!a[1][0]&&!a[1][1]&&(i=e[++l],e[l]=r,e[n]=i)}),e.forEach(function(t){var e,n,i=r(t),s=i[0],l=i[1];if(e=o[s])if(delete o[e.end],e.push(t),e.end=l,n=a[l]){delete a[n.start];var c=n===e?e:e.concat(n);a[c.start=e.start]=o[c.end=n.end]=c}else a[e.start]=o[e.end]=e;else if(e=a[l])if(delete a[e.start],e.unshift(t),e.start=s,n=o[s]){delete o[n.end];var u=n===e?e:n.concat(e);a[u.start=n.start]=o[u.end=e.end]=u}else a[e.start]=o[e.end]=e;else e=[t],a[e.start=s]=o[e.end=l]=e}),n(o,a),n(a,o),e.forEach(function(t){i[0>t?~t:t]||s.push([t])}),s}function u(t){return l(t,f.apply(this,arguments))}function f(t,e,r){function n(t){var e=0>t?~t:t;(u[e]||(u[e]=[])).push({i:t,g:l})}function i(t){t.forEach(n)}function a(t){t.forEach(i)}function o(t){"GeometryCollection"===t.type?t.geometries.forEach(o):t.type in f&&(l=t,f[t.type](t.arcs))}var s=[];if(arguments.length>1){var l,u=[],f={LineString:i,MultiLineString:a,Polygon:a,MultiPolygon:function(t){t.forEach(a)}};o(e),u.forEach(arguments.length<3?function(t){s.push(t[0].i)}:function(t){r(t[0].g,t[t.length-1].g)&&s.push(t[0].i)})}else for(var h=0,d=t.arcs.length;d>h;++h)s.push(h);return{type:"MultiLineString",arcs:c(t,s)}}function h(t){var e=t[0],r=t[1],n=t[2];return Math.abs((e[0]-n[0])*(r[1]-e[1])-(e[0]-r[0])*(n[1]-e[1]))}function d(t){for(var e,r=-1,n=t.length,i=t[n-1],a=0;++re?~e:e]||(i[e]=[])).push(t)})}),a.push(t)}function n(e){return d(l(t,{type:"Polygon",arcs:[e]}).coordinates[0])>0}var i={},a=[],o=[];return e.forEach(function(t){"Polygon"===t.type?r(t.arcs):"MultiPolygon"===t.type&&t.arcs.forEach(r)}),a.forEach(function(t){if(!t._){var e=[],r=[t];for(t._=1,o.push(e);t=r.pop();)e.push(t),t.forEach(function(t){t.forEach(function(t){i[0>t?~t:t].forEach(function(t){t._||(t._=1,r.push(t))})})})}}),a.forEach(function(t){delete t._}),{type:"MultiPolygon",arcs:o.map(function(e){var r,a=[];if(e.forEach(function(t){t.forEach(function(t){t.forEach(function(t){i[0>t?~t:t].length<2&&a.push(t)})})}),a=c(t,a),(r=a.length)>1)for(var o,s=n(e[0][0]),l=0;r>l;++l)if(s===n(a[l])){o=a[0],a[0]=a[l],a[l]=o;break}return a})}}function v(t){function e(t,e){t.forEach(function(t){0>t&&(t=~t);var r=i[t];r?r.push(e):i[t]=[e]})}function r(t,r){t.forEach(function(t){e(t,r)})}function n(t,e){"GeometryCollection"===t.type?t.geometries.forEach(function(t){n(t,e)}):t.type in s&&s[t.type](t.arcs,e)}var i={},o=t.map(function(){return[]}),s={LineString:e,MultiLineString:r,Polygon:r,MultiPolygon:function(t,e){t.forEach(function(t){r(t,e)})}};t.forEach(n);for(var l in i)for(var c=i[l],u=c.length,f=0;u>f;++f)for(var h=f+1;u>h;++h){var d,p=c[f],g=c[h];(d=o[p])[l=a(d,g)]!==g&&d.splice(l,0,g),(d=o[g])[l=a(d,p)]!==p&&d.splice(l,0,p)}return o}function m(t,e){return t[1][2]-e[1][2]}function y(){function t(t,e){for(;e>0;){var r=(e+1>>1)-1,i=n[r];if(m(t,i)>=0)break;n[i._=e]=i,n[t._=e=r]=t}}function e(t,e){for(;;){var r=e+1<<1,a=r-1,o=e,s=n[o];if(i>a&&m(n[a],s)<0&&(s=n[o=a]),i>r&&m(n[r],s)<0&&(s=n[o=r]),o===e)break;n[s._=e]=s,n[t._=e=o]=t}}var r={},n=[],i=0;return r.push=function(e){return t(n[e._=i]=e,i++),i},r.pop=function(){if(!(0>=i)){var t,r=n[0];return--i>0&&(t=n[i],e(n[t._=0]=t,0)),r}},r.remove=function(r){var a,o=r._;if(n[o]===r)return o!==--i&&(a=n[i],(m(a,r)<0?t:e)(n[a._=o]=a,o)),o},r}function b(t,e){function i(t){s.remove(t),t[1][2]=e(t),s.push(t)}var a=r(t.transform),o=n(t.transform),s=y();return e||(e=h),t.arcs.forEach(function(t){var r,n,l,c,u=[],f=0;for(n=0,l=t.length;l>n;++n)c=t[n],a(t[n]=[c[0],c[1],1/0],n);for(n=1,l=t.length-1;l>n;++n)r=t.slice(n-1,n+2),r[1][2]=e(r),u.push(r),s.push(r);for(n=0,l=u.length;l>n;++n)r=u[n],r.previous=u[n-1],r.next=u[n+1];for(;r=s.pop();){var h=r.previous,d=r.next;r[1][2]0?r.pop():new ArrayBuffer(t)}function s(t){return new Uint8Array(o(t),0,t)}function l(t){return new Uint16Array(o(2*t),0,t)}function c(t){return new Uint32Array(o(4*t),0,t)}function u(t){return new Int8Array(o(t),0,t)}function f(t){return new Int16Array(o(2*t),0,t)}function h(t){return new Int32Array(o(4*t),0,t)}function d(t){return new Float32Array(o(4*t),0,t)}function p(t){return new Float64Array(o(8*t),0,t)}function g(t){return x?new Uint8ClampedArray(o(t),0,t):s(t)}function v(t){return new DataView(o(t),0,t)}function m(t){t=y.nextPow2(t);var e=y.log2(t),r=k[e];return r.length>0?r.pop():new n(t)}var y=t("bit-twiddle"),b=t("dup");e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:b([32,0]),UINT16:b([32,0]),UINT32:b([32,0]),INT8:b([32,0]),INT16:b([32,0]),INT32:b([32,0]),FLOAT:b([32,0]),DOUBLE:b([32,0]),DATA:b([32,0]),UINT8C:b([32,0]),BUFFER:b([32,0])});var x="undefined"!=typeof Uint8ClampedArray,_=e.__TYPEDARRAY_POOL;_.UINT8C||(_.UINT8C=b([32,0])),_.BUFFER||(_.BUFFER=b([32,0]));var w=_.DATA,k=_.BUFFER;r.free=function(t){if(n.isBuffer(t))k[y.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|y.log2(e);w[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeInt8=r.freeInt16=r.freeInt32=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=a,r.freeArrayBuffer=i,r.freeBuffer=function(t){k[y.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return o(t);switch(e){case"uint8":return s(t);case"uint16":return l(t);case"uint32":return c(t);case"int8":return u(t);case"int16":return f(t);case"int32":return h(t);case"float":case"float32":return d(t);case"double":case"float64":return p(t);case"uint8_clamped":return g(t);case"buffer":return m(t);case"data":case"dataview":return v(t);default:return null}return null},r.mallocArrayBuffer=o,r.mallocUint8=s,r.mallocUint16=l,r.mallocUint32=c,r.mallocInt8=u,r.mallocInt16=f,r.mallocInt32=h,r.mallocFloat32=r.mallocFloat=d,r.mallocFloat64=r.mallocDouble=p,r.mallocUint8Clamped=g,r.mallocDataView=v,r.mallocBuffer=m,r.clearCache=function(){for(var t=0;32>t;++t)_.UINT8[t].length=0,_.UINT16[t].length=0,_.UINT32[t].length=0,_.INT8[t].length=0,_.INT16[t].length=0,_.INT32[t].length=0,_.FLOAT[t].length=0,_.DOUBLE[t].length=0,_.UINT8C[t].length=0,w[t].length=0,k[t].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"bit-twiddle":50,buffer:51,dup:115}],279:[function(t,e,r){"use strict";function n(t,e){for(var r=1,n=t.length,i=t[0],a=t[0],o=1;n>o;++o)if(a=i,i=t[o],e(i,a)){if(o===r){r++;continue}t[r++]=i}return t.length=r,t}function i(t){for(var e=1,r=t.length,n=t[0],i=t[0],a=1;r>a;++a,i=n)if(i=n,n=t[a],n!==i){if(a===e){e++;continue}t[e++]=n}return t.length=e,t}function a(t,e,r){return 0===t.length?t:e?(r||t.sort(e),n(t,e)):(r||t.sort(),i(t))}e.exports=a},{}],280:[function(t,e,r){"use strict";function n(t,e){return"object"==typeof e&&null!==e||(e={}),i(t,e.canvas||a,e.context||o,e)}e.exports=n;var i=t("./lib/vtext"),a=null,o=null;"undefined"!=typeof document&&(a=document.createElement("canvas"),a.width=8192,a.height=1024,o=a.getContext("2d"))},{"./lib/vtext":281}],281:[function(t,e,r){"use strict";function n(t,e,r){for(var n=e.textAlign||"start",i=e.textBaseline||"alphabetic",a=[1<<30,1<<30],o=[0,0],s=t.length,l=0;s>l;++l)for(var c=t[l],u=0;2>u;++u)a[u]=0|Math.min(a[u],c[u]),o[u]=0|Math.max(o[u],c[u]);var f=0;switch(n){case"center":f=-.5*(a[0]+o[0]);break;case"right":case"end":f=-o[0];break;case"left":case"start":f=-a[0];break;default:throw new Error("vectorize-text: Unrecognized textAlign: '"+n+"'")}var h=0;switch(i){case"hanging":case"top":h=-a[1];break;case"middle":h=-.5*(a[1]+o[1]);break;case"alphabetic":case"ideographic":h=-3*r;break;case"bottom":h=-o[1];break;default:throw new Error("vectorize-text: Unrecoginized textBaseline: '"+i+"'")}var d=1/r;return"lineHeight"in e?d*=+e.lineHeight:"width"in e?d=e.width/(o[0]-a[0]):"height"in e&&(d=e.height/(o[1]-a[1])),t.map(function(t){return[d*(t[0]+f),d*(t[1]+h)]})}function i(t,e,r,n){var i=0|Math.ceil(e.measureText(r).width+2*n);if(i>8192)throw new Error("vectorize-text: String too long (sorry, this will get fixed later)");var a=3*n;t.height=l&&o.push(s)}for(;o.length>0;){var c=o.pop();n[c]=!1;for(var u=r[c],s=0;sn;++n){var a=t[n];e=Math.max(e,a[0],a[1])}e=(0|e)+1}e=0|e;for(var o=new Array(e),n=0;e>n;++n)o[n]=[];for(var n=0;r>n;++n){var a=t[n];o[a[0]].push(a[1]),o[a[1]].push(a[0])}for(var s=0;e>s;++s)i(o[s],function(t,e){return t-e});return o}e.exports=n;var i=t("uniq")},{uniq:279}],284:[function(t,e,r){"use strict";function n(t,e){function r(t,e){var r=c[e][t[e]];r.splice(r.indexOf(t),1)}function n(t,n,a){for(var o,s,l,u=0;2>u;++u)if(c[u][n].length>0){o=c[u][n][0],l=u;break}s=o[1^l];for(var f=0;2>f;++f)for(var h=c[f][n],d=0;d0&&(o=p,s=g,l=f)}return a?s:(o&&r(o,l),s)}function a(t,a){var o=c[a][t][0],s=[t];r(o,a);for(var l=o[1^a];;){for(;l!==t;)s.push(l),l=n(s[s.length-2],l,!1);if(c[0][t].length+c[1][t].length===0)break;var u=s[s.length-1],f=t,h=s[1],d=n(u,f,!0);if(i(e[u],e[f],e[h],e[d])<0)break;s.push(t),l=n(u,f)}return s}function o(t,e){return e[1]===e[e.length-1]}for(var s=0|e.length,l=t.length,c=[new Array(s),new Array(s)],u=0;s>u;++u)c[0][u]=[],c[1][u]=[];for(var u=0;l>u;++u){var f=t[u];c[0][f[0]].push(f),c[1][f[1]].push(f)}for(var h=[],u=0;s>u;++u)c[0][u].length+c[1][u].length===0&&h.push([u]);for(var u=0;s>u;++u)for(var d=0;2>d;++d){for(var p=[];c[d][u].length>0;){var g=(c[0][u].length,a(u,d));o(p,g)?p.push.apply(p,g):(p.length>0&&h.push(p),p=g)}p.length>0&&h.push(p)}return h}e.exports=n;var i=t("compare-angle")},{"compare-angle":285}],285:[function(t,e,r){"use strict";function n(t,e,r){var n=s(t[0],-e[0]),i=s(t[1],-e[1]),a=s(r[0],-e[0]),o=s(r[1],-e[1]),u=c(l(n,a),l(i,o));return u[u.length-1]>=0}function i(t,e,r,i){var s=a(e,r,i);if(0===s){var l=o(a(t,e,r)),c=o(a(t,e,i));if(l===c){if(0===l){var u=n(t,e,r),f=n(t,e,i);return u===f?0:u?1:-1}return 0}return 0===c?l>0?-1:n(t,e,i)?-1:1:0===l?c>0?1:n(t,e,r)?1:-1:o(c-l)}var h=a(t,e,r);if(h>0)return s>0&&a(t,e,i)>0?1:-1;if(0>h)return s>0||a(t,e,i)>0?1:-1;var d=a(t,e,i);return d>0?1:n(t,e,r)?1:-1}e.exports=i;var a=t("robust-orientation"),o=t("signum"),s=t("two-sum"),l=t("robust-product"),c=t("robust-sum")},{"robust-orientation":259,"robust-product":286,"robust-sum":262,signum:287,"two-sum":277}],286:[function(t,e,r){"use strict";function n(t,e){if(1===t.length)return a(e,t[0]);if(1===e.length)return a(t,e[0]);if(0===t.length||0===e.length)return[0];var r=[0];if(t.lengtht?-1:t>0?1:0}},{}],288:[function(t,e,r){arguments[4][21][0].apply(r,arguments)},{dup:21}],289:[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 0>n?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 u(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)}},_.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1))return s(this,t);var n=this.left.remove(t);return n===x?(this.left=null,this.count-=1,b):(n===b&&(this.count-=1),n)}if(t[0]>this.mid){if(!this.right)return y;var a=this.left?this.left.count:0;if(4*a>3*(e-1))return s(this,t);var n=this.right.remove(t);return n===x?(this.right=null,this.count-=1,b):(n===b&&(this.count-=1),n)}if(1===this.count)return this.leftPoints[0]===t?x:y;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var o=this,l=this.left;l.right;)o=l,l=l.right;if(o===this)l.right=this.right;else{var c=this.left,n=this.right;o.count-=l.count,o.right=l.left,l.left=c,l.right=n}i(this,l),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 c=m.ge(this.leftPoints,t,h);cthis.mid){if(this.right){var r=this.right.queryPoint(t,e);if(r)return r}return c(this.rightPoints,t,e)}return u(this.leftPoints,e)},_.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?c(this.rightPoints,t,r):u(this.leftPoints,r)};var w=g.prototype;w.insert=function(t){this.root?this.root.insert(t):this.root=new n(t[0],null,null,[t],[t])},w.remove=function(t){if(this.root){var e=this.root.remove(t);return e===x&&(this.root=null),e!==y}return!1},w.queryPoint=function(t,e){return this.root?this.root.queryPoint(t,e):void 0},w.queryInterval=function(t,e,r){return e>=t&&this.root?this.root.queryInterval(t,e,r):void 0},Object.defineProperty(w,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(w,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":288}],290:[function(t,e,r){"use strict";function n(t,e){var r,n;if(e[0][0]e[1][0])){var i=Math.min(t[0][1],t[1][1]),o=Math.max(t[0][1],t[1][1]),s=Math.min(e[0][1],e[1][1]),l=Math.max(e[0][1],e[1][1]);return s>o?o-s:i>l?i-l:o-l}r=e[1],n=e[0]}var c,u;t[0][1]e[1][0]))return n(e,t);r=e[1],i=e[0]}var o,s;if(t[0][0]t[1][0]))return-n(t,e);o=t[1],s=t[0]}var l=a(r,i,s),c=a(r,i,o);if(0>l){if(0>=c)return l}else if(l>0){if(c>=0)return l}else if(c)return c;if(l=a(s,o,i),c=a(s,o,r),0>l){if(0>=c)return l}else if(l>0){if(c>=0)return l}else if(c)return c;return i[0]-s[0]}e.exports=i;var a=t("robust-orientation")},{"robust-orientation":259}],291:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){this._color=t,this.key=e,this.value=r,this.left=n,this.right=i,this._count=a}function i(t){return new n(t._color,t.key,t.value,t.left,t.right,t._count)}function a(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?r:e.right?l(t,e.right):void 0}function c(t,e,r,n){var i=e(t,n.key);if(0>=i){if(n.left){var a=c(t,e,r,n.left);if(a)return a}var a=r(n.key,n.value);if(a)return a}return n.right?c(t,e,r,n.right):void 0}function u(t,e,r,n,i){var a,o=r(t,i.key),s=r(e,i.key);if(0>=o){if(i.left&&(a=u(t,e,r,n,i.left)))return a;if(s>0&&(a=n(i.key,i.value)))return a}return s>0&&i.right?u(t,e,r,n,i.right):void 0}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=m);if(r=t[l-1],r.left===e){if(n=r.right,n.right&&n.right._color===v){if(n=r.right=i(n),s=n.right=i(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,e._color=m,r._color=m,s._color=m,o(r),o(n),l>1){var c=t[l-2];c.left===r?c.left=n:c.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 c=t[l-2];c.left===r?c.left=s:c.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 c=t[l-2];c.left===r?c.left=n:c.right=n}t[l-1]=n,t[l]=r,l+11){var c=t[l-2];c.right===r?c.right=n:c.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 c=t[l-2];c.right===r?c.right=s:c.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 c=t[l-2];c.right===r?c.right=n:c.left=n}t[l-1]=n,t[l]=r,l+1t?-1:t>e?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=[],c=[];i;){var u=r(t,i.key);l.push(i),c.push(u),i=0>=u?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];c[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 c(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return u(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(0>t)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),0>=a&&(i=n.length),r=0>=a?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),0>a&&(i=n.length),r=0>a?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=0>=a?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=0>a?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=0>=i?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=0>=n?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?this._stack[this._stack.length-1].key:void 0},enumerable:!0}),Object.defineProperty(b,"value",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1].value:void 0},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}})},{}],292:[function(t,e,r){"use strict";function n(t,e,r){this.slabs=t,this.coordinates=e,this.horizontal=r}function i(t,e){return t.y-e}function a(t,e){for(var r=null;t;){var n,i,o=t.key;o[0][0]s)t=t.left;else if(s>0)if(e[0]!==o[1][0])r=t,t=t.right;else{var l=a(t.right,e);if(l)return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l=a(t.right,e);if(l)return l;t=t.left}}return r}function o(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function s(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}function l(t){for(var e=t.length,r=2*e,i=new Array(r),a=0;e>a;++a){var l=t[a],c=l[0][0]a;){for(var v=i[a].x,m=[];r>a;){var y=i[a];if(y.x!==v)break;a+=1,y.segment[0][0]===y.x&&y.segment[1][0]===y.x?y.create&&(y.segment[0][1]e)return-1;var r=(this.slabs[e],a(this.slabs[e],t)),n=-1;if(r&&(n=r.value),this.coordinates[e]===t[0]){var o=null;if(r&&(o=r.key),e>0){var s=a(this.slabs[e-1],t);s&&(o?h(s.key,o)>0&&(o=s.key,n=s.value):(n=s.value,o=s.key))}var l=this.horizontal[e];if(l.length>0){var u=c.ge(l,t[1],i);if(u=l.length)return n;d=l[u]}}if(d.start)if(o){var p=f(o[0],o[1],[t[0],d.y]);o[0][0]>o[1][0]&&(p=-p),p>0&&(n=d.index)}else n=d.index;else d.y!==t[1]&&(n=d.index)}}}return n}},{"./lib/order-segments":290,"binary-search-bounds":288,"functional-red-black-tree":291,"robust-orientation":259}],293:[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):!1}}function a(t){for(var e={},r=0;rn)return 1;var i=t[n];if(!i){if(!(n>0&&e[n]===r[0]))return 1;i=t[n-1]}for(var a=1;i;){var o=i.key,s=f(r,o[0],o[1]);if(o[0][0]s)i=i.left;else{if(!(s>0))return 0;a=-1,i=i.right}else if(s>0)i=i.left;else{if(!(0>s))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 c(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}function u(t){for(var e=t.length,r=[],n=[],i=0;e>i;++i)for(var u=t[i],f=u.length,d=f-1,p=0;f>p;d=p++){var g=u[d],v=u[p];g[0]===v[0]?n.push([g,v]):r.push([g,v]); -}if(0===r.length)return 0===n.length?s:l(a(n));var m=h(r),y=o(m.slabs,m.coordinates);return 0===n.length?y:c(a(n),y)}e.exports=u;var f=t("robust-orientation")[3],h=t("slab-decomposition"),d=t("interval-tree-1d"),p=t("binary-search-bounds")},{"binary-search-bounds":288,"interval-tree-1d":289,"robust-orientation":259,"slab-decomposition":292}],294:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(t),n=0;t>n;++n)r[n]=e;return r}function i(t){for(var e=new Array(t),r=0;t>r;++r)e[r]=[];return e}function a(t,e){function r(t){for(var r=t.length,n=[0],i=0;r>i;++i){var a=e[t[i]],o=e[t[(i+1)%r]],s=c(-a[0],a[1]),l=c(-a[0],o[1]),f=c(o[0],a[1]),h=c(o[0],o[1]);n=u(n,u(u(s,l),u(f,h)))}return n[n.length-1]>0}function a(t){for(var e=t.length,r=0;e>r;++r)if(!O[t[r]])return!1;return!0}var d=h(t,e);t=d[0],e=d[1];for(var p=e.length,g=(t.length,o(t,e.length)),v=0;p>v;++v)if(g[v].length%2===1)throw new Error("planar-graph-to-polyline: graph must be manifold");var m=s(t,e);m=m.filter(r);for(var y=m.length,b=new Array(y),x=new Array(y),v=0;y>v;++v){b[v]=v;var _=new Array(y),w=m[v].map(function(t){return e[t]}),k=l([w]),A=0;t:for(var M=0;y>M;++M)if(_[M]=0,v!==M){for(var T=m[M],E=T.length,L=0;E>L;++L){var S=k(e[T[L]]);if(0!==S){0>S&&(_[M]=1,A+=1);continue t}}_[M]=1,A+=1}x[v]=[A,v,_]}x.sort(function(t,e){return e[0]-t[0]});for(var v=0;y>v;++v)for(var _=x[v],C=_[1],z=_[2],M=0;y>M;++M)z[M]&&(b[M]=C);for(var P=i(y),v=0;y>v;++v)P[v].push(b[v]),P[b[v]].push(v);for(var R={},O=n(p,!1),v=0;y>v;++v)for(var T=m[v],E=T.length,M=0;E>M;++M){var I=T[M],N=T[(M+1)%E],j=Math.min(I,N)+":"+Math.max(I,N);if(j in R){var F=R[j];P[F].push(v),P[v].push(F),O[I]=O[N]=!0}else R[j]=v}for(var D=[],B=n(y,-1),v=0;y>v;++v)b[v]!==v||a(m[v])?B[v]=-1:(D.push(v),B[v]=0);for(var d=[];D.length>0;){var U=D.pop(),V=P[U];f(V,function(t,e){return t-e});var q,H=V.length,G=B[U];if(0===G){var T=m[U];q=[T]}for(var v=0;H>v;++v){var Y=V[v];if(!(B[Y]>=0)&&(B[Y]=1^G,D.push(Y),0===G)){var T=m[Y];a(T)||(T.reverse(),q.push(T))}}0===G&&d.push(q)}return d}e.exports=a;var o=t("edges-to-adjacency-list"),s=t("planar-dual"),l=t("point-in-big-polygon"),c=t("two-product"),u=t("robust-sum"),f=t("uniq"),h=t("./lib/trim-leaves")},{"./lib/trim-leaves":282,"edges-to-adjacency-list":283,"planar-dual":284,"point-in-big-polygon":293,"robust-sum":262,"two-product":276,uniq:279}],295:[function(t,e,r){arguments[4][50][0].apply(r,arguments)},{dup:50}],296:[function(t,e,r){"use strict";"use restrict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;t>e;++e)this.roots[e]=e,this.ranks[e]=0}e.exports=n,n.prototype.length=function(){return this.roots.length},n.prototype.makeSet=function(){var t=this.roots.length;return this.roots.push(t),this.ranks.push(0),t},n.prototype.find=function(t){for(var e=this.roots;e[t]!==t;){var r=e[t];e[t]=e[r],t=r}return t},n.prototype.link=function(t,e){var r=this.find(t),n=this.find(e);if(r!==n){var i=this.ranks,a=this.roots,o=i[r],s=i[n];s>o?a[r]=n:o>s?a[n]=r:(a[n]=r,++i[r])}}},{}],297:[function(t,e,r){arguments[4][238][0].apply(r,arguments)},{"bit-twiddle":295,dup:238,"union-find":296}],298:[function(t,e,r){"use strict";function n(t,e,r){var n=Math.abs(a(t,e,r)),i=Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2));return n/i}function i(t,e,r){function i(t){if(x[t])return 1/0;var r=m[t],i=y[t];return 0>r||0>i?1/0:n(e[t],e[r],e[i])}function a(t,e){var r=M[t],n=M[e];M[t]=n,M[e]=r,T[r]=e,T[n]=t}function s(t){return b[M[t]]}function l(t){return 1&t?t-1>>1:(t>>1)-1}function c(t){for(var e=s(t);;){var r=e,n=2*t+1,i=2*(t+1),o=t;if(L>n){var l=s(n);r>l&&(o=n,r=l)}if(L>i){var c=s(i);r>c&&(o=i)}if(o===t)return t;a(t,o),t=o}}function u(t){for(var e=s(t);t>0;){var r=l(t);if(r>=0){var n=s(r);if(n>e){a(t,r),t=r;continue}}return t}}function f(){if(L>0){var t=M[0];return a(0,L-1),L-=1,c(0),t}return-1}function h(t,e){var r=M[t];return b[r]===e?t:(b[r]=-(1/0),u(t),f(),b[r]=e,L+=1,u(L-1))}function d(t){if(!x[t]){x[t]=!0;var e=m[t],r=y[t];m[r]>=0&&(m[r]=e),y[e]>=0&&(y[e]=r),T[e]>=0&&h(T[e],i(e)),T[r]>=0&&h(T[r],i(r))}}function p(t,e){if(t[e]<0)return e;var r=e,n=e;do{var i=t[n];if(!x[n]||0>i||i===n)break;if(n=i,i=t[n],!x[n]||0>i||i===n)break;n=i,r=t[r]}while(r!==n);for(var a=e;a!==n;a=t[a])t[a]=n;return n}for(var g=e.length,v=t.length,m=new Array(g),y=new Array(g),b=new Array(g),x=new Array(g),_=0;g>_;++_)m[_]=y[_]=-1,b[_]=1/0,x[_]=!1;for(var _=0;v>_;++_){var w=t[_];if(2!==w.length)throw new Error("Input must be a graph");var k=w[1],A=w[0];-1!==y[A]?y[A]=-2:y[A]=k,-1!==m[k]?m[k]=-2:m[k]=A}for(var M=[],T=new Array(g),_=0;g>_;++_){var E=b[_]=i(_);1/0>E?(T[_]=M.length,M.push(_)):T[_]=-1}for(var L=M.length,_=L>>1;_>=0;--_)c(_);for(;;){var S=f();if(0>S||b[S]>r)break;d(S)}for(var C=[],_=0;g>_;++_)x[_]||(T[_]=C.length,C.push(e[_].slice()));var z=(C.length,[]);return t.forEach(function(t){var e=p(m,t[0]),r=p(y,t[1]);if(e>=0&&r>=0&&e!==r){var n=T[e],i=T[r];n!==i&&z.push([n,i])}}),o.unique(o.normalize(z)),{positions:C,edges:z}}e.exports=i;var a=t("robust-orientation"),o=t("simplicial-complex")},{"robust-orientation":259,"simplicial-complex":297}],299:[function(t,e,r){"use strict";e.exports=["",{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0},{path:"M2,2V-2H-2V2Z",backoff:0}]},{}],300:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=t("../../plots/cartesian/constants"),o=t("../../lib/extend").extendFlat;e.exports={_isLinkedToArray:!0,text:{valType:"string"},textangle:{valType:"angle",dflt:0},font:o({},i,{}),opacity:{valType:"number",min:0,max:1,dflt:1},align:{valType:"enumerated",values:["left","center","right"],dflt:"center"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)"},borderpad:{valType:"number",min:0,dflt:1},borderwidth:{valType:"number",min:0,dflt:1},showarrow:{valType:"boolean",dflt:!0},arrowcolor:{valType:"color"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1},arrowsize:{valType:"number",min:.3,dflt:1},arrowwidth:{valType:"number",min:.1},ax:{valType:"number",dflt:-10},ay:{valType:"number",dflt:-30},xref:{valType:"enumerated",values:["paper",a.idRegex.x.toString()]},x:{valType:"number"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()]},y:{valType:"number"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"},_deprecated:{ref:{valType:"string"}}}},{"../../lib/extend":377,"../../plots/cartesian/constants":410,"../../plots/font_attributes":423,"./arrow_paths":299}],301:[function(t,e,r){"use strict";function n(t,e){function r(e,r){return c.coerce(t,n,v.layoutAttributes,e,r)}var n={};r("opacity"),r("align"),r("bgcolor");var i=r("bordercolor"),a=f.opacity(i);r("borderpad");var o=r("borderwidth"),s=r("showarrow");s&&(r("arrowcolor",a?n.bordercolor:f.defaultLine),r("arrowhead"),r("arrowsize"),r("arrowwidth",2*(a&&o||1)),r("ax"),r("ay"),c.noneOrAll(t,n,["ax","ay"])),r("text",s?" ":"new text"),r("textangle"),c.coerceFont(r,"font",e.font);for(var l=["x","y"],h=0;2>h;h++){var d=l[h],p={_fullLayout:e},g=u.coerceRef(t,n,p,d),m=.5;if("paper"!==g){var y=u.getFromId(p,g);if(m=y.range[0]+m*(y.range[1]-y.range[0]),-1!==["date","category"].indexOf(y.type)&&"string"==typeof t[d]){var b;"date"===y.type?(b=c.dateTime2ms(t[d]),b!==!1&&(t[d]=b)):(y._categories||[]).length&&(b=y._categories.indexOf(t[d]),-1!==b&&(t[d]=b))}}r(d,m),s||r(d+"anchor")}return c.noneOrAll(t,n,["x","y"]),n}function i(t){var e=t._fullLayout;e.annotations.forEach(function(e){var r=u.getFromId(t,e.xref),n=u.getFromId(t,e.yref);if(r||n){var i=(e._xsize||0)/2,a=e._xshift||0,o=(e._ysize||0)/2,s=e._yshift||0,l=i-a,c=i+a,f=o-s,h=o+s;if(e.showarrow){var d=3*e.arrowsize*e.arrowwidth;l=Math.max(l,d),c=Math.max(c,d),f=Math.max(f,d),h=Math.max(h,d)}r&&r.autorange&&u.expand(r,[r.l2c(e.x)],{ppadplus:c,ppadminus:l}),n&&n.autorange&&u.expand(n,[n.l2c(e.y)],{ppadplus:h,ppadminus:f})}})}function a(t,e,r,n,i,a,o,s){var l=r-t,c=i-t,u=o-i,f=n-e,h=a-e,d=s-a,p=l*d-u*f;if(0===p)return null;var g=(c*d-u*h)/p,v=(c*f-l*h)/p;return 0>v||v>1||0>g||g>1?null:{x:t+l*g,y:e+f*g}}var o=t("d3"),s=t("fast-isnumeric"),l=t("../../plotly"),c=t("../../lib"),u=t("../../plots/cartesian/axes"),f=t("../color"),h=t("../drawing"),d=t("../../lib/svg_text_utils"),p=t("../../lib/setcursor"),g=t("../dragelement"),v=e.exports={};v.ARROWPATHS=t("./arrow_paths"),v.layoutAttributes=t("./attributes"),v.supplyLayoutDefaults=function(t,e){for(var r=t.annotations||[],i=e.annotations=[],a=0;at?"left":t>2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}tt.selectAll("tspan.line").attr({y:0,x:0});var n=W.select(".annotation-math-group"),i=!n.empty(),s=h.bBox((i?n:tt).node()),d=s.width,m=s.height,y=Math.round(d+2*$),b=Math.round(m+2*$);U._w=d,U._h=m;var x=!1;if(["x","y"].forEach(function(e){var n,i=u.getFromId(t,U[e+"ref"]||e),a=(G+("x"===e?0:90))*Math.PI/180,o=y*Math.abs(Math.cos(a))+b*Math.abs(Math.sin(a)),s=U[e+"anchor"];if(i){if(!i.autorange&&(U[e]-i.range[0])*(U[e]-i.range[1])>0)return void(x=!0);H[e]=i._offset+i.l2p(U[e]),n=.5}else n=U[e],"y"===e&&(n=1-n),H[e]="x"===e?S.l+S.w*n:S.t+S.h*n;var l=0;l=U.showarrow?U["a"+e]:o*r(n,s),H[e]+=l,U["_"+e+"type"]=i&&i.type,U["_"+e+"size"]=o,U["_"+e+"shift"]=l}),x)return void W.remove();var w,k;U.showarrow&&(w=c.constrain(H.x-U.ax,1,_.width-1),k=c.constrain(H.y-U.ay,1,_.height-1)),H.x=c.constrain(H.x,1,_.width-1),H.y=c.constrain(H.y,1,_.height-1);var A=$-s.top,M=$-s.left;i?n.select("svg").attr({x:$-1,y:$}):(tt.attr({x:M,y:A}),tt.selectAll("tspan.line").attr({y:A,x:M})),Q.call(h.setRect,Z/2,Z/2,y-Z,b-Z);var T=Math.round(H.x-y/2),E=Math.round(H.y-b/2);W.call(c.setTranslate,T,E);var L="annotations["+e+"]",C=function(r,n){o.select(t).selectAll('.annotation-arrow-g[data-index="'+e+'"]').remove();var i=H.x+r,s=H.y+n,u=c.rotationXYMatrix(G,i,s),h=c.apply2DTransform(u),d=c.apply2DTransform2(u),p=Q.attr("width")/2,m=Q.attr("height")/2,y=[[i-p,s-m,i-p,s+m],[i-p,s+m,i+p,s+m],[i+p,s+m,i+p,s-m],[i+p,s-m,i-p,s-m]].map(d);if(!y.reduce(function(t,e){return t^!!a(w,k,w+1e6,k+1e6,e[0],e[1],e[2],e[3])},!1)){y.forEach(function(t){var e=a(i,s,w,k,t[0],t[1],t[2],t[3]);e&&(i=e.x,s=e.y)});var b=U.arrowwidth,x=U.arrowcolor,_=Y.append("g").style({opacity:f.opacity(x)}).classed("annotation-arrow-g",!0).attr("data-index",String(e)),A=_.append("path").attr("d","M"+i+","+s+"L"+w+","+k).style("stroke-width",b+"px").call(f.stroke,f.rgb(x));v.arrowhead(A,U.arrowhead,"end",U.arrowsize);var M=_.append("path").classed("annotation",!0).classed("anndrag",!0).attr({"data-index":String(e),d:"M3,3H-3V-3H3ZM0,0L"+(i-w)+","+(s-k),transform:"translate("+w+","+k+")"}).style("stroke-width",b+6+"px").call(f.stroke,"rgba(0,0,0,0)").call(f.fill,"rgba(0,0,0,0)");if(t._context.editable){var T,E,C;g.init({element:M.node(),prepFn:function(){var t=c.getTranslate(W);E=t.x,C=t.y,T={},V&&V.autorange&&(T[V._name+".autorange"]=!0),q&&q.autorange&&(T[q._name+".autorange"]=!0)},moveFn:function(t,e){_.attr("transform","translate("+t+","+e+")");var r=h(E,C),n=r[0]+t,i=r[1]+e;W.call(c.setTranslate,n,i),T[L+".x"]=V?U.x+t/V._m:(w+t-S.l)/S.w,T[L+".y"]=q?U.y+e/q._m:1-(k+e-S.t)/S.h,X.attr({transform:"rotate("+G+","+n+","+i+")"})},doneFn:function(e){if(e){l.relayout(t,T);var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}}})}}};U.showarrow&&C(0,0);var z=c.rotationXYMatrix(G,H.x,H.y),P=c.apply2DTransform(z);if(t._context.editable){var R,O,I;g.init({element:W.node(),prepFn:function(){var t=c.getTranslate(W);R=t.x,O=t.y,I={}},moveFn:function(t,e){W.call(c.setTranslate,R+t,O+e);var r="pointer";if(U.showarrow)I[L+".ax"]=U.ax+t,I[L+".ay"]=U.ay+e,C(t,e);else{if(V)I[L+".x"]=U.x+t/V._m;else{var n=U._xsize/S.w,i=U.x+U._xshift/S.w-n/2;I[L+".x"]=g.align(i+t/S.w,n,0,1,U.xanchor)}if(q)I[L+".y"]=U.y+e/q._m;else{var a=U._ysize/S.h,o=U.y-U._yshift/S.h-a/2;I[L+".y"]=g.align(o-e/S.h,a,0,1,U.yanchor)}V&&q||(r=g.getCursor(V?.5:I[L+".x"],q?.5:I[L+".y"],U.xanchor,U.yanchor))}var s=P(R,O),l=s[0]+t,u=s[1]+e;W.call(c.setTranslate,R+t,O+e),X.attr({transform:"rotate("+G+","+l+","+u+")"}),p(W,r)},doneFn:function(e){if(p(W),e){l.relayout(t,I);var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}}})}}var b,x=t.layout,_=t._fullLayout;if(!s(e)||-1===e){if(!e&&Array.isArray(i))return x.annotations=i,v.supplyLayoutDefaults(x,_),void v.drawAll(t);if("remove"===i)return delete x.annotations,_.annotations=[],void v.drawAll(t);if(r&&"add"!==i){for(b=0;b<_.annotations.length;b++)v.draw(t,b,r,i);return}e=_.annotations.length,_.annotations.push({})}if(!r&&i){if("remove"===i){for(_._infolayer.selectAll('.annotation[data-index="'+e+'"]').remove(),_.annotations.splice(e,1),x.annotations.splice(e,1),b=e;b<_.annotations.length;b++)_._infolayer.selectAll('.annotation[data-index="'+(b+1)+'"]').attr("data-index",String(b)),v.draw(t,b);return}if("add"===i||c.isPlainObject(i)){_.annotations.splice(e,0,{});var w=c.isPlainObject(i)?c.extendFlat({},i):{text:"New text"};for(x.annotations?x.annotations.splice(e,0,w):x.annotations=[w],b=_.annotations.length-1;b>e;b--)_._infolayer.selectAll('.annotation[data-index="'+(b-1)+'"]').attr("data-index",String(b)),v.draw(t,b)}}_._infolayer.selectAll('.annotation[data-index="'+e+'"]').remove();var k=x.annotations[e],A=_.annotations[e];if(k){var M={xref:k.xref,yref:k.yref},T={};"string"==typeof r&&r?T[r]=i:c.isPlainObject(r)&&(T=r);var E=Object.keys(T);for(b=0;bb;b++){var z=C[b];if(void 0===T[z]&&void 0!==k[z]){var P=u.getFromId(t,u.coerceRef(M,{},t,z)),R=u.getFromId(t,u.coerceRef(k,{},t,z)),O=k[z],I=A["_"+z+"type"];if(void 0!==T[z+"ref"]){var N="auto"===k[z+"anchor"],j="x"===z?S.w:S.h,F=(A["_"+z+"size"]||0)/(2*j);if(P&&R)O=(O-P.range[0])/(P.range[1]-P.range[0]),O=R.range[0]+O*(R.range[1]-R.range[0]);else if(P){if(O=(O-P.range[0])/(P.range[1]-P.range[0]),O=P.domain[0]+O*(P.domain[1]-P.domain[0]),N){var D=O+F,B=O-F;2/3>O+B?O=B:O+D>4/3&&(O=D)}}else R&&(N&&(1/3>O?O+=F:O>2/3&&(O-=F)),O=(O-R.domain[0])/(R.domain[1]-R.domain[0]),O=R.range[0]+O*(R.range[1]-R.range[0]))}R&&R===P&&I&&("log"===I&&"log"!==R.type?O=Math.pow(10,O):"log"!==I&&"log"===R.type&&(O=O>0?Math.log(O)/Math.LN10:void 0)),k[z]=O}}var U=n(k,_);_.annotations[e]=U;var V=u.getFromId(t,U.xref),q=u.getFromId(t,U.yref),H={x:0,y:0},G=+U.textangle||0,Y=_._infolayer.append("g").classed("annotation",!0).attr("data-index",String(e)).style("opacity",U.opacity).on("click",function(){t._dragging=!1,t.emit("plotly_clickannotation",{index:e,annotation:k,fullAnnotation:U})}),X=Y.append("g").classed("annotation-text-g",!0).attr("data-index",String(e)),W=X.append("g"),Z=U.borderwidth,K=U.borderpad,$=Z+K,Q=W.append("rect").attr("class","bg").style("stroke-width",Z+"px").call(f.stroke,U.bordercolor).call(f.fill,U.bgcolor),J=U.font,tt=W.append("text").classed("annotation",!0).attr("data-unformatted",U.text).text(U.text);t._context.editable?tt.call(d.makeEditable,W).call(m).on("edit",function(r){U.text=r,this.attr({"data-unformatted":U.text}),this.call(m);var n={};n["annotations["+e+"].text"]=U.text,V&&V.autorange&&(n[V._name+".autorange"]=!0),q&&q.autorange&&(n[q._name+".autorange"]=!0),l.relayout(t,n)}):tt.call(m),X.attr({transform:"rotate("+G+","+H.x+","+H.y+")"}).call(h.setPosition,H.x,H.y)}},v.arrowhead=function(t,e,r,n){s(n)||(n=1);var i=t.node(),a=v.ARROWPATHS[e||0];if(a){"string"==typeof r&&r||(r="end");var l,c,u,d,p=(h.getPx(t,"stroke-width")||1)*n,g=t.style("stroke")||f.defaultLine,m=t.style("stroke-opacity")||1,y=r.indexOf("start")>=0,b=r.indexOf("end")>=0,x=a.backoff*p;if("line"===i.nodeName){if(l={x:+t.attr("x1"),y:+t.attr("y1")},c={x:+t.attr("x2"),y:+t.attr("y2")},u=Math.atan2(l.y-c.y,l.x-c.x),d=u+Math.PI,x){var _=x*Math.cos(u),w=x*Math.sin(u);y&&(l.x-=_,l.y-=w,t.attr({x1:l.x,y1:l.y})),b&&(c.x+=_,c.y+=w,t.attr({x2:c.x,y2:c.y}))}}else if("path"===i.nodeName){var k=i.getTotalLength(),A="";if(y){var M=i.getPointAtLength(0),T=i.getPointAtLength(.1);u=Math.atan2(M.y-T.y,M.x-T.x),l=i.getPointAtLength(Math.min(x,k)),x&&(A="0px,"+x+"px,")}if(b){var E=i.getPointAtLength(k),L=i.getPointAtLength(k-.1);if(d=Math.atan2(E.y-L.y,E.x-L.x),c=i.getPointAtLength(Math.max(0,k-x)),x){var S=A?2*x:x;A+=k-S+"px,"+k+"px"}}else A&&(A+=k+"px");A&&t.style("stroke-dasharray",A)}var C=function(r,n){e>5&&(n=0),o.select(i.parentElement).append("path").attr({"class":t.attr("class"),d:a.path,transform:"translate("+r.x+","+r.y+")rotate("+180*n/Math.PI+")scale("+p+")"}).style({fill:g,opacity:m,"stroke-width":0})};y&&C(l,u),b&&C(c,d)}},v.calcAutorange=function(t){var e=t._fullLayout,r=e.annotations;if(r.length&&t._fullData.length){var n={};r.forEach(function(t){n[t.xref]=!0,n[t.yref]=!0});var a=u.list(t).filter(function(t){return t.autorange&&n[t._id]});if(a.length)return c.syncOrAsync([v.drawAll,i],t)}}},{"../../lib":382,"../../lib/setcursor":391,"../../lib/svg_text_utils":395,"../../plotly":402,"../../plots/cartesian/axes":405,"../color":303,"../dragelement":324,"../drawing":326,"./arrow_paths":299,"./attributes":300,d3:113,"fast-isnumeric":117}],302:[function(t,e,r){"use strict";r.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],r.defaultLine="#444",r.lightLine="#eee",r.background="#fff",r.lightFraction=1e3/11},{}],303:[function(t,e,r){"use strict";function n(t){if(a(t)||"string"!=typeof t)return t;var e=t.trim();if("rgb"!==e.substr(0,3))return t;var r=e.match(/^rgba?\s*\(([^()]*)\)$/);if(!r)return t;var n=r[1].trim().split(/\s*[\s,]\s*/),i="a"===e.charAt(3)&&4===n.length;if(!i&&3!==n.length)return t;for(var o=0;o=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}var i=t("tinycolor2"),a=t("fast-isnumeric"),o=e.exports={},s=t("./attributes");o.defaults=s.defaults,o.defaultLine=s.defaultLine,o.lightLine=s.lightLine,o.background=s.background,o.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},o.rgb=function(t){return o.tinyRGB(i(t))},o.opacity=function(t){return t?i(t).getAlpha():0},o.addOpacity=function(t,e){var r=i(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=i(t).toRgb();if(1===r.a)return i(t).toRgbString();var n=i(e||o.background).toRgb(),a=1===n.a?n:{r:255*(1-n.a)+n.r*n.a,g:255*(1-n.a)+n.g*n.a,b:255*(1-n.a)+n.b*n.a},s={r:a.r*(1-r.a)+r.r*r.a,g:a.g*(1-r.a)+r.g*r.a,b:a.b*(1-r.a)+r.b*r.a};return i(s).toRgbString()},o.stroke=function(t,e){var r=i(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=i(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,i,a,s=Object.keys(t);for(e=0;el&&(a[1]-=(ot-l)/2)):r.node()&&!r.classed("js-placeholder")&&(ot=h.bBox(e.node()).height),ot){if(ot+=5,"top"===x.titleside)Q.domain[1]-=ot/M.h,a[1]*=-1;else{Q.domain[0]+=ot/M.h;var u=Math.max(1,r.selectAll("tspan.line").size());a[1]+=(1-u)*l}e.attr("transform","translate("+a+")"),Q.setScale()}}it.selectAll(".cbfills,.cblines,.cbaxis").attr("transform","translate(0,"+Math.round(M.h*(1-Q.domain[1]))+")");var f=it.select(".cbfills").selectAll("rect.cbfill").data(S);f.enter().append("rect").classed("cbfill",!0).style("stroke","none"),f.exit().remove(),f.each(function(t,e){var r=[0===e?E[0]:(S[e]+S[e-1])/2,e===S.length-1?E[1]:(S[e]+S[e+1])/2].map(Q.c2p).map(Math.round);e!==S.length-1&&(r[1]+=r[1]>r[0]?1:-1);var a=z(t).replace("e-",""),o=i(a).toHexString();n.select(this).attr({x:Y,width:Math.max(D,2),y:n.min(r),height:Math.max(n.max(r)-n.min(r),2),fill:o})});var d=it.select(".cblines").selectAll("path.cbline").data(x.line.color&&x.line.width?L:[]);return d.enter().append("path").classed("cbline",!0),d.exit().remove(),d.each(function(t){n.select(this).attr("d","M"+Y+","+(Math.round(Q.c2p(t))+x.line.width/2%1)+"h"+D).call(h.lineGroupStyle,x.line.width,C(t),x.line.dash)}),Q._axislayer.selectAll("g."+Q._id+"tick,path").remove(),Q._pos=Y+D+(x.outlinewidth||0)/2-("outside"===x.ticks?1:0),Q.side="right",c.syncOrAsync([function(){return s.doTicks(t,Q,!0)},function(){if(-1===["top","bottom"].indexOf(x.titleside)){var e=Q.titlefont.size,r=Q._offset+Q._length/2,i=M.l+(Q.position||0)*M.w+("right"===Q.side?10+e*(Q.showticklabels?1:.5):-10-e*(Q.showticklabels?.5:0));w("h"+Q._id+"title",{avoid:{selection:n.select(t).selectAll("g."+Q._id+"tick"),side:x.titleside,offsetLeft:M.l,offsetTop:M.t,maxShift:A.width},attributes:{x:i,y:r,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])}function w(e,r){var n,i=b();n=o.traceIs(i,"markerColorscale")?"marker.colorbar.title":"colorbar.title";var a={propContainer:Q,propName:n,traceIndex:i.index,dfltName:"colorscale",containerGroup:it.select(".cbtitle")},s="h"===e.charAt(0)?e.substr(1):"h"+e;it.selectAll("."+s+",."+s+"-math-group").remove(),p.draw(t,e,u(a,r||{}))}function k(){var r=D+x.outlinewidth/2+h.bBox(Q._axislayer.node()).width;if(N=at.select("text"),N.node()&&!N.classed("js-placeholder")){var n,i=at.select(".h"+Q._id+"title-math-group").node();n=i&&-1!==["top","bottom"].indexOf(x.titleside)?h.bBox(i).width:h.bBox(at.node()).right-Y-M.l,r=Math.max(r,n)}var a=2*x.xpad+r+x.borderwidth+x.outlinewidth/2,s=Z-K;it.select(".cbbg").attr({x:Y-x.xpad-(x.borderwidth+x.outlinewidth)/2,y:K-H,width:Math.max(a,2),height:Math.max(s+2*H,2)}).call(d.fill,x.bgcolor).call(d.stroke,x.bordercolor).style({"stroke-width":x.borderwidth}),it.selectAll(".cboutline").attr({x:Y,y:K+x.ypad+("top"===x.titleside?ot:0),width:Math.max(D,2),height:Math.max(s-2*x.ypad-ot,2)}).call(d.stroke,x.outlinecolor).style({fill:"None","stroke-width":x.outlinewidth});var l=({center:.5,right:1}[x.xanchor]||0)*a;it.attr("transform","translate("+(M.l-l)+","+M.t+")"),o.autoMargin(t,e,{x:x.x,y:x.y,l:a*({right:1,center:.5}[x.xanchor]||0),r:a*({left:1,center:.5}[x.xanchor]||0),t:s*({bottom:1,middle:.5}[x.yanchor]||0),b:s*({top:1,middle:.5}[x.yanchor]||0)})}var A=t._fullLayout,M=A._size;if("function"!=typeof x.fillcolor&&"function"!=typeof x.line.color)return void A._infolayer.selectAll("g."+e).remove();var T,E=n.extent(("function"==typeof x.fillcolor?x.fillcolor:x.line.color).domain()),L=[],S=[],C="function"==typeof x.line.color?x.line.color:function(){return x.line.color},z="function"==typeof x.fillcolor?x.fillcolor:function(){return x.fillcolor},P=x.levels.end+x.levels.size/100,R=x.levels.size,O=1.001*E[0]-.001*E[1],I=1.001*E[1]-.001*E[0];for(T=x.levels.start;0>(T-P)*R;T+=R)T>O&&I>T&&L.push(T);if("function"==typeof x.fillcolor)if(x.filllevels)for(P=x.filllevels.end+x.filllevels.size/100,R=x.filllevels.size,T=x.filllevels.start;0>(T-P)*R;T+=R)T>E[0]&&T1){var nt=Math.pow(10,Math.floor(Math.log(rt)/Math.LN10));tt*=nt*c.roundUp(rt/nt,[2,5,10]),(Math.abs(x.levels.start)/x.levels.size+1e-6)%1<2e-6&&(Q.tick0=0)}Q.dtick=tt}Q.domain=[W+G,W+V-G],Q.setScale();var it=A._infolayer.selectAll("g."+e).data([0]);it.enter().append("g").classed(e,!0).each(function(){var t=n.select(this);t.append("rect").classed("cbbg",!0),t.append("g").classed("cbfills",!0),t.append("g").classed("cblines",!0),t.append("g").classed("cbaxis",!0).classed("crisp",!0),t.append("g").classed("cbtitleunshift",!0).append("g").classed("cbtitle",!0),t.append("rect").classed("cboutline",!0),t.select(".cbtitle").datum(0)}),it.attr("transform","translate("+Math.round(M.l)+","+Math.round(M.t)+")");var at=it.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(M.l)+",-"+Math.round(M.t)+")");Q._axislayer=it.select(".cbaxis");var ot=0;if(-1!==["top","bottom"].indexOf(x.titleside)){var st,lt=M.l+(x.x+q)*M.w,ct=Q.titlefont.size;st="top"===x.titleside?(1-(W+V-G))*M.h+M.t+3+.75*ct:(1-(W+G))*M.h+M.t-3-.25*ct,w(Q._id+"title",{attributes:{x:lt,y:st,"text-anchor":"start"}})}var ut=c.syncOrAsync([o.previousPromises,_,o.previousPromises,k],t);if(ut&&ut.then&&(t._promises||[]).push(ut),t._context.editable){var ft,ht,dt;l.init({element:it.node(),prepFn:function(){ft=it.attr("transform"),f(it)},moveFn:function(t,e){it.attr("transform",ft+" translate("+t+","+e+")"),ht=l.align(X+t/M.w,B,0,1,x.xanchor),dt=l.align(W-e/M.h,V,0,1,x.yanchor);var r=l.getCursor(ht,dt,x.xanchor,x.yanchor);f(it,r)},doneFn:function(e){f(it),e&&void 0!==ht&&void 0!==dt&&a.restyle(t,{"colorbar.x":ht,"colorbar.y":dt},b().index)}})}return ut}function b(){var r,n,i=e.substr(2);for(r=0;ru*f?i.RdBu:u>=0?i.Reds:i.Blues,l.colorscale=h,s.reversescale&&(h=a(h)),s.colorscale=h)}},{"../../lib":382,"./flip_scale":314,"./scales":321}],311:[function(t,e,r){"use strict";var n=t("./attributes"),i=t("../../lib/extend").extendDeep;e.exports=function(t){return{color:{valType:"color",arrayOk:!0},colorscale:i({},n.colorscale,{}),cauto:i({},n.zauto,{}),cmax:i({},n.zmax,{}),cmin:i({},n.zmin,{}),autocolorscale:i({},n.autocolorscale,{}),reversescale:i({},n.reversescale,{})}}},{"../../lib/extend":377,"./attributes":309}],312:[function(t,e,r){"use strict";var n=t("./scales");e.exports=n.RdBu},{"./scales":321}],313:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../colorbar/has_colorbar"),o=t("../colorbar/defaults"),s=t("./is_valid_scale"),l=t("./flip_scale");e.exports=function(t,e,r,c,u){var f=u.prefix,h=u.cLetter,d=f.slice(0,f.length-1),p=f?i.nestedProperty(t,d).get()||{}:t,g=f?i.nestedProperty(e,d).get()||{}:e,v=p[h+"min"],m=p[h+"max"],y=p.colorscale,b=n(v)&&n(m)&&m>v;c(f+h+"auto",!b),c(f+h+"min"),c(f+h+"max");var x;void 0!==y&&(x=!s(y)),c(f+"autocolorscale",x);var _=c(f+"colorscale"),w=c(f+"reversescale");if(w&&(g.colorscale=l(_)),"marker.line."!==f){var k;f&&(k=a(p));var A=c(f+"showscale",k);A&&o(p,g,r)}}},{"../../lib":382,"../colorbar/defaults":305,"../colorbar/has_colorbar":307,"./flip_scale":314,"./is_valid_scale":318,"fast-isnumeric":117}],314:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length,n=new Array(r),i=r-1,a=0;i>=0;i--,a++)e=t[i],n[a]=[1-e[0],e[1]];return n}},{}],315:[function(t,e,r){"use strict";var n=t("./scales"),i=t("./default_scale"),a=t("./is_valid_scale_array");e.exports=function(t,e){function r(){try{t=n[t]||JSON.parse(t)}catch(r){t=e}}return e||(e=i),t?("string"==typeof t&&(r(),"string"==typeof t&&r()),a(t)?t:e):e}},{"./default_scale":312,"./is_valid_scale_array":319,"./scales":321}],316:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./is_valid_scale");e.exports=function(t,e){var r=e?i.nestedProperty(t,e).get()||{}:t,o=r.color,s=!1;if(Array.isArray(o))for(var l=0;lh;h++)l=t[h],u[h]=e+l[0]*(r-e),f[h]=i(l[1]).toRgb();var d=n.scale.linear().domain(u).interpolate(n.interpolateObject).range(f);return function(t){if(a(t)){var n=o.constrain(t,e,r),l=d(n);return i(l).toRgbString()}return i(t).isValid()?t:s.defaultLine}}},{"../../lib":382,"../color":303,d3:113,"fast-isnumeric":117,tinycolor2:274}],321:[function(t,e,r){"use strict";e.exports={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]]}},{}],322:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i){var a=(t-r)/(n-r),o=a+e/(n-r),s=(a+o)/2;return"left"===i||"bottom"===i?a:"center"===i||"middle"===i?s:"right"===i||"top"===i?o:2/3-s>a?a:o>4/3-s?o:s}},{}],323:[function(t,e,r){"use strict";var n=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,a){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:n.constrain(Math.floor(3*e),0,2),i[e][t]}},{"../../lib":382}],324:[function(t,e,r){"use strict";function n(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function i(t){t._dragging=!1,t._replotPending&&a.plot(t)}var a=t("../../plotly"),o=t("../../lib"),s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var c=t("./unhover");l.unhover=c.wrapped,l.unhoverRaw=c.raw,l.init=function(t){function e(e){return p._dragged=!1,p._dragging=!0,c=e.clientX,u=e.clientY,d=e.target,f=(new Date).getTime(),f-p._mouseDownTimev&&(g=Math.max(g-1,1)),t.doneFn&&t.doneFn(p._dragged,g),!p._dragged){var r=document.createEvent("MouseEvents");r.initEvent("click",!0,!0),d.dispatchEvent(r)}return i(p),p._dragged=!1,o.pauseEvent(e)}var c,u,f,h,d,p=o.getPlotDiv(t.element)||{},g=1,v=s.DBLCLICKDELAY;p._mouseDownTime||(p._mouseDownTime=0),t.element.onmousedown=e,t.element.style.pointerEvents="all"}},{"../../lib":382,"../../plotly":402,"../../plots/cartesian/constants":410,"./align":322,"./cursor":323,"./unhover":325}],325:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=e.exports={};i.wrapped=function(t,e,r){"string"==typeof t&&(t=document.getElementById(t)),t._hoverTimer&&(clearTimeout(t._hoverTimer),t._hoverTimer=void 0),i.raw(t,e,r)},i.raw=function(t,e){var r=t._fullLayout;e||(e={}),e.target&&n.triggerHandler(t,"plotly_beforehover",e)===!1||(r._hoverlayer.selectAll("g").remove(),e.target&&t._hoverdata&&t.emit("plotly_unhover",{points:t._hoverdata}),t._hoverdata=void 0)}},{"../../lib/events":376}],326:[function(t,e,r){"use strict";function n(t,e,r,n){var a=t[0]-e[0],o=t[1]-e[1],s=r[0]-e[0],l=r[1]-e[1],c=Math.pow(a*a+o*o,x/2),u=Math.pow(s*s+l*l,x/2),f=(u*u*a-c*c*s)*n,h=(u*u*o-c*c*l)*n,d=3*u*(c+u),p=3*c*(c+u);return[[i.round(e[0]+(d&&f/d),2),i.round(e[1]+(d&&h/d),2)],[i.round(e[0]-(p&&f/p),2),i.round(e[1]-(p&&h/p),2)]]}var i=t("d3"),a=t("fast-isnumeric"),o=t("../../plots/plots"),s=t("../color"),l=t("../colorscale"),c=t("../../lib"),u=t("../../lib/svg_text_utils"),f=t("../../constants/xmlns_namespaces"),h=t("../../traces/scatter/subtypes"),d=t("../../traces/scatter/make_bubble_size_func"),p=e.exports={};p.font=function(t,e,r,n){e&&e.family&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(s.fill,n)},p.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},p.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},p.setRect=function(t,e,r,n,i){t.call(p.setPosition,e,r).call(p.setSize,n,i)},p.translatePoints=function(t,e,r){t.each(function(t){var n=t.xp||e.c2p(t.x),o=t.yp||r.c2p(t.y),s=i.select(this);a(n)&&a(o)?"text"===this.nodeName?s.attr("x",n).attr("y",o):s.attr("transform","translate("+n+","+o+")"):s.remove()})},p.getPx=function(t,e){return Number(t.style(e).replace(/px$/,""))},p.crispRound=function(t,e,r){return e&&a(e)?t._context.staticPlot?e:1>e?1:Math.round(e):r||0},p.lineGroupStyle=function(t,e,r,n){t.style("fill","none").each(function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},o=e||a.width||0,l=n||a.dash||"";i.select(this).call(s.stroke,r||a.color).call(p.dashLine,l,o)})},p.dashLine=function(t,e,r){var n=Math.max(r,3);"solid"===e?e="":"dot"===e?e=n+"px,"+n+"px":"dash"===e?e=3*n+"px,"+3*n+"px":"longdash"===e?e=5*n+"px,"+5*n+"px":"dashdot"===e?e=3*n+"px,"+n+"px,"+n+"px,"+n+"px":"longdashdot"===e&&(e=5*n+"px,"+2*n+"px,"+n+"px,"+2*n+"px"),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},p.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var r=i.select(this);try{r.call(s.fill,e[0].trace.fillcolor)}catch(n){c.error(n,t),r.remove()}})};var g=t("./symbol_defs");p.symbolNames=[],p.symbolFuncs=[],p.symbolNeedLines={},p.symbolNoDot={},p.symbolList=[],Object.keys(g).forEach(function(t){var e=g[t];p.symbolList=p.symbolList.concat([e.n,t,e.n+100,t+"-open"]),p.symbolNames[e.n]=t,p.symbolFuncs[e.n]=e.f,e.needLine&&(p.symbolNeedLines[e.n]=!0),e.noDot?p.symbolNoDot[e.n]=!0:p.symbolList=p.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"])});var v=p.symbolNames.length,m="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";p.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),t=p.symbolNames.indexOf(t),t>=0&&(t+=e)}return t%100>=v||t>=400?0:Math.floor(Math.max(t,0))},p.pointStyle=function(t,e){if(t.size()){var r=e.marker,n=r.line;if(o.traceIs(e,"symbols")){var a=d(e);t.attr("d",function(t){var n;n="various"===t.ms||"various"===r.size?3:h.isBubble(e)?a(t.ms):(r.size||6)/2,t.mrc=n;var i=p.symbolNumber(t.mx||r.symbol)||0,o=i%100;return t.om=i%200>=100,p.symbolFuncs[o](n)+(i>=200?m:"")}).style("opacity",function(t){return(t.mo+1||r.opacity+1)-1})}var l=(e._input||{}).marker||{},c=p.tryColorscale(r,l,""),u=p.tryColorscale(r,l,"line.");t.each(function(t){var e,a,o;t.so?(o=n.outlierwidth,a=n.outliercolor,e=r.outliercolor):(o=(t.mlw+1||n.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,a="mlc"in t?t.mlcc=u(t.mlc):Array.isArray(n.color)?s.defaultLine:n.color,e="mc"in t?t.mcc=c(t.mc):Array.isArray(r.color)?s.defaultLine:r.color||"rgba(0,0,0,0)");var l=i.select(this);t.om?l.call(s.stroke,e).style({"stroke-width":(o||1)+"px",fill:"none"}):(l.style("stroke-width",o+"px").call(s.fill,e),o&&l.call(s.stroke,a))})}},p.tryColorscale=function(t,e,r){var n=c.nestedProperty(t,r+"color").get(),i=c.nestedProperty(t,r+"colorscale").get(),o=c.nestedProperty(t,r+"cauto").get(),s=c.nestedProperty(t,r+"cmin"),u=c.nestedProperty(t,r+"cmax"),f=s.get(),h=u.get();return i&&Array.isArray(n)?(!o&&a(f)&&a(h)||(f=1/0,h=-(1/0),n.forEach(function(t){a(t)&&(f>t&&(f=+t),t>h&&(h=+t))}),f>h&&(f=0,h=1),s.set(f),u.set(h),c.nestedProperty(e,r+"cmin").set(f),c.nestedProperty(e,r+"cmax").set(h)),l.makeScaleFunction(i,f,h)):c.identity};var y={start:1,end:-1,middle:0,bottom:1,top:-1},b=1.3;p.textPointStyle=function(t,e){t.each(function(t){var r=i.select(this),n=t.tx||e.text;if(!n||Array.isArray(n))return void r.remove();var o=t.tp||e.textposition,s=-1!==o.indexOf("top")?"top":-1!==o.indexOf("bottom")?"bottom":"middle",l=-1!==o.indexOf("left")?"end":-1!==o.indexOf("right")?"start":"middle",c=t.ts||e.textfont.size,f=t.mrc?t.mrc/.8+1:0;c=a(c)&&c>0?c:0,r.call(p.font,t.tf||e.textfont.family,c,t.tc||e.textfont.color).attr("text-anchor",l).text(n).call(u.convertToTspans);var h=i.select(this.parentNode),d=r.selectAll("tspan.line"),g=((d[0].length||1)-1)*b+1,v=y[l]*f,m=.75*c+y[s]*f+(y[s]-1)*g*c/2;h.attr("transform","translate("+v+","+m+")"),g>1&&d.attr({x:r.attr("x"),y:r.attr("y")})})};var x=.5;p.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,i="M"+t[0],a=[];for(r=1;rr;r++)o.push(n(t[r-1],t[r],t[r+1],e));for(o.push(n(t[a-1],t[a],t[0],e)),r=1;a>=r;r++)i+="C"+o[r-1][1]+" "+o[r][0]+" "+t[r];return i+="C"+o[a][1]+" "+o[0][0]+" "+t[0]+"Z"};var _={hv:function(t,e){return"H"+i.round(e[0],2)+"V"+i.round(e[1],2)},vh:function(t,e){return"V"+i.round(e[1],2)+"H"+i.round(e[0],2)},hvh:function(t,e){return"H"+i.round((t[0]+e[0])/2,2)+"V"+i.round(e[1],2)+"H"+i.round(e[0],2)},vhv:function(t,e){return"V"+i.round((t[1]+e[1])/2,2)+"H"+i.round(e[0],2)+"V"+i.round(e[1],2)}},w=function(t,e){return"L"+i.round(e[0],2)+","+i.round(e[1],2)};p.steps=function(t){var e=_[t]||w;return function(t){for(var r="M"+i.round(t[0][0],2)+","+i.round(t[0][1],2),n=1;n=A&&(i.selectAll("[data-bb]").attr("data-bb",null),k=[]),t.setAttribute("data-bb",k.length),k.push(l),c.extendFlat({},l)},p.setClipUrl=function(t,e){if(!e)return void t.attr("clip-path",null);var r="#"+e,n=i.select("base");n.size()&&n.attr("href")&&(r=window.location.href+r),t.attr("clip-path","url("+r+")")}},{"../../constants/xmlns_namespaces":370,"../../lib":382,"../../lib/svg_text_utils":395,"../../plots/plots":454,"../../traces/scatter/make_bubble_size_func":569,"../../traces/scatter/subtypes":575,"../color":303,"../colorscale":317,"./symbol_defs":327,d3:113,"fast-isnumeric":117}],327:[function(t,e,r){"use strict";var n=t("d3");e.exports={circle:{n:0,f:function(t){var e=n.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=n.round(.4*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H"+e+"V"+r+"H-"+e+"V"+e+"H-"+r+"V-"+e+"H-"+e+"V-"+r+"H"+e+"V-"+e+"H"+r+"Z"}},x:{n:4,f:function(t){var e=n.round(.8*t/Math.sqrt(2),2),r="l"+e+","+e,i="l"+e+",-"+e,a="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+i+a+i+a+o+a+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+e+","+r+"H"+e+"L0,-"+i+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+e+",-"+r+"H"+e+"L0,"+i+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M"+r+",-"+e+"V"+e+"L-"+i+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+r+",-"+e+"V"+e+"L"+i+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+r+",-"+e+"H"+e+"V"+r+"Z"}},"triangle-se":{n:10,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+e+",-"+r+"V"+e+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H-"+e+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+e+","+r+"V-"+e+"H"+r+"Z"}},pentagon:{n:13,f:function(t){var e=n.round(.951*t,2),r=n.round(.588*t,2),i=n.round(-t,2),a=n.round(t*-.309,2),o=n.round(.809*t,2);return"M"+e+","+a+"L"+r+","+o+"H-"+r+"L-"+e+","+a+"L0,"+i+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M"+i+",-"+r+"V"+r+"L0,"+e+"L-"+i+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+i+"H"+r+"L"+e+",0L"+r+",-"+i+"H-"+r+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=n.round(.924*t,2),r=n.round(.383*t,2);return"M-"+r+",-"+e+"H"+r+"L"+e+",-"+r+"V"+r+"L"+r+","+e+"H-"+r+"L-"+e+","+r+"V-"+r+"Z"}},star:{n:17,f:function(t){var e=1.4*t,r=n.round(.225*e,2),i=n.round(.951*e,2),a=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(e*-.309,2),c=n.round(.118*e,2),u=n.round(.809*e,2),f=n.round(.382*e,2);return"M"+r+","+l+"H"+i+"L"+a+","+c+"L"+o+","+u+"L0,"+f+"L-"+o+","+u+"L-"+a+","+c+"L-"+i+","+l+"H-"+r+"L0,"+s+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),i=n.round(.76*t,2);return"M-"+i+",0l-"+r+",-"+e+"h"+i+"l"+r+",-"+e+"l"+r+","+e+"h"+i+"l-"+r+","+e+"l"+r+","+e+"h-"+i+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+i+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+i+o+"-"+e+","+r+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+i+o+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+i+"-"+e+","+e+i+e+","+e+i+e+",-"+e+i+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+i+"0,"+e+i+e+",0"+i+"0,-"+e+i+"-"+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),i=n.round(.8*t,2);return"M-"+e+","+i+"L0,0M"+e+","+i+"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),i=n.round(.8*t,2);return"M-"+e+",-"+i+"L0,0M"+e+",-"+i+"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),i=n.round(.8*t,2);return"M"+i+","+e+"L0,0M"+i+",-"+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),i=n.round(.8*t,2);return"M-"+i+","+e+"L0,0M-"+i+",-"+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:113}],328:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"]},symmetric:{valType:"boolean"},array:{valType:"data_array"},arrayminus:{valType:"data_array"},value:{valType:"number",min:0,dflt:10},valueminus:{valType:"number",min:0,dflt:10},traceref:{valType:"integer",min:0,dflt:0},tracerefminus:{valType:"integer",min:0,dflt:0},copy_ystyle:{valType:"boolean"},copy_zstyle:{valType:"boolean"},color:{valType:"color"},thickness:{valType:"number",min:0,dflt:2},width:{valType:"number",min:0},_deprecated:{opacity:{valType:"number"}}}},{}],329:[function(t,e,r){"use strict";function n(t,e,r,n){var a=e["error_"+n]||{},l=a.visible&&-1!==["linear","log"].indexOf(r.type),c=[];if(l){for(var u=s(a),f=0;fs;s++)o[s]={x:r[s],y:i[s]};return o[0].trace=t,n.calc({calcdata:[o],_fullLayout:e}),o},n.plot=t("./plot"),n.style=t("./style"),n.hoverInfo=function(t,e,r){(e.error_y||{}).visible&&(r.yerr=t.yh-t.y,e.error_y.symmetric||(r.yerrneg=t.y-t.ys)),(e.error_x||{}).visible&&(r.xerr=t.xh-t.x,e.error_x.symmetric||(r.xerrneg=t.x-t.xs))}},{"./attributes":328,"./calc":329,"./defaults":331,"./plot":333,"./style":334}],333:[function(t,e,r){"use strict";function n(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};return void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(t.ys,!0))),void 0!==t.xh&&(n.xh=e.c2p(t.xh),n.xs=e.c2p(t.xs),a(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0))),n}var i=t("d3"),a=t("fast-isnumeric"),o=t("../../lib"),s=t("../../traces/scatter/subtypes");e.exports=function(t,e){var r=e.x(),l=e.y();t.each(function(t){var e=t[0].trace,c=e.error_x||{},u=e.error_y||{},f=s.hasMarkers(e)&&e.marker.maxdisplayed>0;if(u.visible||c.visible){var h=i.select(this).selectAll("g.errorbar").data(o.identity);h.enter().append("g").classed("errorbar",!0),h.each(function(t){var e=i.select(this),o=n(t,r,l);if(!f||t.vis){var s;if(u.visible&&a(o.x)&&a(o.yh)&&a(o.ys)){var h=u.width;s="M"+(o.x-h)+","+o.yh+"h"+2*h+"m-"+h+",0V"+o.ys,o.noYS||(s+="m-"+h+",0h"+2*h),e.append("path").classed("yerror",!0).attr("d",s)}if(c.visible&&a(o.y)&&a(o.xh)&&a(o.xs)){var d=(c.copy_ystyle?u:c).width;s="M"+o.xh+","+(o.y-d)+"v"+2*d+"m0,-"+d+"H"+o.xs,o.noXS||(s+="m0,-"+d+"v"+2*d),e.append("path").classed("xerror",!0).attr("d",s)}}})}})}},{"../../lib":382,"../../traces/scatter/subtypes":575,d3:113,"fast-isnumeric":117}],334:[function(t,e,r){"use strict";var n=t("d3"),i=t("../color");e.exports=function(t){t.each(function(t){var e=t[0].trace,r=e.error_y||{},a=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(i.stroke,r.color),a.copy_ystyle&&(a=r),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(i.stroke,a.color)})}},{"../color":303,d3:113}],335:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/constants");e.exports={_isLinkedToArray:!0,source:{valType:"string"},layer:{valType:"enumerated",values:["below","above"],dflt:"above"},sizex:{valType:"number",dflt:0},sizey:{valType:"number",dflt:0},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain"},opacity:{valType:"number",min:0,max:1,dflt:1},x:{valType:"number",dflt:0},y:{valType:"number",dflt:0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top"},xref:{valType:"enumerated",values:["paper",n.idRegex.x.toString()],dflt:"paper"},yref:{valType:"enumerated",values:["paper",n.idRegex.y.toString()],dflt:"paper"}}},{"../../plots/cartesian/constants":410}],336:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return a.coerce(t,e,o,r,n)}e=e||{},n("source"),n("layer"),n("x"),n("y"),n("xanchor"),n("yanchor"),n("sizex"),n("sizey"),n("sizing"),n("opacity");for(var s=0;2>s;s++){var l={_fullLayout:r},c=["x","y"][s];i.coerceRef(t,e,l,c,"paper")}return e}var i=t("../../plots/cartesian/axes"),a=t("../../lib"),o=t("./attributes");e.exports=function(t,e){if(t.images&&Array.isArray(t.images))for(var r=t.images,i=e.images=[],a=0;a=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}},{}],340:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat;e.exports={bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.defaultLine},borderwidth:{valType:"number",min:0,dflt:0},font:a({},n,{}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"]},tracegroupgap:{valType:"number",min:0,dflt:10},x:{valType:"number",min:-2,max:3,dflt:1.02},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"}}},{"../../lib/extend":377,"../../plots/font_attributes":423,"../color/attributes":302}],341:[function(t,e,r){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],342:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/plots"),a=t("./attributes"),o=t("./helpers");e.exports=function(t,e,r){function s(t,e){return n.coerce(h,d,a,t,e)}for(var l,c,u,f,h=t.legend||{},d=e.legend={},p=0,g="normal",v=0;v1);if(y!==!1){if(s("bgcolor",e.paper_bgcolor),s("bordercolor"),s("borderwidth"),n.coerceFont(s,"font",e.font),s("orientation"),"h"===d.orientation){var b=t.xaxis;b&&b.rangeslider&&b.rangeslider.visible?(l=0,u="left",c=1.1,f="bottom"):(l=0,u="left",c=-.1,f="top")}s("traceorder",g),o.isGrouped(e.legend)&&s("tracegroupgap"),s("x",l),s("xanchor",u),s("y",c),s("yanchor",f),n.noneOrAll(h,d,["x","y"])}}},{"../../lib":382,"../../plots/plots":454,"./attributes":340,"./helpers":345}],343:[function(t,e,r){"use strict";function n(t,e){function r(r){u.util.convertToTspans(r,function(){r.selectAll("tspan.line").attr({x:r.attr("x")}),t.call(a,e)})}var n=t.data()[0][0],i=e._fullLayout,o=n.trace,s=h.traceIs(o,"pie"),l=o.index,c=s?n.label:o.name,f=t.selectAll("text.legendtext").data([0]);f.enter().append("text").classed("legendtext",!0),f.attr({x:40,y:0,"data-unformatted":c}).style("text-anchor","start").classed("user-select-none",!0).call(p.font,i.legend.font).text(c),e._context.editable&&!s?f.call(u.util.makeEditable).call(r).on("edit",function(t){this.attr({"data-unformatted":t}),this.text(t).call(r),this.text()||(t=" "),u.restyle(e,"name",t,l)}):f.call(r)}function i(t,e){var r=e._fullLayout.hiddenlabels?e._fullLayout.hiddenlabels.slice():[],n=t.selectAll("rect").data([0]);n.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(g.fill,"rgba(0,0,0,0)"),n.on("click",function(){if(!e._dragged){var n,i,a=t.data()[0][0],o=e._fullData,s=a.trace,l=s.legendgroup,c=[];if(h.traceIs(s,"pie")){var f=a.label,d=r.indexOf(f);-1===d?r.push(f):r.splice(d,1),u.relayout(e,"hiddenlabels",r)}else{if(""===l)c=[s.index];else for(var p=0;ptspan"),d=h[0].length||1;r=l*d,n=u.node()&&p.bBox(u.node()).width;var g=l*(.3+(1-d)/2);u.attr("y",g),h.attr("y",g)}r=Math.max(r,16)+3,a.attr({x:0,y:-r/2,height:r}),i.height=r,i.width=n}function o(t,e,r){var n=t._fullLayout,i=n.legend,a=i.borderwidth,o=b.isGrouped(i);if(b.isVertical(i))o&&e.each(function(t,e){f.setTranslate(this,0,e*i.tracegroupgap)}),i.width=0,i.height=0,r.each(function(t){var e=t[0],r=e.height,n=e.width;f.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),r.selectAll(".legendtoggle").attr("width",(t._context.editable?0:i.width)+40),i.width=Math.ceil(i.width),i.height=Math.ceil(i.height);else if(o){i.width=0,i.height=0;for(var s=[i.width],l=e.data(),u=0,h=l.length;h>u;u++){var d=l[u].map(function(t){return t[0].width}),p=40+Math.max.apply(null,d);i.width+=i.tracegroupgap+p,s.push(i.width)}e.each(function(t,e){f.setTranslate(this,s[e],0)}),e.each(function(){var t=c.select(this),e=t.selectAll("g.traces"),r=0;e.each(function(t){var e=t[0],n=e.height;f.setTranslate(this,0,5+a+r+n/2),r+=n}),i.height=Math.max(i.height,r)}),i.height+=10+2*a,i.width+=2*a,i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),r.selectAll(".legendtoggle").attr("width",t._context.editable?0:i.width)}else i.width=0,i.height=0,r.each(function(t){var e=t[0],r=40+e.width,n=i.tracegroupgap||5;f.setTranslate(this,a+i.width,5+a+e.height/2),i.width+=n+r,i.height=Math.max(i.height,e.height)}),i.width+=2*a,i.height+=10+2*a,i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),r.selectAll(".legendtoggle").attr("width",t._context.editable?0:i.width)}function s(t){var e=t._fullLayout,r=e.legend,n="left";x.isRightAnchor(r)?n="right":x.isCenterAnchor(r)&&(n="center");var i="top";x.isBottomAnchor(r)?i="bottom":x.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";x.isRightAnchor(r)?n="right":x.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 c=t("d3"),u=t("../../plotly"),f=t("../../lib"),h=t("../../plots/plots"),d=t("../dragelement"),p=t("../drawing"),g=t("../color"),v=t("./constants"),m=t("./get_legend_data"),y=t("./style"),b=t("./helpers"),x=t("./anchor_utils");e.exports=function(t){function e(t,e){T.attr("data-scroll",e).call(f.setTranslate,0,e),E.call(p.setRect,F,t,v.scrollBarWidth,v.scrollBarHeight),A.select("rect").attr({y:b.borderwidth-e})}var r=t._fullLayout,a="legend"+r._uid;if(r._infolayer&&t.calcdata){var b=r.legend,_=r.showlegend&&m(t.calcdata,b),w=r.hiddenlabels||[];if(!r.showlegend||!_.length)return r._infolayer.selectAll(".legend").remove(),r._topdefs.select("#"+a).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 A=r._topdefs.selectAll("#"+a).data([0]);A.enter().append("clipPath").attr("id",a).append("rect");var M=k.selectAll("rect.bg").data([0]);M.enter().append("rect").attr({"class":"bg","shape-rendering":"crispEdges"}).call(g.stroke,b.bordercolor).call(g.fill,b.bgcolor).style("stroke-width",b.borderwidth+"px");var T=k.selectAll("g.scrollbox").data([0]);T.enter().append("g").attr("class","scrollbox");var E=k.selectAll("rect.scrollbar").data([0]);E.enter().append("rect").attr({"class":"scrollbar",rx:20,ry:2,width:0,height:0}).call(g.fill,"#808BA4");var L=T.selectAll("g.groups").data(_);L.enter().append("g").attr("class","groups"),L.exit().remove();var S=L.selectAll("g.traces").data(f.identity);S.enter().append("g").attr("class","traces"),S.exit().remove(),S.call(y).style("opacity",function(t){var e=t[0].trace;return h.traceIs(e,"pie")?-1!==w.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){c.select(this).call(n,t).call(i,t)});var C=0!==k.enter().size();C&&(o(t,L,S),s(t));var z=0,P=r.width,R=0,O=r.height;o(t,L,S),b.height>O?l(t):s(t);var I=r._size,N=I.l+I.w*b.x,j=I.t+I.h*(1-b.y);x.isRightAnchor(b)?N-=b.width:x.isCenterAnchor(b)&&(N-=b.width/2),x.isBottomAnchor(b)?j-=b.height:x.isMiddleAnchor(b)&&(j-=b.height/2);var F=b.width,D=I.w;F>D?(N=I.l,F=D):(N+F>P&&(N=P-F),z>N&&(N=z),F=Math.min(P-N,b.width));var B=b.height,U=I.h;B>U?(j=I.t,B=U):(j+B>O&&(j=O-B),R>j&&(j=R),B=Math.min(O-j,b.height)),f.setTranslate(k,N,j);var V,q,H=B-v.scrollBarHeight-2*v.scrollBarMargin,G=b.height-B;if(b.height<=B||t._context.staticPlot)M.attr({width:F-b.borderwidth,height:B-b.borderwidth,x:b.borderwidth/2,y:b.borderwidth/2}),f.setTranslate(T,0,0),A.select("rect").attr({width:F-2*b.borderwidth,height:B-2*b.borderwidth,x:b.borderwidth,y:b.borderwidth}),T.call(p.setClipUrl,a);else{V=v.scrollBarMargin,q=T.attr("data-scroll")||0,M.attr({width:F-2*b.borderwidth+v.scrollBarWidth+v.scrollBarMargin,height:B-b.borderwidth,x:b.borderwidth/2,y:b.borderwidth/2}),A.select("rect").attr({width:F-2*b.borderwidth+v.scrollBarWidth+v.scrollBarMargin,height:B-2*b.borderwidth,x:b.borderwidth,y:b.borderwidth-q}),T.call(p.setClipUrl,a),C&&e(V,q),k.on("wheel",null),k.on("wheel",function(){q=f.constrain(T.attr("data-scroll")-c.event.deltaY/H*G,-G,0),V=v.scrollBarMargin-q/G*H,e(V,q),c.event.preventDefault()}),E.on(".drag",null),T.on(".drag",null);var Y=c.behavior.drag().on("drag",function(){V=f.constrain(c.event.y-v.scrollBarHeight/2,v.scrollBarMargin,v.scrollBarMargin+H),q=-(V-v.scrollBarMargin)/H*G,e(V,q)});E.call(Y),T.call(Y)}if(t._context.editable){var X,W,Z,K;k.classed("cursor-move",!0),d.init({element:k.node(),prepFn:function(){var t=f.getTranslate(k);Z=t.x,K=t.y},moveFn:function(t,e){var r=Z+t,n=K+e;f.setTranslate(k,r,n),X=d.align(r,0,I.l,I.l+I.w,b.xanchor),W=d.align(n,0,I.t+I.h,I.t,b.yanchor)},doneFn:function(e){e&&void 0!==X&&void 0!==W&&u.relayout(t,{"legend.x":X,"legend.y":W})}})}}}},{"../../lib":382,"../../plotly":402,"../../plots/plots":454,"../color":303,"../dragelement":324,"../drawing":326,"./anchor_utils":339,"./constants":341,"./get_legend_data":344,"./helpers":345,"./style":347,d3:113}],344:[function(t,e,r){"use strict";var n=t("../../plots/plots"),i=t("./helpers");e.exports=function(t,e){function r(t,r){if(""!==t&&i.isGrouped(e))-1===l.indexOf(t)?(l.push(t),c=!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=[],c=!1,u={},f=0;for(a=0;aa;a++)m=s[l[a]],y[a]=i.isReversed(e)?m.reverse():m;else{for(y=[new Array(b)],a=0;b>a;a++)m=s[l[a]][0],y[0][i.isReversed(e)?b-a-1:a]=m;b=1}return e._lgroupsLength=b,y}},{"../../plots/plots":454,"./helpers":345}],345:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.legendGetsTrace=function(t){return t.visible&&n.traceIs(t,"showLegend")},r.isGrouped=function(t){return-1!==(t.traceorder||"").indexOf("grouped")},r.isVertical=function(t){return"h"!==t.orientation},r.isReversed=function(t){return-1!==(t.traceorder||"").indexOf("reversed")}},{"../../plots/plots":454}],346:[function(t,e,r){"use strict";var n=e.exports={};n.layoutAttributes=t("./attributes"),n.supplyLayoutDefaults=t("./defaults"),n.draw=t("./draw"),n.style=t("./style")},{"./attributes":340,"./defaults":342,"./draw":343,"./style":347}],347:[function(t,e,r){"use strict";function n(t){var e=t[0].trace,r=e.visible&&e.fill&&"none"!==e.fill,n=d.hasLines(e),i=l.select(this).select(".legendfill").selectAll("path").data(r?[t]:[]);i.enter().append("path").classed("js-fill",!0),i.exit().remove(),i.attr("d","M5,0h30v6h-30z").call(f.fillGroupStyle);var a=l.select(this).select(".legendlines").selectAll("path").data(n?[t]:[]);a.enter().append("path").classed("js-line",!0).attr("d","M5,0h30"),a.exit().remove(),a.call(f.lineGroupStyle)}function i(t){function e(t,e,r){var n=c.nestedProperty(o,t).get(),i=Array.isArray(n)&&e?e(n):n;if(r){if(ir[1])return r[1]}return i}function r(t){return t[0]}var n,i,a=t[0],o=a.trace,s=d.hasMarkers(o),u=d.hasText(o),h=d.hasLines(o);if(s||u||h){var p={},g={};s&&(p.mc=e("marker.color",r),p.mo=e("marker.opacity",c.mean,[.2,1]),p.ms=e("marker.size",c.mean,[2,16]),p.mlc=e("marker.line.color",r),p.mlw=e("marker.line.width",c.mean,[0,5]),g.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),h&&(g.line={width:e("line.width",r,[0,10])}),u&&(p.tx="Aa",p.tp=e("textposition",r),p.ts=10,p.tc=e("textfont.color",r),p.tf=e("textfont.family",r)),n=[c.minExtend(a,p)],i=c.minExtend(o,g)}var v=l.select(this).select("g.legendpoints"),m=v.selectAll("path.scatterpts").data(s?n:[]);m.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),m.exit().remove(),m.call(f.pointStyle,i),s&&(n[0].mrc=3);var y=v.selectAll("g.pointtext").data(u?n:[]);y.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),y.exit().remove(),y.selectAll("text").call(f.textPointStyle,i)}function a(t){var e=t[0].trace,r=e.marker||{},n=r.line||{},i=l.select(this).select("g.legendpoints").selectAll("path.legendbar").data(u.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=(t.mlw+1||n.width+1)-1,i=l.select(this);i.style("stroke-width",e+"px").call(h.fill,t.mc||r.color),e&&i.call(h.stroke,t.mlc||n.color)})}function o(t){var e=t[0].trace,r=l.select(this).select("g.legendpoints").selectAll("path.legendbox").data(u.traceIs(e,"box")&&e.visible?[t]:[]);r.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.each(function(t){var r=(t.lw+1||e.line.width+1)-1,n=l.select(this);n.style("stroke-width",r+"px").call(h.fill,t.fc||e.fillcolor),r&&n.call(h.stroke,t.lc||e.line.color)})}function s(t){var e=t[0].trace,r=l.select(this).select("g.legendpoints").selectAll("path.legendpie").data(u.traceIs(e,"pie")&&e.visible?[t]:[]);r.enter().append("path").classed("legendpie",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.size()&&r.call(p,t[0],e)}var l=t("d3"),c=t("../../lib"),u=t("../../plots/plots"),f=t("../drawing"),h=t("../color"),d=t("../../traces/scatter/subtypes"),p=t("../../traces/pie/style_one");e.exports=function(t){t.each(function(t){var e=l.select(this),r=e.selectAll("g.legendfill").data([t]);r.enter().append("g").classed("legendfill",!0);var n=e.selectAll("g.legendlines").data([t]);n.enter().append("g").classed("legendlines",!0);var i=e.selectAll("g.legendsymbols").data([t]);i.enter().append("g").classed("legendsymbols",!0),i.style("opacity",t[0].trace.opacity),i.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(a).each(o).each(s).each(n).each(i)}},{"../../lib":382,"../../plots/plots":454,"../../traces/pie/style_one":554,"../../traces/scatter/subtypes":575,"../color":303,"../drawing":326,d3:113}],348:[function(t,e,r){"use strict";function n(t,e){var r=e.currentTarget,n=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,a=t._fullLayout,o={};if("zoom"===n){for(var s,l,u="in"===i?.5:2,h=(1+u)/2,d=(1-u)/2,p=c.Axes.list(t,null,!0),v=0;vy;y++){var b=s[y];h=m[b]={};for(var x=0;x1)return n(["resetViews","toggleHover"]),o(v,r);u&&(n(["zoom3d","pan3d","orbitRotation","tableRotation"]),n(["resetCameraDefault3d","resetCameraLastSave3d"]),n(["hoverClosest3d"])),h&&(n(["zoomInGeo","zoomOutGeo","resetGeo"]),n(["hoverClosestGeo"]));var m=i(s),y=[];return((c||p)&&!m||g)&&(y=["zoom2d","pan2d"]),(c||g)&&a(l)&&(y.push("select2d"),y.push("lasso2d")),y.length&&n(y),!c&&!p||m||g||n(["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"]),c&&d?n(["toggleHover"]):p?n(["hoverClosestGl2d"]):c?n(["hoverClosestCartesian","hoverCompareCartesian"]):d&&n(["hoverClosestPie"]),o(v,r)}function i(t){for(var e=l.Axes.list({_fullLayout:t},null,!0),r=!0,n=0;n0);if(h){var d=i(e,r,s);l("x",d[0]),l("y",d[1]),a.noneOrAll(t,e,["x","y"]),l("xanchor"),l("yanchor"),a.coerceFont(l,"font",r.font),l("bgcolor"),l("bordercolor"),l("borderwidth")}}},{"../../lib":382,"./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;ne){var r=e;e=t,t=r}s.setAttributes(w,{"data-min":t,"data-max":e}),s.setAttributes(R,{x:t,width:e-t}),s.setAttributes(M,{width:t}),s.setAttributes(T,{x:e,width:p-e}),s.setAttributes(E,{transform:"translate("+(t-v-1)+")"}),s.setAttributes(C,{transform:"translate("+e+")"})}var f=t._fullLayout,h=f._infolayer.selectAll("g.range-slider"),d=f.xaxis.rangeslider,p=f._size.w,g=(f.height-f.margin.b-f.margin.t)*d.thickness,v=2,m=Math.floor(d.borderwidth/2),y=f.margin.l,b=f.height-g-f.margin.b,x=0,_=p,w=document.createElementNS(o,"g");s.setAttributes(w,{"class":"range-slider","data-min":x,"data-max":_,"pointer-events":"all",transform:"translate("+y+","+b+")"});var k=document.createElementNS(o,"rect"),A=d.borderwidth%2===0?d.borderwidth:d.borderwidth-1;s.setAttributes(k,{fill:d.bgcolor,stroke:d.bordercolor,"stroke-width":d.borderwidth,height:g+A,width:p+A,transform:"translate(-"+m+", -"+m+")","shape-rendering":"crispEdges"});var M=document.createElementNS(o,"rect");s.setAttributes(M,{x:0,width:x,height:g,fill:"rgba(0,0,0,0.4)"});var T=document.createElementNS(o,"rect");s.setAttributes(T,{x:_,width:p-_,height:g,fill:"rgba(0,0,0,0.4)"});var E=document.createElementNS(o,"g"),L=document.createElementNS(o,"rect"),S=document.createElementNS(o,"rect");s.setAttributes(E,{transform:"translate("+(x-v-1)+")"}),s.setAttributes(L,{width:10,height:g,x:-6,fill:"transparent",cursor:"col-resize"}),s.setAttributes(S,{width:v,height:g/2,y:g/4,rx:1,fill:"white",stroke:"#666","shape-rendering":"crispEdges"}),s.appendChildren(E,[S,L]);var C=document.createElementNS(o,"g"),z=document.createElementNS(o,"rect"),P=document.createElementNS(o,"rect");s.setAttributes(C,{transform:"translate("+_+")"}),s.setAttributes(z,{width:10,height:g,x:-2,fill:"transparent",cursor:"col-resize"}),s.setAttributes(P,{width:v,height:g/2,y:g/4,rx:1,fill:"white",stroke:"#666","shape-rendering":"crispEdges"}),s.appendChildren(C,[P,z]);var R=document.createElementNS(o,"rect");s.setAttributes(R,{x:x,width:_-x,height:g,cursor:"ew-resize",fill:"transparent"}),w.addEventListener("mousedown",function(t){function r(t){var r,n,f=+t.clientX-a;switch(i){case R:w.style.cursor="ew-resize",r=+s+f,n=+l+f,u(r,n),c(e(r),e(n));break;case L:w.style.cursor="col-resize",r=+s+f,n=+l,u(r,n),c(e(r),e(n));break;case z:w.style.cursor="col-resize",r=+s,n=+l+f,u(r,n),c(e(r),e(n));break;default:w.style.cursor="ew-resize",r=o,n=o+f,u(r,n),c(e(r),e(n))}}function n(){window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",n),w.style.cursor="auto"}var i=t.target,a=t.clientX,o=a-w.getBoundingClientRect().left,s=w.getAttribute("data-min"),l=w.getAttribute("data-max");window.addEventListener("mousemove",r),window.addEventListener("mouseup",n)}),d.range||(d.range=i.getAutoRange(f.xaxis));var O=l(t,p,g);s.appendChildren(w,[k,O,M,T,R,E,C]),r(f.xaxis.range[0],f.xaxis.range[1]),h.data([0]).enter().append(function(){return d.setRange=r,w})}},{"../../constants/xmlns_namespaces":370,"../../lib":382,"../../plotly":402,"../../plots/cartesian/axes":405,"./helpers":361,"./range_plot":363}],360:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r,a){function o(t,e){return n.coerce(s,l,i,t,e)}if(t[r].rangeslider){var s="object"==typeof t[r].rangeslider?t[r].rangeslider:{},l=e[r].rangeslider={};if(o("bgcolor"),o("bordercolor"),o("borderwidth"),o("thickness"),o("visible"),o("range"),l.range&&!e[r].autorange){var c=l.range,u=e[r].range;c[0]=Math.min(c[0],u[0]),c[1]=Math.max(c[1],u[1])}else e[r]._needsExpand=!0;l.visible&&a.forEach(function(t){var r=e[t]||{};r.fixedrange=!0,e[t]=r})}}},{"../../lib":382,"./attributes":358}],361:[function(t,e,r){"use strict";r.setAttributes=function(t,e){for(var r in e)t.setAttribute(r,e[r])},r.appendChildren=function(t,e){for(var r=0;rl;l++){var c=s[l],u={_fullLayout:e},f=x.coerceRef(t,n,u,c);if("path"!==o){var h=.25,d=.75;if("paper"!==f){var p=x.getFromId(u,f),g=a(p);h=g(p.range[0]+h*(p.range[1]-p.range[0])),d=g(p.range[0]+d*(p.range[1]-p.range[0]))}r(c+"0",h),r(c+"1",d)}}return"path"===o?r("path"):b.noneOrAll(t,n,["x0","x1","y0","y1"]),n}function i(t){return"category"===t.type?t.c2l:t.d2l}function a(t){return"category"===t.type?t.l2c:t.l2d}function o(t,e){t.layout.shapes=e,k.supplyLayoutDefaults(t.layout,t._fullLayout),k.drawAll(t)}function s(t){delete t.layout.shapes,t._fullLayout.shapes=[],k.drawAll(t)}function l(t,e,r){for(var n=0;ne;i--)h(t,i).selectAll('[data-index="'+(i-1)+'"]').attr("data-index",i),k.draw(t,i)}function f(t,e,r,o){function s(e){var r=e.append("path").attr(z).style("opacity",S.opacity).call(_.stroke,P).call(_.fill,S.fillcolor).call(w.dashLine,S.line.dash,S.line.width);C&&r.call(w.setClipUrl,"clip"+t._fullLayout._uid+C)}var l,c;h(t,e).selectAll('[data-index="'+e+'"]').remove();var u=t.layout.shapes[e];if(u){var f={xref:u.xref,yref:u.yref},p={};"string"==typeof r&&r?p[r]=o:b.isPlainObject(r)&&(p=r);var v=Object.keys(p);for(l=0;ll;l++){var k=y[l];if(void 0===p[k]&&void 0!==u[k]){var A,M=k.charAt(0),T=x.getFromId(t,x.coerceRef(f,{},t,M)),E=x.getFromId(t,x.coerceRef(u,{},t,M)),L=u[k];void 0!==p[M+"ref"]&&(T?(A=i(T)(L),L=(A-T.range[0])/(T.range[1]-T.range[0])):L=(L-E.domain[0])/(E.domain[1]-E.domain[0]),E?(A=E.range[0]+L*(E.range[1]-E.range[0]),L=a(E)(A)):L=T.domain[0]+L*(T.domain[1]-T.domain[0])),u[k]=L}}var S=n(u,t._fullLayout);t._fullLayout.shapes[e]=S;var C,z={"data-index":e,"fill-rule":"evenodd",d:g(t,S)},P=S.line.width?S.line.color:"rgba(0,0,0,0)";if("below"!==S.layer)C=(S.xref+S.yref).replace(/paper/g,""),s(t._fullLayout._shapeUpperLayer);else if("paper"===S.xref&&"paper"===S.yref)C="",s(t._fullLayout._shapeLowerLayer);else{var R,O=t._fullLayout._plots||{},I=Object.keys(O);for(l=0,c=I.length;c>l;l++)R=O[I[l]],C=I[l],d(t,S,R)&&s(R.shapelayer)}}}function h(t,e){var r=t._fullLayout.shapes[e],n=t._fullLayout._shapeUpperLayer;return r?"below"===r.layer&&(n="paper"===r.xref&&"paper"===r.yref?t._fullLayout._shapeLowerLayer:t._fullLayout._shapeSubplotLayer):b.log("getShapeLayer: undefined shape: index",e),n}function d(t,e,r){var n=y.Axes.getFromId(t,r.id,"x")._id,i=y.Axes.getFromId(t,r.id,"y")._id,a="below"===e.layer,o=n===e.xref||i===e.yref,s=!!r.shapelayer;return a&&o&&s}function p(t){return function(e){return t(e.replace("_"," "))}}function g(t,e){var r,n,a,o,s=e.type,l=x.getFromId(t,e.xref),c=x.getFromId(t,e.yref),u=t._fullLayout._size;if(l?(r=i(l),n=function(t){return l._offset+l.l2p(r(t,!0))}):n=function(t){return u.l+u.w*t},c?(a=i(c),o=function(t){return c._offset+c.l2p(a(t,!0))}):o=function(t){return u.t+u.h*(1-t)},"path"===s)return l&&"date"===l.type&&(n=p(n)),c&&"date"===c.type&&(o=p(o)),k.convertPath(e.path,n,o);var f=n(e.x0),h=n(e.x1),d=o(e.y0),g=o(e.y1);if("line"===s)return"M"+f+","+d+"L"+h+","+g;if("rect"===s)return"M"+f+","+d+"H"+h+"V"+g+"H"+f+"Z";var v=(f+h)/2,m=(d+g)/2,y=Math.abs(v-f),b=Math.abs(m-d),_="A"+y+","+b,w=v+y+","+m,A=v+","+(m-b);return"M"+w+_+" 0 1,1 "+A+_+" 0 0,1 "+w+"Z"}function v(t,e,r,n,i){var a="category"===t.type?Number:t.d2c;if(void 0!==e)return[a(e),a(r)];if(n){var o,s,l,c,u,f=1/0,h=-(1/0),d=n.match(A);for("date"===t.type&&(a=p(a)),o=0;ou&&(f=u),u>h&&(h=u)));return h>=f?[f,h]:void 0}}var m=t("fast-isnumeric"),y=t("../../plotly"),b=t("../../lib"),x=t("../../plots/cartesian/axes"),_=t("../color"),w=t("../drawing"),k=e.exports={};k.layoutAttributes=t("./attributes"),k.supplyLayoutDefaults=function(t,e){for(var r=t.shapes||[],i=e.shapes=[],a=0;as&&(t="X"),t});return n>s&&(l=l.replace(/[\s,]*X.*/,""),b.log("Ignoring extra params in segment "+t)),i+l})},k.calcAutorange=function(t){var e,r,n,i,a,o=t._fullLayout,s=o.shapes;if(s.length&&t._fullData.length)for(e=0;eh?r=h:(u.left-=b.offsetLeft,u.right-=b.offsetLeft,u.top-=b.offsetTop,u.bottom-=b.offsetTop,b.selection.each(function(){var t=l.bBox(this);s.bBoxIntersect(u,t,c)&&(r=Math.max(r,o*(t[b.side]-u[a])+c))}),r=Math.min(h,r)),r>0||0>h){var d={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[b.side];e.attr("transform","translate("+d+")")}}}function p(){E=0,L=!0,S=z,k._infolayer.select("."+e).attr({"data-unformatted":S}).text(S).on("mouseover.opacity",function(){n.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(1e3).style("opacity",0)})}var g=r.propContainer,v=r.propName,m=r.traceIndex,y=r.dfltName,b=r.avoid||{},x=r.attributes,_=r.transform,w=r.containerGroup,k=t._fullLayout,A=g.titlefont.family,M=g.titlefont.size,T=g.titlefont.color,E=1,L=!1,S=g.title.trim();""===S&&(E=0),S.match(/Click to enter .+ title/)&&(E=.2,L=!0),w||(w=k._infolayer.selectAll(".g-"+e).data([0]),w.enter().append("g").classed("g-"+e,!0));var C=w.selectAll("text").data([0]);C.enter().append("text"),C.text(S).attr("class",e),C.attr({"data-unformatted":S}).call(f);var z="Click to enter "+y+" title";t._context.editable?(S||p(),C.call(u.makeEditable).on("edit",function(e){void 0!==m?a.restyle(t,v,e,m):a.relayout(t,v,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(f)}).on("input",function(t){this.text(t||" ").attr(x).selectAll("tspan.line").attr(x)})):S&&!S.match(/Click to enter .+ title/)||C.remove(),C.classed("js-placeholder",L)}},{"../../lib":382,"../../lib/svg_text_utils":395,"../../plotly":402,"../../plots/plots":454,"../color":303,"../drawing":326,d3:113,"fast-isnumeric":117}],367:[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]}},{}],368:[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]}},{}],369:[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"}},{}],370:[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}},{}],371:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.13.0",r.plot=n.plot,r.newPlot=n.newPlot,r.restyle=n.restyle,r.relayout=n.relayout,r.redraw=n.redraw,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=n.register,r.toImage=t("./plot_api/to_image"),r.downloadImage=t("./snapshot/download"),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=n.Fx,r.Snapshot=n.Snapshot,r.PlotSchema=n.PlotSchema,r.Queue=n.Queue,r.d3=t("d3")},{"../build/ploticon":2,"./plot_api/set_plot_config":400,"./plot_api/to_image":401,"./plotly":402,"./snapshot/download":469,d3:113}],372:[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},{}],373:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){Array.isArray(t)&&(e[r]=t[n])}},{}],374:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("./nested_property"),o=t("../components/colorscale/get_scale"),s=(Object.keys(t("../components/colorscale/scales")),/^([2-9]|[1-9][0-9]+)$/);r.valObjects={data_array:{coerceFunction:function(t,e,r){Array.isArray(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),-1===n.values.indexOf(t)?e.set(r):e.set(t)}},"boolean":{coerceFunction:function(t,e,r){t===!0||t===!1?e.set(t):e.set(r)}},number:{coerceFunction:function(t,e,r,i){!n(t)||void 0!==i.min&&ti.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(n.strict===!0&&"string"!=typeof t)return void e.set(r);var i=String(t);void 0===t||n.noBlank===!0&&!i?e.set(r):e.set(i)}},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){var n=r.length;return"string"==typeof t&&t.substr(0,n)===r&&s.test(t.substr(n))?void e.set(t):void e.set(r)}},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;a2)return!1;var l=o[0].split("-");if(l.length>3||3!==l.length&&o[1])return!1;if(4===l[0].length)r=Number(l[0]);else{if(2!==l[0].length)return!1;var c=(new Date).getFullYear();r=((Number(l[0])-c+70)%100+200)%100+c-70}return s(r)?1===l.length?new Date(r,0,1).getTime():(n=Number(l[1])-1,l[1].length>2||!(n>=0&&11>=n)?!1:2===l.length?new Date(r,n,1).getTime():(i=Number(l[2]),l[2].length>2||!(i>=1&&31>=i)?!1:(i=new Date(r,n,i).getTime(),o[1]?(l=o[1].split(":"),l.length>3?!1:(a=Number(l[0]),l[0].length>2||!(a>=0&&23>=a)?!1:(i+=36e5*a,1===l.length?i:(n=Number(l[1]),l[1].length>2||!(n>=0&&59>=n)?!1:(i+=6e4*n,2===l.length?i:(t=Number(l[2]),t>=0&&60>t?i+1e3*t:!1)))))):i))):!1},r.isDateTime=function(t){return r.dateTime2ms(t)!==!1},r.ms2DateTime=function(t,e){if("undefined"==typeof o)return void l.error("d3 is not defined.");e||(e=0);var r=new Date(t),i=o.time.format("%Y-%m-%d")(r);return 7776e6>e?(i+=" "+n(r.getHours(),2),432e6>e&&(i+=":"+n(r.getMinutes(),2),108e5>e&&(i+=":"+n(r.getSeconds(),2),3e5>e&&(i+="."+n(r.getMilliseconds(),3)))),i.replace(/([:\s]00)*\.?[0]*$/,"")):i};var c={H:["%H:%M:%S~%L","%H:%M:%S","%H:%M"],I:["%I:%M:%S~%L%p","%I:%M:%S%p","%I:%M%p"],D:["%H","%I%p","%Hh"]},u={Y:["%Y~%m~%d","%Y%m%d","%y%m%d","%m~%d~%Y","%d~%m~%Y"],Yb:["%b~%d~%Y","%d~%b~%Y","%Y~%d~%b","%Y~%b~%d"],y:["%m~%d~%y","%d~%m~%y","%y~%m~%d"],yb:["%b~%d~%y","%d~%b~%y","%y~%d~%b","%y~%b~%d"]},f=o.time.format.utc,h={Y:{H:["%Y~%m~%dT%H:%M:%S","%Y~%m~%dT%H:%M:%S~%L"].map(f),I:[],D:["%Y%m%d%H%M%S","%Y~%m","%m~%Y"].map(f)},Yb:{H:[],I:[],D:["%Y~%b","%b~%Y"].map(f)},y:{H:[],I:[],D:[]},yb:{H:[],I:[],D:[]}};["Y","Yb","y","yb"].forEach(function(t){u[t].forEach(function(e){h[t].D.push(f(e)),["H","I","D"].forEach(function(r){c[r].forEach(function(n){var i=h[t][r];i.push(f(e+"~"+n)),i.push(f(n+"~"+e))})})})});var d=/[a-z]*/g,p=function(t){return t.substr(0,3)},g=/(mon|tue|wed|thu|fri|sat|sun|the|of|st|nd|rd|th)/g,v=/[\s,\/\-\.\(\)]+/g,m=/~?([ap])~?m(~|$)/,y=function(t,e){return e+"m "},b=/\d\d\d\d/,x=/(^|~)[a-z]{3}/,_=/[ap]m/,w=/:/,k=/q([1-4])/,A=["31~mar","30~jun","30~sep","31~dec"],M=function(t,e){return A[e-1]},T=/ ?([+\-]\d\d:?\d\d|Z)$/;r.parseDate=function(t){if(t.getTime)return t;if("string"!=typeof t)return!1;t=t.toLowerCase().replace(d,p).replace(g,"").replace(v,"~").replace(m,y).replace(k,M).trim().replace(T,"");var e,r,n=null,o=i(t),s=a(t);e=h[o][s],r=e.length;for(var l=0;r>l&&!(n=e[l].parse(t));l++);if(!(n instanceof Date))return!1;var c=n.getTimezoneOffset();return n.setTime(n.getTime()+60*c*1e3),n}},{"../lib":382,d3:113,"fast-isnumeric":117}],376:[function(t,e,r){"use strict";var n=t("events").EventEmitter,i={init:function(t){if(t._ev instanceof n)return t;var e=new n;return t._ev=e,t.on=e.on.bind(e),t.once=e.once.bind(e),t.removeListener=e.removeListener.bind(e),t.removeAllListeners=e.removeAllListeners.bind(e),t.emit=function(r,n){"undefined"!=typeof jQuery&&jQuery(t).trigger(r,n),e.emit(r,n)},t},triggerHandler:function(t,e,r){var n,i;"undefined"!=typeof jQuery&&(n=jQuery(t).triggerHandler(e,r));var a=t._ev;if(!a)return n;var o=a._events[e];if(!o)return n;"function"==typeof o&&(o=[o]);for(var s=o.pop(),l=0;lp;p++){o=t[p];for(s in o)l=h[s],c=o[s],e&&c&&(i(c)||(u=a(c)))?(u?(u=!1,f=l&&a(l)?l:[]):f=l&&i(l)?l:{},h[s]=n([f,c],e,r)):("undefined"!=typeof c||r)&&(h[s]=c)}return h}var i=t("./is_plain_object.js"),a=Array.isArray;r.extendFlat=function(){return n(arguments,!1,!1)},r.extendDeep=function(){return n(arguments,!0,!1)},r.extendDeepAll=function(){return n(arguments,!0,!0)}},{"./is_plain_object.js":383}],378:[function(t,e,r){"use strict";e.exports=function(t){for(var e=[],r=0;ry;y++)f=s(p,y),d=l(e,y),m[y]=n(f,d);else m=n(p,e);return m}var s=t("tinycolor2"),l=t("fast-isnumeric"),c=t("../components/colorscale/make_scale_function"),u=t("../components/color/attributes").defaultLine,f=t("./str2rgbarray"),h=1;e.exports=o},{"../components/color/attributes":302,"../components/colorscale/make_scale_function":320,"./str2rgbarray":394,"fast-isnumeric":117,tinycolor2:274}],381:[function(t,e,r){"use strict";function n(t){for(var e=0;(e=t.indexOf("",e))>=0;){var r=t.indexOf("",e);if(e>r)break;t=t.slice(0,e)+l(t.slice(e+5,r))+t.slice(r+6); -}return t}function i(t){return t.replace(/\/g,"\n")}function a(t){return t.replace(/\<.*\>/g,"")}function o(t){for(var e=0;(e=t.indexOf("&",e))>=0;){var r=t.indexOf(";",e);if(e>r)e+=1;else{var n=c[t.slice(e+1,r)];t=n?t.slice(0,e)+n+t.slice(r+1):t.slice(0,e)+t.slice(r+1)}}return t}function s(t){return""+o(a(n(i(t))))}var l=t("superscript-text"),c={mu:"\u03bc",amp:"&",lt:"<",gt:">"};e.exports=s},{"superscript-text":263}],382:[function(t,e,r){"use strict";var n=t("d3"),i=e.exports={};i.nestedProperty=t("./nested_property"),i.isPlainObject=t("./is_plain_object");var a=t("./coerce");i.valObjects=a.valObjects,i.coerce=a.coerce,i.coerce2=a.coerce2,i.coerceFont=a.coerceFont;var o=t("./dates");i.dateTime2ms=o.dateTime2ms,i.isDateTime=o.isDateTime,i.ms2DateTime=o.ms2DateTime,i.parseDate=o.parseDate;var s=t("./search");i.findBin=s.findBin,i.sorterAsc=s.sorterAsc,i.sorterDes=s.sorterDes,i.distinctVals=s.distinctVals,i.roundUp=s.roundUp;var l=t("./stats");i.aggNums=l.aggNums,i.len=l.len,i.mean=l.mean,i.variance=l.variance,i.stdev=l.stdev,i.interp=l.interp;var c=t("./matrix");i.init2dArray=c.init2dArray,i.transposeRagged=c.transposeRagged,i.dot=c.dot,i.translationMatrix=c.translationMatrix,i.rotationMatrix=c.rotationMatrix,i.rotationXYMatrix=c.rotationXYMatrix,i.apply2DTransform=c.apply2DTransform,i.apply2DTransform2=c.apply2DTransform2;var u=t("./extend");i.extendFlat=u.extendFlat,i.extendDeep=u.extendDeep,i.extendDeepAll=u.extendDeepAll;var f=t("./loggers");i.log=f.log,i.warn=f.warn,i.error=f.error,i.notifier=t("./notifier"),i.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))},i.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},i.identity=function(t){return t},i.randstr=function h(t,e,r){if(r||(r=16),void 0===e&&(e=24),0>=e)return"0";var n,i,a,o=Math.log(Math.pow(2,e))/Math.log(r),s="";for(n=2;o===1/0;n*=2)o=Math.log(Math.pow(2,e/n))/Math.log(r)*n;var l=o-Math.floor(o);for(n=0;n-1||c!==1/0&&c>=Math.pow(2,e)?h(t,e,r):s},i.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},i.smooth=function(t,e){if(e=Math.round(e)||0,2>e)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,c=new Array(l),u=new Array(o);for(r=0;l>r;r++)c[r]=(1-Math.cos(Math.PI*(r+1)/e))/(2*e);for(r=0;o>r;r++){for(a=0,n=0;l>n;n++)i=r+n+1-e,-o>i?i-=s*Math.round(i/s):i>=s&&(i-=s*Math.floor(i/s)),0>i?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*c[n];u[r]=a}return u},i.syncOrAsync=function(t,e,r){function n(){return i.syncOrAsync(t,e,r)}for(var a,o;t.length;)if(o=t.splice(0,1)[0],a=o(e),a&&a.then)return a.then(n).then(void 0,i.promiseError);return r&&r(e)},i.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},i.noneOrAll=function(t,e,r){if(t){var n,i,a=!1,o=!0;for(n=0;ni;i++)e[i][r]=t[i]},i.minExtend=function(t,e){var r={};"object"!=typeof e&&(e={});var n,a,o,s=3,l=Object.keys(t);for(n=0;n1?n+a[1]:"";if(i&&(a.length>1||o.length>4))for(;r.test(o);)o=o.replace(r,"$1"+i+"$2");return o+s}},{"./coerce":374,"./dates":375,"./extend":377,"./is_plain_object":383,"./loggers":384,"./matrix":385,"./nested_property":386,"./notifier":387,"./search":390,"./stats":393,d3:113}],383:[function(t,e,r){"use strict";e.exports=function(t){return"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t)===Object.prototype}},{}],384:[function(t,e,r){"use strict";var n=t("../plot_api/plot_config"),i=e.exports={};i.log=function(){if(n.logging>1){for(var t=["LOG:"],e=0;e0){for(var t=["WARN:"],e=0;e0){for(var t=["ERROR:"],e=0;en;n++)r[n]=new Array(e);return r},r.transposeRagged=function(t){var e,r,n=0,i=t.length;for(e=0;i>e;e++)n=Math.max(n,t[e].length);var a=new Array(n);for(e=0;n>e;e++)for(a[e]=new Array(i),r=0;i>r;r++)a[e][r]=t[r][e];return a},r.dot=function(t,e){if(!t.length||!e.length||t.length!==e.length)return null;var n,i,a=t.length;if(t[0].length)for(n=new Array(a),i=0;a>i;i++)n[i]=r.dot(t[i],e);else if(e[0].length){var o=r.transposeRagged(e);for(n=new Array(o.length),i=0;ii;i++)n+=t[i]*e[i];return n},r.translationMatrix=function(t,e){return[[1,0,t],[0,1,e],[0,0,1]]},r.rotationMatrix=function(t){var e=t*Math.PI/180;return[[Math.cos(e),-Math.sin(e),0],[Math.sin(e),Math.cos(e),0],[0,0,1]]},r.rotationXYMatrix=function(t,e,n){return r.dot(r.dot(r.translationMatrix(e,n),r.rotationMatrix(t)),r.translationMatrix(-e,-n))},r.apply2DTransform=function(t){return function(){var e=arguments;3===e.length&&(e=e[0]);var n=1===arguments.length?e[0]:[e[0],e[1]];return r.dot(t,[n[0],n[1],1]).slice(0,2)}},r.apply2DTransform2=function(t){var e=r.apply2DTransform(t);return function(t){return e(t.slice(0,2)).concat(e(t.slice(2,4)))}}},{}],386:[function(t,e,r){"use strict";function n(t,e){return function(){var r,i,a,o,s,l=t;for(o=0;o=0;e--){if(n=t[e],o=!1,Array.isArray(n))for(r=n.length-1;r>=0;r--)c(n[r])?o?n[r]=void 0:n.pop():o=!0;else if("object"==typeof n&&null!==n)for(a=Object.keys(n),o=!1,r=a.length-1;r>=0;r--)c(n[a[r]])&&!i(n[a[r]],a[r])?delete n[a[r]]:o=!0;if(o)return}}function c(t){return void 0===t||null===t?!0:"object"!=typeof t?!1:Array.isArray(t)?!t.length:!Object.keys(t).length}function u(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}var f=t("fast-isnumeric");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(".");sr||r>a||o>n||n>s?!1:!e||!c(t)}function r(t,e){var r=t[0],l=t[1];if(i>r||r>a||o>l||l>s)return!1;var c,u,f,h,d,p=n.length,g=n[0][0],v=n[0][1],m=0;for(c=1;p>c;c++)if(u=g,f=v,g=n[c][0],v=n[c][1],h=Math.min(u,g),!(h>r||r>Math.max(u,g)||l>Math.max(f,v)))if(l=l&&r!==h&&m++}return m%2===1}var n=t.slice(),i=n[0][0],a=i,o=n[0][1],s=o;n.push(n[0]);for(var l=1;la;a++)if(o=[t[a][0]-l[0],t[a][1]-l[1]],s=n(o,c),0>s||s>u||Math.abs(n(o,h))>i)return!0;return!1};i.filter=function(t,e){function r(r){t.push(r);var s=n.length,l=i;n.splice(o+1);for(var c=l+1;c1){var s=t.pop();r(s)}return{addPt:r,raw:t,filtered:n}}},{"./matrix":385}],389:[function(t,e,r){"use strict";function n(t,e){for(var r,n=[],a=0;a=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;rt}function i(t,e){return e>=t}function a(t,e){return t>e}function o(t,e){return t>=e}var s=t("fast-isnumeric"),l=t("../lib");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 c,u,f=0,h=e.length,d=0;for(u=e[e.length-1]>=e[0]?r?n:i:r?o:a;h>f&&d++<100;)c=Math.floor((f+h)/2),u(e[c],t)?f=c+1:h=c;return d>90&&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;n>s;s++)e[s+1]>e[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,c=r?Math.ceil:Math.floor;a>i&&o++<100;)n=c((i+a)/2),e[n]<=t?i=n+s:a=n-l;return e[i]}},{"../lib":382,"fast-isnumeric":117}],391:[function(t,e,r){"use strict";e.exports=function(t,e){(t.attr("class")||"").split(" ").forEach(function(e){0===e.indexOf("cursor-")&&t.classed(e,!1)}),e&&t.classed("cursor-"+e,!0)}},{}],392:[function(t,e,r){"use strict";var n=t("../components/color"),i=function(){};e.exports=function(t){for(var e in t)"function"==typeof t[e]&&(t[e]=i);t.destroy=function(){t.container.parentNode.removeChild(t.container)};var r=document.createElement("div");return r.textContent="Webgl is not supported by your browser - visit http://get.webgl.org for more info",r.style.cursor="pointer",r.style.fontSize="24px",r.style.color=n.defaults[0],t.container.appendChild(r),t.container.style.background="#FFFFFF",t.container.onclick=function(){window.open("http://get.webgl.org")},!1}},{"../components/color":303}],393:[function(t,e,r){"use strict";var n=t("fast-isnumeric");r.aggNums=function(t,e,i,a){var o,s;if(a||(a=i.length),n(e)||(e=!1),Array.isArray(i[0])){for(s=new Array(a),o=0;a>o;o++)s[o]=r.aggNums(t,e,i[o]);i=s}for(o=0;a>o;o++)n(e)?n(i[o])&&(e=t(+e,+i[o])):e=i[o];return e},r.len=function(t){return r.aggNums(function(t){return t+1},0,t)},r.mean=function(t,e){return e||(e=r.len(t)),r.aggNums(function(t,e){return t+e},0,t)/e},r.variance=function(t,e,i){return e||(e=r.len(t)),n(i)||(i=r.mean(t,e)),r.aggNums(function(t,e){return t+Math.pow(e-i,2)},0,t)/e},r.stdev=function(t,e,n){return Math.sqrt(r.variance(t,e,n))},r.interp=function(t,e){if(!n(e))throw"n should be a finite number";if(e=e*t.length-.5,0>e)return t[0];if(e>t.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"fast-isnumeric":117}],394:[function(t,e,r){"use strict";function n(t){return t=i(t),a.str2RgbaArray(t.toRgbString())}var i=t("tinycolor2"),a=t("arraytools");e.exports=n},{arraytools:49,tinycolor2:274}],395:[function(t,e,r){"use strict";function n(t,e){return t.node().getBoundingClientRect()[e]}function i(t){return t.replace(/(<|<|<)/g,"\\lt ").replace(/(>|>|>)/g,"\\gt ")}function a(t,e,r){var n="math-output-"+l.Lib.randstr([],64),a=c.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=c.select("body").select("#MathJax_SVG_glyphs");if(a.select(".MathJax_SVG").empty()||!a.select("svg").node())u.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){for(var e=l.util.html_entity_decode(t),r=e.split(/(<[^<>]*>)/).map(function(t){var e=t.match(/<(\/?)([^ >]*)\s*(.*)>/i),r=e&&e[2].toLowerCase(),n=d[r];if(void 0!==n){var i=e[1],a=e[3],o=a.match(/^style\s*=\s*"([^"]+)"\s*/i);if("a"===r){if(i)return"";if("href"!==a.substr(0,4).toLowerCase())return"";var s=document.createElement("a");return s.href=a.substr(4).replace(/["'=]/g,""),-1===p.indexOf(s.protocol)?"":'"}if("br"===r)return"
";if(i)return"sup"===r?'':"sub"===r?'':"";var c=""}return l.util.xml_entity_encode(t).replace(/");i>0;i=r.indexOf("
",i+1))n.push(i);var a=0;n.forEach(function(t){for(var e=t+a,n=r.slice(0,e),i="",o=n.length-1;o>=0;o--){var s=n[o].match(/<(\/?).*>/i);if(s&&"
"!==n[o]){s[1]||(i=n[o]);break}}i&&(r.splice(e+1,0,i),r.splice(e,0,""),a+=2)});var o=r.join(""),s=o.split(/
/gi);return s.length>1&&(r=s.map(function(t,e){return''+t+""})),r.join("")}function s(t,e,r){var n,i,a,o=r.horizontalAlign,s=r.verticalAlign||"top",l=t.node().getBoundingClientRect(),c=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()-c.top+"px",left:a()-c.left+"px","z-index":1e3}),this}}var l=t("../plotly"),c=t("d3"),u=t("../lib"),f=t("../constants/xmlns_namespaces"),h=e.exports={};c.selection.prototype.appendSVG=function(t){for(var e=['',t,""].join(""),r=(new DOMParser).parseFromString(e,"application/xml"),n=r.documentElement.firstChild;n;)this.node().appendChild(this.node().ownerDocument.importNode(n,!0)),n=n.nextSibling;return r.querySelector("parsererror")?(u.log(r.querySelector("parsererror div").textContent),null):c.select(this.node().lastChild)},h.html_entity_decode=function(t){var e=c.select("body").append("div").style({display:"none"}).html(""),r=t.replace(/(&[^;]*;)/gi,function(t){return"<"===t?"<":"&rt;"===t?">":e.html(t).text()});return e.remove(),r},h.xml_entity_encode=function(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")},h.convertToTspans=function(t,e){function r(){d.empty()||(p=u.attr("class")+"-math",d.select("svg."+p).remove()),t.text("").style({visibility:"visible","white-space":"pre"}),h=t.appendSVG(s),h||t.text(i),t.select("a").size()&&t.style("pointer-events","all"),e&&e.call(u)}var i=t.text(),s=o(i),u=t,f=!u.attr("data-notex")&&s.match(/([^$]*)([$]+[^$]*[$]+)([^$]*)/),h=i,d=c.select(u.node().parentNode);if(!d.empty()){var p=u.attr("class")?u.attr("class").split(" ")[0]:"text";p+="-math",d.selectAll("svg."+p).remove(),d.selectAll("g."+p+"-group").remove(),t.style({visibility:null});for(var g=t.node();g&&g.removeAttribute;g=g.parentNode)g.removeAttribute("data-bb");if(f){var v=l.Lib.getPlotDiv(u.node());(v&&v._promises||[]).push(new Promise(function(t){u.style({visibility:"hidden"});var i={fontSize:parseInt(u.style("font-size"),10)};a(f[2],i,function(i,a,o){d.selectAll("svg."+p).remove(),d.selectAll("g."+p+"-group").remove();var s=i&&i.select("svg");if(!s||!s.node())return r(),void t();var l=d.append("g").classed(p+"-group",!0).attr({"pointer-events":"none"});l.node().appendChild(s.node()),a&&a.node()&&s.node().insertBefore(a.node().cloneNode(!0),s.node().firstChild),s.attr({"class":p,height:o.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=u.style("fill")||"black";s.select("g").attr({fill:c,stroke:c});var f=n(s,"width"),h=n(s,"height"),g=+u.attr("x")-f*{start:0,middle:.5,end:1}[u.attr("text-anchor")||"start"],v=parseInt(u.style("font-size"),10)||n(u,"height"),m=-v/4;"y"===p[0]?(l.attr({transform:"rotate("+[-90,+u.attr("x"),+u.attr("y")]+") translate("+[-f/2,m-h/2]+")"}),s.attr({x:+u.attr("x"),y:+u.attr("y")})):"l"===p[0]?s.attr({x:u.attr("x"),y:m-h/2}):"a"===p[0]?s.attr({x:0,y:m}):s.attr({x:g,y:+u.attr("y")+m-h/2}),e&&e.call(u,l),t(l)})}))}else r();return t}};var d={sup:'font-size:70%" dy="-0.6em',sub:'font-size:70%" dy="0.3em',b:"font-weight:bold",i:"font-style:italic",a:"",span:"",br:"",em:"font-style:italic;font-weight:bold"},p=["http:","https:","mailto:"],g=new RegExp("]*)?/?>","g");h.plainText=function(t){return(t||"").replace(g," ")},h.makeEditable=function(t,e,r){function n(){a(),o.style({opacity:0});var t,e=h.attr("class");t=e?"."+e.split(" ")[0]+"-math-group":"[class*=-math-group]",t&&c.select(o.node().parentNode).select(t).style({opacity:0})}function i(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 t=c.select(l.Lib.getPlotDiv(o.node())),e=t.select(".svg-container"),n=e.append("div");n.classed("plugin-editable editable",!0).style({position:"absolute","font-family":o.style("font-family")||"Arial","font-size":o.style("font-size")||12,color:r.fill||o.style("fill")||"black",opacity:1,"background-color":r.background||"transparent",outline:"#ffffff33 1px solid",margin:[-parseFloat(o.style("font-size"))/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(r.text||o.attr("data-unformatted")).call(s(o,e,r)).on("blur",function(){o.text(this.textContent).style({opacity:1});var t,e=c.select(this).attr("class");t=e?"."+e.split(" ")[0]+"-math-group":"[class*=-math-group]",t&&c.select(o.node().parentNode).select(t).style({opacity:0});var r=this.textContent;c.select(this).transition().duration(0).remove(),c.select(document).on("mouseup",null),u.edit.call(o,r)}).on("focus",function(){var t=this;c.select(document).on("mouseup",function(){return c.event.target===t?!1:void(document.activeElement===n.node()&&n.node().blur())})}).on("keyup",function(){27===c.event.which?(o.style({opacity:1}),c.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),u.cancel.call(o,this.textContent)):(u.input.call(o,this.textContent),c.select(this).call(s(o,e,r)))}).on("keydown",function(){13===c.event.which&&this.blur()}).call(i)}r||(r={});var o=this,u=c.dispatch("edit","input","cancel"),f=c.select(this.node()).style({"pointer-events":"all"}),h=e||f;return e&&f.style({"pointer-events":"none"}),r.immediate?n():h.on("click",n),c.rebind(this,u,"on")}},{"../constants/xmlns_namespaces":370,"../lib":382,"../plotly":402,d3:113}],396:[function(t,e,r){"use strict";var n=e.exports={},i=t("../plots/geo/constants").locationmodeToLayer,a=t("topojson").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":424,topojson:275}],397:[function(t,e,r){"use strict";function n(t){var e;if("string"==typeof t){if(e=document.getElementById(t),null===e)throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t}function i(t,e){t._fullLayout._paperdiv.style("background","white"),P.defaultConfig.setBackground(t,e)}function a(t,e){t._context||(t._context=R.extendFlat({},P.defaultConfig));var r=t._context;e&&(Object.keys(e).forEach(function(t){t in r&&("setBackground"===t&&"opaque"===e[t]?r[t]=i:r[t]=e[t])}),e.plot3dPixelRatio&&!r.plotGlPixelRatio&&(r.plotGlPixelRatio=r.plot3dPixelRatio)),r.staticPlot&&(r.editable=!1,r.autosizable=!1,r.scrollZoom=!1,r.doubleClick=!1,r.showTips=!1,r.showLink=!1,r.displayModeBar=!1)}function o(t,e,r){var n=S.select(t).selectAll(".plot-container").data([0]);n.enter().insert("div",":first-child").classed("plot-container plotly",!0);var i=n.selectAll(".svg-container").data([0]);i.enter().append("div").classed("svg-container",!0).style("position","relative"),i.html(""),e&&(t.data=e),r&&(t.layout=r),P.micropolar.manager.fillLayout(t),"initial"===t._fullLayout.autosize&&t._context.autosizable&&(w(t,{}),t._fullLayout.autosize=r.autosize=!0),i.style({width:t._fullLayout.width+"px",height:t._fullLayout.height+"px"}),t.framework=P.micropolar.manager.framework(t),t.framework({data:t.data,layout:t.layout},i.node()),t.framework.setUndoPoint();var a=t.framework.svg(),o=1,s=t._fullLayout.title;""!==s&&s||(o=0);var l="Click to enter title",c=function(){this.call(P.util.convertToTspans)},u=a.select(".title-group text").call(c);if(t._context.editable){u.attr({"data-unformatted":s}),s&&s!==l||(o=.2,u.attr({"data-unformatted":l}).text(l).style({opacity:o}).on("mouseover.opacity",function(){S.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){S.select(this).transition().duration(1e3).style("opacity",0)}));var f=function(){this.call(P.util.makeEditable).on("edit",function(e){t.framework({layout:{title:e}}),this.attr({"data-unformatted":e}).text(e).call(c),this.call(f)}).on("cancel",function(){var t=this.attr("data-unformatted");this.text(t).call(c)})};u.call(f)}return t._context.setBackground(t,t._fullLayout.paper_bgcolor),N.addLinks(t),Promise.resolve()}function s(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 n=P.Axes.list({_fullLayout:t});for(e=0;ee;e++){var o=t.annotations[e];o.ref&&("paper"===o.ref?(o.xref="paper",o.yref="paper"):"data"===o.ref&&(o.xref="x",o.yref="y"),delete o.ref),l(o,"xref"),l(o,"yref")}void 0===t.shapes||Array.isArray(t.shapes)||(R.warn("Shapes must be an array."),delete t.shapes);var s=(t.shapes||[]).length;for(e=0;s>e;e++){var c=t.shapes[e];l(c,"xref"),l(c,"yref")}var u=t.legend;u&&(u.x>3?(u.x=1.02,u.xanchor="left"):u.x<-2&&(u.x=-.02,u.xanchor="right"),u.y>3?(u.y=1.02,u.yanchor="bottom"):u.y<-2&&(u.y=-.02,u.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var h=N.getSubplotIds(t,"gl3d");for(e=0;er;++r)b[r]=v[e]+m*y[2+4*r];d.camera={eye:{x:b[0],y:b[1],z:b[2]},center:{x:v[0],y:v[1],z:v[2]},up:{x:y[1],y:y[5],z:y[9]}},delete d.cameraposition}}return F.clean(t),t}function l(t,e){var r=t[e],n=e.charAt(0);r&&"paper"!==r&&(t[e]=P.Axes.cleanId(r,n))}function c(t,e){for(var r=[],n=(t.concat(Array.isArray(e)?e:[]).filter(function(t){return"uid"in t}).map(function(t){return t.uid})),i=0;ia&&(s=R.randstr(n),-1!==r.indexOf(s));a++);o.uid=R.randstr(n),n.push(o.uid)}if(r.push(o.uid),"histogramy"===o.type&&"xbins"in o&&!("ybins"in o)&&(o.ybins=o.xbins,delete o.xbins),o.error_y&&"opacity"in o.error_y){var l=F.defaults,c=o.error_y.color||(N.traceIs(o,"bar")?F.defaultLine:l[i%l.length]);o.error_y.color=F.addOpacity(F.rgb(c),F.opacity(c)*o.error_y.opacity),delete o.error_y.opacity}if("bardir"in o&&("h"!==o.bardir||!N.traceIs(o,"bar")&&"histogram"!==o.type.substr(0,9)||(o.orientation="h",x(o)),delete o.bardir),"histogramy"===o.type&&x(o),"histogramx"!==o.type&&"histogramy"!==o.type||(o.type="histogram"),"scl"in o&&(o.colorscale=o.scl,delete o.scl),"reversescl"in o&&(o.reversescale=o.reversescl,delete o.reversescl),o.xaxis&&(o.xaxis=P.Axes.cleanId(o.xaxis,"x")),o.yaxis&&(o.yaxis=P.Axes.cleanId(o.yaxis,"y")),N.traceIs(o,"gl3d")&&o.scene&&(o.scene=N.subplotsRegistry.gl3d.cleanId(o.scene)),N.traceIs(o,"pie")||(Array.isArray(o.textposition)?o.textposition=o.textposition.map(u):o.textposition&&(o.textposition=u(o.textposition))),N.traceIs(o,"2dMap")&&("YIGnBu"===o.colorscale&&(o.colorscale="YlGnBu"),"YIOrRd"===o.colorscale&&(o.colorscale="YlOrRd")),N.traceIs(o,"markerColorscale")&&o.marker){var h=o.marker;"YIGnBu"===h.colorscale&&(h.colorscale="YlGnBu"),"YIOrRd"===h.colorscale&&(h.colorscale="YlOrRd")}if("surface"===o.type&&R.isPlainObject(o.contours)){var d=["x","y","z"];for(a=0;an?a.push(i+n):a.push(n);return a}function p(t,e,r){var n,i;for(n=0;n=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||0>i&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function g(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),p(t,e,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&p(t,r,"newIndices"),"undefined"!=typeof r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function v(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&l0){var s=_(t._boundingBoxMargins),l=s.left+s.right,c=s.bottom+s.top,u=a._container.node().getBoundingClientRect(),f=1-2*o.frameMargins;i=Math.round(f*(u.width-l)),n=Math.round(f*(u.height-c))}else r=window.getComputedStyle(t),n=parseFloat(r.height)||a.height,i=parseFloat(r.width)||a.width;return Math.abs(a.width-i)>1||Math.abs(a.height-n)>1?(a.height=t.layout.height=n,a.width=t.layout.width=i):"initial"!==a.autosize&&(delete e.autosize,a.autosize=t.layout.autosize=!0),N.sanitizeMargins(a),e}function k(t){var e=S.select(t),r=t._fullLayout;if(r._container=e.selectAll(".plot-container").data([0]),r._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0),r._paperdiv=r._container.selectAll(".svg-container").data([0]),r._paperdiv.enter().append("div").classed("svg-container",!0).style("position","relative"),"initial"===r.autosize&&(w(t,{}),r.autosize=!0,t.layout.autosize=!0),r._glcontainer=r._paperdiv.selectAll(".gl-container").data([0]),r._glcontainer.enter().append("div").classed("gl-container",!0),r._geocontainer=r._paperdiv.selectAll(".geo-container").data([0]),r._geocontainer.enter().append("div").classed("geo-container",!0),r._paperdiv.selectAll(".main-svg").remove(),r._paper=r._paperdiv.insert("svg",":first-child").classed("main-svg",!0),r._toppaper=r._paperdiv.append("svg").classed("main-svg",!0),!r._uid){var n=[];S.selectAll("defs").each(function(){this.id&&n.push(this.id.split("-")[1])}),r._uid=R.randstr(n)}r._paperdiv.selectAll(".main-svg").attr(W.svgAttrs),r._defs=r._paper.append("defs").attr("id","defs-"+r._uid),r._topdefs=r._toppaper.append("defs").attr("id","topdefs-"+r._uid),r._draggers=r._paper.append("g").classed("draglayer",!0);var i=r._paper.append("g").classed("layer-below",!0);r._imageLowerLayer=i.append("g").classed("imagelayer",!0),r._shapeLowerLayer=i.append("g").classed("shapelayer",!0);var a=P.Axes.getSubplots(t);a.join("")!==Object.keys(t._fullLayout._plots||{}).join("")&&A(t,a),r._has("cartesian")&&M(t,a),r._ternarylayer=r._paper.append("g").classed("ternarylayer",!0);var o=r._paper.selectAll(".layer-subplot");r._imageSubplotLayer=o.selectAll(".imagelayer"),r._shapeSubplotLayer=o.selectAll(".shapelayer");var s=r._paper.append("g").classed("layer-above",!0);r._imageUpperLayer=s.append("g").classed("imagelayer",!0),r._shapeUpperLayer=s.append("g").classed("shapelayer",!0),r._pielayer=r._paper.append("g").classed("pielayer",!0),r._glimages=r._paper.append("g").classed("glimages",!0),r._geoimages=r._paper.append("g").classed("geoimages",!0),r._infolayer=r._toppaper.append("g").classed("infolayer",!0),r._zoomlayer=r._toppaper.append("g").classed("zoomlayer",!0),r._hoverlayer=r._toppaper.append("g").classed("hoverlayer",!0),t.emit("plotly_framework");var l=R.syncOrAsync([T,function(){return P.Axes.doTicks(t,"redraw")},j.init],t);return l&&l.then&&t._promises.push(l),l}function A(t,e){function r(e,r){return function(){return P.Axes.getFromId(t,e,r)}}for(var n,i,a=t._fullLayout._plots={},o=0;o0,_=P.Axes.getSubplots(t).join(""),w=Object.keys(t._fullLayout._plots||{}).join(""),A=w===_;x?t.framework===k&&!b&&A||(t.framework=k,k(t)):A?b&&k(t):(t.framework=k,k(t)),b&&P.Axes.saveRangeInitial(t);var M=t._fullLayout,E=!t.calcdata||t.calcdata.length!==(t.data||[]).length;E&&h(t);for(var L=0;LY.range[0]?[1,2]:[2,1]);else{var W=Y.range[0],Z=Y.range[1];"log"===O?(0>=W&&0>=Z&&i(q+".autorange",!0),0>=W?W=Z/1e6:0>=Z&&(Z=W/1e6),i(q+".range[0]",Math.log(W)/Math.LN10),i(q+".range[1]",Math.log(Z)/Math.LN10)):(i(q+".range[0]",Math.pow(10,W)),i(q+".range[1]",Math.pow(10,Z)))}else i(q+".autorange",!0)}if("reverse"===D)H.range?H.range.reverse():(i(q+".autorange",!0),H.range=[1,0]),G.autorange?_=!0:x=!0;else if("annotations"===z.parts[0]||"shapes"===z.parts[0]){var K=z.parts[1],$=z.parts[0],Q=p[$]||[],J=P[R.titleCase($)],tt=Q[K]||{};2===z.parts.length&&("add"===v[C]||R.isPlainObject(v[C])?E[C]="remove":"remove"===v[C]?-1===K?(E[$]=Q,delete E[C]):E[C]=tt:R.log("???",v)),!a(tt,"x")&&!a(tt,"y")||R.containsAny(C,["color","opacity","align","dash"])||(_=!0),J.draw(t,K,z.parts.slice(2).join("."),v[C]),delete v[C]}else if("images"===z.parts[0]){var rt=R.objectFromPath(C,O);R.extendDeepAll(t.layout,rt),U.supplyLayoutDefaults(t.layout,t._fullLayout),U.draw(t)}else if("mapbox"===z.parts[0]&&"layers"===z.parts[1]){R.extendDeepAll(t.layout,R.objectFromPath(C,O));var nt=(t._fullLayout.mapbox||{}).layers||[],it=z.parts[2]+1-nt.length;for(d=0;it>d;d++)nt.push({});x=!0}else 0===z.parts[0].indexOf("scene")?x=!0:0===z.parts[0].indexOf("geo")?x=!0:0===z.parts[0].indexOf("ternary")?x=!0:!g._has("gl2d")||-1===C.indexOf("axis")&&"plot_bgcolor"!==z.parts[0]?"hiddenlabels"===C?_=!0:-1!==z.parts[0].indexOf("legend")?m=!0:-1!==C.indexOf("title")?y=!0:-1!==z.parts[0].indexOf("bgcolor")?b=!0:z.parts.length>1&&R.containsAny(z.parts[1],["tick","exponent","grid","zeroline"])?y=!0:-1!==C.indexOf(".linewidth")&&-1!==C.indexOf("axis")?y=b=!0:z.parts.length>1&&-1!==z.parts[1].indexOf("line")?b=!0:z.parts.length>1&&"mirror"===z.parts[1]?y=b=!0:"margin.pad"===C?y=b=!0:"margin"===z.parts[0]||"autorange"===z.parts[1]||"rangemode"===z.parts[1]||"type"===z.parts[1]||"domain"===z.parts[1]||C.match(/^(bar|box|font)/)?_=!0:-1!==["hovermode","dragmode"].indexOf(C)?k=!0:-1===["hovermode","dragmode","height","width","autosize"].indexOf(C)&&(x=!0):x=!0,z.set(O)}I&&I.add(t,et,[t,E],et,[t,M]),v.autosize&&(v=w(t,v)),(v.height||v.width||v.autosize)&&(_=!0);var at=Object.keys(v),ot=[N.previousPromises];if(x||_)ot.push(function(){return t.layout=void 0,_&&(t.calcdata=void 0),P.plot(t,"",p)});else if(at.length&&(N.supplyDefaults(t),g=t._fullLayout,m&&ot.push(function(){return V.draw(t),N.previousPromises(t)}),b&&ot.push(T),y&&ot.push(function(){return P.Axes.doTicks(t,"redraw"),L(t),N.previousPromises(t)}),k)){var st;for(X(t),st=N.getSubplotIds(g,"gl3d"),d=0;d1)};c(r.width)&&c(r.height)||s(new Error("Height and width should be pixel values."));var u=n.clone(e,{format:"png",height:r.height,width:r.width}),f=u.td;f.style.position="absolute",f.style.left="-5000px",document.body.appendChild(f);var h=n.getRedrawFunc(f);a.plot(f,u.data,u.layout,u.config).then(h).then(l).then(function(e){t(e)}).catch(function(t){s(t)})});return s}var i=t("fast-isnumeric"),a=t("../plotly"),o=t("../lib");e.exports=n},{"../lib":382,"../plotly":402,"../snapshot":471,"fast-isnumeric":117}],402:[function(t,e,r){"use strict";t("es6-promise").polyfill(),r.Lib=t("./lib"),r.util=t("./lib/svg_text_utils"),r.Queue=t("./lib/queue"),t("../build/plotcss"),r.MathJaxConfig=t("./fonts/mathjax_config"),r.defaultConfig=t("./plot_api/plot_config");var n=r.Plots=t("./plots/plots");r.Axes=t("./plots/cartesian/axes"),r.Fx=t("./plots/cartesian/graph_interact"),r.micropolar=t("./plots/polar/micropolar"),r.Color=t("./components/color"),r.Drawing=t("./components/drawing"),r.Colorscale=t("./components/colorscale"),r.Colorbar=t("./components/colorbar"),r.ErrorBars=t("./components/errorbars"),r.Annotations=t("./components/annotations"),r.Shapes=t("./components/shapes"),r.Legend=t("./components/legend"),r.Images=t("./components/images"),r.ModeBar=t("./components/modebar"),r.register=function(t){if(!t)throw new Error("No argument passed to Plotly.register.");t&&!Array.isArray(t)&&(t=[t]);for(var e=0;ec&&u>e&&(void 0===i[r]?a[f]=T.tickText(t,e):a[f]=s(t,e,String(i[r])),f++);return f=864e5?t._tickround="d":r>=36e5?t._tickround="H":r>=6e4?t._tickround="M":r>=1e3?t._tickround="S":t._tickround=3-Math.round(Math.log(r/2)/Math.LN10);else{b(r)||(r=Number(r.substr(1))),t._tickround=2-Math.floor(Math.log(r)/Math.LN10+.01),e="log"===t.type?Math.pow(10,Math.max(t.range[0],t.range[1])):Math.max(Math.abs(t.range[0]),Math.abs(t.range[1]));var n=Math.floor(Math.log(e)/Math.LN10+.01);Math.abs(n)>3&&("SI"===t.exponentformat||"B"===t.exponentformat?t._tickexponent=3*Math.round((n-1)/3):t._tickexponent=n)}else"M"===r.charAt(0)?t._tickround=2===r.length?"m":"y":t._tickround=null}function o(t,e){var r=t.match(U),n=new Date(e);if(r){var i=Math.min(+r[1]||6,6),a=String(e/1e3%1+2.0000005).substr(2,i).replace(/0+$/,"")||"0";return y.time.format(t.replace(U,a))(n)}return y.time.format(t)(n)}function s(t,e,r){var n=t.tickfont||t._gd._fullLayout.font;return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}function l(t,e,r,n){var i,a=e.x,s=t._tickround,l=new Date(a),c="";r&&t.hoverformat?i=o(t.hoverformat,a):t.tickformat?i=o(t.tickformat,a):(n&&(b(s)?s+=2:s={y:"m",m:"d",d:"H",H:"M",M:"S",S:2}[s]),"y"===s?i=I(l):"m"===s?i=N(l):(a!==t._tmin||r||(c="
"+I(l)),"d"===s?i=j(l):"H"===s?i=F(l):(a!==t._tmin||r||(c="
"+j(l)+", "+I(l)),i=D(l),"M"!==s&&(i+=B(l),"S"!==s&&(i+=h(m(a/1e3,1),t,"none",r).substr(1)))))),e.text=i+c}function c(t,e,r,n,i){var a=t.dtick,o=e.x;if(!n||"string"==typeof a&&"L"===a.charAt(0)||(a="L3"),t.tickformat||"string"==typeof a&&"L"===a.charAt(0))e.text=h(Math.pow(10,o),t,i,n);else if(b(a)||"D"===a.charAt(0)&&m(o+.01,1)<.1)if(-1!==["e","E","power"].indexOf(t.exponentformat)){var s=Math.round(o);0===s?e.text=1:1===s?e.text="10":s>1?e.text="10"+s+"":e.text="10\u2212"+-s+"",e.fontSize*=1.25}else e.text=h(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,m(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*(0>o?.5:.25)))}}function u(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}function f(t,e,r,n,i){"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=h(e.x,t,i,n)}function h(t,e,r,n){var i=0>t,o=e._tickround,s=r||e.exponentformat||"B",l=e._tickexponent,c=e.tickformat;if(n){var u={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:b(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range:[0,t||1]};a(u),o=(Number(u._tickround)||0)+4,l=u._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return y.format(c)(t).replace(/-/g,"\u2212");var f=Math.pow(10,-o)/2;if("none"===s&&(l=0),t=Math.abs(t),f>t)t="0",i=!1;else{if(t+=f,l&&(t*=Math.pow(10,-l),o+=l),0===o)t=String(Math.floor(t));else if(0>o){t=String(Math.round(t)),t=t.substr(0,t.length+o);for(var h=o;0>h;h++)t+="0"}else{t=String(t);var d=t.indexOf(".")+1;d&&(t=t.substr(0,d+o).replace(/\.?0+$/,""))}t=_.numSeparate(t,e._gd._fullLayout.separators)}if(l&&"hide"!==s){var p;p=0>l?"\u2212"+-l:"power"!==s?"+"+l:String(l),"e"===s||("SI"===s||"B"===s)&&(l>12||-15>l)?t+="e"+p:"E"===s?t+="E"+p:"power"===s?t+="×10"+p+"":"B"===s&&9===l?t+="B":"SI"!==s&&"B"!==s||(t+=V[l/3+5])}return i?"\u2212"+t:t}function d(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},T.getAutoRange=function(t){var e,r=[],n=t._min[0].val,i=t._max[0].val;for(e=1;e0&&u>0&&f/u>h&&(l=o,c=s,h=f/u);return n===i?r=d?[n+1,"normal"!==t.rangemode?0:n-1]:["normal"!==t.rangemode?0:n-1,n+1]:h&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode&&l.val>=0?l={val:0,pad:0}:"nonnegative"===t.rangemode&&(l.val-h*l.pad<0&&(l={val:0,pad:0}),c.val<0&&(c={val:1,pad:0})),h=(c.val-l.val)/(t._length-l.pad-c.pad)),r=[l.val-h*l.pad,c.val+h*c.pad],r[0]===r[1]&&(r=[r[0]-1,r[0]+1]),d&&r.reverse()),r},T.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=T.getAutoRange(t);var r=t._gd.layout[t._name];r||(t._gd.layout[t._name]=r={}),r!==t&&(r.range=t.range.slice(),r.autorange=t.autorange)}},T.saveRangeInitial=function(t,e){for(var r=T.list(t,"",!0),n=!1,i=0;ip&&(p=g/10),c=t.c2l(p),u=t.c2l(g),y&&(c=Math.min(0,c),u=Math.max(0,u)),n(c)){for(d=!0,o=0;o=h?d=!1:s.val>=c&&s.pad<=h&&(t._min.splice(o,1),o--);d&&t._min.push({val:c,pad:y&&0===c?0:h})}if(n(u)){for(d=!0,o=0;o=u&&s.pad>=f?d=!1:s.val<=u&&s.pad<=f&&(t._max.splice(o,1),o--);d&&t._max.push({val:u,pad:y&&0===u?0:f})}}}if((t.autorange||t._needsExpand)&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var a,o,s,l,c,u,f,h,d,p,g,v=e.length,m=r.padded?.05*t._length:0,y=r.tozero&&("linear"===t.type||"-"===t.type),x=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),_=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),w=n(r.vpadplus||r.vpad),k=n(r.vpadminus||r.vpad);for(a=0;6>a;a++)i(a);for(a=v-1;a>5;a--)i(a)}},T.autoBin=function(t,e,r,n){function i(t){return(1+100*(t-d)/f.dtick)%100<2}var a=_.aggNums(Math.min,null,t),o=_.aggNums(Math.max,null,t);if("category"===e.type)return{start:a-.5,end:o+.5,size:1};var s;if(r)s=(o-a)/r;else{var l=_.distinctVals(t),c=Math.pow(10,Math.floor(Math.log(l.minDiff)/Math.LN10)),u=c*_.roundUp(l.minDiff/c,[.9,1.9,4.9,9.9],!0);s=Math.max(u,2*_.stdev(t)/Math.pow(t.length,n?.25:.4))}var f={type:"log"===e.type?"linear":e.type,range:[a,o]};T.autoTicks(f,s);var h,d=T.tickIncrement(T.tickFirst(f),f.dtick,"reverse");if("number"==typeof f.dtick){for(var p=0,g=0,v=0,m=0,y=0;yg&&(p>.3*x||i(a)||i(o))){var w=f.dtick/2;d+=a>d+w?w:-w}var k=1+Math.floor((o-d)/f.dtick);h=d+k*f.dtick}else for(h=d;o>=h;)h=T.tickIncrement(h,f.dtick);return{start:d,end:h,size:f.dtick}},T.calcTicks=function(t){if("array"===t.tickmode)return n(t);if("auto"===t.tickmode||!t.dtick){var e,r=t.nticks;r||("category"===t.type?(e=t.tickfont?1.2*(t.tickfont.size||12):15,r=t._length/e):(e="y"===t._id.charAt(0)?40:80,r=_.constrain(t._length/e,4,9)+1)),T.autoTicks(t,Math.abs(t.range[1]-t.range[0])/r),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t._forceTick0)}t.tick0||(t.tick0="date"===t.type?new Date(2e3,0,1).getTime():0),a(t),t._tmin=T.tickFirst(t);var i=t.range[1]=s:s>=l)&&(o.push(l),!(o.length>1e3));l=T.tickIncrement(l,t.dtick,i));t._tmax=o[o.length-1];for(var c=new Array(o.length),u=0;u157788e5?(e/=315576e5,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*i(e,r,S)):e>12096e5?(e/=26298e5,t.dtick="M"+i(e,1,C)):e>432e5?(t.dtick=i(e,864e5,P),t.tick0=new Date(2e3,0,2).getTime()):e>18e5?t.dtick=i(e,36e5,C):e>3e4?t.dtick=i(e,6e4,z):e>500?t.dtick=i(e,1e3,z):(r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=i(e,r,S));else if("log"===t.type)if(t.tick0=0,e>.7)t.dtick=Math.ceil(e);else if(Math.abs(t.range[1]-t.range[0])<1){var n=1.5*Math.abs((t.range[1]-t.range[0])/e);e=Math.abs(Math.pow(10,t.range[1])-Math.pow(10,t.range[0]))/n,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+i(e,r,S)}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=i(e,r,S));if(0===t.dtick&&(t.dtick=1),!b(t.dtick)&&"string"!=typeof t.dtick){var a=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(a)}},T.tickIncrement=function(t,e,r){var n=r?-1:1;if(b(e))return t+n*e;var i=e.charAt(0),a=n*Number(e.substr(1));if("M"===i){var o=new Date(t);return o.setMonth(o.getMonth()+a)}if("L"===i)return Math.log(Math.pow(10,t)+a)/Math.LN10;if("D"===i){var s="D2"===e?O:R,l=t+.01*n,c=_.roundUp(m(l,1),s,r);return Math.floor(l)+Math.log(y.round(Math.pow(10,c),1))/Math.LN10}throw"unrecognized dtick "+String(e)},T.tickFirst=function(t){var e=t.range[1]n:n>c;)c=T.tickIncrement(c,i,e);return c}if("L"===u)return Math.log(r((Math.pow(10,n)-a)/f)*f+a)/Math.LN10;if("D"===u){var h="D2"===i?O:R,d=_.roundUp(m(n,1),h,e);return Math.floor(n)+Math.log(y.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(i)};var I=y.time.format("%Y"),N=y.time.format("%b %Y"),j=y.time.format("%b %-d"),F=y.time.format("%b %-d %Hh"),D=y.time.format("%H:%M"),B=y.time.format(":%S"),U=/%(\d?)f/g;T.tickText=function(t,e,r){function n(n){var i;return void 0===n?!0:r?"none"===n:(i={first:t._tmin,last:t._tmax}[n],"all"!==n&&e!==i)}var i,a,o=s(t,e),h="array"===t.tickmode,d=r||h;if(h&&Array.isArray(t.ticktext)){var p=Math.abs(t.range[1]-t.range[0])/1e4;for(a=0;a1&&er&&(A=90),i(u,A)}c._lastangle=A}return o(e),e+" done"}function l(){c._boundingBox=r.node().getBoundingClientRect()}var u=r.selectAll("g."+C).data(L,S);if(!c.showticklabels||!b(n))return u.remove(),void o(e);var f,h,p,m,x;"x"===v?(x="bottom"===B?1:-1,f=function(t){return t.dx+I*x},m=n+(O+R)*x,h=function(t){return t.dy+m+t.fontSize*("bottom"===B?1:-.5)},p=function(t){return b(t)&&0!==t&&180!==t?0>t*x?"end":"start":"middle"}):(x="right"===B?1:-1,h=function(t){return t.dy+t.fontSize/2-I*x},f=function(t){return t.dx+n+(O+R+(90===Math.abs(c.tickangle)?t.fontSize/2:0))*x},p=function(t){return b(t)&&90===Math.abs(t)?"middle":"right"===B?"start":"end"});var k=0,A=0,T=[];u.enter().append("g").classed(C,1).append("text").attr("text-anchor","middle").each(function(e){var r=y.select(this),n=t._promises.length;r.call(M.setPosition,f(e),h(e)).call(M.font,e.font,e.fontSize,e.fontColor).text(e.text).call(w.convertToTspans),n=t._promises[n],n?T.push(t._promises.pop().then(function(){i(r,c.tickangle)})):i(r,c.tickangle)}),u.exit().remove(),u.each(function(t){k=Math.max(k,t.fontSize)}),i(u,c._lastangle||c.tickangle);var E=_.syncOrAsync([a,s,l]);return E&&E.then&&t._promises.push(E),E}function o(e){if(!r){var n,i,a,o,s=E.getFromId(t,e),l=y.select(t).selectAll("g."+e+"tick"),c={selection:l,side:s.side},f=e.charAt(0),h=t._fullLayout._size,d=1.5,p=s.titlefont.size;if(l.size()){var g=y.select(l.node().parentNode).attr("transform").match(/translate\(([-\.\d]+),([-\.\d]+)\)/);g&&(c.offsetLeft=+g[1],c.offsetTop=+g[2])}"x"===f?(i="free"===s.anchor?{_offset:h.t+(1-(s.position||0))*h.h,_length:0}:E.getFromId(t,s.anchor),a=s._offset+s._length/2,o=i._offset+("top"===s.side?-10-p*(d+(s.showticklabels?1:0)):i._length+10+p*(d+(s.showticklabels?1.5:.5))),s.rangeslider&&s.rangeslider.visible&&s._boundingBox&&(o+=(u.height-u.margin.b-u.margin.t)*s.rangeslider.thickness+s._boundingBox.height),c.side||(c.side="bottom")):(i="free"===s.anchor?{_offset:h.l+(s.position||0)*h.w,_length:0}:E.getFromId(t,s.anchor),o=s._offset+s._length/2,a=i._offset+("right"===s.side?i._length+10+p*(d+(s.showticklabels?1:.5)):-10-p*(d+(s.showticklabels?.5:0))),n={rotate:"-90",offset:0},c.side||(c.side="left")),k.draw(t,e+"title",{propContainer:s,propName:s._name+".title",dfltName:f.toUpperCase()+" axis",avoid:c,transform:n,attributes:{x:a,y:o,"text-anchor":"middle"}})}}function s(t,e){return t.visible!==!0||t.xaxis+t.yaxis!==e?!1:x.Plots.traceIs(t,"bar")&&t.orientation==={x:"h",y:"v"}[v]?!0:t.fill&&t.fill.charAt(t.fill.length-1)===v}function l(e,r,i){var a=e.gridlayer,o=e.zerolinelayer,l=e["hidegrid"+v]?[]:V,u=c._gridpath||"M0,0"+("x"===v?"v":"h")+r._length,f=a.selectAll("path."+z).data(c.showgrid===!1?[]:l,S);if(f.enter().append("path").classed(z,1).classed("crisp",1).attr("d",u).each(function(t){c.zeroline&&("linear"===c.type||"-"===c.type)&&Math.abs(t.x)g;g++){var y=c.mirrors[o._id+h[g]];"ticks"!==y&&"labels"!==y||(f[g]=!0)}return void 0!==n[2]&&(f[2]=!0),f.forEach(function(t,e){var r=n[e],i=U[e];t&&b(r)&&(d+=p(r+R*i,i*c.ticklen))}),i(r,d),l(e,o,t),a(r,n[3])}}).filter(function(t){return t&&t.then});return H.length?Promise.all(H):0},T.swap=function(t,e){for(var r=d(t,e),n=0;n2*n; -}function u(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,i=0,a=0;a2*n}var f=t("fast-isnumeric"),h=t("tinycolor2").mix,d=t("../../lib"),p=t("../plots"),g=t("../../components/color/attributes").lightFraction,v=t("./layout_attributes"),m=t("./tick_value_defaults"),y=t("./tick_mark_defaults"),b=t("./tick_label_defaults"),x=t("./category_order_defaults"),_=t("./set_convert"),w=t("./ordered_categories"),k=t("./clean_datum"),A=t("./axis_ids");e.exports=function(t,e,r,i){function a(r,n){return d.coerce2(t,e,v,r,n)}var o=i.letter,s=i.font||{},l="Click to enter "+(i.title||o.toUpperCase()+" axis")+" title";i.name&&(e._name=i.name,e._id=A.name2id(i.name));var c=r("type");"-"===c&&(n(e,i.data),"-"===e.type?e.type="linear":c=t.type=e.type),_(e);var u=r("color"),p=u===t.color?u:s.color;r("title",l),d.coerceFont(r,"titlefont",{family:s.family,size:Math.round(1.2*s.size),color:p});var k=2===(t.range||[]).length&&f(t.range[0])&&f(t.range[1]),M=r("autorange",!k);M&&r("rangemode");var T=r("range",[-1,"x"===o?6:4]);T[0]===T[1]&&(e.range=[T[0]-1,T[0]+1]),d.noneOrAll(t.range,e.range,[0,1]),r("fixedrange"),m(t,e,r,c),b(t,e,r,c,i),y(t,e,r,i),x(t,e,r);var E=a("linecolor",u),L=a("linewidth"),S=r("showline",!!E||!!L);S||(delete e.linecolor,delete e.linewidth),(S||e.ticks)&&r("mirror");var C=a("gridcolor",h(u,i.bgColor,g).toRgbString()),z=a("gridwidth"),P=r("showgrid",i.showGrid||!!C||!!z);P||(delete e.gridcolor,delete e.gridwidth);var R=a("zerolinecolor",u),O=a("zerolinewidth"),I=r("zeroline",i.showGrid||!!R||!!O);return I||(delete e.zerolinecolor,delete e.zerolinewidth),e._initialCategories="category"===c?w(o,e.categoryorder,e.categoryarray,i.data):[],e}},{"../../components/color/attributes":302,"../../lib":382,"../plots":454,"./axis_ids":407,"./category_order_defaults":408,"./clean_datum":409,"./layout_attributes":414,"./ordered_categories":416,"./set_convert":419,"./tick_label_defaults":420,"./tick_mark_defaults":421,"./tick_value_defaults":422,"fast-isnumeric":117,tinycolor2:274}],407:[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")}}},{}],409:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib");e.exports=function(t){try{if("object"==typeof t&&null!==t&&t.getTime)return i.ms2DateTime(t);if("string"!=typeof t&&!n(t))return"";t=t.toString().replace(/['"%,$# ]/g,"")}catch(e){i.error(e,t)}return t}},{"../../lib":382,"fast-isnumeric":117}],410:[function(t,e,r){"use strict";e.exports={idRegex:{x:/^x([2-9]|[1-9][0-9]+)?$/,y:/^y([2-9]|[1-9][0-9]+)?$/},attrRegex:{x:/^xaxis([2-9]|[1-9][0-9]+)?$/,y:/^yaxis([2-9]|[1-9][0-9]+)?$/},BADNUM:void 0,xAxisMatch:/^xaxis[0-9]*$/,yAxisMatch:/^yaxis[0-9]*$/,AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,DBLCLICKDELAY:300,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,MAXDIST:20,YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,BENDPX:1.5,REDRAWDELAY:50}},{}],411:[function(t,e,r){"use strict";function n(t,e){var r,n=t.range[e],i=Math.abs(n-t.range[1-e]);return"date"===t.type?c.ms2DateTime(n,i):"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,o.format("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,o.format("."+String(r)+"g")(n))}function i(t,e){return t?"nsew"===t?"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}function a(t){o.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}var o=t("d3"),s=t("tinycolor2"),l=t("../../plotly"),c=t("../../lib"),u=t("../../lib/svg_text_utils"),f=t("../../components/color"),h=t("../../components/drawing"),d=t("../../lib/setcursor"),p=t("../../components/dragelement"),g=t("./axes"),v=t("./select"),m=t("./constants"),y=!0;e.exports=function(t,e,r,o,b,x,_,w){function k(t,e){for(var r=0;r.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+ht+", "+dt+")").attr("d",ot+"Z"),ut=ft.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+ht+", "+dt+")").attr("d","M0,0Z"),T();for(var a=0;ai?(lt="",it.r=it.l,it.t=it.b,ut.attr("d","M0,0Z")):(it.t=0,it.b=V,lt="x",ut.attr("d","M"+(it.l-.5)+","+(nt-H-.5)+"h-3v"+(2*H+1)+"h3ZM"+(it.r+.5)+","+(nt-H-.5)+"h3v"+(2*H+1)+"h-3Z")):!Z||i.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),ut.transition().style("opacity",1).duration(200),st=!0)}function L(t,e,r){var n,i,a;for(n=0;nzoom back out","long"),y=!1)))}function C(e,r){var i=1===(_+w).length;if(e)I();else if(2!==r||i){if(1===r&&i){var a=_?B[0]:D[0],o="s"===_||"w"===w?0:1,s=a._name+".range["+o+"]",c=n(a,o),f="left",h="middle";if(a.fixedrange)return;_?(h="n"===_?"top":"bottom","right"===a.side&&(f="right")):"e"===w&&(f="right"),J.call(u.makeEditable,null,{immediate:!0,background:j.paper_bgcolor,text:String(c),fill:a.tickfont?a.tickfont.color:"#444",horizontalAlign:f,verticalAlign:h}).on("edit",function(e){var r="category"===a.type?a.c2l(e):a.d2l(e);void 0!==r&&l.relayout(t,s,r)})}}else O()}function z(e){function r(t,e,r){if(!t.fixedrange){A(t.range);var n=t.range,i=n[0]+(n[1]-n[0])*e;t.range=[i+(n[0]-i)*r,i+(n[1]-i)*r]}}if(t._context.scrollZoom||j._enablescrollzoom){var n=t.querySelector(".plotly");if(!(n.scrollHeight-n.clientHeight>10||n.scrollWidth-n.clientWidth>10)){clearTimeout(gt);var i=-e.deltaY;if(isFinite(i)||(i=e.wheelDelta/10),!isFinite(i))return void c.log("Did not find wheel motion attributes: ",e);var a,o=Math.exp(-Math.min(Math.max(i,-20),20)/100),s=mt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),l=(e.clientX-s.left)/s.width,u=pt[0]+pt[2]*l,f=(s.bottom-e.clientY)/s.height,h=pt[1]+pt[3]*(1-f);if(w){for(a=0;a=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function i(t,e,r){for(var i=1-e,a=0,o=0;o0;n--)r.push(e);return r}function i(t,e){for(var r=[],n=0;nT;T++){var E=a[T],L=d[E];if(L)A[T]=w.getFromId(t,L.xaxis._id),M[T]=w.getFromId(t,L.yaxis._id);else{var S=o[E]._subplot;A[T]=S.xaxis,M[T]=S.yaxis}}var C=e.hovermode||o.hovermode;if(-1===["x","y","closest"].indexOf(C)||!t.calcdata||t.querySelector(".zoombox")||t._dragging)return _.unhoverRaw(t,e);var z,P,R,O,I,N,j,F,D,B,U,V,q=[],H=[];if(Array.isArray(e))for(C="array",R=0;RG||G>X.width||0>Y||Y>X.height)return _.unhoverRaw(t,e)}else G="xpx"in e?e.xpx:A[0]._length/2,Y="ypx"in e?e.ypx:M[0]._length/2;if(z="xval"in e?n(a,e.xval):i(A,G),P="yval"in e?n(a,e.yval):i(M,Y),!g(z[0])||!g(P[0]))return v.warn("Plotly.Fx.hover failed",e,t),_.unhoverRaw(t,e)}var W=1/0;for(O=0;O1||-1!==N.hoverinfo.indexOf("name")?N.name:void 0,index:!1,distance:Math.min(W,k.MAXDIST),color:b.defaultLine,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},V=q.length,"array"===F){var Z=e[O];"pointNumber"in Z?(U.index=Z.pointNumber,F="closest"):(F="","xval"in Z&&(D=Z.xval,F="x"),"yval"in Z&&(B=Z.yval,F=F?"closest":"y"))}else D=z[j],B=P[j];if(N._module&&N._module.hoverPoints){var K=N._module.hoverPoints(U,D,B,F);if(K)for(var $,Q=0;QV&&(q.splice(0,V),W=q[0].distance)}if(0===q.length)return _.unhoverRaw(t,e);var J="y"===C&&H.length>1;q.sort(function(t,e){return t.distance-e.distance});var tt=b.combine(o.plot_bgcolor||b.background,o.paper_bgcolor),et={hovermode:C,rotateLabels:J,bgColor:tt,container:o._hoverlayer,outerContainer:o._paperdiv},rt=c(q,et);u(q,J?"xa":"ya"),f(rt,J);var nt=t._hoverdata,it=[];for(R=0;R128?"#000":b.background;if(t.name&&void 0===t.zLabelVal){var u=document.createElement("p");u.innerHTML=t.name,r=u.textContent||"",r.length>15&&(r=r.substr(0,12)+"...")}void 0!==t.extraText&&(n+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(n+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(n+="y: "+t.yLabel+"
"),n+=(n?"z: ":"")+t.zLabel):M&&t[i+"Label"]===g?n=t[("x"===i?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(n=t.yLabel):n=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(n+=(n?"
":"")+t.text),""===n&&(""===r&&e.remove(),n=r);var f=e.select("text.nums").style("fill",c).call(x.setPosition,0,0).text(n).attr("data-notex",1).call(y.convertToTspans);f.selectAll("tspan.line").call(x.setPosition,0,0);var h=e.select("text.name"),v=0;r&&r!==n?(h.style("fill",l).text(r).call(x.setPosition,0,0).attr("data-notex",1).call(y.convertToTspans),h.selectAll("tspan.line").call(x.setPosition,0,0),v=h.node().getBoundingClientRect().width+2*P):(h.remove(),e.select("rect").remove()),e.select("path").style({fill:l,stroke:c});var m,k,E=f.node().getBoundingClientRect(),L=t.xa._offset+(t.x0+t.x1)/2,S=t.ya._offset+(t.y0+t.y1)/2,C=Math.abs(t.x1-t.x0),R=Math.abs(t.y1-t.y0),O=E.width+z+P+v;t.ty0=_-E.top,t.bx=E.width+2*P,t.by=E.height+2*P,t.anchor="start",t.txwidth=E.width,t.tx2width=v,t.offset=0,a?(t.pos=L,m=A>=S+R/2+O,k=S-R/2-O>=0,"top"!==t.idealAlign&&m||!k?m?(S+=R/2,t.anchor="start"):t.anchor="middle":(S-=R/2,t.anchor="end")):(t.pos=S,m=w>=L+C/2+O,k=L-C/2-O>=0,"left"!==t.idealAlign&&m||!k?m?(L+=C/2,t.anchor="start"):t.anchor="middle":(L-=C/2,t.anchor="end")),f.attr("text-anchor",t.anchor),v&&h.attr("text-anchor",t.anchor),e.attr("transform","translate("+L+","+S+")"+(a?"rotate("+T+")":""))}),S}function u(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(!(.01>a)){if(-.01>i){for(s=t.length-1;s>=0;s--)t[s].dp-=a;n=!1}if(n){var c=0;for(o=0;oe.pmax&&c++;for(o=t.length-1;o>=0&&!(0>=c);o--)l=t[o],l.pos>e.pmax-1&&(l.del=!0,c--);for(o=0;o=c);o++)if(l=t[o],l.pos=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(0>=c);o--)l=t[o],l.pos+l.dp+l.size>e.pmax&&(l.del=!0,c--)}}}for(var n,i,a,o,s,l,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)?L: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&&p.pmin===g.pmin&&p.pmax===g.pmax){for(s=d.length-1;s>=0;s--)d[s].dp+=i;for(h.push.apply(h,d),f.splice(o+1,1),c=0,s=h.length-1;s>=0;s--)c+=h[s].dp;for(a=c/h.length,s=h.length-1;s>=0;s--)h[s].dp-=a;n=!1}else o++}f.forEach(r)}for(o=f.length-1;o>=0;o--){var v=f[o];for(s=v.length-1;s>=0;s--){var m=v[s],y=t[m.i];y.offset=m.dp,y.del=m.del}}}function f(t,e){t.each(function(t){var r=d.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*(z+P),s=o+a*(t.txwidth+P),l=0,c=t.offset;"middle"===t.anchor&&(o-=t.tx2width/2,s-=t.tx2width/2),e&&(c*=-C,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*z+l)+","+(z+c)+"v"+(t.by/2-z)+"h"+n*t.bx+"v-"+t.by+"H"+(n*z+l)+"V"+(c-z)+"Z"),i.call(x.setPosition,o+l,c+t.ty0-t.by/2+P).selectAll("tspan.line").attr({x:i.attr("x"),y:i.attr("y")}),t.tx2width&&(r.select("text.name, text.name tspan.line").call(x.setPosition,s+a*P+l,c+t.ty0-t.by/2+P),r.select("rect").call(x.setRect,s+(a-1)*t.tx2width/2+l,c-t.by/2-1,t.tx2width,t.by+2))})}function h(t,e,r){if(!e.target)return!1;if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=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 d=t("d3"),p=t("tinycolor2"),g=t("fast-isnumeric"),v=t("../../lib"),m=t("../../lib/events"),y=t("../../lib/svg_text_utils"),b=t("../../components/color"),x=t("../../components/drawing"),_=t("../../components/dragelement"),w=t("./axes"),k=t("./constants"),A=t("./dragbox"),M=e.exports={};M.unhover=_.unhover,M.layoutAttributes={dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom"},hovermode:{valType:"enumerated",values:["x","y","closest",!1]}},M.supplyLayoutDefaults=function(t,e,r){function n(r,n){return v.coerce(t,e,M.layoutAttributes,r,n)}n("dragmode");var i;if(e._has("cartesian")){var a=e._isHoriz=M.isHoriz(r);i=a?"y":"x"}else i="closest";n("hovermode",i)},M.isHoriz=function(t){for(var e=!0,r=0;rt._lastHoverTime+k.HOVERMINTIME?(o(t,e,r),void(t._lastHoverTime=Date.now())):void(t._hoverTimer=setTimeout(function(){o(t,e,r),t._lastHoverTime=Date.now(),t._hoverTimer=void 0},k.HOVERMINTIME))},M.getDistanceFunction=function(t,e,r,n){return"closest"===t?n||a(e,r):"x"===t?e:r},M.getClosest=function(t,e,r){if(r.index!==!1)r.index>=0&&r.indext*e||0===t?k.MAXDIST*(.6-.3/Math.max(3,Math.abs(t-e))):1/0}},{"../../components/color":303,"../../components/dragelement":324,"../../components/drawing":326,"../../lib":382,"../../lib/events":376,"../../lib/svg_text_utils":395,"./axes":405,"./constants":410,"./dragbox":411,d3:113,"fast-isnumeric":117,tinycolor2:274}],413:[function(t,e,r){"use strict";var n=t("../plots"),i=t("./constants");r.name="cartesian",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex=i.idRegex,r.attrRegex=i.attrRegex,r.attributes=t("./attributes"),r.plot=function(t){function e(t,e){for(var r=[],n=0;nf[1]-.01&&(e.domain=[0,1]),i.noneOrAll(t.domain,e.domain,[0,1])}return e}},{"../../lib":382,"fast-isnumeric":117}],418:[function(t,e,r){"use strict";function n(t){return t._id}var i=t("../../lib/polygon"),a=t("../../components/color"),o=t("./axes"),s=t("./constants"),l=i.filter,c=i.tester,u=s.MINSELECT;e.exports=function(t,e,r,i,f){function h(t){var e="y"===t._id.charAt(0)?1:0;return function(r){return t.p2d(r[e])}}function d(t,e){return t-e}var p,g=i.gd._fullLayout._zoomlayer,v=i.element.getBoundingClientRect(),m=i.plotinfo.x()._offset,y=i.plotinfo.y()._offset,b=e-v.left,x=r-v.top,_=b,w=x,k="M"+b+","+x,A=i.xaxes[0]._length,M=i.yaxes[0]._length,T=i.xaxes.map(n),E=i.yaxes.map(n),L=i.xaxes.concat(i.yaxes);"lasso"===f&&(p=l([[b,x]],s.BENDPX));var S=g.selectAll("path.select-outline").data([1,2]);S.enter().append("path").attr("class",function(t){return"select-outline select-outline-"+t}).attr("transform","translate("+m+", "+y+")").attr("d",k+"Z");var C,z,P,R,O,I=g.append("path").attr("class","zoombox-corners").style({fill:a.background,stroke:a.defaultLine,"stroke-width":1}).attr("transform","translate("+m+", "+y+")").attr("d","M0,0Z"),N=[],j=i.gd,F=[];for(C=0;C0)return Math.log(e)/Math.LN10;if(0>=e&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-3*u*Math.abs(n-i))}return o.BADNUM}function r(t){return Math.pow(10,t)}function c(t){return i(t)?Number(t):o.BADNUM}var u=10;if(t.c2l="log"===t.type?e:c,t.l2c="log"===t.type?r:c,t.l2d=function(e){return t.c2d(t.l2c(e))},t.p2d=function(e){return t.l2d(t.p2l(e))},t.setScale=function(){var e,r=t._gd._fullLayout._size;if(t._categories||(t._categories=[]),t.overlaying){var n=l.getFromId(t._gd,t.overlaying);t.domain=n.domain}for(t.range&&2===t.range.length&&t.range[0]!==t.range[1]||(t.range=[-1,1]),e=0;2>e;e++)i(t.range[e])||(t.range[e]=i(t.range[1-e])?t.range[1-e]*(e?10:.1):e?1:-1),t.range[e]<-(Number.MAX_VALUE/2)?t.range[e]=-(Number.MAX_VALUE/2):t.range[e]>Number.MAX_VALUE/2&&(t.range[e]=Number.MAX_VALUE/2);if("y"===t._id.charAt(0)?(t._offset=r.t+(1-t.domain[1])*r.h,t._length=r.h*(t.domain[1]-t.domain[0]),t._m=t._length/(t.range[0]-t.range[1]),t._b=-t._m*t.range[1]):(t._offset=r.l+t.domain[0]*r.w,t._length=r.w*(t.domain[1]-t.domain[0]),t._m=t._length/(t.range[1]-t.range[0]),t._b=-t._m*t.range[0]),!isFinite(t._m)||!isFinite(t._b))throw a.notifier("Something went wrong with axis scaling","long"),t._gd._replotting=!1,new Error("axis scaling")},t.l2p=function(e){return i(e)?n.round(t._b+t._m*e,2):o.BADNUM},t.p2l=function(e){return(e-t._b)/t._m},t.c2p=function(e,r){return t.l2p(t.c2l(e,r))},t.p2c=function(e){return t.l2c(t.p2l(e))},-1!==["linear","log","-"].indexOf(t.type))t.c2d=c,t.d2c=function(t){return t=s(t),i(t)?Number(t):o.BADNUM},t.d2l=function(e,r){return"log"===t.type?t.c2l(t.d2c(e),r):t.d2c(e)};else if("date"===t.type){if(t.c2d=function(t){return i(t)?a.ms2DateTime(t):o.BADNUM},t.d2c=function(t){return i(t)?Number(t):a.dateTime2ms(t)},t.d2l=t.d2c,t.range&&t.range.length>1)try{var f=t.range.map(a.dateTime2ms);!i(t.range[0])&&i(f[0])&&(t.range[0]=f[0]),!i(t.range[1])&&i(f[1])&&(t.range[1]=f[1])}catch(h){a.error(h,t.range)}}else"category"===t.type&&(t.c2d=function(e){return t._categories[Math.round(e)]},t.d2c=function(e){null!==e&&void 0!==e&&-1===t._categories.indexOf(e)&&t._categories.push(e);var r=t._categories.indexOf(e);return-1===r?o.BADNUM:r},t.d2l=t.d2c);t.makeCalcdata=function(e,r){var n,i,a;if(r in e)for(n=e[r],i=new Array(n.length),a=0;an?"0":"1.0"}var r=this.framework,n=r.select("g.choroplethlayer"),i=r.select("g.scattergeolayer"),a=this.projection,o=this.path,s=this.clipAngle;r.selectAll("path.basepath").attr("d",o),r.selectAll("path.graticulepath").attr("d",o),n.selectAll("path.choroplethlocation").attr("d",o),n.selectAll("path.basepath").attr("d",o),i.selectAll("path.js-line").attr("d",o),null!==s?(i.selectAll("path.point").style("opacity",e).attr("transform",t),i.selectAll("text").style("opacity",e).attr("transform",t)):(i.selectAll("path.point").attr("transform",t),i.selectAll("text").attr("transform",t))}},{"../../components/color":303,"../../components/drawing":326,"../../constants/xmlns_namespaces":370,"../../lib/filter_visible":378,"../../lib/topojson_utils":396,"../../plots/cartesian/axes":405,"./constants":424,"./projections":432,"./set_scale":433,"./zoom":434,"./zoom_reset":435,d3:113,topojson:275}],426:[function(t,e,r){"use strict";var n=t("./geo"),i=t("../../plots/plots");r.name="geo",r.attr="geo",r.idRoot="geo",r.idRegex=/^geo([2-9]|[1-9][0-9]+)?$/,r.attrRegex=/^geo([2-9]|[1-9][0-9]+)?$/,r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){var e=t._fullLayout,r=t._fullData,a=i.getSubplotIds(e,"geo");void 0===window.PlotlyGeoAssets&&(window.PlotlyGeoAssets={topojson:{}});for(var o=0;o=n}function a(t,e){for(var r=e[0],n=e[1],i=!1,a=0,o=t.length,s=o-1;o>a;s=a++){var l=t[a],c=l[0],u=l[1],f=t[s],h=f[0],d=f[1];u>n^d>n&&(h-c)*(n-u)/(d-u)+c>r&&(i=!i)}return i}function o(t){return t?t/Math.sin(t):1}function s(t){return t>1?P:-1>t?-P:Math.asin(t)}function l(t){return t>1?0:-1>t?z:Math.acos(t)}function c(t,e){var r=(2+P)*Math.sin(e);e/=2;for(var n=0,i=1/0;10>n&&Math.abs(i)>S;n++){var a=Math.cos(e);e-=i=(e+Math.sin(e)*(a+2)-r)/(2*a*(1+a))}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 r(r,n){var i=j(r/e,n);return i[0]*=t,i}return arguments.length<2&&(e=t),1===e?j:e===1/0?h:(r.invert=function(r,n){var i=j.invert(r/t,n);return i[0]*=e,i},r)}function f(){var t=2,e=N(u),r=e(t);return r.coefficient=function(r){return arguments.length?e(t=+r):t},r}function h(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function d(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 r,n=t*Math.sin(e),i=30;do e-=r=(e+Math.sin(e)-n)/(1+Math.cos(e));while(Math.abs(r)>S&&--i>0);return e/2}}function v(t,e,r){function n(r,n){return[t*r*Math.cos(n=i(n)),e*Math.sin(n)]}var i=g(r);return n.invert=function(n,i){var a=s(i/e);return[n/(t*Math.cos(a)),s((2*a+Math.sin(2*a))/r)]},n}function m(t,e){var r=e*e,n=r*r;return[t*(.8707-.131979*r+n*(-.013791+n*(.003971*r-.001529*n))),e*(1.007226+r*(.015085+n*(-.044475+.028874*r-.005916*n)))]}function y(t,e){var r,n=Math.min(18,36*Math.abs(e)/z),i=Math.floor(n),a=n-i,o=(r=D[i])[0],s=r[1],l=(r=D[++i])[0],c=r[1],u=(r=D[Math.min(19,++i)])[0],f=r[1];return[t*(l+a*(u-o)/2+a*a*(u-2*l+o)/2),(e>0?P:-P)*(c+a*(f-s)/2+a*a*(f-2*c+s)/2)]}function b(t,e){return[t*Math.cos(e),e]}function x(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 _(t,e){var r=x(t,e);return[(r[0]+t/P)/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&&w.hasOwnProperty(t.type)?w[t.type]:r)(t,n)};var w={Feature:e,FeatureCollection:function(t,r){return{type:"FeatureCollection",features:t.features.map(function(t){return e(t,r)})}}},k=[],A=[],M={point:function(t,e){k.push([t,e])},result:function(){var t=k.length?k.length<2?{type:"Point",coordinates:k[0]}:{type:"MultiPoint",coordinates:k}:null;return k=[],t}},T={lineStart:n,point:function(t,e){k.push([t,e])},lineEnd:function(){k.length&&(A.push(k),k=[])},result:function(){var t=A.length?A.length<2?{type:"LineString",coordinates:A[0]}:{type:"MultiLineString",coordinates:A}:null;return A=[],t}},E={polygonStart:n,lineStart:n,point:function(t,e){k.push([t,e])},lineEnd:function(){var t=k.length;if(t){do k.push(k[0].slice());while(++t<4);A.push(k),k=[]}},polygonEnd:n,result:function(){if(!A.length)return null;var t=[],e=[];return A.forEach(function(r){i(r)?t.push([r]):e.push(r)}),e.forEach(function(e){var r=e[0];t.some(function(t){return a(t[0],r)?(t.push(e),!0):void 0})||t.push([e])}),A=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},L={Point:M,MultiPoint:M,LineString:T,MultiLineString:T,Polygon:E,MultiPolygon:E,Sphere:E},S=1e-6,C=S*S,z=Math.PI,P=z/2,R=(Math.sqrt(z),z/180),O=180/z,I=t.geo.projection,N=t.geo.projectionMutator;t.geo.interrupt=function(e){function r(t,r){for(var n=0>r?-1:1,i=l[+(0>r)],a=0,o=i.length-1;o>a&&t>i[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;i>n;++n){var o=l[0][n],s=180*o[0][0]/z,c=180*o[0][1]/z,u=180*o[1][1]/z,f=180*o[2][0]/z,h=180*o[2][1]/z;r.push(a([[s+e,c+e],[s+e,u-e],[f-e,u-e],[f-e,h+e]],30))}for(var n=l[1].length-1;n>=0;--n){var o=l[1][n],s=180*o[0][0]/z,c=180*o[0][1]/z,u=180*o[1][1]/z,f=180*o[2][0]/z,h=180*o[2][1]/z;r.push(a([[f-e,h-e],[f-e,u+e],[s+e,u+e],[s+e,c-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=[];++ac;++c)l.push([s[0]+c*n,s[1]+c*i]);s=r}return l.push(r),l}function o(t,e){return Math.abs(t[0]-e[0])n)],a=l[+(0>n)],c=0,u=i.length;u>c;++c){var f=i[c];if(f[0][0]<=t&&tS&&--i>0);return[t/(.8707+(a=n*n)*(-.131979+a*(-.013791+a*a*a*(.003971-.001529*a)))),n]},(t.geo.naturalEarth=function(){return I(m)}).raw=m;var D=[[.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]];D.forEach(function(t){t[1]*=1.0144}),y.invert=function(t,e){var r=e/P,n=90*r,i=Math.min(18,Math.abs(n/5)),a=Math.max(0,Math.floor(i));do{var o=D[a][1],s=D[a+1][1],l=D[Math.min(19,a+2)][1],c=l-o,u=l-2*s+o,f=2*(Math.abs(r)-s)/c,h=u/c,d=f*(1-h*f*(1-2*h*f));if(d>=0||1===a){n=(e>=0?5:-5)*(d+i);var p,g=50;do i=Math.min(18,Math.abs(n)/5),a=Math.floor(i),d=i-a,o=D[a][1],s=D[a+1][1],l=D[Math.min(19,a+2)][1],n-=(p=(e>=0?P:-P)*(s+d*(l-o)/2+d*d*(l-2*s+o)/2)-e)*O;while(Math.abs(p)>C&&--g>0);break}}while(--a>=0);var v=D[a][0],m=D[a+1][0],y=D[Math.min(19,a+2)][0];return[t/(m+d*(y-v)/2+d*d*(y-2*m+v)/2),n*R]},(t.geo.robinson=function(){return I(y)}).raw=y,b.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return I(b)}).raw=b,x.invert=function(t,e){if(!(t*t+4*e*e>z*z+S)){var r=t,n=e,i=25;do{var a,o=Math.sin(r),s=Math.sin(r/2),c=Math.cos(r/2),u=Math.sin(n),f=Math.cos(n),h=Math.sin(2*n),d=u*u,p=f*f,g=s*s,v=1-p*c*c,m=v?l(f*c)*Math.sqrt(a=1/v):a=0,y=2*m*f*s-t,b=m*u-e,x=a*(p*g+m*f*c*d),_=a*(.5*o*h-2*m*u*s),w=.25*a*(h*s-m*u*p*o),k=a*(d*c+m*g*f),A=_*w-k*x;if(!A)break;var M=(b*_-y*k)/A,T=(y*w-b*x)/A;r-=M,n-=T}while((Math.abs(M)>S||Math.abs(T)>S)&&--i>0);return[r,n]}},(t.geo.aitoff=function(){return I(x)}).raw=x,_.invert=function(t,e){var r=t,n=e,i=25;do{var a,o=Math.cos(n),s=Math.sin(n),c=Math.sin(2*n),u=s*s,f=o*o,h=Math.sin(r),d=Math.cos(r/2),p=Math.sin(r/2),g=p*p,v=1-f*d*d,m=v?l(o*d)*Math.sqrt(a=1/v):a=0,y=.5*(2*m*o*p+r/P)-t,b=.5*(m*s+n)-e,x=.5*a*(f*g+m*o*d*u)+.5/P,_=a*(h*c/4-m*s*p),w=.125*a*(c*p-m*s*f*h),k=.5*a*(u*d+m*g*o)+.5,A=_*w-k*x,M=(b*_-y*k)/A,T=(y*w-b*x)/A;r-=M,n-=T}while((Math.abs(M)>S||Math.abs(T)>S)&&--i>0);return[r,n]},(t.geo.winkel3=function(){return I(_)}).raw=_}e.exports=n},{}],433:[function(t,e,r){"use strict";function n(t,e){var r=t.projection,n=t.lonaxis,o=t.lataxis,l=t.domain,c=t.framewidth||0,u=e.w*(l.x[1]-l.x[0]),f=e.h*(l.y[1]-l.y[0]),h=n.range[0]+s,d=n.range[1]-s,p=o.range[0]+s,g=o.range[1]-s,v=n._fullRange[0]+s,m=n._fullRange[1]-s,y=o._fullRange[0]+s,b=o._fullRange[1]-s;r._translate0=[e.l+u/2,e.t+f/2];var x=d-h,_=g-p,w=[h+x/2,p+_/2],k=r._rotate;r._center=[w[0]+k[0],w[1]+k[1]];var A=function(e){function n(t){return Math.min(_*u/(t[1][0]-t[0][0]),_*f/(t[1][1]-t[0][1]))}var o,s,l,x,_=e.scale(),w=r._translate0,k=i(h,p,d,g),A=i(v,y,m,b);l=a(e,k),o=n(l),x=a(e,A),r._fullScale=n(x),e.scale(o),l=a(e,k),s=[w[0]-l[0][0]+c,w[1]-l[0][1]+c],r._translate=s,e.translate(s),l=a(e,k),t._isAlbersUsa||e.clipExtent(l),o=r.scale*o,r._scale=o,t._width=Math.round(l[1][0])+c,t._height=Math.round(l[1][1])+c,t._marginX=(u-Math.round(l[1][0]))/2,t._marginY=(f-Math.round(l[1][1]))/2};return A}function i(t,e,r,n){var i=(r-t)/4;return{type:"Polygon",coordinates:[[[t,e],[t,n],[t+i,n],[t+2*i,n],[t+3*i,n],[r,n],[r,e],[r-i,e],[r-2*i,e],[r-3*i,e],[t,e]]]}}function a(t,e){return o.geo.path().projection(t).bounds(e)}var o=t("d3"),s=t("./constants").clipPad;e.exports=n},{"./constants":424,d3:113}],434:[function(t,e,r){"use strict";function n(t,e){var r;return(r=e._isScoped?a:e._clipAngle?s:o)(t,e.projection)}function i(t,e){var r=e._fullScale;return _.behavior.zoom().translate(t.translate()).scale(t.scale()).scaleExtent([.5*r,100*r])}function a(t,e){function r(){_.select(this).style(A)}function n(){o.scale(_.event.scale).translate(_.event.translate),t.render()}function a(){_.select(this).style(M)}var o=t.projection,s=i(o,e);return s.on("zoomstart",r).on("zoom",n).on("zoomend",a),s}function o(t,e){function r(t){return v.invert(t)}function n(t){var e=v(r(t));return Math.abs(e[0]-t[0])>y||Math.abs(e[1]-t[1])>y}function a(){_.select(this).style(A),l=_.mouse(this),c=v.rotate(),u=v.translate(),f=c,h=r(l)}function o(){return d=_.mouse(this),n(l)?(m.scale(v.scale()),void m.translate(v.translate())):(v.scale(_.event.scale),v.translate([u[0],_.event.translate[1]]),h?r(d)&&(g=r(d),p=[f[0]+(g[0]-h[0]),c[1],c[2]],v.rotate(p),f=p):(l=d,h=r(l)),void t.render())}function s(){_.select(this).style(M)}var l,c,u,f,h,d,p,g,v=t.projection,m=i(v,e),y=2;return m.on("zoomstart",a).on("zoom",o).on("zoomend",s),m}function s(t,e){function r(t){m++||t({type:"zoomstart"})}function n(t){t({type:"zoom"})}function a(t){--m||t({type:"zoomend"})}var o,s=t.projection,d={r:s.rotate(),k:s.scale()},p=i(s,e),g=x(p,"zoomstart","zoom","zoomend"),m=0,y=p.on;return p.on("zoomstart",function(){_.select(this).style(A);var t=_.mouse(this),e=s.rotate(),i=e,a=s.translate(),m=c(e);o=l(s,t),y.call(p,"zoom",function(){var r=_.mouse(this);if(s.scale(d.k=_.event.scale),o){if(l(s,r)){s.rotate(e).translate(a);var c=l(s,r),p=f(o,c),y=v(u(m,p)),b=d.r=h(y,o,i);isFinite(b[0])&&isFinite(b[1])&&isFinite(b[2])||(b=i),s.rotate(b),i=b}}else t=r,o=l(s,t);n(g.of(this,arguments))}),r(g.of(this,arguments))}).on("zoomend",function(){_.select(this).style(M),y.call(p,"zoom",null),a(g.of(this,arguments))}).on("zoom.redraw",function(){t.render()}),_.rebind(p,g,"on")}function l(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&m(r)}function c(t){var e=.5*t[0]*w,r=.5*t[1]*w,n=.5*t[2]*w,i=Math.sin(e),a=Math.cos(e),o=Math.sin(r),s=Math.cos(r),l=Math.sin(n),c=Math.cos(n);return[a*s*c+i*o*l,i*s*c-a*o*l,a*o*c+i*s*l,a*s*l-i*o*c]}function u(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=e[0],s=e[1],l=e[2],c=e[3];return[r*o-n*s-i*l-a*c,r*s+n*o+i*c-a*l,r*l-n*c+i*o+a*s,r*c+n*l-i*s+a*o]}function f(t,e){if(t&&e){var r=b(t,e),n=Math.sqrt(y(r,r)),i=.5*Math.acos(Math.max(-1,Math.min(1,y(t,e)))),a=Math.sin(i)/n;return n&&[Math.cos(i),r[2]*a,-r[1]*a,r[0]*a]}}function h(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],c=n[0],u=n[1],f=n[2],h=Math.atan2(s,o)*k,p=Math.sqrt(o*o+s*s);Math.abs(u)>p?(a=(u>0?90:-90)-h,i=0):(a=Math.asin(u/p)*k-h,i=Math.sqrt(p*p-u*u));var v=180-a-2*h,m=(Math.atan2(f,c)-Math.atan2(l,i))*k,y=(Math.atan2(f,c)-Math.atan2(l,-i))*k,b=d(r[0],r[1],a,m),x=d(r[0],r[1],v,y);return x>=b?[a,m,r[2]]:[v,y,r[2]]}function d(t,e,r,n){var i=p(r-t),a=p(n-e);return Math.sqrt(i*i+a*a)}function p(t){return(t%360+540)%360-180}function g(t,e,r){var n=r*w,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]))*k,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*k,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*k]}function m(t){var e=t[0]*w,r=t[1]*w,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function y(t,e){for(var r=0,n=0,i=t.length;i>n;++n)r+=t[n]*e[n];return r}function b(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function x(t){for(var e=0,r=arguments.length,n=[];++ed;++d){for(e=c[d],r=t[this.scene[e]._name],n=/Click to enter .+ title/.test(r.title)?"":r.title,p=0;2>=p;p+=2)this.labelEnable[d+p]=!1,this.labels[d+p]=o(n),this.labelColor[d+p]=s(r.titlefont.color),this.labelFont[d+p]=r.titlefont.family,this.labelSize[d+p]=r.titlefont.size,this.labelPad[d+p]=this.getLabelPad(e,r),this.tickEnable[d+p]=!1,this.tickColor[d+p]=s((r.tickfont||{}).color),this.tickAngle[d+p]="auto"===r.tickangle?0:Math.PI*-r.tickangle/180,this.tickPad[d+p]=this.getTickPad(r),this.tickMarkLength[d+p]=0,this.tickMarkWidth[d+p]=r.tickwidth||0,this.tickMarkColor[d+p]=s(r.tickcolor),this.borderLineEnable[d+p]=!1,this.borderLineColor[d+p]=s(r.linecolor),this.borderLineWidth[d+p]=r.linewidth||0;u=this.hasSharedAxis(r),a=this.hasAxisInDfltPos(e,r)&&!u,l=this.hasAxisInAltrPos(e,r)&&!u,i=r.mirror||!1,f=u?-1!==String(i).indexOf("all"):!!i,h=u?"allticks"===i:-1!==String(i).indexOf("ticks"),a?this.labelEnable[d]=!0:l&&(this.labelEnable[d+2]=!0),a?this.tickEnable[d]=r.showticklabels:l&&(this.tickEnable[d+2]=r.showticklabels),(a||f)&&(this.borderLineEnable[d]=r.showline),(l||f)&&(this.borderLineEnable[d+2]=r.showline),(a||h)&&(this.tickMarkLength[d]=this.getTickMarkLength(r)),(l||h)&&(this.tickMarkLength[d+2]=this.getTickMarkLength(r)),this.gridLineEnable[d]=r.showgrid,this.gridLineColor[d]=s(r.gridcolor),this.gridLineWidth[d]=r.gridwidth,this.zeroLineEnable[d]=r.zeroline,this.zeroLineColor[d]=s(r.zerolinecolor),this.zeroLineWidth[d]=r.zerolinewidth}},l.hasSharedAxis=function(t){var e=this.scene,r=a.Plots.getSubplotIds(e.fullLayout,"gl2d"),n=a.Axes.findSubplotsWithAxis(r,t);return 0!==n.indexOf(e.id)},l.hasAxisInDfltPos=function(t,e){var r=e.side;return"xaxis"===t?"bottom"===r:"yaxis"===t?"left"===r:void 0},l.hasAxisInAltrPos=function(t,e){var r=e.side;return"xaxis"===t?"top"===r:"yaxis"===t?"right"===r:void 0},l.getLabelPad=function(t,e){var r=1.5,n=e.titlefont.size,i=e.showticklabels;return"xaxis"===t?"top"===e.side?-10+n*(r+(i?1:0)):-10+n*(r+(i?.5:0)):"yaxis"===t?"right"===e.side?10+n*(r+(i?1:.5)):10+n*(r+(i?.5:0)):void 0},l.getTickPad=function(t){return"outside"===t.ticks?10+t.ticklen:15},l.getTickMarkLength=function(t){if(!t.ticks)return 0;var e=t.ticklen;return"inside"===t.ticks?-e:e},e.exports=i},{"../../lib/html2unicode":381,"../../lib/str2rgbarray":394,"../../plotly":402}],438:[function(t,e,r){"use strict";var n=t("./scene2d"),i=t("../plots"),a=t("../../constants/xmlns_namespaces");r.name="gl2d",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex={x:/^x([2-9]|[1-9][0-9]+)?$/,y:/^y([2-9]|[1-9][0-9]+)?$/},r.attrRegex={x:/^xaxis([2-9]|[1-9][0-9]+)?$/,y:/^yaxis([2-9]|[1-9][0-9]+)?$/},r.attributes=t("../cartesian/attributes"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,a=i.getSubplotIds(e,"gl2d"),o=0;or;++r){var n=t[r],i=e[r];if(n.length!==i.length)return!0;for(var a=0;ao;++o,--s)for(var l=0;r>l;++l)for(var c=0;4>c;++c){var u=i[4*(r*o+l)+c];i[4*(r*o+l)+c]=i[4*(r*s+l)+c],i[4*(r*s+l)+c]=u}var f=document.createElement("canvas");f.width=r,f.height=n;var h=f.getContext("2d"),d=h.createImageData(r,n);d.data.set(i),h.putImageData(d,0,0);var p;switch(t){case"jpeg":p=f.toDataURL("image/jpeg");break;case"webp":p=f.toDataURL("image/webp");break;default:p=f.toDataURL("image/png")}return this.staticPlot&&this.container.removeChild(a),p},m.computeTickMarks=function(){this.xaxis._length=this.glplot.viewBox[2]-this.glplot.viewBox[0],this.yaxis._length=this.glplot.viewBox[3]-this.glplot.viewBox[1];for(var t=[s.calcTicks(this.xaxis),s.calcTicks(this.yaxis)],e=0;2>e;++e)for(var r=0;rk;++k)w[k]=Math.min(w[k],a.bounds[k]),w[k+2]=Math.max(w[k+2],a.bounds[k+2])}var A;for(n=0;2>n;++n)w[n]>w[n+2]&&(w[n]=-1,w[n+2]=1),A=this[v[n]],A._length=y.viewBox[n+2]-y.viewBox[n],s.doAutoRange(A);y.ticks=this.computeTickMarks();var M=this.xaxis.range,T=this.yaxis.range;y.dataBox=[M[0],T[0],M[1],T[1]],y.merge(r),o.update(y),this.glplot.draw()},m.draw=function(){if(!this.stopped){requestAnimationFrame(this.redraw);var t=this.glplot,e=this.camera,r=e.mouseListener,n=this.fullLayout;this.cameraChanged();var i=r.x*t.pixelRatio,a=this.canvas.height-t.pixelRatio*r.y;if(e.boxEnabled&&"zoom"===n.dragmode)this.selectBox.enabled=!0,this.selectBox.selectBox=[Math.min(e.boxStart[0],e.boxEnd[0]),Math.min(e.boxStart[1],e.boxEnd[1]),Math.max(e.boxStart[0],e.boxEnd[0]),Math.max(e.boxStart[1],e.boxEnd[1])],t.setDirty();else{this.selectBox.enabled=!1;var o=n._size,s=this.xaxis.domain,c=this.yaxis.domain,u=t.pick(i/t.pixelRatio+o.l+s[0]*o.w,a/t.pixelRatio-(o.t+(1-c[1])*o.h));if(u&&n.hovermode){var f=u.object._trace.handlePick(u);if(f&&(!this.lastPickResult||this.lastPickResult.trace!==f.trace||this.lastPickResult.dataCoord[0]!==f.dataCoord[0]||this.lastPickResult.dataCoord[1]!==f.dataCoord[1])){var h=this.lastPickResult=f;this.spikes.update({center:u.dataCoord}),h.screenCoord=[((t.viewBox[2]-t.viewBox[0])*(u.dataCoord[0]-t.dataBox[0])/(t.dataBox[2]-t.dataBox[0])+t.viewBox[0])/t.pixelRatio,(this.canvas.height-(t.viewBox[3]-t.viewBox[1])*(u.dataCoord[1]-t.dataBox[1])/(t.dataBox[3]-t.dataBox[1])-t.viewBox[1])/t.pixelRatio];var d=h.hoverinfo;if("all"!==d){var p=d.split("+");-1===p.indexOf("x")&&(h.traceCoord[0]=void 0),-1===p.indexOf("y")&&(h.traceCoord[1]=void 0),-1===p.indexOf("z")&&(h.traceCoord[2]=void 0),-1===p.indexOf("text")&&(h.textLabel=void 0),-1===p.indexOf("name")&&(h.name=void 0)}l.loneHover({x:h.screenCoord[0],y:h.screenCoord[1],xLabel:this.hoverFormatter("xaxis",h.traceCoord[0]),yLabel:this.hoverFormatter("yaxis",h.traceCoord[1]),zLabel:h.traceCoord[2],text:h.textLabel,name:h.name,color:h.color},{container:this.svgContainer}),this.lastPickResult={dataCoord:u.dataCoord}}}else!u&&this.lastPickResult&&(this.spikes.update({}),this.lastPickResult=null,l.loneUnhover(this.svgContainer))}t.draw()}},m.hoverFormatter=function(t,e){if(void 0!==e){var r=this[t];return s.tickText(r,r.c2l(e),"hover").text}}},{"../../lib/html2unicode":381,"../../lib/show_no_webgl_msg":392,"../../plots/cartesian/axes":405,"../../plots/cartesian/graph_interact":412,"./camera":436,"./convert":437,"gl-plot2d":165,"gl-select-box":195,"gl-spikes2d":215}],440:[function(t,e,r){"use strict";function n(t,e){t=t||document.body,e=e||{};var r=[.01,1/0];"distanceLimits"in e&&(r[0]=e.distanceLimits[0],r[1]=e.distanceLimits[1]),"zoomMin"in e&&(r[0]=e.zoomMin),"zoomMax"in e&&(r[1]=e.zoomMax);var n=a({center:e.center||[0,0,0],up:e.up||[0,1,0],eye:e.eye||[0,0,10],mode:e.mode||"orbit",distanceLimits:r}),l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],c=0,u=t.clientWidth,f=t.clientHeight,h={keyBindingMode:"rotate",view:n,element:t,delay:e.delay||16,rotateSpeed:e.rotateSpeed||1,zoomSpeed:e.zoomSpeed||1,translateSpeed:e.translateSpeed||1,flipX:!!e.flipX,flipY:!!e.flipY,modes:n.modes,tick:function(){var e=i(),r=this.delay,a=e-2*r;n.idle(e-r),n.recalcMatrix(a),n.flush(e-(100+2*r));for(var o=!0,s=n.computedMatrix,h=0;16>h;++h)o=o&&l[h]===s[h],l[h]=s[h];var d=t.clientWidth===u&&t.clientHeight===f;return u=t.clientWidth,f=t.clientHeight,o?!d:(c=Math.exp(n.computedRadius[0]),!0)},lookAt:function(t,e,r){n.lookAt(n.lastT(),t,e,r)},rotate:function(t,e,r){n.rotate(n.lastT(),t,e,r)},pan:function(t,e,r){n.pan(n.lastT(),t,e,r)},translate:function(t,e,r){n.translate(n.lastT(),t,e,r)}};Object.defineProperties(h,{matrix:{get:function(){return n.computedMatrix},set:function(t){return n.setMatrix(n.lastT(),t),n.computedMatrix},enumerable:!0},mode:{get:function(){return n.getMode()},set:function(t){var e=n.computedUp.slice(),r=n.computedEye.slice(),a=n.computedCenter.slice();if(n.setMode(t),"turntable"===t){var o=i();n._active.lookAt(o,r,a,e),n._active.lookAt(o+500,r,a,[0,0,1]),n._active.flush(o)}return n.getMode()},enumerable:!0},center:{get:function(){return n.computedCenter},set:function(t){return n.lookAt(n.lastT(),null,t),n.computedCenter},enumerable:!0},eye:{get:function(){return n.computedEye},set:function(t){return n.lookAt(n.lastT(),t),n.computedEye},enumerable:!0},up:{get:function(){return n.computedUp},set:function(t){return n.lookAt(n.lastT(),null,null,t),n.computedUp},enumerable:!0},distance:{get:function(){return c},set:function(t){return n.setDistance(n.lastT(),t),t},enumerable:!0},distanceLimits:{get:function(){return n.getDistanceLimits(r)},set:function(t){return n.setDistanceLimits(t),t},enumerable:!0}}),t.addEventListener("contextmenu",function(t){return t.preventDefault(),!1});var d=0,p=0;return o(t,function(e,r,a,o){var s="rotate"===h.keyBindingMode,l="pan"===h.keyBindingMode,u="zoom"===h.keyBindingMode,f=!!o.control,g=!!o.alt,v=!!o.shift,m=!!(1&e),y=!!(2&e),b=!!(4&e),x=1/t.clientHeight,_=x*(r-d),w=x*(a-p),k=h.flipX?1:-1,A=h.flipY?1:-1,M=i(),T=Math.PI*h.rotateSpeed;if((s&&m&&!f&&!g&&!v||m&&!f&&!g&&v)&&n.rotate(M,k*T*_,-A*T*w,0),(l&&m&&!f&&!g&&!v||y||m&&f&&!g&&!v)&&n.pan(M,-h.translateSpeed*_*c,h.translateSpeed*w*c,0),u&&m&&!f&&!g&&!v||b||m&&!f&&g&&!v){var E=-h.zoomSpeed*w/window.innerHeight*(M-n.lastT())*100;n.pan(M,0,0,c*(Math.exp(E)-1))}return d=r,p=a,!0}),s(t,function(t,e){var r=h.flipX?1:-1,a=h.flipY?1:-1,o=i();if(Math.abs(t)>Math.abs(e))n.rotate(o,0,0,-t*r*Math.PI*h.rotateSpeed/window.innerWidth);else{var s=-h.zoomSpeed*a*e/window.innerHeight*(o-n.lastT())/100;n.pan(o,0,0,c*(Math.exp(s)-1))}},!0),h}e.exports=n;var i=t("right-now"),a=t("3d-view"),o=t("mouse-change"),s=t("mouse-wheel")},{"3d-view":39,"mouse-change":241,"mouse-wheel":245,"right-now":255}],441:[function(t,e,r){"use strict";function n(t,e){for(var r=0;3>r;++r){var n=s[r];e[n]._gd=t}}var i=t("./scene"),a=t("../plots"),o=t("../../constants/xmlns_namespaces"),s=["xaxis","yaxis","zaxis"];r.name="gl3d",r.attr="scene",r.idRoot="scene",r.idRegex=/^scene([2-9]|[1-9][0-9]+)?$/,r.attrRegex=/^scene([2-9]|[1-9][0-9]+)?$/,r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){var e=t._fullLayout,r=t._fullData,o=a.getSubplotIds(e,"gl3d");e._paperdiv.style({width:e.width+"px",height:e.height+"px"}),t._context.setBackground(t,e.paper_bgcolor);for(var s=0;sr;++r){var n=t[c[r]];e.labels[r]=o(n.title),"titlefont"in n&&(n.titlefont.color&&(e.labelColor[r]=s(n.titlefont.color)),n.titlefont.family&&(e.labelFont[r]=n.titlefont.family),n.titlefont.size&&(e.labelSize[r]=n.titlefont.size)),"showline"in n&&(e.lineEnable[r]=n.showline),"linecolor"in n&&(e.lineColor[r]=s(n.linecolor)),"linewidth"in n&&(e.lineWidth[r]=n.linewidth),"showgrid"in n&&(e.gridEnable[r]=n.showgrid),"gridcolor"in n&&(e.gridColor[r]=s(n.gridcolor)),"gridwidth"in n&&(e.gridWidth[r]=n.gridwidth), -"log"===n.type?e.zeroEnable[r]=!1:"zeroline"in n&&(e.zeroEnable[r]=n.zeroline),"zerolinecolor"in n&&(e.zeroLineColor[r]=s(n.zerolinecolor)),"zerolinewidth"in n&&(e.zeroLineWidth[r]=n.zerolinewidth),"ticks"in n&&n.ticks?e.lineTickEnable[r]=!0:e.lineTickEnable[r]=!1,"ticklen"in n&&(e.lineTickLength[r]=e._defaultLineTickLength[r]=n.ticklen),"tickcolor"in n&&(e.lineTickColor[r]=s(n.tickcolor)),"tickwidth"in n&&(e.lineTickWidth[r]=n.tickwidth),"tickangle"in n&&(e.tickAngle[r]="auto"===n.tickangle?0:Math.PI*-n.tickangle/180),"showticklabels"in n&&(e.tickEnable[r]=n.showticklabels),"tickfont"in n&&(n.tickfont.color&&(e.tickColor[r]=s(n.tickfont.color)),n.tickfont.family&&(e.tickFont[r]=n.tickfont.family),n.tickfont.size&&(e.tickSize[r]=n.tickfont.size)),"mirror"in n?-1!==["ticks","all","allticks"].indexOf(n.mirror)?(e.lineTickMirror[r]=!0,e.lineMirror[r]=!0):n.mirror===!0?(e.lineTickMirror[r]=!1,e.lineMirror[r]=!0):(e.lineTickMirror[r]=!1,e.lineMirror[r]=!1):e.lineMirror[r]=!1,"showbackground"in n&&n.showbackground!==!1?(e.backgroundEnable[r]=!0,e.backgroundColor[r]=s(n.backgroundcolor)):e.backgroundEnable[r]=!1}},e.exports=i},{"../../../lib/html2unicode":381,"../../../lib/str2rgbarray":394,arraytools:49}],446:[function(t,e,r){"use strict";function n(t,e,r,n){for(var a=r("bgcolor"),l=i.combine(a,n.paper_bgcolor),c=Object.keys(o.camera),u=0;ue;++e){var r=t[o[e]];this.enabled[e]=r.showspikes,this.colors[e]=a(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness}},e.exports=i},{"../../../lib/str2rgbarray":394}],449:[function(t,e,r){"use strict";function n(t){for(var e=new Array(3),r=0;3>r;++r){for(var n=t[r],i=new Array(n.length),a=0;au;++u){var f=i[s[u]];if(f._length=(r[u].hi-r[u].lo)*r[u].pixelsPerDataUnit/t.dataScale[u],Math.abs(f._length)===1/0)c[u]=[];else{f.range[0]=r[u].lo/t.dataScale[u],f.range[1]=r[u].hi/t.dataScale[u],f._m=1/(t.dataScale[u]*r[u].pixelsPerDataUnit),f.range[0]===f.range[1]&&(f.range[0]-=1,f.range[1]+=1);var h=f.tickmode;if("auto"===f.tickmode){f.tickmode="linear";var d=f.nticks||a.Lib.constrain(f._length/40,4,9);a.Axes.autoTicks(f,Math.abs(f.range[1]-f.range[0])/d)}for(var p=a.Axes.calcTicks(f),g=0;gu;++u){l[u]=.5*(t.glplot.bounds[0][u]+t.glplot.bounds[1][u]);for(var g=0;2>g;++g)e.bounds[g][u]=t.glplot.bounds[g][u]}t.contourLevels=n(c)}e.exports=i;var a=t("../../../plotly"),o=t("../../../lib/html2unicode"),s=["xaxis","yaxis","zaxis"],l=[0,0,0]},{"../../../lib/html2unicode":381,"../../../plotly":402}],450:[function(t,e,r){"use strict";function n(t,e){var r,n,i=[0,0,0,0];for(r=0;4>r;++r)for(n=0;4>n;++n)i[n]+=t[4*r+n]*e[r];return i}function i(t,e){var r=n(t.projection,n(t.view,n(t.model,[e[0],e[1],e[2],1])));return r}e.exports=i},{}],451:[function(t,e,r){"use strict";function n(t){function e(e,r){if("string"==typeof r)return r;var n=t.fullSceneLayout[e];return g.tickText(n,n.c2l(r),"hover").text}var r,n=t.svgContainer,i=t.container.getBoundingClientRect(),a=i.width,o=i.height;n.setAttributeNS(null,"viewBox","0 0 "+a+" "+o),n.setAttributeNS(null,"width",a),n.setAttributeNS(null,"height",o),A(t),t.glplot.axes.update(t.axesOptions);for(var s=Object.keys(t.traces),l=null,c=t.glplot.selection,u=0;ua;++a)l=u[T[a]],_(l);t?Array.isArray(t)||(t=[t]):t=[];var h=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]];for(a=0;ao;++o)h[0][o]>h[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,a=0;aa;++a){if(l=u[T[a]],c=l.type,c in x?(x[c].acc*=d[a],x[c].count+=1):x[c]={acc:d[a],count:1},l.autorange){for(y[0][a]=1/0,y[1][a]=-(1/0),o=0;oy[1][a])y[0][a]=-1,y[1][a]=1;else{var k=y[1][a]-y[0][a];y[0][a]-=k/32,y[1][a]+=k/32}}else{var A=u[T[a]].range;y[0][a]=A[0],y[1][a]=A[1]}y[0][a]===y[1][a]&&(y[0][a]-=1,y[1][a]+=1),b[a]=y[1][a]-y[0][a],this.glplot.bounds[0][a]=y[0][a]*d[a],this.glplot.bounds[1][a]=y[1][a]*d[a]}var M=[1,1,1];for(a=0;3>a;++a){l=u[T[a]],c=l.type;var E=x[c];M[a]=Math.pow(E.acc,1/E.count)/d[a]}var L,S=4;if("auto"===u.aspectmode)L=Math.max.apply(null,M)/Math.min.apply(null,M)<=S?M:[1,1,1];else if("cube"===u.aspectmode)L=[1,1,1];else if("data"===u.aspectmode)L=M;else{if("manual"!==u.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var C=u.aspectratio;L=[C.x,C.y,C.z]}u.aspectratio.x=f.aspectratio.x=L[0],u.aspectratio.y=f.aspectratio.y=L[1],u.aspectratio.z=f.aspectratio.z=L[2],this.glplot.aspect=L;var z=u.domain||null,P=e._size||null;if(z&&P){var R=this.container.style;R.position="absolute",R.left=P.l+z.x[0]*P.w+"px",R.top=P.t+(1-z.y[1])*P.h+"px",R.width=P.w*(z.x[1]-z.x[0])+"px",R.height=P.h*(z.y[1]-z.y[0])+"px"}this.glplot.redraw()}},M.destroy=function(){this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null},M.setCameraToDefault=function(){this.setCamera({eye:{x:1.25,y:1.25,z:1.25},center:{x:0,y:0,z:0},up:{x:0,y:0,z:1}})},M.getCamera=function(){return this.glplot.camera.view.recalcMatrix(this.camera.view.lastT()),c(this.glplot.camera)},M.setCamera=function(t){var e={};e[this.id]=t,this.glplot.camera.lookAt.apply(this,l(t)),this.graphDiv.emit("plotly_relayout",e)},M.saveCamera=function(t){function e(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]]}var r=this.getCamera(),n=d.nestedProperty(t,this.id+".camera"),i=n.get(),a=!1;if(void 0===i)a=!0;else for(var o=0;3>o;o++)for(var s=0;3>s;s++)if(!e(r,i,o,s)){a=!0;break}return a&&n.set(r),a},M.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},M.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(u),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;o>a;++a,--o)for(var s=0;r>s;++s)for(var l=0;4>l;++l){var c=i[4*(r*a+s)+l];i[4*(r*a+s)+l]=i[4*(r*o+s)+l],i[4*(r*o+s)+l]=c}var f=document.createElement("canvas");f.width=r,f.height=n;var h=f.getContext("2d"),d=h.createImageData(r,n);d.data.set(i),h.putImageData(d,0,0);var p;switch(t){case"jpeg":p=f.toDataURL("image/jpeg");break;case"webp":p=f.toDataURL("image/webp");break;default:p=f.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(u),p},e.exports=a},{"../../lib":382,"../../lib/show_no_webgl_msg":392,"../../lib/str2rgbarray":394,"../../plots/cartesian/axes":405,"../../plots/cartesian/graph_interact":412,"../../plots/plots":454,"./camera":440,"./layout/convert":445,"./layout/spikes":448,"./layout/tick_marks":449,"./project":450,"./set_convert":452,"gl-plot3d":183}],452:[function(t,e,r){"use strict";var n=t("../cartesian/axes"),i=function(){};e.exports=function(t){n.setConvert(t),t.setScale=i}},{"../cartesian/axes":405}],453:[function(t,e,r){"use strict";var n=t("../plotly"),i=t("./font_attributes"),a=t("../components/color/attributes"),o=n.Lib.extendFlat;e.exports={font:{family:o({},i.family,{dflt:'"Open Sans", verdana, arial, sans-serif'}),size:o({},i.size,{dflt:12}),color:o({},i.color,{dflt:a.defaultLine})},title:{valType:"string",dflt:"Click to enter Plot title"},titlefont:o({},i,{}),autosize:{valType:"enumerated",values:[!0,!1,"initial"]},width:{valType:"number",min:10,dflt:700},height:{valType:"number",min:10,dflt:450},margin:{l:{valType:"number",min:0,dflt:80},r:{valType:"number",min:0,dflt:80},t:{valType:"number",min:0,dflt:100},b:{valType:"number",min:0,dflt:80},pad:{valType:"number",min:0,dflt:0},autoexpand:{valType:"boolean",dflt:!0}},paper_bgcolor:{valType:"color",dflt:a.background},plot_bgcolor:{valType:"color",dflt:a.background},separators:{valType:"string",dflt:".,"},hidesources:{valType:"boolean",dflt:!1},smith:{valType:"enumerated",values:[!1],dflt:!1},showlegend:{valType:"boolean"},_composedModules:{"*":"Fx"},_nestedModules:{xaxis:"Axes",yaxis:"Axes",scene:"gl3d",geo:"geo",legend:"Legend",annotations:"Annotations",shapes:"Shapes",images:"Images",ternary:"ternary",mapbox:"mapbox"}}},{"../components/color/attributes":302,"../plotly":402,"./font_attributes":423}],454:[function(t,e,r){"use strict";function n(t){return"object"==typeof t&&(t=t.type),t}function i(t,e){e.text("");var r=e.append("a").attr({"xlink:xlink:href":"#","class":"link--impt link--embedview","font-weight":"bold"}).text(t._context.linkText+" "+String.fromCharCode(187));if(t._context.sendData)r.on("click",function(){f.sendDataToCloud(t)});else{var n=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}function a(t,e){for(var r,n=Object.keys(e),i=0;i=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 s=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&&i(t,s),l.text(s.text()&&c.text()?" - ":"")},f.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=o.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"}),i=n.append("input").attr({type:"text",name:"data"});return i.node().value=f.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},f.supplyDefaults=function(t){var e,r,n=t._fullLayout||{},i=t._fullLayout={},o=t.layout||{},s=t._fullData||[],u=t._fullData=[],h=t.data||[],d=i._modules=[],p=i._basePlotModules=[];for(f.supplyLayoutGlobalDefaults(o,i),i._dataLength=h.length,e=0;ea&&(e=(r-1)/(i.l+i.r),i.l=Math.floor(e*i.l),i.r=Math.floor(e*i.r)),0>o&&(e=(n-1)/(i.t+i.b),i.t=Math.floor(e*i.t),i.b=Math.floor(e*i.b))}},f.autoMargin=function(t,e,r){var n=t._fullLayout;if(n._pushmargin||(n._pushmargin={}),n.margin.autoexpand!==!1){if(r){var i=void 0===r.pad?12:r.pad;r.l+r.r>.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];t._replotting||f.doAutoMargin(t)}},f.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),c=Math.max(e.margin.b||0,0),u=e._pushmargin;return e.margin.autoexpand!==!1&&(u.base={l:{val:0,size:i},r:{val:1,size:a},t:{val:1,size:o},b:{val:0,size:c}},Object.keys(u).forEach(function(t){var r=u[t].l||{},n=u[t].b||{},l=r.val,f=r.size,h=n.val,d=n.size;Object.keys(u).forEach(function(t){if(s(f)&&u[t].r){var r=u[t].r.val,n=u[t].r.size;if(r>l){var p=(f*r+(n-e.width)*l)/(r-l),g=(n*(1-l)+(f-e.width)*(1-r))/(r-l);p>=0&&g>=0&&p+g>i+a&&(i=p,a=g)}}if(s(d)&&u[t].t){var v=u[t].t.val,m=u[t].t.size;if(v>h){var y=(d*v+(m-e.height)*h)/(v-h),b=(m*(1-h)+(d-e.height)*(1-v))/(v-h);y>=0&&b>=0&&y+b>c+o&&(c=y,o=b)}}})})),r.l=Math.round(i),r.r=Math.round(a),r.t=Math.round(o),r.b=Math.round(c),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,t._replotting||"{}"===n||n===JSON.stringify(e._size)?void 0:l.plot(t)},f.graphJson=function(t,e,r,n,i){function a(t){if("function"==typeof t)return null;if(c.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(n=t[e+"src"],"string"==typeof n&&n.indexOf(":")>0&&!c.isPlainObject(t.stream))continue}else if("keepall"!==r&&(n=t[e+"src"],"string"==typeof n&&n.indexOf(":")>0))continue;i[e]=a(t[e])}return i}return Array.isArray(t)?t.map(a):t&&t.getTime?c.ms2DateTime(t):t}(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&f.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l={data:(o||[]).map(function(t){var r=a(t);return e&&delete r.fit,r})};return e||(l.layout=a(s)),t.framework&&t.framework.isPolar&&(l=t.framework.getConfig()),"object"===n?l:JSON.stringify(l)}},{"../components/color":303,"../lib":382,"../plotly":402,"./attributes":403,"./font_attributes":423,"./layout_attributes":453,d3:113,"fast-isnumeric":117}],455:[function(t,e,r){"use strict";var n=t("../../traces/scatter/attributes"),i=n.marker;e.exports={r:n.r,t:n.t,marker:{color:i.color,size:i.size,symbol:i.symbol,opacity:i.opacity}}},{"../../traces/scatter/attributes":556}],456:[function(t,e,r){"use strict";function n(t,e){var r={showline:{valType:"boolean"},showticklabels:{valType:"boolean"},tickorientation:{valType:"enumerated",values:["horizontal","vertical"]},ticklen:{valType:"number",min:0},tickcolor:{valType:"color"},ticksuffix:{valType:"string"},endpadding:{valType:"number"},visible:{valType:"boolean"}};return a({},e,r)}var i=t("../cartesian/layout_attributes"),a=t("../../lib/extend").extendFlat,o=a({},i.domain,{});e.exports={radialaxis:n("radial",{range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},domain:o,orientation:{valType:"number"}}),angularaxis:n("angular",{range:{valType:"info_array",items:[{valType:"number",dflt:0},{valType:"number",dflt:360}]},domain:o}),layout:{direction:{valType:"enumerated",values:["clockwise","counterclockwise"]},orientation:{valType:"angle"}}}},{"../../lib/extend":377,"../cartesian/layout_attributes":414}],457:[function(t,e,r){var n=t("../../plotly"),i=t("d3"),a=e.exports={version:"0.2.2",manager:t("./micropolar_manager")},o=n.Lib.extendDeepAll;a.Axis=function(){function t(t){r=t||r;var c=l.data,f=l.layout;return("string"==typeof r||r.nodeName)&&(r=i.select(r)),r.datum(c).each(function(t,r){function l(t,e){return s(t)%360+f.orientation}var c=t.slice();u={data:a.util.cloneJson(c),layout:a.util.cloneJson(f)};var h=0;c.forEach(function(t,e){t.color||(t.color=f.defaultColorRange[h],h=(h+1)%f.defaultColorRange.length),t.strokeColor||(t.strokeColor="LinePlot"===t.geometry?t.color:i.rgb(t.color).darker().toString()),u.data[e].color=t.color,u.data[e].strokeColor=t.strokeColor,u.data[e].strokeDash=t.strokeDash,u.data[e].strokeSize=t.strokeSize});var d=c.filter(function(t,e){var r=t.visible;return"undefined"==typeof r||r===!0}),p=!1,g=d.map(function(t,e){return p=p||"undefined"!=typeof t.groupId,t});if(p){var v=i.nest().key(function(t,e){return"undefined"!=typeof t.groupId?t.groupId:"unstacked"}).entries(g),m=[],y=v.map(function(t,e){if("unstacked"===t.key)return t.values;var r=t.values[0].r.map(function(t,e){return 0});return t.values.forEach(function(t,e,n){t.yStack=[r],m.push(r),r=a.util.sumArrays(t.r,r)}),t.values});d=i.merge(y)}d.forEach(function(t,e){t.t=Array.isArray(t.t[0])?t.t:[t.t],t.r=Array.isArray(t.r[0])?t.r:[t.r]});var b=Math.min(f.width-f.margin.left-f.margin.right,f.height-f.margin.top-f.margin.bottom)/2;b=Math.max(10,b);var x,_=[f.margin.left+b,f.margin.top+b];if(p){var w=i.max(a.util.sumArrays(a.util.arrayLast(d).r[0],a.util.arrayLast(m)));x=[0,w]}else x=i.extent(a.util.flattenArray(d.map(function(t,e){return t.r})));f.radialAxis.domain!=a.DATAEXTENT&&(x[0]=0),n=i.scale.linear().domain(f.radialAxis.domain!=a.DATAEXTENT&&f.radialAxis.domain?f.radialAxis.domain:x).range([0,b]),u.layout.radialAxis.domain=n.domain();var k,A=a.util.flattenArray(d.map(function(t,e){return t.t})),M="string"==typeof A[0];M&&(A=a.util.deduplicate(A),k=A.slice(),A=i.range(A.length),d=d.map(function(t,e){var r=t;return t.t=[A],p&&(r.yStack=t.yStack),r}));var T=d.filter(function(t,e){return"LinePlot"===t.geometry||"DotPlot"===t.geometry}).length===d.length,E=null===f.needsEndSpacing?M||!T:f.needsEndSpacing,L=f.angularAxis.domain&&f.angularAxis.domain!=a.DATAEXTENT&&!M&&f.angularAxis.domain[0]>=0,S=L?f.angularAxis.domain:i.extent(A),C=Math.abs(A[1]-A[0]);T&&!M&&(C=0);var z=S.slice();E&&M&&(z[1]+=C);var P=f.angularAxis.ticksCount||4;P>8&&(P=P/(P/8)+P%8),f.angularAxis.ticksStep&&(P=(z[1]-z[0])/P);var R=f.angularAxis.ticksStep||(z[1]-z[0])/(P*(f.minorTicks+1));k&&(R=Math.max(Math.round(R),1)),z[2]||(z[2]=R);var O=i.range.apply(this,z);if(O=O.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=i.scale.linear().domain(z.slice(0,2)).range("clockwise"===f.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=s.domain(),u.layout.angularAxis.endPadding=E?C:0,e=i.select(this).select("svg.chart-root"),"undefined"==typeof e||e.empty()){var I="' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '",N=(new DOMParser).parseFromString(I,"application/xml"),j=this.appendChild(this.ownerDocument.importNode(N.documentElement,!0)); -e=i.select(j)}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,D=e.select(".chart-group"),B={fill:"none",stroke:f.tickColor},U={"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("+[b,f.margin.top]+")"}).style({display:"block"});var V=d.map(function(t,e){var r=a.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend="undefined"==typeof t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});a.Legend().config({data:d.map(function(t,e){return t.name||"Element"+e}),legendConfig:o({},a.Legend.defaultConfig().legendConfig,{container:F,elements:V,reverseOrder:f.legend.reverseOrder})})();var q=F.node().getBBox();b=Math.min(f.width-q.width-f.margin.left-f.margin.right,f.height-f.margin.top-f.margin.bottom)/2,b=Math.max(10,b),_=[f.margin.left+b,f.margin.top+b],n.range([0,b]),u.layout.radialAxis.domain=n.domain(),F.attr("transform","translate("+[_[0]+b,_[1]-b]+")")}else F=e.select(".legend-group").style({display:"none"});e.attr({width:f.width,height:f.height}).style({opacity:f.opacity}),D.attr("transform","translate("+_+")").style({cursor:"crosshair"});var H=[(f.width-(f.margin.left+f.margin.right+2*b+(q?q.width:0)))/2,(f.height-(f.margin.top+f.margin.bottom+2*b))/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 G=e.select("g.title-group text").style(U).text(f.title),Y=G.node().getBBox();G.attr({x:_[0]-Y.width/2,y:_[1]-b-20})}var X=e.select(".radial.axis-group");if(f.radialAxis.gridLinesVisible){var W=X.selectAll("circle.grid-circle").data(n.ticks(5));W.enter().append("circle").attr({"class":"grid-circle"}).style(B),W.attr("r",n),W.exit().remove()}X.select("circle.outside-circle").attr({r:b}).style(B);var Z=e.select("circle.background-circle").attr({r:b}).style({fill:f.backgroundColor,stroke:f.stroke});if(f.radialAxis.visible){var K=i.svg.axis().scale(n).ticks(5).tickSize(5);X.call(K).attr({transform:"rotate("+f.radialAxis.orientation+")"}),X.selectAll(".domain").style(B),X.selectAll("g>text").text(function(t,e){return this.textContent+f.radialAxis.ticksSuffix}).style(U).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,U["font-size"]]+")":"translate("+[0,U["font-size"]]+")"}}),X.selectAll("g>line").style({stroke:"black"})}var $=e.select(".angular.axis-group").selectAll("g.angular-tick").data(O),Q=$.enter().append("g").classed("angular-tick",!0);$.attr({transform:function(t,e){return"rotate("+l(t,e)+")"}}).style({display:f.angularAxis.visible?"block":"none"}),$.exit().remove(),Q.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(B),Q.selectAll(".minor").style({stroke:f.minorTickColor}),$.select("line.grid-line").attr({x1:f.tickLength?b-f.tickLength:0,x2:b}).style({display:f.angularAxis.gridLinesVisible?"block":"none"}),Q.append("text").classed("axis-text",!0).style(U);var J=$.select("text.axis-text").attr({x:b+f.labelOffset,dy:".35em",transform:function(t,e){var r=l(t,e),n=b+f.labelOffset,i=f.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?270>r&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(180>=r&&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?"":k?k[t]+f.angularAxis.ticksSuffix:t+f.angularAxis.ticksSuffix}).style(U);f.angularAxis.rewriteTicks&&J.text(function(t,e){return e%(f.minorTicks+1)!=0?"":f.angularAxis.rewriteTicks(this.textContent,e)});var tt=i.max(D.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));F.attr({transform:"translate("+[b+tt,f.margin.top]+")"});var et=e.select("g.geometry-group").selectAll("g").size()>0,rt=e.select("g.geometry-group").selectAll("g.geometry").data(d);if(rt.enter().append("g").attr({"class":function(t,e){return"geometry geometry"+e}}),rt.exit().remove(),d[0]||et){var nt=[];d.forEach(function(t,e){var r={};r.radialScale=n,r.angularScale=s,r.container=rt.filter(function(t,r){return r==e}),r.geometry=t.geometry,r.orientation=f.orientation,r.direction=f.direction,r.index=e,nt.push({data:t,geometryConfig:r})});var it=i.nest().key(function(t,e){return"undefined"!=typeof t.data.groupId||"unstacked"}).entries(nt),at=[];it.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 o(a[r].defaultConfig(),t)});a[r]().config(n)()})}var ot,st,lt=e.select(".guides-group"),ct=e.select(".tooltips-group"),ut=a.tooltipPanel().config({container:ct,fontSize:8})(),ft=a.tooltipPanel().config({container:ct,fontSize:8})(),ht=a.tooltipPanel().config({container:ct,hasTick:!0})();if(!M){var dt=lt.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});D.on("mousemove.angular-guide",function(t,e){var r=a.util.getMousePos(Z).angle;dt.attr({x2:-b,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-f.orientation)%360;ot=s.invert(n);var i=a.util.convertToCartesian(b+12,r+180);ut.text(a.util.round(ot)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){lt.select("line").style({opacity:0})})}var pt=lt.select("circle").style({stroke:"grey",fill:"none"});D.on("mousemove.radial-guide",function(t,e){var r=a.util.getMousePos(Z).radius;pt.attr({r:r}).style({opacity:.5}),st=n.invert(a.util.getMousePos(Z).radius);var i=a.util.convertToCartesian(r,f.radialAxis.orientation);ft.text(a.util.round(st)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){pt.style({opacity:0}),ht.hide(),ut.hide(),ft.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,r){var n=i.select(this),o=n.style("fill"),s="black",l=n.style("opacity")||1;if(n.attr({"data-opacity":l}),"none"!=o){n.attr({"data-fill":o}),s=i.hsl(o).darker().toString(),n.style({fill:s,opacity:1});var c={t:a.util.round(t[0]),r:a.util.round(t[1])};M&&(c.t=k[t[0]]);var u="t: "+c.t+", r: "+c.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];ht.config({color:s}).text(u),ht.move(d)}else o=n.style("stroke"),n.attr({"data-stroke":o}),s=i.hsl(o).darker().toString(),n.style({stroke:s,opacity:1})}).on("mousemove.tooltip",function(t,e){return 0!=i.event.which?!1:void(i.select(this).attr("data-fill")&&ht.show())}).on("mouseout.tooltip",function(t,e){ht.hide();var r=i.select(this),n=r.attr("data-fill");n?r.style({fill:n,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})}),h}var e,r,n,s,l={data:[],layout:{}},c={},u={},f=i.dispatch("hover"),h={};return h.render=function(e){return t(e),this},h.config=function(t){if(!arguments.length)return l;var e=a.util.cloneJson(t);return e.data.forEach(function(t,e){l.data[e]||(l.data[e]={}),o(l.data[e],a.Axis.defaultConfig().data[0]),o(l.data[e],t)}),o(l.layout,a.Axis.defaultConfig().layout),o(l.layout,e.layout),this},h.getLiveConfig=function(){return u},h.getinputConfig=function(){return c},h.radialScale=function(t){return n},h.angularScale=function(t){return s},h.svg=function(){return e},i.rebind(h,f,"on"),h},a.Axis.defaultConfig=function(t,e){var r={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:i.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}};return r},a.util={},a.DATAEXTENT="dataExtent",a.AREA="AreaChart",a.LINE="LinePlot",a.DOT="DotPlot",a.BAR="BarChart",a.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},a.util._extend=function(t,e){for(var r in t)e[r]=t[r]},a.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},a.util.dataFromEquation2=function(t,e){var r=e||6,n=i.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180,i=t(n);return[e,i]});return n},a.util.dataFromEquation=function(t,e,r){var n=e||6,a=[],o=[];i.range(0,360+n,n).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},a.util.ensureArray=function(t,e){if("undefined"==typeof t)return null;var r=[].concat(t);return i.range(e).map(function(t,e){return r[e]||r[0]})},a.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=a.util.ensureArray(t[e],r)}),t},a.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},a.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},a.util.sumArrays=function(t,e){return i.zip(t,e).map(function(t,e){return i.sum(t)})},a.util.arrayLast=function(t){return t[t.length-1]},a.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},a.util.flattenArray=function(t){for(var e=[];!a.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},a.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},a.util.convertToCartesian=function(t,e){var r=e*Math.PI/180,n=t*Math.cos(r),i=t*Math.sin(r);return[n,i]},a.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},a.util.getMousePos=function(t){var e=i.mouse(t.node()),r=e[0],n=e[1],a={};return a.x=r,a.y=n,a.pos=e,a.angle=180*(Math.atan2(n,r)+Math.PI)/Math.PI,a.radius=Math.sqrt(r*r+n*n),a},a.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,a=t.length;a>i;i++)e=t[i],e in r?(r[e]++,n[e]=r[e]):r[e]=1;return n},a.util.duplicates=function(t){return Object.keys(a.util.duplicatesCount(t))},a.util.translator=function(t,e,r,n){if(n){var i=r.slice();r=e,e=i}var a=e.reduce(function(t,e){return"undefined"!=typeof t?t[e]:void 0},t);"undefined"!=typeof a&&(e.reduce(function(t,r,n){return"undefined"!=typeof t?(n===e.length-1&&delete t[r],t[r]):void 0},t),r.reduce(function(t,e,n){return"undefined"==typeof t[e]&&(t[e]={}),n===r.length-1&&(t[e]=a),t[e]},t))},a.PolyChart=function(){function t(){var t=r[0].geometryConfig,e=t.container;"string"==typeof e&&(e=i.select(e)),e.datum(r).each(function(e,r){function n(e,r){var n=t.radialScale(e[1]),i=(t.angularScale(e[0])+t.orientation)*Math.PI/180;return{r:n,t:i}}function a(t){var e=t.r*Math.cos(t.t),r=t.r*Math.sin(t.t);return{x:e,y:r}}var o=!!e[0].data.yStack,l=e.map(function(t,e){return o?i.zip(t.data.t[0],t.data.r[0],t.data.yStack[0]):i.zip(t.data.t[0],t.data.r[0])}),c=t.angularScale,u=t.radialScale.domain()[0],f={};f.bar=function(r,n,a){var o=e[a].data,s=t.radialScale(r[1])-t.radialScale(0),l=t.radialScale(r[2]||0),u=o.barWidth;i.select(this).attr({"class":"mark bar",d:"M"+[[s+l,-u/2],[s+l,u/2],[l,u/2],[l,-u/2]].join("L")+"Z",transform:function(e,r){return"rotate("+(t.orientation+c(e[0]))+")"}})},f.dot=function(t,r,o){var s=t[2]?[t[0],t[1]+t[2]]:t,l=i.svg.symbol().size(e[o].data.dotSize).type(e[o].data.dotType)(t,r);i.select(this).attr({"class":"mark dot",d:l,transform:function(t,e){var r=a(n(s));return"translate("+[r.x,r.y]+")"}})};var h=i.svg.line.radial().interpolate(e[0].data.lineInterpolation).radius(function(e){return t.radialScale(e[1])}).angle(function(e){return t.angularScale(e[0])*Math.PI/180});f.line=function(r,n,a){var o=r[2]?l[a].map(function(t,e){return[t[0],t[1]+t[2]]}):l[a];if(i.select(this).each(f.dot).style({opacity:function(t,r){return+e[a].data.dotVisible},fill:v.stroke(r,n,a)}).attr({"class":"mark dot"}),!(n>0)){var s=i.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,n,a)},"fill-opacity":0,stroke:function(t,e){return v.stroke(r,n,a)},"stroke-width":function(t,e){return v["stroke-width"](r,n,a)},"stroke-dasharray":function(t,e){return v["stroke-dasharray"](r,n,a)},opacity:function(t,e){return v.opacity(r,n,a)},display:function(t,e){return v.display(r,n,a)}})}};var d=t.angularScale.range(),p=Math.abs(d[1]-d[0])/l[0].length*Math.PI/180,g=i.svg.arc().startAngle(function(t){return-p/2}).endAngle(function(t){return p/2}).innerRadius(function(e){return t.radialScale(u+(e[2]||0))}).outerRadius(function(e){return t.radialScale(u+(e[2]||0))+t.radialScale(e[1])});f.arc=function(e,r,n){i.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 s[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return"undefined"==typeof e[n].data.visible||e[n].data.visible?"block":"none"}},m=i.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,r=[a.PolyChart.defaultConfig()],n=i.dispatch("hover"),s={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,e){r[e]||(r[e]={}),o(r[e],a.PolyChart.defaultConfig()),o(r[e],t)}),this):r},t.getColorScale=function(){return e},i.rebind(t,n,"on"),t},a.PolyChart.defaultConfig=function(){var t={data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:i.scale.category20()}};return t},a.BarChart=function(){return a.PolyChart()},a.BarChart.defaultConfig=function(){var t={geometryConfig:{geometryType:"bar"}};return t},a.AreaChart=function(){return a.PolyChart()},a.AreaChart.defaultConfig=function(){var t={geometryConfig:{geometryType:"arc"}};return t},a.DotPlot=function(){return a.PolyChart()},a.DotPlot.defaultConfig=function(){var t={geometryConfig:{geometryType:"dot",dotType:"circle"}};return t},a.LinePlot=function(){return a.PolyChart()},a.LinePlot.defaultConfig=function(){var t={geometryConfig:{geometryType:"line"}};return t},a.Legend=function(){function t(){var r=e.legendConfig,n=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var i=o({},r.elements[e]);return i.name=t,i.color=[].concat(r.elements[e].color)[n],i})}),a=i.merge(n);a=a.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||"undefined"==typeof r.elements[e].visibleInLegend)}),r.reverseOrder&&(a=a.reverse());var s=r.container;("string"==typeof s||s.nodeName)&&(s=i.select(s));var l=a.map(function(t,e){return t.color}),c=r.fontSize,u=null==r.isContinuous?"number"==typeof a[0]:r.isContinuous,f=u?r.height:c*a.length,h=s.classed("legend-group",!0),d=h.selectAll("svg").data([0]),p=d.enter().append("svg").attr({width:300,height:f+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var g=i.range(a.length),v=i.scale[u?"linear":"ordinal"]().domain(g).range(l),m=i.scale[u?"linear":"ordinal"]().domain(g)[u?"range":"rangePoints"]([0,f]),y=function(t,e){var r=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":-1!=i.svg.symbolTypes.indexOf(t)?i.svg.symbol().type(t).size(r)():i.svg.symbol().type("square").size(r)()};if(u){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(a);x.enter().append("path").classed("legend-mark",!0),x.attr({transform:function(t,e){return"translate("+[c/2,m(e)+c/2]+")"},d:function(t,e){var r=t.symbol;return y(r,c)},fill:function(t,e){return v(e)}}),x.exit().remove()}var _=i.svg.axis().scale(m).orient("right"),w=d.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 a[e].name}),t}var e=a.Legend.defaultConfig(),r=i.dispatch("hover");return t.config=function(t){return arguments.length?(o(e,t),this):e},i.rebind(t,r,"on"),t},a.Legend.defaultConfig=function(t,e){var r={data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}};return r},a.tooltipPanel=function(){var t,e,r,n={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+a.tooltipPanel.uid++,l=10,c=function(){t=n.container.selectAll("g."+s).data([0]);var i=t.enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=i.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=i.append("text").attr({dx:n.padding+l,dy:.3*+n.fontSize}),c};return c.text=function(a){var o=i.hsl(n.color).l,s=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",f=a||"";e.style({fill:u,"font-size":n.fontSize+"px"}).text(f);var h=n.padding,d=e.node().getBBox(),p={fill:n.color,stroke:s,"stroke-width":"2px"},g=d.width+2*h+l,v=d.height+2*h;return r.attr({d:"M"+[[l,-v/2],[l,-v/4],[n.hasTick?0:l,0],[l,v/4],[l,v/2],[g,v/2],[g,-v/2]].join("L")+"Z"}).style(p),t.attr({transform:"translate("+[l,-v/2+2*h]+")"}),t.style({display:"block"}),c},c.move=function(e){return t?(t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),c):void 0},c.hide=function(){return t?(t.style({display:"none"}),c):void 0},c.show=function(){return t?(t.style({display:"block"}),c):void 0},c.config=function(t){return o(n,t),c},c},a.tooltipPanel.uid=1,a.adapter={},a.adapter.plotly=function(){var t={};return t.convert=function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=o({},t),i=[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]];return i.forEach(function(t,r){a.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",n.dotVisible===!0?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var n=a.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var i=n.indexOf(t.geometry);-1!=i&&(r.data[e].groupId=i)})}if(t.layout){var s=o({},t.layout),l=[[s,["plot_bgcolor"],["backgroundColor"]],[s,["showlegend"],["showLegend"]],[s,["radialaxis"],["radialAxis"]],[s,["angularaxis"],["angularAxis"]],[s.angularaxis,["showline"],["gridLinesVisible"]],[s.angularaxis,["showticklabels"],["labelsVisible"]],[s.angularaxis,["nticks"],["ticksCount"]],[s.angularaxis,["tickorientation"],["tickOrientation"]],[s.angularaxis,["ticksuffix"],["ticksSuffix"]],[s.angularaxis,["range"],["domain"]],[s.angularaxis,["endpadding"],["endPadding"]],[s.radialaxis,["showline"],["gridLinesVisible"]],[s.radialaxis,["tickorientation"],["tickOrientation"]],[s.radialaxis,["ticksuffix"],["ticksSuffix"]],[s.radialaxis,["range"],["domain"]],[s.angularAxis,["showline"],["gridLinesVisible"]],[s.angularAxis,["showticklabels"],["labelsVisible"]],[s.angularAxis,["nticks"],["ticksCount"]],[s.angularAxis,["tickorientation"],["tickOrientation"]],[s.angularAxis,["ticksuffix"],["ticksSuffix"]],[s.angularAxis,["range"],["domain"]],[s.angularAxis,["endpadding"],["endPadding"]],[s.radialAxis,["showline"],["gridLinesVisible"]],[s.radialAxis,["tickorientation"],["tickOrientation"]],[s.radialAxis,["ticksuffix"],["ticksSuffix"]],[s.radialAxis,["range"],["domain"]],[s.font,["outlinecolor"],["outlineColor"]],[s.legend,["traceorder"],["reverseOrder"]],[s,["labeloffset"],["labelOffset"]],[s,["defaultcolorrange"],["defaultColorRange"]]];if(l.forEach(function(t,r){a.util.translator.apply(null,t.concat(e))}),e?("undefined"!=typeof s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&"undefined"!=typeof s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&"undefined"!=typeof s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&"undefined"!=typeof s.margin.t){var c=["t","r","b","l","pad"],u=["top","right","bottom","left","pad"],f={};i.entries(s.margin).forEach(function(t,e){f[u[c.indexOf(t.key)]]=t.value}),s.margin=f}e&&(delete s.needsEndSpacing,delete s.minorTickColor,delete s.minorTicks,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksStep,delete s.angularaxis.rewriteTicks,delete s.angularaxis.nticks,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksStep,delete s.radialaxis.rewriteTicks,delete s.radialaxis.nticks),r.layout=s}return r},t}},{"../../plotly":402,"./micropolar_manager":458,d3:113}],458:[function(t,e,r){"use strict";var n=t("../../plotly"),i=t("d3"),a=t("./undo_manager"),o=e.exports={},s=n.Lib.extendDeepAll;o.framework=function(t){function e(e,a){return a&&(f=a),i.select(i.select(f).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),r=r?s(r,e):e,c||(c=n.micropolar.Axis()),u=n.micropolar.adapter.plotly().convert(r),c.config(u).render(f),t.data=r.data,t.layout=r.layout,o.fillLayout(t),r}var r,l,c,u,f,h=new a;return e.isPolar=!0,e.svg=function(){return c.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return n.micropolar.adapter.plotly().convert(c.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:c.angularScale(),r:c.radialScale()}},e.setUndoPoint=function(){var t=this,e=n.micropolar.util.cloneJson(r);!function(e,r){h.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,l),l=n.micropolar.util.cloneJson(e)},e.undo=function(){h.undo()},e.redo=function(){h.redo()},e},o.fillLayout=function(t){var e=i.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:n.Color.background,_container:e,_paperdiv:r,_paper:a};t._fullLayout=s(o,t.layout)}},{"../../plotly":402,"./undo_manager":459,d3:113}],459:[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 ng;g++){var v=d[g];s=t[v]?t[v]:t[v]={},e[v]=l={},o("domain."+h,[g/p,(g+1)/p]),o("domain."+{x:"y",y:"x"}[h]),a.id=v,f(s,l,o,a)}}},{"../lib":382,"./plots":454}],461:[function(t,e,r){"use strict";var n=t("./ternary"),i=t("../../plots/plots");r.name="ternary",r.attr="subplot",r.idRoot="ternary",r.idRegex=/^ternary([2-9]|[1-9][0-9]+)?$/,r.attrRegex=/^ternary([2-9]|[1-9][0-9]+)?$/,r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,a=i.getSubplotIds(e,"ternary"),o=0;o=o&&(d.min=0,p.min=0,g.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}var 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":303,"../../subplot_defaults":460,"./axis_defaults":464,"./layout_attributes":466}],466:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("./axis_attributes");e.exports={domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},bgcolor:{valType:"color",dflt:n.background},sum:{valType:"number",dflt:1,min:0},aaxis:i,baxis:i,caxis:i}},{"../../../components/color/attributes":302,"./axis_attributes":463}],467:[function(t,e,r){"use strict";function n(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework()}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"),c=t("../../components/color"),u=t("../../components/drawing"),f=t("../cartesian/set_convert"),h=t("../../lib/extend").extendFlat,d=t("../cartesian/axes"),p=t("../../lib/filter_visible"),g=t("../../components/dragelement"),v=t("../../components/titles"),m=t("../cartesian/select"),y=t("../cartesian/constants"),b=t("../cartesian/graph_interact");e.exports=n;var x=n.prototype;x.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={}},x.plot=function(t,e){var r,n=this,i=e[n.id],a=e._size;l.getPlotDiv(n.plotContainer.node())!==n.graphDiv&&(n.init(n.graphDiv._fullLayout),n.makeFramework()),n.adjustLayout(i,a);var o=n.traceHash,s={};for(r=0;r_*y?(a=y,i=a*_):(i=m,a=i/_),o=g*i/m,s=v*a/y,r=e.l+e.w*d-i/2,n=e.t+e.h*(1-p)-a/2,l.x0=r,l.y0=n,l.w=i,l.h=a,l.sum=b,l.xaxis={type:"linear",range:[x+2*k-b,b-x-2*w],domain:[d-o/2,d+o/2],_id:"x",_gd:l.graphDiv},f(l.xaxis),l.xaxis.setScale(),l.yaxis={type:"linear",range:[x,b-w-k],domain:[p-s/2,p+s/2],_id:"y",_gd:l.graphDiv},f(l.yaxis),l.yaxis.setScale();var A=l.yaxis.domain[0],M=l.aaxis=h({},t.aaxis,{range:[x,b-w-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,_gd:l.graphDiv,_id:"y",_length:i,_gridpath:"M0,0l"+a+",-"+i/2});f(M);var T=l.baxis=h({},t.baxis,{range:[b-x-k,w],side:"bottom",_counterangle:30,domain:l.xaxis.domain,_axislayer:l.layers.baxis,_gridlayer:l.layers.bgrid,_counteraxis:l.aaxis,_pos:0,_gd:l.graphDiv,_id:"x",_length:i,_gridpath:"M0,0l-"+i/2+",-"+a});f(T),M._counteraxis=T;var E=l.caxis=h({},t.caxis,{range:[b-x-w,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,_gd:l.graphDiv,_id:"y",_length:i,_gridpath:"M0,0l-"+a+","+i/2});f(E);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 S="translate("+r+","+n+")";l.plotContainer.selectAll(".scatterlayer,.maplayer,.zoom").attr("transform",S);var C="translate("+r+","+(n+a)+")";l.layers.baxis.attr("transform",C),l.layers.bgrid.attr("transform",C);var z="translate("+(r+i/2)+","+n+")rotate(30)";l.layers.aaxis.attr("transform",z),l.layers.agrid.attr("transform",z);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);var R=l.layers.axlines;R.select(".aline").attr("d",M.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(c.stroke,M.linecolor||"#000").style("stroke-width",(M.linewidth||0)+"px"),R.select(".bline").attr("d",T.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(c.stroke,T.linecolor||"#000").style("stroke-width",(T.linewidth||0)+"px"),R.select(".cline").attr("d",E.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(c.stroke,E.linecolor||"#000").style("stroke-width",(E.linewidth||0)+"px")},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(d.doTicks(r,i,!0),d.doTicks(r,a,!0),d.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=y.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",A="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",M="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="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",E=!0;x.initInteractions=function(){function t(t,e,r){var n=j.getBoundingClientRect();x=e-n.left,w=r-n.top,L={a:N.aaxis.range[0],b:N.baxis.range[1],c:N.caxis.range[1]},C=L,S=N.aaxis.range[1]-L.a,z=o(N.graphDiv._fullLayout[N.id].bgcolor).getLuminance(),P="M0,"+N.h+"L"+N.w/2+", 0L"+N.w+","+N.h+"Z",R=!1,O=D.append("path").attr("class","zoombox").style({fill:z>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",P),I=D.append("path").attr("class","zoombox-corners").style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),p()}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 a(t,i){var a=x+t,o=w+i,s=Math.max(0,Math.min(1,e(x,w),e(a,o))),l=Math.max(0,Math.min(1,r(x,w),r(a,o))),c=Math.max(0,Math.min(1,n(x,w),n(a,o))),u=(s/2+c)*N.w,f=(1-s/2-l)*N.w,h=(u+f)/2,d=f-u,p=(1-s)*N.h,g=p-d/_;d.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),I.transition().style("opacity",1).duration(200),R=!0)}function u(t,e){if(C===L)return 2===e&&v(),i(F);i(F);var r={};r[N.id+".aaxis.min"]=C.a,r[N.id+".baxis.min"]=C.b,r[N.id+".caxis.min"]=C.c,s.relayout(F,r),E&&F.data&&F._context.showTips&&(l.notifier("Double-click to
zoom back out","long"),E=!1)}function f(){L={a:N.aaxis.range[0],b:N.baxis.range[1],c:N.caxis.range[1]},C=L}function h(t,e){var r=t/N.xaxis._m,n=e/N.yaxis._m;C={a:L.a-n,b:L.b+(r+n)/2,c:L.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=(L.a-C.a)*N.yaxis._m,t=(L.c-C.c-L.b+C.b)*N.xaxis._m);var o="translate("+(N.x0+t)+","+(N.y0+e)+")";N.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",o),N.aaxis.range=[C.a,N.sum-C.b-C.c],N.baxis.range=[N.sum-C.a-C.c,C.b],N.caxis.range=[N.sum-C.a-C.b,C.c],N.drawAxes(!1),N.plotContainer.selectAll(".crisp").classed("crisp",!1)}function d(t,e){if(t){var r={};r[N.id+".aaxis.min"]=C.a,r[N.id+".baxis.min"]=C.b,r[N.id+".caxis.min"]=C.c,s.relayout(F,r)}else 2===e&&v()}function p(){N.plotContainer.selectAll(".select-outline").remove()}function v(){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),s.relayout(F,t)}var x,w,L,S,C,z,P,R,O,I,N=this,j=N.layers.plotbg.select("path").node(),F=N.graphDiv,D=N.layers.zoom,B={element:j,gd:F,plotinfo:{plot:D},doubleclick:v,subplot:N.id,prepFn:function(e,r,n){B.xaxes=[N.xaxis],B.yaxes=[N.yaxis];var i=F._fullLayout.dragmode;e.shiftKey&&(i="pan"===i?"zoom":"pan"),"lasso"===i?B.minDrag=1:B.minDrag=void 0,"zoom"===i?(B.moveFn=a,B.doneFn=u,t(e,r,n)):"pan"===i?(B.moveFn=h,B.doneFn=d,f(),p()):"select"!==i&&"lasso"!==i||m(e,r,n,B,i)}};g.init(B),j.onmousemove=function(t){b.hover(F,t,N.id),F._fullLayout._lasthover=j,F._fullLayout._hoversubplot=N.id},j.onmouseout=function(t){F._dragging||g.unhover(F,t)},j.onclick=function(t){b.click(F,t)}}},{"../../components/color":303,"../../components/dragelement":324,"../../components/drawing":326,"../../components/titles":366,"../../lib":382,"../../lib/extend":377,"../../lib/filter_visible":378,"../../plotly":402,"../cartesian/axes":405,"../cartesian/constants":410,"../cartesian/graph_interact":412,"../cartesian/select":418,"../cartesian/set_convert":419,d3:113,tinycolor2:274}],468:[function(t,e,r){"use strict";function n(t){var e;switch(t){case"themes__thumb":e={autosize:!0,width:150,height:150,title:"",showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":e={title:"",hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:e={}}return e}function i(t){var e=["xaxis","yaxis","zaxis"];return e.indexOf(t.slice(0,5))>-1}var a=t("../plotly"),o=a.Lib.extendFlat,s=a.Lib.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,l=t.data,c=t.layout,u=s([],l),f=s({},c,n(e.tileClass));if(e.width&&(f.width=e.width),e.height&&(f.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){f.annotations=[];var h=Object.keys(f);for(r=0;rl;l++)n(r[l])&&d.push({p:r[l],s:s[l],b:0});return a(e,"marker")&&o(e,e.marker.color,"marker","c"),a(e,"marker.line")&&o(e,e.marker.line.color,"marker.line","c"),d}},{"../../components/colorscale/calc":310,"../../components/colorscale/has_colorscale":316,"../../plots/cartesian/axes":405,"fast-isnumeric":117}],478:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color"),a=t("../scatter/xy_defaults"),o=t("../bar/style_defaults"),s=t("../../components/errorbars/defaults"),l=t("./attributes");e.exports=function(t,e,r,c){function u(r,i){return n.coerce(t,e,l,r,i)}var f=a(t,e,u);return f?(u("orientation",e.x&&!e.y?"h":"v"),u("text"),o(t,e,u,r,c),s(t,e,i.defaultLine,{axis:"y"}),void s(t,e,i.defaultLine,{axis:"x",inherit:"y"})):void(e.visible=!1)}},{"../../components/color":303,"../../components/errorbars/defaults":331,"../../lib":382,"../bar/style_defaults":486,"../scatter/xy_defaults":577,"./attributes":476}],479:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/graph_interact"),i=t("../../components/errorbars"),a=t("../../components/color");e.exports=function(t,e,r,o){var s,l=t.cd,c=l[0].trace,u=l[0].t,f=t.xa,h=t.ya,d="closest"===o?u.barwidth/2:u.dbar*(1-f._gd._fullLayout.bargap)/2;s="closest"!==o?function(t){return t.p}:"h"===c.orientation?function(t){return t.y}:function(t){return t.x};var p,g;"h"===c.orientation?(p=function(t){return n.inbox(t.b-e,t.x-e)+(t.x-e)/(t.x-t.b)},g=function(t){var e=s(t)-r;return n.inbox(e-d,e+d)}):(g=function(t){return n.inbox(t.b-r,t.y-r)+(t.y-r)/(t.y-t.b)},p=function(t){var r=s(t)-e;return n.inbox(r-d,r+d)});var v=n.getDistanceFunction(o,p,g);if(n.getClosest(l,v,t),t.index!==!1){var m=l[t.index],y=m.mcc||c.marker.color,b=m.mlcc||c.marker.line.color,x=m.mlw||c.marker.line.width;return a.opacity(y)?t.color=y:a.opacity(b)&&x&&(t.color=b),"h"===c.orientation?(t.x0=t.x1=f.c2p(m.x,!0),t.xLabelVal=m.s,t.y0=h.c2p(s(m)-d,!0),t.y1=h.c2p(s(m)+d,!0),t.yLabelVal=m.p):(t.y0=t.y1=h.c2p(m.y,!0),t.yLabelVal=m.s,t.x0=f.c2p(s(m)-d,!0),t.x1=f.c2p(s(m)+d,!0),t.xLabelVal=m.p),m.tx&&(t.text=m.tx),i.hoverInfo(m,c,t),[t]}}},{"../../components/color":303,"../../components/errorbars":332,"../../plots/cartesian/graph_interact":412}],480:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.layoutAttributes=t("./layout_attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("./layout_defaults"),n.calc=t("./calc"),n.setPositions=t("./set_positions"),n.colorbar=t("../scatter/colorbar"),n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.moduleType="trace",n.name="bar",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","bar","oriented","markerColorscale","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":413,"../scatter/colorbar":559,"./arrays_to_calcdata":475,"./attributes":476,"./calc":477,"./defaults":478,"./hover":479,"./layout_attributes":481,"./layout_defaults":482,"./plot":483,"./set_positions":484,"./style":485}],481:[function(t,e,r){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:""},bargap:{valType:"number",min:0,max:1},bargroupgap:{valType:"number",min:0,max:1,dflt:0}}},{}],482:[function(t,e,r){"use strict";var n=t("../../plots/plots"),i=t("../../plots/cartesian/axes"),a=t("../../lib"),o=t("./layout_attributes");e.exports=function(t,e,r){function s(r,n){return a.coerce(t,e,o,r,n)}for(var l=!1,c=!1,u=!1,f={},h=0;h=2?a(t):t>e?Math.ceil(t):Math.floor(t)}var h,d,p,g;if("h"===s.orientation?(p=u.c2p(r.poffset+e.p,!0),g=u.c2p(r.poffset+e.p+r.barwidth,!0),h=c.c2p(e.b,!0),d=c.c2p(e.s+e.b,!0)):(h=c.c2p(r.poffset+e.p,!0),d=c.c2p(r.poffset+e.p+r.barwidth,!0),g=u.c2p(e.s+e.b,!0),p=u.c2p(e.b,!0)),!(i(h)&&i(d)&&i(p)&&i(g)&&h!==d&&p!==g))return void n.select(this).remove();var v=(e.mlw+1||s.marker.line.width+1||(e.trace?e.trace.marker.line.width:0)+1)-1,m=n.round(v/2%1,2);if(!t._context.staticPlot){var y=o.opacity(e.mc||s.marker.color),b=1>y||v>.01?a:l;h=b(h,d),d=b(d,h),p=b(p,g),g=b(g,p)}n.select(this).attr("d","M"+h+","+p+"V"+g+"H"+d+"V"+p+"Z")})}),h.call(s.plot,e)}},{"../../components/color":303,"../../components/errorbars":332,"../../lib":382,"./arrays_to_calcdata":475,d3:113,"fast-isnumeric":117}],484:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/plots"),a=t("../../plots/cartesian/axes"),o=t("../../lib");e.exports=function(t,e){var r,s,l=t._fullLayout,c=e.x(),u=e.y();["v","h"].forEach(function(f){function h(e){function r(t){t[p]=t.p+h}var n=[];e.forEach(function(e){t.calcdata[e].forEach(function(t){n.push(t.p)})});var i=o.distinctVals(n),s=i.vals,c=i.minDiff,u=!1,f=[];"group"===l.barmode&&e.forEach(function(e){u||(t.calcdata[e].forEach(function(t){u||f.forEach(function(e){Math.abs(t.p-e)_&&(S=!0,M=_),_>A+R&&(S=!0,A=_))}a.expand(m,[M,A],{tozero:!0,padded:S})}else{var O=function(t){return t[g]=t.s,t.s};for(r=0;r1||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=(e._input||{}).marker||{},l=a.tryColorscale(r,s,""),c=a.tryColorscale(r,s,"line.");n.select(this).selectAll("path").each(function(t){var e,a,s=(t.mlw+1||o.width+1)-1,u=n.select(this);e="mc"in t?t.mcc=l(t.mc):Array.isArray(r.color)?i.defaultLine:r.color,u.style("stroke-width",s+"px").call(i.fill,e),s&&(a="mlc"in t?t.mlcc=c(t.mlc):Array.isArray(o.color)?i.defaultLine:o.color,u.call(i.stroke,a))})}),e.call(o.style)}},{"../../components/color":303,"../../components/drawing":326,"../../components/errorbars":332,d3:113}],486:[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":303,"../../components/colorscale/defaults":313,"../../components/colorscale/has_colorscale":316}],487:[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"},x:{valType:"data_array"},x0:{valType:"any"},y0:{valType:"any"},whiskerwidth:{valType:"number",min:0,max:1,dflt:.5},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1},jitter:{valType:"number",min:0,max:1},pointpos:{valType:"number",min:-2,max:2},orientation:{valType:"enumerated",values:["v","h"]},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)"},symbol:a({},o.symbol,{arrayOk:!1}),opacity:a({},o.opacity,{arrayOk:!1,dflt:1}),size:a({},o.size,{arrayOk:!1}),color:a({},o.color,{arrayOk:!1}),line:{color:a({},s.color,{arrayOk:!1,dflt:i.defaultLine}),width:a({},s.width,{arrayOk:!1,dflt:0}),outliercolor:{valType:"color"},outlierwidth:{valType:"number",min:0,dflt:1}}},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2}},fillcolor:n.fillcolor}},{"../../components/color/attributes":302,"../../lib/extend":377,"../scatter/attributes":556}],488:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/cartesian/axes");e.exports=function(t,e){function r(t,e,r,a,o){var s;return r in e?p=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),p=o.map(function(){return s})),p}function o(t,e,r,a,o){var s,l,c,u,f=a.length,h=e.length,d=[],p=[];for(s=0;f>s;++s)l=a[s],t[s]={pos:l},p[s]=l-o,d[s]=[];for(p.push(a[f-1]+o),s=0;h>s;++s)u=e[s],n(u)&&(c=i.findBin(r[s],p),c>=0&&h>c&&d[c].push(u));return d}function s(t,e){var r,n,a,o;for(o=0;o1,m=r.dPos*(1-h.boxgap)*(1-h.boxgroupgap)/(v?t.numboxes:1),y=v?2*r.dPos*(-.5+(r.boxnum+.5)/t.numboxes)*(1-h.boxgap):0,b=m*g.whiskerwidth;return g.visible!==!0||r.emptybox?void a.select(this).remove():("h"===g.orientation?(l=p,f=d):(l=d,f=p),r.bPos=y,r.bdPos=m,n(),a.select(this).selectAll("path.box").data(o.identity).enter().append("path").attr("class","box").each(function(t){var e=l.c2p(t.pos+y,!0),r=l.c2p(t.pos+y-m,!0),n=l.c2p(t.pos+y+m,!0),i=l.c2p(t.pos+y-b,!0),s=l.c2p(t.pos+y+b,!0),c=f.c2p(t.q1,!0),u=f.c2p(t.q3,!0),h=o.constrain(f.c2p(t.med,!0),Math.min(c,u)+1,Math.max(c,u)-1),d=f.c2p(g.boxpoints===!1?t.min:t.lf,!0),p=f.c2p(g.boxpoints===!1?t.max:t.uf,!0);"h"===g.orientation?a.select(this).attr("d","M"+h+","+r+"V"+n+"M"+c+","+r+"V"+n+"H"+u+"V"+r+"ZM"+c+","+e+"H"+d+"M"+u+","+e+"H"+p+(0===g.whiskerwidth?"":"M"+d+","+i+"V"+s+"M"+p+","+i+"V"+s)):a.select(this).attr("d","M"+r+","+h+"H"+n+"M"+r+","+c+"H"+n+"V"+u+"H"+r+"ZM"+e+","+c+"V"+d+"M"+e+","+u+"V"+p+(0===g.whiskerwidth?"":"M"+i+","+d+"H"+s+"M"+i+","+p+"H"+s))}),g.boxpoints&&a.select(this).selectAll("g.points").data(function(t){return t.forEach(function(t){t.t=r,t.trace=g}),t}).enter().append("g").attr("class","points").selectAll("path").data(function(t){var e,r,n,a,s,l,f,h="all"===g.boxpoints?t.val:t.val.filter(function(e){return et.uf}),d=(t.q3-t.q1)*u,p=[],v=0;if(g.jitter){for(e=0;et.lo&&(n.so=!0),n})}).enter().append("path").call(s.translatePoints,d,p),void(g.boxmean&&a.select(this).selectAll("path.mean").data(o.identity).enter().append("path").attr("class","mean").style("fill","none").each(function(t){var e=l.c2p(t.pos+y,!0),r=l.c2p(t.pos+y-m,!0),n=l.c2p(t.pos+y+m,!0),i=f.c2p(t.mean,!0),o=f.c2p(t.mean-t.sd,!0),s=f.c2p(t.mean+t.sd,!0);"h"===g.orientation?a.select(this).attr("d","M"+i+","+r+"V"+n+("sd"!==g.boxmean?"":"m0,0L"+o+","+e+"L"+i+","+r+"L"+s+","+e+"Z")):a.select(this).attr("d","M"+r+","+i+"H"+n+("sd"!==g.boxmean?"":"m0,0L"+e+","+o+"L"+r+","+i+"L"+e+","+s+"Z"))})))})}},{"../../components/drawing":326,"../../lib":382,d3:113}],495:[function(t,e,r){"use strict";var n=t("../../plots/plots"),i=t("../../plots/cartesian/axes"),a=t("../../lib");e.exports=function(t,e){var r,o,s,l,c=t._fullLayout,u=e.x(),f=e.y(),h=["v","h"];for(o=0;ol&&(e.z=u.slice(0,l)),s("locationmode"),s("text"),s("marker.line.color"),s("marker.line.width"),i(t,e,o,s,{prefix:"",cLetter:"z"}),void s("hoverinfo",1===o._dataLength?"location+z+text":void 0)):void(e.visible=!1)}},{"../../components/colorscale/defaults":313,"../../lib":382,"./attributes":497}],500:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../heatmap/colorbar"),n.calc=t("./calc"),n.plot=t("./plot").plot,n.moduleType="trace",n.name="choropleth",n.basePlotModule=t("../../plots/geo"),n.categories=["geo","noOpacity"],n.meta={},e.exports=n},{"../../plots/geo":426,"../heatmap/colorbar":514,"./attributes":497,"./calc":498,"./defaults":499,"./plot":501}],501:[function(t,e,r){"use strict";function n(t,e){function r(e){var r=t.mockAxis;return o.tickText(r,r.c2l(e),"hover").text}var n=e.hoverinfo;if("none"===n)return function(t){delete t.nameLabel,delete t.textLabel};var i="all"===n?v.hoverinfo.flags:n.split("+"),a=-1!==i.indexOf("name"),s=-1!==i.indexOf("location"),l=-1!==i.indexOf("z"),c=-1!==i.indexOf("text"),u=!a&&s;return function(t){var n=[];u?t.nameLabel=t.id:(a&&(t.nameLabel=e.name),s&&n.push(t.id)),l&&n.push(r(t.z)),c&&n.push(t.tx),t.textLabel=n.join("
")}}function i(t){return function(e,r){return{points:[{data:t._input,fullData:t,curveNumber:t.index,pointNumber:r,location:e.id,z:e.z}]}}}var a=t("d3"),o=t("../../plots/cartesian/axes"),s=t("../../plots/cartesian/graph_interact"),l=t("../../components/color"),c=t("../../components/drawing"),u=t("../../components/colorscale/get_scale"),f=t("../../components/colorscale/make_scale_function"),h=t("../../lib/topojson_utils").getTopojsonFeatures,d=t("../../lib/geo_location_utils").locationToFeature,p=t("../../lib/array_to_calc_item"),g=t("../../plots/geo/constants"),v=t("./attributes"),m=e.exports={};m.calcGeoJSON=function(t,e){for(var r,n=[],i=t.locations,a=i.length,o=h(t,e),s=(t.marker||{}).line||{},l=0;a>l;l++)r=d(t.locationmode,i[l],o),void 0!==r&&(r.z=t.z[l],void 0!==t.text&&(r.tx=t.text[l]),p(s.color,r,"mlc",l),p(s.width,r,"mlw",l),n.push(r));return n.length>0&&(n[0].trace=t),n},m.plot=function(t,e,r){var o,l=t.framework,c=l.select("g.choroplethlayer"),u=l.select("g.baselayer"),f=l.select("g.baselayeroverchoropleth"),h=g.baseLayersOverChoropleth,d=c.selectAll("g.trace.choropleth").data(e,function(t){return t.uid});d.enter().append("g").attr("class","trace choropleth"),d.exit().remove(),d.each(function(e){function r(e,r){if(t.showHover){var n=t.projection(e.properties.ct);c(e),s.loneHover({x:n[0],y:n[1],name:e.nameLabel,text:e.textLabel},{container:t.hoverContainer.node()}),f=u(e,r),t.graphDiv.emit("plotly_hover",f)}}function o(e,r){t.graphDiv.emit("plotly_click",u(e,r))}var l=m.calcGeoJSON(e,t.topojson),c=n(t,e),u=i(e),f=null,h=a.select(this).selectAll("path.choroplethlocation").data(l);h.enter().append("path").classed("choroplethlocation",!0).on("mouseover",r).on("click",o).on("mouseout",function(){s.loneUnhover(t.hoverContainer),t.graphDiv.emit("plotly_unhover",f)}).on("mousedown",function(){s.loneUnhover(t.hoverContainer)}).on("mouseup",r),h.exit().remove()}),f.selectAll("*").remove();for(var p=0;pr;r++)e=f[r],d[r]=e[0]*(t.zmax-t.zmin)+t.zmin,p[r]=e[1];var g=n.extent([t.zmin,t.zmax,a.start,a.start+l*(c-1)]),v=g[t.zminr;r++)e=f[r],d[r]=(e[0]*(c+u-1)-u/2)*l+o,p[r]=e[1];var y=n.scale.linear().interpolate(n.interpolateRgb).domain(d).range(p);return y}},{"../../components/colorscale/get_scale":315,d3:113}],509:[function(t,e,r){"use strict";function n(t,e,r){var n=r[0].trace,a=r[0].x,s=r[0].y,c=n.contours,u=n.uid,f=e.x(),h=e.y(),v=t._fullLayout,b="contour"+u,x=i(c,e,r[0]);if(n.visible!==!0)return v._paper.selectAll("."+b+",.hm"+u).remove(),void v._infolayer.selectAll(".cb"+u).remove();"heatmap"===c.coloring?(n.zauto&&n.autocontour===!1&&(n._input.zmin=n.zmin=c.start-c.size/2,n._input.zmax=n.zmax=n.zmin+x.length*c.size),k(t,e,[r])):v._paper.selectAll(".hm"+u).remove(),o(x),l(x);var _=f.c2p(a[0],!0),w=f.c2p(a[a.length-1],!0),A=h.c2p(s[0],!0),M=h.c2p(s[s.length-1],!0),T=[[_,M],[w,M],[w,A],[_,A]],E=d(e,r,b);p(E,T,c),g(E,x,T,c),m(E,x,c),y(E,e,r[0],T)}function i(t,e,r){for(var n=t.size||1,i=[],a=t.start;at?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);if(5===r||10===r){var n=(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4;return t>n?5===r?713:1114:5===r?104:208}return 15===r?0:r}function o(t){var e,r,n,i,o,s,l,c,u,f=t[0].z,h=f.length,d=f[0].length,p=2===h||2===d;for(r=0;h-1>r;r++)for(i=[],0===r&&(i=i.concat(A)),r===h-2&&(i=i.concat(M)),e=0;d-1>e;e++)for(n=i.slice(),0===e&&(n=n.concat(T)),e===d-2&&(n=n.concat(E)),o=e+","+r,s=[[f[r][e],f[r][e+1]],[f[r+1][e],f[r+1][e+1]]],u=0;ui;i++){if(s>20?(s=S[s][(l[0]||l[1])<0?0:1],t.crossings[o]=C[s]):delete t.crossings[o],l=L[s],!l){_.log("Found bad marching index:",s,e,t.level);break}if(d.push(h(t,e,l)),e[0]+=l[0],e[1]+=l[1],u(d[d.length-1],d[d.length-2])&&d.pop(),o=e.join(","),o===a&&l.join(",")===p||r&&(l[0]&&(e[0]<0||e[0]>v-2)||l[1]&&(e[1]<0||e[1]>g-2)))break;s=t.crossings[o]}1e4===i&&_.log("Infinite loop in contour?");var m,y,b,x,w,k,A,M=u(d[0],d[d.length-1]),T=0,E=.2*t.smoothing,z=[],P=0;for(i=1;i=P;i--)if(m=z[i],R>m){for(b=0,y=i-1;y>=P&&m+z[y]b&&m+z[b]e;)e++,r=Object.keys(i.crossings)[0].split(",").map(Number),s(i,r);1e4===e&&_.log("Infinite loop in contour?")}}function c(t,e,r){var n=0,i=0;return t>20&&e?208===t||1114===t?n=0===r[0]?1:-1:i=0===r[1]?1:-1:-1!==A.indexOf(t)?i=1:-1!==T.indexOf(t)?n=1:-1!==M.indexOf(t)?i=-1:n=-1,[n,i]}function u(t,e){return Math.abs(t[0]-e[0])<.01&&Math.abs(t[1]-e[1])<.01}function f(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function h(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)]}var c=(t.level-a)/(t.z[i+1][n]-a);return[o.c2p(t.x[n],!0),s.c2p((1-c)*t.y[i]+c*t.y[i+1],!0)]}function d(t,e,r){var n=t.plot.select(".maplayer").selectAll("g.contour."+r).data(e);return n.enter().append("g").classed("contour",!0).classed(r,!0),n.exit().remove(),n}function p(t,e,r){var n=t.selectAll("g.contourbg").data([0]);n.enter().append("g").classed("contourbg",!0);var 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 g(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=v(t,r);e?x.select(this).attr("d",e).style("stroke","none"):x.select(this).remove()})}function v(t,e){function r(t){return Math.abs(t[1]-e[0][1])<.01}function n(t){return Math.abs(t[1]-e[2][1])<.01}function i(t){return Math.abs(t[0]-e[0][0])<.01}function a(t){return Math.abs(t[0]-e[2][0])<.01}for(var o,s,l,c,u,f,h=t.edgepaths.length||t.z[0][0]l;l++){if(!o){_.log("Missing end?",d,t);break}for(r(o)&&!a(o)?s=e[1]:i(o)?s=e[0]:n(o)?s=e[3]:a(o)&&(s=e[2]),u=0;u=0&&(s=v,c=u):Math.abs(o[1]-s[1])<.01?Math.abs(o[1]-v[1])<.01&&(v[0]-o[0])*(s[0]-v[0])>=0&&(s=v,c=u):_.log("endpt to newendpt is not vert. or horz.",o,s,v)}if(o=s,c>=0)break;h+="L"+s}if(c===t.edgepaths.length){_.log("unclosed perimeter path");break}d=c,g=-1===p.indexOf(d),g&&(d=p[0],h+="Z")}for(d=0;de;e++)s.push(1);for(e=0;a>e;e++)i.push(s.slice());for(e=0;eo;o++)for(n=i(l,o),u[o]=new Array(n),s=0;n>s;s++)u[o][s]=e(a(l,o,s));return u}function i(t,e,r,n,i,a){var o,s,l,c=[],u=h.traceIs(t,"contour"),f=h.traceIs(t,"histogram"),d=h.traceIs(t,"gl2d");if(Array.isArray(e)&&!f&&"category"!==a.type){e=e.map(a.d2c);var p=e.length;if(!(i>=p))return u?e.slice(0,i):e.slice(0,i+1);if(u||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]],l=1;p>l;l++)c.push(.5*(e[l-1]+e[l]));c.push(1.5*e[p-1]-.5*e[p-2])}if(i>p){var g=c[c.length-1],v=g-c[c.length-2];for(l=p;i>l;l++)g+=v,c.push(g)}}else for(s=n||1,o=void 0===r?0:f||"category"===a.type?r:a.d2c(r),l=u||d?0:-.5;i>l;l++)c.push(o+s*l);return c}function a(t){return.5-.25*Math.min(1,.5*t)}function o(t,e,r){var n,i,o=1;if(Array.isArray(r))for(n=0;nn&&o>y;n++)o=l(t,e,a(o));return o>y&&u.log("interp2d didn't converge quickly",o),t}function s(t){var e,r,n,i,a,o,s,l,c=[],u={},f=[],h=t[0],d=[],p=[0,0,0],g=m(t);for(r=0;rn;n++)void 0===d[n]&&(o=(void 0!==d[n-1]?1:0)+(void 0!==d[n+1]?1:0)+(void 0!==e[n]?1:0)+(void 0!==h[n]?1:0),o?(0===r&&o++,0===n&&o++,r===t.length-1&&o++,n===d.length-1&&o++,4>o&&(u[[r,n]]=[r,n,o]),c.push([r,n,o])):f.push([r,n]));for(;f.length;){for(s={},l=!1,a=f.length-1;a>=0;a--)i=f[a],r=i[0],n=i[1],o=((u[[r-1,n]]||p)[2]+(u[[r+1,n]]||p)[2]+(u[[r,n-1]]||p)[2]+(u[[r,n+1]]||p)[2])/20,o&&(s[i]=[r,n,o],f.splice(a,1),l=!0);if(!l)throw"findEmpties iterated with no new neighbors";for(i in s)u[i]=s[i],c.push(s[i])}return c.sort(function(t,e){return e[2]-t[2]})}function l(t,e,r){var n,i,a,o,s,l,c,u,f,h,d,p,g,v=0;for(o=0;os;s++)l=b[s],c=t[i+l[0]],c&&(u=c[a+l[1]],void 0!==u&&(0===h?p=g=u:(p=Math.min(p,u),g=Math.max(g,u)),f++,h+=u));if(0===f)throw"iterateInterp2d order is wrong: no defined neighbors";t[i][a]=h/f,void 0===d?4>f&&(v=1):(t[i][a]=(1+r)*t[i][a]-r*d,g>p&&(v=Math.max(v,Math.abs(t[i][a]-d)/(g-p))))}return v}var c=t("fast-isnumeric"),u=t("../../lib"),f=t("../../plots/cartesian/axes"),h=t("../../plots/plots"),d=t("../histogram2d/calc"),p=t("../../components/colorscale/calc"),g=t("./has_columns"),v=t("./convert_column_xyz"),m=t("./max_row_length");e.exports=function(t,e){function r(t){E=e._input.zsmooth=e.zsmooth=!1,u.notifier("cannot fast-zsmooth: "+t)}var a,l,c,y,b,x,_,w,k=f.getFromId(t,e.xaxis||"x"),A=f.getFromId(t,e.yaxis||"y"),M=h.traceIs(e,"contour"),T=h.traceIs(e,"histogram"),E=M?"best":e.zsmooth;if(k._minDtick=0,A._minDtick=0,T){var L=d(t,e);a=L.x,l=L.x0,c=L.dx,y=L.y,b=L.y0,x=L.dy,_=L.z}else g(e)&&v(e,k,A),a=e.x?k.makeCalcdata(e,"x"):[],y=e.y?A.makeCalcdata(e,"y"):[],l=e.x0||0,c=e.dx||1,b=e.y0||0,x=e.dy||1,_=n(e),(M||e.connectgaps)&&(e._emptypoints=s(_),e._interpz=o(_,e._emptypoints,e._interpz));if("fast"===E)if("log"===k.type||"log"===A.type)r("log axis found");else if(!T){if(a.length){var S=(a[a.length-1]-a[0])/(a.length-1),C=Math.abs(S/100);for(w=0;wC){r("x scale is not linear");break}}if(y.length&&"fast"===E){var z=(y[y.length-1]-y[0])/(y.length-1),P=Math.abs(z/100);for(w=0;wP){r("y scale is not linear");break}}}var R=m(_),O="scaled"===e.xtype?"":e.x,I=i(e,O,l,c,R,k),N="scaled"===e.ytype?"":e.y,j=i(e,N,b,x,_.length,A);f.expand(k,I),f.expand(A,j);var F={x:I,y:j,z:_};if(p(e,_,"","z"),M&&e.contours&&"heatmap"===e.contours.coloring){var D="contour"===e.type?"heatmap":"histogram2d";F.xfill=i(D,O,l,c,R,k),F.yfill=i(D,N,b,x,_.length,A)}return[F]};var y=.01,b=[[-1,0],[1,0],[0,-1],[0,1]]},{"../../components/colorscale/calc":310,"../../lib":382,"../../plots/cartesian/axes":405,"../../plots/plots":454,"../histogram2d/calc":533,"./convert_column_xyz":515,"./has_columns":517,"./max_row_length":520,"fast-isnumeric":117}],514:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../lib"),o=t("../../plots/plots"),s=t("../../components/colorscale/get_scale"),l=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,c="cb"+r.uid,u=s(r.colorscale),f=r.zmin,h=r.zmax;if(i(f)||(f=a.aggNums(Math.min,null,r.z)),i(h)||(h=a.aggNums(Math.max,null,r.z)),t._fullLayout._infolayer.selectAll("."+c).remove(),!r.showscale)return void o.autoMargin(t,c);var d=e[0].t.cb=l(t,c);d.fillcolor(n.scale.linear().domain(u.map(function(t){return f+t[0]*(h-f)})).range(u.map(function(t){return t[1]}))).filllevels({start:f,end:h,size:(h-f)/254}).options(r.colorbar)()}},{"../../components/colorbar/draw":306,"../../components/colorscale/get_scale":315,"../../lib":382,"../../plots/plots":454,d3:113,"fast-isnumeric":117}],515:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){var i,a=t.x.slice(),o=t.y.slice(),s=t.z,l=t.text,c=Math.min(a.length,o.length,s.length),u=void 0!==l&&!Array.isArray(l[0]);for(ci;i++)a[i]=e.d2c(a[i]),o[i]=r.d2c(o[i]);var f,h,d,p=n.distinctVals(a),g=p.vals,v=n.distinctVals(o),m=v.vals,y=n.init2dArray(m.length,g.length);for(u&&(d=n.init2dArray(m.length,g.length)),i=0;c>i;i++)f=n.findBin(a[i]+p.minDiff/2,g),h=n.findBin(o[i]+v.minDiff/2,m),y[h][f]=s[i],u&&(d[h][f]=l[i]);t.x=g,t.y=m,t.z=y,u&&(t.text=d)}},{"../../lib":382}],516:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./has_columns"),a=t("./xyz_defaults"),o=t("../../components/colorscale/defaults"),s=t("./attributes");e.exports=function(t,e,r,l){function c(r,i){return n.coerce(t,e,s,r,i)}var u=a(t,e,c);return u?(c("text"),c("zsmooth"),c("connectgaps",i(e)&&e.zsmooth!==!1),void o(t,e,l,c,{prefix:"",cLetter:"z"})):void(e.visible=!1)}},{"../../components/colorscale/defaults":313,"../../lib":382,"./attributes":512,"./has_columns":517,"./xyz_defaults":523}],517:[function(t,e,r){"use strict";e.exports=function(t){return!Array.isArray(t.z[0])}},{}],518:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/graph_interact"),i=t("../../lib");e.exports=function(t,e,r,a,o){if(!(t.distancec||c>=m[0].length||0>u||u>m.length)return}else{if(n.inbox(e-g[0],e-g[g.length-1])>n.MAXDIST||n.inbox(r-v[0],r-v[v.length-1])>n.MAXDIST)return;if(o){var w;for(b=[2*g[0]-g[1]],w=1;w0;)_=v.c2p(C[M]),M--;for(x>_&&(w=_,_=x,x=w,N=!0),M=0;void 0===k&&M0;)A=m.c2p(z[M]),M--;if(k>A&&(w=k,k=A,A=w,j=!0),P&&(C=r[0].xfill,z=r[0].yfill),"fast"!==R){var F="best"===R?0:.5;x=Math.max(-F*v._length,x),_=Math.min((1+F)*v._length,_),k=Math.max(-F*m._length,k),A=Math.min((1+F)*m._length,A)}var D=Math.round(_-x),B=Math.round(A-k);if(!(0>=D||0>=B)){var U,V;"fast"===R?(U=I,V=O):(U=D,V=B);var q=document.createElement("canvas");q.width=U,q.height=V;var H,G,Y=q.getContext("2d"),X=i.scale.linear().domain(S.map(function(t){return t[0]})).range(S.map(function(t){var e=a(t[1]).toRgb();return[e.r,e.g,e.b,e.a]})).clamp(!0);"fast"===R?(H=N?function(t){return I-1-t}:o.identity,G=j?function(t){return O-1-t}:o.identity):(H=function(t){return o.constrain(Math.round(v.c2p(C[t])-x),0,D)},G=function(t){return o.constrain(Math.round(m.c2p(z[t])-k),0,B)});var W,Z,K,$,Q,J,tt=G(0),et=[tt,tt],rt=N?0:1,nt=j?0:1,it=0,at=0,ot=0,st=0;if(R){var lt=0,ct=new Uint8Array(D*B*4);if("best"===R){var ut,ft,ht,dt=new Array(C.length),pt=new Array(z.length),gt=new Array(D);for(M=0;MM;M++)gt[M]=n(M,dt);for(Z=0;B>Z;Z++)for(ut=n(Z,pt),ft=T[ut.bin0],ht=T[ut.bin1],M=0;D>M;M++,lt+=4)J=d(ft,ht,gt[M],ut),h(ct,lt,J)}else for(Z=0;O>Z;Z++)for(Q=T[Z],et=G(Z),M=0;D>M;M++)J=f(Q[M],1),lt=4*(et*D+H(M)),h(ct,lt,J);var vt=Y.createImageData(D,B);vt.data.set(ct),Y.putImageData(vt,0,0)}else for(Z=0;O>Z;Z++)if(Q=T[Z],et.reverse(),et[nt]=G(Z+1),et[0]!==et[1]&&void 0!==et[0]&&void 0!==et[1])for(K=H(0),W=[K,K],M=0;I>M;M++)W.reverse(),W[rt]=H(M+1),W[0]!==W[1]&&void 0!==W[0]&&void 0!==W[1]&&($=Q[M],J=f($,(W[1]-W[0])*(et[1]-et[0])),Y.fillStyle="rgba("+J.join(",")+")",Y.fillRect(W[0],et[0],W[1]-W[0],et[1]-et[0]));at=Math.round(at/it),ot=Math.round(ot/it),st=Math.round(st/it);var mt=a("rgb("+at+","+ot+","+st+")");t._hmpixcount=(t._hmpixcount||0)+it,t._hmlumcount=(t._hmlumcount||0)+it*mt.getLuminance();var yt=e.plot.select(".imagelayer").selectAll("g.hm."+b).data([0]);yt.enter().append("g").classed("hm",!0).classed(b,!0),yt.exit().remove();var bt=yt.selectAll("image").data(r);bt.enter().append("svg:image"),bt.exit().remove(),bt.attr({xmlns:c.svg,"xlink:href":q.toDataURL("image/png"),height:B,width:D,x:x,y:k,preserveAspectRatio:"none"})}}var i=t("d3"),a=t("tinycolor2"),o=t("../../lib"),s=t("../../plots/plots"),l=t("../../components/colorscale/get_scale"),c=t("../../constants/xmlns_namespaces"),u=t("./max_row_length");e.exports=function(t,e,r){for(var i=0;i0&&(n=!0);for(var s=0;si;i++)e[i]?(t[i]/=e[i],n+=t[i]):t[i]=null;return n}},{}],526:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){return r("histnorm"),n.forEach(function(t){var e=r(t+"bins.start"),n=r(t+"bins.end"),i=r("autobin"+t,!(e&&n));r(i?"nbins"+t:t+"bins.size")}),e}},{}],527:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports={count:function(t,e,r){return r[t]++,1},sum:function(t,e,r,i){var a=i[e];return n(a)?(a=Number(a),r[t]+=a,a):0},avg:function(t,e,r,i,a){var o=i[e];return n(o)&&(o=Number(o),r[t]+=o,a[t]++),0},min: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]>a)return r[t]=a,a-r[t]}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]r&&c.length<5e3;)g=a.tickIncrement(r,b.size),c.push((r+g)/2),u.push(S),x&&_.push(r),E&&w.push(1/(g-r)),P&&k.push(0),r=g;var R=u.length;for(r=0;r=0&&R>m&&(A+=C(m,r,u,y,k));P&&(A=l(u,k)),z&&z(u,A,w);var O=Math.min(c.length,u.length),I=[],N=0,j=O-1;for(r=0;O>r;r++)if(u[r]){N=r;break}for(r=O-1;r>N;r--)if(u[r]){j=r;break}for(r=N;j>=r;r++)n(c[r])&&n(u[r])&&I.push({p:c[r],s:u[r],b:0});return I}}},{"../../lib":382,"../../plots/cartesian/axes":405,"./average":525,"./bin_functions":527,"./norm_functions":531,"fast-isnumeric":117}],529:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color"),a=t("./bin_defaults"),o=t("../bar/style_defaults"),s=t("../../components/errorbars/defaults"),l=t("./attributes");e.exports=function(t,e,r,c){function u(r,i){return n.coerce(t,e,l,r,i)}var f=u("x"),h=u("y");u("text");var d=u("orientation",h&&!f?"h":"v"),p=e["v"===d?"x":"y"];if(!p||!p.length)return void(e.visible=!1);var g=e["h"===d?"x":"y"];g&&u("histfunc");var v="h"===d?["y"]:["x"];a(t,e,u,v),o(t,e,u,r,c),s(t,e,i.defaultLine,{axis:"y"}),s(t,e,i.defaultLine,{axis:"x",inherit:"y"})}},{"../../components/color":303,"../../components/errorbars/defaults":331,"../../lib":382,"../bar/style_defaults":486,"./attributes":524,"./bin_defaults":526}],530:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.layoutAttributes=t("../bar/layout_attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("../bar/layout_defaults"),n.calc=t("./calc"),n.setPositions=t("../bar/set_positions"),n.plot=t("../bar/plot"),n.style=t("../bar/style"),n.colorbar=t("../scatter/colorbar"),n.hoverPoints=t("../bar/hover"),n.moduleType="trace",n.name="histogram",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","bar","histogram","oriented","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":413,"../bar/hover":479,"../bar/layout_attributes":481,"../bar/layout_defaults":482,"../bar/plot":483,"../bar/set_positions":484,"../bar/style":485,"../scatter/colorbar":559,"./attributes":524,"./calc":528,"./defaults":529}],531:[function(t,e,r){"use strict";e.exports={percent:function(t,e){for(var r=t.length,n=100/e,i=0;r>i;i++)t[i]*=n},probability:function(t,e){for(var r=t.length,n=0;r>n;n++)t[n]/=e},density:function(t,e,r,n){var i=t.length;n=n||1;for(var a=0;i>a;a++)t[a]*=r[a]*n},"probability density":function(t,e,r,n){var i=t.length;n&&(e/=n);for(var a=0;i>a;a++)t[a]*=r[a]/e}}},{}],532:[function(t,e,r){"use strict";var n=t("../histogram/attributes"),i=t("../heatmap/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../lib/extend").extendFlat;e.exports=o({},{x:n.x,y:n.y,z:{valType:"data_array"},marker:{color:{valType:"data_array"}},histnorm:n.histnorm,histfunc:n.histfunc,autobinx:n.autobinx,nbinsx:n.nbinsx,xbins:n.xbins,autobiny:n.autobiny,nbinsy:n.nbinsy,ybins:n.ybins,zsmooth:i.zsmooth,_nestedModules:{colorbar:"Colorbar"}},a,{autocolorscale:o({},a.autocolorscale,{dflt:!1})})},{"../../components/colorscale/attributes":309,"../../lib/extend":377,"../heatmap/attributes":512,"../histogram/attributes":524}],533:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("../histogram/bin_functions"),o=t("../histogram/norm_functions"),s=t("../histogram/average");e.exports=function(t,e){var r,l,c,u,f,h,d=i.getFromId(t,e.xaxis||"x"),p=e.x?d.makeCalcdata(e,"x"):[],g=i.getFromId(t,e.yaxis||"y"),v=e.y?g.makeCalcdata(e,"y"):[],m=Math.min(p.length,v.length);p.length>m&&p.splice(m,p.length-m),v.length>m&&v.splice(m,v.length-m),!e.autobinx&&"xbins"in e||(e.xbins=i.autoBin(p,d,e.nbinsx,"2d"),"histogram2dcontour"===e.type&&(e.xbins.start-=e.xbins.size,e.xbins.end+=e.xbins.size),e._input.xbins=e.xbins),!e.autobiny&&"ybins"in e||(e.ybins=i.autoBin(v,g,e.nbinsy,"2d"),"histogram2dcontour"===e.type&&(e.ybins.start-=e.ybins.size,e.ybins.end+=e.ybins.size),e._input.ybins=e.ybins),f=[];var y,b,x=[],_=[],w="string"==typeof e.xbins.size?[]:e.xbins,k="string"==typeof e.xbins.size?[]:e.ybins,A=0,M=[],T=e.histnorm,E=e.histfunc,L=-1!==T.indexOf("density"),S="max"===E||"min"===E,C=S?null:0,z=a.count,P=o[T],R=!1,O=[],I=[],N="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";N&&"count"!==E&&(R="avg"===E,z=a[E]);var j=e.xbins,F=j.end+(j.start-i.tickIncrement(j.start,j.size))/1e6;for(h=j.start;F>h;h=i.tickIncrement(h,j.size))x.push(C),Array.isArray(w)&&w.push(h),R&&_.push(0);Array.isArray(w)&&w.push(h);var D=x.length;for(r=e.xbins.start,l=(h-r)/D,r+=l/2,j=e.ybins,F=j.end+(j.start-i.tickIncrement(j.start,j.size))/1e6,h=j.start;F>h;h=i.tickIncrement(h,j.size))f.push(x.concat()),Array.isArray(k)&&k.push(h),R&&M.push(_.concat());Array.isArray(k)&&k.push(h);var B=f.length;for(c=e.ybins.start,u=(h-c)/B,c+=u/2,L&&(O=x.map(function(t,e){return Array.isArray(w)?1/(w[e+1]-w[e]):1/l}),I=f.map(function(t,e){return Array.isArray(k)?1/(k[e+1]-k[e]):1/u})),h=0;m>h;h++)y=n.findBin(p[h],w),b=n.findBin(v[h],k),y>=0&&D>y&&b>=0&&B>b&&(A+=z(y,h,f[b],N,M[b]));if(R)for(b=0;B>b;b++)A+=s(f[b],M[b]);if(P)for(b=0;B>b;b++)P(f[b],A,O,I[b]);return{x:p,x0:r,dx:l,y:v,y0:c,dy:u,z:f}}},{"../../lib":382,"../../plots/cartesian/axes":405,"../histogram/average":525,"../histogram/bin_functions":527,"../histogram/norm_functions":531}],534:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./sample_defaults"),a=t("../../components/colorscale/defaults"),o=t("./attributes");e.exports=function(t,e,r){function s(r,i){return n.coerce(t,e,o,r,i)}i(t,e,s),s("zsmooth"),a(t,e,r,s,{prefix:"",cLetter:"z"})}},{"../../components/colorscale/defaults":313,"../../lib":382,"./attributes":532,"./sample_defaults":536}],535:[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":413,"../heatmap/calc":513,"../heatmap/colorbar":514,"../heatmap/hover":518,"../heatmap/plot":521,"../heatmap/style":522,"./attributes":532,"./defaults":534}],536:[function(t,e,r){"use strict";var n=t("../histogram/bin_defaults");e.exports=function(t,e,r){var i=r("x"),a=r("y");if(!(i&&i.length&&a&&a.length))return void(e.visible=!1);var o=r("z")||r("marker.color");o&&r("histfunc");var s=["x","y"];n(t,e,r,s)}},{"../histogram/bin_defaults":526}],537:[function(t,e,r){"use strict";var n=t("../histogram2d/attributes"),i=t("../contour/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../lib/extend").extendFlat;e.exports=o({},{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:i.autocontour,ncontours:i.ncontours,contours:i.contours,line:i.line,_nestedModules:{colorbar:"Colorbar"}},a)},{"../../components/colorscale/attributes":309,"../../lib/extend":377,"../contour/attributes":502,"../histogram2d/attributes":532}],538:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../histogram2d/sample_defaults"),a=t("../contour/style_defaults"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,i){return n.coerce(t,e,o,r,i)}i(t,e,l);var c=n.coerce2(t,e,o,"contours.start"),u=n.coerce2(t,e,o,"contours.end"),f=l("autocontour",!(c&&u));l(f?"ncontours":"contours.size"),a(t,e,l,s)}},{"../../lib":382,"../contour/style_defaults":511,"../histogram2d/sample_defaults":536,"./attributes":537}],539:[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"),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":413,"../contour/calc":503,"../contour/colorbar":504,"../contour/hover":506,"../contour/plot":509,"../contour/style":510,"./attributes":537,"./defaults":538}],540:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../surface/attributes"),a=t("../../lib/extend").extendFlat;e.exports={x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},i:{valType:"data_array"},j:{valType:"data_array"},k:{valType:"data_array"},delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z"},alphahull:{valType:"number",dflt:-1},intensity:{valType:"data_array"},color:{valType:"color"},vertexcolor:{valType:"data_array"},facecolor:{valType:"data_array"},opacity:a({},i.opacity),flatshading:{valType:"boolean",dflt:!1},contour:{show:a({},i.contours.x.show,{}),color:a({},i.contours.x.color),width:a({},i.contours.x.width)},colorscale:n.colorscale,reversescale:n.reversescale,showscale:n.showscale,lightposition:{x:a({},i.lightposition.x,{dflt:1e5}),y:a({},i.lightposition.y,{dflt:1e5}),z:a({},i.lightposition.z,{dflt:0})},lighting:a({},{vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6}},i.lighting),_nestedModules:{colorbar:"Colorbar"}}},{"../../components/colorscale/attributes":309,"../../lib/extend":377,"../surface/attributes":601}],541:[function(t,e,r){"use strict";function n(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}function i(t){return t.map(function(t){var e=t[0],r=c(t[1]),n=r.toRgb();return{index:e,rgb:[n.r,n.g,n.b,1]}})}function a(t){return t.map(d)}function o(t,e,r){for(var n=new Array(t.length),i=0;i0)s=f(t.alphahull,l);else{var c=["x","y","z"].indexOf(t.delaunayaxis);s=u(l.map(function(t){return[t[(c+1)%3],t[(c+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.colormap=i(t.colorscale)):t.vertexcolor?(this.color=t.vertexcolors[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":394,"alpha-shape":40,"convex-hull":102,"delaunay-triangulate":114,"gl-mesh3d":150,tinycolor2:274}],542:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/colorbar/defaults"),a=t("./attributes");e.exports=function(t,e,r,o){function s(r,i){return n.coerce(t,e,a,r,i)}function l(t){var e=t.map(function(t){var e=s(t);return e&&Array.isArray(e)?e:null});return e.every(function(t){return t&&t.length===e[0].length})&&e}var c=l(["x","y","z"]),u=l(["i","j","k"]);return c?(u&&u.forEach(function(t){for(var e=0;el||(c=p[r],void 0!==c&&""!==c||(c=r),c=String(c),void 0===y[c]&&(y[c]=!0,u=a(e.marker.colors[r]),u.isValid()?(u=o.addOpacity(u,u.getAlpha()),m[c]||(m[c]=u)):m[c]?u=m[c]:(u=!1,b=!0),f=-1!==_.indexOf(c),f||(x+=l),g.push({v:l,label:c,color:u,i:r,hidden:f}))));if(e.sort&&g.sort(function(t,e){return e.v-t.v}),b)for(r=0;r")}return g};var l},{"../../components/color":303,"./helpers":548,"fast-isnumeric":117,tinycolor2:274}],547:[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 c=o("labels");Array.isArray(c)||(o("label0"),o("dlabel"));var u=o("marker.line.width");u&&o("marker.line.color");var f=o("marker.colors");Array.isArray(f)||(e.marker.colors=[]),o("scalegroup");var h=o("text"),d=o("textinfo",Array.isArray(h)?"text+percent":"percent");if(o("hoverinfo",1===a._dataLength?"label+text+value+percent":void 0),d&&"none"!==d){var p=o("textposition"),g=Array.isArray(p)||"auto"===p,v=g||"inside"===p,m=g||"outside"===p;if(v||m){var y=s(o,"textfont",a.font);v&&s(o,"insidetextfont",y),m&&s(o,"outsidetextfont",y)}}o("domain.x"),o("domain.y"),o("hole"),o("sort"),o("direction"),o("rotation"),o("pull")}},{"../../lib":382,"./attributes":544}],548:[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":382}],549:[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":544,"./base_plot":545,"./calc":546,"./defaults":547,"./layout_attributes":550,"./layout_defaults":551,"./plot":552,"./style":553,"./style_one":554}],550:[function(t,e,r){"use strict";e.exports={hiddenlabels:{valType:"data_array"}}},{}],551:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}r("hiddenlabels")}},{"../../lib":382,"./layout_attributes":550}],552:[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),c={scale:l*r.r*2/n,rCenter:1-l,rotate:0};if(c.scale>=1)return c;var u=a+1/(2*Math.tan(o)),f=r.r*Math.min(1/(Math.sqrt(u*u+.5)+u),s/(Math.sqrt(a*a+s/2)+a)),h={scale:2*f/t.height,rCenter:Math.cos(f/r.r)-f*a/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},d=1/a,p=d+1/(2*Math.tan(o)),g=r.r*Math.min(1/(Math.sqrt(p*p+.5)+p),s/(Math.sqrt(d*d+s/2)+d)),v={scale:2*g/t.width,rCenter:Math.cos(g/r.r)-g/a/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},m=v.scale>h.scale?v:h;return c.scale<1&&m.scale>c.scale?m:c}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 0>r&&(i*=-1),0>n&&(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]}function i(t,r){r||(r={});var n,i,a,s,h,d,g=r.labelExtraY+(o?r.yLabelMax:r.yLabelMin),v=o?t.yLabelMin:t.yLabelMax,m=o?t.yLabelMax:t.yLabelMin,y=t.cyFinal+c(t.px0[1],t.px1[1]),b=g-v;if(b*f>0&&(t.labelExtraY=b),Array.isArray(e.pull))for(i=0;i=e.pull[a.i]||((t.pxmid[1]-a.pxmid[1])*f>0?(s=a.cyFinal+c(a.px0[1],a.px1[1]),b=s-v-t.labelExtraY,b*f>0&&(t.labelExtraY+=b)):(m+t.labelExtraY-y)*f>0&&(n=3*u*Math.abs(i-p.indexOf(t)),h=a.cxFinal+l(a.px0[0],a.px1[0]),d=h+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX,d*u>0&&(t.labelExtraX+=d)))}var a,o,s,l,c,u,f,h,d,p,g,v,m;for(o=0;2>o;o++)for(s=o?r:n,c=o?Math.max:Math.min,f=o?1:-1,a=0;2>a;a++){for(l=a?Math.max:Math.min,u=a?1:-1,h=t[o][a],h.sort(s),d=t[1-o][a],p=d.concat(h),v=[],g=0;gu&&(u=s.pull[a]);o.r=Math.min(r/c(s.tilt,Math.sin(l),s.depth),n/c(s.tilt,Math.cos(l),s.depth))/(2+2*u),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;af.vTotal/2?1:0)}function c(t,e,r){if(!t)return 1;var n=Math.sin(t*Math.PI/180);return Math.max(.01,r*n*Math.abs(e)+2*Math.sqrt(1-n*n*e*e))}var u=t("d3"),f=t("../../plots/cartesian/graph_interact"),h=t("../../components/color"),d=t("../../components/drawing"),p=t("../../lib/svg_text_utils"),g=t("./helpers");e.exports=function(t,e){var r=t._fullLayout;s(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 s=u.select(this),c=e[0],v=c.trace,m=0,y=(v.depth||0)*c.r*Math.sin(m)/2,b=v.tiltaxis||0,x=b*Math.PI/180,_=[y*Math.sin(x),y*Math.cos(x)],w=c.r*Math.cos(m),k=s.selectAll("g.part").data(v.tilt?["top","sides"]:["top"]);k.enter().append("g").attr("class",function(t){return t+" part"}),k.exit().remove(),k.order(),l(e),s.selectAll(".top").each(function(){var s=u.select(this).selectAll("g.slice").data(e);s.enter().append("g").classed("slice",!0),s.exit().remove();var l=[[[],[]],[[],[]]],m=!1;s.each(function(o){function s(e){var n=t._fullLayout,a=t._fullData[v.index],s=a.hoverinfo;if("all"===s&&(s="label+text+value+percent+name"),!t._dragging&&n.hovermode!==!1&&"none"!==s&&s){var l=i(o,c),u=k+o.pxmid[0]*(1-l),h=A+o.pxmid[1]*(1-l),d=r.separators,p=[];-1!==s.indexOf("label")&&p.push(o.label),a.text&&a.text[o.i]&&-1!==s.indexOf("text")&&p.push(a.text[o.i]),-1!==s.indexOf("value")&&p.push(g.formatPieValue(o.v,d)),-1!==s.indexOf("percent")&&p.push(g.formatPiePercent(o.v/c.vTotal,d)),f.loneHover({x0:u-l*c.r,x1:u+l*c.r,y:h,text:p.join("
"),name:-1!==s.indexOf("name")?a.name:void 0,color:o.color,idealAlign:o.pxmid[0]<0?"left":"right"},{container:n._hoverlayer.node(), -outerContainer:n._paper.node()}),f.hover(t,e,"pie"),E=!0}}function h(e){t.emit("plotly_unhover",{points:[e]}),E&&(f.loneUnhover(r._hoverlayer.node()),E=!1)}function y(){t._hoverdata=[o],t._hoverdata.trace=e.trace,f.click(t,{target:!0})}function x(t,e,r,n){return"a"+n*c.r+","+n*w+" "+b+" "+o.largeArc+(r?" 1 ":" 0 ")+n*(e[0]-t[0])+","+n*(e[1]-t[1])}if(o.hidden)return void u.select(this).selectAll("path,g").remove();l[o.pxmid[1]<0?0:1][o.pxmid[0]<0?0:1].push(o);var k=c.cx+_[0],A=c.cy+_[1],M=u.select(this),T=M.selectAll("path.surface").data([o]),E=!1;if(T.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),M.select("path.textline").remove(),M.on("mouseover",s).on("mouseout",h).on("click",y),v.pull){var L=+(Array.isArray(v.pull)?v.pull[o.i]:v.pull)||0;L>0&&(k+=L*o.pxmid[0],A+=L*o.pxmid[1])}o.cxFinal=k,o.cyFinal=A;var S=v.hole;if(o.v===c.vTotal){var C="M"+(k+o.px0[0])+","+(A+o.px0[1])+x(o.px0,o.pxmid,!0,1)+x(o.pxmid,o.px0,!0,1)+"Z";S?T.attr("d","M"+(k+S*o.px0[0])+","+(A+S*o.px0[1])+x(o.px0,o.pxmid,!1,S)+x(o.pxmid,o.px0,!1,S)+"Z"+C):T.attr("d",C)}else{var z=x(o.px0,o.px1,!0,1);if(S){var P=1-S;T.attr("d","M"+(k+S*o.px1[0])+","+(A+S*o.px1[1])+x(o.px1,o.px0,!1,S)+"l"+P*o.px0[0]+","+P*o.px0[1]+z+"Z")}else T.attr("d","M"+k+","+A+"l"+o.px0[0]+","+o.px0[1]+z+"Z")}var R=Array.isArray(v.textposition)?v.textposition[o.i]:v.textposition,O=M.selectAll("g.slicetext").data(o.text&&"none"!==R?[0]:[]);O.enter().append("g").classed("slicetext",!0),O.exit().remove(),O.each(function(){var t=u.select(this).selectAll("text").data([0]);t.enter().append("text").attr("data-notex",1),t.exit().remove(),t.text(o.text).attr({"class":"slicetext",transform:"","data-bb":"","text-anchor":"middle",x:0,y:0}).call(d.font,"outside"===R?v.outsidetextfont:v.insidetextfont).call(p.convertToTspans),t.selectAll("tspan.line").attr({x:0,y:0});var e,r=d.bBox(t.node());"outside"===R?e=a(r,o):(e=n(r,o,c),"auto"===R&&e.scale<1&&(t.call(d.font,v.outsidetextfont),v.outsidetextfont.family===v.insidetextfont.family&&v.outsidetextfont.size===v.insidetextfont.size||(t.attr({"data-bb":""}),r=d.bBox(t.node())),e=a(r,o)));var i=k+o.pxmid[0]*e.rCenter+(e.x||0),s=A+o.pxmid[1]*e.rCenter+(e.y||0);e.outside&&(o.yLabelMin=s-r.height/2,o.yLabelMid=s,o.yLabelMax=s+r.height/2,o.labelExtraX=0,o.labelExtraY=0,m=!0),t.attr("transform","translate("+i+","+s+")"+(e.scale<1?"scale("+e.scale+")":"")+(e.rotate?"rotate("+e.rotate+")":"")+"translate("+-(r.left+r.right)/2+","+-(r.top+r.bottom)/2+")")})}),m&&o(l,v),s.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],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]);a+=Math.abs(s)>Math.abs(l)?"l"+l*t.pxmid[0]/t.pxmid[1]+","+l+"H"+(n+t.labelExtraX+o):"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(h.stroke,v.outsidetextfont.color).attr({"stroke-width":Math.min(2,v.outsidetextfont.size/8),d:a,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":303,"../../components/drawing":326,"../../lib/svg_text_utils":395,"../../plots/cartesian/graph_interact":412,"./helpers":548,d3:113}],553:[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":554,d3:113}],554:[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,fill:e.color}).call(n.stroke,i)}},{"../../components/color":303}],555:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){var e=t[0].trace,r=e.marker;if(n.mergeArray(e.text,t,"tx"),n.mergeArray(e.textposition,t,"tp"),e.textfont&&(n.mergeArray(e.textfont.size,t,"ts"),n.mergeArray(e.textfont.color,t,"tc"),n.mergeArray(e.textfont.family,t,"tf")),r&&r.line){var i=r.line;n.mergeArray(r.opacity,t,"mo"),n.mergeArray(r.symbol,t,"mx"),n.mergeArray(r.color,t,"mc"),n.mergeArray(i.color,t,"mlc"),n.mergeArray(i.width,t,"mlw")}}},{"../../lib":382}],556:[function(t,e,r){"use strict";var n=t("../../components/colorscale/color_attributes"),i=t("../../components/drawing"),a=(t("./constants"),t("../../lib/extend").extendFlat);e.exports={x:{valType:"data_array"},x0:{valType:"any",dflt:0},dx:{valType:"number",dflt:1},y:{valType:"data_array"},y0:{valType:"any",dflt:0},dy:{valType:"number",dflt:1},text:{valType:"string",dflt:"",arrayOk:!0},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear"},smoothing:{valType:"number",min:0,max:1.3,dflt:1},dash:{valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid"}},connectgaps:{valType:"boolean",dflt:!1},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],dflt:"none"},fillcolor:{valType:"color"},marker:a({},{symbol:{valType:"enumerated",values:i.symbolList,dflt:"circle",arrayOk:!0},opacity:{valType:"number",min:0,max:1,arrayOk:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0},maxdisplayed:{valType:"number",min:0,dflt:0},sizeref:{valType:"number",dflt:1},sizemin:{valType:"number",min:0,dflt:0},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter"},showscale:{valType:"boolean",dflt:!1},line:a({},{width:{valType:"number",min:0,arrayOk:!0}},n("marker.line"))},n("marker")),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0},textfont:{family:{valType:"string",noBlank:!0,strict:!0,arrayOk:!0},size:{valType:"number",min:1,arrayOk:!0},color:{valType:"color",arrayOk:!0}},r:{valType:"data_array"},t:{valType:"data_array"},_nestedModules:{error_y:"ErrorBars",error_x:"ErrorBars","marker.colorbar":"Colorbar"}}},{"../../components/colorscale/color_attributes":311,"../../components/drawing":326,"../../lib/extend":377,"./constants":560}],557:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/cartesian/axes"),a=t("../../lib"),o=t("./subtypes"),s=t("./marker_colorscale_calc");e.exports=function(t,e){var r,l,c,u=i.getFromId(t,e.xaxis||"x"),f=i.getFromId(t,e.yaxis||"y"),h=u.makeCalcdata(e,"x"),d=f.makeCalcdata(e,"y"),p=Math.min(h.length,d.length);u._minDtick=0,f._minDtick=0,h.length>p&&h.splice(p,h.length-p),d.length>p&&d.splice(p,d.length-p);var g={padded:!0},v={padded:!0};if(o.hasMarkers(e)){if(r=e.marker,l=r.size,Array.isArray(l)){var m={type:"linear"};i.setConvert(m),l=m.makeCalcdata(e.marker,"size"),l.length>p&&l.splice(p,l.length-p)}var y,b=1.6*(e.marker.sizeref||1);y="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/b),3)}:function(t){return Math.max((t||0)/b,3)},g.ppad=v.ppad=Array.isArray(l)?l.map(y):y(l)}s(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||h[0]===h[p-1]&&d[0]===d[p-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)||h[0]===h[p-1]&&d[0]===d[p-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(v.padded=!1):v.tozero=!0,i.expand(u,h,g),i.expand(f,d,v);var x=new Array(p);for(c=0;p>c;c++)x[c]=n(h[c])&&n(d[c])?{x:h[c],y:d[c]}:{x:!1,y:!1};return void 0!==typeof l&&a.mergeArray(l,x,"ms"),t.firstscatter=!1,x}},{"../../lib":382,"../../plots/cartesian/axes":405,"./marker_colorscale_calc":570,"./subtypes":575,"fast-isnumeric":117}],558:[function(t,e,r){"use strict";e.exports=function(t){var e,r,n,i,a;for(e=0;e=0;i--)if(a=t[i],"scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}},{}],559:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../lib"),o=t("../../plots/plots"),s=t("../../components/colorscale/get_scale"),l=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,c=r.marker,u="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+u).remove(),void 0===c||!c.showscale)return void o.autoMargin(t,u);var f=s(c.colorscale),h=c.color,d=c.cmin,p=c.cmax;i(d)||(d=a.aggNums(Math.min,null,h)),i(p)||(p=a.aggNums(Math.max,null,h));var g=e[0].t.cb=l(t,u);g.fillcolor(n.scale.linear().domain(f.map(function(t){return d+t[0]*(p-d)})).range(f.map(function(t){return t[1]}))).filllevels({start:d,end:p,size:(p-d)/254}).options(c.colorbar)()}},{"../../components/colorbar/draw":306,"../../components/colorscale/get_scale":315,"../../lib":382,"../../plots/plots":454,d3:113,"fast-isnumeric":117}],560:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20}},{}],561:[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"),c=t("./line_defaults"),u=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,g),m=vi(f))break;l=f,y=g[0]*p[0]+g[1]*p[1],y>v?(v=y,c=f,d=!1):m>y&&(m=y,u=f,d=!0)}if(d?(C[z++]=c,l!==u&&(C[z++]=u)):(u!==s&&(C[z++]=u),l!==c&&(C[z++]=c)),C[z++]=l,o>=t.length||!f)break;C[z++]=f,s=f}}else C[z++]=c}E.push(C.slice(0,z))}return E}},{"../../plots/cartesian/axes":405}],568:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n=r("line.shape");"spline"===n&&r("line.smoothing")}},{}],569:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t){var e=t.marker,r=e.sizeref||1,i=e.sizemin||0,a="area"===e.sizemode?function(t){return Math.sqrt(t/r)}:function(t){return t/r};return function(t){var e=a(t/2);return n(e)&&e>0?Math.max(e,i):0}}},{"fast-isnumeric":117}],570:[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){if(a.hasMarkers(t)){var e=t.marker;n(t,"marker")&&i(t,e.color,"marker","c"),n(t,"marker.line")&&i(t,e.line.color,"marker.line","c")}}},{"../../components/colorscale/calc":310,"../../components/colorscale/has_colorscale":316,"./subtypes":575}],571:[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){var c,u=o.isBubble(t),f=(t.line||{}).color;f&&(r=f),l("marker.symbol"),l("marker.opacity",u?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),c=f&&e.marker.color!==f?f:u?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",u?1:0),u&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode"))}},{"../../components/color":303,"../../components/colorscale/defaults":313,"../../components/colorscale/has_colorscale":316,"./subtypes":575}],572:[function(t,e,r){"use strict";function n(t,e,r){var n=e.x(),a=e.y(),o=i.extent(n.range.map(n.l2c)),s=i.extent(a.range.map(a.l2c));r.forEach(function(t,e){var n=t[0].trace;if(l.hasMarkers(n)){var i=n.marker.maxdisplayed;if(0!==i){var a=t.filter(function(t){return t.x>=o[0]&&t.x<=o[1]&&t.y>=s[0]&&t.y<=s[1]}),c=Math.ceil(a.length/i),u=0;r.forEach(function(t,r){var n=t[0].trace;l.hasMarkers(n)&&n.marker.maxdisplayed>0&&e>r&&u++});var f=Math.round(u*c/3+Math.floor(u/3)*c/7.1);t.forEach(function(t){delete t.vis}),a.forEach(function(t,e){0===Math.round((e+f)%c)&&(t.vis=!0)})}}})}var i=t("d3"),a=t("../../lib"),o=t("../../components/drawing"),s=t("../../components/errorbars"),l=t("./subtypes"),c=t("./arrays_to_calcdata"),u=t("./line_points");e.exports=function(t,e,r){function f(t){return t.filter(function(t){return t.vis})}n(t,e,r);var h=e.x(),d=e.y(),p=e.plot.select(".scatterlayer").selectAll("g.trace.scatter").data(r);p.enter().append("g").attr("class","trace scatter").style("stroke-miterlimit",2),p.call(s.plot,e);var g,v,m,y,b="";p.each(function(t){var e=t[0].trace,r=e.line,n=i.select(this);if(e.visible===!0&&(v=e.fill.charAt(e.fill.length-1),"x"!==v&&"y"!==v&&(v=""),t[0].node3=n,c(t),l.hasLines(e)||"none"!==e.fill)){var a,s,f,p,x,_="",w="";g="tozero"===e.fill.substr(0,6)||"toself"===e.fill||"to"===e.fill.substr(0,2)&&!b?n.append("path").classed("js-fill",!0):null,y&&(m=y.datum(t)),y=n.append("path").classed("js-fill",!0),-1!==["hv","vh","hvh","vhv"].indexOf(r.shape)?(f=o.steps(r.shape),p=o.steps(r.shape.split("").reverse().join(""))):f=p="spline"===r.shape?function(t){var e=t[t.length-1];return t[0][0]===e[0]&&t[0][1]===e[1]?o.smoothclosed(t.slice(1),r.smoothing):o.smoothopen(t,r.smoothing)}:function(t){return"M"+t.join("L")},x=function(t){return p(t.reverse())};var k=u(t,{xaxis:h,yaxis:d,connectGaps:e.connectgaps,baseTolerance:Math.max(r.width||1,3)/4,linear:"linear"===r.shape});if(k.length){for(var A=k[0][0],M=k[k.length-1],T=M[M.length-1],E=0;E1&&n.append("path").classed("js-line",!0).attr("d",a)}g?A&&T&&(v?("y"===v?A[1]=T[1]=d.c2p(0,!0):"x"===v&&(A[0]=T[0]=h.c2p(0,!0)),g.attr("d",_+"L"+T+"L"+A+"Z")):g.attr("d",_+"Z")):"tonext"===e.fill.substr(0,6)&&_&&b&&("tonext"===e.fill?m.attr("d",_+"Z"+b+"Z"):m.attr("d",_+"L"+b.substr(1)+"Z")),b=w}}}),p.selectAll("path:not([d])").remove(),p.append("g").attr("class","points").each(function(t){var e=t[0].trace,r=i.select(this),n=l.hasMarkers(e),s=l.hasText(e);!n&&!s||e.visible!==!0?r.remove():(n&&r.selectAll("path.point").data(e.marker.maxdisplayed?f:a.identity).enter().append("path").classed("point",!0).call(o.translatePoints,h,d),s&&r.selectAll("g").data(e.marker.maxdisplayed?f:a.identity).enter().append("g").append("text").call(o.translatePoints,h,d))})}},{"../../components/drawing":326,"../../components/errorbars":332,"../../lib":382,"./arrays_to_calcdata":555,"./line_points":567,"./subtypes":575,d3:113}],573:[function(t,e,r){"use strict";var n=t("./subtypes"),i=.2;e.exports=function(t,e){var r,a,o,s,l=t.cd,c=t.xaxis,u=t.yaxis,f=[],h=l[0].trace,d=h.index,p=h.marker;if(n.hasMarkers(h)||n.hasText(h)){var g=Array.isArray(p.opacity)?1:p.opacity;if(e===!1)for(r=0;rs;s++){for(var l=[[0,0,0],[0,0,0]],c=0;3>c;c++)if(r[c])for(var u=0;2>u;u++)l[u][c]=r[c][s][u];o[s]=l}return o}var o=t("../../components/errorbars/compute_error");e.exports=a},{"../../components/errorbars/compute_error":330}],581:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.linePlot=null,this.scatterPlot=null,this.errorBars=null,this.textMarkers=null,this.delaunayMesh=null,this.color=null,this.mode="",this.dataPoints=[],this.axesBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.textLabels=null,this.data=null}function i(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],s=[];for(n=0;ni;i++){var a=t[i];a&&a.copy_zstyle!==!1&&(a=t[2]),a&&(e[i]=a.width/2,r[i]=b(a.color),n=a.thickness)}return{capSize:e,color:r,lineWidth:n}}function o(t){var e=[0,0];return Array.isArray(t)?[0,-1]:(t.indexOf("bottom")>=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 k[t]}function c(t,e,r,n,i){var a=null;if(Array.isArray(t)){a=[];for(var o=0;e>o;o++)void 0===t[o]?a[o]=n:a[o]=r(t[o],i)}else a=r(t,y.identity);return a}function u(t,e){var r,n,i,u,f,h,d=[],p=t.fullSceneLayout,g=t.dataScale,v=p.xaxis,m=p.yaxis,w=p.zaxis,k=e.marker,M=e.line,T=e.x||[],E=e.y||[],L=e.z||[],S=T.length;for(n=0;S>n;n++)i=v.d2l(T[n])*g[0],u=m.d2l(E[n])*g[1],f=w.d2l(L[n])*g[2],d[n]=[i,u,f];if(Array.isArray(e.text))h=e.text;else if(void 0!==e.text)for(h=new Array(S),n=0;S>n;n++)h[n]=e.text;if(r={position:d,mode:e.mode,text:h},"line"in e&&(r.lineColor=b(M.color),r.lineWidth=M.width,r.lineDashes=M.dash),"marker"in e){var C=_(e);r.scatterColor=x(k,1,S),r.scatterSize=c(k.size,S,s,20,C),r.scatterMarker=c(k.symbol,S,l,"\u25cf"),r.scatterLineWidth=k.line.width,r.scatterLineColor=x(k.line,1,S),r.scatterAngle=0}"textposition"in e&&(r.textOffset=o(e.textposition),r.textColor=x(e.textfont,1,S),r.textSize=c(e.textfont.size,S,y.identity,12),r.textFont=e.textfont.family,r.textAngle=0);var z=["x","y","z"];for(r.project=[!1,!1,!1],r.projectScale=[1,1,1],r.projectOpacity=[1,1,1],n=0;3>n;++n){var P=e.projection[z[n]];(r.project[n]=P.show)&&(r.projectOpacity[n]=P.opacity,r.projectScale[n]=P.scale)}r.errorBounds=A(e,g);var R=a([e.error_x,e.error_y,e.error_z]);return r.errorColor=R.color,r.errorLineWidth=R.lineWidth,r.errorCapSize=R.capSize,r.delaunayAxis=e.surfaceaxis,r.delaunayColor=b(e.surfacecolor),r}function f(t){if(Array.isArray(t)){var e=t[0];return Array.isArray(e)&&(t=e),"rgb("+t.slice(0,3).map(function(t){return Math.round(255*t)})+")"}return null}function h(t,e){var r=new n(t,e.uid);return r.update(e),r}var d=t("gl-line3d"),p=t("gl-scatter3d"),g=t("gl-error3d"),v=t("gl-mesh3d"),m=t("delaunay-triangulate"),y=t("../../lib"),b=t("../../lib/str2rgbarray"),x=t("../../lib/gl_format_color"),_=t("../scatter/make_bubble_size_func"),w=t("../../constants/gl3d_dashes"),k=t("../../constants/gl_markers"),A=t("./calc_errors"),M=n.prototype;M.handlePick=function(t){if(t.object&&(t.object===this.linePlot||t.object===this.delaunayMesh||t.object===this.textMarkers||t.object===this.scatterPlot)){t.object.highlight&&t.object.highlight(null),this.scatterPlot&&(t.object=this.scatterPlot,this.scatterPlot.highlight(t.data)),this.textLabels&&void 0!==this.textLabels[t.data.index]?t.textLabel=this.textLabels[t.data.index]:t.textLabel="";var e=t.data.index;return t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]],!0}},M.update=function(t){var e,r,n,a,o=this.scene.glplot.gl,s=w.solid;this.data=t;var l=u(this.scene,t);"mode"in l&&(this.mode=l.mode),"lineDashes"in l&&l.lineDashes in w&&(s=w[l.lineDashes]),this.color=f(l.scatterColor)||f(l.lineColor),this.dataPoints=l.position,e={gl:o,position:l.position,color:l.lineColor,lineWidth:l.lineWidth||1,dashes:s[0],dashScale:s[1],opacity:t.opacity,connectGaps:t.connectgaps},-1!==this.mode.indexOf("lines")?this.linePlot?this.linePlot.update(e):(this.linePlot=d(e),this.scene.glplot.add(this.linePlot)):this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose(),this.linePlot=null);var c=t.opacity;if(t.marker&&t.marker.opacity&&(c*=t.marker.opacity),r={gl:o,position:l.position,color:l.scatterColor,size:l.scatterSize,glyph:l.scatterMarker,opacity:c,orthographic:!0,lineWidth:l.scatterLineWidth,lineColor:l.scatterLineColor,project:l.project,projectScale:l.projectScale,projectOpacity:l.projectOpacity},-1!==this.mode.indexOf("markers")?this.scatterPlot?this.scatterPlot.update(r):(this.scatterPlot=p(r),this.scatterPlot.highlightScale=1,this.scene.glplot.add(this.scatterPlot)):this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose(),this.scatterPlot=null),a={gl:o,position:l.position,glyph:l.text,color:l.textColor,size:l.textSize,angle:l.textAngle,alignment:l.textOffset,font:l.textFont,orthographic:!0,lineWidth:0,project:!1,opacity:t.opacity},this.textLabels=l.text,-1!==this.mode.indexOf("text")?this.textMarkers?this.textMarkers.update(a):(this.textMarkers=p(a),this.textMarkers.highlightScale=1,this.scene.glplot.add(this.textMarkers)):this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose(),this.textMarkers=null),n={gl:o,position:l.position,color:l.errorColor,error:l.errorBounds,lineWidth:l.errorLineWidth,capSize:l.errorCapSize,opacity:t.opacity},this.errorBars?l.errorBounds?this.errorBars.update(n):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):l.errorBounds&&(this.errorBars=g(n),this.scene.glplot.add(this.errorBars)),l.delaunayAxis>=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.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},M.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":368,"../../constants/gl_markers":369,"../../lib":382,"../../lib/gl_format_color":380,"../../lib/str2rgbarray":394,"../scatter/make_bubble_size_func":569,"./calc_errors":580,"delaunay-triangulate":114,"gl-error3d":121,"gl-line3d":127,"gl-mesh3d":150,"gl-scatter3d":193}],582:[function(t,e,r){"use strict";function n(t,e,r){var n=0,i=r("x"),a=r("y"),o=r("z");return i&&a&&o&&(n=Math.min(i.length,a.length,o.length),n=0&&h("surfacecolor",p||g);for(var v=["x","y","z"],m=0;3>m;++m){var y="projection."+v[m];h(y+".show")&&(h(y+".opacity"),h(y+".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":331,"../../lib":382,"../scatter/line_defaults":566,"../scatter/marker_defaults":571,"../scatter/subtypes":575,"../scatter/text_defaults":576,"./attributes":578}],583:[function(t,e,r){"use strict";var n={};n.plot=t("./convert"),n.attributes=t("./attributes"),n.markerSymbols=t("../../constants/gl_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/gl_markers":369,"../../plots/gl3d":441,"../scatter/colorbar":559,"./attributes":578,"./calc":579,"./convert":581,"./defaults":582}],584:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../components/colorscale/color_attributes"),o=t("../../lib/extend").extendFlat,s=n.marker,l=n.line,c=s.line; -e.exports={lon:{valType:"data_array"},lat:{valType:"data_array"},locations:{valType:"data_array"},locationmode:{valType:"enumerated",values:["ISO-3","USA-states","country names"],dflt:"ISO-3"},mode:o({},n.mode,{dflt:"markers"}),text:o({},n.text,{}),line:{color:l.color,width:l.width,dash:l.dash},marker:o({},{symbol:s.symbol,opacity:s.opacity,size:s.size,sizeref:s.sizeref,sizemin:s.sizemin,sizemode:s.sizemode,showscale:s.showscale,line:o({},{width:c.width},a("marker.line"))},a("marker")),textfont:n.textfont,textposition:n.textposition,hoverinfo:o({},i.hoverinfo,{flags:["lon","lat","location","text","name"]}),_nestedModules:{"marker.colorbar":"Colorbar"}}},{"../../components/colorscale/color_attributes":311,"../../lib/extend":377,"../../plots/attributes":403,"../scatter/attributes":556}],585:[function(t,e,r){"use strict";var n=t("../scatter/marker_colorscale_calc");e.exports=function(t,e){var r=[{x:!1,y:!1,trace:e,t:{}}];return n(e),r}},{"../scatter/marker_colorscale_calc":570}],586:[function(t,e,r){"use strict";function n(t,e,r){var n,i,a=0,o=r("locations");return o?(r("locationmode"),a=o.length):(n=r("lon")||[],i=r("lat")||[],a=Math.min(n.length,i.length),an;n++)r[n]=[t.lon[n],t.lat[n]];return{type:"LineString",coordinates:r,trace:t}}function a(t,e){function r(e){var r=t.mockAxis;return c.tickText(r,r.c2l(e),"hover").text+"\xb0"}var n=e.hoverinfo;if("none"===n)return function(t){delete t.textLabel};var i="all"===n?v.hoverinfo.flags:n.split("+"),a=-1!==i.indexOf("location")&&Array.isArray(e.locations),o=-1!==i.indexOf("lon"),s=-1!==i.indexOf("lat"),l=-1!==i.indexOf("text");return function(t){var n=[];a?n.push(t.location):o&&s?n.push("("+r(t.lon)+", "+r(t.lat)+")"):o?n.push("lon: "+r(t.lon)):s&&n.push("lat: "+r(t.lat)),l&&n.push(t.tx||e.text),t.textLabel=n.join("
")}}function o(t){var e=Array.isArray(t.locations);return function(r,n){return{points:[{data:t._input,fullData:t,curveNumber:t.index,pointNumber:n,lon:r.lon,lat:r.lat,location:e?r.location:null}]}}}var s=t("d3"),l=t("../../plots/cartesian/graph_interact"),c=t("../../plots/cartesian/axes"),u=t("../../lib/topojson_utils").getTopojsonFeatures,f=t("../../lib/geo_location_utils").locationToFeature,h=t("../../lib/array_to_calc_item"),d=t("../../components/color"),p=t("../../components/drawing"),g=t("../scatter/subtypes"),v=t("./attributes"),m=e.exports={};m.calcGeoJSON=function(t,e){var r,i,a,o,s=[],l=Array.isArray(t.locations);l?(o=t.locations,r=o.length,i=u(t,e),a=function(t,e){var r=f(t.locationmode,o[e],i);return void 0!==r?r.properties.ct:void 0}):(r=t.lon.length,a=function(t,e){return[t.lon[e],t.lat[e]]});for(var c=0;r>c;c++){var h=a(t,c);if(h){var d={lon:h[0],lat:h[1],location:l?t.locations[c]:null};n(t,d,c),s.push(d)}}return s.length>0&&(s[0].trace=t),s},m.plot=function(t,e){var r=t.framework.select(".scattergeolayer").selectAll("g.trace.scattergeo").data(e,function(t){return t.uid});r.enter().append("g").attr("class","trace scattergeo"),r.exit().remove(),r.selectAll("*").remove(),r.each(function(t){var e=s.select(this);g.hasLines(t)&&e.selectAll("path.js-line").data([i(t)]).enter().append("path").classed("js-line",!0)}),r.each(function(e){function r(r,n){if(t.showHover){var i=t.projection([r.lon,r.lat]);h(r),l.loneHover({x:i[0],y:i[1],name:v?e.name:void 0,text:r.textLabel,color:r.mc||(e.marker||{}).color},{container:t.hoverContainer.node()}),y=d(r,n),t.graphDiv.emit("plotly_hover",y)}}function n(e,r){t.graphDiv.emit("plotly_click",d(e,r))}var i=s.select(this),c=g.hasMarkers(e),u=g.hasText(e);if(c||u){var f=m.calcGeoJSON(e,t.topojson),h=a(t,e),d=o(e),p=e.hoverinfo,v="all"===p||-1!==p.indexOf("name"),y=null;c&&i.selectAll("path.point").data(f).enter().append("path").classed("point",!0).on("mouseover",r).on("click",n).on("mouseout",function(){l.loneUnhover(t.hoverContainer),t.graphDiv.emit("plotly_unhover",y)}).on("mousedown",function(){l.loneUnhover(t.hoverContainer)}).on("mouseup",r),u&&i.selectAll("g").data(f).enter().append("g").append("text")}}),m.style(t)},m.style=function(t){var e=t.framework.selectAll("g.trace.scattergeo");e.style("opacity",function(t){return t.opacity}),e.each(function(t){s.select(this).selectAll("path.point").call(p.pointStyle,t),s.select(this).selectAll("text").call(p.textPointStyle,t)}),e.selectAll("path.js-line").style("fill","none").each(function(t){var e=t.trace,r=e.line||{};s.select(this).call(d.stroke,r.color).call(p.dashLine,r.dash||"",r.width||0)})}},{"../../components/color":303,"../../components/drawing":326,"../../lib/array_to_calc_item":373,"../../lib/geo_location_utils":379,"../../lib/topojson_utils":396,"../../plots/cartesian/axes":405,"../../plots/cartesian/graph_interact":412,"../scatter/subtypes":575,"./attributes":584,d3:113}],589:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/colorscale/color_attributes"),a=t("../../constants/gl2d_dashes"),o=t("../../constants/gl_markers"),s=t("../../lib/extend").extendFlat,l=t("../../lib/extend").extendDeep,c=n.line,u=n.marker,f=u.line;e.exports={x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,text:s({},n.text,{}),mode:{valType:"flaglist",flags:["lines","markers"],extras:["none"]},line:{color:c.color,width:c.width,dash:{valType:"enumerated",values:Object.keys(a),dflt:"solid"}},marker:l({},i("marker"),{symbol:{valType:"enumerated",values:Object.keys(o),dflt:"circle",arrayOk:!0},size:u.size,sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,opacity:u.opacity,showscale:u.showscale,line:l({},i("marker.line"),{width:f.width})}),connectgaps:n.connectgaps,fill:s({},n.fill,{values:["none","tozeroy","tozerox"]}),fillcolor:n.fillcolor,_nestedModules:{error_x:"ErrorBars",error_y:"ErrorBars","marker.colorbar":"Colorbar"}}},{"../../components/colorscale/color_attributes":311,"../../constants/gl2d_dashes":367,"../../constants/gl_markers":369,"../../lib/extend":377,"../scatter/attributes":556}],590:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.connectgaps=!0,this.idToIndex=[],this.bounds=[0,0,0,0],this.hasLines=!1,this.lineOptions={positions:new Float32Array(0),color:[0,0,0,1],width:1,fill:[!1,!1,!1,!1],fillColor:[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],dashes:[1]},this.line=d(t.glplot,this.lineOptions),this.line._trace=this,this.hasErrorX=!1,this.errorXOptions={positions:new Float32Array(0),errors:new Float32Array(0),lineWidth:1,capSize:0,color:[0,0,0,1]},this.errorX=p(t.glplot,this.errorXOptions),this.errorX._trace=this,this.hasErrorY=!1,this.errorYOptions={positions:new Float32Array(0),errors:new Float32Array(0),lineWidth:1,capSize:0,color:[0,0,0,1]},this.errorY=p(t.glplot,this.errorYOptions),this.errorY._trace=this,this.hasMarkers=!1,this.scatterOptions={positions:new Float32Array(0),sizes:[],colors:[],glyphs:[],borderWidths:[],borderColors:[],size:12,color:[0,0,0,1],borderSize:1,borderColor:[0,0,0,1]},this.scatter=f(t.glplot,this.scatterOptions),this.scatter._trace=this,this.fancyScatter=h(t.glplot,this.scatterOptions),this.fancyScatter._trace=this}function i(t,e,r){return Array.isArray(e)||(e=[e]),a(t,e,r)}function a(t,e,r){for(var n=new Array(r),i=e[0],a=0;r>a;++a)n[a]=t(a>=e.length?i:e[a]);return n}function o(t,e,r){return l(S(t,r),L(e,r),r)}function s(t,e,r,n){var i=x(t,e,n);return i=Array.isArray(i[0])?i:a(v.identity,[i],n),l(i,L(r,n),n)}function l(t,e,r){for(var n=new Array(4*r),i=0;r>i;++i){for(var a=0;3>a;++a)n[4*i+a]=t[i][a];n[4*i+3]=t[i][3]*e[i]}return n}function c(t,e){if(void 0===Float32Array.slice){for(var r=new Float32Array(e),n=0;e>n;n++)r[n]=t[n];return r}return t.slice(0,e)}function u(t,e){var r=new n(t,e.uid);return r.update(e),r}var f=t("gl-scatter2d"),h=t("gl-scatter2d-fancy"),d=t("gl-line2d"),p=t("gl-error2d"),g=t("fast-isnumeric"),v=t("../../lib"),m=t("../../plots/cartesian/axes"),y=t("../../components/errorbars"),b=t("../../lib/str2rgbarray"),x=t("../../lib/gl_format_color"),_=t("../scatter/subtypes"),w=t("../scatter/make_bubble_size_func"),k=t("../scatter/get_trace_color"),A=t("../../constants/gl_markers"),M=t("../../constants/gl2d_dashes"),T=["xaxis","yaxis"],E=n.prototype;E.handlePick=function(t){var e=t.pointId;return(t.object!==this.line||this.connectgaps)&&(e=this.idToIndex[t.pointId]),{trace:this,dataCoord:t.dataCoord,traceCoord:[this.pickXData[e],this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:Array.isArray(this.color)?this.color[e]:this.color,name:this.name,hoverinfo:this.hoverinfo}},E.isFancy=function(t){if("linear"!==this.scene.xaxis.type)return!0;if("linear"!==this.scene.yaxis.type)return!0;if(!t.x||!t.y)return!0;if(this.hasMarkers){var e=t.marker||{};if(Array.isArray(e.symbol)||"circle"!==e.symbol||Array.isArray(e.size)||Array.isArray(e.color)||Array.isArray(e.line.width)||Array.isArray(e.line.color)||Array.isArray(e.opacity))return!0}return this.hasLines&&!this.connectgaps?!0:this.hasErrorX?!0:!!this.hasErrorY};var L=i.bind(null,function(t){return+t}),S=i.bind(null,b),C=i.bind(null,function(t){return A[t]||"\u25cf"});E.update=function(t){t.visible!==!0?(this.hasLines=!1,this.hasErrorX=!1,this.hasErrorY=!1,this.hasMarkers=!1):(this.hasLines=_.hasLines(t),this.hasErrorX=t.error_x.visible===!0,this.hasErrorY=t.error_y.visible===!0,this.hasMarkers=_.hasMarkers(t)),this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.connectgaps=!!t.connectgaps,this.isFancy(t)?this.updateFancy(t):this.updateFast(t),this.color=k(t,{})},E.updateFast=function(t){for(var e,r,n=this.xData=this.pickXData=t.x,i=this.yData=this.pickYData=t.y,a=n.length,o=new Array(a),s=new Float32Array(2*a),l=this.bounds,u=0,f=0,h=0;a>h;++h)e=n[h],r=i[h],g(e)&&g(r)&&(o[u++]=h,s[f++]=e,s[f++]=r,l[0]=Math.min(l[0],e),l[1]=Math.min(l[1],r),l[2]=Math.max(l[2],e),l[3]=Math.max(l[3],r));s=c(s,f),this.idToIndex=o,this.updateLines(t,s),this.updateError("X",t),this.updateError("Y",t);var d;if(this.hasMarkers){this.scatterOptions.positions=s;var p=b(t.marker.color),v=b(t.marker.line.color),m=t.opacity*t.marker.opacity;p[3]*=m,this.scatterOptions.color=p,v[3]*=m,this.scatterOptions.borderColor=v,d=t.marker.size,this.scatterOptions.size=d,this.scatterOptions.borderSize=t.marker.line.width,this.scatter.update(this.scatterOptions)}else this.scatterOptions.positions=new Float32Array(0),this.scatterOptions.glyphs=[],this.scatter.update(this.scatterOptions);this.scatterOptions.positions=new Float32Array(0),this.scatterOptions.glyphs=[],this.fancyScatter.update(this.scatterOptions),this.expandAxesFast(l,d)},E.updateFancy=function(t){var e=this.scene,r=e.xaxis,n=e.yaxis,a=this.bounds,o=this.pickXData=r.makeCalcdata(t,"x").slice(),l=this.pickYData=n.makeCalcdata(t,"y").slice();this.xData=o.slice(),this.yData=l.slice();var u,f,h,d,p,g,v,m,b=y.calcFromTrace(t,e.fullLayout),x=o.length,_=new Array(x),k=new Float32Array(2*x),A=new Float32Array(4*x),M=new Float32Array(4*x),T=0,E=0,S=0,z=0,P="log"===r.type?function(t){return r.d2l(t)}:function(t){return t},R="log"===n.type?function(t){return n.d2l(t)}:function(t){return t};for(u=0;x>u;++u)this.xData[u]=h=P(o[u]),this.yData[u]=d=R(l[u]),isNaN(h)||isNaN(d)||(_[T++]=u,k[E++]=h,k[E++]=d,p=A[S++]=h-b[u].xs||0,g=A[S++]=b[u].xh-h||0,A[S++]=0,A[S++]=0,M[z++]=0,M[z++]=0,v=M[z++]=d-b[u].ys||0,m=M[z++]=b[u].yh-d||0,a[0]=Math.min(a[0],h-p),a[1]=Math.min(a[1],d-v),a[2]=Math.max(a[2],h+g),a[3]=Math.max(a[3],d+m));k=c(k,E),this.idToIndex=_,this.updateLines(t,k),this.updateError("X",t,k,A),this.updateError("Y",t,k,M);var O;if(this.hasMarkers){this.scatterOptions.positions=k,this.scatterOptions.sizes=new Array(T),this.scatterOptions.glyphs=new Array(T),this.scatterOptions.borderWidths=new Array(T),this.scatterOptions.colors=new Array(4*T),this.scatterOptions.borderColors=new Array(4*T);var I,N=w(t),j=t.marker,F=j.opacity,D=t.opacity,B=s(j,F,D,x),U=C(j.symbol,x),V=L(j.line.width,x),q=s(j.line,F,D,x);for(O=i(N,j.size,x),u=0;T>u;++u)for(I=_[u],this.scatterOptions.sizes[u]=4*O[I],this.scatterOptions.glyphs[u]=U[I],this.scatterOptions.borderWidths[u]=.5*V[I],f=0;4>f;++f)this.scatterOptions.colors[4*u+f]=B[4*I+f],this.scatterOptions.borderColors[4*u+f]=q[4*I+f];this.fancyScatter.update(this.scatterOptions)}else this.scatterOptions.positions=new Float32Array(0),this.scatterOptions.glyphs=[],this.fancyScatter.update(this.scatterOptions);this.scatterOptions.positions=new Float32Array(0),this.scatterOptions.glyphs=[],this.scatter.update(this.scatterOptions),this.expandAxesFancy(o,l,O)},E.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 Float32Array(2*a.length),r=0;ro;o++)r=this.scene[T[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})},E.expandAxesFancy=function(t,e,r){var n=this.scene,i={padded:!0,ppad:r};m.expand(n.xaxis,t,i),m.expand(n.yaxis,e,i)},E.dispose=function(){this.line.dispose(),this.errorX.dispose(),this.errorY.dispose(),this.scatter.dispose(),this.fancyScatter.dispose()},e.exports=u},{"../../components/errorbars":332,"../../constants/gl2d_dashes":367,"../../constants/gl_markers":369,"../../lib":382,"../../lib/gl_format_color":380,"../../lib/str2rgbarray":394,"../../plots/cartesian/axes":405,"../scatter/get_trace_color":563,"../scatter/make_bubble_size_func":569,"../scatter/subtypes":575,"fast-isnumeric":117,"gl-error2d":119,"gl-line2d":125,"gl-scatter2d":190,"gl-scatter2d-fancy":185}],591:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/constants"),a=t("../scatter/subtypes"),o=t("../scatter/xy_defaults"),s=t("../scatter/marker_defaults"),l=t("../scatter/line_defaults"),c=t("../scatter/fillcolor_defaults"),u=t("../../components/errorbars/defaults"),f=t("./attributes");e.exports=function(t,e,r,h){function d(r,i){return n.coerce(t,e,f,r,i)}var p=o(t,e,d);return p?(d("text"),d("mode",pr;r++)y=e.a[r],b=e.b[r],x=e.c[r],n(y)&&n(b)&&n(x)?(y=+y,b=+b,x=+x,_=v/(y+b+x),1!==_&&(y*=_,b*=_,x*=_),k=y,w=x-b,M[r]={x:w,y:k,a:y,b:b,c:x}):M[r]={x:!1,y:!1};var T,E;if(o.hasMarkers(e)&&(T=e.marker,E=T.size,Array.isArray(E))){var L={type:"linear"};i.setConvert(L),E=L.makeCalcdata(e.marker,"size"),E.length>A&&E.splice(A,E.length-A)}return s(e),void 0!==typeof E&&a.mergeArray(E,M,"ms"),M}},{"../../lib":382,"../../plots/cartesian/axes":405,"../scatter/marker_colorscale_calc":570,"../scatter/subtypes":575,"fast-isnumeric":117}],595:[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"),c=t("../scatter/text_defaults"),u=t("../scatter/fillcolor_defaults"),f=t("./attributes");e.exports=function(t,e,r,h){function d(r,i){return n.coerce(t,e,f,r,i)}var p,g=d("a"),v=d("b"),m=d("c");if(g?(p=g.length,v?(p=Math.min(p,v.length),m&&(p=Math.min(p,m.length))):p=m?Math.min(p,m.length):0):v&&m&&(p=Math.min(v.length,m.length)),!p)return void(e.visible=!1);g&&p"),s}}},{"../../plots/cartesian/axes":405,"../scatter/hover":564}],597:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="scatterternary",n.basePlotModule=t("../../plots/ternary"),n.categories=["ternary","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../plots/ternary":461,"../scatter/colorbar":559,"./attributes":593,"./calc":594,"./defaults":595,"./hover":596,"./plot":598,"./select":599,"./style":600}],598:[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={x:function(){return t.xaxis},y:function(){return t.yaxis},plot:r},a=new Array(e.length),o=t.graphDiv.calcdata,s=0;se){for(var r=g/e,n=[0|Math.floor(t[0].shape[0]*r+1),0|Math.floor(t[0].shape[1]*r+1)],i=n[0]*n[1],o=0;or;++r)this.showContour[r]&&(e=!0,t[r]=this.scene.contourLevels[r]);e&&this.surface.update({levels:t})},v.update=function(t){var e,r=this.scene,n=r.fullSceneLayout,a=this.surface,s=t.opacity,l=i(t.colorscale,s),u=t.z,h=t.x,d=t.y,g=n.xaxis,v=n.yaxis,m=n.zaxis,y=r.dataScale,b=u[0].length,x=u.length,_=[c(new Float32Array(b*x),[b,x]),c(new Float32Array(b*x),[b,x]),c(new Float32Array(b*x),[b,x])],w=_[0],k=_[1],A=r.contourLevels;this.data=t,f(_[2],function(t,e){return m.d2l(u[e][t])*y[2]}),Array.isArray(h[0])?f(w,function(t,e){return g.d2l(h[e][t])*y[0]}):f(w,function(t){return g.d2l(h[t])*y[0]}),Array.isArray(d[0])?f(k,function(t,e){return v.d2l(d[e][t])*y[1]}):f(k,function(t,e){return v.d2l(d[e])*y[1]});var M={colormap:l,levels:[[],[],[]],showContour:[!0,!0,!0],showSurface:!t.hidesurface,contourProject:[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],contourWidth:[1,1,1],contourColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],contourTint:[1,1,1],dynamicColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],dynamicWidth:[1,1,1],dynamicTint:[1,1,1],opacity:1};if(M.intensityBounds=[t.cmin,t.cmax],t.surfacecolor){var T=c(new Float32Array(b*x),[b,x]);f(T,function(e,r){return t.surfacecolor[r][e]}),_.push(T)}else M.intensityBounds[0]*=y[2],M.intensityBounds[1]*=y[2];this.dataScale=o(_),t.surfacecolor&&(M.intensity=_.pop()),"opacity"in t&&t.opacity<1&&(M.opacity=.25*t.opacity);var E=[!0,!0,!0],L=["x","y","z"];for(e=0;3>e;++e){var S=t.contours[L[e]];E[e]=S.highlight,M.showContour[e]=S.show||S.highlight,M.showContour[e]&&(M.contourProject[e]=[S.project.x,S.project.y,S.project.z],S.show?(this.showContour[e]=!0,M.levels[e]=A[e],a.highlightColor[e]=M.contourColor[e]=p(S.color),S.usecolormap?a.highlightTint[e]=M.contourTint[e]=0:a.highlightTint[e]=M.contourTint[e]=1,M.contourWidth[e]=S.width):this.showContour[e]=!1,S.highlight&&(M.dynamicColor[e]=p(S.highlightcolor),M.dynamicWidth[e]=S.highlightwidth))}M.coords=_,a.update(M),a.visible=t.visible,a.enableDynamic=E,a.snapToData=!0,"lighting"in t&&(a.ambientLight=t.lighting.ambient,a.diffuseLight=t.lighting.diffuse,a.specularLight=t.lighting.specular,a.roughness=t.lighting.roughness,a.fresnel=t.lighting.fresnel),"lightposition"in t&&(a.lightPosition=[t.lightposition.x,t.lightposition.y,t.lightposition.z]),s&&1>s&&(a.supportsTransparency=!0)},v.dispose=function(){this.scene.glplot.remove(this.surface),this.surface.dispose()},e.exports=s},{"../../lib/str2rgbarray":394,"gl-surface3d":221,ndarray:253,"ndarray-fill":246,"ndarray-homography":251,"ndarray-ops":252,tinycolor2:274}],605:[function(t,e,r){"use strict";function n(t,e,r){e in t&&!(r in t)&&(t[r]=t[e])}var 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)}var c,u,f=l("z");if(!f)return void(e.visible=!1);var h=f[0].length,d=f.length;if(l("x"),l("y"),!Array.isArray(e.x))for(e.x=[],c=0;h>c;++c)e.x[c]=c;if(l("text"),!Array.isArray(e.y))for(e.y=[],c=0;d>c;++c)e.y[c]=c;["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lightposition.x","lightposition.y","lightposition.z","hidesurface","opacity"].forEach(function(t){l(t)});var p=l("surfacecolor");l("colorscale");var g=["x","y","z"];for(c=0;3>c;++c){var v="contours."+g[c],m=l(v+".show"),y=l(v+".highlight");if(m||y)for(u=0;3>u;++u)l(v+".project."+g[u]);m&&(l(v+".color"),l(v+".width"),l(v+".usecolormap")),y&&(l(v+".highlightcolor"),l(v+".highlightwidth"))}p||(n(t,"zmin","cmin"),n(t,"zmax","cmax"),n(t,"zauto","cauto")),a(t,e,s,l,{prefix:"",cLetter:"c"})}},{"../../components/colorscale/defaults":313,"../../lib":382,"./attributes":601}],606:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("./colorbar"),n.calc=t("./calc"),n.plot=t("./convert"),n.moduleType="trace",n.name="surface",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d","noOpacity"],n.meta={},e.exports=n},{"../../plots/gl3d":441,"./attributes":601,"./calc":602,"./colorbar":603,"./convert":604,"./defaults":605}]},{},[12])(12)}); \ No newline at end of file +r.unique=c,r.findCell=u,r.incidence=f,r.dual=h,r.explode=d,r.skeleton=p,r.boundary=g,r.connectedComponents=y},{"bit-twiddle":236,"union-find":237}],239:[function(t,e,r){"use strict";function n(t){for(var e=new Array(t),r=0;t>r;++r)e[r]=r;return e}e.exports=n},{}],240:[function(t,e,r){e.exports=function(t){return!(null==t||!(t._isBuffer||t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)))}},{}],241:[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!==h||a!==d||o!==p||r(n))&&(h=0|t,d=a||0,p=o||0,e(h,d,p,g))}function a(t){n(0,t)}function o(){(h||d||p||g.shift||g.alt||g.meta||g.control)&&(d=p=0,h=0,g.shift=g.alt=g.control=g.meta=!1,e(0,0,0,g))}function s(t){r(t)&&e(h,d,p,g)}function l(t){0===i.buttons(t)?n(0,t):n(h,t)}function c(t){n(h|i.buttons(t),t)}function u(t){n(h&~i.buttons(t),t)}function f(){v||(v=!0,t.addEventListener("mousemove",l),t.addEventListener("mousedown",c),t.addEventListener("mouseup",u),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)))}e||(e=t,t=window);var h=0,d=0,p=0,g={shift:!1,alt:!1,control:!1,meta:!1},v=!1;f();var m={element:t};return Object.defineProperties(m,{enabled:{get:function(){return v},set:function(t){t&&f()},enumerable:!0},buttons:{get:function(){return h},enumerable:!0},x:{get:function(){return d},enumerable:!0},y:{get:function(){return p},enumerable:!0},mods:{get:function(){return g},enumerable:!0}}),m}e.exports=n;var i=t("mouse-event")},{"mouse-event":242}],242:[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&&r=0&&r+1=0&&n=0&&n+1=0&&s=0&&s+1=0&&i=0&&i+1=0&&l=0&&l+1=0&&h=0&&h+1e;++e)r=+arguments[e+1],i[e]=Math.floor(r),a[e]=r-i[e],o[e]=0<=i[e]&&i[e]e;++e){for(c=1,u=t.offset,l=0;n>l;++l)if(e&1<r;++r){t[r]=o[(n+1)*n+r];for(var i=0;n>i;++i)t[r]+=o[(n+1)*i+r]*e[i]}for(var a=o[(n+1)*(n+1)-1],i=0;n>i;++i)a+=o[(n+1)*i+n]*e[i];for(var s=1/a,r=0;n>r;++r)t[r]*=s;return t}),t}var i=t("ndarray-warp"),a=t("gl-matrix-invert");e.exports=n},{"gl-matrix-invert":247,"ndarray-warp":250}],252:[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]=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 c={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in c){var e=c[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 u={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in u){var e=u[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":109}],253:[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;te&&(r="View_Nil"+t);var n="generic"===t;if(-1===e){var a="function "+r+"(a){this.data=a;};var proto="+r+".prototype;proto.dtype='"+t+"';proto.index=function(){return -1};proto.size=0;proto.dimension=-1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function(){return new "+r+"(this.data);};proto.get=proto.set=function(){};proto.pick=function(){return null};return function construct_"+r+"(a){return new "+r+"(a);}",o=new Function(a);return o()}if(0===e){var a="function "+r+"(a,d) {this.data = a;this.offset = d};var proto="+r+".prototype;proto.dtype='"+t+"';proto.index=function(){return this.offset};proto.dimension=0;proto.size=1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function "+r+"_copy() {return new "+r+"(this.data,this.offset)};proto.pick=function "+r+"_pick(){return TrivialArray(this.data);};proto.valueOf=proto.get=function "+r+"_get(){return "+(n?"this.data.get(this.offset)":"this.data[this.offset]")+"};proto.set=function "+r+"_set(v){return "+(n?"this.data.set(this.offset,v)":"this.data[this.offset]=v")+"};return function construct_"+r+"(a,b,c,d){return new "+r+"(a,d)}",o=new Function("TrivialArray",a);return o(f[t][0])}var a=["'use strict'"],s=l(e),c=s.map(function(t){return"i"+t}),u="this.offset+"+s.map(function(t){return"this.stride["+t+"]*i"+t}).join("+"),h=s.map(function(t){return"b"+t}).join(","),d=s.map(function(t){return"c"+t}).join(",");a.push("function "+r+"(a,"+h+","+d+",d){this.data=a","this.shape=["+h+"]","this.stride=["+d+"]","this.offset=d|0}","var proto="+r+".prototype","proto.dtype='"+t+"'","proto.dimension="+e),a.push("Object.defineProperty(proto,'size',{get:function "+r+"_size(){return "+s.map(function(t){return"this.shape["+t+"]"}).join("*"),"}})"),1===e?a.push("proto.order=[0]"):(a.push("Object.defineProperty(proto,'order',{get:"),4>e?(a.push("function "+r+"_order(){"),2===e?a.push("return (Math.abs(this.stride[0])>Math.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("+c.join(",")+",v){"),n?a.push("return this.data.set("+u+",v)}"):a.push("return this.data["+u+"]=v}"),a.push("proto.get=function "+r+"_get("+c.join(",")+"){"),n?a.push("return this.data.get("+u+")}"):a.push("return this.data["+u+"]}"),a.push("proto.index=function "+r+"_index(",c.join(),"){return "+u+"}"),a.push("proto.hi=function "+r+"_hi("+c.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+"]"});a.push("proto.lo=function "+r+"_lo("+c.join(",")+"){var b=this.offset,d=0,"+p.join(",")+","+g.join(","));for(var v=0;e>v;++v)a.push("if(typeof i"+v+"==='number'&&i"+v+">=0){d=i"+v+"|0;b+=c"+v+"*d;a"+v+"-=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("+c.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 v=0;e>v;++v)a.push("if(typeof i"+v+"==='number'){d=i"+v+"|0;if(d<0){c+=b"+v+"*(a"+v+"-1);a"+v+"=ceil(-a"+v+"/d)}else{a"+v+"=ceil(a"+v+"/d)}b"+v+"*=d}");a.push("return new "+r+"(this.data,"+s.map(function(t){return"a"+t}).join(",")+","+s.map(function(t){return"b"+t}).join(",")+",c)}");for(var m=new Array(e),y=new Array(e),v=0;e>v;++v)m[v]="a[i"+v+"]",y[v]="b[i"+v+"]";a.push("proto.transpose=function "+r+"_transpose("+c+"){"+c.map(function(t,e){return t+"=("+t+"===undefined?"+e+":"+t+"|0)"}).join(";"),"var a=this.shape,b=this.stride;return new "+r+"(this.data,"+m.join(",")+","+y.join(",")+",this.offset)}"),a.push("proto.pick=function "+r+"_pick("+c+"){var a=[],b=[],c=this.offset");for(var v=0;e>v;++v)a.push("if(typeof i"+v+"==='number'&&i"+v+">=0){c=(c+this.stride["+v+"]*i"+v+")|0}else{a.push(this.shape["+v+"]);b.push(this.stride["+v+"])}");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(f[t],i)}function o(t){if(c(t))return"buffer";if(u)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=f.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,c=1;l>=0;--l)r[l]=c,c*=e[l]}if(void 0===n){n=0;for(var l=0;s>l;++l)r[l]<0&&(n-=(e[l]-1)*r[l])}for(var u=o(t),h=f[u];h.length<=s+1;)h.push(a(u,h.length-1));var i=h[s+1];return i(t,e,r,n)}var l=t("iota-array"),c=t("is-buffer"),u="undefined"!=typeof Float64Array,f={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};e.exports=s},{"iota-array":239,"is-buffer":240}],254:[function(t,e,r){"use strict";function n(t,e){if("string"!=typeof t)throw new TypeError("repeat-string expects a string.");if(1===e)return t;if(2===e)return t+t;var r=t.length*e;for(i===t&&"undefined"!=typeof i||(i=t,a="");r>a.length&&e>0&&(1&e&&(a+=t),e>>=1);)t+=t;return a.substr(0,r)}var i,a="";e.exports=n},{}],255:[function(t,e,r){(function(t){e.exports=t.performance&&t.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],256:[function(t,e,r){"use strict";function n(t){for(var e="robustLinearSolve"+t+"d",r=["function ",e,"(A,b){return ["],n=0;t>n;++n){r.push("det([");for(var i=0;t>i;++i){i>0&&r.push(","),r.push("[");for(var a=0;t>a;++a)a>0&&r.push(","),a===n?r.push("+b[",i,"]"):r.push("+A[",i,"][",a,"]");r.push("]")}r.push("]),")}r.push("det(A)]}return ",e);var o=new Function("det",r.join(""));return o(6>t?s[t]:s)}function i(){return[0]}function a(t,e){return[[e[0]],[t[0][0]]]}function o(){for(;c.lengthi;++i)t.push("s"+i),r.push("case ",i,":return s",i,"(A,b);");r.push("}var s=CACHE[A.length];if(!s)s=CACHE[A.length]=g(A.length);return s(A,b)}return dispatchLinearSolve"),t.push("CACHE","g",r.join(""));var a=Function.apply(void 0,t);e.exports=a.apply(void 0,c.concat([c,n]));for(var i=0;l>i;++i)e.exports[i]=c[i]}var s=t("robust-determinant"),l=6,c=[i,a];o()},{"robust-determinant":258}],257:[function(t,e,r){"use strict";function n(t){for(var e=t.length,r=t[t.length-1],n=e,i=e-2;i>=0;--i){var a=r,o=t[i];r=a+o;var s=r-a,l=o-s;l&&(t[--n]=r,r=l)}for(var c=0,i=n;e>i;++i){var a=t[i],o=r;r=a+o;var s=r-a,l=o-s;l&&(t[c++]=l)}return t[c++]=r,t.length=c,t}e.exports=n},{}],258:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(t.length-1),n=1;nr;++r){e[r]=new Array(t);for(var n=0;t>n;++n)e[r][n]=["m[",r,"][",n,"]"].join("")}return e}function a(t){return 1&t?"-":""}function o(t){if(1===t.length)return t[0];if(2===t.length)return["sum(",t[0],",",t[1],")"].join("");var e=t.length>>1;return["sum(",o(t.slice(0,e)),",",o(t.slice(e)),")"].join("")}function s(t){if(2===t.length)return["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("");for(var e=[],r=0;rn;++n)t.push("det"+n),r.push("case ",n,":return det",n,"(m);");r.push("}var det=CACHE[m.length];if(!det)det=CACHE[m.length]=gen(m.length);return det(m);}return robustDeterminant"),t.push("CACHE","gen",r.join(""));var i=Function.apply(void 0,t);e.exports=i.apply(void 0,g.concat([g,l]));for(var n=0;nr;++r){e[r]=new Array(t);for(var n=0;t>n;++n)e[r][n]=["m",n,"[",t-r-1,"]"].join("")}return e}function a(t){return 1&t?"-":""}function o(t){if(1===t.length)return t[0];if(2===t.length)return["sum(",t[0],",",t[1],")"].join("");var e=t.length>>1;return["sum(",o(t.slice(0,e)),",",o(t.slice(e)),")"].join("")}function s(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],r=0;rc;++c)0===(1&c)?e.push.apply(e,s(n(a,c))):r.push.apply(r,s(n(a,c))),l.push("m"+c);var u=o(e),g=o(r),v="orientation"+t+"Exact",m=["function ",v,"(",l.join(),"){var p=",u,",n=",g,",d=sub(p,n);return d[d.length-1];};return ",v].join(""),y=new Function("sum","prod","scale","sub",m);return y(h,f,d,p)}function c(t){var e=_[t.length];return e||(e=_[t.length]=l(t.length)),e.apply(void 0,t)}function u(){for(;_.length<=g;)_.push(l(_.length));for(var t=[],r=["slow"],n=0;g>=n;++n)t.push("a"+n),r.push("o"+n);for(var i=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"],n=2;g>=n;++n)i.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i=n;++n)e.exports[n]=_[n]}var f=t("two-product"),h=t("robust-sum"),d=t("robust-scale"),p=t("robust-subtract"),g=5,v=1.1102230246251565e-16,m=(3+16*v)*v,y=(7+56*v)*v,b=l(3),x=l(4),_=[function(){return 0},function(){return 0},function(t,e){return e[0]-t[0]},function(t,e,r){var n,i=(t[1]-r[1])*(e[0]-r[0]),a=(t[0]-r[0])*(e[1]-r[1]),o=i-a;if(i>0){if(0>=a)return o;n=i+a}else{if(!(0>i))return o;if(a>=0)return o;n=-(i+a)}var s=m*n;return o>=s||-s>=o?o:b(t,e,r)},function(t,e,r,n){var i=t[0]-n[0],a=e[0]-n[0],o=r[0]-n[0],s=t[1]-n[1],l=e[1]-n[1],c=r[1]-n[1],u=t[2]-n[2],f=e[2]-n[2],h=r[2]-n[2],d=a*c,p=o*l,g=o*s,v=i*c,m=i*l,b=a*s,_=u*(d-p)+f*(g-v)+h*(m-b),w=(Math.abs(d)+Math.abs(p))*Math.abs(u)+(Math.abs(g)+Math.abs(v))*Math.abs(f)+(Math.abs(m)+Math.abs(b))*Math.abs(h),k=y*w; +return _>k||-_>k?_:x(t,e,r,n)}];u()},{"robust-scale":260,"robust-subtract":261,"robust-sum":262,"two-product":276}],260:[function(t,e,r){"use strict";function n(t,e){var r=t.length;if(1===r){var n=i(t[0],e);return n[0]?n:[n[1]]}var o=new Array(2*r),s=[.1,.1],l=[.1,.1],c=0;i(t[0],e,s),s[0]&&(o[c++]=s[0]);for(var u=1;r>u;++u){i(t[u],e,l);var f=s[1];a(f,l[0],s),s[0]&&(o[c++]=s[0]);var h=l[1],d=s[1],p=h+d,g=p-h,v=d-g;s[1]=p,v&&(o[c++]=v)}return s[1]&&(o[c++]=s[1]),0===c&&(o[c++]=0),o.length=c,o}var i=t("two-product"),a=t("two-sum");e.exports=n},{"two-product":276,"two-sum":277}],261:[function(t,e,r){"use strict";function n(t,e){var r=t+e,n=r-t,i=r-n,a=e-n,o=t-i,s=o+a;return s?[s,r]:[r]}function i(t,e){var r=0|t.length,i=0|e.length;if(1===r&&1===i)return n(t[0],-e[0]);var a,o,s=r+i,l=new Array(s),c=0,u=0,f=0,h=Math.abs,d=t[u],p=h(d),g=-e[f],v=h(g);v>p?(o=d,u+=1,r>u&&(d=t[u],p=h(d))):(o=g,f+=1,i>f&&(g=-e[f],v=h(g))),r>u&&v>p||f>=i?(a=d,u+=1,r>u&&(d=t[u],p=h(d))):(a=g,f+=1,i>f&&(g=-e[f],v=h(g)));for(var m,y,b,x,_,w=a+o,k=w-a,A=o-k,M=A,T=w;r>u&&i>f;)v>p?(a=d,u+=1,r>u&&(d=t[u],p=h(d))):(a=g,f+=1,i>f&&(g=-e[f],v=h(g))),o=M,w=a+o,k=w-a,A=o-k,A&&(l[c++]=A),m=T+w,y=m-T,b=m-y,x=w-y,_=T-b,M=_+x,T=m;for(;r>u;)a=d,o=M,w=a+o,k=w-a,A=o-k,A&&(l[c++]=A),m=T+w,y=m-T,b=m-y,x=w-y,_=T-b,M=_+x,T=m,u+=1,r>u&&(d=t[u]);for(;i>f;)a=g,o=M,w=a+o,k=w-a,A=o-k,A&&(l[c++]=A),m=T+w,y=m-T,b=m-y,x=w-y,_=T-b,M=_+x,T=m,f+=1,i>f&&(g=-e[f]);return M&&(l[c++]=M),T&&(l[c++]=T),c||(l[c++]=0),l.length=c,l}e.exports=i},{}],262:[function(t,e,r){"use strict";function n(t,e){var r=t+e,n=r-t,i=r-n,a=e-n,o=t-i,s=o+a;return s?[s,r]:[r]}function i(t,e){var r=0|t.length,i=0|e.length;if(1===r&&1===i)return n(t[0],e[0]);var a,o,s=r+i,l=new Array(s),c=0,u=0,f=0,h=Math.abs,d=t[u],p=h(d),g=e[f],v=h(g);v>p?(o=d,u+=1,r>u&&(d=t[u],p=h(d))):(o=g,f+=1,i>f&&(g=e[f],v=h(g))),r>u&&v>p||f>=i?(a=d,u+=1,r>u&&(d=t[u],p=h(d))):(a=g,f+=1,i>f&&(g=e[f],v=h(g)));for(var m,y,b,x,_,w=a+o,k=w-a,A=o-k,M=A,T=w;r>u&&i>f;)v>p?(a=d,u+=1,r>u&&(d=t[u],p=h(d))):(a=g,f+=1,i>f&&(g=e[f],v=h(g))),o=M,w=a+o,k=w-a,A=o-k,A&&(l[c++]=A),m=T+w,y=m-T,b=m-y,x=w-y,_=T-b,M=_+x,T=m;for(;r>u;)a=d,o=M,w=a+o,k=w-a,A=o-k,A&&(l[c++]=A),m=T+w,y=m-T,b=m-y,x=w-y,_=T-b,M=_+x,T=m,u+=1,r>u&&(d=t[u]);for(;i>f;)a=g,o=M,w=a+o,k=w-a,A=o-k,A&&(l[c++]=A),m=T+w,y=m-T,b=m-y,x=w-y,_=T-b,M=_+x,T=m,f+=1,i>f&&(g=e[f]);return M&&(l[c++]=M),T&&(l[c++]=T),c||(l[c++]=0),l.length=c,l}e.exports=i},{}],263:[function(t,e,r){"use strict";function n(t){return t.split("").map(function(t){return t in i?i[t]:""}).join("")}e.exports=n;var i={" ":" ",0:"\u2070",1:"\xb9",2:"\xb2",3:"\xb3",4:"\u2074",5:"\u2075",6:"\u2076",7:"\u2077",8:"\u2078",9:"\u2079","+":"\u207a","-":"\u207b",a:"\u1d43",b:"\u1d47",c:"\u1d9c",d:"\u1d48",e:"\u1d49",f:"\u1da0",g:"\u1d4d",h:"\u02b0",i:"\u2071",j:"\u02b2",k:"\u1d4f",l:"\u02e1",m:"\u1d50",n:"\u207f",o:"\u1d52",p:"\u1d56",r:"\u02b3",s:"\u02e2",t:"\u1d57",u:"\u1d58",v:"\u1d5b",w:"\u02b7",x:"\u02e3",y:"\u02b8",z:"\u1dbb"}},{}],264:[function(t,e,r){"use strict";function n(t){return"a"+t}function i(t){return"d"+t}function a(t,e){return"c"+t+"_"+e}function o(t){return"s"+t}function s(t,e){return"t"+t+"_"+e}function l(t){return"o"+t}function c(t){return"x"+t}function u(t){return"p"+t}function f(t,e){return"d"+t+"_"+e}function h(t){return"i"+t}function d(t,e){return"u"+t+"_"+e}function p(t){return"b"+t}function g(t){return"y"+t}function v(t){return"e"+t}function m(t){return"v"+t}function y(t,e,r){for(var n=0,i=0;t>i;++i)e&1<e;++e)F.push(u(e),"+=",d(e,x[t]),";");F.push("}")}function z(t){for(var e=t-1;e>=0;--e)S(e,0);for(var r=[],e=0;I>e;++e)L[e]?r.push(i(e)+".get("+u(e)+")"):r.push(i(e)+"["+u(e)+"]");for(var e=0;b>e;++e)r.push(c(e));F.push(k,"[",T,"++]=phase(",r.join(),");");for(var e=0;t>e;++e)C(e);for(var n=0;I>n;++n)F.push(u(n),"+=",d(n,x[t]),";")}function P(t){for(var e=0;I>e;++e)L[e]?F.push(a(e,0),"=",i(e),".get(",u(e),");"):F.push(a(e,0),"=",i(e),"[",u(e),"];");for(var r=[],e=0;I>e;++e)r.push(a(e,0));for(var e=0;b>e;++e)r.push(c(e));F.push(p(0),"=",k,"[",T,"]=phase(",r.join(),");");for(var n=1;1<n;++n)F.push(p(n),"=",k,"[",T,"+",v(n),"];");for(var o=[],n=1;1<n;++n)o.push("("+p(0)+"!=="+p(n)+")");F.push("if(",o.join("||"),"){");for(var s=[],e=0;N>e;++e)s.push(h(e));for(var e=0;I>e;++e){s.push(a(e,0));for(var n=1;1<n;++n)L[e]?F.push(a(e,n),"=",i(e),".get(",u(e),"+",f(e,n),");"):F.push(a(e,n),"=",i(e),"[",u(e),"+",f(e,n),"];"),s.push(a(e,n))}for(var e=0;1<e;++e)s.push(p(e));for(var e=0;b>e;++e)s.push(c(e));F.push("vertex(",s.join(),");",m(0),"=",w,"[",T,"]=",A,"++;");for(var l=(1<n;++n)if(0===(t&~(1<0;_=_-1&g)x.push(w+"["+T+"+"+v(_)+"]");x.push(m(0));for(var _=0;I>_;++_)1&n?x.push(a(_,l),a(_,g)):x.push(a(_,g),a(_,l));1&n?x.push(d,y):x.push(y,d);for(var _=0;b>_;++_)x.push(c(_));F.push("if(",d,"!==",y,"){","face(",x.join(),")}")}F.push("}",T,"+=1;")}function R(){for(var t=1;1<t;++t)F.push(E,"=",v(t),";",v(t),"=",g(t),";",g(t),"=",E,";")}function O(t,e){if(0>t)return void P(e);z(t),F.push("if(",o(x[t]),">0){",h(x[t]),"=1;"),O(t-1,e|1<r;++r)F.push(u(r),"+=",d(r,x[t]),";");t===N-1&&(F.push(T,"=0;"),R()),S(t,2),O(t-1,e),t===N-1&&(F.push("if(",h(x[N-1]),"&1){",T,"=0;}"),R()),C(t),F.push("}")}var I=L.length,N=x.length;if(2>N)throw new Error("ndarray-extract-contour: Dimension must be at least 2");for(var j="extractContour"+x.join("_"),F=[],D=[],B=[],U=0;I>U;++U)B.push(n(U));for(var U=0;b>U;++U)B.push(c(U));for(var U=0;N>U;++U)D.push(o(U)+"="+n(0)+".shape["+U+"]|0");for(var U=0;I>U;++U){D.push(i(U)+"="+n(U)+".data",l(U)+"="+n(U)+".offset|0");for(var V=0;N>V;++V)D.push(s(U,V)+"="+n(U)+".stride["+V+"]|0")}for(var U=0;I>U;++U){D.push(u(U)+"="+l(U)),D.push(a(U,0));for(var V=1;1<V;++V){for(var q=[],H=0;N>H;++H)V&1<U;++U)for(var V=0;N>V;++V){var G=[s(U,x[V])];V>0&&G.push(s(U,x[V-1])+"*"+o(x[V-1])),D.push(d(U,x[V])+"=("+G.join("-")+")|0")}for(var U=0;N>U;++U)D.push(h(U)+"=0");D.push(A+"=0");for(var Y=["2"],U=N-2;U>=0;--U)Y.push(o(x[U]));D.push(M+"=("+Y.join("*")+")|0",k+"=mallocUint32("+M+")",w+"=mallocUint32("+M+")",T+"=0"),D.push(p(0)+"=0");for(var V=1;1<V;++V){for(var X=[],W=[],H=0;N>H;++H)V&1<n&&e("Must have at least one array argument");var i=t.scalarArguments||0;0>i&&e("Scalar arg count must be > 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;n>s;++s)a.indexOf(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",k="P",A="N",M="Q",T="X",E="T"},{"typedarray-pool":278}],265:[function(t,e,r){function n(t){if(0>t)return Number("0/0");for(var e=s[0],r=s.length-1;r>0;--r)e+=s[r]/(t+r);var n=t+o+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}var i=7,a=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],o=607/128,s=[.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 l(t){if(.5>t)return Math.PI/(Math.sin(Math.PI*t)*l(1-t));if(t>100)return Math.exp(n(t));t-=1;for(var e=a[0],r=1;i+2>r;r++)e+=a[r]/(t+r);var o=t+i+.5;return Math.sqrt(2*Math.PI)*Math.pow(o,t+.5)*Math.exp(-o)*e},e.exports.log=n},{}],266:[function(t,e,r){"use strict";function n(t){var e=t.length;if(i>e){for(var r=1,n=0;e>n;++n)for(var o=0;n>o;++o)if(t[n]n;++n)s[n]=0;for(var r=1,n=0;e>n;++n)if(!s[n]){var l=1;s[n]=1;for(var o=t[n];o!==n;o=t[o]){if(s[o])return a.freeUint8(s),0;l+=1,s[o]=1}1&l||(r=-r)}return a.freeUint8(s),r}e.exports=n;var i=32,a=t("typedarray-pool")},{"typedarray-pool":278}],267:[function(t,e,r){"use strict";function n(t){var e=t.length;switch(e){case 0:case 1:return 0;case 2:return t[1]}var r,n,i,s=a.mallocUint32(e),l=a.mallocUint32(e),c=0;for(o(t,l),i=0;e>i;++i)s[i]=t[i];for(i=e-1;i>0;--i)n=l[i],r=s[i],s[i]=s[n],s[n]=r,l[i]=l[r],l[r]=n,c=(c+r)*i;return a.freeUint32(l),a.freeUint32(s),c}function i(t,e,r){switch(t){case 0:return r?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;t>a;++a)r[a]=a,o=o*a|0;for(a=t-1;a>0;--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":268,"typedarray-pool":278}],268:[function(t,e,r){"use strict";function n(t,e){e=e||new Array(t.length);for(var r=0;rt)return[];if(0===t)return[[0]];for(var e=0|Math.round(o(t+1)),r=[],n=0;e>n;++n){for(var s=i.unrank(t,n),l=[0],c=0,u=0;u= 0) !== (_inline_1_db >= 0)) {\n _inline_1_arg2_.push(_inline_1_arg4_[0] + 0.5 + 0.5 * (_inline_1_da + _inline_1_db) / (_inline_1_da - _inline_1_db))\n }\n }",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg3_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:["_inline_1_da","_inline_1_db"]},funcName:"zeroCrossings"})},{"cwise-compiler":109}],271:[function(t,e,r){"use strict";function n(t,e){var r=[];return e=+e||0,i(t.hi(t.shape[0]-1),r,e),r}e.exports=n;var i=t("./lib/zc-core")},{"./lib/zc-core":270}],272:[function(t,e,r){"use strict";function n(t,e){var r=t.length,n=["'use strict';"],i="surfaceNets"+t.join("_")+"d"+e;n.push("var contour=genContour({","order:[",t.join(),"],","scalarArguments: 3,","phase:function phaseFunc(p,a,b,c) { return (p > c)|0 },"),"generic"===e&&n.push("getters:[0],");for(var a=[],l=[],c=0;r>c;++c)a.push("d"+c),l.push("d"+c);for(var c=0;1<c;++c)a.push("v"+c),l.push("v"+c);for(var c=0;1<c;++c)a.push("p"+c),l.push("p"+c);a.push("a","b","c"),l.push("a","c"),n.push("vertex:function vertexFunc(",a.join(),"){");for(var u=[],c=0;1<c;++c)u.push("(p"+c+"<<"+c+")");n.push("var m=(",u.join("+"),")|0;if(m===0||m===",(1<<(1<=1<<(1<>>7){");for(var c=0;1<<(1<c;++c){if(1<<(1<128&&c%128===0){f.length>0&&h.push("}}");var d="vExtra"+f.length;n.push("case ",c>>>7,":",d,"(m&0x7f,",l.join(),");break;"),h=["function ",d,"(m,",l.join(),"){switch(m){"],f.push(h)}h.push("case ",127&c,":");for(var p=new Array(r),g=new Array(r),v=new Array(r),m=new Array(r),y=0,b=0;r>b;++b)p[b]=[],g[b]=[],v[b]=0,m[b]=0;for(var b=0;1<b;++b)for(var x=0;r>x;++x){var _=b^1<b)&&!(c&1<<_)!=!(c&1<w?(p[x].push("-v"+b+"-v"+_),v[x]+=2):(p[x].push("v"+b+"+v"+_),v[x]-=2),y+=1;for(var k=0;r>k;++k)k!==x&&(_&1<x;++x)if(0===p[x].length)A.push("d"+x+"-0.5");else{var M="";v[x]<0?M=v[x]+"*c":v[x]>0&&(M="+"+v[x]+"*c");var T=.5*(p[x].length/y),E=.5+.5*(m[x]/y);A.push("d"+x+"-"+E+"-"+T+"*("+p[x].join("+")+M+")/("+g[x].join("+")+")")}h.push("a.push([",A.join(),"]);","break;")}n.push("}},"),f.length>0&&h.push("}}");for(var L=[],c=0;1<c;++c)L.push("v"+c);L.push("c0","c1","p0","p1","a","b","c"),n.push("cell:function cellFunc(",L.join(),"){");var S=s(r-1);n.push("if(p0){b.push(",S.map(function(t){return"["+t.map(function(t){return"v"+t})+"]"}).join(),")}else{b.push(",S.map(function(t){var e=t.slice();return e.reverse(),"["+e.map(function(t){return"v"+t})+"]"}).join(),")}}});function ",i,"(array,level){var verts=[],cells=[];contour(array,verts,cells,level);return {positions:verts,cells:cells};} return ",i,";");for(var c=0;co;++o)i[o]=[r[o]],a[o]=[o];return{positions:i,cells:a}}function a(t,e){if(t.dimension<=0)return{positions:[],cells:[]};if(1===t.dimension)return i(t,e);var r=t.order.join()+"-"+t.dtype,a=c[r],e=+e||0;return a||(a=c[r]=n(t.order,t.dtype)),a(t,e)}e.exports=a;var o=t("ndarray-extract-contour"),s=t("triangulate-hypercube"),l=t("zero-crossings"),c={}},{"ndarray-extract-contour":264,"triangulate-hypercube":269,"zero-crossings":271}],273:[function(t,e,r){(function(r){"use strict";function n(t){for(var e=t.cells,r=t.positions,n=new Float32Array(6*e.length),i=0,a=0,o=0;ol;++l){var c=r[s[l]];n[i++]=c[0],n[i++]=c[1]+1.4,a=Math.max(c[0],a)}return{data:n,shape:a}}function i(t,e){var r=s[t];r||(r=s[t]={" ":{data:new Float32Array(0),shape:.2}});var o=r[e];if(!o)if(e.length<=1||!/\d/.test(e))o=r[e]=n(a(e,{triangles:!0,font:t,textAlign:"left",textBaseline:"alphabetic"}));else{for(var l=e.split(/(\d|\s)/),c=new Array(l.length),u=0,f=0,h=0;h0&&(f+=.02);for(var d=new Float32Array(u),p=0,g=-.5*f,h=0;h.5?l/(2-a-o):l/(a+o),a){case t:n=(e-r)/l+(r>e?6:0);break;case e:n=(r-t)/l+2;break;case r:n=(t-e)/l+4}n/=6}return{h:n,s:i,l:s}}function o(t,e,r){function n(t,e,r){return 0>r&&(r+=1),r>1&&(r-=1),1/6>r?t+6*(e-t)*r:.5>r?e:2/3>r?t+(e-t)*(2/3-r)*6:t}var i,a,o;if(t=T(t,360),e=T(e,100),r=T(r,100),0===e)i=a=o=r;else{var s=.5>r?r*(1+e):r+e-r*e,l=2*r-s;i=n(l,s,t+1/3),a=n(l,s,t),o=n(l,s,t-1/3)}return{r:255*i,g:255*a,b:255*o}}function s(t,e,r){t=T(t,255),e=T(e,255),r=T(r,255);var n,i,a=q(t,e,r),o=V(t,e,r),s=a,l=a-o;if(i=0===a?0:l/a,a==o)n=0;else{switch(a){case t:n=(e-r)/l+(r>e?6:0);break;case e:n=(r-t)/l+2;break;case r:n=(t-e)/l+4}n/=6}return{h:n,s:i,v:s}}function l(t,e,r){t=6*T(t,360),e=T(e,100),r=T(r,100);var n=B.floor(t),i=t-n,a=r*(1-e),o=r*(1-i*e),s=r*(1-(1-i)*e),l=n%6,c=[r,o,a,a,s,r][l],u=[s,r,r,o,a,a][l],f=[a,a,s,r,r,o][l];return{r:255*c,g:255*u,b:255*f}}function c(t,e,r,n){var i=[z(U(t).toString(16)),z(U(e).toString(16)),z(U(r).toString(16))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function u(t,e,r,n){var i=[z(R(n)),z(U(t).toString(16)),z(U(e).toString(16)),z(U(r).toString(16))];return i.join("")}function f(t,r){r=0===r?0:r||10;var n=e(t).toHsl();return n.s-=r/100,n.s=E(n.s),e(n)}function h(t,r){r=0===r?0:r||10;var n=e(t).toHsl();return n.s+=r/100,n.s=E(n.s),e(n)}function d(t){return e(t).desaturate(100)}function p(t,r){r=0===r?0:r||10;var n=e(t).toHsl();return n.l+=r/100,n.l=E(n.l),e(n)}function g(t,r){r=0===r?0:r||10;var n=e(t).toRgb();return n.r=q(0,V(255,n.r-U(255*-(r/100)))),n.g=q(0,V(255,n.g-U(255*-(r/100)))),n.b=q(0,V(255,n.b-U(255*-(r/100)))),e(n)}function v(t,r){r=0===r?0:r||10;var n=e(t).toHsl();return n.l-=r/100,n.l=E(n.l),e(n)}function m(t,r){var n=e(t).toHsl(),i=(U(n.h)+r)%360;return n.h=0>i?360+i:i,e(n)}function y(t){var r=e(t).toHsl();return r.h=(r.h+180)%360,e(r)}function b(t){var r=e(t).toHsl(),n=r.h;return[e(t),e({h:(n+120)%360,s:r.s,l:r.l}),e({h:(n+240)%360,s:r.s,l:r.l})]}function x(t){var r=e(t).toHsl(),n=r.h;return[e(t),e({h:(n+90)%360,s:r.s,l:r.l}),e({h:(n+180)%360,s:r.s,l:r.l}),e({h:(n+270)%360,s:r.s,l:r.l})]}function _(t){var r=e(t).toHsl(),n=r.h;return[e(t),e({h:(n+72)%360,s:r.s,l:r.l}),e({h:(n+216)%360,s:r.s,l:r.l})]}function w(t,r,n){r=r||6,n=n||30;var i=e(t).toHsl(),a=360/n,o=[e(t)];for(i.h=(i.h-(a*r>>1)+720)%360;--r;)i.h=(i.h+a)%360,o.push(e(i));return o}function k(t,r){r=r||6;for(var n=e(t).toHsv(),i=n.h,a=n.s,o=n.v,s=[],l=1/r;r--;)s.push(e({h:i,s:a,v:o})),o=(o+l)%1;return s}function A(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}function M(t){return t=parseFloat(t),(isNaN(t)||0>t||t>1)&&(t=1),t}function T(t,e){S(t)&&(t="100%");var r=C(t);return t=V(e,q(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),B.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function E(t){return V(1,q(0,t))}function L(t){return parseInt(t,16)}function S(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)}function C(t){return"string"==typeof t&&-1!=t.indexOf("%")}function z(t){return 1==t.length?"0"+t:""+t}function P(t){return 1>=t&&(t=100*t+"%"),t}function R(t){return Math.round(255*parseFloat(t)).toString(16)}function O(t){return L(t)/255}function I(t){t=t.replace(j,"").replace(F,"").toLowerCase();var e=!1;if(G[t])t=G[t],e=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=X.rgb.exec(t))?{r:r[1],g:r[2],b:r[3]}:(r=X.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=X.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=X.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=X.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=X.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=X.hex8.exec(t))?{a:O(r[1]),r:L(r[2]),g:L(r[3]),b:L(r[4]),format:e?"name":"hex8"}:(r=X.hex6.exec(t))?{r:L(r[1]),g:L(r[2]),b:L(r[3]),format:e?"name":"hex"}:(r=X.hex3.exec(t))?{r:L(r[1]+""+r[1]),g:L(r[2]+""+r[2]),b:L(r[3]+""+r[3]),format:e?"name":"hex"}:!1}function N(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:e,size:r}}var j=/^\s+/,F=/\s+$/,D=0,B=Math,U=B.round,V=B.min,q=B.max,H=B.random;e.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,r,n,i,a,o=this.toRgb();return t=o.r/255,e=o.g/255,r=o.b/255,n=.03928>=t?t/12.92:Math.pow((t+.055)/1.055,2.4),i=.03928>=e?e/12.92:Math.pow((e+.055)/1.055,2.4),a=.03928>=r?r/12.92:Math.pow((r+.055)/1.055,2.4),.2126*n+.7152*i+.0722*a},setAlpha:function(t){return this._a=M(t),this._roundA=U(100*this._a)/100,this},toHsv:function(){var t=s(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=s(this._r,this._g,this._b),e=U(360*t.h),r=U(100*t.s),n=U(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=a(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=a(this._r,this._g,this._b),e=U(360*t.h),r=U(100*t.s),n=U(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return c(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(){return u(this._r,this._g,this._b,this._a)},toHex8String:function(){return"#"+this.toHex8()},toRgb:function(){return{r:U(this._r),g:U(this._g),b:U(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+U(this._r)+", "+U(this._g)+", "+U(this._b)+")":"rgba("+U(this._r)+", "+U(this._g)+", "+U(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:U(100*T(this._r,255))+"%",g:U(100*T(this._g,255))+"%",b:U(100*T(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+U(100*T(this._r,255))+"%, "+U(100*T(this._g,255))+"%, "+U(100*T(this._b,255))+"%)":"rgba("+U(100*T(this._r,255))+"%, "+U(100*T(this._g,255))+"%, "+U(100*T(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":this._a<1?!1:Y[c(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var r="#"+u(this._r,this._g,this._b,this._a),n=r,i=this._gradientType?"GradientType = 1, ":"";if(t){var a=e(t);n=a.toHex8String()}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+r+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0,i=!e&&n&&("hex"===t||"hex6"===t||"hex3"===t||"name"===t);return i?"name"===t&&0===this._a?this.toName():this.toRgbString():("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return e(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(p,arguments)},brighten:function(){return this._applyModification(g,arguments)},darken:function(){return this._applyModification(v,arguments)},desaturate:function(){return this._applyModification(f,arguments)},saturate:function(){return this._applyModification(h,arguments)},greyscale:function(){return this._applyModification(d,arguments)},spin:function(){return this._applyModification(m,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(w,arguments)},complement:function(){return this._applyCombination(y,arguments)},monochromatic:function(){return this._applyCombination(k,arguments)},splitcomplement:function(){return this._applyCombination(_,arguments)},triad:function(){return this._applyCombination(b,arguments)},tetrad:function(){return this._applyCombination(x,arguments)}},e.fromRatio=function(t,r){if("object"==typeof t){var n={};for(var i in t)t.hasOwnProperty(i)&&("a"===i?n[i]=t[i]:n[i]=P(t[i]));t=n}return e(t,r)},e.equals=function(t,r){return t&&r?e(t).toRgbString()==e(r).toRgbString():!1},e.random=function(){return e.fromRatio({r:H(),g:H(),b:H()})},e.mix=function(t,r,n){n=0===n?0:n||50;var i,a=e(t).toRgb(),o=e(r).toRgb(),s=n/100,l=2*s-1,c=o.a-a.a;i=l*c==-1?l:(l+c)/(1+l*c),i=(i+1)/2;var u=1-i,f={r:o.r*i+a.r*u,g:o.g*i+a.g*u,b:o.b*i+a.b*u,a:o.a*s+a.a*(1-s)};return e(f)},e.readability=function(t,r){var n=e(t),i=e(r);return(Math.max(n.getLuminance(),i.getLuminance())+.05)/(Math.min(n.getLuminance(),i.getLuminance())+.05)},e.isReadable=function(t,r,n){var i,a,o=e.readability(t,r);switch(a=!1,i=N(n),i.level+i.size){case"AAsmall":case"AAAlarge":a=o>=4.5;break;case"AAlarge":a=o>=3;break;case"AAAsmall":a=o>=7}return a},e.mostReadable=function(t,r,n){var i,a,o,s,l=null,c=0;n=n||{},a=n.includeFallbackColors,o=n.level,s=n.size;for(var u=0;uc&&(c=i,l=e(r[u]));return e.isReadable(t,l,{level:o,size:s})||!a?l:(n.includeFallbackColors=!1,e.mostReadable(t,["#fff","#000"],n))};var G=e.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Y=e.hexNames=A(G),X=function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",r="(?:"+e+")|(?:"+t+")",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();"undefined"!=typeof r&&r.exports?r.exports=e:"function"==typeof t&&t.amd?t(function(){return e}):window.tinycolor=e}()},{}],275:[function(e,r,n){!function(e,i){"object"==typeof n&&"undefined"!=typeof r?i(n):"function"==typeof t&&t.amd?t(["exports"],i):i(e.topojson={})}(this,function(t){"use strict";function e(){}function r(t){if(!t)return e;var r,n,i=t.scale[0],a=t.scale[1],o=t.translate[0],s=t.translate[1];return function(t,e){e||(r=n=0),t[0]=(r+=t[0])*i+o,t[1]=(n+=t[1])*a+s}}function n(t){if(!t)return e;var r,n,i=t.scale[0],a=t.scale[1],o=t.translate[0],s=t.translate[1];return function(t,e){e||(r=n=0);var l=(t[0]-o)/i|0,c=(t[1]-s)/a|0;t[0]=l-r,t[1]=c-n,r=l,n=c}}function i(t,e){for(var r,n=t.length,i=n-e;i<--n;)r=t[i],t[i++]=t[n],t[n]=r}function a(t,e){for(var r=0,n=t.length;n>r;){var i=r+n>>>1;t[i]t?~t:t],a=0,o=n.length;o>a;++a)e.push(r=n[a].slice()),u(r,a);0>t&&i(e,o)}function a(t){return t=t.slice(),u(t,0),t}function o(t){for(var e=[],r=0,i=t.length;i>r;++r)n(t[r],e);return e.length<2&&e.push(e[0].slice()),e}function s(t){for(var e=o(t);e.length<4;)e.push(e[0].slice());return e}function l(t){return t.map(s)}function c(t){var e=t.type;return"GeometryCollection"===e?{type:e,geometries:t.geometries.map(c)}:e in h?{type:e,coordinates:h[e](t)}:null}var u=r(t.transform),f=t.arcs,h={Point:function(t){return a(t.coordinates)},MultiPoint:function(t){return t.coordinates.map(a)},LineString:function(t){return o(t.arcs)},MultiLineString:function(t){return t.arcs.map(o)},Polygon:function(t){return l(t.arcs)},MultiPolygon:function(t){return t.arcs.map(l)}};return c(e)}function c(t,e){function r(e){var r,n=t.arcs[0>e?~e:e],i=n[0];return t.transform?(r=[0,0],n.forEach(function(t){r[0]+=t[0],r[1]+=t[1]})):r=n[n.length-1],0>e?[r,i]:[i,r]}function n(t,e){for(var r in t){var n=t[r];delete e[n.start],delete n.start,delete n.end,n.forEach(function(t){i[0>t?~t:t]=1}),s.push(n)}}var i={},a={},o={},s=[],l=-1;return e.forEach(function(r,n){var i,a=t.arcs[0>r?~r:r];a.length<3&&!a[1][0]&&!a[1][1]&&(i=e[++l],e[l]=r,e[n]=i)}),e.forEach(function(t){var e,n,i=r(t),s=i[0],l=i[1];if(e=o[s])if(delete o[e.end],e.push(t),e.end=l,n=a[l]){delete a[n.start];var c=n===e?e:e.concat(n);a[c.start=e.start]=o[c.end=n.end]=c}else a[e.start]=o[e.end]=e;else if(e=a[l])if(delete a[e.start], +e.unshift(t),e.start=s,n=o[s]){delete o[n.end];var u=n===e?e:n.concat(e);a[u.start=n.start]=o[u.end=e.end]=u}else a[e.start]=o[e.end]=e;else e=[t],a[e.start=s]=o[e.end=l]=e}),n(o,a),n(a,o),e.forEach(function(t){i[0>t?~t:t]||s.push([t])}),s}function u(t){return l(t,f.apply(this,arguments))}function f(t,e,r){function n(t){var e=0>t?~t:t;(u[e]||(u[e]=[])).push({i:t,g:l})}function i(t){t.forEach(n)}function a(t){t.forEach(i)}function o(t){"GeometryCollection"===t.type?t.geometries.forEach(o):t.type in f&&(l=t,f[t.type](t.arcs))}var s=[];if(arguments.length>1){var l,u=[],f={LineString:i,MultiLineString:a,Polygon:a,MultiPolygon:function(t){t.forEach(a)}};o(e),u.forEach(arguments.length<3?function(t){s.push(t[0].i)}:function(t){r(t[0].g,t[t.length-1].g)&&s.push(t[0].i)})}else for(var h=0,d=t.arcs.length;d>h;++h)s.push(h);return{type:"MultiLineString",arcs:c(t,s)}}function h(t){var e=t[0],r=t[1],n=t[2];return Math.abs((e[0]-n[0])*(r[1]-e[1])-(e[0]-r[0])*(n[1]-e[1]))}function d(t){for(var e,r=-1,n=t.length,i=t[n-1],a=0;++re?~e:e]||(i[e]=[])).push(t)})}),a.push(t)}function n(e){return d(l(t,{type:"Polygon",arcs:[e]}).coordinates[0])>0}var i={},a=[],o=[];return e.forEach(function(t){"Polygon"===t.type?r(t.arcs):"MultiPolygon"===t.type&&t.arcs.forEach(r)}),a.forEach(function(t){if(!t._){var e=[],r=[t];for(t._=1,o.push(e);t=r.pop();)e.push(t),t.forEach(function(t){t.forEach(function(t){i[0>t?~t:t].forEach(function(t){t._||(t._=1,r.push(t))})})})}}),a.forEach(function(t){delete t._}),{type:"MultiPolygon",arcs:o.map(function(e){var r,a=[];if(e.forEach(function(t){t.forEach(function(t){t.forEach(function(t){i[0>t?~t:t].length<2&&a.push(t)})})}),a=c(t,a),(r=a.length)>1)for(var o,s=n(e[0][0]),l=0;r>l;++l)if(s===n(a[l])){o=a[0],a[0]=a[l],a[l]=o;break}return a})}}function v(t){function e(t,e){t.forEach(function(t){0>t&&(t=~t);var r=i[t];r?r.push(e):i[t]=[e]})}function r(t,r){t.forEach(function(t){e(t,r)})}function n(t,e){"GeometryCollection"===t.type?t.geometries.forEach(function(t){n(t,e)}):t.type in s&&s[t.type](t.arcs,e)}var i={},o=t.map(function(){return[]}),s={LineString:e,MultiLineString:r,Polygon:r,MultiPolygon:function(t,e){t.forEach(function(t){r(t,e)})}};t.forEach(n);for(var l in i)for(var c=i[l],u=c.length,f=0;u>f;++f)for(var h=f+1;u>h;++h){var d,p=c[f],g=c[h];(d=o[p])[l=a(d,g)]!==g&&d.splice(l,0,g),(d=o[g])[l=a(d,p)]!==p&&d.splice(l,0,p)}return o}function m(t,e){return t[1][2]-e[1][2]}function y(){function t(t,e){for(;e>0;){var r=(e+1>>1)-1,i=n[r];if(m(t,i)>=0)break;n[i._=e]=i,n[t._=e=r]=t}}function e(t,e){for(;;){var r=e+1<<1,a=r-1,o=e,s=n[o];if(i>a&&m(n[a],s)<0&&(s=n[o=a]),i>r&&m(n[r],s)<0&&(s=n[o=r]),o===e)break;n[s._=e]=s,n[t._=e=o]=t}}var r={},n=[],i=0;return r.push=function(e){return t(n[e._=i]=e,i++),i},r.pop=function(){if(!(0>=i)){var t,r=n[0];return--i>0&&(t=n[i],e(n[t._=0]=t,0)),r}},r.remove=function(r){var a,o=r._;if(n[o]===r)return o!==--i&&(a=n[i],(m(a,r)<0?t:e)(n[a._=o]=a,o)),o},r}function b(t,e){function i(t){s.remove(t),t[1][2]=e(t),s.push(t)}var a=r(t.transform),o=n(t.transform),s=y();return e||(e=h),t.arcs.forEach(function(t){var r,n,l,c,u=[],f=0;for(n=0,l=t.length;l>n;++n)c=t[n],a(t[n]=[c[0],c[1],1/0],n);for(n=1,l=t.length-1;l>n;++n)r=t.slice(n-1,n+2),r[1][2]=e(r),u.push(r),s.push(r);for(n=0,l=u.length;l>n;++n)r=u[n],r.previous=u[n-1],r.next=u[n+1];for(;r=s.pop();){var h=r.previous,d=r.next;r[1][2]0?r.pop():new ArrayBuffer(t)}function s(t){return new Uint8Array(o(t),0,t)}function l(t){return new Uint16Array(o(2*t),0,t)}function c(t){return new Uint32Array(o(4*t),0,t)}function u(t){return new Int8Array(o(t),0,t)}function f(t){return new Int16Array(o(2*t),0,t)}function h(t){return new Int32Array(o(4*t),0,t)}function d(t){return new Float32Array(o(4*t),0,t)}function p(t){return new Float64Array(o(8*t),0,t)}function g(t){return x?new Uint8ClampedArray(o(t),0,t):s(t)}function v(t){return new DataView(o(t),0,t)}function m(t){t=y.nextPow2(t);var e=y.log2(t),r=k[e];return r.length>0?r.pop():new n(t)}var y=t("bit-twiddle"),b=t("dup");e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:b([32,0]),UINT16:b([32,0]),UINT32:b([32,0]),INT8:b([32,0]),INT16:b([32,0]),INT32:b([32,0]),FLOAT:b([32,0]),DOUBLE:b([32,0]),DATA:b([32,0]),UINT8C:b([32,0]),BUFFER:b([32,0])});var x="undefined"!=typeof Uint8ClampedArray,_=e.__TYPEDARRAY_POOL;_.UINT8C||(_.UINT8C=b([32,0])),_.BUFFER||(_.BUFFER=b([32,0]));var w=_.DATA,k=_.BUFFER;r.free=function(t){if(n.isBuffer(t))k[y.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|y.log2(e);w[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeInt8=r.freeInt16=r.freeInt32=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=a,r.freeArrayBuffer=i,r.freeBuffer=function(t){k[y.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return o(t);switch(e){case"uint8":return s(t);case"uint16":return l(t);case"uint32":return c(t);case"int8":return u(t);case"int16":return f(t);case"int32":return h(t);case"float":case"float32":return d(t);case"double":case"float64":return p(t);case"uint8_clamped":return g(t);case"buffer":return m(t);case"data":case"dataview":return v(t);default:return null}return null},r.mallocArrayBuffer=o,r.mallocUint8=s,r.mallocUint16=l,r.mallocUint32=c,r.mallocInt8=u,r.mallocInt16=f,r.mallocInt32=h,r.mallocFloat32=r.mallocFloat=d,r.mallocFloat64=r.mallocDouble=p,r.mallocUint8Clamped=g,r.mallocDataView=v,r.mallocBuffer=m,r.clearCache=function(){for(var t=0;32>t;++t)_.UINT8[t].length=0,_.UINT16[t].length=0,_.UINT32[t].length=0,_.INT8[t].length=0,_.INT16[t].length=0,_.INT32[t].length=0,_.FLOAT[t].length=0,_.DOUBLE[t].length=0,_.UINT8C[t].length=0,w[t].length=0,k[t].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"bit-twiddle":50,buffer:51,dup:115}],279:[function(t,e,r){"use strict";function n(t,e){for(var r=1,n=t.length,i=t[0],a=t[0],o=1;n>o;++o)if(a=i,i=t[o],e(i,a)){if(o===r){r++;continue}t[r++]=i}return t.length=r,t}function i(t){for(var e=1,r=t.length,n=t[0],i=t[0],a=1;r>a;++a,i=n)if(i=n,n=t[a],n!==i){if(a===e){e++;continue}t[e++]=n}return t.length=e,t}function a(t,e,r){return 0===t.length?t:e?(r||t.sort(e),n(t,e)):(r||t.sort(),i(t))}e.exports=a},{}],280:[function(t,e,r){"use strict";function n(t,e){return"object"==typeof e&&null!==e||(e={}),i(t,e.canvas||a,e.context||o,e)}e.exports=n;var i=t("./lib/vtext"),a=null,o=null;"undefined"!=typeof document&&(a=document.createElement("canvas"),a.width=8192,a.height=1024,o=a.getContext("2d"))},{"./lib/vtext":281}],281:[function(t,e,r){"use strict";function n(t,e,r){for(var n=e.textAlign||"start",i=e.textBaseline||"alphabetic",a=[1<<30,1<<30],o=[0,0],s=t.length,l=0;s>l;++l)for(var c=t[l],u=0;2>u;++u)a[u]=0|Math.min(a[u],c[u]),o[u]=0|Math.max(o[u],c[u]);var f=0;switch(n){case"center":f=-.5*(a[0]+o[0]);break;case"right":case"end":f=-o[0];break;case"left":case"start":f=-a[0];break;default:throw new Error("vectorize-text: Unrecognized textAlign: '"+n+"'")}var h=0;switch(i){case"hanging":case"top":h=-a[1];break;case"middle":h=-.5*(a[1]+o[1]);break;case"alphabetic":case"ideographic":h=-3*r;break;case"bottom":h=-o[1];break;default:throw new Error("vectorize-text: Unrecoginized textBaseline: '"+i+"'")}var d=1/r;return"lineHeight"in e?d*=+e.lineHeight:"width"in e?d=e.width/(o[0]-a[0]):"height"in e&&(d=e.height/(o[1]-a[1])),t.map(function(t){return[d*(t[0]+f),d*(t[1]+h)]})}function i(t,e,r,n){var i=0|Math.ceil(e.measureText(r).width+2*n);if(i>8192)throw new Error("vectorize-text: String too long (sorry, this will get fixed later)");var a=3*n;t.height=l&&o.push(s)}for(;o.length>0;){var c=o.pop();n[c]=!1;for(var u=r[c],s=0;sn;++n){var a=t[n];e=Math.max(e,a[0],a[1])}e=(0|e)+1}e=0|e;for(var o=new Array(e),n=0;e>n;++n)o[n]=[];for(var n=0;r>n;++n){var a=t[n];o[a[0]].push(a[1]),o[a[1]].push(a[0])}for(var s=0;e>s;++s)i(o[s],function(t,e){return t-e});return o}e.exports=n;var i=t("uniq")},{uniq:279}],284:[function(t,e,r){"use strict";function n(t,e){function r(t,e){var r=c[e][t[e]];r.splice(r.indexOf(t),1)}function n(t,n,a){for(var o,s,l,u=0;2>u;++u)if(c[u][n].length>0){o=c[u][n][0],l=u;break}s=o[1^l];for(var f=0;2>f;++f)for(var h=c[f][n],d=0;d0&&(o=p,s=g,l=f)}return a?s:(o&&r(o,l),s)}function a(t,a){var o=c[a][t][0],s=[t];r(o,a);for(var l=o[1^a];;){for(;l!==t;)s.push(l),l=n(s[s.length-2],l,!1);if(c[0][t].length+c[1][t].length===0)break;var u=s[s.length-1],f=t,h=s[1],d=n(u,f,!0);if(i(e[u],e[f],e[h],e[d])<0)break;s.push(t),l=n(u,f)}return s}function o(t,e){return e[1]===e[e.length-1]}for(var s=0|e.length,l=t.length,c=[new Array(s),new Array(s)],u=0;s>u;++u)c[0][u]=[],c[1][u]=[];for(var u=0;l>u;++u){var f=t[u];c[0][f[0]].push(f),c[1][f[1]].push(f)}for(var h=[],u=0;s>u;++u)c[0][u].length+c[1][u].length===0&&h.push([u]);for(var u=0;s>u;++u)for(var d=0;2>d;++d){for(var p=[];c[d][u].length>0;){var g=(c[0][u].length,a(u,d));o(p,g)?p.push.apply(p,g):(p.length>0&&h.push(p),p=g)}p.length>0&&h.push(p)}return h}e.exports=n;var i=t("compare-angle")},{"compare-angle":285}],285:[function(t,e,r){"use strict";function n(t,e,r){var n=s(t[0],-e[0]),i=s(t[1],-e[1]),a=s(r[0],-e[0]),o=s(r[1],-e[1]),u=c(l(n,a),l(i,o));return u[u.length-1]>=0}function i(t,e,r,i){var s=a(e,r,i);if(0===s){var l=o(a(t,e,r)),c=o(a(t,e,i));if(l===c){if(0===l){var u=n(t,e,r),f=n(t,e,i);return u===f?0:u?1:-1}return 0}return 0===c?l>0?-1:n(t,e,i)?-1:1:0===l?c>0?1:n(t,e,r)?1:-1:o(c-l)}var h=a(t,e,r);if(h>0)return s>0&&a(t,e,i)>0?1:-1;if(0>h)return s>0||a(t,e,i)>0?1:-1;var d=a(t,e,i);return d>0?1:n(t,e,r)?1:-1}e.exports=i;var a=t("robust-orientation"),o=t("signum"),s=t("two-sum"),l=t("robust-product"),c=t("robust-sum")},{"robust-orientation":259,"robust-product":286,"robust-sum":262,signum:287,"two-sum":277}],286:[function(t,e,r){"use strict";function n(t,e){if(1===t.length)return a(e,t[0]);if(1===e.length)return a(t,e[0]);if(0===t.length||0===e.length)return[0];var r=[0];if(t.lengtht?-1:t>0?1:0}},{}],288:[function(t,e,r){arguments[4][21][0].apply(r,arguments)},{dup:21}],289:[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 0>n?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 u(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)}},_.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1))return s(this,t);var n=this.left.remove(t);return n===x?(this.left=null,this.count-=1,b):(n===b&&(this.count-=1),n)}if(t[0]>this.mid){if(!this.right)return y;var a=this.left?this.left.count:0;if(4*a>3*(e-1))return s(this,t);var n=this.right.remove(t);return n===x?(this.right=null,this.count-=1,b):(n===b&&(this.count-=1),n)}if(1===this.count)return this.leftPoints[0]===t?x:y;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var o=this,l=this.left;l.right;)o=l,l=l.right;if(o===this)l.right=this.right;else{var c=this.left,n=this.right;o.count-=l.count,o.right=l.left,l.left=c,l.right=n}i(this,l),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 c=m.ge(this.leftPoints,t,h);cthis.mid){if(this.right){var r=this.right.queryPoint(t,e);if(r)return r}return c(this.rightPoints,t,e)}return u(this.leftPoints,e)},_.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?c(this.rightPoints,t,r):u(this.leftPoints,r)};var w=g.prototype;w.insert=function(t){this.root?this.root.insert(t):this.root=new n(t[0],null,null,[t],[t])},w.remove=function(t){if(this.root){var e=this.root.remove(t);return e===x&&(this.root=null),e!==y}return!1},w.queryPoint=function(t,e){return this.root?this.root.queryPoint(t,e):void 0},w.queryInterval=function(t,e,r){return e>=t&&this.root?this.root.queryInterval(t,e,r):void 0},Object.defineProperty(w,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(w,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":288}],290:[function(t,e,r){"use strict";function n(t,e){var r,n;if(e[0][0]e[1][0])){var i=Math.min(t[0][1],t[1][1]),o=Math.max(t[0][1],t[1][1]),s=Math.min(e[0][1],e[1][1]),l=Math.max(e[0][1],e[1][1]);return s>o?o-s:i>l?i-l:o-l}r=e[1],n=e[0]}var c,u;t[0][1]e[1][0]))return n(e,t);r=e[1],i=e[0]}var o,s;if(t[0][0]t[1][0]))return-n(t,e);o=t[1],s=t[0]}var l=a(r,i,s),c=a(r,i,o);if(0>l){if(0>=c)return l}else if(l>0){if(c>=0)return l}else if(c)return c;if(l=a(s,o,i),c=a(s,o,r),0>l){if(0>=c)return l}else if(l>0){if(c>=0)return l}else if(c)return c;return i[0]-s[0]}e.exports=i;var a=t("robust-orientation")},{"robust-orientation":259}],291:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){this._color=t,this.key=e,this.value=r,this.left=n,this.right=i,this._count=a}function i(t){return new n(t._color,t.key,t.value,t.left,t.right,t._count)}function a(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?r:e.right?l(t,e.right):void 0}function c(t,e,r,n){var i=e(t,n.key);if(0>=i){if(n.left){var a=c(t,e,r,n.left);if(a)return a}var a=r(n.key,n.value);if(a)return a}return n.right?c(t,e,r,n.right):void 0}function u(t,e,r,n,i){var a,o=r(t,i.key),s=r(e,i.key);if(0>=o){if(i.left&&(a=u(t,e,r,n,i.left)))return a;if(s>0&&(a=n(i.key,i.value)))return a}return s>0&&i.right?u(t,e,r,n,i.right):void 0}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=m);if(r=t[l-1],r.left===e){if(n=r.right,n.right&&n.right._color===v){if(n=r.right=i(n),s=n.right=i(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,e._color=m,r._color=m,s._color=m,o(r),o(n),l>1){var c=t[l-2];c.left===r?c.left=n:c.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 c=t[l-2];c.left===r?c.left=s:c.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 c=t[l-2];c.left===r?c.left=n:c.right=n}t[l-1]=n,t[l]=r,l+11){var c=t[l-2];c.right===r?c.right=n:c.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 c=t[l-2];c.right===r?c.right=s:c.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 c=t[l-2];c.right===r?c.right=n:c.left=n}t[l-1]=n,t[l]=r,l+1t?-1:t>e?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=[],c=[];i;){var u=r(t,i.key);l.push(i),c.push(u),i=0>=u?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];c[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 c(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return u(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(0>t)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),0>=a&&(i=n.length),r=0>=a?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),0>a&&(i=n.length),r=0>a?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=0>=a?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=0>a?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=0>=i?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=0>=n?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?this._stack[this._stack.length-1].key:void 0},enumerable:!0}),Object.defineProperty(b,"value",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1].value:void 0},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}})},{}],292:[function(t,e,r){"use strict";function n(t,e,r){this.slabs=t,this.coordinates=e,this.horizontal=r}function i(t,e){return t.y-e}function a(t,e){for(var r=null;t;){var n,i,o=t.key;o[0][0]s)t=t.left;else if(s>0)if(e[0]!==o[1][0])r=t,t=t.right;else{var l=a(t.right,e);if(l)return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l=a(t.right,e);if(l)return l;t=t.left}}return r}function o(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function s(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}function l(t){for(var e=t.length,r=2*e,i=new Array(r),a=0;e>a;++a){var l=t[a],c=l[0][0]a;){for(var v=i[a].x,m=[];r>a;){var y=i[a];if(y.x!==v)break;a+=1,y.segment[0][0]===y.x&&y.segment[1][0]===y.x?y.create&&(y.segment[0][1]e)return-1;var r=(this.slabs[e],a(this.slabs[e],t)),n=-1;if(r&&(n=r.value),this.coordinates[e]===t[0]){var o=null;if(r&&(o=r.key),e>0){var s=a(this.slabs[e-1],t);s&&(o?h(s.key,o)>0&&(o=s.key,n=s.value):(n=s.value,o=s.key))}var l=this.horizontal[e];if(l.length>0){var u=c.ge(l,t[1],i);if(u=l.length)return n;d=l[u]}}if(d.start)if(o){var p=f(o[0],o[1],[t[0],d.y]);o[0][0]>o[1][0]&&(p=-p),p>0&&(n=d.index)}else n=d.index;else d.y!==t[1]&&(n=d.index)}}}return n}},{"./lib/order-segments":290,"binary-search-bounds":288,"functional-red-black-tree":291,"robust-orientation":259}],293:[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):!1}}function a(t){for(var e={},r=0;rn)return 1;var i=t[n];if(!i){if(!(n>0&&e[n]===r[0]))return 1;i=t[n-1]}for(var a=1;i;){var o=i.key,s=f(r,o[0],o[1]);if(o[0][0]s)i=i.left;else{if(!(s>0))return 0;a=-1,i=i.right}else if(s>0)i=i.left;else{if(!(0>s))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 c(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}function u(t){for(var e=t.length,r=[],n=[],i=0;e>i;++i)for(var u=t[i],f=u.length,d=f-1,p=0;f>p;d=p++){var g=u[d],v=u[p];g[0]===v[0]?n.push([g,v]):r.push([g,v])}if(0===r.length)return 0===n.length?s:l(a(n));var m=h(r),y=o(m.slabs,m.coordinates);return 0===n.length?y:c(a(n),y)}e.exports=u;var f=t("robust-orientation")[3],h=t("slab-decomposition"),d=t("interval-tree-1d"),p=t("binary-search-bounds")},{"binary-search-bounds":288,"interval-tree-1d":289,"robust-orientation":259,"slab-decomposition":292 +}],294:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(t),n=0;t>n;++n)r[n]=e;return r}function i(t){for(var e=new Array(t),r=0;t>r;++r)e[r]=[];return e}function a(t,e){function r(t){for(var r=t.length,n=[0],i=0;r>i;++i){var a=e[t[i]],o=e[t[(i+1)%r]],s=c(-a[0],a[1]),l=c(-a[0],o[1]),f=c(o[0],a[1]),h=c(o[0],o[1]);n=u(n,u(u(s,l),u(f,h)))}return n[n.length-1]>0}function a(t){for(var e=t.length,r=0;e>r;++r)if(!O[t[r]])return!1;return!0}var d=h(t,e);t=d[0],e=d[1];for(var p=e.length,g=(t.length,o(t,e.length)),v=0;p>v;++v)if(g[v].length%2===1)throw new Error("planar-graph-to-polyline: graph must be manifold");var m=s(t,e);m=m.filter(r);for(var y=m.length,b=new Array(y),x=new Array(y),v=0;y>v;++v){b[v]=v;var _=new Array(y),w=m[v].map(function(t){return e[t]}),k=l([w]),A=0;t:for(var M=0;y>M;++M)if(_[M]=0,v!==M){for(var T=m[M],E=T.length,L=0;E>L;++L){var S=k(e[T[L]]);if(0!==S){0>S&&(_[M]=1,A+=1);continue t}}_[M]=1,A+=1}x[v]=[A,v,_]}x.sort(function(t,e){return e[0]-t[0]});for(var v=0;y>v;++v)for(var _=x[v],C=_[1],z=_[2],M=0;y>M;++M)z[M]&&(b[M]=C);for(var P=i(y),v=0;y>v;++v)P[v].push(b[v]),P[b[v]].push(v);for(var R={},O=n(p,!1),v=0;y>v;++v)for(var T=m[v],E=T.length,M=0;E>M;++M){var I=T[M],N=T[(M+1)%E],j=Math.min(I,N)+":"+Math.max(I,N);if(j in R){var F=R[j];P[F].push(v),P[v].push(F),O[I]=O[N]=!0}else R[j]=v}for(var D=[],B=n(y,-1),v=0;y>v;++v)b[v]!==v||a(m[v])?B[v]=-1:(D.push(v),B[v]=0);for(var d=[];D.length>0;){var U=D.pop(),V=P[U];f(V,function(t,e){return t-e});var q,H=V.length,G=B[U];if(0===G){var T=m[U];q=[T]}for(var v=0;H>v;++v){var Y=V[v];if(!(B[Y]>=0)&&(B[Y]=1^G,D.push(Y),0===G)){var T=m[Y];a(T)||(T.reverse(),q.push(T))}}0===G&&d.push(q)}return d}e.exports=a;var o=t("edges-to-adjacency-list"),s=t("planar-dual"),l=t("point-in-big-polygon"),c=t("two-product"),u=t("robust-sum"),f=t("uniq"),h=t("./lib/trim-leaves")},{"./lib/trim-leaves":282,"edges-to-adjacency-list":283,"planar-dual":284,"point-in-big-polygon":293,"robust-sum":262,"two-product":276,uniq:279}],295:[function(t,e,r){arguments[4][50][0].apply(r,arguments)},{dup:50}],296:[function(t,e,r){"use strict";"use restrict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;t>e;++e)this.roots[e]=e,this.ranks[e]=0}e.exports=n,n.prototype.length=function(){return this.roots.length},n.prototype.makeSet=function(){var t=this.roots.length;return this.roots.push(t),this.ranks.push(0),t},n.prototype.find=function(t){for(var e=this.roots;e[t]!==t;){var r=e[t];e[t]=e[r],t=r}return t},n.prototype.link=function(t,e){var r=this.find(t),n=this.find(e);if(r!==n){var i=this.ranks,a=this.roots,o=i[r],s=i[n];s>o?a[r]=n:o>s?a[n]=r:(a[n]=r,++i[r])}}},{}],297:[function(t,e,r){arguments[4][238][0].apply(r,arguments)},{"bit-twiddle":295,dup:238,"union-find":296}],298:[function(t,e,r){"use strict";function n(t,e,r){var n=Math.abs(a(t,e,r)),i=Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2));return n/i}function i(t,e,r){function i(t){if(x[t])return 1/0;var r=m[t],i=y[t];return 0>r||0>i?1/0:n(e[t],e[r],e[i])}function a(t,e){var r=M[t],n=M[e];M[t]=n,M[e]=r,T[r]=e,T[n]=t}function s(t){return b[M[t]]}function l(t){return 1&t?t-1>>1:(t>>1)-1}function c(t){for(var e=s(t);;){var r=e,n=2*t+1,i=2*(t+1),o=t;if(L>n){var l=s(n);r>l&&(o=n,r=l)}if(L>i){var c=s(i);r>c&&(o=i)}if(o===t)return t;a(t,o),t=o}}function u(t){for(var e=s(t);t>0;){var r=l(t);if(r>=0){var n=s(r);if(n>e){a(t,r),t=r;continue}}return t}}function f(){if(L>0){var t=M[0];return a(0,L-1),L-=1,c(0),t}return-1}function h(t,e){var r=M[t];return b[r]===e?t:(b[r]=-(1/0),u(t),f(),b[r]=e,L+=1,u(L-1))}function d(t){if(!x[t]){x[t]=!0;var e=m[t],r=y[t];m[r]>=0&&(m[r]=e),y[e]>=0&&(y[e]=r),T[e]>=0&&h(T[e],i(e)),T[r]>=0&&h(T[r],i(r))}}function p(t,e){if(t[e]<0)return e;var r=e,n=e;do{var i=t[n];if(!x[n]||0>i||i===n)break;if(n=i,i=t[n],!x[n]||0>i||i===n)break;n=i,r=t[r]}while(r!==n);for(var a=e;a!==n;a=t[a])t[a]=n;return n}for(var g=e.length,v=t.length,m=new Array(g),y=new Array(g),b=new Array(g),x=new Array(g),_=0;g>_;++_)m[_]=y[_]=-1,b[_]=1/0,x[_]=!1;for(var _=0;v>_;++_){var w=t[_];if(2!==w.length)throw new Error("Input must be a graph");var k=w[1],A=w[0];-1!==y[A]?y[A]=-2:y[A]=k,-1!==m[k]?m[k]=-2:m[k]=A}for(var M=[],T=new Array(g),_=0;g>_;++_){var E=b[_]=i(_);1/0>E?(T[_]=M.length,M.push(_)):T[_]=-1}for(var L=M.length,_=L>>1;_>=0;--_)c(_);for(;;){var S=f();if(0>S||b[S]>r)break;d(S)}for(var C=[],_=0;g>_;++_)x[_]||(T[_]=C.length,C.push(e[_].slice()));var z=(C.length,[]);return t.forEach(function(t){var e=p(m,t[0]),r=p(y,t[1]);if(e>=0&&r>=0&&e!==r){var n=T[e],i=T[r];n!==i&&z.push([n,i])}}),o.unique(o.normalize(z)),{positions:C,edges:z}}e.exports=i;var a=t("robust-orientation"),o=t("simplicial-complex")},{"robust-orientation":259,"simplicial-complex":297}],299:[function(t,e,r){"use strict";e.exports=["",{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0},{path:"M2,2V-2H-2V2Z",backoff:0}]},{}],300:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=t("../../plots/cartesian/constants"),o=t("../../lib/extend").extendFlat;e.exports={_isLinkedToArray:!0,text:{valType:"string"},textangle:{valType:"angle",dflt:0},font:o({},i,{}),opacity:{valType:"number",min:0,max:1,dflt:1},align:{valType:"enumerated",values:["left","center","right"],dflt:"center"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)"},borderpad:{valType:"number",min:0,dflt:1},borderwidth:{valType:"number",min:0,dflt:1},showarrow:{valType:"boolean",dflt:!0},arrowcolor:{valType:"color"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1},arrowsize:{valType:"number",min:.3,dflt:1},arrowwidth:{valType:"number",min:.1},ax:{valType:"number",dflt:-10},ay:{valType:"number",dflt:-30},xref:{valType:"enumerated",values:["paper",a.idRegex.x.toString()]},x:{valType:"number"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()]},y:{valType:"number"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"},_deprecated:{ref:{valType:"string"}}}},{"../../lib/extend":376,"../../plots/cartesian/constants":408,"../../plots/font_attributes":421,"./arrow_paths":299}],301:[function(t,e,r){"use strict";function n(t,e){function r(e,r){return c.coerce(t,n,v.layoutAttributes,e,r)}var n={};r("opacity"),r("align"),r("bgcolor");var i=r("bordercolor"),a=f.opacity(i);r("borderpad");var o=r("borderwidth"),s=r("showarrow");s&&(r("arrowcolor",a?n.bordercolor:f.defaultLine),r("arrowhead"),r("arrowsize"),r("arrowwidth",2*(a&&o||1)),r("ax"),r("ay"),c.noneOrAll(t,n,["ax","ay"])),r("text",s?" ":"new text"),r("textangle"),c.coerceFont(r,"font",e.font);for(var l=["x","y"],h=0;2>h;h++){var d=l[h],p={_fullLayout:e},g=u.coerceRef(t,n,p,d),m=.5;if("paper"!==g){var y=u.getFromId(p,g);if(m=y.range[0]+m*(y.range[1]-y.range[0]),-1!==["date","category"].indexOf(y.type)&&"string"==typeof t[d]){var b;"date"===y.type?(b=c.dateTime2ms(t[d]),b!==!1&&(t[d]=b)):(y._categories||[]).length&&(b=y._categories.indexOf(t[d]),-1!==b&&(t[d]=b))}}r(d,m),s||r(d+"anchor")}return c.noneOrAll(t,n,["x","y"]),n}function i(t){var e=t._fullLayout;e.annotations.forEach(function(e){var r=u.getFromId(t,e.xref),n=u.getFromId(t,e.yref);if(r||n){var i=(e._xsize||0)/2,a=e._xshift||0,o=(e._ysize||0)/2,s=e._yshift||0,l=i-a,c=i+a,f=o-s,h=o+s;if(e.showarrow){var d=3*e.arrowsize*e.arrowwidth;l=Math.max(l,d),c=Math.max(c,d),f=Math.max(f,d),h=Math.max(h,d)}r&&r.autorange&&u.expand(r,[r.l2c(e.x)],{ppadplus:c,ppadminus:l}),n&&n.autorange&&u.expand(n,[n.l2c(e.y)],{ppadplus:h,ppadminus:f})}})}function a(t,e,r,n,i,a,o,s){var l=r-t,c=i-t,u=o-i,f=n-e,h=a-e,d=s-a,p=l*d-u*f;if(0===p)return null;var g=(c*d-u*h)/p,v=(c*f-l*h)/p;return 0>v||v>1||0>g||g>1?null:{x:t+l*g,y:e+f*g}}var o=t("d3"),s=t("fast-isnumeric"),l=t("../../plotly"),c=t("../../lib"),u=t("../../plots/cartesian/axes"),f=t("../color"),h=t("../drawing"),d=t("../../lib/svg_text_utils"),p=t("../../lib/setcursor"),g=t("../dragelement"),v=e.exports={};v.ARROWPATHS=t("./arrow_paths"),v.layoutAttributes=t("./attributes"),v.supplyLayoutDefaults=function(t,e){for(var r=t.annotations||[],i=e.annotations=[],a=0;at?"left":t>2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}tt.selectAll("tspan.line").attr({y:0,x:0});var n=W.select(".annotation-math-group"),i=!n.empty(),s=h.bBox((i?n:tt).node()),d=s.width,m=s.height,y=Math.round(d+2*$),b=Math.round(m+2*$);U._w=d,U._h=m;var x=!1;if(["x","y"].forEach(function(e){var n,i=u.getFromId(t,U[e+"ref"]||e),a=(G+("x"===e?0:90))*Math.PI/180,o=y*Math.abs(Math.cos(a))+b*Math.abs(Math.sin(a)),s=U[e+"anchor"];if(i){if(!i.autorange&&(U[e]-i.range[0])*(U[e]-i.range[1])>0)return void(x=!0);H[e]=i._offset+i.l2p(U[e]),n=.5}else n=U[e],"y"===e&&(n=1-n),H[e]="x"===e?S.l+S.w*n:S.t+S.h*n;var l=0;l=U.showarrow?U["a"+e]:o*r(n,s),H[e]+=l,U["_"+e+"type"]=i&&i.type,U["_"+e+"size"]=o,U["_"+e+"shift"]=l}),x)return void W.remove();var w,k;U.showarrow&&(w=c.constrain(H.x-U.ax,1,_.width-1),k=c.constrain(H.y-U.ay,1,_.height-1)),H.x=c.constrain(H.x,1,_.width-1),H.y=c.constrain(H.y,1,_.height-1);var A=$-s.top,M=$-s.left;i?n.select("svg").attr({x:$-1,y:$}):(tt.attr({x:M,y:A}),tt.selectAll("tspan.line").attr({y:A,x:M})),Q.call(h.setRect,Z/2,Z/2,y-Z,b-Z);var T=Math.round(H.x-y/2),E=Math.round(H.y-b/2);W.call(c.setTranslate,T,E);var L="annotations["+e+"]",C=function(r,n){o.select(t).selectAll('.annotation-arrow-g[data-index="'+e+'"]').remove();var i=H.x+r,s=H.y+n,u=c.rotationXYMatrix(G,i,s),h=c.apply2DTransform(u),d=c.apply2DTransform2(u),p=Q.attr("width")/2,m=Q.attr("height")/2,y=[[i-p,s-m,i-p,s+m],[i-p,s+m,i+p,s+m],[i+p,s+m,i+p,s-m],[i+p,s-m,i-p,s-m]].map(d);if(!y.reduce(function(t,e){return t^!!a(w,k,w+1e6,k+1e6,e[0],e[1],e[2],e[3])},!1)){y.forEach(function(t){var e=a(i,s,w,k,t[0],t[1],t[2],t[3]);e&&(i=e.x,s=e.y)});var b=U.arrowwidth,x=U.arrowcolor,_=Y.append("g").style({opacity:f.opacity(x)}).classed("annotation-arrow-g",!0).attr("data-index",String(e)),A=_.append("path").attr("d","M"+i+","+s+"L"+w+","+k).style("stroke-width",b+"px").call(f.stroke,f.rgb(x));v.arrowhead(A,U.arrowhead,"end",U.arrowsize);var M=_.append("path").classed("annotation",!0).classed("anndrag",!0).attr({"data-index":String(e),d:"M3,3H-3V-3H3ZM0,0L"+(i-w)+","+(s-k),transform:"translate("+w+","+k+")"}).style("stroke-width",b+6+"px").call(f.stroke,"rgba(0,0,0,0)").call(f.fill,"rgba(0,0,0,0)");if(t._context.editable){var T,E,C;g.init({element:M.node(),prepFn:function(){var t=c.getTranslate(W);E=t.x,C=t.y,T={},V&&V.autorange&&(T[V._name+".autorange"]=!0),q&&q.autorange&&(T[q._name+".autorange"]=!0)},moveFn:function(t,e){_.attr("transform","translate("+t+","+e+")");var r=h(E,C),n=r[0]+t,i=r[1]+e;W.call(c.setTranslate,n,i),T[L+".x"]=V?U.x+t/V._m:(w+t-S.l)/S.w,T[L+".y"]=q?U.y+e/q._m:1-(k+e-S.t)/S.h,X.attr({transform:"rotate("+G+","+n+","+i+")"})},doneFn:function(e){if(e){l.relayout(t,T);var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}}})}}};U.showarrow&&C(0,0);var z=c.rotationXYMatrix(G,H.x,H.y),P=c.apply2DTransform(z);if(t._context.editable){var R,O,I;g.init({element:W.node(),prepFn:function(){var t=c.getTranslate(W);R=t.x,O=t.y,I={}},moveFn:function(t,e){W.call(c.setTranslate,R+t,O+e);var r="pointer";if(U.showarrow)I[L+".ax"]=U.ax+t,I[L+".ay"]=U.ay+e,C(t,e);else{if(V)I[L+".x"]=U.x+t/V._m;else{var n=U._xsize/S.w,i=U.x+U._xshift/S.w-n/2;I[L+".x"]=g.align(i+t/S.w,n,0,1,U.xanchor)}if(q)I[L+".y"]=U.y+e/q._m;else{var a=U._ysize/S.h,o=U.y-U._yshift/S.h-a/2;I[L+".y"]=g.align(o-e/S.h,a,0,1,U.yanchor)}V&&q||(r=g.getCursor(V?.5:I[L+".x"],q?.5:I[L+".y"],U.xanchor,U.yanchor))}var s=P(R,O),l=s[0]+t,u=s[1]+e;W.call(c.setTranslate,R+t,O+e),X.attr({transform:"rotate("+G+","+l+","+u+")"}),p(W,r)},doneFn:function(e){if(p(W),e){l.relayout(t,I);var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}}})}}var b,x=t.layout,_=t._fullLayout;if(!s(e)||-1===e){if(!e&&Array.isArray(i))return x.annotations=i,v.supplyLayoutDefaults(x,_),void v.drawAll(t);if("remove"===i)return delete x.annotations,_.annotations=[],void v.drawAll(t);if(r&&"add"!==i){for(b=0;b<_.annotations.length;b++)v.draw(t,b,r,i);return}e=_.annotations.length,_.annotations.push({})}if(!r&&i){if("remove"===i){for(_._infolayer.selectAll('.annotation[data-index="'+e+'"]').remove(),_.annotations.splice(e,1),x.annotations.splice(e,1),b=e;b<_.annotations.length;b++)_._infolayer.selectAll('.annotation[data-index="'+(b+1)+'"]').attr("data-index",String(b)),v.draw(t,b);return}if("add"===i||c.isPlainObject(i)){_.annotations.splice(e,0,{});var w=c.isPlainObject(i)?c.extendFlat({},i):{text:"New text"};for(x.annotations?x.annotations.splice(e,0,w):x.annotations=[w],b=_.annotations.length-1;b>e;b--)_._infolayer.selectAll('.annotation[data-index="'+(b-1)+'"]').attr("data-index",String(b)),v.draw(t,b)}}_._infolayer.selectAll('.annotation[data-index="'+e+'"]').remove();var k=x.annotations[e],A=_.annotations[e];if(k){var M={xref:k.xref,yref:k.yref},T={};"string"==typeof r&&r?T[r]=i:c.isPlainObject(r)&&(T=r);var E=Object.keys(T);for(b=0;bb;b++){var z=C[b];if(void 0===T[z]&&void 0!==k[z]){var P=u.getFromId(t,u.coerceRef(M,{},t,z)),R=u.getFromId(t,u.coerceRef(k,{},t,z)),O=k[z],I=A["_"+z+"type"];if(void 0!==T[z+"ref"]){var N="auto"===k[z+"anchor"],j="x"===z?S.w:S.h,F=(A["_"+z+"size"]||0)/(2*j);if(P&&R)O=(O-P.range[0])/(P.range[1]-P.range[0]),O=R.range[0]+O*(R.range[1]-R.range[0]);else if(P){if(O=(O-P.range[0])/(P.range[1]-P.range[0]),O=P.domain[0]+O*(P.domain[1]-P.domain[0]),N){var D=O+F,B=O-F;2/3>O+B?O=B:O+D>4/3&&(O=D)}}else R&&(N&&(1/3>O?O+=F:O>2/3&&(O-=F)),O=(O-R.domain[0])/(R.domain[1]-R.domain[0]),O=R.range[0]+O*(R.range[1]-R.range[0]))}R&&R===P&&I&&("log"===I&&"log"!==R.type?O=Math.pow(10,O):"log"!==I&&"log"===R.type&&(O=O>0?Math.log(O)/Math.LN10:void 0)),k[z]=O}}var U=n(k,_);_.annotations[e]=U;var V=u.getFromId(t,U.xref),q=u.getFromId(t,U.yref),H={x:0,y:0},G=+U.textangle||0,Y=_._infolayer.append("g").classed("annotation",!0).attr("data-index",String(e)).style("opacity",U.opacity).on("click",function(){t._dragging=!1,t.emit("plotly_clickannotation",{index:e,annotation:k,fullAnnotation:U})}),X=Y.append("g").classed("annotation-text-g",!0).attr("data-index",String(e)),W=X.append("g"),Z=U.borderwidth,K=U.borderpad,$=Z+K,Q=W.append("rect").attr("class","bg").style("stroke-width",Z+"px").call(f.stroke,U.bordercolor).call(f.fill,U.bgcolor),J=U.font,tt=W.append("text").classed("annotation",!0).attr("data-unformatted",U.text).text(U.text);t._context.editable?tt.call(d.makeEditable,W).call(m).on("edit",function(r){U.text=r,this.attr({"data-unformatted":U.text}),this.call(m);var n={};n["annotations["+e+"].text"]=U.text,V&&V.autorange&&(n[V._name+".autorange"]=!0),q&&q.autorange&&(n[q._name+".autorange"]=!0),l.relayout(t,n)}):tt.call(m),X.attr({transform:"rotate("+G+","+H.x+","+H.y+")"}).call(h.setPosition,H.x,H.y)}},v.arrowhead=function(t,e,r,n){s(n)||(n=1);var i=t.node(),a=v.ARROWPATHS[e||0];if(a){"string"==typeof r&&r||(r="end");var l,c,u,d,p=(h.getPx(t,"stroke-width")||1)*n,g=t.style("stroke")||f.defaultLine,m=t.style("stroke-opacity")||1,y=r.indexOf("start")>=0,b=r.indexOf("end")>=0,x=a.backoff*p;if("line"===i.nodeName){if(l={x:+t.attr("x1"),y:+t.attr("y1")},c={x:+t.attr("x2"),y:+t.attr("y2")},u=Math.atan2(l.y-c.y,l.x-c.x),d=u+Math.PI,x){var _=x*Math.cos(u),w=x*Math.sin(u);y&&(l.x-=_,l.y-=w,t.attr({x1:l.x,y1:l.y})),b&&(c.x+=_,c.y+=w,t.attr({x2:c.x,y2:c.y}))}}else if("path"===i.nodeName){var k=i.getTotalLength(),A="";if(y){var M=i.getPointAtLength(0),T=i.getPointAtLength(.1);u=Math.atan2(M.y-T.y,M.x-T.x),l=i.getPointAtLength(Math.min(x,k)),x&&(A="0px,"+x+"px,")}if(b){var E=i.getPointAtLength(k),L=i.getPointAtLength(k-.1);if(d=Math.atan2(E.y-L.y,E.x-L.x),c=i.getPointAtLength(Math.max(0,k-x)),x){var S=A?2*x:x;A+=k-S+"px,"+k+"px"}}else A&&(A+=k+"px");A&&t.style("stroke-dasharray",A)}var C=function(r,n){e>5&&(n=0),o.select(i.parentElement).append("path").attr({"class":t.attr("class"),d:a.path,transform:"translate("+r.x+","+r.y+")rotate("+180*n/Math.PI+")scale("+p+")"}).style({fill:g,opacity:m,"stroke-width":0})};y&&C(l,u),b&&C(c,d)}},v.calcAutorange=function(t){var e=t._fullLayout,r=e.annotations;if(r.length&&t._fullData.length){var n={};r.forEach(function(t){n[t.xref]=!0,n[t.yref]=!0});var a=u.list(t).filter(function(t){return t.autorange&&n[t._id]});if(a.length)return c.syncOrAsync([v.drawAll,i],t)}}},{"../../lib":381,"../../lib/setcursor":389,"../../lib/svg_text_utils":393,"../../plotly":400,"../../plots/cartesian/axes":403,"../color":303,"../dragelement":323,"../drawing":325,"./arrow_paths":299,"./attributes":300,d3:113,"fast-isnumeric":117}],302:[function(t,e,r){"use strict";r.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],r.defaultLine="#444",r.lightLine="#eee",r.background="#fff",r.lightFraction=1e3/11},{}],303:[function(t,e,r){"use strict";function n(t){if(a(t)||"string"!=typeof t)return t;var e=t.trim();if("rgb"!==e.substr(0,3))return t;var r=e.match(/^rgba?\s*\(([^()]*)\)$/);if(!r)return t;var n=r[1].trim().split(/\s*[\s,]\s*/),i="a"===e.charAt(3)&&4===n.length;if(!i&&3!==n.length)return t;for(var o=0;o=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}var i=t("tinycolor2"),a=t("fast-isnumeric"),o=e.exports={},s=t("./attributes");o.defaults=s.defaults,o.defaultLine=s.defaultLine,o.lightLine=s.lightLine,o.background=s.background,o.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},o.rgb=function(t){return o.tinyRGB(i(t))},o.opacity=function(t){return t?i(t).getAlpha():0},o.addOpacity=function(t,e){var r=i(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=i(t).toRgb();if(1===r.a)return i(t).toRgbString();var n=i(e||o.background).toRgb(),a=1===n.a?n:{r:255*(1-n.a)+n.r*n.a,g:255*(1-n.a)+n.g*n.a,b:255*(1-n.a)+n.b*n.a},s={r:a.r*(1-r.a)+r.r*r.a,g:a.g*(1-r.a)+r.g*r.a,b:a.b*(1-r.a)+r.b*r.a};return i(s).toRgbString()},o.stroke=function(t,e){var r=i(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=i(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,i,a,s=Object.keys(t);for(e=0;el&&(a[1]-=(ot-l)/2)):r.node()&&!r.classed("js-placeholder")&&(ot=h.bBox(e.node()).height),ot){if(ot+=5,"top"===x.titleside)Q.domain[1]-=ot/M.h,a[1]*=-1;else{Q.domain[0]+=ot/M.h;var u=Math.max(1,r.selectAll("tspan.line").size());a[1]+=(1-u)*l}e.attr("transform","translate("+a+")"),Q.setScale()}}it.selectAll(".cbfills,.cblines,.cbaxis").attr("transform","translate(0,"+Math.round(M.h*(1-Q.domain[1]))+")");var f=it.select(".cbfills").selectAll("rect.cbfill").data(S);f.enter().append("rect").classed("cbfill",!0).style("stroke","none"),f.exit().remove(),f.each(function(t,e){var r=[0===e?E[0]:(S[e]+S[e-1])/2,e===S.length-1?E[1]:(S[e]+S[e+1])/2].map(Q.c2p).map(Math.round);e!==S.length-1&&(r[1]+=r[1]>r[0]?1:-1);var a=z(t).replace("e-",""),o=i(a).toHexString();n.select(this).attr({x:Y,width:Math.max(D,2),y:n.min(r),height:Math.max(n.max(r)-n.min(r),2),fill:o})});var d=it.select(".cblines").selectAll("path.cbline").data(x.line.color&&x.line.width?L:[]);return d.enter().append("path").classed("cbline",!0),d.exit().remove(),d.each(function(t){n.select(this).attr("d","M"+Y+","+(Math.round(Q.c2p(t))+x.line.width/2%1)+"h"+D).call(h.lineGroupStyle,x.line.width,C(t),x.line.dash)}),Q._axislayer.selectAll("g."+Q._id+"tick,path").remove(),Q._pos=Y+D+(x.outlinewidth||0)/2-("outside"===x.ticks?1:0),Q.side="right",c.syncOrAsync([function(){return s.doTicks(t,Q,!0)},function(){if(-1===["top","bottom"].indexOf(x.titleside)){var e=Q.titlefont.size,r=Q._offset+Q._length/2,i=M.l+(Q.position||0)*M.w+("right"===Q.side?10+e*(Q.showticklabels?1:.5):-10-e*(Q.showticklabels?.5:0));w("h"+Q._id+"title",{avoid:{selection:n.select(t).selectAll("g."+Q._id+"tick"),side:x.titleside,offsetLeft:M.l,offsetTop:M.t,maxShift:A.width},attributes:{x:i,y:r,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])}function w(e,r){var n,i=b();n=o.traceIs(i,"markerColorscale")?"marker.colorbar.title":"colorbar.title";var a={propContainer:Q,propName:n,traceIndex:i.index,dfltName:"colorscale",containerGroup:it.select(".cbtitle")},s="h"===e.charAt(0)?e.substr(1):"h"+e;it.selectAll("."+s+",."+s+"-math-group").remove(),p.draw(t,e,u(a,r||{}))}function k(){var r=D+x.outlinewidth/2+h.bBox(Q._axislayer.node()).width;if(N=at.select("text"),N.node()&&!N.classed("js-placeholder")){var n,i=at.select(".h"+Q._id+"title-math-group").node();n=i&&-1!==["top","bottom"].indexOf(x.titleside)?h.bBox(i).width:h.bBox(at.node()).right-Y-M.l,r=Math.max(r,n)}var a=2*x.xpad+r+x.borderwidth+x.outlinewidth/2,s=Z-K;it.select(".cbbg").attr({x:Y-x.xpad-(x.borderwidth+x.outlinewidth)/2,y:K-H,width:Math.max(a,2),height:Math.max(s+2*H,2)}).call(d.fill,x.bgcolor).call(d.stroke,x.bordercolor).style({"stroke-width":x.borderwidth}),it.selectAll(".cboutline").attr({x:Y,y:K+x.ypad+("top"===x.titleside?ot:0),width:Math.max(D,2),height:Math.max(s-2*x.ypad-ot,2)}).call(d.stroke,x.outlinecolor).style({fill:"None","stroke-width":x.outlinewidth});var l=({center:.5,right:1}[x.xanchor]||0)*a;it.attr("transform","translate("+(M.l-l)+","+M.t+")"),o.autoMargin(t,e,{x:x.x,y:x.y,l:a*({right:1,center:.5}[x.xanchor]||0),r:a*({left:1,center:.5}[x.xanchor]||0),t:s*({bottom:1,middle:.5}[x.yanchor]||0),b:s*({top:1,middle:.5}[x.yanchor]||0)})}var A=t._fullLayout,M=A._size;if("function"!=typeof x.fillcolor&&"function"!=typeof x.line.color)return void A._infolayer.selectAll("g."+e).remove();var T,E=n.extent(("function"==typeof x.fillcolor?x.fillcolor:x.line.color).domain()),L=[],S=[],C="function"==typeof x.line.color?x.line.color:function(){return x.line.color},z="function"==typeof x.fillcolor?x.fillcolor:function(){return x.fillcolor},P=x.levels.end+x.levels.size/100,R=x.levels.size,O=1.001*E[0]-.001*E[1],I=1.001*E[1]-.001*E[0];for(T=x.levels.start;0>(T-P)*R;T+=R)T>O&&I>T&&L.push(T);if("function"==typeof x.fillcolor)if(x.filllevels)for(P=x.filllevels.end+x.filllevels.size/100,R=x.filllevels.size,T=x.filllevels.start;0>(T-P)*R;T+=R)T>E[0]&&T1){var nt=Math.pow(10,Math.floor(Math.log(rt)/Math.LN10));tt*=nt*c.roundUp(rt/nt,[2,5,10]),(Math.abs(x.levels.start)/x.levels.size+1e-6)%1<2e-6&&(Q.tick0=0)}Q.dtick=tt}Q.domain=[W+G,W+V-G],Q.setScale();var it=A._infolayer.selectAll("g."+e).data([0]);it.enter().append("g").classed(e,!0).each(function(){var t=n.select(this);t.append("rect").classed("cbbg",!0),t.append("g").classed("cbfills",!0),t.append("g").classed("cblines",!0),t.append("g").classed("cbaxis",!0).classed("crisp",!0),t.append("g").classed("cbtitleunshift",!0).append("g").classed("cbtitle",!0),t.append("rect").classed("cboutline",!0),t.select(".cbtitle").datum(0)}),it.attr("transform","translate("+Math.round(M.l)+","+Math.round(M.t)+")");var at=it.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(M.l)+",-"+Math.round(M.t)+")");Q._axislayer=it.select(".cbaxis");var ot=0;if(-1!==["top","bottom"].indexOf(x.titleside)){var st,lt=M.l+(x.x+q)*M.w,ct=Q.titlefont.size;st="top"===x.titleside?(1-(W+V-G))*M.h+M.t+3+.75*ct:(1-(W+G))*M.h+M.t-3-.25*ct,w(Q._id+"title",{attributes:{x:lt,y:st,"text-anchor":"start"}})}var ut=c.syncOrAsync([o.previousPromises,_,o.previousPromises,k],t);if(ut&&ut.then&&(t._promises||[]).push(ut),t._context.editable){var ft,ht,dt;l.init({element:it.node(),prepFn:function(){ft=it.attr("transform"),f(it)},moveFn:function(t,e){it.attr("transform",ft+" translate("+t+","+e+")"),ht=l.align(X+t/M.w,B,0,1,x.xanchor),dt=l.align(W-e/M.h,V,0,1,x.yanchor);var r=l.getCursor(ht,dt,x.xanchor,x.yanchor);f(it,r)},doneFn:function(e){f(it),e&&void 0!==ht&&void 0!==dt&&a.restyle(t,{"colorbar.x":ht,"colorbar.y":dt},b().index)}})}return ut}function b(){var r,n,i=e.substr(2);for(r=0;ru*f?i.RdBu:u>=0?i.Reds:i.Blues,l.colorscale=h,s.reversescale&&(h=a(h)),s.colorscale=h)}},{"../../lib":381,"./flip_scale":313,"./scales":320}],311:[function(t,e,r){"use strict";var n=t("./scales");e.exports=n.RdBu},{"./scales":320}],312:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../colorbar/has_colorbar"),o=t("../colorbar/defaults"),s=t("./is_valid_scale"),l=t("./flip_scale");e.exports=function(t,e,r,c,u){var f=u.prefix,h=u.cLetter,d=f.slice(0,f.length-1),p=f?i.nestedProperty(t,d).get()||{}:t,g=f?i.nestedProperty(e,d).get()||{}:e,v=p[h+"min"],m=p[h+"max"],y=p.colorscale,b=n(v)&&n(m)&&m>v;c(f+h+"auto",!b),c(f+h+"min"),c(f+h+"max");var x;void 0!==y&&(x=!s(y)),c(f+"autocolorscale",x);var _=c(f+"colorscale"),w=c(f+"reversescale");if(w&&(g.colorscale=l(_)),"marker.line."!==f){var k;f&&(k=a(p));var A=c(f+"showscale",k);A&&o(p,g,r)}}},{"../../lib":381,"../colorbar/defaults":305,"../colorbar/has_colorbar":307,"./flip_scale":313,"./is_valid_scale":317,"fast-isnumeric":117}],313:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length,n=new Array(r),i=r-1,a=0;i>=0;i--,a++)e=t[i],n[a]=[1-e[0],e[1]];return n}},{}],314:[function(t,e,r){"use strict";var n=t("./scales"),i=t("./default_scale"),a=t("./is_valid_scale_array");e.exports=function(t,e){function r(){try{t=n[t]||JSON.parse(t)}catch(r){t=e}}return e||(e=i),t?("string"==typeof t&&(r(),"string"==typeof t&&r()),a(t)?t:e):e}},{"./default_scale":311,"./is_valid_scale_array":318,"./scales":320}],315:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./is_valid_scale");e.exports=function(t,e){var r=e?i.nestedProperty(t,e).get()||{}:t,o=r.color,s=!1;if(Array.isArray(o))for(var l=0;lh;h++)l=t[h],u[h]=e+l[0]*(r-e),f[h]=i(l[1]).toRgb();var d=n.scale.linear().domain(u).interpolate(n.interpolateObject).range(f);return function(t){if(a(t)){var n=o.constrain(t,e,r),l=d(n);return i(l).toRgbString()}return i(t).isValid()?t:s.defaultLine}}},{"../../lib":381,"../color":303,d3:113,"fast-isnumeric":117,tinycolor2:274}],320:[function(t,e,r){"use strict";e.exports={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]]}},{}],321:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i){var a=(t-r)/(n-r),o=a+e/(n-r),s=(a+o)/2;return"left"===i||"bottom"===i?a:"center"===i||"middle"===i?s:"right"===i||"top"===i?o:2/3-s>a?a:o>4/3-s?o:s}},{}],322:[function(t,e,r){"use strict";var n=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,a){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:n.constrain(Math.floor(3*e),0,2),i[e][t]}},{"../../lib":381}],323:[function(t,e,r){"use strict";function n(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function i(t){t._dragging=!1,t._replotPending&&a.plot(t)}var a=t("../../plotly"),o=t("../../lib"),s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var c=t("./unhover");l.unhover=c.wrapped,l.unhoverRaw=c.raw,l.init=function(t){function e(e){return p._dragged=!1,p._dragging=!0,c=e.clientX,u=e.clientY,d=e.target,f=(new Date).getTime(),f-p._mouseDownTimev&&(g=Math.max(g-1,1)),t.doneFn&&t.doneFn(p._dragged,g),!p._dragged){var r=document.createEvent("MouseEvents");r.initEvent("click",!0,!0),d.dispatchEvent(r)}return i(p),p._dragged=!1,o.pauseEvent(e)}var c,u,f,h,d,p=o.getPlotDiv(t.element)||{},g=1,v=s.DBLCLICKDELAY;p._mouseDownTime||(p._mouseDownTime=0),t.element.onmousedown=e,t.element.style.pointerEvents="all"}},{"../../lib":381,"../../plotly":400,"../../plots/cartesian/constants":408,"./align":321,"./cursor":322,"./unhover":324}],324:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=e.exports={};i.wrapped=function(t,e,r){"string"==typeof t&&(t=document.getElementById(t)),t._hoverTimer&&(clearTimeout(t._hoverTimer),t._hoverTimer=void 0),i.raw(t,e,r)},i.raw=function(t,e){var r=t._fullLayout;e||(e={}),e.target&&n.triggerHandler(t,"plotly_beforehover",e)===!1||(r._hoverlayer.selectAll("g").remove(),e.target&&t._hoverdata&&t.emit("plotly_unhover",{points:t._hoverdata}),t._hoverdata=void 0)}},{"../../lib/events":375}],325:[function(t,e,r){"use strict";function n(t,e,r,n){var a=t[0]-e[0],o=t[1]-e[1],s=r[0]-e[0],l=r[1]-e[1],c=Math.pow(a*a+o*o,x/2),u=Math.pow(s*s+l*l,x/2),f=(u*u*a-c*c*s)*n,h=(u*u*o-c*c*l)*n,d=3*u*(c+u),p=3*c*(c+u);return[[i.round(e[0]+(d&&f/d),2),i.round(e[1]+(d&&h/d),2)],[i.round(e[0]-(p&&f/p),2),i.round(e[1]-(p&&h/p),2)]]}var i=t("d3"),a=t("fast-isnumeric"),o=t("../../plots/plots"),s=t("../color"),l=t("../colorscale"),c=t("../../lib"),u=t("../../lib/svg_text_utils"),f=t("../../constants/xmlns_namespaces"),h=t("../../traces/scatter/subtypes"),d=t("../../traces/scatter/make_bubble_size_func"),p=e.exports={};p.font=function(t,e,r,n){e&&e.family&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(s.fill,n)},p.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},p.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},p.setRect=function(t,e,r,n,i){t.call(p.setPosition,e,r).call(p.setSize,n,i)},p.translatePoints=function(t,e,r){t.each(function(t){var n=t.xp||e.c2p(t.x),o=t.yp||r.c2p(t.y),s=i.select(this);a(n)&&a(o)?"text"===this.nodeName?s.attr("x",n).attr("y",o):s.attr("transform","translate("+n+","+o+")"):s.remove()})},p.getPx=function(t,e){return Number(t.style(e).replace(/px$/,""))},p.crispRound=function(t,e,r){return e&&a(e)?t._context.staticPlot?e:1>e?1:Math.round(e):r||0},p.lineGroupStyle=function(t,e,r,n){t.style("fill","none").each(function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},o=e||a.width||0,l=n||a.dash||"";i.select(this).call(s.stroke,r||a.color).call(p.dashLine,l,o)})},p.dashLine=function(t,e,r){var n=Math.max(r,3);"solid"===e?e="":"dot"===e?e=n+"px,"+n+"px":"dash"===e?e=3*n+"px,"+3*n+"px":"longdash"===e?e=5*n+"px,"+5*n+"px":"dashdot"===e?e=3*n+"px,"+n+"px,"+n+"px,"+n+"px":"longdashdot"===e&&(e=5*n+"px,"+2*n+"px,"+n+"px,"+2*n+"px"),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},p.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var r=i.select(this);try{r.call(s.fill,e[0].trace.fillcolor)}catch(n){console.log(n,t),r.remove()}})};var g=t("./symbol_defs");p.symbolNames=[],p.symbolFuncs=[],p.symbolNeedLines={},p.symbolNoDot={},p.symbolList=[],Object.keys(g).forEach(function(t){var e=g[t];p.symbolList=p.symbolList.concat([e.n,t,e.n+100,t+"-open"]),p.symbolNames[e.n]=t,p.symbolFuncs[e.n]=e.f,e.needLine&&(p.symbolNeedLines[e.n]=!0),e.noDot?p.symbolNoDot[e.n]=!0:p.symbolList=p.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"])});var v=p.symbolNames.length,m="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";p.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),t=p.symbolNames.indexOf(t),t>=0&&(t+=e)}return t%100>=v||t>=400?0:Math.floor(Math.max(t,0))},p.pointStyle=function(t,e){if(t.size()){var r=e.marker,n=r.line;if(o.traceIs(e,"symbols")){var a=d(e);t.attr("d",function(t){var n;n="various"===t.ms||"various"===r.size?3:h.isBubble(e)?a(t.ms):(r.size||6)/2,t.mrc=n;var i=p.symbolNumber(t.mx||r.symbol)||0,o=i%100;return t.om=i%200>=100,p.symbolFuncs[o](n)+(i>=200?m:"")}).style("opacity",function(t){return(t.mo+1||r.opacity+1)-1})}var l=(e._input||{}).marker||{},c=p.tryColorscale(r,l,""),u=p.tryColorscale(r,l,"line.");t.each(function(t){var e,a,o;t.so?(o=n.outlierwidth,a=n.outliercolor,e=r.outliercolor):(o=(t.mlw+1||n.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,a="mlc"in t?t.mlcc=u(t.mlc):Array.isArray(n.color)?s.defaultLine:n.color,e="mc"in t?t.mcc=c(t.mc):Array.isArray(r.color)?s.defaultLine:r.color||"rgba(0,0,0,0)");var l=i.select(this);t.om?l.call(s.stroke,e).style({"stroke-width":(o||1)+"px",fill:"none"}):(l.style("stroke-width",o+"px").call(s.fill,e),o&&l.call(s.stroke,a))})}},p.tryColorscale=function(t,e,r){var n=c.nestedProperty(t,r+"color").get(),i=c.nestedProperty(t,r+"colorscale").get(),o=c.nestedProperty(t,r+"cauto").get(),s=c.nestedProperty(t,r+"cmin"),u=c.nestedProperty(t,r+"cmax"),f=s.get(),h=u.get();return i&&Array.isArray(n)?(!o&&a(f)&&a(h)||(f=1/0,h=-(1/0),n.forEach(function(t){a(t)&&(f>t&&(f=+t),t>h&&(h=+t))}),f>h&&(f=0,h=1),s.set(f),u.set(h),c.nestedProperty(e,r+"cmin").set(f),c.nestedProperty(e,r+"cmax").set(h)),l.makeScaleFunction(i,f,h)):c.identity};var y={start:1,end:-1,middle:0,bottom:1,top:-1},b=1.3;p.textPointStyle=function(t,e){t.each(function(t){var r=i.select(this),n=t.tx||e.text;if(!n||Array.isArray(n))return void r.remove();var o=t.tp||e.textposition,s=-1!==o.indexOf("top")?"top":-1!==o.indexOf("bottom")?"bottom":"middle",l=-1!==o.indexOf("left")?"end":-1!==o.indexOf("right")?"start":"middle",c=t.ts||e.textfont.size,f=t.mrc?t.mrc/.8+1:0;c=a(c)&&c>0?c:0,r.call(p.font,t.tf||e.textfont.family,c,t.tc||e.textfont.color).attr("text-anchor",l).text(n).call(u.convertToTspans);var h=i.select(this.parentNode),d=r.selectAll("tspan.line"),g=((d[0].length||1)-1)*b+1,v=y[l]*f,m=.75*c+y[s]*f+(y[s]-1)*g*c/2;h.attr("transform","translate("+v+","+m+")"),g>1&&d.attr({x:r.attr("x"),y:r.attr("y")})})};var x=.5;p.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,i="M"+t[0],a=[];for(r=1;rr;r++)o.push(n(t[r-1],t[r],t[r+1],e));for(o.push(n(t[a-1],t[a],t[0],e)),r=1;a>=r;r++)i+="C"+o[r-1][1]+" "+o[r][0]+" "+t[r];return i+="C"+o[a][1]+" "+o[0][0]+" "+t[0]+"Z"};var _={hv:function(t,e){return"H"+i.round(e[0],2)+"V"+i.round(e[1],2)},vh:function(t,e){return"V"+i.round(e[1],2)+"H"+i.round(e[0],2)},hvh:function(t,e){return"H"+i.round((t[0]+e[0])/2,2)+"V"+i.round(e[1],2)+"H"+i.round(e[0],2)},vhv:function(t,e){return"V"+i.round((t[1]+e[1])/2,2)+"H"+i.round(e[0],2)+"V"+i.round(e[1],2)}},w=function(t,e){return"L"+i.round(e[0],2)+","+i.round(e[1],2)};p.steps=function(t){var e=_[t]||w;return function(t){for(var r="M"+i.round(t[0][0],2)+","+i.round(t[0][1],2),n=1;n=A&&(i.selectAll("[data-bb]").attr("data-bb",null),k=[]),t.setAttribute("data-bb",k.length),k.push(l),c.extendFlat({},l)},p.setClipUrl=function(t,e){if(!e)return void t.attr("clip-path",null);var r="#"+e,n=i.select("base");n.size()&&n.attr("href")&&(r=window.location.href+r),t.attr("clip-path","url("+r+")")}},{"../../constants/xmlns_namespaces":369,"../../lib":381,"../../lib/svg_text_utils":393,"../../plots/plots":452,"../../traces/scatter/make_bubble_size_func":567,"../../traces/scatter/subtypes":573,"../color":303,"../colorscale":316,"./symbol_defs":326,d3:113,"fast-isnumeric":117}],326:[function(t,e,r){"use strict";var n=t("d3");e.exports={circle:{n:0,f:function(t){var e=n.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=n.round(.4*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H"+e+"V"+r+"H-"+e+"V"+e+"H-"+r+"V-"+e+"H-"+e+"V-"+r+"H"+e+"V-"+e+"H"+r+"Z"}},x:{n:4,f:function(t){var e=n.round(.8*t/Math.sqrt(2),2),r="l"+e+","+e,i="l"+e+",-"+e,a="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+i+a+i+a+o+a+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+e+","+r+"H"+e+"L0,-"+i+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+e+",-"+r+"H"+e+"L0,"+i+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M"+r+",-"+e+"V"+e+"L-"+i+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+r+",-"+e+"V"+e+"L"+i+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+r+",-"+e+"H"+e+"V"+r+"Z"}},"triangle-se":{n:10,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+e+",-"+r+"V"+e+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H-"+e+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+e+","+r+"V-"+e+"H"+r+"Z"}},pentagon:{n:13,f:function(t){var e=n.round(.951*t,2),r=n.round(.588*t,2),i=n.round(-t,2),a=n.round(t*-.309,2),o=n.round(.809*t,2);return"M"+e+","+a+"L"+r+","+o+"H-"+r+"L-"+e+","+a+"L0,"+i+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M"+i+",-"+r+"V"+r+"L0,"+e+"L-"+i+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+i+"H"+r+"L"+e+",0L"+r+",-"+i+"H-"+r+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=n.round(.924*t,2),r=n.round(.383*t,2);return"M-"+r+",-"+e+"H"+r+"L"+e+",-"+r+"V"+r+"L"+r+","+e+"H-"+r+"L-"+e+","+r+"V-"+r+"Z"}},star:{n:17,f:function(t){var e=1.4*t,r=n.round(.225*e,2),i=n.round(.951*e,2),a=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(e*-.309,2),c=n.round(.118*e,2),u=n.round(.809*e,2),f=n.round(.382*e,2);return"M"+r+","+l+"H"+i+"L"+a+","+c+"L"+o+","+u+"L0,"+f+"L-"+o+","+u+"L-"+a+","+c+"L-"+i+","+l+"H-"+r+"L0,"+s+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),i=n.round(.76*t,2);return"M-"+i+",0l-"+r+",-"+e+"h"+i+"l"+r+",-"+e+"l"+r+","+e+"h"+i+"l-"+r+","+e+"l"+r+","+e+"h-"+i+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+i+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+i+o+"-"+e+","+r+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+i+o+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+i+"-"+e+","+e+i+e+","+e+i+e+",-"+e+i+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+i+"0,"+e+i+e+",0"+i+"0,-"+e+i+"-"+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),i=n.round(.8*t,2);return"M-"+e+","+i+"L0,0M"+e+","+i+"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),i=n.round(.8*t,2);return"M-"+e+",-"+i+"L0,0M"+e+",-"+i+"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),i=n.round(.8*t,2);return"M"+i+","+e+"L0,0M"+i+",-"+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),i=n.round(.8*t,2);return"M-"+i+","+e+"L0,0M-"+i+",-"+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:113}],327:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"]},symmetric:{valType:"boolean"},array:{valType:"data_array"},arrayminus:{valType:"data_array"},value:{valType:"number",min:0,dflt:10},valueminus:{valType:"number",min:0,dflt:10},traceref:{valType:"integer",min:0,dflt:0},tracerefminus:{valType:"integer",min:0,dflt:0},copy_ystyle:{valType:"boolean"},copy_zstyle:{valType:"boolean"},color:{valType:"color"},thickness:{valType:"number",min:0,dflt:2},width:{valType:"number",min:0},_deprecated:{opacity:{valType:"number"}}}},{}],328:[function(t,e,r){"use strict";function n(t,e,r,n){var a=e["error_"+n]||{},l=a.visible&&-1!==["linear","log"].indexOf(r.type),c=[];if(l){for(var u=s(a),f=0;fs;s++)o[s]={x:r[s],y:i[s]};return o[0].trace=t,n.calc({calcdata:[o],_fullLayout:e}),o},n.plot=t("./plot"),n.style=t("./style"),n.hoverInfo=function(t,e,r){(e.error_y||{}).visible&&(r.yerr=t.yh-t.y,e.error_y.symmetric||(r.yerrneg=t.y-t.ys)),(e.error_x||{}).visible&&(r.xerr=t.xh-t.x,e.error_x.symmetric||(r.xerrneg=t.x-t.xs))}},{"./attributes":327,"./calc":328,"./defaults":330,"./plot":332,"./style":333}],332:[function(t,e,r){"use strict";function n(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};return void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(t.ys,!0))),void 0!==t.xh&&(n.xh=e.c2p(t.xh),n.xs=e.c2p(t.xs),a(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0))),n}var i=t("d3"),a=t("fast-isnumeric"),o=t("../../lib"),s=t("../../traces/scatter/subtypes");e.exports=function(t,e){var r=e.x(),l=e.y();t.each(function(t){var e=t[0].trace,c=e.error_x||{},u=e.error_y||{},f=s.hasMarkers(e)&&e.marker.maxdisplayed>0;if(u.visible||c.visible){var h=i.select(this).selectAll("g.errorbar").data(o.identity);h.enter().append("g").classed("errorbar",!0),h.each(function(t){var e=i.select(this),o=n(t,r,l);if(!f||t.vis){var s;if(u.visible&&a(o.x)&&a(o.yh)&&a(o.ys)){var h=u.width;s="M"+(o.x-h)+","+o.yh+"h"+2*h+"m-"+h+",0V"+o.ys,o.noYS||(s+="m-"+h+",0h"+2*h),e.append("path").classed("yerror",!0).attr("d",s)}if(c.visible&&a(o.y)&&a(o.xh)&&a(o.xs)){var d=(c.copy_ystyle?u:c).width;s="M"+o.xh+","+(o.y-d)+"v"+2*d+"m0,-"+d+"H"+o.xs,o.noXS||(s+="m0,-"+d+"v"+2*d),e.append("path").classed("xerror",!0).attr("d",s)}}})}})}},{"../../lib":381,"../../traces/scatter/subtypes":573,d3:113,"fast-isnumeric":117}],333:[function(t,e,r){"use strict";var n=t("d3"),i=t("../color");e.exports=function(t){t.each(function(t){var e=t[0].trace,r=e.error_y||{},a=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(i.stroke,r.color),a.copy_ystyle&&(a=r),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(i.stroke,a.color)})}},{"../color":303,d3:113}],334:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/constants");e.exports={_isLinkedToArray:!0,source:{valType:"string"},layer:{valType:"enumerated",values:["below","above"],dflt:"above"},sizex:{valType:"number",dflt:0},sizey:{valType:"number",dflt:0},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain"},opacity:{valType:"number",min:0,max:1,dflt:1},x:{valType:"number",dflt:0},y:{valType:"number",dflt:0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top"},xref:{valType:"enumerated",values:["paper",n.idRegex.x.toString()],dflt:"paper"},yref:{valType:"enumerated",values:["paper",n.idRegex.y.toString()],dflt:"paper"}}},{"../../plots/cartesian/constants":408}],335:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return a.coerce(t,e,o,r,n)}e=e||{},n("source"),n("layer"),n("x"),n("y"),n("xanchor"),n("yanchor"),n("sizex"),n("sizey"),n("sizing"),n("opacity");for(var s=0;2>s;s++){var l={_fullLayout:r},c=["x","y"][s];i.coerceRef(t,e,l,c,"paper")}return e}var i=t("../../plots/cartesian/axes"),a=t("../../lib"),o=t("./attributes");e.exports=function(t,e){if(t.images&&Array.isArray(t.images))for(var r=t.images,i=e.images=[],a=0;a=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}},{}],339:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat;e.exports={bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.defaultLine},borderwidth:{valType:"number",min:0,dflt:0},font:a({},n,{}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"]},tracegroupgap:{valType:"number",min:0,dflt:10},x:{valType:"number",min:-2,max:3,dflt:1.02},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"}}},{"../../lib/extend":376,"../../plots/font_attributes":421,"../color/attributes":302}],340:[function(t,e,r){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],341:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/plots"),a=t("./attributes"),o=t("./helpers");e.exports=function(t,e,r){function s(t,e){return n.coerce(h,d,a,t,e)}for(var l,c,u,f,h=t.legend||{},d=e.legend={},p=0,g="normal",v=0;v1);if(y!==!1){if(s("bgcolor",e.paper_bgcolor),s("bordercolor"),s("borderwidth"),n.coerceFont(s,"font",e.font),s("orientation"),"h"===d.orientation){var b=t.xaxis;b&&b.rangeslider&&b.rangeslider.visible?(l=0,u="left",c=1.1,f="bottom"):(l=0,u="left",c=-.1,f="top")}s("traceorder",g),o.isGrouped(e.legend)&&s("tracegroupgap"),s("x",l),s("xanchor",u),s("y",c),s("yanchor",f),n.noneOrAll(h,d,["x","y"])}}},{"../../lib":381,"../../plots/plots":452,"./attributes":339,"./helpers":344}],342:[function(t,e,r){"use strict";function n(t,e){function r(r){u.util.convertToTspans(r,function(){r.selectAll("tspan.line").attr({x:r.attr("x")}),t.call(a,e)})}var n=t.data()[0][0],i=e._fullLayout,o=n.trace,s=h.traceIs(o,"pie"),l=o.index,c=s?n.label:o.name,f=t.selectAll("text.legendtext").data([0]);f.enter().append("text").classed("legendtext",!0),f.attr({x:40,y:0,"data-unformatted":c}).style("text-anchor","start").classed("user-select-none",!0).call(p.font,i.legend.font).text(c),e._context.editable&&!s?f.call(u.util.makeEditable).call(r).on("edit",function(t){this.attr({"data-unformatted":t}),this.text(t).call(r),this.text()||(t=" "),u.restyle(e,"name",t,l)}):f.call(r)}function i(t,e){var r=e._fullLayout.hiddenlabels?e._fullLayout.hiddenlabels.slice():[],n=t.selectAll("rect").data([0]);n.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(g.fill,"rgba(0,0,0,0)"),n.on("click",function(){if(!e._dragged){var n,i,a=t.data()[0][0],o=e._fullData,s=a.trace,l=s.legendgroup,c=[];if(h.traceIs(s,"pie")){var f=a.label,d=r.indexOf(f);-1===d?r.push(f):r.splice(d,1),u.relayout(e,"hiddenlabels",r)}else{if(""===l)c=[s.index];else for(var p=0;ptspan"),d=h[0].length||1;r=l*d,n=u.node()&&p.bBox(u.node()).width;var g=l*(.3+(1-d)/2);u.attr("y",g),h.attr("y",g)}r=Math.max(r,16)+3,a.attr({x:0,y:-r/2,height:r}),i.height=r,i.width=n}function o(t,e,r){var n=t._fullLayout,i=n.legend,a=i.borderwidth,o=b.isGrouped(i);if(b.isVertical(i))o&&e.each(function(t,e){f.setTranslate(this,0,e*i.tracegroupgap)}),i.width=0,i.height=0,r.each(function(t){var e=t[0],r=e.height,n=e.width;f.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),r.selectAll(".legendtoggle").attr("width",(t._context.editable?0:i.width)+40),i.width=Math.ceil(i.width),i.height=Math.ceil(i.height);else if(o){i.width=0,i.height=0;for(var s=[i.width],l=e.data(),u=0,h=l.length;h>u;u++){var d=l[u].map(function(t){return t[0].width}),p=40+Math.max.apply(null,d);i.width+=i.tracegroupgap+p,s.push(i.width)}e.each(function(t,e){f.setTranslate(this,s[e],0)}),e.each(function(){var t=c.select(this),e=t.selectAll("g.traces"),r=0;e.each(function(t){var e=t[0],n=e.height;f.setTranslate(this,0,5+a+r+n/2),r+=n}),i.height=Math.max(i.height,r)}),i.height+=10+2*a,i.width+=2*a,i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),r.selectAll(".legendtoggle").attr("width",t._context.editable?0:i.width)}else i.width=0,i.height=0,r.each(function(t){var e=t[0],r=40+e.width,n=i.tracegroupgap||5;f.setTranslate(this,a+i.width,5+a+e.height/2),i.width+=n+r,i.height=Math.max(i.height,e.height)}),i.width+=2*a,i.height+=10+2*a,i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),r.selectAll(".legendtoggle").attr("width",t._context.editable?0:i.width)}function s(t){var e=t._fullLayout,r=e.legend,n="left";x.isRightAnchor(r)?n="right":x.isCenterAnchor(r)&&(n="center");var i="top";x.isBottomAnchor(r)?i="bottom":x.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";x.isRightAnchor(r)?n="right":x.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 c=t("d3"),u=t("../../plotly"),f=t("../../lib"),h=t("../../plots/plots"),d=t("../dragelement"),p=t("../drawing"),g=t("../color"),v=t("./constants"),m=t("./get_legend_data"),y=t("./style"),b=t("./helpers"),x=t("./anchor_utils");e.exports=function(t){function e(t,e){T.attr("data-scroll",e).call(f.setTranslate,0,e),E.call(p.setRect,j,t,v.scrollBarWidth,v.scrollBarHeight),A.select("rect").attr({y:b.borderwidth-e})}var r=t._fullLayout,a="legend"+r._uid;if(r._infolayer&&t.calcdata){var b=r.legend,_=r.showlegend&&m(t.calcdata,b),w=r.hiddenlabels||[];if(!r.showlegend||!_.length)return r._infolayer.selectAll(".legend").remove(),r._topdefs.select("#"+a).remove(),void h.autoMargin(t,"legend");"undefined"==typeof t.firstRender?t.firstRender=!0:t.firstRender&&(t.firstRender=!1);var k=r._infolayer.selectAll("g.legend").data([0]);k.enter().append("g").attr({"class":"legend","pointer-events":"all"});var A=r._topdefs.selectAll("#"+a).data([0]);A.enter().append("clipPath").attr("id",a).append("rect");var M=k.selectAll("rect.bg").data([0]);M.enter().append("rect").attr({"class":"bg","shape-rendering":"crispEdges"}).call(g.stroke,b.bordercolor).call(g.fill,b.bgcolor).style("stroke-width",b.borderwidth+"px");var T=k.selectAll("g.scrollbox").data([0]);T.enter().append("g").attr("class","scrollbox");var E=k.selectAll("rect.scrollbar").data([0]);E.enter().append("rect").attr({"class":"scrollbar",rx:20,ry:2,width:0,height:0}).call(g.fill,"#808BA4");var L=T.selectAll("g.groups").data(_);L.enter().append("g").attr("class","groups"),L.exit().remove();var S=L.selectAll("g.traces").data(f.identity);S.enter().append("g").attr("class","traces"),S.exit().remove(),S.call(y).style("opacity",function(t){var e=t[0].trace;return h.traceIs(e,"pie")?-1!==w.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){c.select(this).call(n,t).call(i,t)}),t.firstRender&&(o(t,L,S),s(t));var C=0,z=r.width,P=0,R=r.height;o(t,L,S),b.height>R?l(t):s(t);var O=r._size,I=O.l+O.w*b.x,N=O.t+O.h*(1-b.y);x.isRightAnchor(b)?I-=b.width:x.isCenterAnchor(b)&&(I-=b.width/2),x.isBottomAnchor(b)?N-=b.height:x.isMiddleAnchor(b)&&(N-=b.height/2);var j=b.width,F=O.w;j>F?(I=O.l,j=F):(I+j>z&&(I=z-j),C>I&&(I=C),j=Math.min(z-I,b.width));var D=b.height,B=O.h;D>B?(N=O.t,D=B):(N+D>R&&(N=R-D),P>N&&(N=P),D=Math.min(R-N,b.height)),f.setTranslate(k,I,N),M.attr({width:j-b.borderwidth,height:D-b.borderwidth,x:b.borderwidth/2,y:b.borderwidth/2});var U=T.attr("data-scroll")||0;if(f.setTranslate(T,0,U),A.select("rect").attr({width:j-2*b.borderwidth,height:D-2*b.borderwidth,x:b.borderwidth-U,y:b.borderwidth}),T.call(p.setClipUrl,a),b.height-D>0&&!t._context.staticPlot){M.attr({width:j-2*b.borderwidth+v.scrollBarWidth+v.scrollBarMargin}),A.select("rect").attr({width:j-2*b.borderwidth+v.scrollBarWidth+v.scrollBarMargin}),t.firstRender&&e(v.scrollBarMargin,0);var V=D-v.scrollBarHeight-2*v.scrollBarMargin,q=b.height-D,H=v.scrollBarMargin,G=0;e(H,G),k.on("wheel",null),k.on("wheel",function(){G=f.constrain(T.attr("data-scroll")-c.event.deltaY/V*q,-q,0),H=v.scrollBarMargin-G/q*V,e(H,G),c.event.preventDefault()}),E.on(".drag",null),T.on(".drag",null);var Y=c.behavior.drag().on("drag",function(){H=f.constrain(c.event.y-v.scrollBarHeight/2,v.scrollBarMargin,v.scrollBarMargin+V),G=-(H-v.scrollBarMargin)/V*q,e(H,G)});E.call(Y),T.call(Y)}if(t._context.editable){var X,W,Z,K;k.classed("cursor-move",!0),d.init({element:k.node(),prepFn:function(){var t=f.getTranslate(k);Z=t.x,K=t.y},moveFn:function(t,e){var r=Z+t,n=K+e;f.setTranslate(k,r,n),X=d.align(r,0,O.l,O.l+O.w,b.xanchor),W=d.align(n,0,O.t+O.h,O.t,b.yanchor)},doneFn:function(e){e&&void 0!==X&&void 0!==W&&u.relayout(t,{"legend.x":X,"legend.y":W})}})}}}},{"../../lib":381,"../../plotly":400,"../../plots/plots":452,"../color":303,"../dragelement":323,"../drawing":325,"./anchor_utils":338,"./constants":340,"./get_legend_data":343,"./helpers":344,"./style":346,d3:113}],343:[function(t,e,r){"use strict";var n=t("../../plots/plots"),i=t("./helpers");e.exports=function(t,e){function r(t,r){if(""!==t&&i.isGrouped(e))-1===l.indexOf(t)?(l.push(t),c=!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=[],c=!1,u={},f=0;for(a=0;aa;a++)m=s[l[a]],y[a]=i.isReversed(e)?m.reverse():m;else{for(y=[new Array(b)],a=0;b>a;a++)m=s[l[a]][0],y[0][i.isReversed(e)?b-a-1:a]=m;b=1}return e._lgroupsLength=b,y}},{"../../plots/plots":452,"./helpers":344}],344:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.legendGetsTrace=function(t){return t.visible&&n.traceIs(t,"showLegend")},r.isGrouped=function(t){return-1!==(t.traceorder||"").indexOf("grouped")},r.isVertical=function(t){return"h"!==t.orientation},r.isReversed=function(t){return-1!==(t.traceorder||"").indexOf("reversed")}},{"../../plots/plots":452}],345:[function(t,e,r){"use strict";var n=e.exports={};n.layoutAttributes=t("./attributes"),n.supplyLayoutDefaults=t("./defaults"),n.draw=t("./draw"),n.style=t("./style")},{"./attributes":339,"./defaults":341,"./draw":342,"./style":346}],346:[function(t,e,r){"use strict";function n(t){var e=t[0].trace,r=e.visible&&e.fill&&"none"!==e.fill,n=d.hasLines(e),i=l.select(this).select(".legendfill").selectAll("path").data(r?[t]:[]);i.enter().append("path").classed("js-fill",!0),i.exit().remove(),i.attr("d","M5,0h30v6h-30z").call(f.fillGroupStyle);var a=l.select(this).select(".legendlines").selectAll("path").data(n?[t]:[]);a.enter().append("path").classed("js-line",!0).attr("d","M5,0h30"),a.exit().remove(),a.call(f.lineGroupStyle)}function i(t){function e(t,e,r){var n=c.nestedProperty(o,t).get(),i=Array.isArray(n)&&e?e(n):n;if(r){if(ir[1])return r[1]}return i}function r(t){return t[0]}var n,i,a=t[0],o=a.trace,s=d.hasMarkers(o),u=d.hasText(o),h=d.hasLines(o);if(s||u||h){var p={},g={};s&&(p.mc=e("marker.color",r),p.mo=e("marker.opacity",c.mean,[.2,1]),p.ms=e("marker.size",c.mean,[2,16]),p.mlc=e("marker.line.color",r),p.mlw=e("marker.line.width",c.mean,[0,5]),g.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),h&&(g.line={width:e("line.width",r,[0,10])}),u&&(p.tx="Aa",p.tp=e("textposition",r),p.ts=10,p.tc=e("textfont.color",r),p.tf=e("textfont.family",r)),n=[c.minExtend(a,p)],i=c.minExtend(o,g)}var v=l.select(this).select("g.legendpoints"),m=v.selectAll("path.scatterpts").data(s?n:[]);m.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),m.exit().remove(),m.call(f.pointStyle,i),s&&(n[0].mrc=3);var y=v.selectAll("g.pointtext").data(u?n:[]);y.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),y.exit().remove(),y.selectAll("text").call(f.textPointStyle,i)}function a(t){var e=t[0].trace,r=e.marker||{},n=r.line||{},i=l.select(this).select("g.legendpoints").selectAll("path.legendbar").data(u.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=(t.mlw+1||n.width+1)-1,i=l.select(this);i.style("stroke-width",e+"px").call(h.fill,t.mc||r.color),e&&i.call(h.stroke,t.mlc||n.color)})}function o(t){var e=t[0].trace,r=l.select(this).select("g.legendpoints").selectAll("path.legendbox").data(u.traceIs(e,"box")&&e.visible?[t]:[]);r.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.each(function(t){var r=(t.lw+1||e.line.width+1)-1,n=l.select(this);n.style("stroke-width",r+"px").call(h.fill,t.fc||e.fillcolor),r&&n.call(h.stroke,t.lc||e.line.color)})}function s(t){var e=t[0].trace,r=l.select(this).select("g.legendpoints").selectAll("path.legendpie").data(u.traceIs(e,"pie")&&e.visible?[t]:[]);r.enter().append("path").classed("legendpie",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.size()&&r.call(p,t[0],e)}var l=t("d3"),c=t("../../lib"),u=t("../../plots/plots"),f=t("../drawing"),h=t("../color"),d=t("../../traces/scatter/subtypes"),p=t("../../traces/pie/style_one");e.exports=function(t){t.each(function(t){var e=l.select(this),r=e.selectAll("g.legendfill").data([t]);r.enter().append("g").classed("legendfill",!0);var n=e.selectAll("g.legendlines").data([t]);n.enter().append("g").classed("legendlines",!0);var i=e.selectAll("g.legendsymbols").data([t]);i.enter().append("g").classed("legendsymbols",!0),i.style("opacity",t[0].trace.opacity),i.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(a).each(o).each(s).each(n).each(i)}},{"../../lib":381,"../../plots/plots":452,"../../traces/pie/style_one":552,"../../traces/scatter/subtypes":573,"../color":303,"../drawing":325,d3:113}],347:[function(t,e,r){"use strict";function n(t,e){var r=e.currentTarget,n=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,a=t._fullLayout,o={};if("zoom"===n){for(var s,l,u="in"===i?.5:2,h=(1+u)/2,d=(1-u)/2,p=c.Axes.list(t,null,!0),v=0;vy;y++){var b=s[y];h=m[b]={};for(var x=0;x1)return n(["resetViews","toggleHover"]),o(v,r);u&&(n(["zoom3d","pan3d","orbitRotation","tableRotation"]),n(["resetCameraDefault3d","resetCameraLastSave3d"]),n(["hoverClosest3d"])),h&&(n(["zoomInGeo","zoomOutGeo","resetGeo"]),n(["hoverClosestGeo"]));var m=i(s),y=[];return((c||p)&&!m||g)&&(y=["zoom2d","pan2d"]),(c||g)&&a(l)&&(y.push("select2d"),y.push("lasso2d")),y.length&&n(y),!c&&!p||m||g||n(["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"]),c&&d?n(["toggleHover"]):p?n(["hoverClosestGl2d"]):c?n(["hoverClosestCartesian","hoverCompareCartesian"]):d&&n(["hoverClosestPie"]),o(v,r)}function i(t){for(var e=l.Axes.list({_fullLayout:t},null,!0),r=!0,n=0;n0);if(h){var d=i(e,r,s);l("x",d[0]),l("y",d[1]),a.noneOrAll(t,e,["x","y"]),l("xanchor"),l("yanchor"),a.coerceFont(l,"font",r.font),l("bgcolor"),l("bordercolor"),l("borderwidth")}}},{"../../lib":381,"./attributes":350,"./button_attributes":351,"./constants":352}],354:[function(t,e,r){"use strict";function n(t){for(var e=m.list(t,"x",!0),r=[],n=0;ne){var r=e;e=t,t=r}s.setAttributes(w,{"data-min":t,"data-max":e}),s.setAttributes(R,{x:t,width:e-t}),s.setAttributes(M,{width:t}),s.setAttributes(T,{x:e,width:p-e}),s.setAttributes(E,{transform:"translate("+(t-v-1)+")"}),s.setAttributes(C,{transform:"translate("+e+")"})}var f=t._fullLayout,h=f._infolayer.selectAll("g.range-slider"),d=f.xaxis.rangeslider,p=f._size.w,g=(f.height-f.margin.b-f.margin.t)*d.thickness,v=2,m=Math.floor(d.borderwidth/2),y=f.margin.l,b=f.height-g-f.margin.b,x=0,_=p,w=document.createElementNS(o,"g");s.setAttributes(w,{"class":"range-slider","data-min":x,"data-max":_,"pointer-events":"all",transform:"translate("+y+","+b+")"});var k=document.createElementNS(o,"rect"),A=d.borderwidth%2===0?d.borderwidth:d.borderwidth-1;s.setAttributes(k,{fill:d.bgcolor,stroke:d.bordercolor,"stroke-width":d.borderwidth,height:g+A,width:p+A,transform:"translate(-"+m+", -"+m+")","shape-rendering":"crispEdges"});var M=document.createElementNS(o,"rect");s.setAttributes(M,{x:0,width:x,height:g,fill:"rgba(0,0,0,0.4)"});var T=document.createElementNS(o,"rect");s.setAttributes(T,{x:_,width:p-_,height:g,fill:"rgba(0,0,0,0.4)"});var E=document.createElementNS(o,"g"),L=document.createElementNS(o,"rect"),S=document.createElementNS(o,"rect");s.setAttributes(E,{transform:"translate("+(x-v-1)+")"}),s.setAttributes(L,{width:10,height:g,x:-6,fill:"transparent",cursor:"col-resize"}),s.setAttributes(S,{width:v,height:g/2,y:g/4,rx:1,fill:"white",stroke:"#666","shape-rendering":"crispEdges"}),s.appendChildren(E,[S,L]);var C=document.createElementNS(o,"g"),z=document.createElementNS(o,"rect"),P=document.createElementNS(o,"rect");s.setAttributes(C,{transform:"translate("+_+")"}),s.setAttributes(z,{width:10,height:g,x:-2,fill:"transparent",cursor:"col-resize"}),s.setAttributes(P,{width:v,height:g/2,y:g/4,rx:1,fill:"white",stroke:"#666","shape-rendering":"crispEdges"}),s.appendChildren(C,[P,z]);var R=document.createElementNS(o,"rect");s.setAttributes(R,{x:x,width:_-x,height:g,cursor:"ew-resize",fill:"transparent"}),w.addEventListener("mousedown",function(t){function r(t){var r,n,f=+t.clientX-a;switch(i){case R:w.style.cursor="ew-resize",r=+s+f,n=+l+f,u(r,n),c(e(r),e(n));break;case L:w.style.cursor="col-resize",r=+s+f,n=+l,u(r,n),c(e(r),e(n));break;case z:w.style.cursor="col-resize",r=+s,n=+l+f,u(r,n),c(e(r),e(n));break;default:w.style.cursor="ew-resize",r=o,n=o+f,u(r,n),c(e(r),e(n))}}function n(){window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",n),w.style.cursor="auto"}var i=t.target,a=t.clientX,o=a-w.getBoundingClientRect().left,s=w.getAttribute("data-min"),l=w.getAttribute("data-max");window.addEventListener("mousemove",r),window.addEventListener("mouseup",n)}),d.range||(d.range=i.getAutoRange(f.xaxis));var O=l(t,p,g);s.appendChildren(w,[k,O,M,T,R,E,C]),r(f.xaxis.range[0],f.xaxis.range[1]),h.data([0]).enter().append(function(){return d.setRange=r,w})}},{"../../constants/xmlns_namespaces":369,"../../lib":381,"../../plotly":400,"../../plots/cartesian/axes":403,"./helpers":360,"./range_plot":362}],359:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r,a){function o(t,e){return n.coerce(s,l,i,t,e)}if(t[r].rangeslider){var s="object"==typeof t[r].rangeslider?t[r].rangeslider:{},l=e[r].rangeslider={};if(o("bgcolor"),o("bordercolor"),o("borderwidth"),o("thickness"),o("visible"),o("range"),l.range&&!e[r].autorange){var c=l.range,u=e[r].range;c[0]=Math.min(c[0],u[0]),c[1]=Math.max(c[1],u[1])}else e[r]._needsExpand=!0;l.visible&&a.forEach(function(t){var r=e[t]||{};r.fixedrange=!0,e[t]=r})}}},{"../../lib":381,"./attributes":357}],360:[function(t,e,r){"use strict";r.setAttributes=function(t,e){for(var r in e)t.setAttribute(r,e[r])},r.appendChildren=function(t,e){for(var r=0;rl;l++){var c=s[l],u={_fullLayout:e},f=x.coerceRef(t,n,u,c);if("path"!==o){var h=.25,d=.75;if("paper"!==f){var p=x.getFromId(u,f),g=a(p);h=g(p.range[0]+h*(p.range[1]-p.range[0])),d=g(p.range[0]+d*(p.range[1]-p.range[0]))}r(c+"0",h),r(c+"1",d)}}return"path"===o?r("path"):b.noneOrAll(t,n,["x0","x1","y0","y1"]),n}function i(t){return"category"===t.type?t.c2l:t.d2l}function a(t){return"category"===t.type?t.l2c:t.l2d}function o(t,e){t.layout.shapes=e,k.supplyLayoutDefaults(t.layout,t._fullLayout),k.drawAll(t)}function s(t){delete t.layout.shapes,t._fullLayout.shapes=[],k.drawAll(t)}function l(t,e,r){for(var n=0;ne;i--)h(t,i).selectAll('[data-index="'+(i-1)+'"]').attr("data-index",i),k.draw(t,i)}function f(t,e,r,o){function s(e){var r=e.append("path").attr(z).style("opacity",S.opacity).call(_.stroke,P).call(_.fill,S.fillcolor).call(w.dashLine,S.line.dash,S.line.width);C&&r.call(w.setClipUrl,"clip"+t._fullLayout._uid+C)}var l,c;h(t,e).selectAll('[data-index="'+e+'"]').remove();var u=t.layout.shapes[e];if(u){var f={xref:u.xref,yref:u.yref},p={};"string"==typeof r&&r?p[r]=o:b.isPlainObject(r)&&(p=r);var v=Object.keys(p);for(l=0;ll;l++){var k=y[l];if(void 0===p[k]&&void 0!==u[k]){var A,M=k.charAt(0),T=x.getFromId(t,x.coerceRef(f,{},t,M)),E=x.getFromId(t,x.coerceRef(u,{},t,M)),L=u[k];void 0!==p[M+"ref"]&&(T?(A=i(T)(L),L=(A-T.range[0])/(T.range[1]-T.range[0])):L=(L-E.domain[0])/(E.domain[1]-E.domain[0]),E?(A=E.range[0]+L*(E.range[1]-E.range[0]),L=a(E)(A)):L=T.domain[0]+L*(T.domain[1]-T.domain[0])),u[k]=L}}var S=n(u,t._fullLayout);t._fullLayout.shapes[e]=S;var C,z={"data-index":e,"fill-rule":"evenodd",d:g(t,S)},P=S.line.width?S.line.color:"rgba(0,0,0,0)";if("below"!==S.layer)C=(S.xref+S.yref).replace(/paper/g,""),s(t._fullLayout._shapeUpperLayer);else if("paper"===S.xref&&"paper"===S.yref)C="",s(t._fullLayout._shapeLowerLayer);else{var R,O=t._fullLayout._plots||{},I=Object.keys(O);for(l=0,c=I.length;c>l;l++)R=O[I[l]],C=I[l],d(t,S,R.id)&&s(R.shapelayer)}}}function h(t,e){var r=t._fullLayout.shapes[e],n=t._fullLayout._shapeUpperLayer;return r?"below"===r.layer&&(n="paper"===r.xref&&"paper"===r.yref?t._fullLayout._shapeLowerLayer:t._fullLayout._shapeSubplotLayer):console.log("getShapeLayer: undefined shape: index",e),n}function d(t,e,r){var n=y.Axes.getFromId(t,r,"x")._id,i=y.Axes.getFromId(t,r,"y")._id;return"below"===e.layer&&(n===e.xref||i===e.yref)}function p(t){return function(e){return t(e.replace("_"," "))}}function g(t,e){var r,n,a,o,s=e.type,l=x.getFromId(t,e.xref),c=x.getFromId(t,e.yref),u=t._fullLayout._size;if(l?(r=i(l),n=function(t){return l._offset+l.l2p(r(t,!0))}):n=function(t){return u.l+u.w*t},c?(a=i(c),o=function(t){return c._offset+c.l2p(a(t,!0))}):o=function(t){return u.t+u.h*(1-t)},"path"===s)return l&&"date"===l.type&&(n=p(n)),c&&"date"===c.type&&(o=p(o)),k.convertPath(e.path,n,o);var f=n(e.x0),h=n(e.x1),d=o(e.y0),g=o(e.y1);if("line"===s)return"M"+f+","+d+"L"+h+","+g;if("rect"===s)return"M"+f+","+d+"H"+h+"V"+g+"H"+f+"Z";var v=(f+h)/2,m=(d+g)/2,y=Math.abs(v-f),b=Math.abs(m-d),_="A"+y+","+b,w=v+y+","+m,A=v+","+(m-b);return"M"+w+_+" 0 1,1 "+A+_+" 0 0,1 "+w+"Z"}function v(t,e,r,n,i){var a="category"===t.type?Number:t.d2c;if(void 0!==e)return[a(e),a(r)];if(n){var o,s,l,c,u,f=1/0,h=-(1/0),d=n.match(A);for("date"===t.type&&(a=p(a)),o=0;ou&&(f=u),u>h&&(h=u)));return h>=f?[f,h]:void 0}}var m=t("fast-isnumeric"),y=t("../../plotly"),b=t("../../lib"),x=t("../../plots/cartesian/axes"),_=t("../color"),w=t("../drawing"),k=e.exports={};k.layoutAttributes=t("./attributes"),k.supplyLayoutDefaults=function(t,e){for(var r=t.shapes||[],i=e.shapes=[],a=0;as&&(t="X"),t});return n>s&&(l=l.replace(/[\s,]*X.*/,""),console.log("ignoring extra params in segment "+t)),i+l})},k.calcAutorange=function(t){var e,r,n,i,a,o=t._fullLayout,s=o.shapes;if(s.length&&t._fullData.length)for(e=0;eh?r=h:(u.left-=b.offsetLeft,u.right-=b.offsetLeft,u.top-=b.offsetTop,u.bottom-=b.offsetTop,b.selection.each(function(){var t=l.bBox(this);s.bBoxIntersect(u,t,c)&&(r=Math.max(r,o*(t[b.side]-u[a])+c))}),r=Math.min(h,r)),r>0||0>h){var d={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[b.side];e.attr("transform","translate("+d+")")}}}function p(){E=0,L=!0,S=z,k._infolayer.select("."+e).attr({"data-unformatted":S}).text(S).on("mouseover.opacity",function(){n.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(1e3).style("opacity",0)})}var g=r.propContainer,v=r.propName,m=r.traceIndex,y=r.dfltName,b=r.avoid||{},x=r.attributes,_=r.transform,w=r.containerGroup,k=t._fullLayout,A=g.titlefont.family,M=g.titlefont.size,T=g.titlefont.color,E=1,L=!1,S=g.title.trim();""===S&&(E=0),S.match(/Click to enter .+ title/)&&(E=.2,L=!0),w||(w=k._infolayer.selectAll(".g-"+e).data([0]),w.enter().append("g").classed("g-"+e,!0));var C=w.selectAll("text").data([0]);C.enter().append("text"),C.text(S).attr("class",e),C.attr({"data-unformatted":S}).call(f);var z="Click to enter "+y+" title";t._context.editable?(S||p(),C.call(u.makeEditable).on("edit",function(e){void 0!==m?a.restyle(t,v,e,m):a.relayout(t,v,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(f)}).on("input",function(t){this.text(t||" ").attr(x).selectAll("tspan.line").attr(x)})):S&&!S.match(/Click to enter .+ title/)||C.remove(),C.classed("js-placeholder",L)}},{"../../lib":381,"../../lib/svg_text_utils":393,"../../plotly":400,"../../plots/plots":452,"../color":303,"../drawing":325,d3:113,"fast-isnumeric":117}],366:[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]}},{}],367:[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]}},{}],368:[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"}},{}],369:[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}},{}],370:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.12.0",r.plot=n.plot,r.newPlot=n.newPlot,r.restyle=n.restyle,r.relayout=n.relayout,r.redraw=n.redraw,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=n.register,r.toImage=t("./plot_api/to_image"),r.downloadImage=t("./snapshot/download"),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=n.Fx,r.Snapshot=n.Snapshot,r.PlotSchema=n.PlotSchema,r.Queue=n.Queue,r.d3=t("d3")},{"../build/ploticon":2,"./plot_api/set_plot_config":398,"./plot_api/to_image":399,"./plotly":400,"./snapshot/download":467,d3:113}],371:[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},{}],372:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){Array.isArray(t)&&(e[r]=t[n])}},{}],373:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("./nested_property"),o=t("../components/colorscale/get_scale"),s=(Object.keys(t("../components/colorscale/scales")),/^([2-9]|[1-9][0-9]+)$/);r.valObjects={data_array:{coerceFunction:function(t,e,r){Array.isArray(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),-1===n.values.indexOf(t)?e.set(r):e.set(t)}},"boolean":{coerceFunction:function(t,e,r){t===!0||t===!1?e.set(t):e.set(r)}},number:{coerceFunction:function(t,e,r,i){!n(t)||void 0!==i.min&&ti.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(n.strict===!0&&"string"!=typeof t)return void e.set(r);var i=String(t);void 0===t||n.noBlank===!0&&!i?e.set(r):e.set(i)}},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){var n=r.length;return"string"==typeof t&&t.substr(0,n)===r&&s.test(t.substr(n))?void e.set(t):void e.set(r)}},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;a2)return!1;var l=o[0].split("-");if(l.length>3||3!==l.length&&o[1])return!1;if(4===l[0].length)r=Number(l[0]);else{if(2!==l[0].length)return!1;var c=(new Date).getFullYear();r=((Number(l[0])-c+70)%100+200)%100+c-70}return s(r)?1===l.length?new Date(r,0,1).getTime():(n=Number(l[1])-1,l[1].length>2||!(n>=0&&11>=n)?!1:2===l.length?new Date(r,n,1).getTime():(i=Number(l[2]),l[2].length>2||!(i>=1&&31>=i)?!1:(i=new Date(r,n,i).getTime(),o[1]?(l=o[1].split(":"),l.length>3?!1:(a=Number(l[0]),l[0].length>2||!(a>=0&&23>=a)?!1:(i+=36e5*a,1===l.length?i:(n=Number(l[1]),l[1].length>2||!(n>=0&&59>=n)?!1:(i+=6e4*n,2===l.length?i:(t=Number(l[2]),t>=0&&60>t?i+1e3*t:!1)))))):i))):!1},r.isDateTime=function(t){return r.dateTime2ms(t)!==!1},r.ms2DateTime=function(t,e){if("undefined"==typeof o)return void console.log("d3 is not defined");e||(e=0);var r=new Date(t),i=o.time.format("%Y-%m-%d")(r);return 7776e6>e?(i+=" "+n(r.getHours(),2),432e6>e&&(i+=":"+n(r.getMinutes(),2),108e5>e&&(i+=":"+n(r.getSeconds(),2),3e5>e&&(i+="."+n(r.getMilliseconds(),3)))),i.replace(/([:\s]00)*\.?[0]*$/,"")):i};var l={H:["%H:%M:%S~%L","%H:%M:%S","%H:%M"],I:["%I:%M:%S~%L%p","%I:%M:%S%p","%I:%M%p"],D:["%H","%I%p","%Hh"]},c={Y:["%Y~%m~%d","%Y%m%d","%y%m%d","%m~%d~%Y","%d~%m~%Y"],Yb:["%b~%d~%Y","%d~%b~%Y","%Y~%d~%b","%Y~%b~%d"],y:["%m~%d~%y","%d~%m~%y","%y~%m~%d"],yb:["%b~%d~%y","%d~%b~%y","%y~%d~%b","%y~%b~%d"]},u=o.time.format.utc,f={Y:{H:["%Y~%m~%dT%H:%M:%S","%Y~%m~%dT%H:%M:%S~%L"].map(u),I:[],D:["%Y%m%d%H%M%S","%Y~%m","%m~%Y"].map(u)},Yb:{H:[],I:[],D:["%Y~%b","%b~%Y"].map(u)},y:{H:[],I:[],D:[]},yb:{H:[],I:[],D:[]}};["Y","Yb","y","yb"].forEach(function(t){c[t].forEach(function(e){f[t].D.push(u(e)),["H","I","D"].forEach(function(r){l[r].forEach(function(n){var i=f[t][r];i.push(u(e+"~"+n)),i.push(u(n+"~"+e))})})})});var h=/[a-z]*/g,d=function(t){return t.substr(0,3)},p=/(mon|tue|wed|thu|fri|sat|sun|the|of|st|nd|rd|th)/g,g=/[\s,\/\-\.\(\)]+/g,v=/~?([ap])~?m(~|$)/,m=function(t,e){return e+"m "},y=/\d\d\d\d/,b=/(^|~)[a-z]{3}/,x=/[ap]m/,_=/:/,w=/q([1-4])/,k=["31~mar","30~jun","30~sep","31~dec"],A=function(t,e){return k[e-1]},M=/ ?([+\-]\d\d:?\d\d|Z)$/;r.parseDate=function(t){if(t.getTime)return t;if("string"!=typeof t)return!1;t=t.toLowerCase().replace(h,d).replace(p,"").replace(g,"~").replace(v,m).replace(w,A).trim().replace(M,"");var e,r,n=null,o=i(t),s=a(t);e=f[o][s],r=e.length;for(var l=0;r>l&&!(n=e[l].parse(t));l++);if(!(n instanceof Date))return!1;var c=n.getTimezoneOffset();return n.setTime(n.getTime()+60*c*1e3),n}},{d3:113,"fast-isnumeric":117}],375:[function(t,e,r){"use strict";var n=t("events").EventEmitter,i={init:function(t){if(t._ev instanceof n)return t;var e=new n;return t._ev=e,t.on=e.on.bind(e),t.once=e.once.bind(e),t.removeListener=e.removeListener.bind(e),t.removeAllListeners=e.removeAllListeners.bind(e),t.emit=function(r,n){"undefined"!=typeof jQuery&&jQuery(t).trigger(r,n),e.emit(r,n)},t},triggerHandler:function(t,e,r){var n,i;"undefined"!=typeof jQuery&&(n=jQuery(t).triggerHandler(e,r));var a=t._ev;if(!a)return n;var o=a._events[e];if(!o)return n;"function"==typeof o&&(o=[o]);for(var s=o.pop(),l=0;lp;p++){o=t[p];for(s in o)l=h[s],c=o[s],e&&c&&(i(c)||(u=a(c)))?(u?(u=!1,f=l&&a(l)?l:[]):f=l&&i(l)?l:{},h[s]=n([f,c],e,r)):("undefined"!=typeof c||r)&&(h[s]=c)}return h}var i=t("./is_plain_object.js"),a=Array.isArray;r.extendFlat=function(){return n(arguments,!1,!1)},r.extendDeep=function(){return n(arguments,!0,!1)},r.extendDeepAll=function(){return n(arguments,!0,!0)}},{"./is_plain_object.js":382}],377:[function(t,e,r){"use strict";e.exports=function(t){for(var e=[],r=0;ry;y++)f=s(p,y),d=l(e,y),m[y]=n(f,d);else m=n(p,e);return m}var s=t("tinycolor2"),l=t("fast-isnumeric"),c=t("../components/colorscale/make_scale_function"),u=t("../components/color/attributes").defaultLine,f=t("./str2rgbarray"),h=1;e.exports=o},{"../components/color/attributes":302,"../components/colorscale/make_scale_function":319,"./str2rgbarray":392,"fast-isnumeric":117,tinycolor2:274}],380:[function(t,e,r){"use strict";function n(t){for(var e=0;(e=t.indexOf("",e))>=0;){var r=t.indexOf("",e);if(e>r)break;t=t.slice(0,e)+l(t.slice(e+5,r))+t.slice(r+6)}return t}function i(t){return t.replace(/\/g,"\n")}function a(t){return t.replace(/\<.*\>/g,"")}function o(t){for(var e=0;(e=t.indexOf("&",e))>=0;){var r=t.indexOf(";",e);if(e>r)e+=1;else{var n=c[t.slice(e+1,r)];t=n?t.slice(0,e)+n+t.slice(r+1):t.slice(0,e)+t.slice(r+1)}}return t}function s(t){return""+o(a(n(i(t))))}var l=t("superscript-text"),c={mu:"\u03bc",amp:"&",lt:"<",gt:">"};e.exports=s},{"superscript-text":263}],381:[function(t,e,r){"use strict";var n=t("d3"),i=e.exports={};i.nestedProperty=t("./nested_property"),i.isPlainObject=t("./is_plain_object");var a=t("./coerce");i.valObjects=a.valObjects,i.coerce=a.coerce,i.coerce2=a.coerce2,i.coerceFont=a.coerceFont;var o=t("./dates");i.dateTime2ms=o.dateTime2ms,i.isDateTime=o.isDateTime,i.ms2DateTime=o.ms2DateTime, +i.parseDate=o.parseDate;var s=t("./search");i.findBin=s.findBin,i.sorterAsc=s.sorterAsc,i.sorterDes=s.sorterDes,i.distinctVals=s.distinctVals,i.roundUp=s.roundUp;var l=t("./stats");i.aggNums=l.aggNums,i.len=l.len,i.mean=l.mean,i.variance=l.variance,i.stdev=l.stdev,i.interp=l.interp;var c=t("./matrix");i.init2dArray=c.init2dArray,i.transposeRagged=c.transposeRagged,i.dot=c.dot,i.translationMatrix=c.translationMatrix,i.rotationMatrix=c.rotationMatrix,i.rotationXYMatrix=c.rotationXYMatrix,i.apply2DTransform=c.apply2DTransform,i.apply2DTransform2=c.apply2DTransform2;var u=t("./extend");i.extendFlat=u.extendFlat,i.extendDeep=u.extendDeep,i.extendDeepAll=u.extendDeepAll,i.notifier=t("./notifier"),i.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))},i.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},i.identity=function(t){return t},i.randstr=function f(t,e,r){if(r||(r=16),void 0===e&&(e=24),0>=e)return"0";var n,i,a,o=Math.log(Math.pow(2,e))/Math.log(r),s="";for(n=2;o===1/0;n*=2)o=Math.log(Math.pow(2,e/n))/Math.log(r)*n;var l=o-Math.floor(o);for(n=0;n-1||c!==1/0&&c>=Math.pow(2,e)?f(t,e,r):s},i.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},i.smooth=function(t,e){if(e=Math.round(e)||0,2>e)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,c=new Array(l),u=new Array(o);for(r=0;l>r;r++)c[r]=(1-Math.cos(Math.PI*(r+1)/e))/(2*e);for(r=0;o>r;r++){for(a=0,n=0;l>n;n++)i=r+n+1-e,-o>i?i-=s*Math.round(i/s):i>=s&&(i-=s*Math.floor(i/s)),0>i?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*c[n];u[r]=a}return u},i.syncOrAsync=function(t,e,r){function n(){return i.markTime("async done "+o.name),i.syncOrAsync(t,e,r)}for(var a,o;t.length;){if(o=t.splice(0,1)[0],a=o(e),a&&a.then)return a.then(n).then(void 0,i.promiseError);i.markTime("sync done "+o.name)}return r&&r(e)},i.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},i.noneOrAll=function(t,e,r){if(t){var n,i,a=!1,o=!0;for(n=0;ni;i++)e[i][r]=t[i]},i.minExtend=function(t,e){var r={};"object"!=typeof e&&(e={});var n,a,o,s=3,l=Object.keys(t);for(n=0;n1?n+a[1]:"";if(i&&(a.length>1||o.length>4))for(;r.test(o);)o=o.replace(r,"$1"+i+"$2");return o+s}},{"./coerce":373,"./dates":374,"./extend":376,"./is_plain_object":382,"./matrix":383,"./nested_property":384,"./notifier":385,"./search":388,"./stats":391,d3:113}],382:[function(t,e,r){"use strict";e.exports=function(t){return"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t)===Object.prototype}},{}],383:[function(t,e,r){"use strict";r.init2dArray=function(t,e){for(var r=new Array(t),n=0;t>n;n++)r[n]=new Array(e);return r},r.transposeRagged=function(t){var e,r,n=0,i=t.length;for(e=0;i>e;e++)n=Math.max(n,t[e].length);var a=new Array(n);for(e=0;n>e;e++)for(a[e]=new Array(i),r=0;i>r;r++)a[e][r]=t[r][e];return a},r.dot=function(t,e){if(!t.length||!e.length||t.length!==e.length)return null;var n,i,a=t.length;if(t[0].length)for(n=new Array(a),i=0;a>i;i++)n[i]=r.dot(t[i],e);else if(e[0].length){var o=r.transposeRagged(e);for(n=new Array(o.length),i=0;ii;i++)n+=t[i]*e[i];return n},r.translationMatrix=function(t,e){return[[1,0,t],[0,1,e],[0,0,1]]},r.rotationMatrix=function(t){var e=t*Math.PI/180;return[[Math.cos(e),-Math.sin(e),0],[Math.sin(e),Math.cos(e),0],[0,0,1]]},r.rotationXYMatrix=function(t,e,n){return r.dot(r.dot(r.translationMatrix(e,n),r.rotationMatrix(t)),r.translationMatrix(-e,-n))},r.apply2DTransform=function(t){return function(){var e=arguments;3===e.length&&(e=e[0]);var n=1===arguments.length?e[0]:[e[0],e[1]];return r.dot(t,[n[0],n[1],1]).slice(0,2)}},r.apply2DTransform2=function(t){var e=r.apply2DTransform(t);return function(t){return e(t.slice(0,2)).concat(e(t.slice(2,4)))}}},{}],384:[function(t,e,r){"use strict";function n(t,e){return function(){var r,i,a,o,s,l=t;for(o=0;o=0;e--){if(n=t[e],o=!1,Array.isArray(n))for(r=n.length-1;r>=0;r--)c(n[r])?o?n[r]=void 0:n.pop():o=!0;else if("object"==typeof n&&null!==n)for(a=Object.keys(n),o=!1,r=a.length-1;r>=0;r--)c(n[a[r]])&&!i(n[a[r]],a[r])?delete n[a[r]]:o=!0;if(o)return}}function c(t){return void 0===t||null===t?!0:"object"!=typeof t?!1:Array.isArray(t)?!t.length:!Object.keys(t).length}function u(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}var f=t("fast-isnumeric");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(".");sr||r>a||o>n||n>s?!1:!e||!c(t)}function r(t,e){var r=t[0],l=t[1];if(i>r||r>a||o>l||l>s)return!1;var c,u,f,h,d,p=n.length,g=n[0][0],v=n[0][1],m=0;for(c=1;p>c;c++)if(u=g,f=v,g=n[c][0],v=n[c][1],h=Math.min(u,g),!(h>r||r>Math.max(u,g)||l>Math.max(f,v)))if(l=l&&r!==h&&m++}return m%2===1}var n=t.slice(),i=n[0][0],a=i,o=n[0][1],s=o;n.push(n[0]);for(var l=1;la;a++)if(o=[t[a][0]-l[0],t[a][1]-l[1]],s=n(o,c),0>s||s>u||Math.abs(n(o,h))>i)return!0;return!1};i.filter=function(t,e){function r(r){t.push(r);var s=n.length,l=i;n.splice(o+1);for(var c=l+1;c1){var s=t.pop();r(s)}return{addPt:r,raw:t,filtered:n}}},{"./matrix":383}],387:[function(t,e,r){"use strict";function n(t,e){for(var r,n=[],a=0;a=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;rt}function i(t,e){return e>=t}function a(t,e){return t>e}function o(t,e){return t>=e}var s=t("fast-isnumeric");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 l,c,u=0,f=e.length,h=0;for(c=e[e.length-1]>=e[0]?r?n:i:r?o:a;f>u&&h++<100;)l=Math.floor((u+f)/2),c(e[l],t)?u=l+1:f=l;return h>90&&console.log("Long binary search..."),u-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;n>s;s++)e[s+1]>e[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,c=r?Math.ceil:Math.floor;a>i&&o++<100;)n=c((i+a)/2),e[n]<=t?i=n+s:a=n-l;return e[i]}},{"fast-isnumeric":117}],389:[function(t,e,r){"use strict";e.exports=function(t,e){(t.attr("class")||"").split(" ").forEach(function(e){0===e.indexOf("cursor-")&&t.classed(e,!1)}),e&&t.classed("cursor-"+e,!0)}},{}],390:[function(t,e,r){"use strict";var n=t("../components/color"),i=function(){};e.exports=function(t){for(var e in t)"function"==typeof t[e]&&(t[e]=i);t.destroy=function(){t.container.parentNode.removeChild(t.container)};var r=document.createElement("div");return r.textContent="Webgl is not supported by your browser - visit http://get.webgl.org for more info",r.style.cursor="pointer",r.style.fontSize="24px",r.style.color=n.defaults[0],t.container.appendChild(r),t.container.style.background="#FFFFFF",t.container.onclick=function(){window.open("http://get.webgl.org")},!1}},{"../components/color":303}],391:[function(t,e,r){"use strict";var n=t("fast-isnumeric");r.aggNums=function(t,e,i,a){var o,s;if(a||(a=i.length),n(e)||(e=!1),Array.isArray(i[0])){for(s=new Array(a),o=0;a>o;o++)s[o]=r.aggNums(t,e,i[o]);i=s}for(o=0;a>o;o++)n(e)?n(i[o])&&(e=t(+e,+i[o])):e=i[o];return e},r.len=function(t){return r.aggNums(function(t){return t+1},0,t)},r.mean=function(t,e){return e||(e=r.len(t)),r.aggNums(function(t,e){return t+e},0,t)/e},r.variance=function(t,e,i){return e||(e=r.len(t)),n(i)||(i=r.mean(t,e)),r.aggNums(function(t,e){return t+Math.pow(e-i,2)},0,t)/e},r.stdev=function(t,e,n){return Math.sqrt(r.variance(t,e,n))},r.interp=function(t,e){if(!n(e))throw"n should be a finite number";if(e=e*t.length-.5,0>e)return t[0];if(e>t.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"fast-isnumeric":117}],392:[function(t,e,r){"use strict";function n(t){return t=i(t),a.str2RgbaArray(t.toRgbString())}var i=t("tinycolor2"),a=t("arraytools");e.exports=n},{arraytools:49,tinycolor2:274}],393:[function(t,e,r){"use strict";function n(t,e){return t.node().getBoundingClientRect()[e]}function i(t){return t.replace(/(<|<|<)/g,"\\lt ").replace(/(>|>|>)/g,"\\gt ")}function a(t,e,r){var n="math-output-"+l.Lib.randstr([],64),a=c.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=c.select("body").select("#MathJax_SVG_glyphs");if(a.select(".MathJax_SVG").empty()||!a.select("svg").node())console.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){for(var e=l.util.html_entity_decode(t),r=e.split(/(<[^<>]*>)/).map(function(t){var e=t.match(/<(\/?)([^ >]*)\s*(.*)>/i),r=e&&e[2].toLowerCase(),n=h[r];if(void 0!==n){var i=e[1],a=e[3],o=a.match(/^style\s*=\s*"([^"]+)"\s*/i);if("a"===r){if(i)return"
";if("href"!==a.substr(0,4).toLowerCase())return"";var s=document.createElement("a");return s.href=a.substr(4).replace(/["'=]/g,""),-1===d.indexOf(s.protocol)?"":'"}if("br"===r)return"
";if(i)return"sup"===r?'':"sub"===r?'':"";var c=""}return l.util.xml_entity_encode(t).replace(/");i>0;i=r.indexOf("
",i+1))n.push(i);var a=0;n.forEach(function(t){for(var e=t+a,n=r.slice(0,e),i="",o=n.length-1;o>=0;o--){var s=n[o].match(/<(\/?).*>/i);if(s&&"
"!==n[o]){s[1]||(i=n[o]);break}}i&&(r.splice(e+1,0,i),r.splice(e,0,""),a+=2)});var o=r.join(""),s=o.split(/
/gi);return s.length>1&&(r=s.map(function(t,e){return''+t+""})),r.join("")}function s(t,e,r){var n,i,a,o=r.horizontalAlign,s=r.verticalAlign||"top",l=t.node().getBoundingClientRect(),c=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()-c.top+"px",left:a()-c.left+"px","z-index":1e3}),this}}var l=t("../plotly"),c=t("d3"),u=t("../constants/xmlns_namespaces"),f=e.exports={};c.selection.prototype.appendSVG=function(t){for(var e=['',t,""].join(""),r=(new DOMParser).parseFromString(e,"application/xml"),n=r.documentElement.firstChild;n;)this.node().appendChild(this.node().ownerDocument.importNode(n,!0)),n=n.nextSibling;return r.querySelector("parsererror")?(console.log(r.querySelector("parsererror div").textContent),null):c.select(this.node().lastChild)},f.html_entity_decode=function(t){var e=c.select("body").append("div").style({display:"none"}).html(""),r=t.replace(/(&[^;]*;)/gi,function(t){return"<"===t?"<":"&rt;"===t?">":e.html(t).text()});return e.remove(),r},f.xml_entity_encode=function(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")},f.convertToTspans=function(t,e){function r(){d.empty()||(p=u.attr("class")+"-math",d.select("svg."+p).remove()),t.text("").style({visibility:"visible","white-space":"pre"}),h=t.appendSVG(s),h||t.text(i),t.select("a").size()&&t.style("pointer-events","all"),e&&e.call(u)}var i=t.text(),s=o(i),u=t,f=!u.attr("data-notex")&&s.match(/([^$]*)([$]+[^$]*[$]+)([^$]*)/),h=i,d=c.select(u.node().parentNode);if(!d.empty()){var p=u.attr("class")?u.attr("class").split(" ")[0]:"text";p+="-math",d.selectAll("svg."+p).remove(),d.selectAll("g."+p+"-group").remove(),t.style({visibility:null});for(var g=t.node();g&&g.removeAttribute;g=g.parentNode)g.removeAttribute("data-bb");if(f){var v=l.Lib.getPlotDiv(u.node());(v&&v._promises||[]).push(new Promise(function(t){u.style({visibility:"hidden"});var i={fontSize:parseInt(u.style("font-size"),10)};a(f[2],i,function(i,a,o){d.selectAll("svg."+p).remove(),d.selectAll("g."+p+"-group").remove();var s=i&&i.select("svg");if(!s||!s.node())return r(),void t();var l=d.append("g").classed(p+"-group",!0).attr({"pointer-events":"none"});l.node().appendChild(s.node()),a&&a.node()&&s.node().insertBefore(a.node().cloneNode(!0),s.node().firstChild),s.attr({"class":p,height:o.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=u.style("fill")||"black";s.select("g").attr({fill:c,stroke:c});var f=n(s,"width"),h=n(s,"height"),g=+u.attr("x")-f*{start:0,middle:.5,end:1}[u.attr("text-anchor")||"start"],v=parseInt(u.style("font-size"),10)||n(u,"height"),m=-v/4;"y"===p[0]?(l.attr({transform:"rotate("+[-90,+u.attr("x"),+u.attr("y")]+") translate("+[-f/2,m-h/2]+")"}),s.attr({x:+u.attr("x"),y:+u.attr("y")})):"l"===p[0]?s.attr({x:u.attr("x"),y:m-h/2}):"a"===p[0]?s.attr({x:0,y:m}):s.attr({x:g,y:+u.attr("y")+m-h/2}),e&&e.call(u,l),t(l)})}))}else r();return t}};var h={sup:'font-size:70%" dy="-0.6em',sub:'font-size:70%" dy="0.3em',b:"font-weight:bold",i:"font-style:italic",a:"",span:"",br:"",em:"font-style:italic;font-weight:bold"},d=["http:","https:","mailto:"],p=new RegExp("]*)?/?>","g");f.plainText=function(t){return(t||"").replace(p," ")},f.makeEditable=function(t,e,r){function n(){a(),o.style({opacity:0});var t,e=h.attr("class");t=e?"."+e.split(" ")[0]+"-math-group":"[class*=-math-group]",t&&c.select(o.node().parentNode).select(t).style({opacity:0})}function i(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 t=c.select(l.Lib.getPlotDiv(o.node())),e=t.select(".svg-container"),n=e.append("div");n.classed("plugin-editable editable",!0).style({position:"absolute","font-family":o.style("font-family")||"Arial","font-size":o.style("font-size")||12,color:r.fill||o.style("fill")||"black",opacity:1,"background-color":r.background||"transparent",outline:"#ffffff33 1px solid",margin:[-parseFloat(o.style("font-size"))/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(r.text||o.attr("data-unformatted")).call(s(o,e,r)).on("blur",function(){o.text(this.textContent).style({opacity:1});var t,e=c.select(this).attr("class");t=e?"."+e.split(" ")[0]+"-math-group":"[class*=-math-group]",t&&c.select(o.node().parentNode).select(t).style({opacity:0});var r=this.textContent;c.select(this).transition().duration(0).remove(),c.select(document).on("mouseup",null),u.edit.call(o,r)}).on("focus",function(){var t=this;c.select(document).on("mouseup",function(){return c.event.target===t?!1:void(document.activeElement===n.node()&&n.node().blur())})}).on("keyup",function(){27===c.event.which?(o.style({opacity:1}),c.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),u.cancel.call(o,this.textContent)):(u.input.call(o,this.textContent),c.select(this).call(s(o,e,r)))}).on("keydown",function(){13===c.event.which&&this.blur()}).call(i)}r||(r={});var o=this,u=c.dispatch("edit","input","cancel"),f=c.select(this.node()).style({"pointer-events":"all"}),h=e||f;return e&&f.style({"pointer-events":"none"}),r.immediate?n():h.on("click",n),c.rebind(this,u,"on")}},{"../constants/xmlns_namespaces":369,"../plotly":400,d3:113}],394:[function(t,e,r){"use strict";var n=e.exports={},i=t("../plots/geo/constants").locationmodeToLayer,a=t("topojson").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":422,topojson:275}],395:[function(t,e,r){"use strict";function n(t){var e;if("string"==typeof t){if(e=document.getElementById(t),null===e)throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t}function i(t,e){t._fullLayout._paperdiv.style("background","white"),P.defaultConfig.setBackground(t,e)}function a(t,e){t._context||(t._context=R.extendFlat({},P.defaultConfig));var r=t._context;e&&(Object.keys(e).forEach(function(t){t in r&&("setBackground"===t&&"opaque"===e[t]?r[t]=i:r[t]=e[t])}),e.plot3dPixelRatio&&!r.plotGlPixelRatio&&(r.plotGlPixelRatio=r.plot3dPixelRatio)),r.staticPlot&&(r.editable=!1,r.autosizable=!1,r.scrollZoom=!1,r.doubleClick=!1,r.showTips=!1,r.showLink=!1,r.displayModeBar=!1)}function o(t,e,r){var n=S.select(t).selectAll(".plot-container").data([0]);n.enter().insert("div",":first-child").classed("plot-container plotly",!0);var i=n.selectAll(".svg-container").data([0]);i.enter().append("div").classed("svg-container",!0).style("position","relative"),i.html(""),e&&(t.data=e),r&&(t.layout=r),P.micropolar.manager.fillLayout(t),"initial"===t._fullLayout.autosize&&t._context.autosizable&&(w(t,{}),t._fullLayout.autosize=r.autosize=!0),i.style({width:t._fullLayout.width+"px",height:t._fullLayout.height+"px"}),t.framework=P.micropolar.manager.framework(t),t.framework({data:t.data,layout:t.layout},i.node()),t.framework.setUndoPoint();var a=t.framework.svg(),o=1,s=t._fullLayout.title;""!==s&&s||(o=0);var l="Click to enter title",c=function(){this.call(P.util.convertToTspans)},u=a.select(".title-group text").call(c);if(t._context.editable){u.attr({"data-unformatted":s}),s&&s!==l||(o=.2,u.attr({"data-unformatted":l}).text(l).style({opacity:o}).on("mouseover.opacity",function(){S.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){S.select(this).transition().duration(1e3).style("opacity",0)}));var f=function(){this.call(P.util.makeEditable).on("edit",function(e){t.framework({layout:{title:e}}),this.attr({"data-unformatted":e}).text(e).call(c),this.call(f)}).on("cancel",function(){var t=this.attr("data-unformatted");this.text(t).call(c)})};u.call(f)}return t._context.setBackground(t,t._fullLayout.paper_bgcolor),N.addLinks(t),Promise.resolve()}function s(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 n=P.Axes.list({_fullLayout:t});for(e=0;ee;e++){var o=t.annotations[e];o.ref&&("paper"===o.ref?(o.xref="paper",o.yref="paper"):"data"===o.ref&&(o.xref="x",o.yref="y"),delete o.ref),l(o,"xref"),l(o,"yref")}void 0===t.shapes||Array.isArray(t.shapes)||(console.log("shapes must be an array"),delete t.shapes);var s=(t.shapes||[]).length;for(e=0;s>e;e++){var c=t.shapes[e];l(c,"xref"),l(c,"yref")}var u=t.legend;u&&(u.x>3?(u.x=1.02,u.xanchor="left"):u.x<-2&&(u.x=-.02,u.xanchor="right"),u.y>3?(u.y=1.02,u.yanchor="bottom"):u.y<-2&&(u.y=-.02,u.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var h=N.getSubplotIds(t,"gl3d");for(e=0;er;++r)b[r]=v[e]+m*y[2+4*r];d.camera={eye:{x:b[0],y:b[1],z:b[2]},center:{x:v[0],y:v[1],z:v[2]},up:{x:y[1],y:y[5],z:y[9]}},delete d.cameraposition}}return R.markTime("finished rest of cleanLayout, starting color"),F.clean(t),R.markTime("finished cleanLayout color.clean"),t}function l(t,e){var r=t[e],n=e.charAt(0);r&&"paper"!==r&&(t[e]=P.Axes.cleanId(r,n))}function c(t,e){for(var r=[],n=(t.concat(Array.isArray(e)?e:[]).filter(function(t){return"uid"in t}).map(function(t){return t.uid})),i=0;ia&&(s=R.randstr(n),-1!==r.indexOf(s));a++);o.uid=R.randstr(n),n.push(o.uid)}if(r.push(o.uid),"histogramy"===o.type&&"xbins"in o&&!("ybins"in o)&&(o.ybins=o.xbins,delete o.xbins),o.error_y&&"opacity"in o.error_y){var l=F.defaults,c=o.error_y.color||(N.traceIs(o,"bar")?F.defaultLine:l[i%l.length]);o.error_y.color=F.addOpacity(F.rgb(c),F.opacity(c)*o.error_y.opacity),delete o.error_y.opacity}if("bardir"in o&&("h"!==o.bardir||!N.traceIs(o,"bar")&&"histogram"!==o.type.substr(0,9)||(o.orientation="h",x(o)),delete o.bardir),"histogramy"===o.type&&x(o),"histogramx"!==o.type&&"histogramy"!==o.type||(o.type="histogram"),"scl"in o&&(o.colorscale=o.scl,delete o.scl),"reversescl"in o&&(o.reversescale=o.reversescl,delete o.reversescl),o.xaxis&&(o.xaxis=P.Axes.cleanId(o.xaxis,"x")),o.yaxis&&(o.yaxis=P.Axes.cleanId(o.yaxis,"y")),N.traceIs(o,"gl3d")&&o.scene&&(o.scene=N.subplotsRegistry.gl3d.cleanId(o.scene)),N.traceIs(o,"pie")||(Array.isArray(o.textposition)?o.textposition=o.textposition.map(u):o.textposition&&(o.textposition=u(o.textposition))),N.traceIs(o,"2dMap")&&("YIGnBu"===o.colorscale&&(o.colorscale="YlGnBu"),"YIOrRd"===o.colorscale&&(o.colorscale="YlOrRd")),N.traceIs(o,"markerColorscale")&&o.marker){var h=o.marker;"YIGnBu"===h.colorscale&&(h.colorscale="YlGnBu"),"YIOrRd"===h.colorscale&&(h.colorscale="YlOrRd")}if("surface"===o.type&&R.isPlainObject(o.contours)){var d=["x","y","z"];for(a=0;an?a.push(i+n):a.push(n);return a}function p(t,e,r){var n,i;for(n=0;n=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||0>i&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function g(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),p(t,e,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&p(t,r,"newIndices"),"undefined"!=typeof r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function v(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&l0){var s=_(t._boundingBoxMargins),l=s.left+s.right,c=s.bottom+s.top,u=a._container.node().getBoundingClientRect(),f=1-2*o.frameMargins;i=Math.round(f*(u.width-l)),n=Math.round(f*(u.height-c))}else r=window.getComputedStyle(t),n=parseFloat(r.height)||a.height,i=parseFloat(r.width)||a.width;return Math.abs(a.width-i)>1||Math.abs(a.height-n)>1?(a.height=t.layout.height=n,a.width=t.layout.width=i):"initial"!==a.autosize&&(delete e.autosize,a.autosize=t.layout.autosize=!0),N.sanitizeMargins(a),e}function k(t){var e=S.select(t),r=t._fullLayout;if(r._container=e.selectAll(".plot-container").data([0]),r._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0),r._paperdiv=r._container.selectAll(".svg-container").data([0]),r._paperdiv.enter().append("div").classed("svg-container",!0).style("position","relative"),"initial"===r.autosize&&(w(t,{}),r.autosize=!0,t.layout.autosize=!0),r._glcontainer=r._paperdiv.selectAll(".gl-container").data([0]),r._glcontainer.enter().append("div").classed("gl-container",!0),r._geocontainer=r._paperdiv.selectAll(".geo-container").data([0]),r._geocontainer.enter().append("div").classed("geo-container",!0),r._paperdiv.selectAll(".main-svg").remove(),r._paper=r._paperdiv.insert("svg",":first-child").classed("main-svg",!0),r._toppaper=r._paperdiv.append("svg").classed("main-svg",!0),!r._uid){var n=[];S.selectAll("defs").each(function(){this.id&&n.push(this.id.split("-")[1])}),r._uid=R.randstr(n)}r._paperdiv.selectAll(".main-svg").attr(W.svgAttrs),r._defs=r._paper.append("defs").attr("id","defs-"+r._uid),r._topdefs=r._toppaper.append("defs").attr("id","topdefs-"+r._uid),r._draggers=r._paper.append("g").classed("draglayer",!0);var i=r._paper.append("g").classed("layer-below",!0);r._imageLowerLayer=i.append("g").classed("imagelayer",!0),r._shapeLowerLayer=i.append("g").classed("shapelayer",!0);var a=P.Axes.getSubplots(t);a.join("")!==Object.keys(t._fullLayout._plots||{}).join("")&&A(t,a),r._has("cartesian")&&M(t,a),r._ternarylayer=r._paper.append("g").classed("ternarylayer",!0);var o=r._paper.selectAll(".layer-subplot");r._imageSubplotLayer=o.selectAll(".imagelayer"),r._shapeSubplotLayer=o.selectAll(".shapelayer");var s=r._paper.append("g").classed("layer-above",!0);r._imageUpperLayer=s.append("g").classed("imagelayer",!0),r._shapeUpperLayer=s.append("g").classed("shapelayer",!0),r._pielayer=r._paper.append("g").classed("pielayer",!0),r._glimages=r._paper.append("g").classed("glimages",!0),r._geoimages=r._paper.append("g").classed("geoimages",!0),r._infolayer=r._toppaper.append("g").classed("infolayer",!0),r._zoomlayer=r._toppaper.append("g").classed("zoomlayer",!0),r._hoverlayer=r._toppaper.append("g").classed("hoverlayer",!0),t.emit("plotly_framework");var l=R.syncOrAsync([T,function(){return P.Axes.doTicks(t,"redraw")},j.init],t);return l&&l.then&&t._promises.push(l),l}function A(t,e){function r(e,r){return function(){return P.Axes.getFromId(t,e,r)}}for(var n,i,a=t._fullLayout._plots={},o=0;o0,_=P.Axes.getSubplots(t).join(""),w=Object.keys(t._fullLayout._plots||{}).join(""),A=w===_;x?t.framework===k&&!b&&A||(t.framework=k,k(t)):A?b&&k(t):(t.framework=k,k(t)),b&&P.Axes.saveRangeInitial(t);var M=t._fullLayout,E=!t.calcdata||t.calcdata.length!==(t.data||[]).length;E&&h(t);for(var L=0;LY.range[0]?[1,2]:[2,1]);else{var W=Y.range[0],Z=Y.range[1];"log"===O?(0>=W&&0>=Z&&i(q+".autorange",!0),0>=W?W=Z/1e6:0>=Z&&(Z=W/1e6),i(q+".range[0]",Math.log(W)/Math.LN10),i(q+".range[1]",Math.log(Z)/Math.LN10)):(i(q+".range[0]",Math.pow(10,W)),i(q+".range[1]",Math.pow(10,Z)))}else i(q+".autorange",!0)}if("reverse"===D)H.range?H.range.reverse():(i(q+".autorange",!0),H.range=[1,0]),G.autorange?_=!0:x=!0;else if("annotations"===z.parts[0]||"shapes"===z.parts[0]){var K=z.parts[1],$=z.parts[0],Q=p[$]||[],J=P[R.titleCase($)],tt=Q[K]||{};2===z.parts.length&&("add"===v[C]||R.isPlainObject(v[C])?E[C]="remove":"remove"===v[C]?-1===K?(E[$]=Q,delete E[C]):E[C]=tt:console.log("???",v)),!a(tt,"x")&&!a(tt,"y")||R.containsAny(C,["color","opacity","align","dash"])||(_=!0),J.draw(t,K,z.parts.slice(2).join("."),v[C]),delete v[C]}else if("images"===z.parts[0]){var rt=R.objectFromPath(e,O);R.extendDeepAll(t.layout,rt),U.supplyLayoutDefaults(t.layout,t._fullLayout),U.draw(t)}else 0===z.parts[0].indexOf("scene")?x=!0:0===z.parts[0].indexOf("geo")?x=!0:0===z.parts[0].indexOf("ternary")?x=!0:!g._has("gl2d")||-1===C.indexOf("axis")&&"plot_bgcolor"!==z.parts[0]?"hiddenlabels"===C?_=!0:-1!==z.parts[0].indexOf("legend")?m=!0:-1!==C.indexOf("title")?y=!0:-1!==z.parts[0].indexOf("bgcolor")?b=!0:z.parts.length>1&&R.containsAny(z.parts[1],["tick","exponent","grid","zeroline"])?y=!0:-1!==C.indexOf(".linewidth")&&-1!==C.indexOf("axis")?y=b=!0:z.parts.length>1&&-1!==z.parts[1].indexOf("line")?b=!0:z.parts.length>1&&"mirror"===z.parts[1]?y=b=!0:"margin.pad"===C?y=b=!0:"margin"===z.parts[0]||"autorange"===z.parts[1]||"rangemode"===z.parts[1]||"type"===z.parts[1]||"domain"===z.parts[1]||C.match(/^(bar|box|font)/)?_=!0:-1!==["hovermode","dragmode"].indexOf(C)?k=!0:-1===["hovermode","dragmode","height","width","autosize"].indexOf(C)&&(x=!0):x=!0,z.set(O)}I&&I.add(t,et,[t,E],et,[t,M]),v.autosize&&(v=w(t,v)),(v.height||v.width||v.autosize)&&(_=!0);var nt=Object.keys(v),it=[N.previousPromises];if(x||_)it.push(function(){return t.layout=void 0,_&&(t.calcdata=void 0),P.plot(t,"",p)});else if(nt.length&&(N.supplyDefaults(t),g=t._fullLayout,m&&it.push(function(){return V.draw(t),N.previousPromises(t)}),b&&it.push(T),y&&it.push(function(){return P.Axes.doTicks(t,"redraw"),L(t),N.previousPromises(t)}),k)){var at;for(X(t),at=N.getSubplotIds(g,"gl3d"),d=0;d1)};c(r.width)&&c(r.height)||s(new Error("Height and width should be pixel values."));var u=n.clone(e,{format:"png",height:r.height,width:r.width}),f=u.td;f.style.position="absolute",f.style.left="-5000px",document.body.appendChild(f);var h=n.getRedrawFunc(f);a.plot(f,u.data,u.layout,u.config).then(h).then(l).then(function(e){t(e)}).catch(function(t){s(t)})});return s}var i=t("fast-isnumeric"),a=t("../plotly"),o=t("../lib");e.exports=n},{"../lib":381,"../plotly":400,"../snapshot":469,"fast-isnumeric":117}],400:[function(t,e,r){"use strict";t("es6-promise").polyfill(),r.Lib=t("./lib"),r.util=t("./lib/svg_text_utils"),r.Queue=t("./lib/queue"),t("../build/plotcss"),r.MathJaxConfig=t("./fonts/mathjax_config"),r.defaultConfig=t("./plot_api/plot_config");var n=r.Plots=t("./plots/plots");r.Axes=t("./plots/cartesian/axes"),r.Fx=t("./plots/cartesian/graph_interact"),r.micropolar=t("./plots/polar/micropolar"),r.Color=t("./components/color"),r.Drawing=t("./components/drawing"),r.Colorscale=t("./components/colorscale"),r.Colorbar=t("./components/colorbar"),r.ErrorBars=t("./components/errorbars"),r.Annotations=t("./components/annotations"),r.Shapes=t("./components/shapes"),r.Legend=t("./components/legend"),r.Images=t("./components/images"),r.ModeBar=t("./components/modebar"),r.register=function(t){if(!t)throw new Error("No argument passed to Plotly.register.");t&&!Array.isArray(t)&&(t=[t]);for(var e=0;ec&&u>e&&(void 0===i[r]?a[f]=T.tickText(t,e):a[f]=s(t,e,String(i[r])),f++);return f=864e5?t._tickround="d":r>=36e5?t._tickround="H":r>=6e4?t._tickround="M":r>=1e3?t._tickround="S":t._tickround=3-Math.round(Math.log(r/2)/Math.LN10);else{b(r)||(r=Number(r.substr(1))),t._tickround=2-Math.floor(Math.log(r)/Math.LN10+.01),e="log"===t.type?Math.pow(10,Math.max(t.range[0],t.range[1])):Math.max(Math.abs(t.range[0]),Math.abs(t.range[1]));var n=Math.floor(Math.log(e)/Math.LN10+.01);Math.abs(n)>3&&("SI"===t.exponentformat||"B"===t.exponentformat?t._tickexponent=3*Math.round((n-1)/3):t._tickexponent=n)}else"M"===r.charAt(0)?t._tickround=2===r.length?"m":"y":t._tickround=null}function o(t,e){var r=t.match(U),n=new Date(e);if(r){var i=Math.min(+r[1]||6,6),a=String(e/1e3%1+2.0000005).substr(2,i).replace(/0+$/,"")||"0";return y.time.format(t.replace(U,a))(n)}return y.time.format(t)(n)}function s(t,e,r){var n=t.tickfont||t._gd._fullLayout.font;return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}function l(t,e,r,n){var i,a=e.x,s=t._tickround,l=new Date(a),c="";r&&t.hoverformat?i=o(t.hoverformat,a):t.tickformat?i=o(t.tickformat,a):(n&&(b(s)?s+=2:s={y:"m",m:"d",d:"H",H:"M",M:"S",S:2}[s]),"y"===s?i=I(l):"m"===s?i=N(l):(a!==t._tmin||r||(c="
"+I(l)),"d"===s?i=j(l):"H"===s?i=F(l):(a!==t._tmin||r||(c="
"+j(l)+", "+I(l)),i=D(l),"M"!==s&&(i+=B(l),"S"!==s&&(i+=h(m(a/1e3,1),t,"none",r).substr(1)))))),e.text=i+c}function c(t,e,r,n,i){var a=t.dtick,o=e.x;if(!n||"string"==typeof a&&"L"===a.charAt(0)||(a="L3"),t.tickformat||"string"==typeof a&&"L"===a.charAt(0))e.text=h(Math.pow(10,o),t,i,n);else if(b(a)||"D"===a.charAt(0)&&m(o+.01,1)<.1)if(-1!==["e","E","power"].indexOf(t.exponentformat)){var s=Math.round(o);0===s?e.text=1:1===s?e.text="10":s>1?e.text="10"+s+"":e.text="10\u2212"+-s+"",e.fontSize*=1.25}else e.text=h(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,m(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*(0>o?.5:.25)))}}function u(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}function f(t,e,r,n,i){"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=h(e.x,t,i,n)}function h(t,e,r,n){var i=0>t,o=e._tickround,s=r||e.exponentformat||"B",l=e._tickexponent,c=e.tickformat;if(n){var u={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:b(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range:[0,t||1]};a(u),o=(Number(u._tickround)||0)+4,l=u._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return y.format(c)(t).replace(/-/g,"\u2212");var f=Math.pow(10,-o)/2;if("none"===s&&(l=0),t=Math.abs(t),f>t)t="0",i=!1;else{if(t+=f,l&&(t*=Math.pow(10,-l),o+=l),0===o)t=String(Math.floor(t));else if(0>o){t=String(Math.round(t)),t=t.substr(0,t.length+o);for(var h=o;0>h;h++)t+="0"}else{t=String(t);var d=t.indexOf(".")+1;d&&(t=t.substr(0,d+o).replace(/\.?0+$/,""))}t=_.numSeparate(t,e._gd._fullLayout.separators)}if(l&&"hide"!==s){var p;p=0>l?"\u2212"+-l:"power"!==s?"+"+l:String(l),"e"===s||("SI"===s||"B"===s)&&(l>12||-15>l)?t+="e"+p:"E"===s?t+="E"+p:"power"===s?t+="×10"+p+"":"B"===s&&9===l?t+="B":"SI"!==s&&"B"!==s||(t+=V[l/3+5])}return i?"\u2212"+t:t}function d(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},T.getAutoRange=function(t){var e,r=[],n=t._min[0].val,i=t._max[0].val;for(e=1;e0&&u>0&&f/u>h&&(l=o,c=s,h=f/u);return n===i?r=d?[n+1,"normal"!==t.rangemode?0:n-1]:["normal"!==t.rangemode?0:n-1,n+1]:h&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode&&l.val>=0?l={val:0,pad:0}:"nonnegative"===t.rangemode&&(l.val-h*l.pad<0&&(l={val:0,pad:0}),c.val<0&&(c={val:1,pad:0})),h=(c.val-l.val)/(t._length-l.pad-c.pad)),r=[l.val-h*l.pad,c.val+h*c.pad],r[0]===r[1]&&(r=[r[0]-1,r[0]+1]),d&&r.reverse()),r},T.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=T.getAutoRange(t);var r=t._gd.layout[t._name];r||(t._gd.layout[t._name]=r={}),r!==t&&(r.range=t.range.slice(),r.autorange=t.autorange)}},T.saveRangeInitial=function(t,e){for(var r=T.list(t,"",!0),n=!1,i=0;ip&&(p=g/10),c=t.c2l(p),u=t.c2l(g),y&&(c=Math.min(0,c),u=Math.max(0,u)),n(c)){for(d=!0,o=0;o=h?d=!1:s.val>=c&&s.pad<=h&&(t._min.splice(o,1),o--);d&&t._min.push({val:c,pad:y&&0===c?0:h})}if(n(u)){for(d=!0,o=0;o=u&&s.pad>=f?d=!1:s.val<=u&&s.pad<=f&&(t._max.splice(o,1),o--);d&&t._max.push({val:u,pad:y&&0===u?0:f})}}}if((t.autorange||t._needsExpand)&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var a,o,s,l,c,u,f,h,d,p,g,v=e.length,m=r.padded?.05*t._length:0,y=r.tozero&&("linear"===t.type||"-"===t.type),x=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),_=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),w=n(r.vpadplus||r.vpad),k=n(r.vpadminus||r.vpad);for(a=0;6>a;a++)i(a);for(a=v-1;a>5;a--)i(a)}},T.autoBin=function(t,e,r,n){function i(t){return(1+100*(t-d)/f.dtick)%100<2}var a=_.aggNums(Math.min,null,t),o=_.aggNums(Math.max,null,t);if("category"===e.type)return{start:a-.5,end:o+.5,size:1};var s;if(r)s=(o-a)/r;else{var l=_.distinctVals(t),c=Math.pow(10,Math.floor(Math.log(l.minDiff)/Math.LN10)),u=c*_.roundUp(l.minDiff/c,[.9,1.9,4.9,9.9],!0);s=Math.max(u,2*_.stdev(t)/Math.pow(t.length,n?.25:.4))}var f={type:"log"===e.type?"linear":e.type,range:[a,o]};T.autoTicks(f,s);var h,d=T.tickIncrement(T.tickFirst(f),f.dtick,"reverse");if("number"==typeof f.dtick){for(var p=0,g=0,v=0,m=0,y=0;yg&&(p>.3*x||i(a)||i(o))){var w=f.dtick/2;d+=a>d+w?w:-w}var k=1+Math.floor((o-d)/f.dtick);h=d+k*f.dtick}else for(h=d;o>=h;)h=T.tickIncrement(h,f.dtick);return{start:d,end:h,size:f.dtick}},T.calcTicks=function(t){if("array"===t.tickmode)return n(t);if("auto"===t.tickmode||!t.dtick){var e,r=t.nticks;r||("category"===t.type?(e=t.tickfont?1.2*(t.tickfont.size||12):15,r=t._length/e):(e="y"===t._id.charAt(0)?40:80,r=_.constrain(t._length/e,4,9)+1)),T.autoTicks(t,Math.abs(t.range[1]-t.range[0])/r),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t._forceTick0)}t.tick0||(t.tick0="date"===t.type?new Date(2e3,0,1).getTime():0),a(t),t._tmin=T.tickFirst(t);var i=t.range[1]=s:s>=l)&&(o.push(l),!(o.length>1e3));l=T.tickIncrement(l,t.dtick,i));t._tmax=o[o.length-1];for(var c=new Array(o.length),u=0;u157788e5?(e/=315576e5,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*i(e,r,S)):e>12096e5?(e/=26298e5,t.dtick="M"+i(e,1,C)):e>432e5?(t.dtick=i(e,864e5,P),t.tick0=new Date(2e3,0,2).getTime()):e>18e5?t.dtick=i(e,36e5,C):e>3e4?t.dtick=i(e,6e4,z):e>500?t.dtick=i(e,1e3,z):(r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=i(e,r,S));else if("log"===t.type)if(t.tick0=0,e>.7)t.dtick=Math.ceil(e);else if(Math.abs(t.range[1]-t.range[0])<1){var n=1.5*Math.abs((t.range[1]-t.range[0])/e);e=Math.abs(Math.pow(10,t.range[1])-Math.pow(10,t.range[0]))/n,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+i(e,r,S)}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=i(e,r,S));if(0===t.dtick&&(t.dtick=1),!b(t.dtick)&&"string"!=typeof t.dtick){var a=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(a)}},T.tickIncrement=function(t,e,r){var n=r?-1:1;if(b(e))return t+n*e;var i=e.charAt(0),a=n*Number(e.substr(1));if("M"===i){var o=new Date(t);return o.setMonth(o.getMonth()+a)}if("L"===i)return Math.log(Math.pow(10,t)+a)/Math.LN10;if("D"===i){var s="D2"===e?O:R,l=t+.01*n,c=_.roundUp(m(l,1),s,r);return Math.floor(l)+Math.log(y.round(Math.pow(10,c),1))/Math.LN10}throw"unrecognized dtick "+String(e)},T.tickFirst=function(t){var e=t.range[1]n:n>c;)c=T.tickIncrement(c,i,e);return c}if("L"===u)return Math.log(r((Math.pow(10,n)-a)/f)*f+a)/Math.LN10;if("D"===u){var h="D2"===i?O:R,d=_.roundUp(m(n,1),h,e);return Math.floor(n)+Math.log(y.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(i)};var I=y.time.format("%Y"),N=y.time.format("%b %Y"),j=y.time.format("%b %-d"),F=y.time.format("%b %-d %Hh"),D=y.time.format("%H:%M"),B=y.time.format(":%S"),U=/%(\d?)f/g;T.tickText=function(t,e,r){function n(n){var i;return void 0===n?!0:r?"none"===n:(i={first:t._tmin,last:t._tmax}[n],"all"!==n&&e!==i)}var i,a,o=s(t,e),h="array"===t.tickmode,d=r||h;if(h&&Array.isArray(t.ticktext)){var p=Math.abs(t.range[1]-t.range[0])/1e4;for(a=0;a1&&er&&(A=90),i(u,A)}c._lastangle=A}return o(e),e+" done"}function l(){c._boundingBox=r.node().getBoundingClientRect()}var u=r.selectAll("g."+C).data(L,S);if(!c.showticklabels||!b(n))return u.remove(),void o(e);var f,h,p,m,x;"x"===v?(x="bottom"===B?1:-1,f=function(t){return t.dx+I*x},m=n+(O+R)*x,h=function(t){return t.dy+m+t.fontSize*("bottom"===B?1:-.5)},p=function(t){return b(t)&&0!==t&&180!==t?0>t*x?"end":"start":"middle"}):(x="right"===B?1:-1,h=function(t){return t.dy+t.fontSize/2-I*x},f=function(t){return t.dx+n+(O+R+(90===Math.abs(c.tickangle)?t.fontSize/2:0))*x},p=function(t){return b(t)&&90===Math.abs(t)?"middle":"right"===B?"start":"end"});var k=0,A=0,T=[];u.enter().append("g").classed(C,1).append("text").attr("text-anchor","middle").each(function(e){var r=y.select(this),n=t._promises.length;r.call(M.setPosition,f(e),h(e)).call(M.font,e.font,e.fontSize,e.fontColor).text(e.text).call(w.convertToTspans),n=t._promises[n],n?T.push(t._promises.pop().then(function(){i(r,c.tickangle)})):i(r,c.tickangle)}),u.exit().remove(),u.each(function(t){k=Math.max(k,t.fontSize)}),i(u,c._lastangle||c.tickangle);var E=_.syncOrAsync([a,s,l]);return E&&E.then&&t._promises.push(E),E}function o(e){if(!r){var n,i,a,o,s=E.getFromId(t,e),l=y.select(t).selectAll("g."+e+"tick"),c={selection:l,side:s.side},f=e.charAt(0),h=t._fullLayout._size,d=1.5,p=s.titlefont.size;if(l.size()){var g=y.select(l.node().parentNode).attr("transform").match(/translate\(([-\.\d]+),([-\.\d]+)\)/);g&&(c.offsetLeft=+g[1],c.offsetTop=+g[2])}"x"===f?(i="free"===s.anchor?{_offset:h.t+(1-(s.position||0))*h.h,_length:0}:E.getFromId(t,s.anchor),a=s._offset+s._length/2,o=i._offset+("top"===s.side?-10-p*(d+(s.showticklabels?1:0)):i._length+10+p*(d+(s.showticklabels?1.5:.5))),s.rangeslider&&s.rangeslider.visible&&s._boundingBox&&(o+=(u.height-u.margin.b-u.margin.t)*s.rangeslider.thickness+s._boundingBox.height),c.side||(c.side="bottom")):(i="free"===s.anchor?{_offset:h.l+(s.position||0)*h.w,_length:0}:E.getFromId(t,s.anchor),o=s._offset+s._length/2,a=i._offset+("right"===s.side?i._length+10+p*(d+(s.showticklabels?1:.5)):-10-p*(d+(s.showticklabels?.5:0))),n={rotate:"-90",offset:0},c.side||(c.side="left")),k.draw(t,e+"title",{propContainer:s,propName:s._name+".title",dfltName:f.toUpperCase()+" axis",avoid:c,transform:n,attributes:{x:a,y:o,"text-anchor":"middle"}})}}function s(t,e){return t.visible!==!0||t.xaxis+t.yaxis!==e?!1:x.Plots.traceIs(t,"bar")&&t.orientation==={x:"h",y:"v"}[v]?!0:t.fill&&t.fill.charAt(t.fill.length-1)===v}function l(e,r,i){var a=e.gridlayer,o=e.zerolinelayer,l=e["hidegrid"+v]?[]:V,u=c._gridpath||"M0,0"+("x"===v?"v":"h")+r._length,f=a.selectAll("path."+z).data(c.showgrid===!1?[]:l,S);if(f.enter().append("path").classed(z,1).classed("crisp",1).attr("d",u).each(function(t){c.zeroline&&("linear"===c.type||"-"===c.type)&&Math.abs(t.x)g;g++){var y=c.mirrors[o._id+h[g]];"ticks"!==y&&"labels"!==y||(f[g]=!0)}return void 0!==n[2]&&(f[2]=!0),f.forEach(function(t,e){var r=n[e],i=U[e];t&&b(r)&&(d+=p(r+R*i,i*c.ticklen))}),i(r,d),l(e,o,t),a(r,n[3])}}).filter(function(t){return t&&t.then});return H.length?Promise.all(H):0},T.swap=function(t,e){for(var r=d(t,e),n=0;n2*n}function u(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,i=0,a=0;a2*n}var f=t("fast-isnumeric"),h=t("tinycolor2").mix,d=t("../../lib"),p=t("../plots"),g=t("../../components/color/attributes").lightFraction,v=t("./layout_attributes"),m=t("./tick_value_defaults"),y=t("./tick_mark_defaults"),b=t("./tick_label_defaults"),x=t("./category_order_defaults"),_=t("./set_convert"),w=t("./ordered_categories"),k=t("./clean_datum"),A=t("./axis_ids");e.exports=function(t,e,r,i){function a(r,n){return d.coerce2(t,e,v,r,n)}var o=i.letter,s=i.font||{},l="Click to enter "+(i.title||o.toUpperCase()+" axis")+" title";i.name&&(e._name=i.name,e._id=A.name2id(i.name));var c=r("type");"-"===c&&(n(e,i.data),"-"===e.type?e.type="linear":c=t.type=e.type),_(e);var u=r("color"),p=u===t.color?u:s.color;r("title",l),d.coerceFont(r,"titlefont",{family:s.family,size:Math.round(1.2*s.size),color:p});var k=2===(t.range||[]).length&&f(t.range[0])&&f(t.range[1]),M=r("autorange",!k); +M&&r("rangemode");var T=r("range",[-1,"x"===o?6:4]);T[0]===T[1]&&(e.range=[T[0]-1,T[0]+1]),d.noneOrAll(t.range,e.range,[0,1]),r("fixedrange"),m(t,e,r,c),b(t,e,r,c,i),y(t,e,r,i),x(t,e,r);var E=a("linecolor",u),L=a("linewidth"),S=r("showline",!!E||!!L);S||(delete e.linecolor,delete e.linewidth),(S||e.ticks)&&r("mirror");var C=a("gridcolor",h(u,i.bgColor,g).toRgbString()),z=a("gridwidth"),P=r("showgrid",i.showGrid||!!C||!!z);P||(delete e.gridcolor,delete e.gridwidth);var R=a("zerolinecolor",u),O=a("zerolinewidth"),I=r("zeroline",i.showGrid||!!R||!!O);return I||(delete e.zerolinecolor,delete e.zerolinewidth),e._initialCategories="category"===c?w(o,e.categoryorder,e.categoryarray,i.data):[],e}},{"../../components/color/attributes":302,"../../lib":381,"../plots":452,"./axis_ids":405,"./category_order_defaults":406,"./clean_datum":407,"./layout_attributes":412,"./ordered_categories":414,"./set_convert":417,"./tick_label_defaults":418,"./tick_mark_defaults":419,"./tick_value_defaults":420,"fast-isnumeric":117,tinycolor2:274}],405:[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")}}},{}],407:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib");e.exports=function(t){try{if("object"==typeof t&&null!==t&&t.getTime)return i.ms2DateTime(t);if("string"!=typeof t&&!n(t))return"";t=t.toString().replace(/['"%,$# ]/g,"")}catch(e){console.log(e,t)}return t}},{"../../lib":381,"fast-isnumeric":117}],408:[function(t,e,r){"use strict";e.exports={idRegex:{x:/^x([2-9]|[1-9][0-9]+)?$/,y:/^y([2-9]|[1-9][0-9]+)?$/},attrRegex:{x:/^xaxis([2-9]|[1-9][0-9]+)?$/,y:/^yaxis([2-9]|[1-9][0-9]+)?$/},BADNUM:void 0,xAxisMatch:/^xaxis[0-9]*$/,yAxisMatch:/^yaxis[0-9]*$/,AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,DBLCLICKDELAY:300,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,MAXDIST:20,YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,BENDPX:1.5,REDRAWDELAY:50}},{}],409:[function(t,e,r){"use strict";function n(t,e){var r,n=t.range[e],i=Math.abs(n-t.range[1-e]);return"date"===t.type?c.ms2DateTime(n,i):"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,o.format("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,o.format("."+String(r)+"g")(n))}function i(t,e){return t?"nsew"===t?"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}function a(t){o.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}var o=t("d3"),s=t("tinycolor2"),l=t("../../plotly"),c=t("../../lib"),u=t("../../lib/svg_text_utils"),f=t("../../components/color"),h=t("../../components/drawing"),d=t("../../lib/setcursor"),p=t("../../components/dragelement"),g=t("./axes"),v=t("./select"),m=t("./constants"),y=!0;e.exports=function(t,e,r,o,b,x,_,w){function k(t,e){for(var r=0;r.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+ht+", "+dt+")").attr("d",ot+"Z"),ut=ft.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+ht+", "+dt+")").attr("d","M0,0Z"),T();for(var a=0;ai?(lt="",it.r=it.l,it.t=it.b,ut.attr("d","M0,0Z")):(it.t=0,it.b=V,lt="x",ut.attr("d","M"+(it.l-.5)+","+(nt-H-.5)+"h-3v"+(2*H+1)+"h3ZM"+(it.r+.5)+","+(nt-H-.5)+"h3v"+(2*H+1)+"h-3Z")):!Z||i.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),ut.transition().style("opacity",1).duration(200),st=!0)}function L(t,e,r){var n,i,a;for(n=0;nzoom back out","long"),y=!1)))}function C(e,r){var i=1===(_+w).length;if(e)I();else if(2!==r||i){if(1===r&&i){var a=_?B[0]:D[0],o="s"===_||"w"===w?0:1,s=a._name+".range["+o+"]",c=n(a,o),f="left",h="middle";if(a.fixedrange)return;_?(h="n"===_?"top":"bottom","right"===a.side&&(f="right")):"e"===w&&(f="right"),J.call(u.makeEditable,null,{immediate:!0,background:j.paper_bgcolor,text:String(c),fill:a.tickfont?a.tickfont.color:"#444",horizontalAlign:f,verticalAlign:h}).on("edit",function(e){var r="category"===a.type?a.c2l(e):a.d2l(e);void 0!==r&&l.relayout(t,s,r)})}}else O()}function z(e){function r(t,e,r){if(!t.fixedrange){A(t.range);var n=t.range,i=n[0]+(n[1]-n[0])*e;t.range=[i+(n[0]-i)*r,i+(n[1]-i)*r]}}if(t._context.scrollZoom||j._enablescrollzoom){var n=t.querySelector(".plotly");if(!(n.scrollHeight-n.clientHeight>10||n.scrollWidth-n.clientWidth>10)){clearTimeout(gt);var i=-e.deltaY;if(isFinite(i)||(i=e.wheelDelta/10),!isFinite(i))return void console.log("did not find wheel motion attributes",e);var a,o=Math.exp(-Math.min(Math.max(i,-20),20)/100),s=mt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),l=(e.clientX-s.left)/s.width,u=pt[0]+pt[2]*l,f=(s.bottom-e.clientY)/s.height,h=pt[1]+pt[3]*(1-f);if(w){for(a=0;a=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function i(t,e,r){for(var i=1-e,a=0,o=0;o0;n--)r.push(e);return r}function i(t,e){for(var r=[],n=0;nj||j>D.width||0>F||F>D.height)return _.unhoverRaw(t,e)}else j="xpx"in e?e.xpx:p[0]._length/2,F="ypx"in e?e.ypx:v[0]._length/2;if(x="xval"in e?n(d,e.xval):i(p,j),A="yval"in e?n(d,e.yval):i(v,F),!g(x[0])||!g(A[0]))return console.log("Plotly.Fx.hover failed",e,t),_.unhoverRaw(t,e)}var B=1/0;for(T=0;T1||-1!==L.hoverinfo.indexOf("name")?L.name:void 0,index:!1,distance:Math.min(B,k.MAXDIST),color:b.defaultLine,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},O=I.length,"array"===C){var U=e[T];"pointNumber"in U?(R.index=U.pointNumber,C="closest"):(C="","xval"in U&&(z=U.xval,C="x"),"yval"in U&&(P=U.yval,C=C?"closest":"y"))}else z=x[S],P=A[S];if(L._module&&L._module.hoverPoints){var V=L._module.hoverPoints(R,z,P,C);if(V)for(var q,H=0;HO&&(I.splice(0,O),B=I[0].distance)}if(0===I.length)return _.unhoverRaw(t,e);var G="y"===y&&N.length>1;I.sort(function(t,e){return t.distance-e.distance});var Y=b.combine(a.plot_bgcolor||b.background,a.paper_bgcolor),X={hovermode:y,rotateLabels:G,bgColor:Y,container:a._hoverlayer,outerContainer:a._paperdiv},W=c(I,X);u(I,G?"xa":"ya"),f(W,G);var Z=t._hoverdata,K=[];for(M=0;M128?"#000":b.background;if(t.name&&void 0===t.zLabelVal){var u=document.createElement("p");u.innerHTML=t.name,r=u.textContent||"",r.length>15&&(r=r.substr(0,12)+"...")}void 0!==t.extraText&&(n+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(n+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(n+="y: "+t.yLabel+"
"),n+=(n?"z: ":"")+t.zLabel):M&&t[i+"Label"]===g?n=t[("x"===i?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(n=t.yLabel):n=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(n+=(n?"
":"")+t.text),""===n&&(""===r&&e.remove(),n=r);var f=e.select("text.nums").style("fill",c).call(x.setPosition,0,0).text(n).attr("data-notex",1).call(y.convertToTspans);f.selectAll("tspan.line").call(x.setPosition,0,0);var h=e.select("text.name"),v=0;r&&r!==n?(h.style("fill",l).text(r).call(x.setPosition,0,0).attr("data-notex",1).call(y.convertToTspans),h.selectAll("tspan.line").call(x.setPosition,0,0),v=h.node().getBoundingClientRect().width+2*P):(h.remove(),e.select("rect").remove()),e.select("path").style({fill:l,stroke:c});var m,k,E=f.node().getBoundingClientRect(),L=t.xa._offset+(t.x0+t.x1)/2,S=t.ya._offset+(t.y0+t.y1)/2,C=Math.abs(t.x1-t.x0),R=Math.abs(t.y1-t.y0),O=E.width+z+P+v;t.ty0=_-E.top,t.bx=E.width+2*P,t.by=E.height+2*P,t.anchor="start",t.txwidth=E.width,t.tx2width=v,t.offset=0,a?(t.pos=L,m=A>=S+R/2+O,k=S-R/2-O>=0,"top"!==t.idealAlign&&m||!k?m?(S+=R/2,t.anchor="start"):t.anchor="middle":(S-=R/2,t.anchor="end")):(t.pos=S,m=w>=L+C/2+O,k=L-C/2-O>=0,"left"!==t.idealAlign&&m||!k?m?(L+=C/2,t.anchor="start"):t.anchor="middle":(L-=C/2,t.anchor="end")),f.attr("text-anchor",t.anchor),v&&h.attr("text-anchor",t.anchor),e.attr("transform","translate("+L+","+S+")"+(a?"rotate("+T+")":""))}),S}function u(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(!(.01>a)){if(-.01>i){for(s=t.length-1;s>=0;s--)t[s].dp-=a;n=!1}if(n){var c=0;for(o=0;oe.pmax&&c++;for(o=t.length-1;o>=0&&!(0>=c);o--)l=t[o],l.pos>e.pmax-1&&(l.del=!0,c--);for(o=0;o=c);o++)if(l=t[o],l.pos=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(0>=c);o--)l=t[o],l.pos+l.dp+l.size>e.pmax&&(l.del=!0,c--)}}}for(var n,i,a,o,s,l,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)?L: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&&p.pmin===g.pmin&&p.pmax===g.pmax){for(s=d.length-1;s>=0;s--)d[s].dp+=i;for(h.push.apply(h,d),f.splice(o+1,1),c=0,s=h.length-1;s>=0;s--)c+=h[s].dp;for(a=c/h.length,s=h.length-1;s>=0;s--)h[s].dp-=a;n=!1}else o++}f.forEach(r)}for(o=f.length-1;o>=0;o--){var v=f[o];for(s=v.length-1;s>=0;s--){var m=v[s],y=t[m.i];y.offset=m.dp,y.del=m.del}}}function f(t,e){t.each(function(t){var r=d.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*(z+P),s=o+a*(t.txwidth+P),l=0,c=t.offset;"middle"===t.anchor&&(o-=t.tx2width/2,s-=t.tx2width/2),e&&(c*=-C,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*z+l)+","+(z+c)+"v"+(t.by/2-z)+"h"+n*t.bx+"v-"+t.by+"H"+(n*z+l)+"V"+(c-z)+"Z"),i.call(x.setPosition,o+l,c+t.ty0-t.by/2+P).selectAll("tspan.line").attr({x:i.attr("x"),y:i.attr("y")}),t.tx2width&&(r.select("text.name, text.name tspan.line").call(x.setPosition,s+a*P+l,c+t.ty0-t.by/2+P),r.select("rect").call(x.setRect,s+(a-1)*t.tx2width/2+l,c-t.by/2-1,t.tx2width,t.by+2))})}function h(t,e,r){if(!e.target)return!1;if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=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 d=t("d3"),p=t("tinycolor2"),g=t("fast-isnumeric"),v=t("../../lib"),m=t("../../lib/events"),y=t("../../lib/svg_text_utils"),b=t("../../components/color"),x=t("../../components/drawing"),_=t("../../components/dragelement"),w=t("./axes"),k=t("./constants"),A=t("./dragbox"),M=e.exports={};M.unhover=_.unhover,M.layoutAttributes={dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom"},hovermode:{valType:"enumerated",values:["x","y","closest",!1]}},M.supplyLayoutDefaults=function(t,e,r){function n(r,n){return v.coerce(t,e,M.layoutAttributes,r,n)}n("dragmode");var i;if(e._has("cartesian")){var a=e._isHoriz=M.isHoriz(r);i=a?"y":"x"}else i="closest";n("hovermode",i)},M.isHoriz=function(t){for(var e=!0,r=0;rt._lastHoverTime+k.HOVERMINTIME?(o(t,e,r),void(t._lastHoverTime=Date.now())):void(t._hoverTimer=setTimeout(function(){o(t,e,r),t._lastHoverTime=Date.now(),t._hoverTimer=void 0},k.HOVERMINTIME))},M.getDistanceFunction=function(t,e,r,n){return"closest"===t?n||a(e,r):"x"===t?e:r},M.getClosest=function(t,e,r){if(r.index!==!1)r.index>=0&&r.indext*e||0===t?k.MAXDIST*(.6-.3/Math.max(3,Math.abs(t-e))):1/0}},{"../../components/color":303,"../../components/dragelement":323,"../../components/drawing":325,"../../lib":381,"../../lib/events":375,"../../lib/svg_text_utils":393,"./axes":403,"./constants":408,"./dragbox":409,d3:113,"fast-isnumeric":117,tinycolor2:274}],411:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../plots"),a=t("./constants");r.name="cartesian",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex=a.idRegex,r.attrRegex=a.attrRegex,r.attributes=t("./attributes"),r.plot=function(t){function e(t,e){for(var r=[],n=0;nf[1]-.01&&(e.domain=[0,1]),i.noneOrAll(t.domain,e.domain,[0,1])}return e}},{"../../lib":381,"fast-isnumeric":117}],416:[function(t,e,r){"use strict";function n(t){return t._id}var i=t("../../lib/polygon"),a=t("../../components/color"),o=t("./axes"),s=t("./constants"),l=i.filter,c=i.tester,u=s.MINSELECT;e.exports=function(t,e,r,i,f){function h(t){var e="y"===t._id.charAt(0)?1:0;return function(r){return t.p2d(r[e])}}function d(t,e){return t-e}var p,g=i.gd._fullLayout._zoomlayer,v=i.element.getBoundingClientRect(),m=i.plotinfo.x()._offset,y=i.plotinfo.y()._offset,b=e-v.left,x=r-v.top,_=b,w=x,k="M"+b+","+x,A=i.xaxes[0]._length,M=i.yaxes[0]._length,T=i.xaxes.map(n),E=i.yaxes.map(n),L=i.xaxes.concat(i.yaxes);"lasso"===f&&(p=l([[b,x]],s.BENDPX));var S=g.selectAll("path.select-outline").data([1,2]);S.enter().append("path").attr("class",function(t){return"select-outline select-outline-"+t}).attr("transform","translate("+m+", "+y+")").attr("d",k+"Z");var C,z,P,R,O,I=g.append("path").attr("class","zoombox-corners").style({fill:a.background,stroke:a.defaultLine,"stroke-width":1}).attr("transform","translate("+m+", "+y+")").attr("d","M0,0Z"),N=[],j=i.gd,F=[];for(C=0;C0)return Math.log(e)/Math.LN10;if(0>=e&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-3*u*Math.abs(n-i))}return o.BADNUM}function r(t){return Math.pow(10,t)}function c(t){return i(t)?Number(t):o.BADNUM}var u=10;if(t.c2l="log"===t.type?e:c,t.l2c="log"===t.type?r:c,t.l2d=function(e){return t.c2d(t.l2c(e))},t.p2d=function(e){return t.l2d(t.p2l(e))},t.setScale=function(){var e,r=t._gd._fullLayout._size;if(t._categories||(t._categories=[]),t.overlaying){var n=l.getFromId(t._gd,t.overlaying);t.domain=n.domain}for(t.range&&2===t.range.length&&t.range[0]!==t.range[1]||(t.range=[-1,1]),e=0;2>e;e++)i(t.range[e])||(t.range[e]=i(t.range[1-e])?t.range[1-e]*(e?10:.1):e?1:-1),t.range[e]<-(Number.MAX_VALUE/2)?t.range[e]=-(Number.MAX_VALUE/2):t.range[e]>Number.MAX_VALUE/2&&(t.range[e]=Number.MAX_VALUE/2);if("y"===t._id.charAt(0)?(t._offset=r.t+(1-t.domain[1])*r.h,t._length=r.h*(t.domain[1]-t.domain[0]),t._m=t._length/(t.range[0]-t.range[1]),t._b=-t._m*t.range[1]):(t._offset=r.l+t.domain[0]*r.w,t._length=r.w*(t.domain[1]-t.domain[0]),t._m=t._length/(t.range[1]-t.range[0]),t._b=-t._m*t.range[0]),!isFinite(t._m)||!isFinite(t._b))throw a.notifier("Something went wrong with axis scaling","long"),t._gd._replotting=!1,new Error("axis scaling")},t.l2p=function(e){return i(e)?n.round(t._b+t._m*e,2):o.BADNUM},t.p2l=function(e){return(e-t._b)/t._m},t.c2p=function(e,r){return t.l2p(t.c2l(e,r))},t.p2c=function(e){return t.l2c(t.p2l(e))},-1!==["linear","log","-"].indexOf(t.type))t.c2d=c,t.d2c=function(t){return t=s(t),i(t)?Number(t):o.BADNUM},t.d2l=function(e,r){return"log"===t.type?t.c2l(t.d2c(e),r):t.d2c(e)};else if("date"===t.type){if(t.c2d=function(t){return i(t)?a.ms2DateTime(t):o.BADNUM},t.d2c=function(t){return i(t)?Number(t):a.dateTime2ms(t)},t.d2l=t.d2c,t.range&&t.range.length>1)try{var f=t.range.map(a.dateTime2ms);!i(t.range[0])&&i(f[0])&&(t.range[0]=f[0]),!i(t.range[1])&&i(f[1])&&(t.range[1]=f[1])}catch(h){console.log(h,t.range)}}else"category"===t.type&&(t.c2d=function(e){return t._categories[Math.round(e)]},t.d2c=function(e){null!==e&&void 0!==e&&-1===t._categories.indexOf(e)&&t._categories.push(e);var r=t._categories.indexOf(e);return-1===r?o.BADNUM:r},t.d2l=t.d2c);t.makeCalcdata=function(e,r){var n,i,a;if(r in e)for(n=e[r],i=new Array(n.length),a=0;an?"0":"1.0"}var r=this.framework,n=r.select("g.choroplethlayer"),i=r.select("g.scattergeolayer"),a=this.projection,o=this.path,s=this.clipAngle;r.selectAll("path.basepath").attr("d",o),r.selectAll("path.graticulepath").attr("d",o),n.selectAll("path.choroplethlocation").attr("d",o),n.selectAll("path.basepath").attr("d",o),i.selectAll("path.js-line").attr("d",o),null!==s?(i.selectAll("path.point").style("opacity",e).attr("transform",t),i.selectAll("text").style("opacity",e).attr("transform",t)):(i.selectAll("path.point").attr("transform",t),i.selectAll("text").attr("transform",t))}},{"../../components/color":303,"../../components/drawing":325,"../../constants/xmlns_namespaces":369,"../../lib/filter_visible":377,"../../lib/topojson_utils":394,"../../plots/cartesian/axes":403,"./constants":422,"./projections":430,"./set_scale":431,"./zoom":432,"./zoom_reset":433,d3:113,topojson:275}],424:[function(t,e,r){"use strict";var n=t("./geo"),i=t("../../plots/plots");r.name="geo",r.attr="geo",r.idRoot="geo",r.idRegex=/^geo([2-9]|[1-9][0-9]+)?$/,r.attrRegex=/^geo([2-9]|[1-9][0-9]+)?$/,r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){var e=t._fullLayout,r=t._fullData,a=i.getSubplotIds(e,"geo");void 0===window.PlotlyGeoAssets&&(window.PlotlyGeoAssets={topojson:{}});for(var o=0;o=n}function a(t,e){for(var r=e[0],n=e[1],i=!1,a=0,o=t.length,s=o-1;o>a;s=a++){var l=t[a],c=l[0],u=l[1],f=t[s],h=f[0],d=f[1];u>n^d>n&&(h-c)*(n-u)/(d-u)+c>r&&(i=!i)}return i}function o(t){return t?t/Math.sin(t):1}function s(t){return t>1?P:-1>t?-P:Math.asin(t)}function l(t){return t>1?0:-1>t?z:Math.acos(t)}function c(t,e){var r=(2+P)*Math.sin(e);e/=2;for(var n=0,i=1/0;10>n&&Math.abs(i)>S;n++){var a=Math.cos(e);e-=i=(e+Math.sin(e)*(a+2)-r)/(2*a*(1+a))}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 r(r,n){var i=j(r/e,n);return i[0]*=t,i}return arguments.length<2&&(e=t),1===e?j:e===1/0?h:(r.invert=function(r,n){var i=j.invert(r/t,n);return i[0]*=e,i},r)}function f(){var t=2,e=N(u),r=e(t);return r.coefficient=function(r){return arguments.length?e(t=+r):t},r}function h(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function d(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 r,n=t*Math.sin(e),i=30;do e-=r=(e+Math.sin(e)-n)/(1+Math.cos(e));while(Math.abs(r)>S&&--i>0);return e/2}}function v(t,e,r){function n(r,n){return[t*r*Math.cos(n=i(n)),e*Math.sin(n)]}var i=g(r);return n.invert=function(n,i){var a=s(i/e);return[n/(t*Math.cos(a)),s((2*a+Math.sin(2*a))/r)]},n}function m(t,e){var r=e*e,n=r*r;return[t*(.8707-.131979*r+n*(-.013791+n*(.003971*r-.001529*n))),e*(1.007226+r*(.015085+n*(-.044475+.028874*r-.005916*n)))]}function y(t,e){var r,n=Math.min(18,36*Math.abs(e)/z),i=Math.floor(n),a=n-i,o=(r=D[i])[0],s=r[1],l=(r=D[++i])[0],c=r[1],u=(r=D[Math.min(19,++i)])[0],f=r[1];return[t*(l+a*(u-o)/2+a*a*(u-2*l+o)/2),(e>0?P:-P)*(c+a*(f-s)/2+a*a*(f-2*c+s)/2)]}function b(t,e){return[t*Math.cos(e),e]}function x(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 _(t,e){var r=x(t,e);return[(r[0]+t/P)/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&&w.hasOwnProperty(t.type)?w[t.type]:r)(t,n)};var w={Feature:e,FeatureCollection:function(t,r){return{type:"FeatureCollection",features:t.features.map(function(t){return e(t,r)})}}},k=[],A=[],M={point:function(t,e){k.push([t,e])},result:function(){var t=k.length?k.length<2?{type:"Point",coordinates:k[0]}:{type:"MultiPoint",coordinates:k}:null;return k=[],t}},T={lineStart:n,point:function(t,e){k.push([t,e])},lineEnd:function(){k.length&&(A.push(k),k=[])},result:function(){var t=A.length?A.length<2?{type:"LineString",coordinates:A[0]}:{type:"MultiLineString",coordinates:A}:null;return A=[],t}},E={polygonStart:n,lineStart:n,point:function(t,e){k.push([t,e])},lineEnd:function(){var t=k.length;if(t){do k.push(k[0].slice());while(++t<4);A.push(k),k=[]}},polygonEnd:n,result:function(){if(!A.length)return null;var t=[],e=[];return A.forEach(function(r){i(r)?t.push([r]):e.push(r)}),e.forEach(function(e){var r=e[0];t.some(function(t){return a(t[0],r)?(t.push(e),!0):void 0})||t.push([e])}),A=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},L={Point:M,MultiPoint:M,LineString:T,MultiLineString:T,Polygon:E,MultiPolygon:E,Sphere:E},S=1e-6,C=S*S,z=Math.PI,P=z/2,R=(Math.sqrt(z),z/180),O=180/z,I=t.geo.projection,N=t.geo.projectionMutator;t.geo.interrupt=function(e){function r(t,r){for(var n=0>r?-1:1,i=l[+(0>r)],a=0,o=i.length-1;o>a&&t>i[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;i>n;++n){var o=l[0][n],s=180*o[0][0]/z,c=180*o[0][1]/z,u=180*o[1][1]/z,f=180*o[2][0]/z,h=180*o[2][1]/z;r.push(a([[s+e,c+e],[s+e,u-e],[f-e,u-e],[f-e,h+e]],30))}for(var n=l[1].length-1;n>=0;--n){var o=l[1][n],s=180*o[0][0]/z,c=180*o[0][1]/z,u=180*o[1][1]/z,f=180*o[2][0]/z,h=180*o[2][1]/z;r.push(a([[f-e,h-e],[f-e,u+e],[s+e,u+e],[s+e,c-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=[];++ac;++c)l.push([s[0]+c*n,s[1]+c*i]);s=r}return l.push(r),l}function o(t,e){return Math.abs(t[0]-e[0])n)],a=l[+(0>n)],c=0,u=i.length;u>c;++c){var f=i[c];if(f[0][0]<=t&&tS&&--i>0);return[t/(.8707+(a=n*n)*(-.131979+a*(-.013791+a*a*a*(.003971-.001529*a)))),n]},(t.geo.naturalEarth=function(){return I(m)}).raw=m;var D=[[.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]];D.forEach(function(t){t[1]*=1.0144}),y.invert=function(t,e){var r=e/P,n=90*r,i=Math.min(18,Math.abs(n/5)),a=Math.max(0,Math.floor(i));do{var o=D[a][1],s=D[a+1][1],l=D[Math.min(19,a+2)][1],c=l-o,u=l-2*s+o,f=2*(Math.abs(r)-s)/c,h=u/c,d=f*(1-h*f*(1-2*h*f));if(d>=0||1===a){n=(e>=0?5:-5)*(d+i);var p,g=50;do i=Math.min(18,Math.abs(n)/5),a=Math.floor(i),d=i-a,o=D[a][1],s=D[a+1][1],l=D[Math.min(19,a+2)][1],n-=(p=(e>=0?P:-P)*(s+d*(l-o)/2+d*d*(l-2*s+o)/2)-e)*O;while(Math.abs(p)>C&&--g>0); +break}}while(--a>=0);var v=D[a][0],m=D[a+1][0],y=D[Math.min(19,a+2)][0];return[t/(m+d*(y-v)/2+d*d*(y-2*m+v)/2),n*R]},(t.geo.robinson=function(){return I(y)}).raw=y,b.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return I(b)}).raw=b,x.invert=function(t,e){if(!(t*t+4*e*e>z*z+S)){var r=t,n=e,i=25;do{var a,o=Math.sin(r),s=Math.sin(r/2),c=Math.cos(r/2),u=Math.sin(n),f=Math.cos(n),h=Math.sin(2*n),d=u*u,p=f*f,g=s*s,v=1-p*c*c,m=v?l(f*c)*Math.sqrt(a=1/v):a=0,y=2*m*f*s-t,b=m*u-e,x=a*(p*g+m*f*c*d),_=a*(.5*o*h-2*m*u*s),w=.25*a*(h*s-m*u*p*o),k=a*(d*c+m*g*f),A=_*w-k*x;if(!A)break;var M=(b*_-y*k)/A,T=(y*w-b*x)/A;r-=M,n-=T}while((Math.abs(M)>S||Math.abs(T)>S)&&--i>0);return[r,n]}},(t.geo.aitoff=function(){return I(x)}).raw=x,_.invert=function(t,e){var r=t,n=e,i=25;do{var a,o=Math.cos(n),s=Math.sin(n),c=Math.sin(2*n),u=s*s,f=o*o,h=Math.sin(r),d=Math.cos(r/2),p=Math.sin(r/2),g=p*p,v=1-f*d*d,m=v?l(o*d)*Math.sqrt(a=1/v):a=0,y=.5*(2*m*o*p+r/P)-t,b=.5*(m*s+n)-e,x=.5*a*(f*g+m*o*d*u)+.5/P,_=a*(h*c/4-m*s*p),w=.125*a*(c*p-m*s*f*h),k=.5*a*(u*d+m*g*o)+.5,A=_*w-k*x,M=(b*_-y*k)/A,T=(y*w-b*x)/A;r-=M,n-=T}while((Math.abs(M)>S||Math.abs(T)>S)&&--i>0);return[r,n]},(t.geo.winkel3=function(){return I(_)}).raw=_}e.exports=n},{}],431:[function(t,e,r){"use strict";function n(t,e){var r=t.projection,n=t.lonaxis,o=t.lataxis,l=t.domain,c=t.framewidth||0,u=e.w*(l.x[1]-l.x[0]),f=e.h*(l.y[1]-l.y[0]),h=n.range[0]+s,d=n.range[1]-s,p=o.range[0]+s,g=o.range[1]-s,v=n._fullRange[0]+s,m=n._fullRange[1]-s,y=o._fullRange[0]+s,b=o._fullRange[1]-s;r._translate0=[e.l+u/2,e.t+f/2];var x=d-h,_=g-p,w=[h+x/2,p+_/2],k=r._rotate;r._center=[w[0]+k[0],w[1]+k[1]];var A=function(e){function n(t){return Math.min(_*u/(t[1][0]-t[0][0]),_*f/(t[1][1]-t[0][1]))}var o,s,l,x,_=e.scale(),w=r._translate0,k=i(h,p,d,g),A=i(v,y,m,b);l=a(e,k),o=n(l),x=a(e,A),r._fullScale=n(x),e.scale(o),l=a(e,k),s=[w[0]-l[0][0]+c,w[1]-l[0][1]+c],r._translate=s,e.translate(s),l=a(e,k),t._isAlbersUsa||e.clipExtent(l),o=r.scale*o,r._scale=o,t._width=Math.round(l[1][0])+c,t._height=Math.round(l[1][1])+c,t._marginX=(u-Math.round(l[1][0]))/2,t._marginY=(f-Math.round(l[1][1]))/2};return A}function i(t,e,r,n){var i=(r-t)/4;return{type:"Polygon",coordinates:[[[t,e],[t,n],[t+i,n],[t+2*i,n],[t+3*i,n],[r,n],[r,e],[r-i,e],[r-2*i,e],[r-3*i,e],[t,e]]]}}function a(t,e){return o.geo.path().projection(t).bounds(e)}var o=t("d3"),s=t("./constants/").clipPad;e.exports=n},{"./constants/":422,d3:113}],432:[function(t,e,r){"use strict";function n(t,e){var r;return(r=e._isScoped?a:e._clipAngle?s:o)(t,e.projection)}function i(t,e){var r=e._fullScale;return _.behavior.zoom().translate(t.translate()).scale(t.scale()).scaleExtent([.5*r,100*r])}function a(t,e){function r(){_.select(this).style(A)}function n(){o.scale(_.event.scale).translate(_.event.translate),t.render()}function a(){_.select(this).style(M)}var o=t.projection,s=i(o,e);return s.on("zoomstart",r).on("zoom",n).on("zoomend",a),s}function o(t,e){function r(t){return v.invert(t)}function n(t){var e=v(r(t));return Math.abs(e[0]-t[0])>y||Math.abs(e[1]-t[1])>y}function a(){_.select(this).style(A),l=_.mouse(this),c=v.rotate(),u=v.translate(),f=c,h=r(l)}function o(){return d=_.mouse(this),n(l)?(m.scale(v.scale()),void m.translate(v.translate())):(v.scale(_.event.scale),v.translate([u[0],_.event.translate[1]]),h?r(d)&&(g=r(d),p=[f[0]+(g[0]-h[0]),c[1],c[2]],v.rotate(p),f=p):(l=d,h=r(l)),void t.render())}function s(){_.select(this).style(M)}var l,c,u,f,h,d,p,g,v=t.projection,m=i(v,e),y=2;return m.on("zoomstart",a).on("zoom",o).on("zoomend",s),m}function s(t,e){function r(t){m++||t({type:"zoomstart"})}function n(t){t({type:"zoom"})}function a(t){--m||t({type:"zoomend"})}var o,s=t.projection,d={r:s.rotate(),k:s.scale()},p=i(s,e),g=x(p,"zoomstart","zoom","zoomend"),m=0,y=p.on;return p.on("zoomstart",function(){_.select(this).style(A);var t=_.mouse(this),e=s.rotate(),i=e,a=s.translate(),m=c(e);o=l(s,t),y.call(p,"zoom",function(){var r=_.mouse(this);if(s.scale(d.k=_.event.scale),o){if(l(s,r)){s.rotate(e).translate(a);var c=l(s,r),p=f(o,c),y=v(u(m,p)),b=d.r=h(y,o,i);isFinite(b[0])&&isFinite(b[1])&&isFinite(b[2])||(b=i),s.rotate(b),i=b}}else t=r,o=l(s,t);n(g.of(this,arguments))}),r(g.of(this,arguments))}).on("zoomend",function(){_.select(this).style(M),y.call(p,"zoom",null),a(g.of(this,arguments))}).on("zoom.redraw",function(){t.render()}),_.rebind(p,g,"on")}function l(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&m(r)}function c(t){var e=.5*t[0]*w,r=.5*t[1]*w,n=.5*t[2]*w,i=Math.sin(e),a=Math.cos(e),o=Math.sin(r),s=Math.cos(r),l=Math.sin(n),c=Math.cos(n);return[a*s*c+i*o*l,i*s*c-a*o*l,a*o*c+i*s*l,a*s*l-i*o*c]}function u(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=e[0],s=e[1],l=e[2],c=e[3];return[r*o-n*s-i*l-a*c,r*s+n*o+i*c-a*l,r*l-n*c+i*o+a*s,r*c+n*l-i*s+a*o]}function f(t,e){if(t&&e){var r=b(t,e),n=Math.sqrt(y(r,r)),i=.5*Math.acos(Math.max(-1,Math.min(1,y(t,e)))),a=Math.sin(i)/n;return n&&[Math.cos(i),r[2]*a,-r[1]*a,r[0]*a]}}function h(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],c=n[0],u=n[1],f=n[2],h=Math.atan2(s,o)*k,p=Math.sqrt(o*o+s*s);Math.abs(u)>p?(a=(u>0?90:-90)-h,i=0):(a=Math.asin(u/p)*k-h,i=Math.sqrt(p*p-u*u));var v=180-a-2*h,m=(Math.atan2(f,c)-Math.atan2(l,i))*k,y=(Math.atan2(f,c)-Math.atan2(l,-i))*k,b=d(r[0],r[1],a,m),x=d(r[0],r[1],v,y);return x>=b?[a,m,r[2]]:[v,y,r[2]]}function d(t,e,r,n){var i=p(r-t),a=p(n-e);return Math.sqrt(i*i+a*a)}function p(t){return(t%360+540)%360-180}function g(t,e,r){var n=r*w,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]))*k,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*k,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*k]}function m(t){var e=t[0]*w,r=t[1]*w,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function y(t,e){for(var r=0,n=0,i=t.length;i>n;++n)r+=t[n]*e[n];return r}function b(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function x(t){for(var e=0,r=arguments.length,n=[];++ed;++d){for(e=c[d],r=t[this.scene[e]._name],n=/Click to enter .+ title/.test(r.title)?"":r.title,p=0;2>=p;p+=2)this.labelEnable[d+p]=!1,this.labels[d+p]=o(n),this.labelColor[d+p]=s(r.titlefont.color),this.labelFont[d+p]=r.titlefont.family,this.labelSize[d+p]=r.titlefont.size,this.labelPad[d+p]=this.getLabelPad(e,r),this.tickEnable[d+p]=!1,this.tickColor[d+p]=s((r.tickfont||{}).color),this.tickAngle[d+p]="auto"===r.tickangle?0:Math.PI*-r.tickangle/180,this.tickPad[d+p]=this.getTickPad(r),this.tickMarkLength[d+p]=0,this.tickMarkWidth[d+p]=r.tickwidth||0,this.tickMarkColor[d+p]=s(r.tickcolor),this.borderLineEnable[d+p]=!1,this.borderLineColor[d+p]=s(r.linecolor),this.borderLineWidth[d+p]=r.linewidth||0;u=this.hasSharedAxis(r),a=this.hasAxisInDfltPos(e,r)&&!u,l=this.hasAxisInAltrPos(e,r)&&!u,i=r.mirror||!1,f=u?-1!==String(i).indexOf("all"):!!i,h=u?"allticks"===i:-1!==String(i).indexOf("ticks"),a?this.labelEnable[d]=!0:l&&(this.labelEnable[d+2]=!0),a?this.tickEnable[d]=r.showticklabels:l&&(this.tickEnable[d+2]=r.showticklabels),(a||f)&&(this.borderLineEnable[d]=r.showline),(l||f)&&(this.borderLineEnable[d+2]=r.showline),(a||h)&&(this.tickMarkLength[d]=this.getTickMarkLength(r)),(l||h)&&(this.tickMarkLength[d+2]=this.getTickMarkLength(r)),this.gridLineEnable[d]=r.showgrid,this.gridLineColor[d]=s(r.gridcolor),this.gridLineWidth[d]=r.gridwidth,this.zeroLineEnable[d]=r.zeroline,this.zeroLineColor[d]=s(r.zerolinecolor),this.zeroLineWidth[d]=r.zerolinewidth}},l.hasSharedAxis=function(t){var e=this.scene,r=a.Plots.getSubplotIds(e.fullLayout,"gl2d"),n=a.Axes.findSubplotsWithAxis(r,t);return 0!==n.indexOf(e.id)},l.hasAxisInDfltPos=function(t,e){var r=e.side;return"xaxis"===t?"bottom"===r:"yaxis"===t?"left"===r:void 0},l.hasAxisInAltrPos=function(t,e){var r=e.side;return"xaxis"===t?"top"===r:"yaxis"===t?"right"===r:void 0},l.getLabelPad=function(t,e){var r=1.5,n=e.titlefont.size,i=e.showticklabels;return"xaxis"===t?"top"===e.side?-10+n*(r+(i?1:0)):-10+n*(r+(i?.5:0)):"yaxis"===t?"right"===e.side?10+n*(r+(i?1:.5)):10+n*(r+(i?.5:0)):void 0},l.getTickPad=function(t){return"outside"===t.ticks?10+t.ticklen:15},l.getTickMarkLength=function(t){if(!t.ticks)return 0;var e=t.ticklen;return"inside"===t.ticks?-e:e},e.exports=i},{"../../lib/html2unicode":380,"../../lib/str2rgbarray":392,"../../plotly":400}],436:[function(t,e,r){"use strict";var n=t("./scene2d"),i=t("../plots"),a=t("../../constants/xmlns_namespaces");r.name="gl2d",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex={x:/^x([2-9]|[1-9][0-9]+)?$/,y:/^y([2-9]|[1-9][0-9]+)?$/},r.attrRegex={x:/^xaxis([2-9]|[1-9][0-9]+)?$/,y:/^yaxis([2-9]|[1-9][0-9]+)?$/},r.attributes=t("../cartesian/attributes"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,a=i.getSubplotIds(e,"gl2d"),o=0;or;++r){var n=t[r],i=e[r];if(n.length!==i.length)return!0;for(var a=0;ao;++o,--s)for(var l=0;r>l;++l)for(var c=0;4>c;++c){var u=i[4*(r*o+l)+c];i[4*(r*o+l)+c]=i[4*(r*s+l)+c],i[4*(r*s+l)+c]=u}var f=document.createElement("canvas");f.width=r,f.height=n;var h=f.getContext("2d"),d=h.createImageData(r,n);d.data.set(i),h.putImageData(d,0,0);var p;switch(t){case"jpeg":p=f.toDataURL("image/jpeg");break;case"webp":p=f.toDataURL("image/webp");break;default:p=f.toDataURL("image/png")}return this.staticPlot&&this.container.removeChild(a),p},m.computeTickMarks=function(){this.xaxis._length=this.glplot.viewBox[2]-this.glplot.viewBox[0],this.yaxis._length=this.glplot.viewBox[3]-this.glplot.viewBox[1];for(var t=[s.calcTicks(this.xaxis),s.calcTicks(this.yaxis)],e=0;2>e;++e)for(var r=0;rk;++k)w[k]=Math.min(w[k],a.bounds[k]),w[k+2]=Math.max(w[k+2],a.bounds[k+2])}var A;for(n=0;2>n;++n)w[n]>w[n+2]&&(w[n]=-1,w[n+2]=1),A=this[v[n]],A._length=y.viewBox[n+2]-y.viewBox[n],s.doAutoRange(A);y.ticks=this.computeTickMarks();var M=this.xaxis.range,T=this.yaxis.range;y.dataBox=[M[0],T[0],M[1],T[1]],y.merge(r),o.update(y),this.glplot.draw()},m.draw=function(){if(!this.stopped){requestAnimationFrame(this.redraw);var t=this.glplot,e=this.camera,r=e.mouseListener,n=this.fullLayout;this.cameraChanged();var i=r.x*t.pixelRatio,a=this.canvas.height-t.pixelRatio*r.y;if(e.boxEnabled&&"zoom"===n.dragmode)this.selectBox.enabled=!0,this.selectBox.selectBox=[Math.min(e.boxStart[0],e.boxEnd[0]),Math.min(e.boxStart[1],e.boxEnd[1]),Math.max(e.boxStart[0],e.boxEnd[0]),Math.max(e.boxStart[1],e.boxEnd[1])],t.setDirty();else{this.selectBox.enabled=!1;var o=n._size,s=this.xaxis.domain,c=this.yaxis.domain,u=t.pick(i/t.pixelRatio+o.l+s[0]*o.w,a/t.pixelRatio-(o.t+(1-c[1])*o.h));if(u&&n.hovermode){var f=u.object._trace.handlePick(u);if(f&&(!this.lastPickResult||this.lastPickResult.trace!==f.trace||this.lastPickResult.dataCoord[0]!==f.dataCoord[0]||this.lastPickResult.dataCoord[1]!==f.dataCoord[1])){var h=this.lastPickResult=f;this.spikes.update({center:u.dataCoord}),h.screenCoord=[((t.viewBox[2]-t.viewBox[0])*(u.dataCoord[0]-t.dataBox[0])/(t.dataBox[2]-t.dataBox[0])+t.viewBox[0])/t.pixelRatio,(this.canvas.height-(t.viewBox[3]-t.viewBox[1])*(u.dataCoord[1]-t.dataBox[1])/(t.dataBox[3]-t.dataBox[1])-t.viewBox[1])/t.pixelRatio];var d=h.hoverinfo;if("all"!==d){var p=d.split("+");-1===p.indexOf("x")&&(h.traceCoord[0]=void 0),-1===p.indexOf("y")&&(h.traceCoord[1]=void 0),-1===p.indexOf("z")&&(h.traceCoord[2]=void 0),-1===p.indexOf("text")&&(h.textLabel=void 0),-1===p.indexOf("name")&&(h.name=void 0)}l.loneHover({x:h.screenCoord[0],y:h.screenCoord[1],xLabel:this.hoverFormatter("xaxis",h.traceCoord[0]),yLabel:this.hoverFormatter("yaxis",h.traceCoord[1]),zLabel:h.traceCoord[2],text:h.textLabel,name:h.name,color:h.color},{container:this.svgContainer}),this.lastPickResult={dataCoord:u.dataCoord}}}else!u&&this.lastPickResult&&(this.spikes.update({}),this.lastPickResult=null,l.loneUnhover(this.svgContainer))}t.draw()}},m.hoverFormatter=function(t,e){if(void 0!==e){var r=this[t];return s.tickText(r,r.c2l(e),"hover").text}}},{"../../lib/html2unicode":380,"../../lib/show_no_webgl_msg":390,"../../plots/cartesian/axes":403,"../../plots/cartesian/graph_interact":410,"./camera":434,"./convert":435,"gl-plot2d":165,"gl-select-box":195,"gl-spikes2d":215}],438:[function(t,e,r){"use strict";function n(t,e){t=t||document.body,e=e||{};var r=[.01,1/0];"distanceLimits"in e&&(r[0]=e.distanceLimits[0],r[1]=e.distanceLimits[1]),"zoomMin"in e&&(r[0]=e.zoomMin),"zoomMax"in e&&(r[1]=e.zoomMax);var n=a({center:e.center||[0,0,0],up:e.up||[0,1,0],eye:e.eye||[0,0,10],mode:e.mode||"orbit",distanceLimits:r}),l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],c=0,u=t.clientWidth,f=t.clientHeight,h={keyBindingMode:"rotate",view:n,element:t,delay:e.delay||16,rotateSpeed:e.rotateSpeed||1,zoomSpeed:e.zoomSpeed||1,translateSpeed:e.translateSpeed||1,flipX:!!e.flipX,flipY:!!e.flipY,modes:n.modes,tick:function(){var e=i(),r=this.delay,a=e-2*r;n.idle(e-r),n.recalcMatrix(a),n.flush(e-(100+2*r));for(var o=!0,s=n.computedMatrix,h=0;16>h;++h)o=o&&l[h]===s[h],l[h]=s[h];var d=t.clientWidth===u&&t.clientHeight===f;return u=t.clientWidth,f=t.clientHeight,o?!d:(c=Math.exp(n.computedRadius[0]),!0)},lookAt:function(t,e,r){n.lookAt(n.lastT(),t,e,r)},rotate:function(t,e,r){n.rotate(n.lastT(),t,e,r)},pan:function(t,e,r){n.pan(n.lastT(),t,e,r)},translate:function(t,e,r){n.translate(n.lastT(),t,e,r)}};Object.defineProperties(h,{matrix:{get:function(){return n.computedMatrix},set:function(t){return n.setMatrix(n.lastT(),t),n.computedMatrix},enumerable:!0},mode:{get:function(){return n.getMode()},set:function(t){var e=n.computedUp.slice(),r=n.computedEye.slice(),a=n.computedCenter.slice();if(n.setMode(t),"turntable"===t){var o=i();n._active.lookAt(o,r,a,e),n._active.lookAt(o+500,r,a,[0,0,1]),n._active.flush(o)}return n.getMode()},enumerable:!0},center:{get:function(){return n.computedCenter},set:function(t){return n.lookAt(n.lastT(),null,t),n.computedCenter},enumerable:!0},eye:{get:function(){return n.computedEye},set:function(t){return n.lookAt(n.lastT(),t),n.computedEye},enumerable:!0},up:{get:function(){return n.computedUp},set:function(t){return n.lookAt(n.lastT(),null,null,t),n.computedUp},enumerable:!0},distance:{get:function(){return c},set:function(t){return n.setDistance(n.lastT(),t),t},enumerable:!0},distanceLimits:{get:function(){return n.getDistanceLimits(r)},set:function(t){return n.setDistanceLimits(t),t},enumerable:!0}}),t.addEventListener("contextmenu",function(t){return t.preventDefault(),!1});var d=0,p=0;return o(t,function(e,r,a,o){var s="rotate"===h.keyBindingMode,l="pan"===h.keyBindingMode,u="zoom"===h.keyBindingMode,f=!!o.control,g=!!o.alt,v=!!o.shift,m=!!(1&e),y=!!(2&e),b=!!(4&e),x=1/t.clientHeight,_=x*(r-d),w=x*(a-p),k=h.flipX?1:-1,A=h.flipY?1:-1,M=i(),T=Math.PI*h.rotateSpeed;if((s&&m&&!f&&!g&&!v||m&&!f&&!g&&v)&&n.rotate(M,k*T*_,-A*T*w,0),(l&&m&&!f&&!g&&!v||y||m&&f&&!g&&!v)&&n.pan(M,-h.translateSpeed*_*c,h.translateSpeed*w*c,0),u&&m&&!f&&!g&&!v||b||m&&!f&&g&&!v){var E=-h.zoomSpeed*w/window.innerHeight*(M-n.lastT())*100;n.pan(M,0,0,c*(Math.exp(E)-1))}return d=r,p=a,!0}),s(t,function(t,e){var r=h.flipX?1:-1,a=h.flipY?1:-1,o=i();if(Math.abs(t)>Math.abs(e))n.rotate(o,0,0,-t*r*Math.PI*h.rotateSpeed/window.innerWidth);else{var s=-h.zoomSpeed*a*e/window.innerHeight*(o-n.lastT())/100;n.pan(o,0,0,c*(Math.exp(s)-1))}},!0),h}e.exports=n;var i=t("right-now"),a=t("3d-view"),o=t("mouse-change"),s=t("mouse-wheel")},{"3d-view":39,"mouse-change":241,"mouse-wheel":245,"right-now":255}],439:[function(t,e,r){"use strict";function n(t,e){for(var r=0;3>r;++r){var n=s[r];e[n]._gd=t}}var i=t("./scene"),a=t("../plots"),o=t("../../constants/xmlns_namespaces"),s=["xaxis","yaxis","zaxis"];r.name="gl3d",r.attr="scene",r.idRoot="scene",r.idRegex=/^scene([2-9]|[1-9][0-9]+)?$/,r.attrRegex=/^scene([2-9]|[1-9][0-9]+)?$/,r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){var e=t._fullLayout,r=t._fullData,o=a.getSubplotIds(e,"gl3d");e._paperdiv.style({width:e.width+"px",height:e.height+"px"}),t._context.setBackground(t,e.paper_bgcolor);for(var s=0;sr;++r){var n=t[c[r]];e.labels[r]=o(n.title),"titlefont"in n&&(n.titlefont.color&&(e.labelColor[r]=s(n.titlefont.color)),n.titlefont.family&&(e.labelFont[r]=n.titlefont.family),n.titlefont.size&&(e.labelSize[r]=n.titlefont.size)),"showline"in n&&(e.lineEnable[r]=n.showline),"linecolor"in n&&(e.lineColor[r]=s(n.linecolor)),"linewidth"in n&&(e.lineWidth[r]=n.linewidth),"showgrid"in n&&(e.gridEnable[r]=n.showgrid),"gridcolor"in n&&(e.gridColor[r]=s(n.gridcolor)),"gridwidth"in n&&(e.gridWidth[r]=n.gridwidth),"log"===n.type?e.zeroEnable[r]=!1:"zeroline"in n&&(e.zeroEnable[r]=n.zeroline),"zerolinecolor"in n&&(e.zeroLineColor[r]=s(n.zerolinecolor)),"zerolinewidth"in n&&(e.zeroLineWidth[r]=n.zerolinewidth),"ticks"in n&&n.ticks?e.lineTickEnable[r]=!0:e.lineTickEnable[r]=!1,"ticklen"in n&&(e.lineTickLength[r]=e._defaultLineTickLength[r]=n.ticklen),"tickcolor"in n&&(e.lineTickColor[r]=s(n.tickcolor)),"tickwidth"in n&&(e.lineTickWidth[r]=n.tickwidth),"tickangle"in n&&(e.tickAngle[r]="auto"===n.tickangle?0:Math.PI*-n.tickangle/180),"showticklabels"in n&&(e.tickEnable[r]=n.showticklabels),"tickfont"in n&&(n.tickfont.color&&(e.tickColor[r]=s(n.tickfont.color)),n.tickfont.family&&(e.tickFont[r]=n.tickfont.family),n.tickfont.size&&(e.tickSize[r]=n.tickfont.size)),"mirror"in n?-1!==["ticks","all","allticks"].indexOf(n.mirror)?(e.lineTickMirror[r]=!0,e.lineMirror[r]=!0):n.mirror===!0?(e.lineTickMirror[r]=!1,e.lineMirror[r]=!0):(e.lineTickMirror[r]=!1,e.lineMirror[r]=!1):e.lineMirror[r]=!1,"showbackground"in n&&n.showbackground!==!1?(e.backgroundEnable[r]=!0, +e.backgroundColor[r]=s(n.backgroundcolor)):e.backgroundEnable[r]=!1}},e.exports=i},{"../../../lib/html2unicode":380,"../../../lib/str2rgbarray":392,arraytools:49}],444:[function(t,e,r){"use strict";function n(t,e,r,n){for(var a=r("bgcolor"),l=i.combine(a,n.paper_bgcolor),c=Object.keys(o.camera),u=0;ue;++e){var r=t[o[e]];this.enabled[e]=r.showspikes,this.colors[e]=a(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness}},e.exports=i},{"../../../lib/str2rgbarray":392}],447:[function(t,e,r){"use strict";function n(t){for(var e=new Array(3),r=0;3>r;++r){for(var n=t[r],i=new Array(n.length),a=0;au;++u){var f=i[s[u]];if(f._length=(r[u].hi-r[u].lo)*r[u].pixelsPerDataUnit/t.dataScale[u],Math.abs(f._length)===1/0)c[u]=[];else{f.range[0]=r[u].lo/t.dataScale[u],f.range[1]=r[u].hi/t.dataScale[u],f._m=1/(t.dataScale[u]*r[u].pixelsPerDataUnit),f.range[0]===f.range[1]&&(f.range[0]-=1,f.range[1]+=1);var h=f.tickmode;if("auto"===f.tickmode){f.tickmode="linear";var d=f.nticks||a.Lib.constrain(f._length/40,4,9);a.Axes.autoTicks(f,Math.abs(f.range[1]-f.range[0])/d)}for(var p=a.Axes.calcTicks(f),g=0;gu;++u){l[u]=.5*(t.glplot.bounds[0][u]+t.glplot.bounds[1][u]);for(var g=0;2>g;++g)e.bounds[g][u]=t.glplot.bounds[g][u]}t.contourLevels=n(c)}e.exports=i;var a=t("../../../plotly"),o=t("../../../lib/html2unicode"),s=["xaxis","yaxis","zaxis"],l=[0,0,0]},{"../../../lib/html2unicode":380,"../../../plotly":400}],448:[function(t,e,r){"use strict";function n(t,e){var r,n,i=[0,0,0,0];for(r=0;4>r;++r)for(n=0;4>n;++n)i[n]+=t[4*r+n]*e[r];return i}function i(t,e){var r=n(t.projection,n(t.view,n(t.model,[e[0],e[1],e[2],1])));return r}e.exports=i},{}],449:[function(t,e,r){"use strict";function n(t){function e(e,r){if("string"==typeof r)return r;var n=t.fullSceneLayout[e];return g.tickText(n,n.c2l(r),"hover").text}var r,n=t.svgContainer,i=t.container.getBoundingClientRect(),a=i.width,o=i.height;n.setAttributeNS(null,"viewBox","0 0 "+a+" "+o),n.setAttributeNS(null,"width",a),n.setAttributeNS(null,"height",o),A(t),t.glplot.axes.update(t.axesOptions);for(var s=Object.keys(t.traces),l=null,c=t.glplot.selection,u=0;ua;++a)l=u[T[a]],_(l);t?Array.isArray(t)||(t=[t]):t=[];var h=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]];for(a=0;ao;++o)h[0][o]>h[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,a=0;aa;++a){if(l=u[T[a]],c=l.type,c in x?(x[c].acc*=d[a],x[c].count+=1):x[c]={acc:d[a],count:1},l.autorange){for(y[0][a]=1/0,y[1][a]=-(1/0),o=0;oy[1][a])y[0][a]=-1,y[1][a]=1;else{var k=y[1][a]-y[0][a];y[0][a]-=k/32,y[1][a]+=k/32}}else{var A=u[T[a]].range;y[0][a]=A[0],y[1][a]=A[1]}y[0][a]===y[1][a]&&(y[0][a]-=1,y[1][a]+=1),b[a]=y[1][a]-y[0][a],this.glplot.bounds[0][a]=y[0][a]*d[a],this.glplot.bounds[1][a]=y[1][a]*d[a]}var M=[1,1,1];for(a=0;3>a;++a){l=u[T[a]],c=l.type;var E=x[c];M[a]=Math.pow(E.acc,1/E.count)/d[a]}var L,S=4;if("auto"===u.aspectmode)L=Math.max.apply(null,M)/Math.min.apply(null,M)<=S?M:[1,1,1];else if("cube"===u.aspectmode)L=[1,1,1];else if("data"===u.aspectmode)L=M;else{if("manual"!==u.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var C=u.aspectratio;L=[C.x,C.y,C.z]}u.aspectratio.x=f.aspectratio.x=L[0],u.aspectratio.y=f.aspectratio.y=L[1],u.aspectratio.z=f.aspectratio.z=L[2],this.glplot.aspect=L;var z=u.domain||null,P=e._size||null;if(z&&P){var R=this.container.style;R.position="absolute",R.left=P.l+z.x[0]*P.w+"px",R.top=P.t+(1-z.y[1])*P.h+"px",R.width=P.w*(z.x[1]-z.x[0])+"px",R.height=P.h*(z.y[1]-z.y[0])+"px"}this.glplot.redraw()}},M.destroy=function(){this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null},M.setCameraToDefault=function(){this.setCamera({eye:{x:1.25,y:1.25,z:1.25},center:{x:0,y:0,z:0},up:{x:0,y:0,z:1}})},M.getCamera=function(){return this.glplot.camera.view.recalcMatrix(this.camera.view.lastT()),c(this.glplot.camera)},M.setCamera=function(t){var e={};e[this.id]=t,this.glplot.camera.lookAt.apply(this,l(t)),this.graphDiv.emit("plotly_relayout",e)},M.saveCamera=function(t){function e(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]]}var r=this.getCamera(),n=d.nestedProperty(t,this.id+".camera"),i=n.get(),a=!1;if(void 0===i)a=!0;else for(var o=0;3>o;o++)for(var s=0;3>s;s++)if(!e(r,i,o,s)){a=!0;break}return a&&n.set(r),a},M.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},M.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(u),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;o>a;++a,--o)for(var s=0;r>s;++s)for(var l=0;4>l;++l){var c=i[4*(r*a+s)+l];i[4*(r*a+s)+l]=i[4*(r*o+s)+l],i[4*(r*o+s)+l]=c}var f=document.createElement("canvas");f.width=r,f.height=n;var h=f.getContext("2d"),d=h.createImageData(r,n);d.data.set(i),h.putImageData(d,0,0);var p;switch(t){case"jpeg":p=f.toDataURL("image/jpeg");break;case"webp":p=f.toDataURL("image/webp");break;default:p=f.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(u),p},e.exports=a},{"../../lib":381,"../../lib/show_no_webgl_msg":390,"../../lib/str2rgbarray":392,"../../plots/cartesian/axes":403,"../../plots/cartesian/graph_interact":410,"../../plots/plots":452,"./camera":438,"./layout/convert":443,"./layout/spikes":446,"./layout/tick_marks":447,"./project":448,"./set_convert":450,"gl-plot3d":183}],450:[function(t,e,r){"use strict";var n=t("../cartesian/axes"),i=function(){};e.exports=function(t){n.setConvert(t),t.setScale=i}},{"../cartesian/axes":403}],451:[function(t,e,r){"use strict";var n=t("../plotly"),i=t("./font_attributes"),a=t("../components/color/attributes"),o=n.Lib.extendFlat;e.exports={font:{family:o({},i.family,{dflt:'"Open Sans", verdana, arial, sans-serif'}),size:o({},i.size,{dflt:12}),color:o({},i.color,{dflt:a.defaultLine})},title:{valType:"string",dflt:"Click to enter Plot title"},titlefont:o({},i,{}),autosize:{valType:"enumerated",values:[!0,!1,"initial"]},width:{valType:"number",min:10,dflt:700},height:{valType:"number",min:10,dflt:450},margin:{l:{valType:"number",min:0,dflt:80},r:{valType:"number",min:0,dflt:80},t:{valType:"number",min:0,dflt:100},b:{valType:"number",min:0,dflt:80},pad:{valType:"number",min:0,dflt:0},autoexpand:{valType:"boolean",dflt:!0}},paper_bgcolor:{valType:"color",dflt:a.background},plot_bgcolor:{valType:"color",dflt:a.background},separators:{valType:"string",dflt:".,"},hidesources:{valType:"boolean",dflt:!1},smith:{valType:"enumerated",values:[!1],dflt:!1},showlegend:{valType:"boolean"},_composedModules:{"*":"Fx"},_nestedModules:{xaxis:"Axes",yaxis:"Axes",scene:"gl3d",geo:"geo",legend:"Legend",annotations:"Annotations",shapes:"Shapes",images:"Images",ternary:"ternary"}}},{"../components/color/attributes":302,"../plotly":400,"./font_attributes":421}],452:[function(t,e,r){"use strict";function n(t){return"object"==typeof t&&(t=t.type),t}function i(t,e){e.text("");var r=e.append("a").attr({"xlink:xlink:href":"#","class":"link--impt link--embedview","font-weight":"bold"}).text(t._context.linkText+" "+String.fromCharCode(187));if(t._context.sendData)r.on("click",function(){f.sendDataToCloud(t)});else{var n=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}function a(t,e){for(var r,n=Object.keys(e),i=0;i=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 s=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&&i(t,s),l.text(s.text()&&c.text()?" - ":"")},f.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=o.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"}),i=n.append("input").attr({type:"text",name:"data"});return i.node().value=f.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},f.supplyDefaults=function(t){var e,r,n=t._fullLayout||{},i=t._fullLayout={},o=t.layout||{},s=t._fullData||[],u=t._fullData=[],h=t.data||[],d=i._modules=[],p=i._basePlotModules=[];for(f.supplyLayoutGlobalDefaults(o,i),i._dataLength=h.length,e=0;ea&&(e=(r-1)/(i.l+i.r),i.l=Math.floor(e*i.l),i.r=Math.floor(e*i.r)),0>o&&(e=(n-1)/(i.t+i.b),i.t=Math.floor(e*i.t),i.b=Math.floor(e*i.b))}},f.autoMargin=function(t,e,r){var n=t._fullLayout;if(n._pushmargin||(n._pushmargin={}),n.margin.autoexpand!==!1){if(r){var i=void 0===r.pad?12:r.pad;r.l+r.r>.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];t._replotting||f.doAutoMargin(t)}},f.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),c=Math.max(e.margin.b||0,0),u=e._pushmargin;return e.margin.autoexpand!==!1&&(u.base={l:{val:0,size:i},r:{val:1,size:a},t:{val:1,size:o},b:{val:0,size:c}},Object.keys(u).forEach(function(t){var r=u[t].l||{},n=u[t].b||{},l=r.val,f=r.size,h=n.val,d=n.size;Object.keys(u).forEach(function(t){if(s(f)&&u[t].r){var r=u[t].r.val,n=u[t].r.size;if(r>l){var p=(f*r+(n-e.width)*l)/(r-l),g=(n*(1-l)+(f-e.width)*(1-r))/(r-l);p>=0&&g>=0&&p+g>i+a&&(i=p,a=g)}}if(s(d)&&u[t].t){var v=u[t].t.val,m=u[t].t.size;if(v>h){var y=(d*v+(m-e.height)*h)/(v-h),b=(m*(1-h)+(d-e.height)*(1-v))/(v-h);y>=0&&b>=0&&y+b>c+o&&(c=y,o=b)}}})})),r.l=Math.round(i),r.r=Math.round(a),r.t=Math.round(o),r.b=Math.round(c),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,t._replotting||"{}"===n||n===JSON.stringify(e._size)?void 0:l.plot(t)},f.graphJson=function(t,e,r,n,i){function a(t){if("function"==typeof t)return null;if(c.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(n=t[e+"src"],"string"==typeof n&&n.indexOf(":")>0&&!c.isPlainObject(t.stream))continue}else if("keepall"!==r&&(n=t[e+"src"],"string"==typeof n&&n.indexOf(":")>0))continue;i[e]=a(t[e])}return i}return Array.isArray(t)?t.map(a):t&&t.getTime?c.ms2DateTime(t):t}(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&f.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l={data:(o||[]).map(function(t){var r=a(t);return e&&delete r.fit,r})};return e||(l.layout=a(s)),t.framework&&t.framework.isPolar&&(l=t.framework.getConfig()),"object"===n?l:JSON.stringify(l)}},{"../components/color":303,"../lib":381,"../plotly":400,"./attributes":401,"./font_attributes":421,"./layout_attributes":451,d3:113,"fast-isnumeric":117}],453:[function(t,e,r){"use strict";var n=t("../../traces/scatter/attributes"),i=n.marker;e.exports={r:n.r,t:n.t,marker:{color:i.color,size:i.size,symbol:i.symbol,opacity:i.opacity}}},{"../../traces/scatter/attributes":554}],454:[function(t,e,r){"use strict";function n(t,e){var r={showline:{valType:"boolean"},showticklabels:{valType:"boolean"},tickorientation:{valType:"enumerated",values:["horizontal","vertical"]},ticklen:{valType:"number",min:0},tickcolor:{valType:"color"},ticksuffix:{valType:"string"},endpadding:{valType:"number"},visible:{valType:"boolean"}};return a({},e,r)}var i=t("../cartesian/layout_attributes"),a=t("../../lib/extend").extendFlat,o=a({},i.domain,{});e.exports={radialaxis:n("radial",{range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},domain:o,orientation:{valType:"number"}}),angularaxis:n("angular",{range:{valType:"info_array",items:[{valType:"number",dflt:0},{valType:"number",dflt:360}]},domain:o}),layout:{direction:{valType:"enumerated",values:["clockwise","counterclockwise"]},orientation:{valType:"angle"}}}},{"../../lib/extend":376,"../cartesian/layout_attributes":412}],455:[function(t,e,r){var n=t("../../plotly"),i=t("d3"),a=e.exports={version:"0.2.2",manager:t("./micropolar_manager")},o=n.Lib.extendDeepAll;a.Axis=function(){function t(t){r=t||r;var c=l.data,f=l.layout;return("string"==typeof r||r.nodeName)&&(r=i.select(r)),r.datum(c).each(function(t,r){function l(t,e){return s(t)%360+f.orientation}var c=t.slice();u={data:a.util.cloneJson(c),layout:a.util.cloneJson(f)};var h=0;c.forEach(function(t,e){t.color||(t.color=f.defaultColorRange[h],h=(h+1)%f.defaultColorRange.length),t.strokeColor||(t.strokeColor="LinePlot"===t.geometry?t.color:i.rgb(t.color).darker().toString()),u.data[e].color=t.color,u.data[e].strokeColor=t.strokeColor,u.data[e].strokeDash=t.strokeDash,u.data[e].strokeSize=t.strokeSize});var d=c.filter(function(t,e){var r=t.visible;return"undefined"==typeof r||r===!0}),p=!1,g=d.map(function(t,e){return p=p||"undefined"!=typeof t.groupId,t});if(p){var v=i.nest().key(function(t,e){return"undefined"!=typeof t.groupId?t.groupId:"unstacked"}).entries(g),m=[],y=v.map(function(t,e){if("unstacked"===t.key)return t.values;var r=t.values[0].r.map(function(t,e){return 0});return t.values.forEach(function(t,e,n){t.yStack=[r],m.push(r),r=a.util.sumArrays(t.r,r)}),t.values});d=i.merge(y)}d.forEach(function(t,e){t.t=Array.isArray(t.t[0])?t.t:[t.t],t.r=Array.isArray(t.r[0])?t.r:[t.r]});var b=Math.min(f.width-f.margin.left-f.margin.right,f.height-f.margin.top-f.margin.bottom)/2;b=Math.max(10,b);var x,_=[f.margin.left+b,f.margin.top+b];if(p){var w=i.max(a.util.sumArrays(a.util.arrayLast(d).r[0],a.util.arrayLast(m)));x=[0,w]}else x=i.extent(a.util.flattenArray(d.map(function(t,e){return t.r})));f.radialAxis.domain!=a.DATAEXTENT&&(x[0]=0),n=i.scale.linear().domain(f.radialAxis.domain!=a.DATAEXTENT&&f.radialAxis.domain?f.radialAxis.domain:x).range([0,b]),u.layout.radialAxis.domain=n.domain();var k,A=a.util.flattenArray(d.map(function(t,e){return t.t})),M="string"==typeof A[0];M&&(A=a.util.deduplicate(A),k=A.slice(),A=i.range(A.length),d=d.map(function(t,e){var r=t;return t.t=[A],p&&(r.yStack=t.yStack),r}));var T=d.filter(function(t,e){return"LinePlot"===t.geometry||"DotPlot"===t.geometry}).length===d.length,E=null===f.needsEndSpacing?M||!T:f.needsEndSpacing,L=f.angularAxis.domain&&f.angularAxis.domain!=a.DATAEXTENT&&!M&&f.angularAxis.domain[0]>=0,S=L?f.angularAxis.domain:i.extent(A),C=Math.abs(A[1]-A[0]);T&&!M&&(C=0);var z=S.slice();E&&M&&(z[1]+=C);var P=f.angularAxis.ticksCount||4;P>8&&(P=P/(P/8)+P%8),f.angularAxis.ticksStep&&(P=(z[1]-z[0])/P);var R=f.angularAxis.ticksStep||(z[1]-z[0])/(P*(f.minorTicks+1));k&&(R=Math.max(Math.round(R),1)),z[2]||(z[2]=R);var O=i.range.apply(this,z);if(O=O.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=i.scale.linear().domain(z.slice(0,2)).range("clockwise"===f.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=s.domain(),u.layout.angularAxis.endPadding=E?C:0,e=i.select(this).select("svg.chart-root"),"undefined"==typeof e||e.empty()){var I="' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '",N=(new DOMParser).parseFromString(I,"application/xml"),j=this.appendChild(this.ownerDocument.importNode(N.documentElement,!0));e=i.select(j)}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,D=e.select(".chart-group"),B={fill:"none",stroke:f.tickColor},U={"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("+[b,f.margin.top]+")"}).style({display:"block"});var V=d.map(function(t,e){var r=a.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend="undefined"==typeof t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});a.Legend().config({data:d.map(function(t,e){return t.name||"Element"+e}),legendConfig:o({},a.Legend.defaultConfig().legendConfig,{container:F,elements:V,reverseOrder:f.legend.reverseOrder})})();var q=F.node().getBBox();b=Math.min(f.width-q.width-f.margin.left-f.margin.right,f.height-f.margin.top-f.margin.bottom)/2,b=Math.max(10,b),_=[f.margin.left+b,f.margin.top+b],n.range([0,b]),u.layout.radialAxis.domain=n.domain(),F.attr("transform","translate("+[_[0]+b,_[1]-b]+")")}else F=e.select(".legend-group").style({display:"none"});e.attr({width:f.width,height:f.height}).style({opacity:f.opacity}),D.attr("transform","translate("+_+")").style({cursor:"crosshair"});var H=[(f.width-(f.margin.left+f.margin.right+2*b+(q?q.width:0)))/2,(f.height-(f.margin.top+f.margin.bottom+2*b))/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 G=e.select("g.title-group text").style(U).text(f.title),Y=G.node().getBBox();G.attr({x:_[0]-Y.width/2,y:_[1]-b-20})}var X=e.select(".radial.axis-group");if(f.radialAxis.gridLinesVisible){var W=X.selectAll("circle.grid-circle").data(n.ticks(5));W.enter().append("circle").attr({"class":"grid-circle"}).style(B),W.attr("r",n),W.exit().remove()}X.select("circle.outside-circle").attr({r:b}).style(B);var Z=e.select("circle.background-circle").attr({r:b}).style({fill:f.backgroundColor,stroke:f.stroke});if(f.radialAxis.visible){var K=i.svg.axis().scale(n).ticks(5).tickSize(5);X.call(K).attr({transform:"rotate("+f.radialAxis.orientation+")"}),X.selectAll(".domain").style(B),X.selectAll("g>text").text(function(t,e){return this.textContent+f.radialAxis.ticksSuffix}).style(U).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,U["font-size"]]+")":"translate("+[0,U["font-size"]]+")"}}),X.selectAll("g>line").style({stroke:"black"})}var $=e.select(".angular.axis-group").selectAll("g.angular-tick").data(O),Q=$.enter().append("g").classed("angular-tick",!0);$.attr({transform:function(t,e){return"rotate("+l(t,e)+")"}}).style({display:f.angularAxis.visible?"block":"none"}),$.exit().remove(),Q.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(B),Q.selectAll(".minor").style({stroke:f.minorTickColor}),$.select("line.grid-line").attr({x1:f.tickLength?b-f.tickLength:0,x2:b}).style({display:f.angularAxis.gridLinesVisible?"block":"none"}),Q.append("text").classed("axis-text",!0).style(U);var J=$.select("text.axis-text").attr({x:b+f.labelOffset,dy:".35em",transform:function(t,e){var r=l(t,e),n=b+f.labelOffset,i=f.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?270>r&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(180>=r&&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?"":k?k[t]+f.angularAxis.ticksSuffix:t+f.angularAxis.ticksSuffix}).style(U);f.angularAxis.rewriteTicks&&J.text(function(t,e){return e%(f.minorTicks+1)!=0?"":f.angularAxis.rewriteTicks(this.textContent,e)});var tt=i.max(D.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));F.attr({transform:"translate("+[b+tt,f.margin.top]+")"});var et=e.select("g.geometry-group").selectAll("g").size()>0,rt=e.select("g.geometry-group").selectAll("g.geometry").data(d);if(rt.enter().append("g").attr({"class":function(t,e){return"geometry geometry"+e}}),rt.exit().remove(),d[0]||et){var nt=[];d.forEach(function(t,e){var r={};r.radialScale=n,r.angularScale=s,r.container=rt.filter(function(t,r){return r==e}),r.geometry=t.geometry,r.orientation=f.orientation,r.direction=f.direction,r.index=e,nt.push({data:t,geometryConfig:r})});var it=i.nest().key(function(t,e){return"undefined"!=typeof t.data.groupId||"unstacked"}).entries(nt),at=[];it.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 o(a[r].defaultConfig(),t)});a[r]().config(n)()})}var ot,st,lt=e.select(".guides-group"),ct=e.select(".tooltips-group"),ut=a.tooltipPanel().config({container:ct,fontSize:8})(),ft=a.tooltipPanel().config({container:ct,fontSize:8})(),ht=a.tooltipPanel().config({container:ct,hasTick:!0})();if(!M){var dt=lt.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});D.on("mousemove.angular-guide",function(t,e){var r=a.util.getMousePos(Z).angle;dt.attr({x2:-b,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-f.orientation)%360;ot=s.invert(n);var i=a.util.convertToCartesian(b+12,r+180);ut.text(a.util.round(ot)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){lt.select("line").style({opacity:0})})}var pt=lt.select("circle").style({stroke:"grey",fill:"none"});D.on("mousemove.radial-guide",function(t,e){var r=a.util.getMousePos(Z).radius;pt.attr({r:r}).style({opacity:.5}),st=n.invert(a.util.getMousePos(Z).radius);var i=a.util.convertToCartesian(r,f.radialAxis.orientation);ft.text(a.util.round(st)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){pt.style({opacity:0}),ht.hide(),ut.hide(),ft.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,r){var n=i.select(this),o=n.style("fill"),s="black",l=n.style("opacity")||1;if(n.attr({"data-opacity":l}),"none"!=o){n.attr({"data-fill":o}),s=i.hsl(o).darker().toString(),n.style({fill:s,opacity:1});var c={t:a.util.round(t[0]),r:a.util.round(t[1])};M&&(c.t=k[t[0]]);var u="t: "+c.t+", r: "+c.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];ht.config({color:s}).text(u),ht.move(d)}else o=n.style("stroke"),n.attr({"data-stroke":o}),s=i.hsl(o).darker().toString(),n.style({stroke:s,opacity:1})}).on("mousemove.tooltip",function(t,e){return 0!=i.event.which?!1:void(i.select(this).attr("data-fill")&&ht.show())}).on("mouseout.tooltip",function(t,e){ht.hide();var r=i.select(this),n=r.attr("data-fill");n?r.style({fill:n,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})}),h}var e,r,n,s,l={data:[],layout:{}},c={},u={},f=i.dispatch("hover"),h={};return h.render=function(e){return t(e),this},h.config=function(t){if(!arguments.length)return l;var e=a.util.cloneJson(t);return e.data.forEach(function(t,e){l.data[e]||(l.data[e]={}),o(l.data[e],a.Axis.defaultConfig().data[0]),o(l.data[e],t)}),o(l.layout,a.Axis.defaultConfig().layout),o(l.layout,e.layout),this},h.getLiveConfig=function(){return u},h.getinputConfig=function(){return c},h.radialScale=function(t){return n},h.angularScale=function(t){return s},h.svg=function(){return e},i.rebind(h,f,"on"),h},a.Axis.defaultConfig=function(t,e){var r={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:i.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}};return r},a.util={},a.DATAEXTENT="dataExtent",a.AREA="AreaChart",a.LINE="LinePlot",a.DOT="DotPlot",a.BAR="BarChart",a.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},a.util._extend=function(t,e){for(var r in t)e[r]=t[r]},a.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},a.util.dataFromEquation2=function(t,e){var r=e||6,n=i.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180,i=t(n);return[e,i]});return n},a.util.dataFromEquation=function(t,e,r){var n=e||6,a=[],o=[];i.range(0,360+n,n).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},a.util.ensureArray=function(t,e){if("undefined"==typeof t)return null;var r=[].concat(t);return i.range(e).map(function(t,e){return r[e]||r[0]})},a.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=a.util.ensureArray(t[e],r)}),t},a.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},a.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},a.util.sumArrays=function(t,e){return i.zip(t,e).map(function(t,e){return i.sum(t)})},a.util.arrayLast=function(t){return t[t.length-1]},a.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},a.util.flattenArray=function(t){for(var e=[];!a.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},a.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},a.util.convertToCartesian=function(t,e){var r=e*Math.PI/180,n=t*Math.cos(r),i=t*Math.sin(r);return[n,i]},a.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},a.util.getMousePos=function(t){var e=i.mouse(t.node()),r=e[0],n=e[1],a={};return a.x=r,a.y=n,a.pos=e,a.angle=180*(Math.atan2(n,r)+Math.PI)/Math.PI,a.radius=Math.sqrt(r*r+n*n),a},a.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,a=t.length;a>i;i++)e=t[i],e in r?(r[e]++,n[e]=r[e]):r[e]=1;return n},a.util.duplicates=function(t){return Object.keys(a.util.duplicatesCount(t))},a.util.translator=function(t,e,r,n){if(n){var i=r.slice();r=e,e=i}var a=e.reduce(function(t,e){return"undefined"!=typeof t?t[e]:void 0},t);"undefined"!=typeof a&&(e.reduce(function(t,r,n){return"undefined"!=typeof t?(n===e.length-1&&delete t[r],t[r]):void 0},t),r.reduce(function(t,e,n){return"undefined"==typeof t[e]&&(t[e]={}),n===r.length-1&&(t[e]=a),t[e]},t))},a.PolyChart=function(){function t(){var t=r[0].geometryConfig,e=t.container;"string"==typeof e&&(e=i.select(e)),e.datum(r).each(function(e,r){function n(e,r){var n=t.radialScale(e[1]),i=(t.angularScale(e[0])+t.orientation)*Math.PI/180;return{r:n,t:i}}function a(t){var e=t.r*Math.cos(t.t),r=t.r*Math.sin(t.t);return{x:e,y:r}}var o=!!e[0].data.yStack,l=e.map(function(t,e){return o?i.zip(t.data.t[0],t.data.r[0],t.data.yStack[0]):i.zip(t.data.t[0],t.data.r[0])}),c=t.angularScale,u=t.radialScale.domain()[0],f={};f.bar=function(r,n,a){var o=e[a].data,s=t.radialScale(r[1])-t.radialScale(0),l=t.radialScale(r[2]||0),u=o.barWidth;i.select(this).attr({"class":"mark bar",d:"M"+[[s+l,-u/2],[s+l,u/2],[l,u/2],[l,-u/2]].join("L")+"Z",transform:function(e,r){return"rotate("+(t.orientation+c(e[0]))+")"}})},f.dot=function(t,r,o){var s=t[2]?[t[0],t[1]+t[2]]:t,l=i.svg.symbol().size(e[o].data.dotSize).type(e[o].data.dotType)(t,r);i.select(this).attr({"class":"mark dot",d:l,transform:function(t,e){var r=a(n(s));return"translate("+[r.x,r.y]+")"}})};var h=i.svg.line.radial().interpolate(e[0].data.lineInterpolation).radius(function(e){return t.radialScale(e[1])}).angle(function(e){return t.angularScale(e[0])*Math.PI/180});f.line=function(r,n,a){var o=r[2]?l[a].map(function(t,e){return[t[0],t[1]+t[2]]}):l[a];if(i.select(this).each(f.dot).style({opacity:function(t,r){return+e[a].data.dotVisible},fill:v.stroke(r,n,a)}).attr({"class":"mark dot"}),!(n>0)){var s=i.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,n,a)},"fill-opacity":0,stroke:function(t,e){return v.stroke(r,n,a)},"stroke-width":function(t,e){return v["stroke-width"](r,n,a)},"stroke-dasharray":function(t,e){return v["stroke-dasharray"](r,n,a)},opacity:function(t,e){return v.opacity(r,n,a)},display:function(t,e){return v.display(r,n,a)}})}};var d=t.angularScale.range(),p=Math.abs(d[1]-d[0])/l[0].length*Math.PI/180,g=i.svg.arc().startAngle(function(t){return-p/2}).endAngle(function(t){return p/2}).innerRadius(function(e){return t.radialScale(u+(e[2]||0))}).outerRadius(function(e){return t.radialScale(u+(e[2]||0))+t.radialScale(e[1])});f.arc=function(e,r,n){i.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 s[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return"undefined"==typeof e[n].data.visible||e[n].data.visible?"block":"none"}},m=i.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,r=[a.PolyChart.defaultConfig()],n=i.dispatch("hover"),s={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,e){r[e]||(r[e]={}),o(r[e],a.PolyChart.defaultConfig()),o(r[e],t)}),this):r},t.getColorScale=function(){return e},i.rebind(t,n,"on"),t},a.PolyChart.defaultConfig=function(){var t={data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:i.scale.category20()}};return t},a.BarChart=function(){return a.PolyChart()},a.BarChart.defaultConfig=function(){var t={geometryConfig:{geometryType:"bar"}};return t},a.AreaChart=function(){return a.PolyChart()},a.AreaChart.defaultConfig=function(){var t={geometryConfig:{geometryType:"arc"}};return t},a.DotPlot=function(){return a.PolyChart()},a.DotPlot.defaultConfig=function(){var t={geometryConfig:{geometryType:"dot",dotType:"circle"}};return t},a.LinePlot=function(){return a.PolyChart()},a.LinePlot.defaultConfig=function(){var t={geometryConfig:{geometryType:"line"}};return t},a.Legend=function(){function t(){var r=e.legendConfig,n=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var i=o({},r.elements[e]);return i.name=t,i.color=[].concat(r.elements[e].color)[n],i})}),a=i.merge(n);a=a.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||"undefined"==typeof r.elements[e].visibleInLegend)}),r.reverseOrder&&(a=a.reverse());var s=r.container;("string"==typeof s||s.nodeName)&&(s=i.select(s));var l=a.map(function(t,e){return t.color}),c=r.fontSize,u=null==r.isContinuous?"number"==typeof a[0]:r.isContinuous,f=u?r.height:c*a.length,h=s.classed("legend-group",!0),d=h.selectAll("svg").data([0]),p=d.enter().append("svg").attr({width:300,height:f+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var g=i.range(a.length),v=i.scale[u?"linear":"ordinal"]().domain(g).range(l),m=i.scale[u?"linear":"ordinal"]().domain(g)[u?"range":"rangePoints"]([0,f]),y=function(t,e){var r=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":-1!=i.svg.symbolTypes.indexOf(t)?i.svg.symbol().type(t).size(r)():i.svg.symbol().type("square").size(r)()};if(u){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(a);x.enter().append("path").classed("legend-mark",!0),x.attr({transform:function(t,e){return"translate("+[c/2,m(e)+c/2]+")"},d:function(t,e){var r=t.symbol;return y(r,c)},fill:function(t,e){return v(e)}}),x.exit().remove()}var _=i.svg.axis().scale(m).orient("right"),w=d.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 a[e].name}),t}var e=a.Legend.defaultConfig(),r=i.dispatch("hover");return t.config=function(t){return arguments.length?(o(e,t),this):e},i.rebind(t,r,"on"),t},a.Legend.defaultConfig=function(t,e){var r={data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}};return r},a.tooltipPanel=function(){var t,e,r,n={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+a.tooltipPanel.uid++,l=10,c=function(){t=n.container.selectAll("g."+s).data([0]);var i=t.enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=i.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=i.append("text").attr({dx:n.padding+l,dy:.3*+n.fontSize}),c};return c.text=function(a){var o=i.hsl(n.color).l,s=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",f=a||"";e.style({fill:u,"font-size":n.fontSize+"px"}).text(f);var h=n.padding,d=e.node().getBBox(),p={fill:n.color,stroke:s,"stroke-width":"2px"},g=d.width+2*h+l,v=d.height+2*h;return r.attr({d:"M"+[[l,-v/2],[l,-v/4],[n.hasTick?0:l,0],[l,v/4],[l,v/2],[g,v/2],[g,-v/2]].join("L")+"Z"}).style(p),t.attr({transform:"translate("+[l,-v/2+2*h]+")"}),t.style({display:"block"}),c},c.move=function(e){return t?(t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),c):void 0},c.hide=function(){return t?(t.style({display:"none"}),c):void 0},c.show=function(){return t?(t.style({display:"block"}),c):void 0},c.config=function(t){return o(n,t),c},c},a.tooltipPanel.uid=1,a.adapter={},a.adapter.plotly=function(){var t={};return t.convert=function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=o({},t),i=[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]];return i.forEach(function(t,r){a.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",n.dotVisible===!0?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var n=a.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var i=n.indexOf(t.geometry);-1!=i&&(r.data[e].groupId=i)})}if(t.layout){var s=o({},t.layout),l=[[s,["plot_bgcolor"],["backgroundColor"]],[s,["showlegend"],["showLegend"]],[s,["radialaxis"],["radialAxis"]],[s,["angularaxis"],["angularAxis"]],[s.angularaxis,["showline"],["gridLinesVisible"]],[s.angularaxis,["showticklabels"],["labelsVisible"]],[s.angularaxis,["nticks"],["ticksCount"]],[s.angularaxis,["tickorientation"],["tickOrientation"]],[s.angularaxis,["ticksuffix"],["ticksSuffix"]],[s.angularaxis,["range"],["domain"]],[s.angularaxis,["endpadding"],["endPadding"]],[s.radialaxis,["showline"],["gridLinesVisible"]],[s.radialaxis,["tickorientation"],["tickOrientation"]],[s.radialaxis,["ticksuffix"],["ticksSuffix"]],[s.radialaxis,["range"],["domain"]],[s.angularAxis,["showline"],["gridLinesVisible"]],[s.angularAxis,["showticklabels"],["labelsVisible"]],[s.angularAxis,["nticks"],["ticksCount"]],[s.angularAxis,["tickorientation"],["tickOrientation"]],[s.angularAxis,["ticksuffix"],["ticksSuffix"]],[s.angularAxis,["range"],["domain"]],[s.angularAxis,["endpadding"],["endPadding"]],[s.radialAxis,["showline"],["gridLinesVisible"]],[s.radialAxis,["tickorientation"],["tickOrientation"]],[s.radialAxis,["ticksuffix"],["ticksSuffix"]],[s.radialAxis,["range"],["domain"]],[s.font,["outlinecolor"],["outlineColor"]],[s.legend,["traceorder"],["reverseOrder"]],[s,["labeloffset"],["labelOffset"]],[s,["defaultcolorrange"],["defaultColorRange"]]];if(l.forEach(function(t,r){a.util.translator.apply(null,t.concat(e))}),e?("undefined"!=typeof s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&"undefined"!=typeof s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&"undefined"!=typeof s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&"undefined"!=typeof s.margin.t){var c=["t","r","b","l","pad"],u=["top","right","bottom","left","pad"],f={};i.entries(s.margin).forEach(function(t,e){f[u[c.indexOf(t.key)]]=t.value}),s.margin=f}e&&(delete s.needsEndSpacing,delete s.minorTickColor,delete s.minorTicks,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksStep,delete s.angularaxis.rewriteTicks,delete s.angularaxis.nticks,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksStep,delete s.radialaxis.rewriteTicks,delete s.radialaxis.nticks),r.layout=s}return r},t}},{"../../plotly":400,"./micropolar_manager":456,d3:113}],456:[function(t,e,r){"use strict";var n=t("../../plotly"),i=t("d3"),a=t("./undo_manager"),o=e.exports={},s=n.Lib.extendDeepAll;o.framework=function(t){function e(e,a){return a&&(f=a),i.select(i.select(f).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),r=r?s(r,e):e,c||(c=n.micropolar.Axis()),u=n.micropolar.adapter.plotly().convert(r),c.config(u).render(f),t.data=r.data,t.layout=r.layout,o.fillLayout(t),r}var r,l,c,u,f,h=new a;return e.isPolar=!0,e.svg=function(){return c.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return n.micropolar.adapter.plotly().convert(c.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:c.angularScale(),r:c.radialScale()}},e.setUndoPoint=function(){var t=this,e=n.micropolar.util.cloneJson(r);!function(e,r){h.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,l),l=n.micropolar.util.cloneJson(e)},e.undo=function(){h.undo()},e.redo=function(){h.redo()},e},o.fillLayout=function(t){var e=i.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:n.Color.background,_container:e,_paperdiv:r,_paper:a};t._fullLayout=s(o,t.layout)}},{"../../plotly":400,"./undo_manager":457,d3:113}],457:[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 ng;g++){var v=d[g];s=t[v]?t[v]:t[v]={},e[v]=l={},o("domain."+h,[g/p,(g+1)/p]),o("domain."+{x:"y",y:"x"}[h]),a.id=v,f(s,l,o,a)}}},{"../lib":381,"./plots":452}],459:[function(t,e,r){"use strict";var n=t("./ternary"),i=t("../../plots/plots");r.name="ternary",r.attr="subplot",r.idRoot="ternary",r.idRegex=/^ternary([2-9]|[1-9][0-9]+)?$/,r.attrRegex=/^ternary([2-9]|[1-9][0-9]+)?$/,r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,a=i.getSubplotIds(e,"ternary"),o=0;o=o&&(d.min=0,p.min=0,g.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}var 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":303,"../../subplot_defaults":458,"./axis_defaults":462,"./layout_attributes":464}],464:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("./axis_attributes");e.exports={domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},bgcolor:{valType:"color",dflt:n.background},sum:{valType:"number",dflt:1,min:0},aaxis:i,baxis:i,caxis:i}},{"../../../components/color/attributes":302,"./axis_attributes":461}],465:[function(t,e,r){"use strict";function n(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework()}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"),c=t("../../components/color"),u=t("../../components/drawing"),f=t("../cartesian/set_convert"),h=t("../../lib/extend").extendFlat,d=t("../cartesian/axes"),p=t("../../lib/filter_visible"),g=t("../../components/dragelement"),v=t("../../components/titles"),m=t("../cartesian/select"),y=t("../cartesian/constants"),b=t("../cartesian/graph_interact");e.exports=n;var x=n.prototype;x.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={}},x.plot=function(t,e){var r,n=this,i=e[n.id],a=e._size;l.getPlotDiv(n.plotContainer.node())!==n.graphDiv&&(n.init(n.graphDiv._fullLayout),n.makeFramework()),n.adjustLayout(i,a);var o=n.traceHash,s={};for(r=0;r_*y?(a=y,i=a*_):(i=m,a=i/_),o=g*i/m,s=v*a/y,r=e.l+e.w*d-i/2,n=e.t+e.h*(1-p)-a/2,l.x0=r,l.y0=n,l.w=i,l.h=a,l.sum=b,l.xaxis={type:"linear",range:[x+2*k-b,b-x-2*w],domain:[d-o/2,d+o/2],_id:"x",_gd:l.graphDiv},f(l.xaxis),l.xaxis.setScale(),l.yaxis={type:"linear",range:[x,b-w-k],domain:[p-s/2,p+s/2],_id:"y",_gd:l.graphDiv},f(l.yaxis),l.yaxis.setScale();var A=l.yaxis.domain[0],M=l.aaxis=h({},t.aaxis,{range:[x,b-w-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,_gd:l.graphDiv,_id:"y",_length:i,_gridpath:"M0,0l"+a+",-"+i/2});f(M);var T=l.baxis=h({},t.baxis,{range:[b-x-k,w],side:"bottom",_counterangle:30,domain:l.xaxis.domain,_axislayer:l.layers.baxis,_gridlayer:l.layers.bgrid,_counteraxis:l.aaxis,_pos:0,_gd:l.graphDiv,_id:"x",_length:i,_gridpath:"M0,0l-"+i/2+",-"+a});f(T),M._counteraxis=T;var E=l.caxis=h({},t.caxis,{range:[b-x-w,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,_gd:l.graphDiv,_id:"y",_length:i,_gridpath:"M0,0l-"+a+","+i/2});f(E);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 S="translate("+r+","+n+")";l.plotContainer.selectAll(".scatterlayer,.maplayer,.zoom").attr("transform",S);var C="translate("+r+","+(n+a)+")";l.layers.baxis.attr("transform",C),l.layers.bgrid.attr("transform",C);var z="translate("+(r+i/2)+","+n+")rotate(30)";l.layers.aaxis.attr("transform",z),l.layers.agrid.attr("transform",z);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);var R=l.layers.axlines;R.select(".aline").attr("d",M.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(c.stroke,M.linecolor||"#000").style("stroke-width",(M.linewidth||0)+"px"),R.select(".bline").attr("d",T.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(c.stroke,T.linecolor||"#000").style("stroke-width",(T.linewidth||0)+"px"),R.select(".cline").attr("d",E.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(c.stroke,E.linecolor||"#000").style("stroke-width",(E.linewidth||0)+"px")},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(d.doTicks(r,i,!0),d.doTicks(r,a,!0),d.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=y.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",A="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",M="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="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",E=!0;x.initInteractions=function(){function t(t,e,r){var n=j.getBoundingClientRect();x=e-n.left,w=r-n.top,L={a:N.aaxis.range[0],b:N.baxis.range[1],c:N.caxis.range[1]},C=L,S=N.aaxis.range[1]-L.a,z=o(N.graphDiv._fullLayout[N.id].bgcolor).getLuminance(),P="M0,"+N.h+"L"+N.w/2+", 0L"+N.w+","+N.h+"Z",R=!1,O=D.append("path").attr("class","zoombox").style({fill:z>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",P),I=D.append("path").attr("class","zoombox-corners").style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),p()}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 a(t,i){var a=x+t,o=w+i,s=Math.max(0,Math.min(1,e(x,w),e(a,o))),l=Math.max(0,Math.min(1,r(x,w),r(a,o))),c=Math.max(0,Math.min(1,n(x,w),n(a,o))),u=(s/2+c)*N.w,f=(1-s/2-l)*N.w,h=(u+f)/2,d=f-u,p=(1-s)*N.h,g=p-d/_;d.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),I.transition().style("opacity",1).duration(200),R=!0)}function u(t,e){if(C===L)return 2===e&&v(),i(F);i(F);var r={};r[N.id+".aaxis.min"]=C.a,r[N.id+".baxis.min"]=C.b,r[N.id+".caxis.min"]=C.c,s.relayout(F,r),E&&F.data&&F._context.showTips&&(l.notifier("Double-click to
zoom back out","long"),E=!1)}function f(){L={a:N.aaxis.range[0],b:N.baxis.range[1],c:N.caxis.range[1]},C=L}function h(t,e){var r=t/N.xaxis._m,n=e/N.yaxis._m;C={a:L.a-n,b:L.b+(r+n)/2,c:L.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=(L.a-C.a)*N.yaxis._m,t=(L.c-C.c-L.b+C.b)*N.xaxis._m);var o="translate("+(N.x0+t)+","+(N.y0+e)+")";N.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",o),N.aaxis.range=[C.a,N.sum-C.b-C.c],N.baxis.range=[N.sum-C.a-C.c,C.b],N.caxis.range=[N.sum-C.a-C.b,C.c],N.drawAxes(!1),N.plotContainer.selectAll(".crisp").classed("crisp",!1)}function d(t,e){if(t){var r={};r[N.id+".aaxis.min"]=C.a,r[N.id+".baxis.min"]=C.b,r[N.id+".caxis.min"]=C.c,s.relayout(F,r)}else 2===e&&v()}function p(){N.plotContainer.selectAll(".select-outline").remove()}function v(){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),s.relayout(F,t)}var x,w,L,S,C,z,P,R,O,I,N=this,j=N.layers.plotbg.select("path").node(),F=N.graphDiv,D=N.layers.zoom,B={element:j,gd:F,plotinfo:{plot:D},doubleclick:v,subplot:N.id,prepFn:function(e,r,n){B.xaxes=[N.xaxis],B.yaxes=[N.yaxis];var i=F._fullLayout.dragmode;e.shiftKey&&(i="pan"===i?"zoom":"pan"),"lasso"===i?B.minDrag=1:B.minDrag=void 0,"zoom"===i?(B.moveFn=a,B.doneFn=u,t(e,r,n)):"pan"===i?(B.moveFn=h,B.doneFn=d,f(),p()):"select"!==i&&"lasso"!==i||m(e,r,n,B,i)}};g.init(B),j.onmousemove=function(t){b.hover(F,t,N.id),F._fullLayout._lasthover=j,F._fullLayout._hoversubplot=N.id},j.onmouseout=function(t){F._dragging||g.unhover(F,t)},j.onclick=function(t){b.click(F,t)},F._fullLayout._plots||(F._fullLayout._plots={}),F._fullLayout._plots[N.id]={overlays:[],xaxis:N.xaxis,yaxis:N.yaxis,x:function(){return N.xaxis},y:function(){return N.yaxis}}}},{"../../components/color":303,"../../components/dragelement":323,"../../components/drawing":325,"../../components/titles":365,"../../lib":381,"../../lib/extend":376,"../../lib/filter_visible":377,"../../plotly":400,"../cartesian/axes":403,"../cartesian/constants":408,"../cartesian/graph_interact":410,"../cartesian/select":416,"../cartesian/set_convert":417,d3:113,tinycolor2:274}],466:[function(t,e,r){"use strict";function n(t){var e;switch(t){case"themes__thumb":e={autosize:!0,width:150,height:150,title:"",showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":e={title:"",hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:e={}}return e}function i(t){var e=["xaxis","yaxis","zaxis"];return e.indexOf(t.slice(0,5))>-1}var a=t("../plotly"),o=a.Lib.extendFlat,s=a.Lib.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,l=t.data,c=t.layout,u=s([],l),f=s({},c,n(e.tileClass));if(e.width&&(f.width=e.width),e.height&&(f.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){f.annotations=[];var h=Object.keys(f);for(r=0;rl;l++)n(r[l])&&d.push({p:r[l],s:s[l],b:0});return a(e,"marker")&&o(e,e.marker.color,"marker","c"),a(e,"marker.line")&&o(e,e.marker.line.color,"marker.line","c"),d}},{"../../components/colorscale/calc":310,"../../components/colorscale/has_colorscale":315,"../../plots/cartesian/axes":403,"fast-isnumeric":117}],476:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color"),a=t("../scatter/xy_defaults"),o=t("../bar/style_defaults"),s=t("../../components/errorbars/defaults"),l=t("./attributes");e.exports=function(t,e,r,c){function u(r,i){return n.coerce(t,e,l,r,i)}var f=a(t,e,u);return f?(u("orientation",e.x&&!e.y?"h":"v"),u("text"),o(t,e,u,r,c),s(t,e,i.defaultLine,{axis:"y"}),void s(t,e,i.defaultLine,{axis:"x",inherit:"y"})):void(e.visible=!1)}},{"../../components/color":303,"../../components/errorbars/defaults":330,"../../lib":381,"../bar/style_defaults":484,"../scatter/xy_defaults":575,"./attributes":474}],477:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/graph_interact"),i=t("../../components/errorbars"),a=t("../../components/color");e.exports=function(t,e,r,o){var s,l=t.cd,c=l[0].trace,u=l[0].t,f=t.xa,h=t.ya,d="closest"===o?u.barwidth/2:u.dbar*(1-f._gd._fullLayout.bargap)/2;s="closest"!==o?function(t){return t.p}:"h"===c.orientation?function(t){return t.y}:function(t){return t.x};var p,g;"h"===c.orientation?(p=function(t){return n.inbox(t.b-e,t.x-e)+(t.x-e)/(t.x-t.b)},g=function(t){var e=s(t)-r;return n.inbox(e-d,e+d)}):(g=function(t){return n.inbox(t.b-r,t.y-r)+(t.y-r)/(t.y-t.b)},p=function(t){var r=s(t)-e;return n.inbox(r-d,r+d)});var v=n.getDistanceFunction(o,p,g);if(n.getClosest(l,v,t),t.index!==!1){var m=l[t.index],y=m.mcc||c.marker.color,b=m.mlcc||c.marker.line.color,x=m.mlw||c.marker.line.width;return a.opacity(y)?t.color=y:a.opacity(b)&&x&&(t.color=b),"h"===c.orientation?(t.x0=t.x1=f.c2p(m.x,!0),t.xLabelVal=m.s,t.y0=h.c2p(s(m)-d,!0),t.y1=h.c2p(s(m)+d,!0),t.yLabelVal=m.p):(t.y0=t.y1=h.c2p(m.y,!0),t.yLabelVal=m.s,t.x0=f.c2p(s(m)-d,!0),t.x1=f.c2p(s(m)+d,!0),t.xLabelVal=m.p),m.tx&&(t.text=m.tx),i.hoverInfo(m,c,t),[t]}}},{"../../components/color":303,"../../components/errorbars":331,"../../plots/cartesian/graph_interact":410}],478:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.layoutAttributes=t("./layout_attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("./layout_defaults"),n.calc=t("./calc"),n.setPositions=t("./set_positions"),n.colorbar=t("../scatter/colorbar"),n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.moduleType="trace",n.name="bar",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","bar","oriented","markerColorscale","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":411,"../scatter/colorbar":557,"./arrays_to_calcdata":473,"./attributes":474,"./calc":475,"./defaults":476,"./hover":477,"./layout_attributes":479,"./layout_defaults":480,"./plot":481,"./set_positions":482,"./style":483}],479:[function(t,e,r){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:""},bargap:{valType:"number",min:0,max:1},bargroupgap:{valType:"number",min:0,max:1,dflt:0}}},{}],480:[function(t,e,r){"use strict";var n=t("../../plots/plots"),i=t("../../plots/cartesian/axes"),a=t("../../lib"),o=t("./layout_attributes");e.exports=function(t,e,r){function s(r,n){return a.coerce(t,e,o,r,n)}for(var l=!1,c=!1,u=!1,f={},h=0;h=2?a(t):t>e?Math.ceil(t):Math.floor(t)}var h,d,p,g;if("h"===s.orientation?(p=u.c2p(r.poffset+e.p,!0),g=u.c2p(r.poffset+e.p+r.barwidth,!0),h=c.c2p(e.b,!0),d=c.c2p(e.s+e.b,!0)):(h=c.c2p(r.poffset+e.p,!0),d=c.c2p(r.poffset+e.p+r.barwidth,!0),g=u.c2p(e.s+e.b,!0),p=u.c2p(e.b,!0)),!(i(h)&&i(d)&&i(p)&&i(g)&&h!==d&&p!==g))return void n.select(this).remove();var v=(e.mlw+1||s.marker.line.width+1||(e.trace?e.trace.marker.line.width:0)+1)-1,m=n.round(v/2%1,2);if(!t._context.staticPlot){var y=o.opacity(e.mc||s.marker.color),b=1>y||v>.01?a:l;h=b(h,d),d=b(d,h),p=b(p,g),g=b(g,p)}n.select(this).attr("d","M"+h+","+p+"V"+g+"H"+d+"V"+p+"Z")})}),h.call(s.plot,e)}},{"../../components/color":303,"../../components/errorbars":331,"../../lib":381,"./arrays_to_calcdata":473,d3:113,"fast-isnumeric":117}],482:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/plots"),a=t("../../plots/cartesian/axes"),o=t("../../lib");e.exports=function(t,e){var r,s,l=t._fullLayout,c=e.x(),u=e.y();["v","h"].forEach(function(f){function h(e){function r(t){t[p]=t.p+h}var n=[];e.forEach(function(e){t.calcdata[e].forEach(function(t){n.push(t.p)})});var i=o.distinctVals(n),s=i.vals,c=i.minDiff,u=!1,f=[];"group"===l.barmode&&e.forEach(function(e){u||(t.calcdata[e].forEach(function(t){u||f.forEach(function(e){Math.abs(t.p-e)_&&(S=!0,M=_),_>A+R&&(S=!0,A=_))}a.expand(m,[M,A],{tozero:!0,padded:S})}else{var O=function(t){return t[g]=t.s,t.s};for(r=0;r1||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=(e._input||{}).marker||{},l=a.tryColorscale(r,s,""),c=a.tryColorscale(r,s,"line.");n.select(this).selectAll("path").each(function(t){var e,a,s=(t.mlw+1||o.width+1)-1,u=n.select(this);e="mc"in t?t.mcc=l(t.mc):Array.isArray(r.color)?i.defaultLine:r.color,u.style("stroke-width",s+"px").call(i.fill,e),s&&(a="mlc"in t?t.mlcc=c(t.mlc):Array.isArray(o.color)?i.defaultLine:o.color,u.call(i.stroke,a))})}),e.call(o.style)}},{"../../components/color":303,"../../components/drawing":325,"../../components/errorbars":331,d3:113}],484:[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":303,"../../components/colorscale/defaults":312,"../../components/colorscale/has_colorscale":315}],485:[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"},x:{valType:"data_array"},x0:{valType:"any"},y0:{valType:"any"},whiskerwidth:{valType:"number",min:0,max:1,dflt:.5},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1},jitter:{valType:"number",min:0,max:1},pointpos:{valType:"number",min:-2,max:2},orientation:{valType:"enumerated",values:["v","h"]},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)"},symbol:a({},o.symbol,{arrayOk:!1}),opacity:a({},o.opacity,{arrayOk:!1,dflt:1}),size:a({},o.size,{arrayOk:!1}),color:a({},o.color,{arrayOk:!1}),line:{color:a({},s.color,{arrayOk:!1,dflt:i.defaultLine}),width:a({},s.width,{arrayOk:!1,dflt:0}),outliercolor:{valType:"color"},outlierwidth:{valType:"number",min:0,dflt:1}}},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2}},fillcolor:n.fillcolor}},{"../../components/color/attributes":302,"../../lib/extend":376,"../scatter/attributes":554}],486:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/cartesian/axes");e.exports=function(t,e){function r(t,e,r,a,o){var s;return r in e?p=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),p=o.map(function(){return s})),p}function o(t,e,r,a,o){var s,l,c,u,f=a.length,h=e.length,d=[],p=[];for(s=0;f>s;++s)l=a[s],t[s]={pos:l},p[s]=l-o,d[s]=[];for(p.push(a[f-1]+o),s=0;h>s;++s)u=e[s],n(u)&&(c=i.findBin(r[s],p),c>=0&&h>c&&d[c].push(u));return d}function s(t,e){var r,n,a,o;for(o=0;o1,m=r.dPos*(1-h.boxgap)*(1-h.boxgroupgap)/(v?t.numboxes:1),y=v?2*r.dPos*(-.5+(r.boxnum+.5)/t.numboxes)*(1-h.boxgap):0,b=m*g.whiskerwidth;return g.visible!==!0||r.emptybox?void a.select(this).remove():("h"===g.orientation?(l=p,f=d):(l=d,f=p),r.bPos=y,r.bdPos=m,n(),a.select(this).selectAll("path.box").data(o.identity).enter().append("path").attr("class","box").each(function(t){var e=l.c2p(t.pos+y,!0),r=l.c2p(t.pos+y-m,!0),n=l.c2p(t.pos+y+m,!0),i=l.c2p(t.pos+y-b,!0),s=l.c2p(t.pos+y+b,!0),c=f.c2p(t.q1,!0),u=f.c2p(t.q3,!0),h=o.constrain(f.c2p(t.med,!0),Math.min(c,u)+1,Math.max(c,u)-1),d=f.c2p(g.boxpoints===!1?t.min:t.lf,!0),p=f.c2p(g.boxpoints===!1?t.max:t.uf,!0);"h"===g.orientation?a.select(this).attr("d","M"+h+","+r+"V"+n+"M"+c+","+r+"V"+n+"H"+u+"V"+r+"ZM"+c+","+e+"H"+d+"M"+u+","+e+"H"+p+(0===g.whiskerwidth?"":"M"+d+","+i+"V"+s+"M"+p+","+i+"V"+s)):a.select(this).attr("d","M"+r+","+h+"H"+n+"M"+r+","+c+"H"+n+"V"+u+"H"+r+"ZM"+e+","+c+"V"+d+"M"+e+","+u+"V"+p+(0===g.whiskerwidth?"":"M"+i+","+d+"H"+s+"M"+i+","+p+"H"+s))}),g.boxpoints&&a.select(this).selectAll("g.points").data(function(t){return t.forEach(function(t){t.t=r,t.trace=g}),t}).enter().append("g").attr("class","points").selectAll("path").data(function(t){var e,r,n,a,s,l,f,h="all"===g.boxpoints?t.val:t.val.filter(function(e){return et.uf}),d=(t.q3-t.q1)*u,p=[],v=0;if(g.jitter){for(e=0;et.lo&&(n.so=!0),n})}).enter().append("path").call(s.translatePoints,d,p),void(g.boxmean&&a.select(this).selectAll("path.mean").data(o.identity).enter().append("path").attr("class","mean").style("fill","none").each(function(t){var e=l.c2p(t.pos+y,!0),r=l.c2p(t.pos+y-m,!0),n=l.c2p(t.pos+y+m,!0),i=f.c2p(t.mean,!0),o=f.c2p(t.mean-t.sd,!0),s=f.c2p(t.mean+t.sd,!0);"h"===g.orientation?a.select(this).attr("d","M"+i+","+r+"V"+n+("sd"!==g.boxmean?"":"m0,0L"+o+","+e+"L"+i+","+r+"L"+s+","+e+"Z")):a.select(this).attr("d","M"+r+","+i+"H"+n+("sd"!==g.boxmean?"":"m0,0L"+e+","+o+"L"+r+","+i+"L"+e+","+s+"Z"))})))})}},{"../../components/drawing":325,"../../lib":381,d3:113}],493:[function(t,e,r){"use strict";var n=t("../../plots/plots"),i=t("../../plots/cartesian/axes"),a=t("../../lib");e.exports=function(t,e){var r,o,s,l,c=t._fullLayout,u=e.x(),f=e.y(),h=["v","h"];for(o=0;ol&&(e.z=u.slice(0,l)),s("locationmode"),s("text"),s("marker.line.color"),s("marker.line.width"),i(t,e,o,s,{prefix:"",cLetter:"z"}),void s("hoverinfo",1===o._dataLength?"location+z+text":void 0)):void(e.visible=!1)}},{"../../components/colorscale/defaults":312,"../../lib":381,"./attributes":495}],498:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../heatmap/colorbar"),n.calc=t("./calc"),n.plot=t("./plot").plot,n.moduleType="trace",n.name="choropleth",n.basePlotModule=t("../../plots/geo"),n.categories=["geo","noOpacity"],n.meta={},e.exports=n},{"../../plots/geo":424,"../heatmap/colorbar":512,"./attributes":495,"./calc":496,"./defaults":497,"./plot":499}],499:[function(t,e,r){"use strict";function n(t,e){function r(e){var r=t.mockAxis;return o.tickText(r,r.c2l(e),"hover").text}var n=e.hoverinfo;if("none"===n)return function(t){delete t.nameLabel,delete t.textLabel};var i="all"===n?v.hoverinfo.flags:n.split("+"),a=-1!==i.indexOf("name"),s=-1!==i.indexOf("location"),l=-1!==i.indexOf("z"),c=-1!==i.indexOf("text"),u=!a&&s;return function(t){var n=[];u?t.nameLabel=t.id:(a&&(t.nameLabel=e.name),s&&n.push(t.id)),l&&n.push(r(t.z)),c&&n.push(t.tx),t.textLabel=n.join("
")}}function i(t){return function(e,r){return{points:[{data:t._input,fullData:t,curveNumber:t.index,pointNumber:r,location:e.id,z:e.z}]}}}var a=t("d3"),o=t("../../plots/cartesian/axes"),s=t("../../plots/cartesian/graph_interact"),l=t("../../components/color"),c=t("../../components/drawing"),u=t("../../components/colorscale/get_scale"),f=t("../../components/colorscale/make_scale_function"),h=t("../../lib/topojson_utils").getTopojsonFeatures,d=t("../../lib/geo_location_utils").locationToFeature,p=t("../../lib/array_to_calc_item"),g=t("../../plots/geo/constants"),v=t("./attributes"),m=e.exports={};m.calcGeoJSON=function(t,e){for(var r,n=[],i=t.locations,a=i.length,o=h(t,e),s=(t.marker||{}).line||{},l=0;a>l;l++)r=d(t.locationmode,i[l],o),void 0!==r&&(r.z=t.z[l],void 0!==t.text&&(r.tx=t.text[l]),p(s.color,r,"mlc",l),p(s.width,r,"mlw",l),n.push(r));return n.length>0&&(n[0].trace=t),n},m.plot=function(t,e,r){var o,l=t.framework,c=l.select("g.choroplethlayer"),u=l.select("g.baselayer"),f=l.select("g.baselayeroverchoropleth"),h=g.baseLayersOverChoropleth,d=c.selectAll("g.trace.choropleth").data(e,function(t){return t.uid});d.enter().append("g").attr("class","trace choropleth"),d.exit().remove(),d.each(function(e){function r(e,r){if(t.showHover){var n=t.projection(e.properties.ct);c(e),s.loneHover({x:n[0],y:n[1],name:e.nameLabel,text:e.textLabel},{container:t.hoverContainer.node()}),f=u(e,r),t.graphDiv.emit("plotly_hover",f)}}function o(e,r){t.graphDiv.emit("plotly_click",u(e,r))}var l=m.calcGeoJSON(e,t.topojson),c=n(t,e),u=i(e),f=null,h=a.select(this).selectAll("path.choroplethlocation").data(l);h.enter().append("path").classed("choroplethlocation",!0).on("mouseover",r).on("click",o).on("mouseout",function(){s.loneUnhover(t.hoverContainer),t.graphDiv.emit("plotly_unhover",f)}).on("mousedown",function(){s.loneUnhover(t.hoverContainer)}).on("mouseup",r),h.exit().remove()}),f.selectAll("*").remove();for(var p=0;pr;r++)e=f[r],d[r]=e[0]*(t.zmax-t.zmin)+t.zmin,p[r]=e[1];var g=n.extent([t.zmin,t.zmax,a.start,a.start+l*(c-1)]),v=g[t.zminr;r++)e=f[r],d[r]=(e[0]*(c+u-1)-u/2)*l+o,p[r]=e[1];var y=n.scale.linear().interpolate(n.interpolateRgb).domain(d).range(p);return y}},{"../../components/colorscale/get_scale":314,d3:113}],507:[function(t,e,r){"use strict";function n(t,e,r){_.markTime("in Contour.plot");var n=r[0].trace,a=r[0].x,s=r[0].y,c=n.contours,u=n.uid,f=e.x(),h=e.y(),v=t._fullLayout,b="contour"+u,x=i(c,e,r[0]);if(n.visible!==!0)return v._paper.selectAll("."+b+",.hm"+u).remove(),void v._infolayer.selectAll(".cb"+u).remove();"heatmap"===c.coloring?(n.zauto&&n.autocontour===!1&&(n._input.zmin=n.zmin=c.start-c.size/2,n._input.zmax=n.zmax=n.zmin+x.length*c.size),k(t,e,[r])):v._paper.selectAll(".hm"+u).remove(),o(x),l(x);var w=f.c2p(a[0],!0),A=f.c2p(a[a.length-1],!0),M=h.c2p(s[0],!0),T=h.c2p(s[s.length-1],!0),E=[[w,T],[A,T],[A,M],[w,M]],L=d(e,r,b);p(L,E,c),g(L,x,E,c),m(L,x,c),y(L,e,r[0],E),_.markTime("done Contour.plot")}function i(t,e,r){for(var n=t.size||1,i=[],a=t.start;at?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);if(5===r||10===r){var n=(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4;return t>n?5===r?713:1114:5===r?104:208}return 15===r?0:r}function o(t){var e,r,n,i,o,s,l,c,u,f=t[0].z,h=f.length,d=f[0].length,p=2===h||2===d;for(r=0;h-1>r;r++)for(i=[],0===r&&(i=i.concat(A)),r===h-2&&(i=i.concat(M)),e=0;d-1>e;e++)for(n=i.slice(),0===e&&(n=n.concat(T)),e===d-2&&(n=n.concat(E)),o=e+","+r,s=[[f[r][e],f[r][e+1]],[f[r+1][e],f[r+1][e+1]]],u=0;ui;i++){if(s>20?(s=S[s][(l[0]||l[1])<0?0:1],t.crossings[o]=C[s]):delete t.crossings[o],l=L[s],!l){console.log("found bad marching index",s,e,t.level);break}if(d.push(h(t,e,l)),e[0]+=l[0],e[1]+=l[1],u(d[d.length-1],d[d.length-2])&&d.pop(),o=e.join(","),o===a&&l.join(",")===p||r&&(l[0]&&(e[0]<0||e[0]>v-2)||l[1]&&(e[1]<0||e[1]>g-2)))break;s=t.crossings[o]}1e4===i&&console.log("Infinite loop in contour?");var m,y,b,x,_,w,k,A=u(d[0],d[d.length-1]),M=0,T=.2*t.smoothing,E=[],z=0;for(i=1;i=z;i--)if(m=E[i],P>m){for(b=0,y=i-1;y>=z&&m+E[y]b&&m+E[b]e;)e++,r=Object.keys(i.crossings)[0].split(",").map(Number),s(i,r);1e4===e&&console.log("Infinite loop in contour?")}}function c(t,e,r){var n=0,i=0;return t>20&&e?208===t||1114===t?n=0===r[0]?1:-1:i=0===r[1]?1:-1:-1!==A.indexOf(t)?i=1:-1!==T.indexOf(t)?n=1:-1!==M.indexOf(t)?i=-1:n=-1,[n,i]}function u(t,e){return Math.abs(t[0]-e[0])<.01&&Math.abs(t[1]-e[1])<.01}function f(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function h(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)]}var c=(t.level-a)/(t.z[i+1][n]-a);return[o.c2p(t.x[n],!0),s.c2p((1-c)*t.y[i]+c*t.y[i+1],!0)]}function d(t,e,r){var n=t.plot.select(".maplayer").selectAll("g.contour."+r).data(e);return n.enter().append("g").classed("contour",!0).classed(r,!0),n.exit().remove(),n}function p(t,e,r){var n=t.selectAll("g.contourbg").data([0]);n.enter().append("g").classed("contourbg",!0);var 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 g(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=v(t,r);e?x.select(this).attr("d",e).style("stroke","none"):x.select(this).remove()})}function v(t,e){function r(t){return Math.abs(t[1]-e[0][1])<.01}function n(t){return Math.abs(t[1]-e[2][1])<.01}function i(t){return Math.abs(t[0]-e[0][0])<.01}function a(t){return Math.abs(t[0]-e[2][0])<.01}for(var o,s,l,c,u,f,h=t.edgepaths.length||t.z[0][0]l;l++){if(!o){console.log("missing end?",d,t);break}for(r(o)&&!a(o)?s=e[1]:i(o)?s=e[0]:n(o)?s=e[3]:a(o)&&(s=e[2]),u=0;u=0&&(s=v,c=u):Math.abs(o[1]-s[1])<.01?Math.abs(o[1]-v[1])<.01&&(v[0]-o[0])*(s[0]-v[0])>=0&&(s=v,c=u):console.log("endpt to newendpt is not vert. or horz.",o,s,v)}if(o=s,c>=0)break;h+="L"+s}if(c===t.edgepaths.length){console.log("unclosed perimeter path");break}d=c,g=-1===p.indexOf(d),g&&(d=p[0],h+="Z")}for(d=0;de;e++)s.push(1);for(e=0;a>e;e++)i.push(s.slice());for(e=0;eo;o++)for(n=i(l,o),u[o]=new Array(n),s=0;n>s;s++)u[o][s]=e(a(l,o,s));return u}function i(t,e,r,n,i,a){var o,s,l,c=[],u=h.traceIs(t,"contour"),f=h.traceIs(t,"histogram"),d=h.traceIs(t,"gl2d");if(Array.isArray(e)&&!f&&"category"!==a.type){e=e.map(a.d2c);var p=e.length;if(!(i>=p))return u?e.slice(0,i):e.slice(0,i+1);if(u||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]],l=1;p>l;l++)c.push(.5*(e[l-1]+e[l]));c.push(1.5*e[p-1]-.5*e[p-2])}if(i>p){var g=c[c.length-1],v=g-c[c.length-2];for(l=p;i>l;l++)g+=v,c.push(g)}}else for(s=n||1,o=void 0===r?0:f||"category"===a.type?r:a.d2c(r),l=u||d?0:-.5;i>l;l++)c.push(o+s*l);return c}function a(t){return.5-.25*Math.min(1,.5*t)}function o(t,e,r){var n,i,o=1;if(Array.isArray(r))for(n=0;nn&&o>y;n++)o=l(t,e,a(o));return o>y&&console.log("interp2d didn't converge quickly",o),t}function s(t){var e,r,n,i,a,o,s,l,c=[],u={},f=[],h=t[0],d=[],p=[0,0,0],g=m(t);for(r=0;rn;n++)void 0===d[n]&&(o=(void 0!==d[n-1]?1:0)+(void 0!==d[n+1]?1:0)+(void 0!==e[n]?1:0)+(void 0!==h[n]?1:0),o?(0===r&&o++,0===n&&o++,r===t.length-1&&o++,n===d.length-1&&o++,4>o&&(u[[r,n]]=[r,n,o]),c.push([r,n,o])):f.push([r,n]));for(;f.length;){for(s={},l=!1,a=f.length-1;a>=0;a--)i=f[a],r=i[0],n=i[1],o=((u[[r-1,n]]||p)[2]+(u[[r+1,n]]||p)[2]+(u[[r,n-1]]||p)[2]+(u[[r,n+1]]||p)[2])/20,o&&(s[i]=[r,n,o],f.splice(a,1),l=!0);if(!l)throw"findEmpties iterated with no new neighbors";for(i in s)u[i]=s[i],c.push(s[i])}return c.sort(function(t,e){return e[2]-t[2]})}function l(t,e,r){var n,i,a,o,s,l,c,u,f,h,d,p,g,v=0;for(o=0;os;s++)l=b[s],c=t[i+l[0]],c&&(u=c[a+l[1]],void 0!==u&&(0===h?p=g=u:(p=Math.min(p,u),g=Math.max(g,u)),f++,h+=u));if(0===f)throw"iterateInterp2d order is wrong: no defined neighbors";t[i][a]=h/f,void 0===d?4>f&&(v=1):(t[i][a]=(1+r)*t[i][a]-r*d,g>p&&(v=Math.max(v,Math.abs(t[i][a]-d)/(g-p))))}return v}var c=t("fast-isnumeric"),u=t("../../lib"),f=t("../../plots/cartesian/axes"),h=t("../../plots/plots"),d=t("../histogram2d/calc"),p=t("../../components/colorscale/calc"),g=t("./has_columns"),v=t("./convert_column_xyz"),m=t("./max_row_length");e.exports=function(t,e){function r(t){E=e._input.zsmooth=e.zsmooth=!1,u.notifier("cannot fast-zsmooth: "+t)}u.markTime("start convert x&y");var a,l,c,y,b,x,_,w,k=f.getFromId(t,e.xaxis||"x"),A=f.getFromId(t,e.yaxis||"y"),M=h.traceIs(e,"contour"),T=h.traceIs(e,"histogram"),E=M?"best":e.zsmooth;if(k._minDtick=0,A._minDtick=0,u.markTime("done convert x&y"),T){var L=d(t,e);a=L.x,l=L.x0,c=L.dx,y=L.y,b=L.y0,x=L.dy,_=L.z}else g(e)&&v(e,k,A),a=e.x?k.makeCalcdata(e,"x"):[],y=e.y?A.makeCalcdata(e,"y"):[],l=e.x0||0,c=e.dx||1,b=e.y0||0,x=e.dy||1,_=n(e),(M||e.connectgaps)&&(e._emptypoints=s(_),e._interpz=o(_,e._emptypoints,e._interpz));if("fast"===E)if("log"===k.type||"log"===A.type)r("log axis found");else if(!T){if(a.length){var S=(a[a.length-1]-a[0])/(a.length-1),C=Math.abs(S/100);for(w=0;wC){r("x scale is not linear");break}}if(y.length&&"fast"===E){var z=(y[y.length-1]-y[0])/(y.length-1),P=Math.abs(z/100);for(w=0;wP){r("y scale is not linear");break}}}var R=m(_),O="scaled"===e.xtype?"":e.x,I=i(e,O,l,c,R,k),N="scaled"===e.ytype?"":e.y,j=i(e,N,b,x,_.length,A);f.expand(k,I),f.expand(A,j);var F={x:I,y:j,z:_};if(p(e,_,"","z"),M&&e.contours&&"heatmap"===e.contours.coloring){var D="contour"===e.type?"heatmap":"histogram2d";F.xfill=i(D,O,l,c,R,k),F.yfill=i(D,N,b,x,_.length,A)}return[F]};var y=.01,b=[[-1,0],[1,0],[0,-1],[0,1]]},{"../../components/colorscale/calc":310,"../../lib":381,"../../plots/cartesian/axes":403,"../../plots/plots":452,"../histogram2d/calc":531,"./convert_column_xyz":513,"./has_columns":515,"./max_row_length":518,"fast-isnumeric":117}],512:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../lib"),o=t("../../plots/plots"),s=t("../../components/colorscale/get_scale"),l=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,c="cb"+r.uid,u=s(r.colorscale),f=r.zmin,h=r.zmax;if(i(f)||(f=a.aggNums(Math.min,null,r.z)),i(h)||(h=a.aggNums(Math.max,null,r.z)),t._fullLayout._infolayer.selectAll("."+c).remove(),!r.showscale)return void o.autoMargin(t,c);var d=e[0].t.cb=l(t,c);d.fillcolor(n.scale.linear().domain(u.map(function(t){return f+t[0]*(h-f)})).range(u.map(function(t){return t[1]}))).filllevels({start:f,end:h,size:(h-f)/254}).options(r.colorbar)(),a.markTime("done colorbar")}},{"../../components/colorbar/draw":306,"../../components/colorscale/get_scale":314,"../../lib":381,"../../plots/plots":452,d3:113,"fast-isnumeric":117}],513:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){var i,a=t.x.slice(),o=t.y.slice(),s=t.z,l=t.text,c=Math.min(a.length,o.length,s.length),u=void 0!==l&&!Array.isArray(l[0]);for(ci;i++)a[i]=e.d2c(a[i]),o[i]=r.d2c(o[i]);var f,h,d,p=n.distinctVals(a),g=p.vals,v=n.distinctVals(o),m=v.vals,y=n.init2dArray(m.length,g.length);for(u&&(d=n.init2dArray(m.length,g.length)),i=0;c>i;i++)f=n.findBin(a[i]+p.minDiff/2,g),h=n.findBin(o[i]+v.minDiff/2,m),y[h][f]=s[i],u&&(d[h][f]=l[i]);t.x=g,t.y=m,t.z=y,u&&(t.text=d)}},{"../../lib":381}],514:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./has_columns"),a=t("./xyz_defaults"),o=t("../../components/colorscale/defaults"),s=t("./attributes");e.exports=function(t,e,r,l){function c(r,i){return n.coerce(t,e,s,r,i)}var u=a(t,e,c);return u?(c("text"),c("zsmooth"),c("connectgaps",i(e)&&e.zsmooth!==!1),void o(t,e,l,c,{prefix:"",cLetter:"z"})):void(e.visible=!1)}},{"../../components/colorscale/defaults":312,"../../lib":381,"./attributes":510,"./has_columns":515,"./xyz_defaults":521}],515:[function(t,e,r){"use strict";e.exports=function(t){return!Array.isArray(t.z[0])}},{}],516:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/graph_interact"),i=t("../../lib");e.exports=function(t,e,r,a,o){if(!(t.distancec||c>=m[0].length||0>u||u>m.length)return}else{if(n.inbox(e-g[0],e-g[g.length-1])>n.MAXDIST||n.inbox(r-v[0],r-v[v.length-1])>n.MAXDIST)return;if(o){var w;for(b=[2*g[0]-g[1]],w=1;w0;)_=v.c2p(C[M]),M--;for(x>_&&(w=_,_=x,x=w,N=!0),M=0;void 0===k&&M0;)A=m.c2p(z[M]),M--;if(k>A&&(w=k,k=A,A=w,j=!0),P&&(C=r[0].xfill,z=r[0].yfill),"fast"!==R){var F="best"===R?0:.5;x=Math.max(-F*v._length,x),_=Math.min((1+F)*v._length,_),k=Math.max(-F*m._length,k),A=Math.min((1+F)*m._length,A)}var D=Math.round(_-x),B=Math.round(A-k);if(!(0>=D||0>=B)){var U,V;"fast"===R?(U=I,V=O):(U=D,V=B);var q=document.createElement("canvas");q.width=U,q.height=V;var H,G,Y=q.getContext("2d"),X=i.scale.linear().domain(S.map(function(t){return t[0]})).range(S.map(function(t){var e=a(t[1]).toRgb();return[e.r,e.g,e.b,e.a]})).clamp(!0);"fast"===R?(H=N?function(t){return I-1-t}:o.identity,G=j?function(t){return O-1-t}:o.identity):(H=function(t){return o.constrain(Math.round(v.c2p(C[t])-x),0,D)},G=function(t){return o.constrain(Math.round(m.c2p(z[t])-k),0,B)});var W,Z,K,$,Q,J,tt=G(0),et=[tt,tt],rt=N?0:1,nt=j?0:1,it=0,at=0,ot=0,st=0;if(o.markTime("done init png"),R){var lt=0,ct=new Uint8Array(D*B*4);if("best"===R){var ut,ft,ht,dt=new Array(C.length),pt=new Array(z.length),gt=new Array(D);for(M=0;MM;M++)gt[M]=n(M,dt);for(Z=0;B>Z;Z++)for(ut=n(Z,pt),ft=T[ut.bin0],ht=T[ut.bin1],M=0;D>M;M++,lt+=4)J=d(ft,ht,gt[M],ut),h(ct,lt,J)}else for(Z=0;O>Z;Z++)for(Q=T[Z],et=G(Z),M=0;D>M;M++)J=f(Q[M],1),lt=4*(et*D+H(M)),h(ct,lt,J);var vt=Y.createImageData(D,B);vt.data.set(ct),Y.putImageData(vt,0,0)}else for(Z=0;O>Z;Z++)if(Q=T[Z],et.reverse(),et[nt]=G(Z+1),et[0]!==et[1]&&void 0!==et[0]&&void 0!==et[1])for(K=H(0),W=[K,K],M=0;I>M;M++)W.reverse(),W[rt]=H(M+1),W[0]!==W[1]&&void 0!==W[0]&&void 0!==W[1]&&($=Q[M],J=f($,(W[1]-W[0])*(et[1]-et[0])),Y.fillStyle="rgba("+J.join(",")+")",Y.fillRect(W[0],et[0],W[1]-W[0],et[1]-et[0]));o.markTime("done filling png"),at=Math.round(at/it),ot=Math.round(ot/it),st=Math.round(st/it);var mt=a("rgb("+at+","+ot+","+st+")");t._hmpixcount=(t._hmpixcount||0)+it,t._hmlumcount=(t._hmlumcount||0)+it*mt.getLuminance();var yt=e.plot.select(".imagelayer").selectAll("g.hm."+b).data([0]);yt.enter().append("g").classed("hm",!0).classed(b,!0),yt.exit().remove();var bt=yt.selectAll("image").data(r);bt.enter().append("svg:image"),bt.exit().remove(),bt.attr({xmlns:c.svg,"xlink:href":q.toDataURL("image/png"),height:B,width:D,x:x,y:k,preserveAspectRatio:"none"}),o.markTime("done showing png")}}var i=t("d3"),a=t("tinycolor2"),o=t("../../lib"),s=t("../../plots/plots"),l=t("../../components/colorscale/get_scale"),c=t("../../constants/xmlns_namespaces"),u=t("./max_row_length");e.exports=function(t,e,r){for(var i=0;i0&&(n=!0);for(var s=0;si;i++)e[i]?(t[i]/=e[i],n+=t[i]):t[i]=null;return n}},{}],524:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){return r("histnorm"),n.forEach(function(t){var e=r(t+"bins.start"),n=r(t+"bins.end"),i=r("autobin"+t,!(e&&n));r(i?"nbins"+t:t+"bins.size")}),e}},{}],525:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports={count:function(t,e,r){return r[t]++,1},sum:function(t,e,r,i){var a=i[e];return n(a)?(a=Number(a),r[t]+=a,a):0},avg:function(t,e,r,i,a){var o=i[e];return n(o)&&(o=Number(o),r[t]+=o,a[t]++),0},min: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]>a)return r[t]=a,a-r[t]}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]r&&c.length<5e3;)g=a.tickIncrement(r,b.size),c.push((r+g)/2),u.push(S),x&&_.push(r),E&&w.push(1/(g-r)),P&&k.push(0),r=g;var R=u.length;for(r=0;r=0&&R>m&&(A+=C(m,r,u,y,k));P&&(A=l(u,k)),z&&z(u,A,w);var O=Math.min(c.length,u.length),I=[],N=0,j=O-1;for(r=0;O>r;r++)if(u[r]){N=r;break}for(r=O-1;r>N;r--)if(u[r]){j=r;break}for(r=N;j>=r;r++)n(c[r])&&n(u[r])&&I.push({p:c[r],s:u[r],b:0});return I}}},{"../../lib":381,"../../plots/cartesian/axes":403,"./average":523,"./bin_functions":525,"./norm_functions":529,"fast-isnumeric":117}],527:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color"),a=t("./bin_defaults"),o=t("../bar/style_defaults"),s=t("../../components/errorbars/defaults"),l=t("./attributes");e.exports=function(t,e,r,c){function u(r,i){return n.coerce(t,e,l,r,i)}var f=u("x"),h=u("y");u("text");var d=u("orientation",h&&!f?"h":"v"),p=e["v"===d?"x":"y"];if(!p||!p.length)return void(e.visible=!1);var g=e["h"===d?"x":"y"];g&&u("histfunc");var v="h"===d?["y"]:["x"];a(t,e,u,v),o(t,e,u,r,c),s(t,e,i.defaultLine,{axis:"y"}),s(t,e,i.defaultLine,{axis:"x",inherit:"y"})}},{"../../components/color":303,"../../components/errorbars/defaults":330,"../../lib":381,"../bar/style_defaults":484,"./attributes":522,"./bin_defaults":524}],528:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.layoutAttributes=t("../bar/layout_attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("../bar/layout_defaults"),n.calc=t("./calc"),n.setPositions=t("../bar/set_positions"),n.plot=t("../bar/plot"),n.style=t("../bar/style"),n.colorbar=t("../scatter/colorbar"),n.hoverPoints=t("../bar/hover"),n.moduleType="trace",n.name="histogram",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","bar","histogram","oriented","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":411,"../bar/hover":477,"../bar/layout_attributes":479,"../bar/layout_defaults":480,"../bar/plot":481,"../bar/set_positions":482,"../bar/style":483,"../scatter/colorbar":557,"./attributes":522,"./calc":526,"./defaults":527}],529:[function(t,e,r){"use strict";e.exports={percent:function(t,e){for(var r=t.length,n=100/e,i=0;r>i;i++)t[i]*=n},probability:function(t,e){for(var r=t.length,n=0;r>n;n++)t[n]/=e},density:function(t,e,r,n){var i=t.length;n=n||1;for(var a=0;i>a;a++)t[a]*=r[a]*n},"probability density":function(t,e,r,n){var i=t.length;n&&(e/=n);for(var a=0;i>a;a++)t[a]*=r[a]/e}}},{}],530:[function(t,e,r){"use strict";var n=t("../histogram/attributes"),i=t("../heatmap/attributes");e.exports={x:n.x,y:n.y,z:{valType:"data_array"},marker:{color:{valType:"data_array"}},histnorm:n.histnorm,histfunc:n.histfunc,autobinx:n.autobinx,nbinsx:n.nbinsx,xbins:n.xbins,autobiny:n.autobiny,nbinsy:n.nbinsy,ybins:n.ybins,zauto:i.zauto,zmin:i.zmin,zmax:i.zmax,colorscale:i.colorscale,autocolorscale:i.autocolorscale,reversescale:i.reversescale,showscale:i.showscale,zsmooth:i.zsmooth,_nestedModules:{colorbar:"Colorbar"}}},{"../heatmap/attributes":510,"../histogram/attributes":522}],531:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("../histogram/bin_functions"),o=t("../histogram/norm_functions"),s=t("../histogram/average");e.exports=function(t,e){var r,l,c,u,f,h,d=i.getFromId(t,e.xaxis||"x"),p=e.x?d.makeCalcdata(e,"x"):[],g=i.getFromId(t,e.yaxis||"y"),v=e.y?g.makeCalcdata(e,"y"):[],m=Math.min(p.length,v.length);p.length>m&&p.splice(m,p.length-m),v.length>m&&v.splice(m,v.length-m),n.markTime("done convert data"),!e.autobinx&&"xbins"in e||(e.xbins=i.autoBin(p,d,e.nbinsx,"2d"),"histogram2dcontour"===e.type&&(e.xbins.start-=e.xbins.size,e.xbins.end+=e.xbins.size),e._input.xbins=e.xbins),!e.autobiny&&"ybins"in e||(e.ybins=i.autoBin(v,g,e.nbinsy,"2d"),"histogram2dcontour"===e.type&&(e.ybins.start-=e.ybins.size,e.ybins.end+=e.ybins.size),e._input.ybins=e.ybins),n.markTime("done autoBin"),f=[];var y,b,x=[],_=[],w="string"==typeof e.xbins.size?[]:e.xbins,k="string"==typeof e.xbins.size?[]:e.ybins,A=0,M=[],T=e.histnorm,E=e.histfunc,L=-1!==T.indexOf("density"),S="max"===E||"min"===E,C=S?null:0,z=a.count,P=o[T],R=!1,O=[],I=[],N="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";N&&"count"!==E&&(R="avg"===E,z=a[E]);var j=e.xbins,F=j.end+(j.start-i.tickIncrement(j.start,j.size))/1e6;for(h=j.start;F>h;h=i.tickIncrement(h,j.size))x.push(C),Array.isArray(w)&&w.push(h),R&&_.push(0);Array.isArray(w)&&w.push(h);var D=x.length;for(r=e.xbins.start,l=(h-r)/D,r+=l/2,j=e.ybins,F=j.end+(j.start-i.tickIncrement(j.start,j.size))/1e6,h=j.start;F>h;h=i.tickIncrement(h,j.size))f.push(x.concat()),Array.isArray(k)&&k.push(h),R&&M.push(_.concat());Array.isArray(k)&&k.push(h);var B=f.length;for(c=e.ybins.start,u=(h-c)/B,c+=u/2,L&&(O=x.map(function(t,e){return Array.isArray(w)?1/(w[e+1]-w[e]):1/l}),I=f.map(function(t,e){return Array.isArray(k)?1/(k[e+1]-k[e]):1/u})),n.markTime("done making bins"),h=0;m>h;h++)y=n.findBin(p[h],w),b=n.findBin(v[h],k),y>=0&&D>y&&b>=0&&B>b&&(A+=z(y,h,f[b],N,M[b]));if(R)for(b=0;B>b;b++)A+=s(f[b],M[b]);if(P)for(b=0;B>b;b++)P(f[b],A,O,I[b]);return n.markTime("done binning"),{x:p,x0:r,dx:l,y:v,y0:c,dy:u,z:f}}},{"../../lib":381,"../../plots/cartesian/axes":403,"../histogram/average":523,"../histogram/bin_functions":525,"../histogram/norm_functions":529}],532:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./sample_defaults"),a=t("../../components/colorscale/defaults"),o=t("./attributes");e.exports=function(t,e,r){function s(r,i){return n.coerce(t,e,o,r,i)}i(t,e,s),s("zsmooth"),a(t,e,r,s,{prefix:"",cLetter:"z"})}},{"../../components/colorscale/defaults":312,"../../lib":381,"./attributes":530,"./sample_defaults":534}],533:[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":411,"../heatmap/calc":511,"../heatmap/colorbar":512,"../heatmap/hover":516,"../heatmap/plot":519,"../heatmap/style":520,"./attributes":530,"./defaults":532}],534:[function(t,e,r){"use strict";var n=t("../histogram/bin_defaults");e.exports=function(t,e,r){var i=r("x"),a=r("y");if(!(i&&i.length&&a&&a.length))return void(e.visible=!1);var o=r("z")||r("marker.color");o&&r("histfunc");var s=["x","y"];n(t,e,r,s)}},{"../histogram/bin_defaults":524}],535:[function(t,e,r){"use strict";var n=t("../histogram2d/attributes"),i=t("../contour/attributes");e.exports={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,zauto:i.zauto,zmin:i.zmin,zmax:i.zmax,colorscale:i.colorscale,autocolorscale:i.autocolorscale,reversescale:i.reversescale,showscale:i.showscale,autocontour:i.autocontour,ncontours:i.ncontours,contours:i.contours,line:i.line,_nestedModules:{colorbar:"Colorbar"}}},{"../contour/attributes":500,"../histogram2d/attributes":530}],536:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../histogram2d/sample_defaults"),a=t("../contour/style_defaults"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,i){return n.coerce(t,e,o,r,i)}i(t,e,l);var c=n.coerce2(t,e,o,"contours.start"),u=n.coerce2(t,e,o,"contours.end"),f=l("autocontour",!(c&&u));l(f?"ncontours":"contours.size"),a(t,e,l,s)}},{"../../lib":381,"../contour/style_defaults":509,"../histogram2d/sample_defaults":534,"./attributes":535}],537:[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"),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":411,"../contour/calc":501,"../contour/colorbar":502,"../contour/hover":504,"../contour/plot":507,"../contour/style":508,"./attributes":535,"./defaults":536}],538:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../surface/attributes"),a=t("../../lib/extend").extendFlat;e.exports={x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},i:{valType:"data_array"},j:{valType:"data_array"},k:{valType:"data_array"},delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z"},alphahull:{valType:"number",dflt:-1},intensity:{valType:"data_array"},color:{valType:"color"},vertexcolor:{valType:"data_array"},facecolor:{valType:"data_array"},opacity:a({},i.opacity),flatshading:{valType:"boolean",dflt:!1},contour:{show:a({},i.contours.x.show,{}),color:a({},i.contours.x.color),width:a({},i.contours.x.width)},colorscale:n.colorscale,reversescale:n.reversescale,showscale:n.showscale,lightposition:{x:a({},i.lightposition.x,{dflt:1e5}),y:a({},i.lightposition.y,{dflt:1e5}),z:a({},i.lightposition.z,{dflt:0})},lighting:a({},{vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6}},i.lighting),_nestedModules:{colorbar:"Colorbar"}}},{"../../components/colorscale/attributes":309,"../../lib/extend":376,"../surface/attributes":599}],539:[function(t,e,r){"use strict";function n(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}function i(t){return t.map(function(t){var e=t[0],r=c(t[1]),n=r.toRgb();return{index:e,rgb:[n.r,n.g,n.b,1]}})}function a(t){return t.map(d)}function o(t,e,r){for(var n=new Array(t.length),i=0;i0)s=f(t.alphahull,l);else{var c=["x","y","z"].indexOf(t.delaunayaxis);s=u(l.map(function(t){return[t[(c+1)%3],t[(c+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.colormap=i(t.colorscale)):t.vertexcolor?(this.color=t.vertexcolors[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":392,"alpha-shape":40,"convex-hull":102,"delaunay-triangulate":114,"gl-mesh3d":150,tinycolor2:274}],540:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/colorbar/defaults"),a=t("./attributes");e.exports=function(t,e,r,o){function s(r,i){return n.coerce(t,e,a,r,i)}function l(t){var e=t.map(function(t){var e=s(t);return e&&Array.isArray(e)?e:null});return e.every(function(t){return t&&t.length===e[0].length})&&e}var c=l(["x","y","z"]),u=l(["i","j","k"]);return c?(u&&u.forEach(function(t){for(var e=0;el||(c=p[r],void 0!==c&&""!==c||(c=r),c=String(c),void 0===y[c]&&(y[c]=!0,u=a(e.marker.colors[r]),u.isValid()?(u=o.addOpacity(u,u.getAlpha()),m[c]||(m[c]=u)):m[c]?u=m[c]:(u=!1,b=!0),f=-1!==_.indexOf(c),f||(x+=l),g.push({v:l,label:c,color:u,i:r,hidden:f}))));if(e.sort&&g.sort(function(t,e){return e.v-t.v}),b)for(r=0;r")}return g};var l},{"../../components/color":303,"./helpers":546,"fast-isnumeric":117,tinycolor2:274}],545:[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 c=o("labels");Array.isArray(c)||(o("label0"),o("dlabel"));var u=o("marker.line.width");u&&o("marker.line.color");var f=o("marker.colors");Array.isArray(f)||(e.marker.colors=[]),o("scalegroup");var h=o("text"),d=o("textinfo",Array.isArray(h)?"text+percent":"percent");if(o("hoverinfo",1===a._dataLength?"label+text+value+percent":void 0),d&&"none"!==d){var p=o("textposition"),g=Array.isArray(p)||"auto"===p,v=g||"inside"===p,m=g||"outside"===p;if(v||m){var y=s(o,"textfont",a.font);v&&s(o,"insidetextfont",y),m&&s(o,"outsidetextfont",y)}}o("domain.x"),o("domain.y"),o("hole"),o("sort"),o("direction"),o("rotation"),o("pull")}},{"../../lib":381,"./attributes":542}],546:[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":381}],547:[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":542,"./base_plot":543,"./calc":544,"./defaults":545,"./layout_attributes":548,"./layout_defaults":549,"./plot":550,"./style":551,"./style_one":552}],548:[function(t,e,r){"use strict";e.exports={hiddenlabels:{valType:"data_array"}}},{}],549:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}r("hiddenlabels")}},{"../../lib":381,"./layout_attributes":548}],550:[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),c={scale:l*r.r*2/n,rCenter:1-l,rotate:0};if(c.scale>=1)return c;var u=a+1/(2*Math.tan(o)),f=r.r*Math.min(1/(Math.sqrt(u*u+.5)+u),s/(Math.sqrt(a*a+s/2)+a)),h={scale:2*f/t.height,rCenter:Math.cos(f/r.r)-f*a/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},d=1/a,p=d+1/(2*Math.tan(o)),g=r.r*Math.min(1/(Math.sqrt(p*p+.5)+p),s/(Math.sqrt(d*d+s/2)+d)),v={scale:2*g/t.width,rCenter:Math.cos(g/r.r)-g/a/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},m=v.scale>h.scale?v:h;return c.scale<1&&m.scale>c.scale?m:c}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 0>r&&(i*=-1),0>n&&(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]}function i(t,r){r||(r={});var n,i,a,s,h,d,g=r.labelExtraY+(o?r.yLabelMax:r.yLabelMin),v=o?t.yLabelMin:t.yLabelMax,m=o?t.yLabelMax:t.yLabelMin,y=t.cyFinal+c(t.px0[1],t.px1[1]),b=g-v;if(b*f>0&&(t.labelExtraY=b),Array.isArray(e.pull))for(i=0;i=e.pull[a.i]||((t.pxmid[1]-a.pxmid[1])*f>0?(s=a.cyFinal+c(a.px0[1],a.px1[1]),b=s-v-t.labelExtraY,b*f>0&&(t.labelExtraY+=b)):(m+t.labelExtraY-y)*f>0&&(n=3*u*Math.abs(i-p.indexOf(t)),h=a.cxFinal+l(a.px0[0],a.px1[0]),d=h+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX,d*u>0&&(t.labelExtraX+=d)))}var a,o,s,l,c,u,f,h,d,p,g,v,m;for(o=0;2>o;o++)for(s=o?r:n,c=o?Math.max:Math.min,f=o?1:-1,a=0;2>a;a++){for(l=a?Math.max:Math.min,u=a?1:-1,h=t[o][a],h.sort(s),d=t[1-o][a],p=d.concat(h),v=[],g=0;gu&&(u=s.pull[a]);o.r=Math.min(r/c(s.tilt,Math.sin(l),s.depth),n/c(s.tilt,Math.cos(l),s.depth))/(2+2*u),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;af.vTotal/2?1:0)}function c(t,e,r){if(!t)return 1;var n=Math.sin(t*Math.PI/180);return Math.max(.01,r*n*Math.abs(e)+2*Math.sqrt(1-n*n*e*e))}var u=t("d3"),f=t("../../plots/cartesian/graph_interact"),h=t("../../components/color"),d=t("../../components/drawing"),p=t("../../lib/svg_text_utils"),g=t("./helpers");e.exports=function(t,e){var r=t._fullLayout;s(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 s=u.select(this),c=e[0],v=c.trace,m=0,y=(v.depth||0)*c.r*Math.sin(m)/2,b=v.tiltaxis||0,x=b*Math.PI/180,_=[y*Math.sin(x),y*Math.cos(x)],w=c.r*Math.cos(m),k=s.selectAll("g.part").data(v.tilt?["top","sides"]:["top"]);k.enter().append("g").attr("class",function(t){return t+" part"}),k.exit().remove(),k.order(),l(e),s.selectAll(".top").each(function(){var s=u.select(this).selectAll("g.slice").data(e);s.enter().append("g").classed("slice",!0),s.exit().remove();var l=[[[],[]],[[],[]]],m=!1;s.each(function(o){function s(e){var n=t._fullLayout,a=t._fullData[v.index],s=a.hoverinfo;if("all"===s&&(s="label+text+value+percent+name"),!t._dragging&&n.hovermode!==!1&&"none"!==s&&s){var l=i(o,c),u=k+o.pxmid[0]*(1-l),h=A+o.pxmid[1]*(1-l),d=r.separators,p=[]; +-1!==s.indexOf("label")&&p.push(o.label),a.text&&a.text[o.i]&&-1!==s.indexOf("text")&&p.push(a.text[o.i]),-1!==s.indexOf("value")&&p.push(g.formatPieValue(o.v,d)),-1!==s.indexOf("percent")&&p.push(g.formatPiePercent(o.v/c.vTotal,d)),f.loneHover({x0:u-l*c.r,x1:u+l*c.r,y:h,text:p.join("
"),name:-1!==s.indexOf("name")?a.name:void 0,color:o.color,idealAlign:o.pxmid[0]<0?"left":"right"},{container:n._hoverlayer.node(),outerContainer:n._paper.node()}),f.hover(t,e,"pie"),E=!0}}function h(e){t.emit("plotly_unhover",{points:[e]}),E&&(f.loneUnhover(r._hoverlayer.node()),E=!1)}function y(){t._hoverdata=[o],t._hoverdata.trace=e.trace,f.click(t,{target:!0})}function x(t,e,r,n){return"a"+n*c.r+","+n*w+" "+b+" "+o.largeArc+(r?" 1 ":" 0 ")+n*(e[0]-t[0])+","+n*(e[1]-t[1])}if(o.hidden)return void u.select(this).selectAll("path,g").remove();l[o.pxmid[1]<0?0:1][o.pxmid[0]<0?0:1].push(o);var k=c.cx+_[0],A=c.cy+_[1],M=u.select(this),T=M.selectAll("path.surface").data([o]),E=!1;if(T.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),M.select("path.textline").remove(),M.on("mouseover",s).on("mouseout",h).on("click",y),v.pull){var L=+(Array.isArray(v.pull)?v.pull[o.i]:v.pull)||0;L>0&&(k+=L*o.pxmid[0],A+=L*o.pxmid[1])}o.cxFinal=k,o.cyFinal=A;var S=v.hole;if(o.v===c.vTotal){var C="M"+(k+o.px0[0])+","+(A+o.px0[1])+x(o.px0,o.pxmid,!0,1)+x(o.pxmid,o.px0,!0,1)+"Z";S?T.attr("d","M"+(k+S*o.px0[0])+","+(A+S*o.px0[1])+x(o.px0,o.pxmid,!1,S)+x(o.pxmid,o.px0,!1,S)+"Z"+C):T.attr("d",C)}else{var z=x(o.px0,o.px1,!0,1);if(S){var P=1-S;T.attr("d","M"+(k+S*o.px1[0])+","+(A+S*o.px1[1])+x(o.px1,o.px0,!1,S)+"l"+P*o.px0[0]+","+P*o.px0[1]+z+"Z")}else T.attr("d","M"+k+","+A+"l"+o.px0[0]+","+o.px0[1]+z+"Z")}var R=Array.isArray(v.textposition)?v.textposition[o.i]:v.textposition,O=M.selectAll("g.slicetext").data(o.text&&"none"!==R?[0]:[]);O.enter().append("g").classed("slicetext",!0),O.exit().remove(),O.each(function(){var t=u.select(this).selectAll("text").data([0]);t.enter().append("text").attr("data-notex",1),t.exit().remove(),t.text(o.text).attr({"class":"slicetext",transform:"","data-bb":"","text-anchor":"middle",x:0,y:0}).call(d.font,"outside"===R?v.outsidetextfont:v.insidetextfont).call(p.convertToTspans),t.selectAll("tspan.line").attr({x:0,y:0});var e,r=d.bBox(t.node());"outside"===R?e=a(r,o):(e=n(r,o,c),"auto"===R&&e.scale<1&&(t.call(d.font,v.outsidetextfont),v.outsidetextfont.family===v.insidetextfont.family&&v.outsidetextfont.size===v.insidetextfont.size||(t.attr({"data-bb":""}),r=d.bBox(t.node())),e=a(r,o)));var i=k+o.pxmid[0]*e.rCenter+(e.x||0),s=A+o.pxmid[1]*e.rCenter+(e.y||0);e.outside&&(o.yLabelMin=s-r.height/2,o.yLabelMid=s,o.yLabelMax=s+r.height/2,o.labelExtraX=0,o.labelExtraY=0,m=!0),t.attr("transform","translate("+i+","+s+")"+(e.scale<1?"scale("+e.scale+")":"")+(e.rotate?"rotate("+e.rotate+")":"")+"translate("+-(r.left+r.right)/2+","+-(r.top+r.bottom)/2+")")})}),m&&o(l,v),s.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],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]);a+=Math.abs(s)>Math.abs(l)?"l"+l*t.pxmid[0]/t.pxmid[1]+","+l+"H"+(n+t.labelExtraX+o):"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(h.stroke,v.outsidetextfont.color).attr({"stroke-width":Math.min(2,v.outsidetextfont.size/8),d:a,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":303,"../../components/drawing":325,"../../lib/svg_text_utils":393,"../../plots/cartesian/graph_interact":410,"./helpers":546,d3:113}],551:[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":552,d3:113}],552:[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,fill:e.color}).call(n.stroke,i)}},{"../../components/color":303}],553:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){var e=t[0].trace,r=e.marker;if(n.mergeArray(e.text,t,"tx"),n.mergeArray(e.textposition,t,"tp"),e.textfont&&(n.mergeArray(e.textfont.size,t,"ts"),n.mergeArray(e.textfont.color,t,"tc"),n.mergeArray(e.textfont.family,t,"tf")),r&&r.line){var i=r.line;n.mergeArray(r.opacity,t,"mo"),n.mergeArray(r.symbol,t,"mx"),n.mergeArray(r.color,t,"mc"),n.mergeArray(i.color,t,"mlc"),n.mergeArray(i.width,t,"mlw")}}},{"../../lib":381}],554:[function(t,e,r){"use strict";var n=t("../../components/drawing");t("./constants");e.exports={x:{valType:"data_array"},x0:{valType:"any",dflt:0},dx:{valType:"number",dflt:1},y:{valType:"data_array"},y0:{valType:"any",dflt:0},dy:{valType:"number",dflt:1},text:{valType:"string",dflt:"",arrayOk:!0},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear"},smoothing:{valType:"number",min:0,max:1.3,dflt:1},dash:{valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid"}},connectgaps:{valType:"boolean",dflt:!1},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],dflt:"none"},fillcolor:{valType:"color"},marker:{symbol:{valType:"enumerated",values:n.symbolList,dflt:"circle",arrayOk:!0},opacity:{valType:"number",min:0,max:1,arrayOk:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0},color:{valType:"color",arrayOk:!0},maxdisplayed:{valType:"number",min:0,dflt:0},sizeref:{valType:"number",dflt:1},sizemin:{valType:"number",min:0,dflt:0},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter"},colorscale:{valType:"colorscale"},cauto:{valType:"boolean",dflt:!0},cmax:{valType:"number",dflt:null},cmin:{valType:"number",dflt:null},autocolorscale:{valType:"boolean",dflt:!0},reversescale:{valType:"boolean",dflt:!1},showscale:{valType:"boolean",dflt:!1},line:{color:{valType:"color",arrayOk:!0},width:{valType:"number",min:0,arrayOk:!0},colorscale:{valType:"colorscale"},cauto:{valType:"boolean",dflt:!0},cmax:{valType:"number",dflt:null},cmin:{valType:"number",dflt:null},autocolorscale:{valType:"boolean",dflt:!0},reversescale:{valType:"boolean",dflt:!1}}},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0},textfont:{family:{valType:"string",noBlank:!0,strict:!0,arrayOk:!0},size:{valType:"number",min:1,arrayOk:!0},color:{valType:"color",arrayOk:!0}},r:{valType:"data_array"},t:{valType:"data_array"},_nestedModules:{error_y:"ErrorBars",error_x:"ErrorBars","marker.colorbar":"Colorbar"}}},{"../../components/drawing":325,"./constants":558}],555:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/cartesian/axes"),a=t("../../lib"),o=t("./subtypes"),s=t("./marker_colorscale_calc");e.exports=function(t,e){var r=i.getFromId(t,e.xaxis||"x"),l=i.getFromId(t,e.yaxis||"y");a.markTime("in Scatter.calc");var c=r.makeCalcdata(e,"x");a.markTime("finished convert x");var u=l.makeCalcdata(e,"y");a.markTime("finished convert y");var f,h,d,p=Math.min(c.length,u.length);r._minDtick=0,l._minDtick=0,c.length>p&&c.splice(p,c.length-p),u.length>p&&u.splice(p,u.length-p);var g={padded:!0},v={padded:!0};if(o.hasMarkers(e)){if(f=e.marker,h=f.size,Array.isArray(h)){var m={type:"linear"};i.setConvert(m),h=m.makeCalcdata(e.marker,"size"),h.length>p&&h.splice(p,h.length-p)}var y,b=1.6*(e.marker.sizeref||1);y="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/b),3)}:function(t){return Math.max((t||0)/b,3)},g.ppad=v.ppad=Array.isArray(h)?h.map(y):y(h)}s(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||c[0]===c[p-1]&&u[0]===u[p-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)||c[0]===c[p-1]&&u[0]===u[p-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(v.padded=!1):v.tozero=!0,a.markTime("ready for Axes.expand"),i.expand(r,c,g),a.markTime("done expand x"),i.expand(l,u,v),a.markTime("done expand y");var x=new Array(p);for(d=0;p>d;d++)x[d]=n(c[d])&&n(u[d])?{x:c[d],y:u[d]}:{x:!1,y:!1};return void 0!==typeof h&&a.mergeArray(h,x,"ms"),t.firstscatter=!1,x}},{"../../lib":381,"../../plots/cartesian/axes":403,"./marker_colorscale_calc":568,"./subtypes":573,"fast-isnumeric":117}],556:[function(t,e,r){"use strict";e.exports=function(t){var e,r,n,i,a;for(e=0;e=0;i--)if(a=t[i],"scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}},{}],557:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../lib"),o=t("../../plots/plots"),s=t("../../components/colorscale/get_scale"),l=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,c=r.marker,u="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+u).remove(),void 0===c||!c.showscale)return void o.autoMargin(t,u);var f=s(c.colorscale),h=c.color,d=c.cmin,p=c.cmax;i(d)||(d=a.aggNums(Math.min,null,h)),i(p)||(p=a.aggNums(Math.max,null,h));var g=e[0].t.cb=l(t,u);g.fillcolor(n.scale.linear().domain(f.map(function(t){return d+t[0]*(p-d)})).range(f.map(function(t){return t[1]}))).filllevels({start:d,end:p,size:(p-d)/254}).options(c.colorbar)(),a.markTime("done colorbar")}},{"../../components/colorbar/draw":306,"../../components/colorscale/get_scale":314,"../../lib":381,"../../plots/plots":452,d3:113,"fast-isnumeric":117}],558:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20}},{}],559:[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"),c=t("./line_defaults"),u=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,g),m=vi(f))break;l=f,y=g[0]*p[0]+g[1]*p[1],y>v?(v=y,c=f,d=!1):m>y&&(m=y,u=f,d=!0)}if(d?(C[z++]=c,l!==u&&(C[z++]=u)):(u!==s&&(C[z++]=u),l!==c&&(C[z++]=c)),C[z++]=l,o>=t.length||!f)break;C[z++]=f,s=f}}else C[z++]=c}E.push(C.slice(0,z))}return E}},{"../../plots/cartesian/axes":403}],566:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n=r("line.shape");"spline"===n&&r("line.smoothing")}},{}],567:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t){var e=t.marker,r=e.sizeref||1,i=e.sizemin||0,a="area"===e.sizemode?function(t){return Math.sqrt(t/r)}:function(t){return t/r};return function(t){var e=a(t/2);return n(e)&&e>0?Math.max(e,i):0}}},{"fast-isnumeric":117}],568:[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){if(a.hasMarkers(t)){var e=t.marker;n(t,"marker")&&i(t,e.color,"marker","c"),n(t,"marker.line")&&i(t,e.line.color,"marker.line","c")}}},{"../../components/colorscale/calc":310,"../../components/colorscale/has_colorscale":315,"./subtypes":573}],569:[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){var c,u=o.isBubble(t),f=(t.line||{}).color;f&&(r=f),l("marker.symbol"),l("marker.opacity",u?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),c=f&&e.marker.color!==f?f:u?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",u?1:0),u&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode"))}},{"../../components/color":303,"../../components/colorscale/defaults":312,"../../components/colorscale/has_colorscale":315,"./subtypes":573}],570:[function(t,e,r){"use strict";function n(t,e,r){var n=e.x(),a=e.y(),o=i.extent(n.range.map(n.l2c)),s=i.extent(a.range.map(a.l2c));r.forEach(function(t,e){var n=t[0].trace;if(l.hasMarkers(n)){var i=n.marker.maxdisplayed;if(0!==i){var a=t.filter(function(t){return t.x>=o[0]&&t.x<=o[1]&&t.y>=s[0]&&t.y<=s[1]}),c=Math.ceil(a.length/i),u=0;r.forEach(function(t,r){var n=t[0].trace;l.hasMarkers(n)&&n.marker.maxdisplayed>0&&e>r&&u++});var f=Math.round(u*c/3+Math.floor(u/3)*c/7.1);t.forEach(function(t){delete t.vis}),a.forEach(function(t,e){0===Math.round((e+f)%c)&&(t.vis=!0)})}}})}var i=t("d3"),a=t("../../lib"),o=t("../../components/drawing"),s=t("../../components/errorbars"),l=t("./subtypes"),c=t("./arrays_to_calcdata"),u=t("./line_points");e.exports=function(t,e,r){function f(t){return t.filter(function(t){return t.vis})}n(t,e,r);var h=e.x(),d=e.y(),p=e.plot.select(".scatterlayer").selectAll("g.trace.scatter").data(r);p.enter().append("g").attr("class","trace scatter").style("stroke-miterlimit",2),p.call(s.plot,e);var g,v,m,y,b="";p.each(function(t){var e=t[0].trace,r=e.line,n=i.select(this);if(e.visible===!0&&(v=e.fill.charAt(e.fill.length-1),"x"!==v&&"y"!==v&&(v=""),t[0].node3=n,c(t),l.hasLines(e)||"none"!==e.fill)){var a,s,f,p,x,_="",w="";g="tozero"===e.fill.substr(0,6)||"toself"===e.fill||"to"===e.fill.substr(0,2)&&!b?n.append("path").classed("js-fill",!0):null,y&&(m=y.datum(t)),y=n.append("path").classed("js-fill",!0),-1!==["hv","vh","hvh","vhv"].indexOf(r.shape)?(f=o.steps(r.shape),p=o.steps(r.shape.split("").reverse().join(""))):f=p="spline"===r.shape?function(t){var e=t[t.length-1];return t[0][0]===e[0]&&t[0][1]===e[1]?o.smoothclosed(t.slice(1),r.smoothing):o.smoothopen(t,r.smoothing)}:function(t){return"M"+t.join("L")},x=function(t){return p(t.reverse())};var k=u(t,{xaxis:h,yaxis:d,connectGaps:e.connectgaps,baseTolerance:Math.max(r.width||1,3)/4,linear:"linear"===r.shape});if(k.length){for(var A=k[0][0],M=k[k.length-1],T=M[M.length-1],E=0;E1&&n.append("path").classed("js-line",!0).attr("d",a)}g?A&&T&&(v?("y"===v?A[1]=T[1]=d.c2p(0,!0):"x"===v&&(A[0]=T[0]=h.c2p(0,!0)),g.attr("d",_+"L"+T+"L"+A+"Z")):g.attr("d",_+"Z")):"tonext"===e.fill.substr(0,6)&&_&&b&&("tonext"===e.fill?m.attr("d",_+"Z"+b+"Z"):m.attr("d",_+"L"+b.substr(1)+"Z")),b=w}}}),p.selectAll("path:not([d])").remove(),p.append("g").attr("class","points").each(function(t){var e=t[0].trace,r=i.select(this),n=l.hasMarkers(e),s=l.hasText(e);!n&&!s||e.visible!==!0?r.remove():(n&&r.selectAll("path.point").data(e.marker.maxdisplayed?f:a.identity).enter().append("path").classed("point",!0).call(o.translatePoints,h,d),s&&r.selectAll("g").data(e.marker.maxdisplayed?f:a.identity).enter().append("g").append("text").call(o.translatePoints,h,d))})}},{"../../components/drawing":325,"../../components/errorbars":331,"../../lib":381,"./arrays_to_calcdata":553,"./line_points":565,"./subtypes":573,d3:113}],571:[function(t,e,r){"use strict";var n=t("./subtypes"),i=.2;e.exports=function(t,e){var r,a,o,s,l=t.cd,c=t.xaxis,u=t.yaxis,f=[],h=l[0].trace,d=h.index,p=h.marker;if(n.hasMarkers(h)||n.hasText(h)){var g=Array.isArray(p.opacity)?1:p.opacity;if(e===!1)for(r=0;rs;s++){for(var l=[[0,0,0],[0,0,0]],c=0;3>c;c++)if(r[c])for(var u=0;2>u;u++)l[u][c]=r[c][s][u];o[s]=l}return o}var o=t("../../components/errorbars/compute_error");e.exports=a},{"../../components/errorbars/compute_error":329}],579:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.linePlot=null,this.scatterPlot=null,this.errorBars=null,this.textMarkers=null,this.delaunayMesh=null,this.color=null,this.mode="",this.dataPoints=[],this.axesBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.textLabels=null,this.data=null}function i(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],s=[];for(n=0;ni;i++){var a=t[i];a&&a.copy_zstyle!==!1&&(a=t[2]),a&&(e[i]=a.width/2,r[i]=b(a.color),n=a.thickness)}return{capSize:e,color:r,lineWidth:n}}function o(t){var e=[0,0];return Array.isArray(t)?[0,-1]:(t.indexOf("bottom")>=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 k[t]}function c(t,e,r,n,i){var a=null;if(Array.isArray(t)){a=[];for(var o=0;e>o;o++)void 0===t[o]?a[o]=n:a[o]=r(t[o],i)}else a=r(t,y.identity);return a}function u(t,e){var r,n,i,u,f,h,d=[],p=t.fullSceneLayout,g=t.dataScale,v=p.xaxis,m=p.yaxis,w=p.zaxis,k=e.marker,M=e.line,T=e.x||[],E=e.y||[],L=e.z||[],S=T.length;for(n=0;S>n;n++)i=v.d2l(T[n])*g[0],u=m.d2l(E[n])*g[1],f=w.d2l(L[n])*g[2],d[n]=[i,u,f];if(Array.isArray(e.text))h=e.text;else if(void 0!==e.text)for(h=new Array(S),n=0;S>n;n++)h[n]=e.text;if(r={position:d,mode:e.mode,text:h},"line"in e&&(r.lineColor=b(M.color),r.lineWidth=M.width,r.lineDashes=M.dash),"marker"in e){var C=_(e);r.scatterColor=x(k,1,S),r.scatterSize=c(k.size,S,s,20,C),r.scatterMarker=c(k.symbol,S,l,"\u25cf"),r.scatterLineWidth=k.line.width,r.scatterLineColor=x(k.line,1,S),r.scatterAngle=0}"textposition"in e&&(r.textOffset=o(e.textposition),r.textColor=x(e.textfont,1,S),r.textSize=c(e.textfont.size,S,y.identity,12),r.textFont=e.textfont.family,r.textAngle=0);var z=["x","y","z"];for(r.project=[!1,!1,!1],r.projectScale=[1,1,1],r.projectOpacity=[1,1,1],n=0;3>n;++n){var P=e.projection[z[n]];(r.project[n]=P.show)&&(r.projectOpacity[n]=P.opacity,r.projectScale[n]=P.scale)}r.errorBounds=A(e,g);var R=a([e.error_x,e.error_y,e.error_z]);return r.errorColor=R.color,r.errorLineWidth=R.lineWidth,r.errorCapSize=R.capSize,r.delaunayAxis=e.surfaceaxis,r.delaunayColor=b(e.surfacecolor),r}function f(t){if(Array.isArray(t)){var e=t[0];return Array.isArray(e)&&(t=e),"rgb("+t.slice(0,3).map(function(t){return Math.round(255*t)})+")"}return null}function h(t,e){var r=new n(t,e.uid);return r.update(e),r}var d=t("gl-line3d"),p=t("gl-scatter3d"),g=t("gl-error3d"),v=t("gl-mesh3d"),m=t("delaunay-triangulate"),y=t("../../lib"),b=t("../../lib/str2rgbarray"),x=t("../../lib/gl_format_color"),_=t("../scatter/make_bubble_size_func"),w=t("../../constants/gl3d_dashes"),k=t("../../constants/gl_markers"),A=t("./calc_errors"),M=n.prototype;M.handlePick=function(t){if(t.object&&(t.object===this.linePlot||t.object===this.delaunayMesh||t.object===this.textMarkers||t.object===this.scatterPlot)){t.object.highlight&&t.object.highlight(null),this.scatterPlot&&(t.object=this.scatterPlot,this.scatterPlot.highlight(t.data)),this.textLabels&&void 0!==this.textLabels[t.data.index]?t.textLabel=this.textLabels[t.data.index]:t.textLabel="";var e=t.data.index;return t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]],!0}},M.update=function(t){var e,r,n,a,o=this.scene.glplot.gl,s=w.solid;this.data=t;var l=u(this.scene,t);"mode"in l&&(this.mode=l.mode),"lineDashes"in l&&l.lineDashes in w&&(s=w[l.lineDashes]),this.color=f(l.scatterColor)||f(l.lineColor),this.dataPoints=l.position,e={gl:o,position:l.position,color:l.lineColor,lineWidth:l.lineWidth||1,dashes:s[0],dashScale:s[1],opacity:t.opacity,connectGaps:t.connectgaps},-1!==this.mode.indexOf("lines")?this.linePlot?this.linePlot.update(e):(this.linePlot=d(e),this.scene.glplot.add(this.linePlot)):this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose(),this.linePlot=null);var c=t.opacity;if(t.marker&&t.marker.opacity&&(c*=t.marker.opacity),r={gl:o,position:l.position,color:l.scatterColor,size:l.scatterSize,glyph:l.scatterMarker,opacity:c,orthographic:!0,lineWidth:l.scatterLineWidth,lineColor:l.scatterLineColor,project:l.project,projectScale:l.projectScale,projectOpacity:l.projectOpacity},-1!==this.mode.indexOf("markers")?this.scatterPlot?this.scatterPlot.update(r):(this.scatterPlot=p(r),this.scatterPlot.highlightScale=1,this.scene.glplot.add(this.scatterPlot)):this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose(),this.scatterPlot=null),a={gl:o,position:l.position,glyph:l.text,color:l.textColor,size:l.textSize,angle:l.textAngle,alignment:l.textOffset,font:l.textFont,orthographic:!0,lineWidth:0,project:!1,opacity:t.opacity},this.textLabels=l.text,-1!==this.mode.indexOf("text")?this.textMarkers?this.textMarkers.update(a):(this.textMarkers=p(a),this.textMarkers.highlightScale=1,this.scene.glplot.add(this.textMarkers)):this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose(),this.textMarkers=null),n={gl:o,position:l.position,color:l.errorColor,error:l.errorBounds,lineWidth:l.errorLineWidth,capSize:l.errorCapSize,opacity:t.opacity},this.errorBars?l.errorBounds?this.errorBars.update(n):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):l.errorBounds&&(this.errorBars=g(n),this.scene.glplot.add(this.errorBars)),l.delaunayAxis>=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.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},M.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":367,"../../constants/gl_markers":368,"../../lib":381,"../../lib/gl_format_color":379,"../../lib/str2rgbarray":392,"../scatter/make_bubble_size_func":567,"./calc_errors":578,"delaunay-triangulate":114,"gl-error3d":121,"gl-line3d":127,"gl-mesh3d":150,"gl-scatter3d":193}],580:[function(t,e,r){"use strict";function n(t,e,r){var n=0,i=r("x"),a=r("y"),o=r("z");return i&&a&&o&&(n=Math.min(i.length,a.length,o.length),n=0&&h("surfacecolor",p||g);for(var v=["x","y","z"],m=0;3>m;++m){var y="projection."+v[m];h(y+".show")&&(h(y+".opacity"),h(y+".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":330,"../../lib":381,"../scatter/line_defaults":564,"../scatter/marker_defaults":569,"../scatter/subtypes":573,"../scatter/text_defaults":574,"./attributes":576}],581:[function(t,e,r){"use strict";var n={};n.plot=t("./convert"),n.attributes=t("./attributes"),n.markerSymbols=t("../../constants/gl_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/gl_markers":368,"../../plots/gl3d":439,"../scatter/colorbar":557,"./attributes":576,"./calc":577,"./convert":579,"./defaults":580}],582:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../lib/extend").extendFlat,o=n.marker,s=n.line,l=o.line;e.exports={lon:{valType:"data_array"},lat:{valType:"data_array"},locations:{valType:"data_array"},locationmode:{valType:"enumerated",values:["ISO-3","USA-states","country names"],dflt:"ISO-3"},mode:a({},n.mode,{dflt:"markers"}),text:a({},n.text,{}),line:{color:s.color,width:s.width,dash:s.dash},marker:{symbol:o.symbol,opacity:o.opacity,size:o.size,sizeref:o.sizeref,sizemin:o.sizemin,sizemode:o.sizemode,color:o.color,colorscale:o.colorscale,cauto:o.cauto,cmax:o.cmax,cmin:o.cmin,autocolorscale:o.autocolorscale,reversescale:o.reversescale,showscale:o.showscale,line:{color:l.color,width:l.width,colorscale:l.colorscale,cauto:l.cauto,cmax:l.cmax,cmin:l.cmin,autocolorscale:l.autocolorscale,reversescale:l.reversescale}},textfont:n.textfont,textposition:n.textposition,hoverinfo:a({},i.hoverinfo,{flags:["lon","lat","location","text","name"]}),_nestedModules:{"marker.colorbar":"Colorbar"}}},{"../../lib/extend":376,"../../plots/attributes":401,"../scatter/attributes":554}],583:[function(t,e,r){"use strict";var n=t("../scatter/marker_colorscale_calc");e.exports=function(t,e){var r=[{x:!1,y:!1,trace:e,t:{}}];return n(e),r}},{"../scatter/marker_colorscale_calc":568}],584:[function(t,e,r){"use strict";function n(t,e,r){var n,i,a=0,o=r("locations");return o?(r("locationmode"),a=o.length):(n=r("lon")||[],i=r("lat")||[],a=Math.min(n.length,i.length),an;n++)r[n]=[t.lon[n],t.lat[n]];return{type:"LineString",coordinates:r,trace:t}}function a(t,e){function r(e){var r=t.mockAxis;return c.tickText(r,r.c2l(e),"hover").text+"\xb0"}var n=e.hoverinfo;if("none"===n)return function(t){delete t.textLabel};var i="all"===n?v.hoverinfo.flags:n.split("+"),a=-1!==i.indexOf("location")&&Array.isArray(e.locations),o=-1!==i.indexOf("lon"),s=-1!==i.indexOf("lat"),l=-1!==i.indexOf("text");return function(t){var n=[];a?n.push(t.location):o&&s?n.push("("+r(t.lon)+", "+r(t.lat)+")"):o?n.push("lon: "+r(t.lon)):s&&n.push("lat: "+r(t.lat)),l&&n.push(t.tx||e.text),t.textLabel=n.join("
")}}function o(t){var e=Array.isArray(t.locations);return function(r,n){return{points:[{data:t._input,fullData:t,curveNumber:t.index,pointNumber:n,lon:r.lon,lat:r.lat,location:e?r.location:null}]}}}var s=t("d3"),l=t("../../plots/cartesian/graph_interact"),c=t("../../plots/cartesian/axes"),u=t("../../lib/topojson_utils").getTopojsonFeatures,f=t("../../lib/geo_location_utils").locationToFeature,h=t("../../lib/array_to_calc_item"),d=t("../../components/color"),p=t("../../components/drawing"),g=t("../scatter/subtypes"),v=t("./attributes"),m=e.exports={};m.calcGeoJSON=function(t,e){var r,i,a,o,s=[],l=Array.isArray(t.locations);l?(o=t.locations,r=o.length,i=u(t,e),a=function(t,e){var r=f(t.locationmode,o[e],i);return void 0!==r?r.properties.ct:void 0}):(r=t.lon.length,a=function(t,e){return[t.lon[e],t.lat[e]]});for(var c=0;r>c;c++){var h=a(t,c);if(h){var d={lon:h[0],lat:h[1],location:l?t.locations[c]:null};n(t,d,c),s.push(d)}}return s.length>0&&(s[0].trace=t),s},m.plot=function(t,e){var r=t.framework.select(".scattergeolayer").selectAll("g.trace.scattergeo").data(e,function(t){return t.uid});r.enter().append("g").attr("class","trace scattergeo"),r.exit().remove(),r.selectAll("*").remove(),r.each(function(t){var e=s.select(this);g.hasLines(t)&&e.selectAll("path.js-line").data([i(t)]).enter().append("path").classed("js-line",!0)}),r.each(function(e){function r(r,n){if(t.showHover){var i=t.projection([r.lon,r.lat]);h(r),l.loneHover({x:i[0],y:i[1],name:v?e.name:void 0,text:r.textLabel,color:r.mc||(e.marker||{}).color},{container:t.hoverContainer.node()}),y=d(r,n),t.graphDiv.emit("plotly_hover",y)}}function n(e,r){t.graphDiv.emit("plotly_click",d(e,r))}var i=s.select(this),c=g.hasMarkers(e),u=g.hasText(e);if(c||u){var f=m.calcGeoJSON(e,t.topojson),h=a(t,e),d=o(e),p=e.hoverinfo,v="all"===p||-1!==p.indexOf("name"),y=null;c&&i.selectAll("path.point").data(f).enter().append("path").classed("point",!0).on("mouseover",r).on("click",n).on("mouseout",function(){l.loneUnhover(t.hoverContainer),t.graphDiv.emit("plotly_unhover",y)}).on("mousedown",function(){l.loneUnhover(t.hoverContainer)}).on("mouseup",r),u&&i.selectAll("g").data(f).enter().append("g").append("text")}}),m.style(t)},m.style=function(t){var e=t.framework.selectAll("g.trace.scattergeo");e.style("opacity",function(t){return t.opacity}),e.each(function(t){s.select(this).selectAll("path.point").call(p.pointStyle,t),s.select(this).selectAll("text").call(p.textPointStyle,t)}),e.selectAll("path.js-line").style("fill","none").each(function(t){var e=t.trace,r=e.line||{};s.select(this).call(d.stroke,r.color).call(p.dashLine,r.dash||"",r.width||0)})}},{"../../components/color":303,"../../components/drawing":325,"../../lib/array_to_calc_item":372,"../../lib/geo_location_utils":378,"../../lib/topojson_utils":394,"../../plots/cartesian/axes":403,"../../plots/cartesian/graph_interact":410,"../scatter/subtypes":573,"./attributes":582,d3:113}],587:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../constants/gl2d_dashes"),a=t("../../constants/gl_markers"),o=t("../../lib/extend").extendFlat,s=n.line,l=n.marker,c=l.line;e.exports={x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,text:o({},n.text,{}),mode:{valType:"flaglist",flags:["lines","markers"],extras:["none"]},line:{color:s.color,width:s.width,dash:{valType:"enumerated",values:Object.keys(i),dflt:"solid"}},marker:{color:l.color,symbol:{valType:"enumerated",values:Object.keys(a),dflt:"circle",arrayOk:!0},size:l.size,sizeref:l.sizeref,sizemin:l.sizemin,sizemode:l.sizemode,opacity:l.opacity,colorscale:l.colorscale,cauto:l.cauto,cmax:l.cmax,cmin:l.cmin,autocolorscale:l.autocolorscale,reversescale:l.reversescale,showscale:l.showscale,line:{color:c.color,width:c.width,colorscale:c.colorscale,cauto:c.cauto,cmax:c.cmax,cmin:c.cmin,autocolorscale:c.autocolorscale,reversescale:c.reversescale}},connectgaps:n.connectgaps,fill:o({},n.fill,{values:["none","tozeroy","tozerox"]}),fillcolor:n.fillcolor,_nestedModules:{error_x:"ErrorBars",error_y:"ErrorBars","marker.colorbar":"Colorbar"}}},{"../../constants/gl2d_dashes":366,"../../constants/gl_markers":368,"../../lib/extend":376,"../scatter/attributes":554}],588:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.connectgaps=!0,this.idToIndex=[],this.bounds=[0,0,0,0],this.hasLines=!1,this.lineOptions={positions:new Float32Array(0),color:[0,0,0,1],width:1,fill:[!1,!1,!1,!1],fillColor:[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],dashes:[1]},this.line=d(t.glplot,this.lineOptions),this.line._trace=this,this.hasErrorX=!1,this.errorXOptions={positions:new Float32Array(0),errors:new Float32Array(0),lineWidth:1,capSize:0,color:[0,0,0,1]},this.errorX=p(t.glplot,this.errorXOptions),this.errorX._trace=this,this.hasErrorY=!1,this.errorYOptions={positions:new Float32Array(0),errors:new Float32Array(0),lineWidth:1,capSize:0,color:[0,0,0,1]},this.errorY=p(t.glplot,this.errorYOptions),this.errorY._trace=this,this.hasMarkers=!1,this.scatterOptions={positions:new Float32Array(0),sizes:[],colors:[],glyphs:[],borderWidths:[],borderColors:[],size:12,color:[0,0,0,1],borderSize:1,borderColor:[0,0,0,1]},this.scatter=f(t.glplot,this.scatterOptions),this.scatter._trace=this,this.fancyScatter=h(t.glplot,this.scatterOptions),this.fancyScatter._trace=this}function i(t,e,r){return Array.isArray(e)||(e=[e]),a(t,e,r)}function a(t,e,r){for(var n=new Array(r),i=e[0],a=0;r>a;++a)n[a]=t(a>=e.length?i:e[a]);return n}function o(t,e,r){return l(S(t,r),L(e,r),r)}function s(t,e,r,n){var i=x(t,e,n);return i=Array.isArray(i[0])?i:a(v.identity,[i],n),l(i,L(r,n),n)}function l(t,e,r){for(var n=new Array(4*r),i=0;r>i;++i){for(var a=0;3>a;++a)n[4*i+a]=t[i][a];n[4*i+3]=t[i][3]*e[i]}return n}function c(t,e){if(void 0===Float32Array.slice){for(var r=new Float32Array(e),n=0;e>n;n++)r[n]=t[n];return r}return t.slice(0,e)}function u(t,e){var r=new n(t,e.uid);return r.update(e),r}var f=t("gl-scatter2d"),h=t("gl-scatter2d-fancy"),d=t("gl-line2d"),p=t("gl-error2d"),g=t("fast-isnumeric"),v=t("../../lib"),m=t("../../plots/cartesian/axes"),y=t("../../components/errorbars"),b=t("../../lib/str2rgbarray"),x=t("../../lib/gl_format_color"),_=t("../scatter/subtypes"),w=t("../scatter/make_bubble_size_func"),k=t("../scatter/get_trace_color"),A=t("../../constants/gl_markers"),M=t("../../constants/gl2d_dashes"),T=["xaxis","yaxis"],E=n.prototype;E.handlePick=function(t){var e=t.pointId;return(t.object!==this.line||this.connectgaps)&&(e=this.idToIndex[t.pointId]),{trace:this,dataCoord:t.dataCoord,traceCoord:[this.pickXData[e],this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:Array.isArray(this.color)?this.color[e]:this.color,name:this.name,hoverinfo:this.hoverinfo}},E.isFancy=function(t){if("linear"!==this.scene.xaxis.type)return!0;if("linear"!==this.scene.yaxis.type)return!0;if(!t.x||!t.y)return!0;var e=t.marker||{};if(Array.isArray(e.symbol)||"circle"!==e.symbol||Array.isArray(e.size)||Array.isArray(e.line.width)||Array.isArray(e.opacity))return!0;var r=e.color;if(Array.isArray(r))return!0;var n=Array.isArray(e.line.color);return Array.isArray(n)?!0:this.hasErrorX?!0:!!this.hasErrorY};var L=i.bind(null,function(t){return+t}),S=i.bind(null,b),C=i.bind(null,function(t){return A[t]||"\u25cf"});E.update=function(t){t.visible!==!0?(this.hasLines=!1,this.hasErrorX=!1,this.hasErrorY=!1,this.hasMarkers=!1):(this.hasLines=_.hasLines(t),this.hasErrorX=t.error_x.visible===!0,this.hasErrorY=t.error_y.visible===!0,this.hasMarkers=_.hasMarkers(t)),this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.connectgaps=!!t.connectgaps,this.isFancy(t)?this.updateFancy(t):this.updateFast(t),this.color=k(t,{})},E.updateFast=function(t){for(var e,r,n=this.xData=this.pickXData=t.x,i=this.yData=this.pickYData=t.y,a=n.length,o=new Array(a),s=new Float32Array(2*a),l=this.bounds,u=0,f=0,h=0;a>h;++h)e=n[h],r=i[h],g(e)&&g(r)&&(o[u++]=h,s[f++]=e,s[f++]=r,l[0]=Math.min(l[0],e),l[1]=Math.min(l[1],r),l[2]=Math.max(l[2],e),l[3]=Math.max(l[3],r));s=c(s,f),this.idToIndex=o,this.updateLines(t,s),this.updateError("X",t),this.updateError("Y",t);var d;if(this.hasMarkers){this.scatterOptions.positions=s;var p=b(t.marker.color),v=b(t.marker.line.color),m=t.opacity*t.marker.opacity;p[3]*=m,this.scatterOptions.color=p,v[3]*=m,this.scatterOptions.borderColor=v,d=t.marker.size,this.scatterOptions.size=d,this.scatterOptions.borderSize=t.marker.line.width,this.scatter.update(this.scatterOptions)}else this.scatterOptions.positions=new Float32Array(0),this.scatterOptions.glyphs=[],this.scatter.update(this.scatterOptions);this.scatterOptions.positions=new Float32Array(0),this.scatterOptions.glyphs=[],this.fancyScatter.update(this.scatterOptions),this.expandAxesFast(l,d)},E.updateFancy=function(t){var e=this.scene,r=e.xaxis,n=e.yaxis,a=this.bounds,o=this.pickXData=r.makeCalcdata(t,"x").slice(),l=this.pickYData=n.makeCalcdata(t,"y").slice();this.xData=o.slice(),this.yData=l.slice();var u,f,h,d,p,g,v,m,b=y.calcFromTrace(t,e.fullLayout),x=o.length,_=new Array(x),k=new Float32Array(2*x),A=new Float32Array(4*x),M=new Float32Array(4*x),T=0,E=0,S=0,z=0,P="log"===r.type?function(t){return r.d2l(t)}:function(t){return t},R="log"===n.type?function(t){return n.d2l(t)}:function(t){return t};for(u=0;x>u;++u)this.xData[u]=h=P(o[u]),this.yData[u]=d=R(l[u]),isNaN(h)||isNaN(d)||(_[T++]=u,k[E++]=h,k[E++]=d,p=A[S++]=h-b[u].xs||0,g=A[S++]=b[u].xh-h||0,A[S++]=0,A[S++]=0,M[z++]=0,M[z++]=0,v=M[z++]=d-b[u].ys||0,m=M[z++]=b[u].yh-d||0,a[0]=Math.min(a[0],h-p),a[1]=Math.min(a[1],d-v),a[2]=Math.max(a[2],h+g),a[3]=Math.max(a[3],d+m));k=c(k,E),this.idToIndex=_,this.updateLines(t,k),this.updateError("X",t,k,A),this.updateError("Y",t,k,M);var O;if(this.hasMarkers){this.scatterOptions.positions=k,this.scatterOptions.sizes=new Array(T),this.scatterOptions.glyphs=new Array(T),this.scatterOptions.borderWidths=new Array(T),this.scatterOptions.colors=new Array(4*T),this.scatterOptions.borderColors=new Array(4*T);var I,N=w(t),j=t.marker,F=j.opacity,D=t.opacity,B=s(j,F,D,x),U=C(j.symbol,x),V=L(j.line.width,x),q=s(j.line,F,D,x);for(O=i(N,j.size,x),u=0;T>u;++u)for(I=_[u],this.scatterOptions.sizes[u]=4*O[I],this.scatterOptions.glyphs[u]=U[I],this.scatterOptions.borderWidths[u]=.5*V[I],f=0;4>f;++f)this.scatterOptions.colors[4*u+f]=B[4*I+f],this.scatterOptions.borderColors[4*u+f]=q[4*I+f];this.fancyScatter.update(this.scatterOptions)}else this.scatterOptions.positions=new Float32Array(0),this.scatterOptions.glyphs=[],this.fancyScatter.update(this.scatterOptions);this.scatterOptions.positions=new Float32Array(0),this.scatterOptions.glyphs=[],this.scatter.update(this.scatterOptions),this.expandAxesFancy(o,l,O)},E.updateLines=function(t,e){var r;if(this.hasLines){var n=e;if(!t.connectgaps){var i=0,a=this.xData,o=this.yData;for(n=new Float32Array(2*a.length),r=0;ro;o++)r=this.scene[T[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})},E.expandAxesFancy=function(t,e,r){var n=this.scene,i={padded:!0,ppad:r};m.expand(n.xaxis,t,i),m.expand(n.yaxis,e,i)},E.dispose=function(){this.line.dispose(),this.errorX.dispose(),this.errorY.dispose(),this.scatter.dispose(),this.fancyScatter.dispose()},e.exports=u},{"../../components/errorbars":331,"../../constants/gl2d_dashes":366,"../../constants/gl_markers":368,"../../lib":381,"../../lib/gl_format_color":379,"../../lib/str2rgbarray":392,"../../plots/cartesian/axes":403,"../scatter/get_trace_color":561,"../scatter/make_bubble_size_func":567,"../scatter/subtypes":573,"fast-isnumeric":117,"gl-error2d":119,"gl-line2d":125,"gl-scatter2d":190,"gl-scatter2d-fancy":185}],589:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/constants"),a=t("../scatter/subtypes"),o=t("../scatter/xy_defaults"),s=t("../scatter/marker_defaults"),l=t("../scatter/line_defaults"),c=t("../scatter/fillcolor_defaults"),u=t("../../components/errorbars/defaults"),f=t("./attributes");e.exports=function(t,e,r,h){function d(r,i){return n.coerce(t,e,f,r,i)}var p=o(t,e,d);return p?(d("text"),d("mode",pr;r++)y=e.a[r],b=e.b[r],x=e.c[r],n(y)&&n(b)&&n(x)?(y=+y,b=+b,x=+x,_=v/(y+b+x),1!==_&&(y*=_,b*=_,x*=_),k=y,w=x-b,M[r]={x:w,y:k,a:y,b:b,c:x}):M[r]={x:!1,y:!1};var T,E;if(o.hasMarkers(e)&&(T=e.marker,E=T.size,Array.isArray(E))){var L={type:"linear"};i.setConvert(L),E=L.makeCalcdata(e.marker,"size"),E.length>A&&E.splice(A,E.length-A)}return s(e),void 0!==typeof E&&a.mergeArray(E,M,"ms"),M}},{"../../lib":381,"../../plots/cartesian/axes":403,"../scatter/marker_colorscale_calc":568,"../scatter/subtypes":573,"fast-isnumeric":117}],593:[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"),c=t("../scatter/text_defaults"),u=t("../scatter/fillcolor_defaults"),f=t("./attributes");e.exports=function(t,e,r,h){function d(r,i){return n.coerce(t,e,f,r,i)}var p,g=d("a"),v=d("b"),m=d("c");if(g?(p=g.length,v?(p=Math.min(p,v.length),m&&(p=Math.min(p,m.length))):p=m?Math.min(p,m.length):0):v&&m&&(p=Math.min(v.length,m.length)),!p)return void(e.visible=!1);g&&p"),s}}},{"../../plots/cartesian/axes":403,"../scatter/hover":562}],595:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="scatterternary",n.basePlotModule=t("../../plots/ternary"),n.categories=["ternary","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../plots/ternary":459,"../scatter/colorbar":557,"./attributes":591,"./calc":592,"./defaults":593,"./hover":594,"./plot":596,"./select":597,"./style":598}],596:[function(t,e,r){"use strict";var n=t("../scatter/plot");e.exports=function(t,e){for(var r={x:function(){return t.xaxis},y:function(){return t.yaxis},plot:t.plotContainer},i=new Array(e.length),a=t.graphDiv.calcdata,o=0;oe){for(var r=g/e,n=[0|Math.floor(t[0].shape[0]*r+1),0|Math.floor(t[0].shape[1]*r+1)],i=n[0]*n[1],o=0;or;++r)this.showContour[r]&&(e=!0,t[r]=this.scene.contourLevels[r]);e&&this.surface.update({levels:t})},v.update=function(t){var e,r=this.scene,n=r.fullSceneLayout,a=this.surface,s=t.opacity,l=i(t.colorscale,s),u=t.z,h=t.x,d=t.y,g=n.xaxis,v=n.yaxis,m=n.zaxis,y=r.dataScale,b=u[0].length,x=u.length,_=[c(new Float32Array(b*x),[b,x]),c(new Float32Array(b*x),[b,x]),c(new Float32Array(b*x),[b,x])],w=_[0],k=_[1],A=r.contourLevels;this.data=t,f(_[2],function(t,e){return m.d2l(u[e][t])*y[2]}),Array.isArray(h[0])?f(w,function(t,e){return g.d2l(h[e][t])*y[0]}):f(w,function(t){return g.d2l(h[t])*y[0]}),Array.isArray(d[0])?f(k,function(t,e){return v.d2l(d[e][t])*y[1]}):f(k,function(t,e){return v.d2l(d[e])*y[1]});var M={colormap:l,levels:[[],[],[]],showContour:[!0,!0,!0],showSurface:!t.hidesurface,contourProject:[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],contourWidth:[1,1,1],contourColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],contourTint:[1,1,1],dynamicColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],dynamicWidth:[1,1,1],dynamicTint:[1,1,1],opacity:1};if(M.intensityBounds=[t.cmin,t.cmax],t.surfacecolor){var T=c(new Float32Array(b*x),[b,x]);f(T,function(e,r){return t.surfacecolor[r][e]}),_.push(T)}else M.intensityBounds[0]*=y[2],M.intensityBounds[1]*=y[2];this.dataScale=o(_),t.surfacecolor&&(M.intensity=_.pop()),"opacity"in t&&t.opacity<1&&(M.opacity=.25*t.opacity);var E=[!0,!0,!0],L=["x","y","z"];for(e=0;3>e;++e){var S=t.contours[L[e]];E[e]=S.highlight,M.showContour[e]=S.show||S.highlight,M.showContour[e]&&(M.contourProject[e]=[S.project.x,S.project.y,S.project.z],S.show?(this.showContour[e]=!0,M.levels[e]=A[e],a.highlightColor[e]=M.contourColor[e]=p(S.color),S.usecolormap?a.highlightTint[e]=M.contourTint[e]=0:a.highlightTint[e]=M.contourTint[e]=1,M.contourWidth[e]=S.width):this.showContour[e]=!1,S.highlight&&(M.dynamicColor[e]=p(S.highlightcolor),M.dynamicWidth[e]=S.highlightwidth))}M.coords=_,a.update(M),a.visible=t.visible,a.enableDynamic=E,a.snapToData=!0,"lighting"in t&&(a.ambientLight=t.lighting.ambient,a.diffuseLight=t.lighting.diffuse,a.specularLight=t.lighting.specular,a.roughness=t.lighting.roughness,a.fresnel=t.lighting.fresnel),"lightposition"in t&&(void 0===a.lightPosition?a.lightPosition=[t.lightposition.x,t.lightposition.y,t.lightposition.z]:(a.lightPosition.x=t.lightposition.x,a.lightPosition.y=t.lightposition.y,a.lightPosition.z=t.lightposition.z)),s&&1>s&&(a.supportsTransparency=!0)},v.dispose=function(){this.scene.glplot.remove(this.surface),this.surface.dispose()},e.exports=s},{"../../lib/str2rgbarray":392,"gl-surface3d":221,ndarray:253,"ndarray-fill":246,"ndarray-homography":251, +"ndarray-ops":252,tinycolor2:274}],603:[function(t,e,r){"use strict";function n(t,e,r){e in t&&!(r in t)&&(t[r]=t[e])}var 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)}var c,u,f=l("z");if(!f)return void(e.visible=!1);var h=f[0].length,d=f.length;if(l("x"),l("y"),!Array.isArray(e.x))for(e.x=[],c=0;h>c;++c)e.x[c]=c;if(l("text"),!Array.isArray(e.y))for(e.y=[],c=0;d>c;++c)e.y[c]=c;["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lightposition.x","lightposition.y","lightposition.z","hidesurface","opacity"].forEach(function(t){l(t)});var p=l("surfacecolor");l("colorscale");var g=["x","y","z"];for(c=0;3>c;++c){var v="contours."+g[c],m=l(v+".show"),y=l(v+".highlight");if(m||y)for(u=0;3>u;++u)l(v+".project."+g[u]);m&&(l(v+".color"),l(v+".width"),l(v+".usecolormap")),y&&(l(v+".highlightcolor"),l(v+".highlightwidth"))}p||(n(t,"zmin","cmin"),n(t,"zmax","cmax"),n(t,"zauto","cauto")),a(t,e,s,l,{prefix:"",cLetter:"c"})}},{"../../components/colorscale/defaults":312,"../../lib":381,"./attributes":599}],604:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("./colorbar"),n.calc=t("./calc"),n.plot=t("./convert"),n.moduleType="trace",n.name="surface",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d","noOpacity"],n.meta={},e.exports=n},{"../../plots/gl3d":439,"./attributes":599,"./calc":600,"./colorbar":601,"./convert":602,"./defaults":603}]},{},[12])(12)}); \ No newline at end of file diff --git a/src/components/drawing/index.js b/src/components/drawing/index.js index b6c4b999fe3..6beffebd4fb 100644 --- a/src/components/drawing/index.js +++ b/src/components/drawing/index.js @@ -46,16 +46,61 @@ drawing.setRect = function(s, x, y, w, h) { s.call(drawing.setPosition, x, y).call(drawing.setSize, w, h); }; -drawing.translatePoints = function(s, xa, ya) { - s.each(function(d) { +drawing.translatePoints = function(s, xa, ya, trace, transitionConfig, joinDirection) { + + var hasTransition = transitionConfig && (transitionConfig || {}).duration > 0; + + if (hasTransition) { + var size = s.size(); + } + + s.each(function(d, i) { // put xp and yp into d if pixel scaling is already done var x = d.xp || xa.c2p(d.x), y = d.yp || ya.c2p(d.y), p = d3.select(this); if(isNumeric(x) && isNumeric(y)) { // for multiline text this works better - if(this.nodeName === 'text') p.attr('x', x).attr('y', y); - else p.attr('transform', 'translate(' + x + ',' + y + ')'); + if(this.nodeName==='text') { + p.attr('x',x).attr('y',y); + } else { + if (hasTransition) { + var trans; + if (!joinDirection) { + trans = p.transition() + .delay(transitionConfig.delay + transitionConfig.cascade / size * i) + .duration(transitionConfig.duration) + .ease(transitionConfig.easing) + .attr('transform', 'translate('+x+','+y+')') + + if (trace) { + trans.call(drawing.pointStyle, trace) + } + } else if (joinDirection === -1) { + trans = p.style('opacity', 1) + .transition() + .duration(transitionConfig.duration) + .ease(transitionConfig.easing) + .style('opacity', 0) + .remove(); + } else if (joinDirection === 1) { + trans = p.attr('transform', 'translate('+x+','+y+')') + + if (trace) { + trans.call(drawing.pointStyle, trace) + } + + trans.style('opacity', 0) + .transition() + .duration(transitionConfig.duration) + .ease(transitionConfig.easing) + .style('opacity', 1) + } + + } else { + p.attr('transform', 'translate('+x+','+y+')'); + } + } } else p.remove(); }); @@ -218,7 +263,7 @@ drawing.pointStyle = function(s, trace) { markerScale = drawing.tryColorscale(marker, markerIn, ''), lineScale = drawing.tryColorscale(marker, markerIn, 'line.'); - s.each(function(d) { + s.each(function(d, i) { // 'so' is suspected outliers, for box plots var fillColor, lineColor, @@ -235,11 +280,11 @@ drawing.pointStyle = function(s, trace) { if('mlc' in d) lineColor = d.mlcc = lineScale(d.mlc); // weird case: array wasn't long enough to apply to every point - else if(Array.isArray(markerLine.color)) lineColor = Color.defaultLine; + else if(Array.isArray(markerLine.color)) lineColor = marker.color[i]; else lineColor = markerLine.color; if('mc' in d) fillColor = d.mcc = markerScale(d.mc); - else if(Array.isArray(marker.color)) fillColor = Color.defaultLine; + else if(Array.isArray(marker.color)) fillColor = marker.color[i]; else fillColor = marker.color || 'rgba(0,0,0,0)'; } diff --git a/src/components/errorbars/plot.js b/src/components/errorbars/plot.js index 3f44ed58df1..40243835044 100644 --- a/src/components/errorbars/plot.js +++ b/src/components/errorbars/plot.js @@ -14,12 +14,17 @@ var isNumeric = require('fast-isnumeric'); var Lib = require('../../lib'); var subTypes = require('../../traces/scatter/subtypes'); +var styleError = require('./style'); -module.exports = function plot(traces, plotinfo) { +module.exports = function plot(traces, plotinfo, transitionConfig) { var xa = plotinfo.x(), ya = plotinfo.y(); + + transitionConfig = transitionConfig || {}; + var hasAnimation = isNumeric(transitionConfig.duration) && transitionConfig.duration > 0 + traces.each(function(d) { var trace = d[0].trace, // || {} is in case the trace (specifically scatterternary) @@ -29,6 +34,12 @@ module.exports = function plot(traces, plotinfo) { xObj = trace.error_x || {}, yObj = trace.error_y || {}; + var keyFunc; + + if (trace.key) { + keyFunc = function (d) { return d.key }; + } + var sparse = ( subTypes.hasMarkers(trace) && trace.marker.maxdisplayed > 0 @@ -36,12 +47,24 @@ module.exports = function plot(traces, plotinfo) { if(!yObj.visible && !xObj.visible) return; + var errorbars = d3.select(this).selectAll('g.errorbar') - .data(Lib.identity); + .data(Lib.identity, keyFunc); errorbars.enter().append('g') .classed('errorbar', true); + if (hasAnimation) { + errorbars.exit() + .style('opacity', 1) + .transition() + .duration(transitionConfig.duration) + .style('opacity', 0) + .remove(); + } else { + errorbars.exit().remove(); + } + errorbars.each(function(d) { var errorbar = d3.select(this); var coords = errorCoords(d, xa, ya); @@ -59,14 +82,37 @@ module.exports = function plot(traces, plotinfo) { coords.yh + 'h' + (2 * yw) + // hat 'm-' + yw + ',0V' + coords.ys; // bar + if(!coords.noYS) path += 'm-' + yw + ',0h' + (2 * yw); // shoe - errorbar.append('path') - .classed('yerror', true) - .attr('d', path); + var yerror = errorbar.select('path.yerror'); + + var isNew = !yerror.size(); + + if (isNew) { + yerror = errorbar.append('path') + .classed('yerror', true); + + if (hasAnimation) { + yerror = yerror.style('opacity', 0); + } + } else if (hasAnimation) { + yerror = yerror.transition() + .duration(transitionConfig.duration) + .ease(transitionConfig.easing) + .delay(transitionConfig.delay) + } + + yerror.attr('d', path); + + if (isNew && hasAnimation) { + yerror = yerror.transition() + .duration(transitionConfig.duration) + .style('opacity', 1); + } } - if(xObj.visible && isNumeric(coords.y) && + if(xObj.visible && isNumeric(coords.x) && isNumeric(coords.xh) && isNumeric(coords.xs)) { var xw = (xObj.copy_ystyle ? yObj : xObj).width; @@ -77,11 +123,35 @@ module.exports = function plot(traces, plotinfo) { if(!coords.noXS) path += 'm0,-' + xw + 'v' + (2 * xw); // shoe - errorbar.append('path') - .classed('xerror', true) - .attr('d', path); + var xerror = errorbar.select('path.xerror'); + + var isNew = !xerror.size(); + + if (isNew) { + xerror = errorbar.append('path') + .classed('xerror', true); + + if (hasAnimation) { + xerror = xerror.style('opacity', 0); + } + } else if (hasAnimation) { + xerror = xerror.transition() + .duration(transitionConfig.duration) + .ease(transitionConfig.easing) + .delay(transitionConfig.delay) + } + + xerror.attr('d', path); + + if (isNew && hasAnimation) { + xerror = xerror.transition() + .duration(transitionConfig.duration) + .style('opacity', 1); + } } }); + + d3.select(this).call(styleError); }); }; diff --git a/src/core.js b/src/core.js index cb597f88bb3..d24507c0bf2 100644 --- a/src/core.js +++ b/src/core.js @@ -21,6 +21,7 @@ exports.version = '1.13.0'; exports.plot = Plotly.plot; exports.newPlot = Plotly.newPlot; exports.restyle = Plotly.restyle; +exports.animate = Plotly.animate; exports.relayout = Plotly.relayout; exports.redraw = Plotly.redraw; exports.extendTraces = Plotly.extendTraces; diff --git a/src/lib/index.js b/src/lib/index.js index 32f3f811a67..4d5170d96c8 100644 --- a/src/lib/index.js +++ b/src/lib/index.js @@ -585,3 +585,89 @@ lib.numSeparate = function(value, separators) { return x1 + x2; }; + +/* + * Deep copy of an object, subject to some caveats. Adapted from + * http://stackoverflow.com/questions/10728412/in-javascript-when-performing-a-deep-copy-how-do-i-avoid-a-cycle-due-to-a-pro#answer-10729242 + * + * It does some basics like avoiding infinite loops, but leaves some gaps + * regarding prototypes and functions. But those shouldn't be part of the + * layout anyway, which is the intended use. + * + * @param {object} object the object to be cloned + * @param {function} shallowFilter a callback executed on each attribute name + * @param {Array} path a stack representing the current attr path + * + * @return {object} the cloned object + */ +lib.deepClone = function deepClone (object, shallowFilter, path) { + var nextPath, isShallow; + var gdcc = "__getDeepCircularCopy__"; + if (object !== Object(object)) { + return object; // primitive value + } + + var set = gdcc in object; + var cache = object[gdcc]; + var result; + if (set && typeof cache == "function") { + return cache(); + } + // else + object[gdcc] = function () { return result; }; // overwrite + + if (object instanceof Array) { + result = []; + for (var i=0; i= 0; i--) { + if (gd.data[i][isClonedFlag]) continue; + + // Clone this trace if it's not already cloned. Otherwise the original input + // to Plotly.plot gets mangled and we can't use it again, which is inconvenient. + // Notably, this does *not* copy data arrays. + type = gd._fullData[i].type; + schema = Plotly.PlotSchema.get().traces[type] + gd.data[i] = Lib.deepCloneTrace(gd.data[i], schema); + gd.data[i][isClonedFlag] = true; + } +} diff --git a/src/plots/cartesian/index.js b/src/plots/cartesian/index.js index 56f827f0ec6..500c477b0d2 100644 --- a/src/plots/cartesian/index.js +++ b/src/plots/cartesian/index.js @@ -11,6 +11,8 @@ var Plots = require('../plots'); +var d3 = require('d3'); + var constants = require('./constants'); exports.name = 'cartesian'; @@ -25,7 +27,9 @@ exports.attrRegex = constants.attrRegex; exports.attributes = require('./attributes'); -exports.plot = function(gd) { +exports.transitionAxes = require('./transition_axes'); + +exports.plot = function(gd, traces, transitionOpts) { var fullLayout = gd._fullLayout, subplots = Plots.getSubplotIds(fullLayout, 'cartesian'), calcdata = gd.calcdata, @@ -38,6 +42,9 @@ exports.plot = function(gd) { var cd = calcdata[i]; var trace = cd[0].trace; + // Skip trace if whitelist provided and it's not whitelisted: + // if (Array.isArray(traces) && traces.indexOf(i) === -1) continue; + if(trace.xaxis + trace.yaxis === subplot) { cdSubplot.push(cd); } @@ -67,9 +74,13 @@ exports.plot = function(gd) { cdSubplot = getCdSubplot(calcdata, subplot); // remove old traces, then redraw everything - // TODO: use enter/exit appropriately in the plot functions - // so we don't need this - should sometimes be a big speedup - if(subplotInfo.plot) subplotInfo.plot.selectAll('g.trace').remove(); + // TODO: scatterlayer is manually excluded from this since it knows how + // to update instead of fully removing and redrawing every time. The + // remaining plot traces should also be able to do this. Once implemented, + // we won't need this - which should sometimes be a big speedup. + if(subplotInfo.plot) { + subplotInfo.plot.selectAll('g:not(.scatterlayer)').selectAll('g.trace').remove(); + } for(var j = 0; j < modules.length; j++) { var _module = modules[j]; @@ -79,7 +90,8 @@ exports.plot = function(gd) { // plot all traces of this type on this subplot at once var cdModule = getCdModule(cdSubplot, _module); - _module.plot(gd, subplotInfo, cdModule); + + _module.plot(gd, subplotInfo, cdModule, traces, transitionOpts); } } }; diff --git a/src/plots/cartesian/transition_axes.js b/src/plots/cartesian/transition_axes.js new file mode 100644 index 00000000000..b6f1d404022 --- /dev/null +++ b/src/plots/cartesian/transition_axes.js @@ -0,0 +1,266 @@ +/** +* Copyright 2012-2016, Plotly, Inc. +* All rights reserved. +* +* This source code is licensed under the MIT license found in the +* LICENSE file in the root directory of this source tree. +*/ + + +'use strict'; + +var d3 = require('d3'); +var isNumeric = require('fast-isnumeric'); + +var Plotly = require('../../plotly'); +var Lib = require('../../lib'); +var svgTextUtils = require('../../lib/svg_text_utils'); +var Titles = require('../../components/titles'); +var Color = require('../../components/color'); +var Drawing = require('../../components/drawing'); +var Axes = require('./axes'); + +var axisRegex = /((x|y)([2-9]|[1-9][0-9]+)?)axis$/; + +module.exports = function transitionAxes(gd, newLayout, transitionConfig) { + var fullLayout = gd._fullLayout; + var axes = []; + + function computeUpdates (layout) { + var ai, attrList, match, to, axis, update, i; + var updates = {}; + + for (ai in layout) { + var attrList = ai.split('.'); + var match = attrList[0].match(axisRegex); + if (match) { + var axisName = match[1]; + axis = fullLayout[axisName + 'axis']; + update = {}; + + if (Array.isArray(layout[ai])) { + update.to = layout[ai].slice(0); + } else { + if (Array.isArray(layout[ai].range)) { + update.to = layout[ai].range.slice(0); + } + } + if (!update.to) continue; + + update.axis = axis; + update.length = axis._length; + + axes.push(axisName); + + updates[axisName] = update; + } + } + + return updates; + } + + function computeAffectedSubplots (fullLayout, updatedAxisIds) { + var plotName; + var plotinfos = fullLayout._plots; + var affectedSubplots = []; + + for (plotName in plotinfos) { + var plotinfo = plotinfos[plotName]; + + if (affectedSubplots.indexOf(plotinfo) !== -1) continue; + + var x = plotinfo.xaxis._id; + var y = plotinfo.yaxis._id; + + if (updatedAxisIds.indexOf(x) !== -1 || updatedAxisIds.indexOf(y) !== -1) { + affectedSubplots.push(plotinfo); + } + } + + return affectedSubplots; + } + + var updates = computeUpdates(newLayout); + var updatedAxisIds = Object.keys(updates); + var affectedSubplots = computeAffectedSubplots(fullLayout, updatedAxisIds); + var easeFn = d3.ease(transitionConfig.easing); + + function ticksAndAnnotations(xa, ya) { + var activeAxIds = [], + i; + + activeAxIds = [xa._id, ya._id]; + + for(i = 0; i < activeAxIds.length; i++) { + Axes.doTicks(gd, activeAxIds[i], true); + } + + function redrawObjs(objArray, module) { + var obji; + for(i = 0; i < objArray.length; i++) { + obji = objArray[i]; + if((activeAxIds.indexOf(obji.xref) !== -1) || + (activeAxIds.indexOf(obji.yref) !== -1)) { + module.draw(gd, i); + } + } + } + + redrawObjs(fullLayout.annotations || [], Plotly.Annotations); + redrawObjs(fullLayout.shapes || [], Plotly.Shapes); + redrawObjs(fullLayout.images || [], Plotly.Images); + } + + function unsetSubplotTransform (subplot) { + var xa2 = subplot.x(); + var ya2 = subplot.y(); + + var viewBox = [0, 0, xa2._length, ya2._length]; + + var xScaleFactor = xa2._length / viewBox[2], + yScaleFactor = ya2._length / viewBox[3]; + + var clipDx = viewBox[0], + clipDy = viewBox[1]; + + var fracDx = (viewBox[0] / viewBox[2] * xa2._length), + fracDy = (viewBox[1] / viewBox[3] * ya2._length); + + var plotDx = xa2._offset - fracDx, + plotDy = ya2._offset - fracDy; + + fullLayout._defs.selectAll('#' + subplot.clipId) + .call(Lib.setTranslate, clipDx, clipDy) + .call(Lib.setScale, 1 / xScaleFactor, 1 / yScaleFactor); + + subplot.plot + .call(Lib.setTranslate, plotDx, plotDy) + .call(Lib.setScale, xScaleFactor, yScaleFactor); + + } + + function updateSubplot (subplot, progress) { + var axis, r0, r1; + var xUpdate = updates[subplot.xaxis._id]; + var yUpdate = updates[subplot.yaxis._id]; + + var viewBox = []; + + if (xUpdate) { + axis = xUpdate.axis; + r0 = axis._r; + r1 = xUpdate.to; + viewBox[0] = (r0[0] * (1 - progress) + progress * r1[0] - r0[0]) / (r0[1] - r0[0]) * subplot.xaxis._length; + var dx1 = r0[1] - r0[0]; + var dx2 = r1[1] - r1[0]; + + axis.range[0] = r0[0] * (1 - progress) + progress * r1[0]; + axis.range[1] = r0[1] * (1 - progress) + progress * r1[1]; + + viewBox[2] = subplot.xaxis._length * ((1 - progress) + progress * dx2 / dx1); + } else { + viewBox[0] = 0; + viewBox[2] = subplot.xaxis._length; + } + + if (yUpdate) { + axis = yUpdate.axis; + r0 = axis._r; + r1 = yUpdate.to; + viewBox[1] = (r0[1] * (1 - progress) + progress * r1[1] - r0[1]) / (r0[0] - r0[1]) * subplot.yaxis._length; + var dy1 = r0[1] - r0[0]; + var dy2 = r1[1] - r1[0]; + + axis.range[0] = r0[0] * (1 - progress) + progress * r1[0]; + axis.range[1] = r0[1] * (1 - progress) + progress * r1[1]; + + viewBox[3] = subplot.yaxis._length * ((1 - progress) + progress * dy2 / dy1); + } else { + viewBox[1] = 0; + viewBox[3] = subplot.yaxis._length; + } + + ticksAndAnnotations(subplot.x(), subplot.y()); + + + var xa2 = subplot.x(); + var ya2 = subplot.y(); + + var editX = !!xUpdate; + var editY = !!yUpdate; + + var xScaleFactor = editX ? xa2._length / viewBox[2] : 1, + yScaleFactor = editY ? ya2._length / viewBox[3] : 1; + + var clipDx = editX ? viewBox[0] : 0, + clipDy = editY ? viewBox[1] : 0; + + var fracDx = editX ? (viewBox[0] / viewBox[2] * xa2._length) : 0, + fracDy = editY ? (viewBox[1] / viewBox[3] * ya2._length) : 0; + + var plotDx = xa2._offset - fracDx, + plotDy = ya2._offset - fracDy; + + fullLayout._defs.selectAll('#' + subplot.clipId) + .call(Lib.setTranslate, clipDx, clipDy) + .call(Lib.setScale, 1 / xScaleFactor, 1 / yScaleFactor); + + subplot.plot + .call(Lib.setTranslate, plotDx, plotDy) + .call(Lib.setScale, xScaleFactor, yScaleFactor); + } + + // transitionTail - finish a drag event with a redraw + function transitionTail() { + var attrs = {}; + // revert to the previous axis settings, then apply the new ones + // through relayout - this lets relayout manage undo/redo + for(var i = 0; i < updatedAxisIds.length; i++) { + var axi = updates[updatedAxisIds[i]].axis; + if(axi._r[0] !== axi.range[0]) attrs[axi._name + '.range[0]'] = axi.range[0]; + if(axi._r[1] !== axi.range[1]) attrs[axi._name + '.range[1]'] = axi.range[1]; + + axi.range = axi._r.slice(); + } + + for (var i = 0; i < affectedSubplots.length; i++) { + unsetSubplotTransform(affectedSubplots[i]); + } + + Plotly.relayout(gd, attrs); + } + + return new Promise(function (resolve, reject) { + var t1, t2, raf; + + gd._animationInterrupt = function () { + reject(); + cancelAnimationFrame(raf); + raf = null; + transitionTail(); + }; + + function doFrame () { + t2 = Date.now(); + + var tInterp = Math.min(1, (t2 - t1) / transitionConfig.duration); + var progress = easeFn(tInterp); + + for (var i = 0; i < affectedSubplots.length; i++) { + updateSubplot(affectedSubplots[i], progress); + } + + if (t2 - t1 > transitionConfig.duration) { + raf = cancelAnimationFrame(doFrame); + transitionTail(); + resolve(); + } else { + raf = requestAnimationFrame(doFrame); + resolve(); + } + } + + t1 = Date.now(); + raf = requestAnimationFrame(doFrame); + }); +} diff --git a/src/traces/scatter/attributes.js b/src/traces/scatter/attributes.js index 68d7db06cca..50b8f31cade 100644 --- a/src/traces/scatter/attributes.js +++ b/src/traces/scatter/attributes.js @@ -65,6 +65,10 @@ module.exports = { 'See `y0` for more info.' ].join(' ') }, + key: { + valType: 'data_array', + description: 'A list of keys for object constancy of data points during animation' + }, text: { valType: 'string', role: 'info', diff --git a/src/traces/scatter/calc.js b/src/traces/scatter/calc.js index 21304864b93..0a8b9efdba7 100644 --- a/src/traces/scatter/calc.js +++ b/src/traces/scatter/calc.js @@ -115,6 +115,10 @@ module.exports = function calc(gd, trace) { for(i = 0; i < serieslen; i++) { cd[i] = (isNumeric(x[i]) && isNumeric(y[i])) ? {x: x[i], y: y[i]} : {x: false, y: false}; + + if (trace.key && trace.key[i] !== undefined) { + cd[i].key = trace.key[i]; + } } // this has migrated up from arraysToCalcdata as we have a reference to 's' here diff --git a/src/traces/scatter/defaults.js b/src/traces/scatter/defaults.js index 3690160053f..79b7eac8b0d 100644 --- a/src/traces/scatter/defaults.js +++ b/src/traces/scatter/defaults.js @@ -36,6 +36,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout return; } + coerce('key'); coerce('text'); coerce('mode', defaultMode); diff --git a/src/traces/scatter/index.js b/src/traces/scatter/index.js index 3b576a561d0..152489788f1 100644 --- a/src/traces/scatter/index.js +++ b/src/traces/scatter/index.js @@ -23,6 +23,7 @@ Scatter.attributes = require('./attributes'); Scatter.supplyDefaults = require('./defaults'); Scatter.cleanData = require('./clean_data'); Scatter.calc = require('./calc'); +Scatter.setPositions = require('./set_positions'); Scatter.arraysToCalcdata = require('./arrays_to_calcdata'); Scatter.plot = require('./plot'); Scatter.colorbar = require('./colorbar'); @@ -32,6 +33,7 @@ Scatter.selectPoints = require('./select'); Scatter.moduleType = 'trace'; Scatter.name = 'scatter'; +Scatter.animatable = true; Scatter.basePlotModule = require('../../plots/cartesian'); Scatter.categories = ['cartesian', 'symbols', 'markerColorscale', 'errorBarsOK', 'showLegend']; Scatter.meta = { diff --git a/src/traces/scatter/link_traces.js b/src/traces/scatter/link_traces.js new file mode 100644 index 00000000000..f19149e7255 --- /dev/null +++ b/src/traces/scatter/link_traces.js @@ -0,0 +1,50 @@ +/** +* Copyright 2012-2016, Plotly, Inc. +* All rights reserved. +* +* This source code is licensed under the MIT license found in the +* LICENSE file in the root directory of this source tree. +*/ + +'use strict'; + +var Plots = require('../../plots/plots'); + +module.exports = function linkTraces(gd, plotinfo, cdscatter) { + var i, cd, trace; + var fullLayout = gd._fullLayout; + var xa = plotinfo.x(); + var ya = plotinfo.y(); + + var prevtrace = null; + + for(i = 0; i < cdscatter.length; ++i) { + cd = cdscatter[i]; + trace = cd[0].trace; + + // console.log('visible:', trace.uid, trace.visible); + if(trace.visible === true && Plots.traceIs(trace, 'cartesian') && + trace.xaxis === xa._id && + trace.yaxis === ya._id) { + + trace._nexttrace = null; + + if (['tonextx', 'tonexty', 'tonext'].indexOf(trace.fill) !== -1) { + trace._prevtrace = prevtrace; + + if (prevtrace) { + prevtrace._nexttrace = trace; + } + } + + prevtrace = trace; + } else { + trace._prevtrace = trace._nexttrace = null; + } + } + + /*for(i = 0; i < cdscatter.length; ++i) { + var trace = cdscatter[i][0].trace; + console.log('gd.cdscatter[i]:', trace.uid, 'prev:', trace._prevtrace && trace._prevtrace.uid, 'next:', trace._nexttrace && trace._nexttrace.uid) + }*/ +} diff --git a/src/traces/scatter/plot.js b/src/traces/scatter/plot.js index 2044c854fa1..afd44d8c34a 100644 --- a/src/traces/scatter/plot.js +++ b/src/traces/scatter/plot.js @@ -18,74 +18,174 @@ var ErrorBars = require('../../components/errorbars'); var subTypes = require('./subtypes'); var arraysToCalcdata = require('./arrays_to_calcdata'); var linePoints = require('./line_points'); +var linkTraces = require('./link_traces'); +function cdscatterKey (d) { + return d[0].trace.uid; +} -module.exports = function plot(gd, plotinfo, cdscatter) { - selectMarkers(gd, plotinfo, cdscatter); +module.exports = function plot(gd, plotinfo, cdscatter, traces, transitionOpts) { + var i, uids, noremove; - var xa = plotinfo.x(), - ya = plotinfo.y(); + var transitionConfig = Lib.extendFlat({}, transitionOpts || {}); - // make the container for scatter plots - // (so error bars can find them along with bars) - var scattertraces = plotinfo.plot.select('.scatterlayer') - .selectAll('g.trace.scatter') - .data(cdscatter); + transitionConfig = Lib.extendFlat({ + duration: 0, + easing: 'in-out-cubic', + cascade: 0, + delay: 0, + }, transitionConfig); + + var hasTransition = transitionConfig.duration > 0; - scattertraces.enter().append('g') + if (!traces) { + // If no traces provided, redraw all: + for (i = 0, traces = []; i < cdscatter.length; i++) { + traces[i] = i; + } + noremove = false; + } else { + // If this is a partial update, then don't remove traces whose data is not updated + noremove = true; + } + + var scatterlayer = plotinfo.plot.select('g.scatterlayer'); + var traceJoin = scatterlayer.selectAll('g.trace').data(cdscatter, cdscatterKey); + + var traceEnter = traceJoin.enter().append('g') .attr('class', 'trace scatter') - .style('stroke-miterlimit', 2); + .style('stroke-miterlimit', 2) - // error bars are at the bottom - scattertraces.call(ErrorBars.plot, plotinfo); + // After the elements are created but before they've been draw, we have to do + // this extra step of linking the traces due to z-ordering + linkTraces(gd, plotinfo, cdscatter) + createFills(gd, scatterlayer, cdscatter, traces) - // BUILD LINES AND FILLS - var prevpath = '', - ownFillEl3, ownFillDir, tonext, nexttonext; + traceEnter.each(function(d) { + plotOne(gd, plotinfo, d, this, transitionConfig) + }); - scattertraces.each(function(d) { - var trace = d[0].trace, - line = trace.line, - tr = d3.select(this); - if(trace.visible !== true) return; + traceJoin.transition() + .duration(0) + .each(function(d) { + plotOne(gd, plotinfo, d, this, transitionConfig) + }); + + + if (!noremove) { + traceJoin.exit().remove(); + } + + // Sort the traces, once created, so that the ordering is preserved even when + // traces are shown and hidden. This is now needed since we're not just wiping + // everything out and recreating on every update. + for (i = 0, uids = []; i < cdscatter.length; i++) { + uids[i] = cdscatter[i][0].trace.uid; + } - ownFillDir = trace.fill.charAt(trace.fill.length - 1); - if(ownFillDir !== 'x' && ownFillDir !== 'y') ownFillDir = ''; + scatterlayer.selectAll('g.trace').sort(function (a, b) { + var idx1 = uids.indexOf(a[0].trace.uid); + var idx2 = uids.indexOf(b[0].trace.uid); + return idx1 > idx2 ? 1 : -1; + }); - d[0].node3 = tr; // store node for tweaking by selectPoints + // remove paths that didn't get used + // scatterlayer.selectAll('path:not([d])').remove(); +}; - arraysToCalcdata(d); +function createFills (gd, scatterlayer, cdscatter, traces) { + var i, trace, prevtrace; - if(!subTypes.hasLines(trace) && trace.fill === 'none') return; + scatterlayer.selectAll('g.trace').each(function (d) { + var tr = d3.select(this); - var thispath, - thisrevpath, - // fullpath is all paths for this curve, joined together straight - // across gaps, for filling - fullpath = '', - // revpath is fullpath reversed, for fill-to-next - revpath = '', - // functions for converting a point array to a path - pathfn, revpathbase, revpathfn; + // Loop only over the traces being redrawn: + trace = d[0].trace; - // make the fill-to-zero path now, so it shows behind the line - // fill to next puts the fill associated with one trace - // grouped with the previous if(trace.fill.substr(0, 6) === 'tozero' || trace.fill === 'toself' || - (trace.fill.substr(0, 2) === 'to' && !prevpath)) { - ownFillEl3 = tr.append('path') - .classed('js-fill', true); + (trace.fill.substr(0, 2) === 'to' && !trace._prevtrace)) { + trace._ownFill = tr.select('.js-fill.js-tozero'); + if (!trace._ownFill.size()) { + trace._ownFill = tr.insert('path', ':first-child').attr('class', 'js-fill js-tozero'); + } + } else { + tr.selectAll('.js-fill.js-tozero').remove(); + trace._ownFill = null; } - else ownFillEl3 = null; // make the fill-to-next path now for the NEXT trace, so it shows // behind both lines. - // nexttonext was created last time, but give it - // this curve's data for fill color - if(nexttonext) tonext = nexttonext.datum(d); + if (trace._nexttrace) { + trace._nextFill = tr.select('.js-fill.js-tonext'); + if (!trace._nextFill.size()) { + trace._nextFill = tr.insert('path', ':first-child').attr('class', 'js-fill js-tonext'); + } + } else { + tr.selectAll('.js-fill.js-tonext').remove(); + trace._nextFill = null; + } + }); +} - // now make a new nexttonext for next time - nexttonext = tr.append('path').classed('js-fill', true); + +function plotOne(gd, plotinfo, cdscatter, group, transitionConfig) { + selectMarkers(gd, plotinfo, cdscatter); + + function transition (selection) { + return selection.transition() + .duration(transitionConfig.duration) + .ease(transitionConfig.easing); + } + + var xa = plotinfo.x(), + ya = plotinfo.y(); + + var trace = cdscatter[0].trace, + line = trace.line, + tr = d3.select(group); + + // (so error bars can find them along with bars) + // error bars are at the bottom + tr.call(ErrorBars.plot, plotinfo, transitionConfig); + + if(trace.visible !== true) return; + + // BUILD LINES AND FILLS + var ownFillEl3, tonext, nexttonext; + var ownFillDir = trace.fill.charAt(trace.fill.length - 1); + if(ownFillDir !== 'x' && ownFillDir !== 'y') ownFillDir = ''; + + // store node for tweaking by selectPoints + cdscatter[0].node3 = tr; + + arraysToCalcdata(cdscatter); + + var prevpath = ''; + var prevtrace = trace._prevtrace; + + if (prevtrace) { + prevpath = prevtrace._revpath || ''; + tonext = prevtrace._nextFill; + } + + var thispath, + thisrevpath, + // fullpath is all paths for this curve, joined together straight + // across gaps, for filling + fullpath = '', + // revpath is fullpath reversed, for fill-to-next + revpath = '', + // functions for converting a point array to a path + pathfn, revpathbase, revpathfn; + + ownFillEl3 = trace._ownFill; + + if(subTypes.hasLines(trace) || trace.fill !== 'none') { + + if (tonext) { + // This tells .style which trace to use for fill information: + tonext.datum(cdscatter); + } if(['hv', 'vh', 'hvh', 'vhv'].indexOf(line.shape) !== -1) { pathfn = Drawing.steps(line.shape); @@ -117,7 +217,7 @@ module.exports = function plot(gd, plotinfo, cdscatter) { return revpathbase(pts.reverse()); }; - var segments = linePoints(d, { + var segments = linePoints(cdscatter, { xaxis: xa, yaxis: ya, connectGaps: trace.connectgaps, @@ -147,7 +247,12 @@ module.exports = function plot(gd, plotinfo, cdscatter) { revpath = thisrevpath + 'Z' + revpath; } if(subTypes.hasLines(trace) && pts.length > 1) { - tr.append('path').classed('js-line', true).attr('d', thispath); + var lineJoin = tr.selectAll('.js-line').data([cdscatter]); + + lineJoin.enter() + .append('path').classed('js-line', true).attr('d', thispath); + + transition(lineJoin).attr('d', thispath); } } if(ownFillEl3) { @@ -162,10 +267,11 @@ module.exports = function plot(gd, plotinfo, cdscatter) { // fill to zero: full trace path, plus extension of // the endpoints to the appropriate axis - ownFillEl3.attr('d', fullpath + 'L' + pt1 + 'L' + pt0 + 'Z'); + transition(ownFillEl3).attr('d', fullpath + 'L' + pt1 + 'L' + pt0 + 'Z'); + } else { + // fill to self: just join the path to itself + transition(ownFillEl3).attr('d', fullpath + 'Z'); } - // fill to self: just join the path to itself - else ownFillEl3.attr('d', fullpath + 'Z'); } } else if(trace.fill.substr(0, 6) === 'tonext' && fullpath && prevpath) { @@ -175,7 +281,7 @@ module.exports = function plot(gd, plotinfo, cdscatter) { // contours, we just add the two paths closed on themselves. // This makes strange results if one path is *not* entirely // inside the other, but then that is a strange usage. - tonext.attr('d', fullpath + 'Z' + prevpath + 'Z'); + transition(tonext).attr('d', fullpath + 'Z' + prevpath + 'Z'); } else { // tonextx/y: for now just connect endpoints with lines. This is @@ -183,48 +289,82 @@ module.exports = function plot(gd, plotinfo, cdscatter) { // y/x, but if they *aren't*, we should ideally do more complicated // things depending on whether the new endpoint projects onto the // existing curve or off the end of it - tonext.attr('d', fullpath + 'L' + prevpath.substr(1) + 'Z'); + transition(tonext).attr('d', fullpath + 'L' + prevpath.substr(1) + 'Z'); } } - prevpath = revpath; } - }); - // remove paths that didn't get used - scattertraces.selectAll('path:not([d])').remove(); + trace._revpath = revpath; + } + function visFilter(d) { return d.filter(function(v) { return v.vis; }); } - scattertraces.append('g') - .attr('class', 'points') - .each(function(d) { - var trace = d[0].trace, - s = d3.select(this), - showMarkers = subTypes.hasMarkers(trace), - showText = subTypes.hasText(trace); - - if((!showMarkers && !showText) || trace.visible !== true) s.remove(); - else { - if(showMarkers) { - s.selectAll('path.point') - .data(trace.marker.maxdisplayed ? visFilter : Lib.identity) - .enter().append('path') - .classed('point', true) - .call(Drawing.translatePoints, xa, ya); - } - if(showText) { - s.selectAll('g') - .data(trace.marker.maxdisplayed ? visFilter : Lib.identity) - // each text needs to go in its own 'g' in case - // it gets converted to mathjax - .enter().append('g') - .append('text') - .call(Drawing.translatePoints, xa, ya); + function keyFunc (d) { + return d.key; + } + + function getKeyFunc(trace) { + if (trace.key) { + return keyFunc; + } + } + + var hasTransition = transitionConfig && (transitionConfig || {}).duration > 0; + + function makePoints (d) { + var trace = d[0].trace, + s = d3.select(this), + showMarkers = subTypes.hasMarkers(trace), + showText = subTypes.hasText(trace); + + if((!showMarkers && !showText) || trace.visible !== true) s.remove(); + else { + if(showMarkers) { + var join = s.selectAll('path.point') + .data(trace.marker.maxdisplayed ? visFilter : Lib.identity, getKeyFunc(trace)) + + join.enter().append('path') + .classed('point', true) + .call(Drawing.pointStyle, trace) + .call(Drawing.translatePoints, xa, ya, trace, transitionConfig, 1) + + join.transition() + .call(Drawing.translatePoints, xa, ya, trace, transitionConfig, 0) + .call(Drawing.pointStyle, trace) + + if (hasTransition) { + join.exit() + .call(Drawing.translatePoints, xa, ya, trace, transitionConfig, -1); + } else { + join.exit().remove(); } } - }); + if(showText) { + s.selectAll('g') + .data(trace.marker.maxdisplayed ? visFilter : Lib.identity) + // each text needs to go in its own 'g' in case + // it gets converted to mathjax + .enter().append('g') + .append('text') + .call(Drawing.translatePoints, xa, ya, trace, transitionConfig, 1); + } + } + } + + var pointJoin = tr.selectAll('.points').data([cdscatter]); + + pointJoin.enter().append('g') + .classed('points', true) + .each(makePoints); + + pointJoin.transition() + .duration(0) + .each(makePoints); + + pointJoin.exit().remove(); }; function selectMarkers(gd, plotinfo, cdscatter) { @@ -233,40 +373,41 @@ function selectMarkers(gd, plotinfo, cdscatter) { xr = d3.extent(xa.range.map(xa.l2c)), yr = d3.extent(ya.range.map(ya.l2c)); - cdscatter.forEach(function(d, i) { - var trace = d[0].trace; - if(!subTypes.hasMarkers(trace)) return; - // if marker.maxdisplayed is used, select a maximum of - // mnum markers to show, from the set that are in the viewport - var mnum = trace.marker.maxdisplayed; - - // TODO: remove some as we get away from the viewport? - if(mnum === 0) return; - - var cd = d.filter(function(v) { - return v.x >= xr[0] && v.x <= xr[1] && v.y >= yr[0] && v.y <= yr[1]; - }), - inc = Math.ceil(cd.length / mnum), - tnum = 0; - cdscatter.forEach(function(cdj, j) { - var tracei = cdj[0].trace; - if(subTypes.hasMarkers(tracei) && - tracei.marker.maxdisplayed > 0 && j < i) { - tnum++; - } - }); + // XXX: Not okay. Just makes it work for now. + var i = 0; + + var trace = cdscatter[0].trace; + if(!subTypes.hasMarkers(trace)) return; + // if marker.maxdisplayed is used, select a maximum of + // mnum markers to show, from the set that are in the viewport + var mnum = trace.marker.maxdisplayed; + + // TODO: remove some as we get away from the viewport? + if(mnum === 0) return; + + var cd = cdscatter.filter(function(v) { + return v.x >= xr[0] && v.x <= xr[1] && v.y >= yr[0] && v.y <= yr[1]; + }), + inc = Math.ceil(cd.length / mnum), + tnum = 0; + cdscatter.forEach(function(cdj, j) { + var tracei = cdj[0].trace; + if(subTypes.hasMarkers(tracei) && + tracei.marker.maxdisplayed > 0 && j < i) { + tnum++; + } + }); - // if multiple traces use maxdisplayed, stagger which markers we - // display this formula offsets successive traces by 1/3 of the - // increment, adding an extra small amount after each triplet so - // it's not quite periodic - var i0 = Math.round(tnum * inc / 3 + Math.floor(tnum / 3) * inc / 7.1); - - // for error bars: save in cd which markers to show - // so we don't have to repeat this - d.forEach(function(v) { delete v.vis; }); - cd.forEach(function(v, i) { - if(Math.round((i + i0) % inc) === 0) v.vis = true; - }); + // if multiple traces use maxdisplayed, stagger which markers we + // display this formula offsets successive traces by 1/3 of the + // increment, adding an extra small amount after each triplet so + // it's not quite periodic + var i0 = Math.round(tnum * inc / 3 + Math.floor(tnum / 3) * inc / 7.1); + + // for error bars: save in cd which markers to show + // so we don't have to repeat this + cdscatter.forEach(function(v) { delete v.vis; }); + cd.forEach(function(v, i) { + if(Math.round((i + i0) % inc) === 0) v.vis = true; }); } diff --git a/src/traces/scatter/set_positions.js b/src/traces/scatter/set_positions.js new file mode 100644 index 00000000000..412ff399447 --- /dev/null +++ b/src/traces/scatter/set_positions.js @@ -0,0 +1,58 @@ +/** +* Copyright 2012-2016, Plotly, Inc. +* All rights reserved. +* +* This source code is licensed under the MIT license found in the +* LICENSE file in the root directory of this source tree. +*/ + +'use strict'; + +var Plots = require('../../plots/plots'); +var Axes = require('../../plots/cartesian/axes'); +var Lib = require('../../lib'); + +/** + * setPositions is a bit of a misnomer here. It comes from the box plot + * type that actually does setting of positions. It's the hook though + * that we need to set up links between traces so that trace-level .plot + * doesn't require any links between traces. + */ +module.exports = function setPositions(gd, plotinfo) { + // console.log('setPositions:', plotinfo); + var i, cd, trace; + var fullLayout = gd._fullLayout; + var xa = plotinfo.x(); + var ya = plotinfo.y(); + + var prevtrace = null; + + for(i = 0; i < gd.calcdata.length; ++i) { + cd = gd.calcdata[i]; + trace = cd[0].trace; + + // console.log('visible:', trace.uid, trace.visible); + if(trace.visible === true && Plots.traceIs(trace, 'cartesian') && + trace.xaxis === xa._id && + trace.yaxis === ya._id) { + + trace._nexttrace = null; + + if (['tonextx', 'tonexty', 'tonext'].indexOf(trace.fill) !== -1) { + trace._prevtrace = prevtrace; + + if (prevtrace) { + prevtrace._nexttrace = trace; + } + } + + prevtrace = trace; + } else { + trace._prevtrace = trace._nexttrace = null; + } + } + for(i = 0; i < gd.calcdata.length; ++i) { + var trace = gd.calcdata[i][0].trace; + // console.log('gd.calcdata[i]:', trace.uid, 'prev:', trace._prevtrace && trace._prevtrace.uid, 'next:', trace._nexttrace && trace._nexttrace.uid) + } +};