Skip to content

Commit b33e4dd

Browse files
committed
rename to hoversubplots
1 parent 8dff1a3 commit b33e4dd

File tree

7 files changed

+21
-21
lines changed

7 files changed

+21
-21
lines changed

Diff for: draftlogs/6947_add.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
- Add `layout.hoverthrough` to enable hover effects across multiple cartesian suplots sharing one axis [[#6947](https://github.com/plotly/plotly.js/pull/6947)]
1+
- Add `layout.hoversubplots` to enable hover effects across multiple cartesian suplots sharing one axis [[#6947](https://github.com/plotly/plotly.js/pull/6947)]

Diff for: src/components/fx/hover.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ function _hover(gd, evt, subplot, noHoverEvent, eventTarget) {
261261
var spId;
262262

263263
var fullLayout = gd._fullLayout;
264-
var hoverthrough = fullLayout.hoverthrough;
264+
var hoversubplots = fullLayout.hoversubplots;
265265
var plots = fullLayout._plots || [];
266266
var plotinfo = plots[subplot];
267267
var hasCartesian = fullLayout._has('cartesian');
@@ -270,7 +270,7 @@ function _hover(gd, evt, subplot, noHoverEvent, eventTarget) {
270270
var hovermodeHasX = (hovermode || '').charAt(0) === 'x';
271271
var hovermodeHasY = (hovermode || '').charAt(0) === 'y';
272272

273-
if(hasCartesian && (hovermodeHasX || hovermodeHasY) && hoverthrough === 'axis') {
273+
if(hasCartesian && (hovermodeHasX || hovermodeHasY) && hoversubplots === 'axis') {
274274
var subplotsLength = subplots.length;
275275
for(var p = 0; p < subplotsLength; p++) {
276276
spId = subplots[p];
@@ -570,7 +570,7 @@ function _hover(gd, evt, subplot, noHoverEvent, eventTarget) {
570570
hoverLayer: fullLayout._hoverlayer,
571571

572572
// options for splom when hovering on same axis
573-
hoverthrough: hoverthrough,
573+
hoversubplots: hoversubplots,
574574
gd: gd
575575
});
576576

@@ -692,7 +692,7 @@ function _hover(gd, evt, subplot, noHoverEvent, eventTarget) {
692692
gd._spikepoints = newspikepoints;
693693

694694
var sortHoverData = function() {
695-
if(!hoverthrough) {
695+
if(!hoversubplots) {
696696
hoverData.sort(function(d1, d2) { return d1.distance - d2.distance; });
697697
}
698698

Diff for: src/components/fx/hovermode_defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ module.exports = function handleHoverModeDefaults(layoutIn, layoutOut) {
1212
}
1313

1414
coerce('clickmode');
15-
coerce('hoverthrough');
15+
coerce('hoversubplots');
1616
return coerce('hovermode');
1717
};

Diff for: src/components/fx/layout_attributes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ module.exports = {
7878
'If false, hover interactions are disabled.'
7979
].join(' ')
8080
},
81-
hoverthrough: {
81+
hoversubplots: {
8282
valType: 'enumerated',
8383
values: ['axis', false],
8484
dflt: false,

Diff for: src/traces/splom/hover.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function hoverPoints(pointData, xval, yval, hovermode, opts) {
1616

1717
var points = _hoverPoints(pointData, xpx, ypx);
1818

19-
if((hovermodeHasX || hovermodeHasY) && opts.hoverthrough === 'axis') {
19+
if((hovermodeHasX || hovermodeHasY) && opts.hoversubplots === 'axis') {
2020
var _xpx = points[0]._xpx;
2121
var _ypx = points[0]._ypx;
2222

@@ -53,7 +53,7 @@ function hoverPoints(pointData, xval, yval, hovermode, opts) {
5353
return points;
5454
}
5555

56-
function _hoverPoints(pointData, xpx, ypx, hoverthroughX, hoverthroughY) {
56+
function _hoverPoints(pointData, xpx, ypx, hoversubplotsX, hoversubplotsY) {
5757
var cd = pointData.cd;
5858
var trace = cd[0].trace;
5959
var scene = pointData.scene;
@@ -83,9 +83,9 @@ function _hoverPoints(pointData, xpx, ypx, hoverthroughX, hoverthroughY) {
8383
var dist = 0;
8484

8585
var pick = false;
86-
if(hoverthroughX) {
86+
if(hoversubplotsX) {
8787
if(dx === 0) pick = true;
88-
} else if(hoverthroughY) {
88+
} else if(hoversubplotsY) {
8989
if(dy === 0) pick = true;
9090
} else {
9191
dist = Math.sqrt(dx * dx + dy * dy);

Diff for: test/jasmine/tests/hover_label_test.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -2380,12 +2380,12 @@ describe('hover info on stacked subplots', function() {
23802380
});
23812381
});
23822382

2383-
describe('hover on subplots when hoverthrough is set to *axis* and x hovermodes', function() {
2383+
describe('hover on subplots when hoversubplots is set to *axis* and x hovermodes', function() {
23842384
'use strict';
23852385

23862386
var mock = {
23872387
layout: {
2388-
hoverthrough: 'axis',
2388+
hoversubplots: 'axis',
23892389
hovermode: 'x',
23902390
grid: {
23912391
rows: 3,
@@ -2423,7 +2423,7 @@ describe('hover on subplots when hoverthrough is set to *axis* and x hovermodes'
24232423

24242424
afterEach(destroyGraphDiv);
24252425

2426-
it('hovermode: *x* | *x unified* with hoverthrough: *axis*', function() {
2426+
it('hovermode: *x* | *x unified* with hoversubplots: *axis*', function() {
24272427
var pos = 0;
24282428
var subplot = 'xy';
24292429
Lib.clearThrottle();
@@ -2468,12 +2468,12 @@ describe('hover on subplots when hoverthrough is set to *axis* and x hovermodes'
24682468
});
24692469
});
24702470

2471-
describe('hover on subplots when hoverthrough is set to *axis* and y hovermodes', function() {
2471+
describe('hover on subplots when hoversubplots is set to *axis* and y hovermodes', function() {
24722472
'use strict';
24732473

24742474
var mock = {
24752475
layout: {
2476-
hoverthrough: 'axis',
2476+
hoversubplots: 'axis',
24772477
hovermode: 'y',
24782478
grid: {
24792479
rows: 2,
@@ -2511,7 +2511,7 @@ describe('hover on subplots when hoverthrough is set to *axis* and y hovermodes'
25112511

25122512
afterEach(destroyGraphDiv);
25132513

2514-
it('hovermode: *y* | *y unified* with hoverthrough: *axis*', function() {
2514+
it('hovermode: *y* | *y unified* with hoversubplots: *axis*', function() {
25152515
var pos = 0;
25162516
var subplot = 'xy';
25172517
Lib.clearThrottle();
@@ -2556,12 +2556,12 @@ describe('hover on subplots when hoverthrough is set to *axis* and y hovermodes'
25562556
});
25572557
});
25582558

2559-
describe('splom hover on subplots when hoverthrough is set to *axis* and (x|y) hovermodes', function() {
2559+
describe('splom hover on subplots when hoversubplots is set to *axis* and (x|y) hovermodes', function() {
25602560
'use strict';
25612561

25622562
var mock = Lib.extendDeep({}, splomLogMock);
25632563
mock.layout.hovermode = 'x';
2564-
mock.layout.hoverthrough = 'axis';
2564+
mock.layout.hoversubplots = 'axis';
25652565

25662566
var gd;
25672567

@@ -2572,7 +2572,7 @@ describe('splom hover on subplots when hoverthrough is set to *axis* and (x|y) h
25722572

25732573
afterEach(destroyGraphDiv);
25742574

2575-
it('splom hoverthrough: *axis*', function() {
2575+
it('splom hoversubplots: *axis*', function() {
25762576
Lib.clearThrottle();
25772577
Plotly.Fx.hover(gd, {x: 200, y: 200}, 'xy');
25782578
expect(gd._hoverdata.length).toBe(3);

Diff for: test/plot-schema.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2634,7 +2634,7 @@
26342634
"y unified"
26352635
]
26362636
},
2637-
"hoverthrough": {
2637+
"hoversubplots": {
26382638
"description": "Determines expansion of hover effects to other subplots If *axis*, points from subplots linked to the axis of hovered subplot are included. Has an effect only when `hovermode` is set to *x*, *x unified*, *y* or *y unified*.",
26392639
"dflt": false,
26402640
"editType": "none",

0 commit comments

Comments
 (0)