Skip to content

Commit 3b5fab8

Browse files
committed
Set proper cursor for scattergl mode
1 parent d1b812b commit 3b5fab8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/plots/gl2d/scene2d.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,11 +525,23 @@ proto.updateTraces = function(fullData, calcData) {
525525
};
526526

527527
proto.updateFx = function(dragmode) {
528+
// switch to svg interactions in lasso/select mode
528529
if(dragmode === 'lasso' || dragmode === 'select') {
529530
this.mouseContainer.style['pointer-events'] = 'none';
530531
} else {
531532
this.mouseContainer.style['pointer-events'] = 'auto';
532533
}
534+
535+
// set proper cursor
536+
if(dragmode === 'pan') {
537+
this.mouseContainer.style.cursor = 'move';
538+
}
539+
else if(dragmode === 'zoom') {
540+
this.mouseContainer.style.cursor = 'crosshair';
541+
}
542+
else {
543+
this.mouseContainer.style.cursor = null;
544+
}
533545
};
534546

535547
proto.emitPointAction = function(nextSelection, eventType) {

0 commit comments

Comments
 (0)