BokehJS BoxZoomTool 默认情况下始终处于活动状态,即使设置为 active: false
在bokehjs 2.4.2中,即使在添加工具时将活动> active
属性设置为 false
时,BoxZoomTool始终处于活动状态。
const box_zoom = new Bokeh.BoxZoomTool({
active: false,
});
plot.add_tools(box_zoom);
使用其他工具,例如 freehandDrawTool
,默认情况下该工具不活跃,并且活动
属性不被忽略。
默认情况下,如何添加boxzoomtool而不活跃?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
BoxZoomTool没有参数
活动
,因此在示例中忽略了关键字。要设置活动的工具,请查看此文档。
在您的情况下,行
p.toolbar.active_drag = none
可以做到这一点,它停用了所有pan/drag tools
,并且您只能在其上进行。此行接受
“ auto”
,无
或pan/drag
的实例。python示例
这可以适应JS。
The BoxZoomTool has no parameter
active
, therefor the keyword is ignored in your example.To set tools active, please check out this documentation.
In your case the line
p.toolbar.active_drag = None
does the trick, which deactivates allpan/drag tools
, and you have only on off it.This line accepts
"auto"
,None
or an instance ofpan/drag
.Python Example
This can be adapted to JS.