11/**
2- * plotly.js v1.14.0
2+ * plotly.js v1.14.1
33* Copyright 2012-2016, Plotly, Inc.
44* All rights reserved.
55* Licensed under the MIT license
@@ -60704,7 +60704,7 @@ exports.svgAttrs = {
6070460704var Plotly = require('./plotly');
6070560705
6070660706// package version injected by `npm run preprocess`
60707- exports.version = '1.14.0 ';
60707+ exports.version = '1.14.1 ';
6070860708
6070960709// plot api
6071060710exports.plot = Plotly.plot;
@@ -83808,9 +83808,9 @@ proto.initInteractions = function() {
8380883808 Plotly.relayout(gd, attrs);
8380983809 }
8381083810
83811- dragElement.init(dragOptions);
83812-
8381383811 // 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.
8381483814 dragger.onmousemove = function(evt) {
8381583815 fx.hover(gd, evt, _this.id);
8381683816 gd._fullLayout._lasthover = dragger;
@@ -83826,6 +83826,8 @@ proto.initInteractions = function() {
8382683826 dragger.onclick = function(evt) {
8382783827 fx.click(gd, evt);
8382883828 };
83829+
83830+ dragElement.init(dragOptions);
8382983831};
8383083832
8383183833function removeZoombox(gd) {
@@ -89255,15 +89257,15 @@ function plotOne(gd, plotinfo, cd) {
8925589257
8925689258 image3.enter().append('svg:image').attr({
8925789259 xmlns: xmlnsNamespaces.svg,
89258- 'xlink:href': canvas.toDataURL('image/png'),
8925989260 preserveAspectRatio: 'none'
8926089261 });
8926189262
8926289263 image3.attr({
8926389264 height: imageHeight,
8926489265 width: imageWidth,
8926589266 x: left,
89266- y: top
89267+ y: top,
89268+ 'xlink:href': canvas.toDataURL('image/png')
8926789269 });
8926889270
8926989271 image3.exit().remove();
@@ -93250,6 +93252,11 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) {
9325093252 }
9325193253
9325293254 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+
9325393260 // find the overall left-most and right-most points of the
9325493261 // polygon(s) we're inside at their combined vertical midpoint.
9325593262 // This is where we will draw the hover label.
@@ -93271,6 +93278,10 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) {
9327193278 }
9327293279 }
9327393280
93281+ // constrain xmin/max to the visible plot now too
93282+ xmin = Math.max(xmin, 0);
93283+ xmax = Math.min(xmax, xa._length);
93284+
9327493285 // get only fill or line color for the hover color
9327593286 var color = Color.defaultLine;
9327693287 if(Color.opacity(trace.fillcolor)) color = trace.fillcolor;
@@ -96665,12 +96676,29 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) {
9666596676 var scatterPointData = scatterHover(pointData, xval, yval, hovermode);
9666696677 if(!scatterPointData || scatterPointData[0].index === false) return;
9666796678
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];
9667196680
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];
9667496702
9667596703 newPointData.a = cdi.a;
9667696704 newPointData.b = cdi.b;
@@ -96867,7 +96895,7 @@ function makeContourProjAttr(axLetter) {
9686796895 dflt: false,
9686896896 description: [
9686996897 'Determines whether or not these contour lines are projected',
96870- 'on the', axLetter, 'axis walls .',
96898+ 'on the', axLetter, 'plane .',
9687196899 'If `highlight` is set to *true* (the default), the projected',
9687296900 'lines are shown on hover.',
9687396901 'If `show` is set to *true*, the projected lines are shown',
0 commit comments