Skip to content

Commit f749a4a

Browse files
authored
Merge pull request #7018 from eiriklv/eiriklv/fix-gl-traces-disappering-when-zoom-pan
Fix issue where scattergl traces disappear while zooming or panning
2 parents 7ffcdd7 + 4b8d0c9 commit f749a4a

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

draftlogs/7018_fix.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Fix displaying scattergl traces while zooming or panning (regression introduced in 2.26.0) [[#7018](https://github.com/plotly/plotly.js/pull/7018)],
2+
with thanks to @eiriklv for the contribution!

src/plots/cartesian/dragbox.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -886,14 +886,11 @@ function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {
886886
ya = sp.yaxis;
887887

888888
if(sp._scene) {
889-
var xrng = Lib.simpleMap(xa.range, xa.r2l);
890-
var yrng = Lib.simpleMap(ya.range, ya.r2l);
891-
892889
if(xa.limitRange) xa.limitRange();
893890
if(ya.limitRange) ya.limitRange();
894891

895-
xrng = xa.range;
896-
yrng = ya.range;
892+
var xrng = Lib.simpleMap(xa.range, xa.r2l);
893+
var yrng = Lib.simpleMap(ya.range, ya.r2l);
897894

898895
sp._scene.update({range: [xrng[0], yrng[0], xrng[1], yrng[1]]});
899896
}

0 commit comments

Comments
 (0)