-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make scrollZoom speed configurable #1085
Comments
cc #2041 |
Is there are progress here? |
As a quick hack one can adjust manually the hardcoded normalisation factor in var r=-e.deltaY;if(isFinite(r)||(r=e.wheelDelta/10),isFinite(r)){var n,i=Math.exp(-Math.min(Math.max(r,-20),20)/200),... I replaced |
If using in Javascript, I solved this by overtaking the wheel event (capture phase) and emitted my own event with modified deltaY. This works on cartesian plots, I did not check others. function handler(event)
{
if (!event.isTrusted) return;
event.stopPropagation();
var newEv = new WheelEvent('wheel', {
clientX: event.clientX,
clientY:event.clientY,
deltaY:event.deltaY*2,
});
event.target.dispatchEvent(newEv);
} |
What is the element that you attached the 'handler'? I tried on 'document' and plot element and does not work.... |
I attached it to plot element but on wheel event in capture mode. |
Thank you! I've missed the 'capture mode' from the initial post. Now it worked. |
What's the 'capture mode' you guys talking about? Could you share the script of this part, please? |
Use the same element, Plotly.react is called on. So if you initialize plot with Plotly.react(plotEl, data, layout, options) you should do something like this: The last true, means capture events. For explanation on capture events, search for "event bubbling capturing" |
Thanks a lot, @mitja-p. I'm using angular-plotly.js, based on your suggestion, I did it this way, and it works now. (in case somebody using angular-plotly.js needs it in the future. ) <plotly-plot *ngIf="isPlotDataReady" [data]="graph.data" [layout]="graph.layout"> ngAfterViewInit() { public handler(event: any) {
} |
has any progress been made on this issue? I am experiencing super tiny zoom steps |
I am also interested in this feature. It seems that the default plotly figure zoom speed in a jupyter notebook launched within vscode is very slow, so I would like to be able to make it faster. |
Interrested too, I have been searching for a topic mentioning this and here it is |
+1 zooming is so slow in a jupyter notebook in VSCode that it is not usable at all. |
Although we are in the JS repo here (because of top google result), also want to express my support for configurable zoom speed in plotly (python). |
I am also experiencing the same slow unusable scroll speed within VSCode. Any progress exposing the zoom speed through the Python API would be amazing. |
Also here with the same very slow scroll speed within VS Code. The demos hosted on Plotly.com are much better. |
Here is another post for this issue and it contains videos to demonstrate how slow the zooming is. I don't think this issue is a feature request, but rather a bug report, because the slow zooming speed heavily interferes the proper usage of zooming. Can anyone update the tag? |
I find scrollZoom speed painfully slow. Making this configurable may mean propagating a scale factor to some other gl modules or something, but then again it might just be a simple scalar. Maybe
scrollZoomSpeed
?(Side note: it's not clear to me why
scrollZoom
is camelCased and belongs to config instead of to layout.)I don't think it's entirely straightforward to get the speed itself just right across browsers and system configs, but maybe this is something: http://stackoverflow.com/questions/5527601/normalizing-mousewheel-speed-across-browsers#answer-30134826
The text was updated successfully, but these errors were encountered: