UNPKG

plotly.js

Version:

The open source javascript graphing library that powers plotly

1,510 lines (1,218 loc) 7.54 MB
/** * plotly.js v1.58.4 * Copyright 2012-2020, Plotly, Inc. * All rights reserved. * Licensed under the MIT license */ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Plotly = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../src/lib'); var rules = { "X,X div": "direction:ltr;font-family:'Open Sans', verdana, arial, sans-serif;margin:0;padding:0;", "X input,X button": "font-family:'Open Sans', verdana, arial, sans-serif;", "X input:focus,X button:focus": "outline:none;", "X a": "text-decoration:none;", "X a:hover": "text-decoration:none;", "X .crisp": "shape-rendering:crispEdges;", "X .user-select-none": "-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;", "X svg": "overflow:hidden;", "X svg a": "fill:#447adb;", "X svg a:hover": "fill:#3c6dc5;", "X .main-svg": "position:absolute;top:0;left:0;pointer-events:none;", "X .main-svg .draglayer": "pointer-events:all;", "X .cursor-default": "cursor:default;", "X .cursor-pointer": "cursor:pointer;", "X .cursor-crosshair": "cursor:crosshair;", "X .cursor-move": "cursor:move;", "X .cursor-col-resize": "cursor:col-resize;", "X .cursor-row-resize": "cursor:row-resize;", "X .cursor-ns-resize": "cursor:ns-resize;", "X .cursor-ew-resize": "cursor:ew-resize;", "X .cursor-sw-resize": "cursor:sw-resize;", "X .cursor-s-resize": "cursor:s-resize;", "X .cursor-se-resize": "cursor:se-resize;", "X .cursor-w-resize": "cursor:w-resize;", "X .cursor-e-resize": "cursor:e-resize;", "X .cursor-nw-resize": "cursor:nw-resize;", "X .cursor-n-resize": "cursor:n-resize;", "X .cursor-ne-resize": "cursor:ne-resize;", "X .cursor-grab": "cursor:-webkit-grab;cursor:grab;", "X .modebar": "position:absolute;top:2px;right:2px;", "X .ease-bg": "-webkit-transition:background-color 0.3s ease 0s;-moz-transition:background-color 0.3s ease 0s;-ms-transition:background-color 0.3s ease 0s;-o-transition:background-color 0.3s ease 0s;transition:background-color 0.3s ease 0s;", "X .modebar--hover>:not(.watermark)": "opacity:0;-webkit-transition:opacity 0.3s ease 0s;-moz-transition:opacity 0.3s ease 0s;-ms-transition:opacity 0.3s ease 0s;-o-transition:opacity 0.3s ease 0s;transition:opacity 0.3s ease 0s;", "X:hover .modebar--hover .modebar-group": "opacity:1;", "X .modebar-group": "float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;", "X .modebar-btn": "position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;", "X .modebar-btn svg": "position:relative;top:2px;", "X .modebar.vertical": "display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;", "X .modebar.vertical svg": "top:-1px;", "X .modebar.vertical .modebar-group": "display:block;float:none;padding-left:0px;padding-bottom:8px;", "X .modebar.vertical .modebar-group .modebar-btn": "display:block;text-align:center;", "X [data-title]:before,X [data-title]:after": "position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;", "X [data-title]:hover:before,X [data-title]:hover:after": "display:block;opacity:1;", "X [data-title]:before": "content:'';position:absolute;background:transparent;border:6px solid transparent;z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;", "X [data-title]:after": "content:attr(data-title);background:#69738a;color:white;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;", "X .vertical [data-title]:before,X .vertical [data-title]:after": "top:0%;right:200%;", "X .vertical [data-title]:before": "border:6px solid transparent;border-left-color:#69738a;margin-top:8px;margin-right:-30px;", "X .select-outline": "fill:none;stroke-width:1;shape-rendering:crispEdges;", "X .select-outline-1": "stroke:white;", "X .select-outline-2": "stroke:black;stroke-dasharray:2px 2px;", Y: "font-family:'Open Sans', verdana, arial, sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;", "Y p": "margin:0;", "Y .notifier-note": "min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,0.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;", "Y .notifier-close": "color:#fff;opacity:0.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;", "Y .notifier-close:hover": "color:#444;text-decoration:none;cursor:pointer;" }; for(var selector in rules) { var fullSelector = selector.replace(/^,/,' ,') .replace(/X/g, '.js-plotly-plot .plotly') .replace(/Y/g, '.plotly-notifier'); Lib.addStyleRule(fullSelector, rules[selector]); } },{"../src/lib":778}],2:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/transforms/aggregate'); },{"../src/transforms/aggregate":1365}],3:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/bar'); },{"../src/traces/bar":929}],4:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/barpolar'); },{"../src/traces/barpolar":942}],5:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/box'); },{"../src/traces/box":952}],6:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/components/calendars'); },{"../src/components/calendars":641}],7:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/candlestick'); },{"../src/traces/candlestick":961}],8:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/carpet'); },{"../src/traces/carpet":980}],9:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/choropleth'); },{"../src/traces/choropleth":994}],10:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/choroplethmapbox'); },{"../src/traces/choroplethmapbox":1001}],11:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/cone'); },{"../src/traces/cone":1007}],12:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/contour'); },{"../src/traces/contour":1022}],13:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/contourcarpet'); },{"../src/traces/contourcarpet":1033}],14:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/core'); },{"../src/core":755}],15:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/densitymapbox'); },{"../src/traces/densitymapbox":1041}],16:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/transforms/filter'); },{"../src/transforms/filter":1366}],17:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/funnel'); },{"../src/traces/funnel":1051}],18:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/funnelarea'); },{"../src/traces/funnelarea":1060}],19:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/transforms/groupby'); },{"../src/transforms/groupby":1367}],20:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/heatmap'); },{"../src/traces/heatmap":1073}],21:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/heatmapgl'); },{"../src/traces/heatmapgl":1083}],22:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/histogram'); },{"../src/traces/histogram":1095}],23:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/histogram2d'); },{"../src/traces/histogram2d":1101}],24:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/histogram2dcontour'); },{"../src/traces/histogram2dcontour":1105}],25:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/image'); },{"../src/traces/image":1113}],26:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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 Plotly = _dereq_('./core'); // traces Plotly.register([ _dereq_('./bar'), _dereq_('./box'), _dereq_('./heatmap'), _dereq_('./histogram'), _dereq_('./histogram2d'), _dereq_('./histogram2dcontour'), _dereq_('./contour'), _dereq_('./scatterternary'), _dereq_('./violin'), _dereq_('./funnel'), _dereq_('./waterfall'), _dereq_('./image'), _dereq_('./pie'), _dereq_('./sunburst'), _dereq_('./treemap'), _dereq_('./funnelarea'), _dereq_('./scatter3d'), _dereq_('./surface'), _dereq_('./isosurface'), _dereq_('./volume'), _dereq_('./mesh3d'), _dereq_('./cone'), _dereq_('./streamtube'), _dereq_('./scattergeo'), _dereq_('./choropleth'), _dereq_('./scattergl'), _dereq_('./splom'), _dereq_('./pointcloud'), _dereq_('./heatmapgl'), _dereq_('./parcoords'), _dereq_('./parcats'), _dereq_('./scattermapbox'), _dereq_('./choroplethmapbox'), _dereq_('./densitymapbox'), _dereq_('./sankey'), _dereq_('./indicator'), _dereq_('./table'), _dereq_('./carpet'), _dereq_('./scattercarpet'), _dereq_('./contourcarpet'), _dereq_('./ohlc'), _dereq_('./candlestick'), _dereq_('./scatterpolar'), _dereq_('./scatterpolargl'), _dereq_('./barpolar') ]); // transforms // // Please note that all *transform* methods are executed before // all *calcTransform* methods - which could possibly lead to // unexpected results when applying multiple transforms of different types // to a given trace. // // For more info, see: // https://github.com/plotly/plotly.js/pull/978#pullrequestreview-2403353 // Plotly.register([ _dereq_('./aggregate'), _dereq_('./filter'), _dereq_('./groupby'), _dereq_('./sort') ]); // components Plotly.register([ _dereq_('./calendars') ]); module.exports = Plotly; },{"./aggregate":2,"./bar":3,"./barpolar":4,"./box":5,"./calendars":6,"./candlestick":7,"./carpet":8,"./choropleth":9,"./choroplethmapbox":10,"./cone":11,"./contour":12,"./contourcarpet":13,"./core":14,"./densitymapbox":15,"./filter":16,"./funnel":17,"./funnelarea":18,"./groupby":19,"./heatmap":20,"./heatmapgl":21,"./histogram":22,"./histogram2d":23,"./histogram2dcontour":24,"./image":25,"./indicator":27,"./isosurface":28,"./mesh3d":29,"./ohlc":30,"./parcats":31,"./parcoords":32,"./pie":33,"./pointcloud":34,"./sankey":35,"./scatter3d":36,"./scattercarpet":37,"./scattergeo":38,"./scattergl":39,"./scattermapbox":40,"./scatterpolar":41,"./scatterpolargl":42,"./scatterternary":43,"./sort":44,"./splom":45,"./streamtube":46,"./sunburst":47,"./surface":48,"./table":49,"./treemap":50,"./violin":51,"./volume":52,"./waterfall":53}],27:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/indicator'); },{"../src/traces/indicator":1121}],28:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/isosurface'); },{"../src/traces/isosurface":1127}],29:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/mesh3d'); },{"../src/traces/mesh3d":1132}],30:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/ohlc'); },{"../src/traces/ohlc":1137}],31:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/parcats'); },{"../src/traces/parcats":1146}],32:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/parcoords'); },{"../src/traces/parcoords":1156}],33:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/pie'); },{"../src/traces/pie":1167}],34:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/pointcloud'); },{"../src/traces/pointcloud":1176}],35:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/sankey'); },{"../src/traces/sankey":1182}],36:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/scatter3d'); },{"../src/traces/scatter3d":1220}],37:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/scattercarpet'); },{"../src/traces/scattercarpet":1227}],38:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/scattergeo'); },{"../src/traces/scattergeo":1235}],39:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/scattergl'); },{"../src/traces/scattergl":1248}],40:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/scattermapbox'); },{"../src/traces/scattermapbox":1258}],41:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/scatterpolar'); },{"../src/traces/scatterpolar":1266}],42:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/scatterpolargl'); },{"../src/traces/scatterpolargl":1273}],43:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/scatterternary'); },{"../src/traces/scatterternary":1281}],44:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/transforms/sort'); },{"../src/transforms/sort":1369}],45:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/splom'); },{"../src/traces/splom":1290}],46:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/streamtube'); },{"../src/traces/streamtube":1298}],47:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/sunburst'); },{"../src/traces/sunburst":1306}],48:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/surface'); },{"../src/traces/surface":1315}],49:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/table'); },{"../src/traces/table":1323}],50:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/treemap'); },{"../src/traces/treemap":1332}],51:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/violin'); },{"../src/traces/violin":1344}],52:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/volume'); },{"../src/traces/volume":1352}],53:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, 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'; module.exports = _dereq_('../src/traces/waterfall'); },{"../src/traces/waterfall":1360}],54:[function(_dereq_,module,exports){ 'use strict' module.exports = createViewController var createTurntable = _dereq_('turntable-camera-controller') var createOrbit = _dereq_('orbit-camera-controller') var createMatrix = _dereq_('matrix-camera-controller') function ViewController(controllers, mode) { this._controllerNames = Object.keys(controllers) this._controllerList = this._controllerNames.map(function(n) { return controllers[n] }) this._mode = mode this._active = controllers[mode] if(!this._active) { this._mode = 'turntable' this._active = controllers.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 } var proto = ViewController.prototype var COMMON_METHODS = [ ['flush', 1], ['idle', 1], ['lookAt', 4], ['rotate', 4], ['pan', 4], ['translate', 4], ['setMatrix', 2], ['setDistanceLimits', 2], ['setDistance', 2] ] COMMON_METHODS.forEach(function(method) { var name = method[0] var argNames = [] for(var i=0; i<method[1]; ++i) { argNames.push('a'+i) } var code = 'var cc=this._controllerList;for(var i=0;i<cc.length;++i){cc[i].'+method[0]+'('+argNames.join()+')}' proto[name] = Function.apply(null, argNames.concat(code)) }) proto.recalcMatrix = function(t) { this._active.recalcMatrix(t) } proto.getDistance = function(t) { return this._active.getDistance(t) } proto.getDistanceLimits = function(out) { return this._active.getDistanceLimits(out) } proto.lastT = function() { return this._active.lastT() } proto.setMode = function(mode) { if(mode === this._mode) { return } var idx = this._controllerNames.indexOf(mode) if(idx < 0) { return } var prev = this._active var next = this._controllerList[idx] var lastT = Math.max(prev.lastT(), next.lastT()) prev.recalcMatrix(lastT) next.setMatrix(lastT, prev.computedMatrix) this._active = next this._mode = mode //Update matrix properties 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 } proto.getMode = function() { return this._mode } function createViewController(options) { options = options || {} var eye = options.eye || [0,0,1] var center = options.center || [0,0,0] var up = options.up || [0,1,0] var limits = options.distanceLimits || [0, Infinity] var mode = options.mode || 'turntable' var turntable = createTurntable() var orbit = createOrbit() var matrix = createMatrix() turntable.setDistanceLimits(limits[0], limits[1]) turntable.lookAt(0, eye, center, up) orbit.setDistanceLimits(limits[0], limits[1]) orbit.lookAt(0, eye, center, up) matrix.setDistanceLimits(limits[0], limits[1]) matrix.lookAt(0, eye, center, up) return new ViewController({ turntable: turntable, orbit: orbit, matrix: matrix }, mode) } },{"matrix-camera-controller":480,"orbit-camera-controller":501,"turntable-camera-controller":581}],55:[function(_dereq_,module,exports){ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, _dereq_('d3-array'), _dereq_('d3-collection'), _dereq_('d3-shape'), _dereq_('elementary-circuits-directed-graph')) : typeof define === 'function' && define.amd ? define(['exports', 'd3-array', 'd3-collection', 'd3-shape', 'elementary-circuits-directed-graph'], factory) : (factory((global.d3 = global.d3 || {}),global.d3,global.d3,global.d3,null)); }(this, (function (exports,d3Array,d3Collection,d3Shape,findCircuits) { 'use strict'; findCircuits = findCircuits && findCircuits.hasOwnProperty('default') ? findCircuits['default'] : findCircuits; // For a given link, return the target node's depth function targetDepth(d) { return d.target.depth; } // The depth of a node when the nodeAlign (align) is set to 'left' function left(node) { return node.depth; } // The depth of a node when the nodeAlign (align) is set to 'right' function right(node, n) { return n - 1 - node.height; } // The depth of a node when the nodeAlign (align) is set to 'justify' function justify(node, n) { return node.sourceLinks.length ? node.depth : n - 1; } // The depth of a node when the nodeAlign (align) is set to 'center' function center(node) { return node.targetLinks.length ? node.depth : node.sourceLinks.length ? d3Array.min(node.sourceLinks, targetDepth) - 1 : 0; } // returns a function, using the parameter given to the sankey setting function constant(x) { return function () { return x; }; } var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /// https://github.com/tomshanley/d3-sankeyCircular-circular // sort links' breadth (ie top to bottom in a column), based on their source nodes' breadths function ascendingSourceBreadth(a, b) { return ascendingBreadth(a.source, b.source) || a.index - b.index; } // sort links' breadth (ie top to bottom in a column), based on their target nodes' breadths function ascendingTargetBreadth(a, b) { return ascendingBreadth(a.target, b.target) || a.index - b.index; } // sort nodes' breadth (ie top to bottom in a column) // if both nodes have circular links, or both don't have circular links, then sort by the top (y0) of the node // else push nodes that have top circular links to the top, and nodes that have bottom circular links to the bottom function ascendingBreadth(a, b) { if (a.partOfCycle === b.partOfCycle) { return a.y0 - b.y0; } else { if (a.circularLinkType === 'top' || b.circularLinkType === 'bottom') { return -1; } else { return 1; } } } // return the value of a node or link function value(d) { return d.value; } // return the vertical center of a node function nodeCenter(node) { return (node.y0 + node.y1) / 2; } // return the vertical center of a link's source node function linkSourceCenter(link) { return nodeCenter(link.source); } // return the vertical center of a link's target node function linkTargetCenter(link) { return nodeCenter(link.target); } // Return the default value for ID for node, d.index function defaultId(d) { return d.index; } // Return the default object the graph's nodes, graph.nodes function defaultNodes(graph) { return graph.nodes; } // Return the default object the graph's nodes, graph.links function defaultLinks(graph) { return graph.links; } // Return the node from the collection that matches the provided ID, or throw an error if no match function find(nodeById, id) { var node = nodeById.get(id); if (!node) throw new Error('missing: ' + id); return node; } function getNodeID(node, id) { return id(node); } // The main sankeyCircular functions // Some constants for circular link calculations var verticalMargin = 25; var baseRadius = 10; var scale = 0.3; //Possibly let user control this, although anything over 0.5 starts to get too cramped function sankeyCircular () { // Set the default values var x0 = 0, y0 = 0, x1 = 1, y1 = 1, // extent dx = 24, // nodeWidth py, // nodePadding, for vertical postioning id = defaultId, align = justify, nodes = defaultNodes, links = defaultLinks, iterations = 32, circularLinkGap = 2, paddingRatio, sortNodes = null; function sankeyCircular() { var graph = { nodes: nodes.apply(null, arguments), links: links.apply(null, arguments) // Process the graph's nodes and links, setting their positions // 1. Associate the nodes with their respective links, and vice versa };computeNodeLinks(graph); // 2. Determine which links result in a circular path in the graph identifyCircles(graph, id, sortNodes); // 4. Calculate the nodes' values, based on the values of the incoming and outgoing links computeNodeValues(graph); // 5. Calculate the nodes' depth based on the incoming and outgoing links // Sets the nodes': // - depth: the depth in the graph // - column: the depth (0, 1, 2, etc), as is relates to visual position from left to right // - x0, x1: the x coordinates, as is relates to visual position from left to right computeNodeDepths(graph); // 3. Determine how the circular links will be drawn, // either travelling back above the main chart ("top") // or below the main chart ("bottom") selectCircularLinkTypes(graph, id); // 6. Calculate the nodes' and links' vertical position within their respective column // Also readjusts sankeyCircular size if circular links are needed, and node x's computeNodeBreadths(graph, iterations, id); computeLinkBreadths(graph); // 7. Sort links per node, based on the links' source/target nodes' breadths // 8. Adjust nodes that overlap links that span 2+ columns var linkSortingIterations = 4; //Possibly let user control this number, like the iterations over node placement for (var iteration = 0; iteration < linkSortingIterations; iteration++) { sortSourceLinks(graph, y1, id); sortTargetLinks(graph, y1, id); resolveNodeLinkOverlaps(graph, y0, y1, id); sortSourceLinks(graph, y1, id); sortTargetLinks(graph, y1, id); } // 8.1 Adjust node and link positions back to fill height of chart area if compressed fillHeight(graph, y0, y1); // 9. Calculate visually appealling path for the circular paths, and create the "d" string addCircularPathData(graph, circularLinkGap, y1, id); return graph; } // end of sankeyCircular function // Set the sankeyCircular parameters // nodeID, nodeAlign, nodeWidth, nodePadding, nodes, links, size, extent, iterations, nodePaddingRatio, circularLinkGap sankeyCircular.nodeId = function (_) { return arguments.length ? (id = typeof _ === 'function' ? _ : constant(_), sankeyCircular) : id; }; sankeyCircular.nodeAlign = function (_) { return arguments.length ? (align = typeof _ === 'function' ? _ : constant(_), sankeyCircular) : align; }; sankeyCircular.nodeWidth = function (_) { return arguments.length ? (dx = +_, sankeyCircular) : dx; }; sankeyCircular.nodePadding = function (_) { return arguments.length ? (py = +_, sankeyCircular) : py; }; sankeyCircular.nodes = function (_) { return arguments.length ? (nodes = typeof _ === 'function' ? _ : constant(_), sankeyCircular) : nodes; }; sankeyCircular.links = function (_) { return arguments.length ? (links = typeof _ === 'function' ? _ : constant(_), sankeyCircular) : links; }; sankeyCircular.size = function (_) { return arguments.length ? (x0 = y0 = 0, x1 = +_[0], y1 = +_[1], sankeyCircular) : [x1 - x0, y1 - y0]; }; sankeyCircular.extent = function (_) { return arguments.length ? (x0 = +_[0][0], x1 = +_[1][0], y0 = +_[0][1], y1 = +_[1][1], sankeyCircular) : [[x0, y0], [x1, y1]]; }; sankeyCircular.iterations = function (_) { return arguments.length ? (iterations = +_, sankeyCircular) : iterations; }; sankeyCircular.circularLinkGap = function (_) { return arguments.length ? (circularLinkGap = +_, sankeyCircular) : circularLinkGap; }; sankeyCircular.nodePaddingRatio = function (_) { return arguments.length ? (paddingRatio = +_, sankeyCircular) : paddingRatio; }; sankeyCircular.sortNodes = function (_) { return arguments.length ? (sortNodes = _, sankeyCircular) : sortNodes; }; sankeyCircular.update = function (graph) { // 5. Calculate the nodes' depth based on the incoming and outgoing links // Sets the nodes': // - depth: the depth in the graph // - column: the depth (0, 1, 2, etc), as is relates to visual position from left to right // - x0, x1: the x coordinates, as is relates to visual position from left to right // computeNodeDepths(graph) // 3. Determine how the circular links will be drawn, // either travelling back above the main chart ("top") // or below the main chart ("bottom") selectCircularLinkTypes(graph, id); // 6. Calculate the nodes' and links' vertical position within their respective column // Also readjusts sankeyCircular size if circular links are needed, and node x's // computeNodeBreadths(graph, iterations, id) computeLinkBreadths(graph); // Force position of circular link type based on position graph.links.forEach(function (link) { if (link.circular) { link.circularLinkType = link.y0 + link.y1 < y1 ? 'top' : 'bottom'; link.source.circularLinkType = link.circularLinkType; link.target.circularLinkType = link.circularLinkType; } }); sortSourceLinks(graph, y1, id, false); // Sort links but do not move nodes sortTargetLinks(graph, y1, id); // 7. Sort links per node, based on the links' source/target nodes' breadths // 8. Adjust nodes that overlap links that span 2+ columns // var linkSortingIterations = 4; //Possibly let user control this number, like the iterations over node placement // for (var iteration = 0; iteration < linkSortingIterations; iteration++) { // // sortSourceLinks(graph, y1, id) // sortTargetLinks(graph, y1, id) // resolveNodeLinkOverlaps(graph, y0, y1, id) // sortSourceLinks(graph, y1, id) // sortTargetLinks(graph, y1, id) // // } // 8.1 Adjust node and link positions back to fill height of chart area if compressed // fillHeight(graph, y0, y1) // 9. Calculate visually appealling path for the circular paths, and create the "d" string addCircularPathData(graph, circularLinkGap, y1, id); return graph; }; // Populate the sourceLinks and targetLinks for each node. // Also, if the source and target are not objects, assume they are indices. function computeNodeLinks(graph) { graph.nodes.forEach(function (node, i) { node.index = i; node.sourceLinks = []; node.targetLinks = []; }); var nodeById = d3Collection.map(graph.nodes, id); graph.links.forEach(function (link, i) { link.index = i; var source = link.source; var target = link.target; if ((typeof source === "undefined" ? "undefined" : _typeof(source)) !== 'object') { source = link.source = find(nodeById, source); } if ((typeof target === "undefined" ? "undefined" : _typeof(target)) !== 'object') { target = link.target = find(nodeById, target); } source.sourceLinks.push(link); target.targetLinks.push(link); }); return graph; } // Compute the value (size) and cycleness of each node by summing the associated links. function computeNodeValues(graph) { graph.nodes.forEach(function (node) { node.partOfCycle = false; node.value = Math.max(d3Array.sum(node.sourceLinks, value), d3Array.sum(node.targetLinks, value)); node.sourceLinks.forEach(function (link) { if (link.circular) { node.partOfCycle = true; node.circularLinkType = link.circularLinkType; } }); node.targetLinks.forEach(function (link) { if (link.circular) { node.partOfCycle = true; node.circularLinkType = link.circularLinkType; } }); }); } function getCircleMargins(graph) { var totalTopLinksWidth = 0, totalBottomLinksWidth = 0, totalRightLinksWidth = 0, totalLeftLinksWidth = 0; var maxColumn = d3Array.max(graph.nodes, function (node) { return node.column; }); graph.links.forEach(function (link) { if (link.circular) { if (link.circularLinkType == 'top') { totalTopLinksWidth = totalTopLinksWidth + link.width; } else { totalBottomLinksWidth = totalBottomLinksWidth + link.width; } if (link.target.column == 0) { totalLeftLinksWidth = totalLeftLinksWidth + link.width; } if (link.source.column == maxColumn) { totalRightLinksWidth = totalRightLinksWidth + link.width; } } }); //account for radius of curves and padding between links totalTopLinksWidth = totalTopLinksWidth > 0 ? totalTopLinksWidth + verticalMargin + baseRadius : totalTopLinksWidth; totalBottomLinksWidth = totalBottomLinksWidth > 0 ? totalBottomLinksWidth + verticalMargin + baseRadius : totalBottomLinksWidth; totalRightLinksWidth = totalRightLinksWidth > 0 ? totalRightLinksWidth + verticalMargin + baseRadius : totalRightLinksWidth; totalLeftLinksWidth = totalLeftLinksWidth > 0 ? totalLeftLinksWidth + verticalMargin + baseRadius : totalLeftLinksWidth; return { "top": totalTopLinksWidth, "bottom": totalBottomLinksWidth, "left": totalLeftLinksWidth, "right": totalRightLinksWidth }; } // Update the x0, y0, x1 and y1 for the sankeyCircular, to allow space for any circular links function scaleSankeySize(graph, margin) { var maxColumn = d3Array.max(graph.nodes, function (node) { return node.column; }); var currentWidth = x1 - x0; var currentHeight = y1 - y0; var newWidth = currentWidth + margin.right + margin.left; var newHeight = currentHeight + margin.top + margin.bottom; var scaleX = currentWidth / newWidth; var scaleY = currentHeight / newHeight; x0 = x0 * scaleX + margin.left; x1 = margin.right == 0 ? x1 : x1 * scaleX; y0 = y0 * scaleY + margin.top; y1 = y1 * scaleY; graph.nodes.forEach(function (node) { node.x0 = x0 + node.column * ((x1 - x0 - dx) / maxColumn); node.x1 = node.x0 + dx; }); return scaleY; } // Iteratively assign the depth for each node. // Nodes are assigned the maximum depth of incoming neighbors plus one; // nodes with no incoming links are assigned depth zero, while // nodes with no outgoing links are assigned the maximum depth. function computeNodeDepths(graph) { var nodes, next, x; for (nodes = graph.nodes, next = [], x = 0; nodes.length; ++x, nodes = next, next = []) { nodes.forEach(function (node) { node.depth = x; node.sourceLinks.forEach(function (link) { if (next.indexOf(link.target) < 0 && !link.circular) { next.push(link.target); } }); }); } for (nodes = graph.nodes, next = [], x = 0; nodes.length; ++x, nodes = next, next = []) { nodes.forEach(function (node) { node.height = x; node.targetLinks.forEach(function (link) { if (next.indexOf(link.source) < 0 && !link.circular) { next.push(link.source); } }); }); } // assign column numbers, and get max value graph.nodes.forEach(function (node) { node.column = Math.floor(align.call(null, node, x)); }); } // Assign nodes' breadths, and then shift nodes that overlap (resolveCollisions) function computeNodeBreadths(graph, iterations, id) { var columns = d3Collection.nest().key(function (d) { return d.column; }).sortKeys(d3Array.ascending).entries(graph.nodes).map(function (d) { return d.values; }); initializeNodeBreadth(id); resolveCollisions(); for (var alpha = 1, n = iterations; n > 0; --n) { relaxLeftAndRight(alpha *= 0.99, id); resolveCollisions(); } function initializeNodeBreadth(id) { //override py if nodePadding has been set if (paddingRatio) { var padding = Infinity; columns.forEach(function (nodes) { var thisPadding = y1 * paddingRatio / (nodes.length + 1); padding = thisPadding < padding ? thisPadding : padding; }); py = padding; } var ky = d3Array.min(columns, function (nodes) { return (y1 - y0 - (nodes.length - 1) * py) / d3Array.sum(nodes, value); }); //calculate the widths of the links ky = ky * scale; graph.links.forEach(function (link) { link.width = link.value * ky; }); //determine how much to scale down the chart, based on circular links var margin = getCircleMargins(graph); var ratio = scaleSankeySize(graph, margin); //re-calculate widths ky = ky * ratio; graph.links.forEach(function (link) { link.width = link.value * ky; }); columns.forEach(function (nodes) { var nodesLength = nodes.length; nodes.forEach(function (node, i) { if (node.depth == columns.length - 1 && nodesLength == 1) { node.y0 = y1 / 2 - node.value * ky; node.y1 = node.y0 + node.value * ky; } else if (node.depth == 0 && nodesLength == 1) { node.y0 = y1 / 2 - node.value * ky; node.y1 = node.y0 + node.value * ky; } else if (node.partOfCycle) { if (numberOfNonSelfLinkingCycles(node, id) == 0) { node.y0 = y1 / 2 + i; node.y1 = node.y0 + node.value * ky; } else if (node.circularLinkType == 'top') { node.y0 = y0 + i; node.y1 = node.y0 + node.value * ky; } else { node.y0 = y1 - node.value * ky - i; node.y1 = node.y0 + node.value * ky; } } else { if (margin.top == 0 || margin.bottom == 0) { node.y0 = (y1 - y0) / nodesLength * i; node.y1 = node.y0 + node.value * ky; } else { node.y0 = (y1 - y0) / 2 - nodesLength / 2 + i; node.y1 = node.y0 + node.value * ky; } } }); }); } // For each node in each column, check the node's vertical position in relation to its targets and sources vertical position // and shift up/down to be closer to the vertical middle of those targets and sources function relaxLeftAndRight(alpha, id) { var columnsLength = columns.length; columns.forEach(function (nodes) { var n = nodes.length; var depth = nodes[0].depth; nodes.forEach(function (node) { // check the node is not an orphan var nodeHeight; if (node.sourceLinks.length || node.targetLinks.length) { if (node.partOfCycle && numberOfNonSelfLinkingCycles(node, id) > 0) ; else if (depth == 0 && n == 1) { nodeHeight = node.y1 - node.y0; node.y0 = y1 / 2 - nodeHeight / 2;