Skip to content

Commit bfaf905

Browse files
committed
Simplify rehover calling slightly
1 parent 7df021e commit bfaf905

File tree

3 files changed

+5
-19
lines changed

3 files changed

+5
-19
lines changed

src/plot_api/plot_api.js

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -348,12 +348,9 @@ Plotly.plot = function(gd, data, layout, config) {
348348
drawAxes,
349349
drawData,
350350
finalDraw,
351+
Plots.rehover
351352
];
352353

353-
if(gd._fullLayout._rehover) {
354-
seq.push(function() { Plots.rehover(gd); });
355-
}
356-
357354
Lib.syncOrAsync(seq, gd);
358355

359356
// even if everything we did was synchronous, return a promise
@@ -1216,9 +1213,7 @@ Plotly.restyle = function restyle(gd, astr, val, traces) {
12161213
if(flags.docolorbars) seq.push(subroutines.doColorBars);
12171214
}
12181215

1219-
if(gd._fullLayout._rehover) {
1220-
seq.push(function() { Plots.rehover(gd); });
1221-
}
1216+
seq.push(Plots.rehover);
12221217

12231218
Queue.add(gd,
12241219
restyle, [gd, specs.undoit, specs.traces],
@@ -1737,9 +1732,7 @@ Plotly.relayout = function relayout(gd, astr, val) {
17371732
if(flags.docamera) seq.push(subroutines.doCamera);
17381733
}
17391734

1740-
if(gd._fullLayout._rehover) {
1741-
seq.push(function() { Plots.rehover(gd); });
1742-
}
1735+
seq.push(Plots.rehover);
17431736

17441737
Queue.add(gd,
17451738
relayout, [gd, specs.undoit],
@@ -2141,9 +2134,7 @@ Plotly.update = function update(gd, traceUpdate, layoutUpdate, traces) {
21412134
if(relayoutFlags.doCamera) seq.push(subroutines.doCamera);
21422135
}
21432136

2144-
if(gd._fullLayout._rehover) {
2145-
seq.push(function() { Plots.rehover(gd); });
2146-
}
2137+
seq.push(Plots.rehover);
21472138

21482139
Queue.add(gd,
21492140
update, [gd, restyleSpecs.undoit, relayoutSpecs.undoit, restyleSpecs.traces],

src/plots/cartesian/graph_interact.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ fx.init = function(gd) {
129129

130130
gd._fullLayout._rehover();
131131

132-
fx.hover(gd, evt, subplot);
133132
fullLayout._lasthover = maindrag;
134133
fullLayout._hoversubplot = subplot;
135134
};

src/plots/plots.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1934,11 +1934,7 @@ plots.transition = function(gd, data, layout, traces, frameOpts, transitionOpts)
19341934
}
19351935
}
19361936

1937-
function rehover() {
1938-
plots.rehover(gd);
1939-
}
1940-
1941-
var seq = [plots.previousPromises, interruptPreviousTransitions, prepareTransitions, rehover, executeTransitions];
1937+
var seq = [plots.previousPromises, interruptPreviousTransitions, prepareTransitions, plots.rehover, executeTransitions];
19421938

19431939
var transitionStarting = Lib.syncOrAsync(seq, gd);
19441940

0 commit comments

Comments
 (0)