Skip to content

Commit e246331

Browse files
committed
1.14.1
1 parent 3262692 commit e246331

File tree

7 files changed

+91
-35
lines changed

7 files changed

+91
-35
lines changed

dist/plotly-geo-assets.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-with-meta.js

+40-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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 = {
6070460704
var 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
6071060710
exports.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

8383183833
function 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',

dist/plotly.js

+39-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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
@@ -60280,7 +60280,7 @@ exports.svgAttrs = {
6028060280
var Plotly = require('./plotly');
6028160281

6028260282
// package version injected by `npm run preprocess`
60283-
exports.version = '1.14.0';
60283+
exports.version = '1.14.1';
6028460284

6028560285
// plot api
6028660286
exports.plot = Plotly.plot;
@@ -82930,9 +82930,9 @@ proto.initInteractions = function() {
8293082930
Plotly.relayout(gd, attrs);
8293182931
}
8293282932

82933-
dragElement.init(dragOptions);
82934-
8293582933
// finally, set up hover and click
82934+
// these event handlers must already be set before dragElement.init
82935+
// so it can stash them and override them.
8293682936
dragger.onmousemove = function(evt) {
8293782937
fx.hover(gd, evt, _this.id);
8293882938
gd._fullLayout._lasthover = dragger;
@@ -82948,6 +82948,8 @@ proto.initInteractions = function() {
8294882948
dragger.onclick = function(evt) {
8294982949
fx.click(gd, evt);
8295082950
};
82951+
82952+
dragElement.init(dragOptions);
8295182953
};
8295282954

8295382955
function removeZoombox(gd) {
@@ -88192,15 +88194,15 @@ function plotOne(gd, plotinfo, cd) {
8819288194

8819388195
image3.enter().append('svg:image').attr({
8819488196
xmlns: xmlnsNamespaces.svg,
88195-
'xlink:href': canvas.toDataURL('image/png'),
8819688197
preserveAspectRatio: 'none'
8819788198
});
8819888199

8819988200
image3.attr({
8820088201
height: imageHeight,
8820188202
width: imageWidth,
8820288203
x: left,
88203-
y: top
88204+
y: top,
88205+
'xlink:href': canvas.toDataURL('image/png')
8820488206
});
8820588207

8820688208
image3.exit().remove();
@@ -91888,6 +91890,11 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) {
9188891890
}
9188991891

9189091892
if(inside) {
91893+
// constrain ymin/max to the visible plot, so the label goes
91894+
// at the middle of the piece you can see
91895+
ymin = Math.max(ymin, 0);
91896+
ymax = Math.min(ymax, ya._length);
91897+
9189191898
// find the overall left-most and right-most points of the
9189291899
// polygon(s) we're inside at their combined vertical midpoint.
9189391900
// This is where we will draw the hover label.
@@ -91909,6 +91916,10 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) {
9190991916
}
9191091917
}
9191191918

91919+
// constrain xmin/max to the visible plot now too
91920+
xmin = Math.max(xmin, 0);
91921+
xmax = Math.min(xmax, xa._length);
91922+
9191291923
// get only fill or line color for the hover color
9191391924
var color = Color.defaultLine;
9191491925
if(Color.opacity(trace.fillcolor)) color = trace.fillcolor;
@@ -95193,12 +95204,29 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) {
9519395204
var scatterPointData = scatterHover(pointData, xval, yval, hovermode);
9519495205
if(!scatterPointData || scatterPointData[0].index === false) return;
9519595206

95196-
// if hovering on a fill, we don't show any point data so the label is
95197-
// unchanged from what scatter gives us.
95198-
if(scatterPointData[0].index === undefined) return scatterPointData;
95207+
var newPointData = scatterPointData[0];
9519995208

95200-
var newPointData = scatterPointData[0],
95201-
cdi = newPointData.cd[newPointData.index];
95209+
// if hovering on a fill, we don't show any point data so the label is
95210+
// unchanged from what scatter gives us - except that it needs to
95211+
// be constrained to the trianglular plot area, not just the rectangular
95212+
// area defined by the synthetic x and y axes
95213+
// TODO: in some cases the vertical middle of the shape is not within
95214+
// the triangular viewport at all, so the label can become disconnected
95215+
// from the shape entirely. But calculating what portion of the shape
95216+
// is actually visible, as constrained by the diagonal axis lines, is not
95217+
// so easy and anyway we lost the information we would have needed to do
95218+
// this inside scatterHover.
95219+
if(newPointData.index === undefined) {
95220+
var yFracUp = 1 - (newPointData.y0 / pointData.ya._length),
95221+
xLen = pointData.xa._length,
95222+
xMin = xLen * yFracUp / 2,
95223+
xMax = xLen - xMin;
95224+
newPointData.x0 = Math.max(Math.min(newPointData.x0, xMax), xMin);
95225+
newPointData.x1 = Math.max(Math.min(newPointData.x1, xMax), xMin);
95226+
return scatterPointData;
95227+
}
95228+
95229+
var cdi = newPointData.cd[newPointData.index];
9520295230

9520395231
newPointData.a = cdi.a;
9520495232
newPointData.b = cdi.b;

dist/plotly.min.js

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "plotly.js",
3-
"version": "1.14.0",
3+
"version": "1.14.1",
44
"description": "The open source javascript graphing library that powers plotly",
55
"license": "MIT",
66
"main": "./lib/index.js",

src/assets/geo_assets.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ var saneTopojson = require('sane-topojson');
1212

1313

1414
// package version injected by `npm run preprocess`
15-
exports.version = '1.14.0';
15+
exports.version = '1.14.1';
1616

1717
exports.topojson = saneTopojson;

src/core.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
var Plotly = require('./plotly');
1616

1717
// package version injected by `npm run preprocess`
18-
exports.version = '1.14.0';
18+
exports.version = '1.14.1';
1919

2020
// plot api
2121
exports.plot = Plotly.plot;

0 commit comments

Comments
 (0)