Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2e63d1e

Browse files
committed
enfore a stricter distance req for gl3d click events
1 parent bd960c9 commit 2e63d1e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/plots/gl3d/scene.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,15 @@ function render(scene) {
112112
});
113113
}
114114

115-
var eventType = (selection.buttons) ? 'plotly_click' : 'plotly_hover',
116-
eventData = makeEventData(xVal, yVal, zVal, trace, selection);
115+
var eventData = makeEventData(xVal, yVal, zVal, trace, selection);
116+
117+
if(selection.buttons && selection.distance < 5) {
118+
scene.graphDiv.emit('plotly_click', eventData);
119+
}
120+
else {
121+
scene.graphDiv.emit('plotly_hover', eventData);
122+
}
117123

118-
scene.graphDiv.emit(eventType, eventData);
119124
oldEventData = eventData;
120125
}
121126
else {

0 commit comments

Comments
 (0)