1
1
/**
2
- * plotly.js v1.14.0
2
+ * plotly.js v1.14.1
3
3
* Copyright 2012-2016, Plotly, Inc.
4
4
* All rights reserved.
5
5
* Licensed under the MIT license
@@ -60704,7 +60704,7 @@ exports.svgAttrs = {
60704
60704
var Plotly = require('./plotly');
60705
60705
60706
60706
// package version injected by `npm run preprocess`
60707
- exports.version = '1.14.0 ';
60707
+ exports.version = '1.14.1 ';
60708
60708
60709
60709
// plot api
60710
60710
exports.plot = Plotly.plot;
@@ -83808,9 +83808,9 @@ proto.initInteractions = function() {
83808
83808
Plotly.relayout(gd, attrs);
83809
83809
}
83810
83810
83811
- dragElement.init(dragOptions);
83812
-
83813
83811
// finally, set up hover and click
83812
+ // these event handlers must already be set before dragElement.init
83813
+ // so it can stash them and override them.
83814
83814
dragger.onmousemove = function(evt) {
83815
83815
fx.hover(gd, evt, _this.id);
83816
83816
gd._fullLayout._lasthover = dragger;
@@ -83826,6 +83826,8 @@ proto.initInteractions = function() {
83826
83826
dragger.onclick = function(evt) {
83827
83827
fx.click(gd, evt);
83828
83828
};
83829
+
83830
+ dragElement.init(dragOptions);
83829
83831
};
83830
83832
83831
83833
function removeZoombox(gd) {
@@ -89255,15 +89257,15 @@ function plotOne(gd, plotinfo, cd) {
89255
89257
89256
89258
image3.enter().append('svg:image').attr({
89257
89259
xmlns: xmlnsNamespaces.svg,
89258
- 'xlink:href': canvas.toDataURL('image/png'),
89259
89260
preserveAspectRatio: 'none'
89260
89261
});
89261
89262
89262
89263
image3.attr({
89263
89264
height: imageHeight,
89264
89265
width: imageWidth,
89265
89266
x: left,
89266
- y: top
89267
+ y: top,
89268
+ 'xlink:href': canvas.toDataURL('image/png')
89267
89269
});
89268
89270
89269
89271
image3.exit().remove();
@@ -93250,6 +93252,11 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) {
93250
93252
}
93251
93253
93252
93254
if(inside) {
93255
+ // constrain ymin/max to the visible plot, so the label goes
93256
+ // at the middle of the piece you can see
93257
+ ymin = Math.max(ymin, 0);
93258
+ ymax = Math.min(ymax, ya._length);
93259
+
93253
93260
// find the overall left-most and right-most points of the
93254
93261
// polygon(s) we're inside at their combined vertical midpoint.
93255
93262
// This is where we will draw the hover label.
@@ -93271,6 +93278,10 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) {
93271
93278
}
93272
93279
}
93273
93280
93281
+ // constrain xmin/max to the visible plot now too
93282
+ xmin = Math.max(xmin, 0);
93283
+ xmax = Math.min(xmax, xa._length);
93284
+
93274
93285
// get only fill or line color for the hover color
93275
93286
var color = Color.defaultLine;
93276
93287
if(Color.opacity(trace.fillcolor)) color = trace.fillcolor;
@@ -96665,12 +96676,29 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) {
96665
96676
var scatterPointData = scatterHover(pointData, xval, yval, hovermode);
96666
96677
if(!scatterPointData || scatterPointData[0].index === false) return;
96667
96678
96668
- // if hovering on a fill, we don't show any point data so the label is
96669
- // unchanged from what scatter gives us.
96670
- if(scatterPointData[0].index === undefined) return scatterPointData;
96679
+ var newPointData = scatterPointData[0];
96671
96680
96672
- var newPointData = scatterPointData[0],
96673
- cdi = newPointData.cd[newPointData.index];
96681
+ // if hovering on a fill, we don't show any point data so the label is
96682
+ // unchanged from what scatter gives us - except that it needs to
96683
+ // be constrained to the trianglular plot area, not just the rectangular
96684
+ // area defined by the synthetic x and y axes
96685
+ // TODO: in some cases the vertical middle of the shape is not within
96686
+ // the triangular viewport at all, so the label can become disconnected
96687
+ // from the shape entirely. But calculating what portion of the shape
96688
+ // is actually visible, as constrained by the diagonal axis lines, is not
96689
+ // so easy and anyway we lost the information we would have needed to do
96690
+ // this inside scatterHover.
96691
+ if(newPointData.index === undefined) {
96692
+ var yFracUp = 1 - (newPointData.y0 / pointData.ya._length),
96693
+ xLen = pointData.xa._length,
96694
+ xMin = xLen * yFracUp / 2,
96695
+ xMax = xLen - xMin;
96696
+ newPointData.x0 = Math.max(Math.min(newPointData.x0, xMax), xMin);
96697
+ newPointData.x1 = Math.max(Math.min(newPointData.x1, xMax), xMin);
96698
+ return scatterPointData;
96699
+ }
96700
+
96701
+ var cdi = newPointData.cd[newPointData.index];
96674
96702
96675
96703
newPointData.a = cdi.a;
96676
96704
newPointData.b = cdi.b;
@@ -96867,7 +96895,7 @@ function makeContourProjAttr(axLetter) {
96867
96895
dflt: false,
96868
96896
description: [
96869
96897
'Determines whether or not these contour lines are projected',
96870
- 'on the', axLetter, 'axis walls .',
96898
+ 'on the', axLetter, 'plane .',
96871
96899
'If `highlight` is set to *true* (the default), the projected',
96872
96900
'lines are shown on hover.',
96873
96901
'If `show` is set to *true*, the projected lines are shown',
0 commit comments