Problem description
I want tools xwheel_zoom,xwheel_pan active at the same time: xwheel_zoom upon vertical (regular) scrolling and xwheel_pan upon horizontal scrolling.
TradingView scrolls this way, for example. Most touchpads support horizontal scrolling, and there are mice available with 2+ scroll wheels ...
It would be a small productivity boost not to need to switch active_scroll tool manually.
Feature description
from bokeh.plotting import figure, show
p = figure(title="Want: xzoom on v-scroll, xpan on h-scroll",
tools='xwheel_zoom,xwheel_pan',
active_scroll='xwheel_zoom,h-xwheel_pan') # <-- proposed new syntax 😅
p.scatter([1, 2, 3, 4, 5], [2, 5, 8, 2, 7], size=20)
show(p)
Potential alternatives
The alternative would be to use modifiers= (untested), but would be neat if horizontal scrolling worked out of the box.
(EDIT: Can't even quite get a .modifiers example to work. 🤔)
Additional information
The code presently considers WheelEvent.deltaY only:
|
export function getDeltaY(event: WheelEvent) { |
|
let deltaY = -event.deltaY |
|
|
|
if (event.target instanceof HTMLElement) { |
|
switch (event.deltaMode) { |
|
case event.DOM_DELTA_LINE: |
|
deltaY *= lineHeight(event.target) |
|
break |
|
case event.DOM_DELTA_PAGE: |
|
deltaY *= pageHeight(event.target) |
|
break |
|
} |
|
} |
|
|
|
return deltaY |
Instead it could use, and scroll in the direction of, whichever delta (
deltaY,
deltaX) was greater, or both proportionally.
Problem description
I want tools
xwheel_zoom,xwheel_panactive at the same time:xwheel_zoomupon vertical (regular) scrolling andxwheel_panupon horizontal scrolling.TradingView scrolls this way, for example. Most touchpads support horizontal scrolling, and there are mice available with 2+ scroll wheels ...
It would be a small productivity boost not to need to switch
active_scrolltool manually.Feature description
Potential alternatives
The alternative would be to use
modifiers=(untested), but would be neat if horizontal scrolling worked out of the box.(EDIT: Can't even quite get a
.modifiersexample to work. 🤔)Additional information
The code presently considers
WheelEvent.deltaYonly:bokeh/bokehjs/src/lib/core/ui_events.ts
Line 701 in fde1500
bokeh/bokehjs/src/lib/core/util/wheel.ts
Lines 24 to 38 in fde1500
Instead it could use, and scroll in the direction of, whichever delta (
deltaY,deltaX) was greater, or both proportionally.