1
- /**
2
- * plotly.js v1.58.4
3
- * Copyright 2012-2020, Plotly, Inc.
4
- * All rights reserved.
5
- * Licensed under the MIT license
6
- */
7
1
(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){
8
2
'use strict';
9
3
@@ -16,7 +10,7 @@ var rules = {
16
10
"X a:hover": "text-decoration:none;",
17
11
"X .crisp": "shape-rendering:crispEdges;",
18
12
"X .user-select-none": "-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;",
19
- "X svg": "overflow:hidden ;",
13
+ "X svg": "overflow:visible ;",
20
14
"X svg a": "fill:#447adb;",
21
15
"X svg a:hover": "fill:#3c6dc5;",
22
16
"X .main-svg": "position:absolute;top:0;left:0;pointer-events:none;",
@@ -97424,7 +97418,7 @@ module.exports = {
97424
97418
tracegroupgap: {
97425
97419
valType: 'number',
97426
97420
min: 0,
97427
- dflt: 10 ,
97421
+ dflt: 0 ,
97428
97422
97429
97423
editType: 'legend',
97430
97424
@@ -97554,7 +97548,7 @@ module.exports = {
97554
97548
// number of px between legend title and (left) side of legend (always in x direction and from inner border)
97555
97549
titlePad: 2,
97556
97550
// number of px between each legend item (x and/or y direction)
97557
- itemGap: 5
97551
+ itemGap: 1
97558
97552
};
97559
97553
97560
97554
},{}],695:[function(_dereq_,module,exports){
@@ -97829,7 +97823,19 @@ module.exports = function draw(gd, opts) {
97829
97823
var gs = fullLayout._size;
97830
97824
var bw = opts.borderwidth;
97831
97825
97832
- var lx = gs.l + gs.w * opts.x - FROM_TL[getXanchor(opts)] * opts._width;
97826
+ var xanchor = getXanchor(opts);
97827
+ var yanchor = getYanchor(opts);
97828
+ // Adjust centering of the legend box
97829
+ var lx;
97830
+ if (xanchor === 'center' && yanchor === 'top') {
97831
+ lx = (gs.w * opts.x - 0.5 * opts._width) * 1.8;
97832
+ } else if (xanchor === 'center' && yanchor === 'bottom') {
97833
+ lx = (gs.l + gs.w * opts.x - FROM_TL[getXanchor(opts)] * opts._width)-30;
97834
+ } else if (xanchor === 'center' && yanchor === 'middle') {
97835
+ lx = (gs.l + gs.w * opts.x - FROM_TL[getXanchor(opts)] * opts._width)-15;
97836
+ } else {
97837
+ lx = gs.l + gs.w * opts.x - FROM_TL[getXanchor(opts)] * opts._width;
97838
+ }
97833
97839
var ly = gs.t + gs.h * (1 - opts.y) - FROM_TL[getYanchor(opts)] * opts._effHeight;
97834
97840
97835
97841
if(opts._main && fullLayout.margin.autoexpand) {
@@ -98335,6 +98341,7 @@ function computeLegendDimensions(gd, groups, traces, opts) {
98335
98341
}
98336
98342
} else {
98337
98343
var xanchor = getXanchor(opts);
98344
+ var isCenterOfPlotArea = (xanchor === 'center');
98338
98345
var isLeftOfPlotArea = opts.x < 0 || (opts.x === 0 && xanchor === 'right');
98339
98346
var isRightOfPlotArea = opts.x > 1 || (opts.x === 1 && xanchor === 'left');
98340
98347
var isBeyondPlotAreaY = isAbovePlotArea || isBelowPlotArea;
@@ -98344,6 +98351,7 @@ function computeLegendDimensions(gd, groups, traces, opts) {
98344
98351
// - else if below/above plot area and anchored in the margin, extend to opposite margin,
98345
98352
// - otherwise give it the maximum potential margin-push value
98346
98353
opts._maxWidth = Math.max(
98354
+ isCenterOfPlotArea ? fullLayout.width :
98347
98355
isLeftOfPlotArea ? ((isBeyondPlotAreaY && xanchor === 'left') ? gs.l + gs.w : hw) :
98348
98356
isRightOfPlotArea ? ((isBeyondPlotAreaY && xanchor === 'right') ? gs.r + gs.w : hw) :
98349
98357
gs.w,
@@ -98363,6 +98371,7 @@ function computeLegendDimensions(gd, groups, traces, opts) {
98363
98371
var maxGroupHeightInRow = 0;
98364
98372
var groupOffsetX = 0;
98365
98373
var groupOffsetY = 0;
98374
+ var next = 0;
98366
98375
groups.each(function() {
98367
98376
var maxWidthInGroup = 0;
98368
98377
var offsetY = 0;
@@ -98377,7 +98386,13 @@ function computeLegendDimensions(gd, groups, traces, opts) {
98377
98386
});
98378
98387
maxGroupHeightInRow = Math.max(maxGroupHeightInRow, offsetY);
98379
98388
98380
- var next = maxWidthInGroup + itemGap;
98389
+ if (yanchor === 'top') {
98390
+ next = fullLayout.width / 3.99;
98391
+ } else if (yanchor === 'bottom') {
98392
+ next = maxWidthInGroup + itemGap;
98393
+ } else {
98394
+ next = maxWidthInGroup + itemGap;
98395
+ }
98381
98396
98382
98397
if((next + bw + groupOffsetX) > opts._maxWidth) {
98383
98398
maxRowWidth = Math.max(maxRowWidth, groupOffsetX);
@@ -99244,7 +99259,7 @@ module.exports = function style(s, gd, legend) {
99244
99259
.selectAll('path.legend' + desiredType)
99245
99260
.data(isVisible ? [d] : []);
99246
99261
barpath.enter().append('path').classed('legend' + desiredType, true)
99247
- .attr('d', 'M6,6H-6V-6H6Z ')
99262
+ .attr('d', 'M6,0A6,6 0 1,1 0,-6A6,6 0 0,1 6,0Z ')
99248
99263
.attr('transform', centerTransform);
99249
99264
barpath.exit().remove();
99250
99265
@@ -123044,64 +123059,67 @@ exports.drawMainTitle = function(gd) {
123044
123059
var fullLayout = gd._fullLayout;
123045
123060
123046
123061
var textAnchor = getMainTitleTextAnchor(fullLayout);
123047
- var dy = getMainTitleDy(fullLayout);
123062
+ // var dy = getMainTitleDy(fullLayout);
123048
123063
123049
123064
Titles.draw(gd, 'gtitle', {
123050
123065
propContainer: fullLayout,
123051
123066
propName: 'title.text',
123052
123067
placeholder: fullLayout._dfltTitle.plot,
123053
123068
attributes: {
123054
- x: getMainTitleX(fullLayout, textAnchor),
123055
- y: getMainTitleY(fullLayout, dy),
123069
+ // x: getMainTitleX(fullLayout, textAnchor),
123070
+ x: 0,
123071
+ // y: getMainTitleY(fullLayout, dy),
123072
+ y: 15,
123056
123073
'text-anchor': textAnchor,
123057
- dy: dy
123074
+ // dy: dy
123075
+ dy: 0
123058
123076
}
123059
123077
});
123060
123078
};
123061
123079
123062
- function getMainTitleX(fullLayout, textAnchor) {
123063
- var title = fullLayout.title;
123064
- var gs = fullLayout._size;
123065
- var hPadShift = 0;
123080
+ // function getMainTitleX(fullLayout, textAnchor) {
123081
+ // var title = fullLayout.title;
123082
+ // var gs = fullLayout._size;
123083
+ // var hPadShift = 0;
123066
123084
123067
- if(textAnchor === SVG_TEXT_ANCHOR_START) {
123068
- hPadShift = title.pad.l;
123069
- } else if(textAnchor === SVG_TEXT_ANCHOR_END) {
123070
- hPadShift = -title.pad.r;
123071
- }
123085
+ // if(textAnchor === SVG_TEXT_ANCHOR_START) {
123086
+ // hPadShift = title.pad.l;
123087
+ // } else if(textAnchor === SVG_TEXT_ANCHOR_END) {
123088
+ // hPadShift = -title.pad.r;
123089
+ // }
123072
123090
123073
- switch(title.xref) {
123074
- case 'paper':
123075
- return gs.l + gs.w * title.x + hPadShift;
123076
- case 'container':
123077
- default:
123078
- return fullLayout.width * title.x + hPadShift;
123079
- }
123080
- }
123091
+ // switch(title.xref) {
123092
+ // case 'paper':
123093
+ // return gs.l + gs.w * title.x + hPadShift;
123094
+ // case 'container':
123095
+ // default:
123096
+ // return fullLayout.width * title.x + hPadShift;
123097
+ // }
123098
+ // }
123081
123099
123082
- function getMainTitleY(fullLayout, dy) {
123083
- var title = fullLayout.title;
123084
- var gs = fullLayout._size;
123085
- var vPadShift = 0;
123100
+ // function getMainTitleY(fullLayout, dy) {
123101
+ // var title = fullLayout.title;
123102
+ // var gs = fullLayout._size;
123103
+ // var vPadShift = 0;
123086
123104
123087
- if(dy === '0em' || !dy) {
123088
- vPadShift = -title.pad.b;
123089
- } else if(dy === alignmentConstants.CAP_SHIFT + 'em') {
123090
- vPadShift = title.pad.t;
123091
- }
123105
+ // if(dy === '0em' || !dy) {
123106
+ // vPadShift = -title.pad.b;
123107
+ // } else if(dy === alignmentConstants.CAP_SHIFT + 'em') {
123108
+ // vPadShift = title.pad.t;
123109
+ // }
123092
123110
123093
- if(title.y === 'auto') {
123094
- return gs.t / 2;
123095
- } else {
123096
- switch(title.yref) {
123097
- case 'paper':
123098
- return gs.t + gs.h - gs.h * title.y + vPadShift;
123099
- case 'container':
123100
- default:
123101
- return fullLayout.height - fullLayout.height * title.y + vPadShift;
123102
- }
123103
- }
123104
- }
123111
+ // if(title.y === 'auto') {
123112
+ // return gs.t / 2;
123113
+ // } else {
123114
+ // switch(title.yref) {
123115
+ // case 'paper':
123116
+ // return gs.t + gs.h - gs.h * title.y + vPadShift;
123117
+ // case 'container':
123118
+ // default:
123119
+ // return fullLayout.height - fullLayout.height * title.y + vPadShift;
123120
+ // }
123121
+ // }
123122
+ // }
123105
123123
123106
123124
function getMainTitleTextAnchor(fullLayout) {
123107
123125
var title = fullLayout.title;
@@ -135926,7 +135944,7 @@ module.exports = function setConvert(ax, fullLayout) {
135926
135944
135927
135945
if(!isFinite(ax._m) || !isFinite(ax._b) || ax._length < 0) {
135928
135946
fullLayout._replotting = false;
135929
- throw new Error('Something went wrong with axis scaling');
135947
+ // throw new Error('Something went wrong with axis scaling');
135930
135948
}
135931
135949
};
135932
135950
@@ -147861,7 +147879,7 @@ plots.plotAutoSize = function plotAutoSize(gd, layout, fullLayout) {
147861
147879
147862
147880
// somehow we get a few extra px height sometimes...
147863
147881
// just hide it
147864
- document.body.style.overflow = 'hidden ';
147882
+ document.body.style.overflow = 'visible ';
147865
147883
} else {
147866
147884
// plotly.js - let the developers do what they want, either
147867
147885
// provide height and width for the container div,
0 commit comments