Skip to content

Commit db76a49

Browse files
committed
store and reuse hovermode get result
1 parent 7cc4dfc commit db76a49

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/plot_api/plot_api.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1739,13 +1739,14 @@ function _restyle(gd, aobj, traces) {
17391739
// swap hovermode if set to "compare x/y data"
17401740
if(ai === 'orientationaxes') {
17411741
var hovermode = nestedProperty(gd.layout, 'hovermode');
1742-
if(hovermode.get() === 'x') {
1742+
var h = hovermode.get();
1743+
if(h === 'x') {
17431744
hovermode.set('y');
1744-
} else if(hovermode.get() === 'y') {
1745+
} else if(h === 'y') {
17451746
hovermode.set('x');
1746-
} else if(hovermode.get() === 'x unified') {
1747+
} else if(h === 'x unified') {
17471748
hovermode.set('y unified');
1748-
} else if(hovermode.get() === 'y unified') {
1749+
} else if(h === 'y unified') {
17491750
hovermode.set('x unified');
17501751
}
17511752
}

0 commit comments

Comments
 (0)