plotly.js 2.6.1 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/README.md +3 -3
- package/dist/README.md +26 -26
- package/dist/plot-schema.json +117 -0
- package/dist/plotly-basic.js +129 -90
- package/dist/plotly-basic.min.js +2 -2
- package/dist/plotly-cartesian.js +187 -97
- package/dist/plotly-cartesian.min.js +2 -2
- package/dist/plotly-finance.js +179 -92
- package/dist/plotly-finance.min.js +2 -2
- package/dist/plotly-geo-assets.js +2 -2
- package/dist/plotly-geo.js +128 -89
- package/dist/plotly-geo.min.js +4 -4
- package/dist/plotly-gl2d.js +134 -110
- package/dist/plotly-gl2d.min.js +2 -2
- package/dist/plotly-gl3d.js +128 -89
- package/dist/plotly-gl3d.min.js +2 -2
- package/dist/plotly-mapbox.js +134 -92
- package/dist/plotly-mapbox.min.js +2 -2
- package/dist/plotly-strict.js +199 -121
- package/dist/plotly-strict.min.js +2 -2
- package/dist/plotly-with-meta.js +202 -121
- package/dist/plotly.js +199 -121
- package/dist/plotly.min.js +2 -2
- package/package.json +10 -9
- package/src/components/colorbar/draw.js +72 -61
- package/src/components/drawing/index.js +6 -3
- package/src/components/fx/hover.js +11 -15
- package/src/plot_api/plot_api.js +37 -8
- package/src/plots/mapbox/mapbox.js +6 -3
- package/src/traces/bar/plot.js +1 -1
- package/src/traces/histogram/attributes.js +40 -0
- package/src/traces/histogram/defaults.js +11 -0
- package/src/version.js +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* plotly.js v2.
|
|
2
|
+
* plotly.js v2.7.0
|
|
3
3
|
* Copyright 2012-2021, Plotly, Inc.
|
|
4
4
|
* All rights reserved.
|
|
5
5
|
* Licensed under the MIT license
|
|
@@ -68,7 +68,7 @@ exports.topojson = saneTopojson;
|
|
|
68
68
|
'use strict';
|
|
69
69
|
|
|
70
70
|
// package version injected by `npm run preprocess`
|
|
71
|
-
exports.version = '2.
|
|
71
|
+
exports.version = '2.7.0';
|
|
72
72
|
|
|
73
73
|
},{}]},{},[16])(16)
|
|
74
74
|
});
|
package/dist/plotly-geo.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* plotly.js (geo) v2.
|
|
2
|
+
* plotly.js (geo) v2.7.0
|
|
3
3
|
* Copyright 2012-2021, Plotly, Inc.
|
|
4
4
|
* All rights reserved.
|
|
5
5
|
* Licensed under the MIT license
|
|
@@ -35716,6 +35716,19 @@ function makeColorBarData(gd) {
|
|
|
35716
35716
|
}
|
|
35717
35717
|
|
|
35718
35718
|
function drawColorBar(g, opts, gd) {
|
|
35719
|
+
var len = opts.len;
|
|
35720
|
+
var lenmode = opts.lenmode;
|
|
35721
|
+
var thickness = opts.thickness;
|
|
35722
|
+
var thicknessmode = opts.thicknessmode;
|
|
35723
|
+
var outlinewidth = opts.outlinewidth;
|
|
35724
|
+
var borderwidth = opts.borderwidth;
|
|
35725
|
+
var xanchor = opts.xanchor;
|
|
35726
|
+
var yanchor = opts.yanchor;
|
|
35727
|
+
var xpad = opts.xpad;
|
|
35728
|
+
var ypad = opts.ypad;
|
|
35729
|
+
var optsX = opts.x;
|
|
35730
|
+
var optsY = opts.y;
|
|
35731
|
+
|
|
35719
35732
|
var fullLayout = gd._fullLayout;
|
|
35720
35733
|
var gs = fullLayout._size;
|
|
35721
35734
|
|
|
@@ -35745,42 +35758,41 @@ function drawColorBar(g, opts, gd) {
|
|
|
35745
35758
|
// when the colorbar itself is pushing the margins.
|
|
35746
35759
|
// but then the fractional size is calculated based on the
|
|
35747
35760
|
// actual graph size, so that the axes will size correctly.
|
|
35748
|
-
var thickPx = Math.round(
|
|
35761
|
+
var thickPx = Math.round(thickness * (thicknessmode === 'fraction' ? gs.w : 1));
|
|
35749
35762
|
var thickFrac = thickPx / gs.w;
|
|
35750
|
-
var lenPx = Math.round(
|
|
35763
|
+
var lenPx = Math.round(len * (lenmode === 'fraction' ? gs.h : 1));
|
|
35751
35764
|
var lenFrac = lenPx / gs.h;
|
|
35752
|
-
var xpadFrac =
|
|
35753
|
-
var yExtraPx = (
|
|
35754
|
-
var ypadFrac =
|
|
35765
|
+
var xpadFrac = xpad / gs.w;
|
|
35766
|
+
var yExtraPx = (borderwidth + outlinewidth) / 2;
|
|
35767
|
+
var ypadFrac = ypad / gs.h;
|
|
35755
35768
|
|
|
35756
35769
|
// x positioning: do it initially just for left anchor,
|
|
35757
35770
|
// then fix at the end (since we don't know the width yet)
|
|
35758
|
-
var
|
|
35771
|
+
var uPx = Math.round(optsX * gs.w + xpad);
|
|
35759
35772
|
// for dragging... this is getting a little muddled...
|
|
35760
|
-
var
|
|
35773
|
+
var uFrac = optsX - thickFrac * ({center: 0.5, right: 1}[xanchor] || 0);
|
|
35761
35774
|
|
|
35762
35775
|
// y positioning we can do correctly from the start
|
|
35763
|
-
var
|
|
35764
|
-
var
|
|
35765
|
-
var yTopPx = yBottomPx - lenPx;
|
|
35776
|
+
var vFrac = optsY + lenFrac * (({top: -0.5, bottom: 0.5}[yanchor] || 0) - 0.5);
|
|
35777
|
+
var vPx = Math.round(gs.h * (1 - vFrac));
|
|
35766
35778
|
|
|
35767
35779
|
// stash a few things for makeEditable
|
|
35768
35780
|
opts._lenFrac = lenFrac;
|
|
35769
35781
|
opts._thickFrac = thickFrac;
|
|
35770
|
-
opts.
|
|
35771
|
-
opts.
|
|
35782
|
+
opts._uFrac = uFrac;
|
|
35783
|
+
opts._vFrac = vFrac;
|
|
35772
35784
|
|
|
35773
35785
|
// stash mocked axis for contour label formatting
|
|
35774
35786
|
var ax = opts._axis = mockColorBarAxis(gd, opts, zrange);
|
|
35775
35787
|
|
|
35776
35788
|
// position can't go in through supplyDefaults
|
|
35777
35789
|
// because that restricts it to [0,1]
|
|
35778
|
-
ax.position =
|
|
35790
|
+
ax.position = optsX + xpadFrac + thickFrac;
|
|
35779
35791
|
|
|
35780
35792
|
if(['top', 'bottom'].indexOf(titleSide) !== -1) {
|
|
35781
35793
|
ax.title.side = titleSide;
|
|
35782
|
-
ax.titlex =
|
|
35783
|
-
ax.titley =
|
|
35794
|
+
ax.titlex = optsX + xpadFrac;
|
|
35795
|
+
ax.titley = vFrac + (title.side === 'top' ? lenFrac - ypadFrac : ypadFrac);
|
|
35784
35796
|
}
|
|
35785
35797
|
|
|
35786
35798
|
if(line.color && opts.tickmode === 'auto') {
|
|
@@ -35788,7 +35800,7 @@ function drawColorBar(g, opts, gd) {
|
|
|
35788
35800
|
ax.tick0 = levelsIn.start;
|
|
35789
35801
|
var dtick = levelsIn.size;
|
|
35790
35802
|
// expand if too many contours, so we don't get too many ticks
|
|
35791
|
-
var autoNtick = Lib.constrain(
|
|
35803
|
+
var autoNtick = Lib.constrain(lenPx / 50, 4, 15) + 1;
|
|
35792
35804
|
var dtFactor = (zrange[1] - zrange[0]) / ((opts.nticks || autoNtick) * dtick);
|
|
35793
35805
|
if(dtFactor > 1) {
|
|
35794
35806
|
var dtexp = Math.pow(10, Math.floor(Math.log(dtFactor) / Math.LN10));
|
|
@@ -35806,8 +35818,8 @@ function drawColorBar(g, opts, gd) {
|
|
|
35806
35818
|
// set domain after init, because we may want to
|
|
35807
35819
|
// allow it outside [0,1]
|
|
35808
35820
|
ax.domain = [
|
|
35809
|
-
|
|
35810
|
-
|
|
35821
|
+
vFrac + ypadFrac,
|
|
35822
|
+
vFrac + lenFrac - ypadFrac
|
|
35811
35823
|
];
|
|
35812
35824
|
|
|
35813
35825
|
ax.setScale();
|
|
@@ -35848,15 +35860,15 @@ function drawColorBar(g, opts, gd) {
|
|
|
35848
35860
|
// draw the title so we know how much room it needs
|
|
35849
35861
|
// when we squish the axis. This one only applies to
|
|
35850
35862
|
// top or bottom titles, not right side.
|
|
35851
|
-
var x = gs.l + (
|
|
35863
|
+
var x = gs.l + (optsX + xpadFrac) * gs.w;
|
|
35852
35864
|
var fontSize = ax.title.font.size;
|
|
35853
35865
|
var y;
|
|
35854
35866
|
|
|
35855
35867
|
if(titleSide === 'top') {
|
|
35856
|
-
y = (1 - (
|
|
35868
|
+
y = (1 - (vFrac + lenFrac - ypadFrac)) * gs.h +
|
|
35857
35869
|
gs.t + 3 + fontSize * 0.75;
|
|
35858
35870
|
} else {
|
|
35859
|
-
y = (1 - (
|
|
35871
|
+
y = (1 - (vFrac + ypadFrac)) * gs.h +
|
|
35860
35872
|
gs.t - 3 - fontSize * 0.25;
|
|
35861
35873
|
}
|
|
35862
35874
|
drawTitle(ax._id + 'title', {
|
|
@@ -35895,7 +35907,7 @@ function drawColorBar(g, opts, gd) {
|
|
|
35895
35907
|
// squish the axis top to make room for the title
|
|
35896
35908
|
var titleGroup = g.select('.' + cn.cbtitle);
|
|
35897
35909
|
var titleText = titleGroup.select('text');
|
|
35898
|
-
var titleTrans = [-
|
|
35910
|
+
var titleTrans = [-outlinewidth / 2, outlinewidth / 2];
|
|
35899
35911
|
var mathJaxNode = titleGroup
|
|
35900
35912
|
.select('.h' + ax._id + 'title-math-group')
|
|
35901
35913
|
.node();
|
|
@@ -35967,7 +35979,7 @@ function drawColorBar(g, opts, gd) {
|
|
|
35967
35979
|
// Colorbar cannot currently support opacities so we
|
|
35968
35980
|
// use an opaque fill even when alpha channels present
|
|
35969
35981
|
var fillEl = d3.select(this).attr({
|
|
35970
|
-
x:
|
|
35982
|
+
x: uPx,
|
|
35971
35983
|
width: Math.max(thickPx, 2),
|
|
35972
35984
|
y: d3.min(z),
|
|
35973
35985
|
height: Math.max(d3.max(z) - d3.min(z), 2),
|
|
@@ -35991,7 +36003,7 @@ function drawColorBar(g, opts, gd) {
|
|
|
35991
36003
|
lines.exit().remove();
|
|
35992
36004
|
lines.each(function(d) {
|
|
35993
36005
|
d3.select(this)
|
|
35994
|
-
.attr('d', 'M' +
|
|
36006
|
+
.attr('d', 'M' + uPx + ',' +
|
|
35995
36007
|
(Math.round(ax.c2p(d)) + (line.width / 2) % 1) + 'h' + thickPx)
|
|
35996
36008
|
.call(Drawing.lineGroupStyle, line.width, lineColormap(d), line.dash);
|
|
35997
36009
|
});
|
|
@@ -35999,8 +36011,8 @@ function drawColorBar(g, opts, gd) {
|
|
|
35999
36011
|
// force full redraw of labels and ticks
|
|
36000
36012
|
axLayer.selectAll('g.' + ax._id + 'tick,path').remove();
|
|
36001
36013
|
|
|
36002
|
-
var shift =
|
|
36003
|
-
(
|
|
36014
|
+
var shift = uPx + thickPx +
|
|
36015
|
+
(outlinewidth || 0) / 2 - (opts.ticks === 'outside' ? 1 : 0);
|
|
36004
36016
|
|
|
36005
36017
|
var vals = Axes.calcTicks(ax);
|
|
36006
36018
|
var tickSign = Axes.getTickSigns(ax)[2];
|
|
@@ -36025,9 +36037,9 @@ function drawColorBar(g, opts, gd) {
|
|
|
36025
36037
|
// TODO: why are we redrawing multiple times now with this?
|
|
36026
36038
|
// I guess autoMargin doesn't like being post-promise?
|
|
36027
36039
|
function positionCB() {
|
|
36028
|
-
var
|
|
36040
|
+
var innerThickness = thickPx + outlinewidth / 2;
|
|
36029
36041
|
if(ax.ticklabelposition.indexOf('inside') === -1) {
|
|
36030
|
-
|
|
36042
|
+
innerThickness += Drawing.bBox(axLayer.node()).width;
|
|
36031
36043
|
}
|
|
36032
36044
|
|
|
36033
36045
|
titleEl = titleCont.select('text');
|
|
@@ -36042,66 +36054,65 @@ function drawColorBar(g, opts, gd) {
|
|
|
36042
36054
|
// (except for top/bottom mathjax, above)
|
|
36043
36055
|
// but the weird gs.l is because the titleunshift
|
|
36044
36056
|
// transform gets removed by Drawing.bBox
|
|
36045
|
-
titleWidth = Drawing.bBox(titleCont.node()).right -
|
|
36057
|
+
titleWidth = Drawing.bBox(titleCont.node()).right - uPx - gs.l;
|
|
36046
36058
|
}
|
|
36047
|
-
|
|
36059
|
+
innerThickness = Math.max(innerThickness, titleWidth);
|
|
36048
36060
|
}
|
|
36049
36061
|
|
|
36050
|
-
var
|
|
36051
|
-
var outerheight = yBottomPx - yTopPx;
|
|
36062
|
+
var outerThickness = 2 * xpad + innerThickness + borderwidth + outlinewidth / 2;
|
|
36052
36063
|
|
|
36053
36064
|
g.select('.' + cn.cbbg).attr({
|
|
36054
|
-
x:
|
|
36055
|
-
y:
|
|
36056
|
-
width: Math.max(
|
|
36057
|
-
height: Math.max(
|
|
36065
|
+
x: uPx - xpad - (borderwidth + outlinewidth) / 2,
|
|
36066
|
+
y: vPx - lenPx - yExtraPx,
|
|
36067
|
+
width: Math.max(outerThickness, 2),
|
|
36068
|
+
height: Math.max(lenPx + 2 * yExtraPx, 2)
|
|
36058
36069
|
})
|
|
36059
36070
|
.call(Color.fill, opts.bgcolor)
|
|
36060
36071
|
.call(Color.stroke, opts.bordercolor)
|
|
36061
|
-
.style('stroke-width',
|
|
36072
|
+
.style('stroke-width', borderwidth);
|
|
36062
36073
|
|
|
36063
36074
|
g.selectAll('.' + cn.cboutline).attr({
|
|
36064
|
-
x:
|
|
36065
|
-
y:
|
|
36075
|
+
x: uPx,
|
|
36076
|
+
y: vPx - lenPx + ypad + (titleSide === 'top' ? titleHeight : 0),
|
|
36066
36077
|
width: Math.max(thickPx, 2),
|
|
36067
|
-
height: Math.max(
|
|
36078
|
+
height: Math.max(lenPx - 2 * ypad - titleHeight, 2)
|
|
36068
36079
|
})
|
|
36069
36080
|
.call(Color.stroke, opts.outlinecolor)
|
|
36070
36081
|
.style({
|
|
36071
36082
|
fill: 'none',
|
|
36072
|
-
'stroke-width':
|
|
36083
|
+
'stroke-width': outlinewidth
|
|
36073
36084
|
});
|
|
36074
36085
|
|
|
36075
36086
|
// fix positioning for xanchor!='left'
|
|
36076
|
-
var xoffset = ({center: 0.5, right: 1}[
|
|
36087
|
+
var xoffset = ({center: 0.5, right: 1}[xanchor] || 0) * outerThickness;
|
|
36077
36088
|
g.attr('transform', strTranslate(gs.l - xoffset, gs.t));
|
|
36078
36089
|
|
|
36079
36090
|
// auto margin adjustment
|
|
36080
36091
|
var marginOpts = {};
|
|
36081
|
-
var tFrac = FROM_TL[
|
|
36082
|
-
var bFrac = FROM_BR[
|
|
36083
|
-
if(
|
|
36084
|
-
marginOpts.y =
|
|
36085
|
-
marginOpts.t =
|
|
36086
|
-
marginOpts.b =
|
|
36092
|
+
var tFrac = FROM_TL[yanchor];
|
|
36093
|
+
var bFrac = FROM_BR[yanchor];
|
|
36094
|
+
if(lenmode === 'pixels') {
|
|
36095
|
+
marginOpts.y = optsY;
|
|
36096
|
+
marginOpts.t = lenPx * tFrac;
|
|
36097
|
+
marginOpts.b = lenPx * bFrac;
|
|
36087
36098
|
} else {
|
|
36088
36099
|
marginOpts.t = marginOpts.b = 0;
|
|
36089
|
-
marginOpts.yt =
|
|
36090
|
-
marginOpts.yb =
|
|
36100
|
+
marginOpts.yt = optsY + len * tFrac;
|
|
36101
|
+
marginOpts.yb = optsY - len * bFrac;
|
|
36091
36102
|
}
|
|
36092
36103
|
|
|
36093
|
-
var lFrac = FROM_TL[
|
|
36094
|
-
var rFrac = FROM_BR[
|
|
36095
|
-
if(
|
|
36096
|
-
marginOpts.x =
|
|
36097
|
-
marginOpts.l =
|
|
36098
|
-
marginOpts.r =
|
|
36104
|
+
var lFrac = FROM_TL[xanchor];
|
|
36105
|
+
var rFrac = FROM_BR[xanchor];
|
|
36106
|
+
if(thicknessmode === 'pixels') {
|
|
36107
|
+
marginOpts.x = optsX;
|
|
36108
|
+
marginOpts.l = outerThickness * lFrac;
|
|
36109
|
+
marginOpts.r = outerThickness * rFrac;
|
|
36099
36110
|
} else {
|
|
36100
|
-
var extraThickness =
|
|
36111
|
+
var extraThickness = outerThickness - thickPx;
|
|
36101
36112
|
marginOpts.l = extraThickness * lFrac;
|
|
36102
36113
|
marginOpts.r = extraThickness * rFrac;
|
|
36103
|
-
marginOpts.xl =
|
|
36104
|
-
marginOpts.xr =
|
|
36114
|
+
marginOpts.xl = optsX - thickness * lFrac;
|
|
36115
|
+
marginOpts.xr = optsX + thickness * rFrac;
|
|
36105
36116
|
}
|
|
36106
36117
|
|
|
36107
36118
|
Plots.autoMargin(gd, opts._id, marginOpts);
|
|
@@ -36132,9 +36143,9 @@ function makeEditable(g, opts, gd) {
|
|
|
36132
36143
|
moveFn: function(dx, dy) {
|
|
36133
36144
|
g.attr('transform', t0 + strTranslate(dx, dy));
|
|
36134
36145
|
|
|
36135
|
-
xf = dragElement.align(opts.
|
|
36146
|
+
xf = dragElement.align(opts._uFrac + (dx / gs.w), opts._thickFrac,
|
|
36136
36147
|
0, 1, opts.xanchor);
|
|
36137
|
-
yf = dragElement.align(opts.
|
|
36148
|
+
yf = dragElement.align(opts._vFrac - (dy / gs.h), opts._lenFrac,
|
|
36138
36149
|
0, 1, opts.yanchor);
|
|
36139
36150
|
|
|
36140
36151
|
var csr = dragElement.getCursor(xf, yf, opts.xanchor, opts.yanchor);
|
|
@@ -38713,7 +38724,7 @@ var TEXTOFFSETSIGN = {
|
|
|
38713
38724
|
start: 1, end: -1, middle: 0, bottom: 1, top: -1
|
|
38714
38725
|
};
|
|
38715
38726
|
|
|
38716
|
-
function textPointPosition(s, textPosition, fontSize, markerRadius) {
|
|
38727
|
+
function textPointPosition(s, textPosition, fontSize, markerRadius, dontTouchParent) {
|
|
38717
38728
|
var group = d3.select(s.node().parentNode);
|
|
38718
38729
|
|
|
38719
38730
|
var v = textPosition.indexOf('top') !== -1 ?
|
|
@@ -38735,7 +38746,9 @@ function textPointPosition(s, textPosition, fontSize, markerRadius) {
|
|
|
38735
38746
|
|
|
38736
38747
|
// fix the overall text group position
|
|
38737
38748
|
s.attr('text-anchor', h);
|
|
38738
|
-
|
|
38749
|
+
if(!dontTouchParent) {
|
|
38750
|
+
group.attr('transform', strTranslate(dx, dy));
|
|
38751
|
+
}
|
|
38739
38752
|
}
|
|
38740
38753
|
|
|
38741
38754
|
function extracTextFontSize(d, trace) {
|
|
@@ -38805,7 +38818,8 @@ drawing.selectedTextStyle = function(s, trace) {
|
|
|
38805
38818
|
var fontSize = extracTextFontSize(d, trace);
|
|
38806
38819
|
|
|
38807
38820
|
Color.fill(tx, tc);
|
|
38808
|
-
|
|
38821
|
+
var dontTouchParent = Registry.traceIs(trace, 'bar-like');
|
|
38822
|
+
textPointPosition(tx, tp, fontSize, d.mrc2 || d.mrc, dontTouchParent);
|
|
38809
38823
|
});
|
|
38810
38824
|
};
|
|
38811
38825
|
|
|
@@ -40836,11 +40850,13 @@ var cartesianScatterPoints = {
|
|
|
40836
40850
|
// The actual rendering is done by private function _hover.
|
|
40837
40851
|
exports.hover = function hover(gd, evt, subplot, noHoverEvent) {
|
|
40838
40852
|
gd = Lib.getGraphDiv(gd);
|
|
40839
|
-
|
|
40853
|
+
// The 'target' property changes when bubbling out of Shadow DOM.
|
|
40854
|
+
// Throttling can delay reading the target, so we save the current value.
|
|
40855
|
+
var eventTarget = evt.target;
|
|
40840
40856
|
Lib.throttle(
|
|
40841
40857
|
gd._fullLayout._uid + constants.HOVERID,
|
|
40842
40858
|
constants.HOVERMINTIME,
|
|
40843
|
-
function() { _hover(gd, evt, subplot, noHoverEvent); }
|
|
40859
|
+
function() { _hover(gd, evt, subplot, noHoverEvent, eventTarget); }
|
|
40844
40860
|
);
|
|
40845
40861
|
};
|
|
40846
40862
|
|
|
@@ -41005,7 +41021,7 @@ exports.loneHover = function loneHover(hoverItems, opts) {
|
|
|
41005
41021
|
};
|
|
41006
41022
|
|
|
41007
41023
|
// The actual implementation is here:
|
|
41008
|
-
function _hover(gd, evt, subplot, noHoverEvent) {
|
|
41024
|
+
function _hover(gd, evt, subplot, noHoverEvent, eventTarget) {
|
|
41009
41025
|
if(!subplot) subplot = 'xy';
|
|
41010
41026
|
|
|
41011
41027
|
// if the user passed in an array of subplots,
|
|
@@ -41124,7 +41140,7 @@ function _hover(gd, evt, subplot, noHoverEvent) {
|
|
|
41124
41140
|
// [x|y]px: the pixels (from top left) of the mouse location
|
|
41125
41141
|
// on the currently selected plot area
|
|
41126
41142
|
// add pointerX|Y property for drawing the spikes in spikesnap 'cursor' situation
|
|
41127
|
-
var hasUserCalledHover = !
|
|
41143
|
+
var hasUserCalledHover = !eventTarget;
|
|
41128
41144
|
var xpx, ypx;
|
|
41129
41145
|
|
|
41130
41146
|
if(hasUserCalledHover) {
|
|
@@ -41141,13 +41157,7 @@ function _hover(gd, evt, subplot, noHoverEvent) {
|
|
|
41141
41157
|
return;
|
|
41142
41158
|
}
|
|
41143
41159
|
|
|
41144
|
-
|
|
41145
|
-
var target = evt.composedPath && evt.composedPath()[0];
|
|
41146
|
-
if(!target) {
|
|
41147
|
-
// Fallback for browsers not supporting composedPath
|
|
41148
|
-
target = evt.target;
|
|
41149
|
-
}
|
|
41150
|
-
var dbb = target.getBoundingClientRect();
|
|
41160
|
+
var dbb = eventTarget.getBoundingClientRect();
|
|
41151
41161
|
|
|
41152
41162
|
xpx = evt.clientX - dbb.left;
|
|
41153
41163
|
ypx = evt.clientY - dbb.top;
|
|
@@ -41595,15 +41605,15 @@ function _hover(gd, evt, subplot, noHoverEvent) {
|
|
|
41595
41605
|
if(!helpers.isUnifiedHover(hovermode)) {
|
|
41596
41606
|
hoverAvoidOverlaps(hoverLabels, rotateLabels ? 'xa' : 'ya', fullLayout);
|
|
41597
41607
|
alignHoverText(hoverLabels, rotateLabels, fullLayout._invScaleX, fullLayout._invScaleY);
|
|
41598
|
-
} // TODO: tagName hack is needed to appease geo.js's hack of using
|
|
41608
|
+
} // TODO: tagName hack is needed to appease geo.js's hack of using eventTarget=true
|
|
41599
41609
|
// we should improve the "fx" API so other plots can use it without these hack.
|
|
41600
|
-
if(
|
|
41610
|
+
if(eventTarget && eventTarget.tagName) {
|
|
41601
41611
|
var hasClickToShow = Registry.getComponentMethod('annotations', 'hasClickToShow')(gd, newhoverdata);
|
|
41602
|
-
overrideCursor(d3.select(
|
|
41612
|
+
overrideCursor(d3.select(eventTarget), hasClickToShow ? 'pointer' : '');
|
|
41603
41613
|
}
|
|
41604
41614
|
|
|
41605
41615
|
// don't emit events if called manually
|
|
41606
|
-
if(!
|
|
41616
|
+
if(!eventTarget || noHoverEvent || !hoverChanged(gd, evt, oldhoverdata)) return;
|
|
41607
41617
|
|
|
41608
41618
|
if(oldhoverdata) {
|
|
41609
41619
|
gd.emit('plotly_unhover', {
|
|
@@ -65411,7 +65421,8 @@ function findUIPattern(key, patternSpecs) {
|
|
|
65411
65421
|
var spec = patternSpecs[i];
|
|
65412
65422
|
var match = key.match(spec.pattern);
|
|
65413
65423
|
if(match) {
|
|
65414
|
-
|
|
65424
|
+
var head = match[1] || '';
|
|
65425
|
+
return {head: head, tail: key.substr(head.length + 1), attr: spec.attr};
|
|
65415
65426
|
}
|
|
65416
65427
|
}
|
|
65417
65428
|
}
|
|
@@ -65463,26 +65474,54 @@ function valsMatch(v1, v2) {
|
|
|
65463
65474
|
|
|
65464
65475
|
function applyUIRevisions(data, layout, oldFullData, oldFullLayout) {
|
|
65465
65476
|
var layoutPreGUI = oldFullLayout._preGUI;
|
|
65466
|
-
var key, revAttr, oldRev, newRev, match, preGUIVal, newNP, newVal;
|
|
65477
|
+
var key, revAttr, oldRev, newRev, match, preGUIVal, newNP, newVal, head, tail;
|
|
65467
65478
|
var bothInheritAutorange = [];
|
|
65479
|
+
var newAutorangeIn = {};
|
|
65468
65480
|
var newRangeAccepted = {};
|
|
65469
65481
|
for(key in layoutPreGUI) {
|
|
65470
65482
|
match = findUIPattern(key, layoutUIControlPatterns);
|
|
65471
65483
|
if(match) {
|
|
65472
|
-
|
|
65484
|
+
head = match.head;
|
|
65485
|
+
tail = match.tail;
|
|
65486
|
+
revAttr = match.attr || (head + '.uirevision');
|
|
65473
65487
|
oldRev = nestedProperty(oldFullLayout, revAttr).get();
|
|
65474
65488
|
newRev = oldRev && getNewRev(revAttr, layout);
|
|
65489
|
+
|
|
65475
65490
|
if(newRev && (newRev === oldRev)) {
|
|
65476
65491
|
preGUIVal = layoutPreGUI[key];
|
|
65477
65492
|
if(preGUIVal === null) preGUIVal = undefined;
|
|
65478
65493
|
newNP = nestedProperty(layout, key);
|
|
65479
65494
|
newVal = newNP.get();
|
|
65495
|
+
|
|
65480
65496
|
if(valsMatch(newVal, preGUIVal)) {
|
|
65481
|
-
if(newVal === undefined &&
|
|
65482
|
-
bothInheritAutorange.push(
|
|
65497
|
+
if(newVal === undefined && tail === 'autorange') {
|
|
65498
|
+
bothInheritAutorange.push(head);
|
|
65483
65499
|
}
|
|
65484
65500
|
newNP.set(undefinedToNull(nestedProperty(oldFullLayout, key).get()));
|
|
65485
65501
|
continue;
|
|
65502
|
+
} else if(tail === 'autorange' || tail.substr(0, 6) === 'range[') {
|
|
65503
|
+
// Special case for (auto)range since we push it back into the layout
|
|
65504
|
+
// so all null should be treated equivalently to autorange: true with any range
|
|
65505
|
+
var pre0 = layoutPreGUI[head + '.range[0]'];
|
|
65506
|
+
var pre1 = layoutPreGUI[head + '.range[1]'];
|
|
65507
|
+
var preAuto = layoutPreGUI[head + '.autorange'];
|
|
65508
|
+
if(preAuto || (preAuto === null && pre0 === null && pre1 === null)) {
|
|
65509
|
+
// Only read the input layout once and stash the result,
|
|
65510
|
+
// so we get it before we start modifying it
|
|
65511
|
+
if(!(head in newAutorangeIn)) {
|
|
65512
|
+
var newContainer = nestedProperty(layout, head).get();
|
|
65513
|
+
newAutorangeIn[head] = newContainer && (
|
|
65514
|
+
newContainer.autorange ||
|
|
65515
|
+
(newContainer.autorange !== false && (
|
|
65516
|
+
!newContainer.range || newContainer.range.length !== 2)
|
|
65517
|
+
)
|
|
65518
|
+
);
|
|
65519
|
+
}
|
|
65520
|
+
if(newAutorangeIn[head]) {
|
|
65521
|
+
newNP.set(undefinedToNull(nestedProperty(oldFullLayout, key).get()));
|
|
65522
|
+
continue;
|
|
65523
|
+
}
|
|
65524
|
+
}
|
|
65486
65525
|
}
|
|
65487
65526
|
}
|
|
65488
65527
|
} else {
|
|
@@ -65493,12 +65532,12 @@ function applyUIRevisions(data, layout, oldFullData, oldFullLayout) {
|
|
|
65493
65532
|
// so remove it from _preGUI for next time.
|
|
65494
65533
|
delete layoutPreGUI[key];
|
|
65495
65534
|
|
|
65496
|
-
if(
|
|
65497
|
-
newRangeAccepted[
|
|
65535
|
+
if(match && match.tail.substr(0, 6) === 'range[') {
|
|
65536
|
+
newRangeAccepted[match.head] = 1;
|
|
65498
65537
|
}
|
|
65499
65538
|
}
|
|
65500
65539
|
|
|
65501
|
-
//
|
|
65540
|
+
// More special logic for `autorange`, since it interacts with `range`:
|
|
65502
65541
|
// If the new figure's matching `range` was kept, and `autorange`
|
|
65503
65542
|
// wasn't supplied explicitly in either the original or the new figure,
|
|
65504
65543
|
// we shouldn't alter that - but we may just have done that, so fix it.
|
|
@@ -95037,7 +95076,7 @@ function getSortFunc(opts, d2c) {
|
|
|
95037
95076
|
'use strict';
|
|
95038
95077
|
|
|
95039
95078
|
// package version injected by `npm run preprocess`
|
|
95040
|
-
exports.version = '2.
|
|
95079
|
+
exports.version = '2.7.0';
|
|
95041
95080
|
|
|
95042
95081
|
},{}]},{},[8])(8)
|
|
95043
95082
|
});
|