Deselect Bokeh tools by default

霸气de小男生 提交于 2019-12-07 16:14:04

问题


When Bokeh tools are available, one is always selected by default (normally "pan"). Is there a way to have all tools be deselected while still making them available? This way the reader is less likely to mess up the plot by accident, especially on a small mobile device.


回答1:


As of Bokeh 0.12 or so, it is possible to configure which tools are active:

# configure so that no drag tools are active
plot.toolbar.active_drag = None

# configure so that Bokeh chooses what (if any) scroll tool is active
plot.toolbar.active_scroll = "auto"

# configure so that a specific PolySelect tap tool is active
plot.toolbar.active_tap = poly_select

# configure so that a sequence of specific inspect tools are active
# note: this only works for inspect tools
plot.toolbar.active_inspect = [hover_tool, crosshair_tool]


来源:https://stackoverflow.com/questions/37639353/deselect-bokeh-tools-by-default

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!