Bokeh.models.tools API

http://bokeh.pydata.org/en/latest/docs/reference/models/tools.html
Pan/Drag class Drag(**kwargs)
Click/Tap class Tap(**kwargs)
Scroll/Pinch class Scroll(**kwargs)[source]
Actions class Action(**kwargs)[source]
Inspectors class Inspection(**kwargs)
以上类都继承于bokeh.models.tools.Tool

Pan/Drag

class BoxSelectTool(**kwargs)

属性&方法类型描述
callbackInstance ( Callback )在选取结束后回调函数
dimensionsEnum ( Dimensions )选取的维度(height,width,both)
namesList ( String )A list of names to query for. If set, only renderers that have a matching value for their name attribute will be used
overlayInstance ( BoxAnnotation )在选取区域里注释,选取过程的区域的样式设置
renderersList ( Instance ( Renderer ) )An explicit list of renderers to hit test again. If unset, defaults to all renderers on a plot.
select_every_mousemoveBoolWhether a selection computation should happen on every mouse event, or only once, when the selection region is completed. Default: False

class BoxZoomTool(**kwargs)

属性&方法类型描述
dimensionsEnum ( Dimensions )选取的维度(height,width,both)
match_aspectBoolWhether the box zoom region should be restricted to have the same aspect ratio as the plot region.
overlayInstance ( BoxAnnotation )A shaded annotation drawn to indicate the selection region.

class LassoSelectTool(**kwargs)

属性&方法类型描述
callbackInstance ( Callback )
namesList ( String )
overlayInstance ( PolyAnnotation )
renderersList ( Instance ( Renderer ) )
select_every_mousemoveBool

class PanTool(**kwargs)

属性&方法类型描述
dimensionsEnum ( Dimensions )

class ResizeTool(**kwargs)

调整整个窗口的大小

Click/Tap

class Tap(**kwargs)

class PolySelectTool(**kwargs)

属性&方法类型描述
namesList ( String )
overlayInstance ( PolyAnnotation )
renderersList ( Instance ( Renderer ) )

class TapTool(**kwargs)

属性&方法类型描述
behaviorEnum ( Enumeration(select, inspect) )
callbackInstance ( Callback )
namesList ( String )
renderersList ( Instance ( Renderer ) )

Scroll/Pinch

class WheelPanTool(**kwargs)

属性&方法类型描述
dimensionEnum ( Dimension )

class WheelZoomTool(**kwargs)

属性&方法类型描述
dimensionsEnum ( Dimensions )

Actions

class UndoTool(**kwargs)

class RedoTool(**kwargs)

class ResetTool(**kwargs)

属性&方法类型描述
reset_sizeBool

class HelpTool(**kwargs)[source]

属性&方法类型描述
help_tooltipStringTooltip displayed when hovering over the help icon.
redirectStringSite to be redirected through upon click.

class SaveTool(**kwargs)

class ZoomInTool(**kwargs)

属性&方法类型描述
dimensionsEnum ( Dimensions )
factorPercent

class ZoomOutTool(**kwargs)

属性&方法类型描述
dimensionsEnum ( Dimensions )
factorPercent

Inspectors

class CrosshairTool(**kwargs)

属性&方法类型描述
dimensionsEnum ( Dimensions )选取的维度(height,width,both)
line_alphaFloat设置十字线的透明度
line_colorColor设置十字线的颜色,可以用CSS样式的颜色名字,也可以是RGB(A) hex value,也可是RGB(A)的元组表示
line_widthFloat设置线的宽度

class HoverTool(**kwargs)

属性&方法类型描述
anchorEnum ( Anchor )If point policy is set to “snap_to_data”, anchor defines the attachment point of a tooltip. The default is to attach to the center of a glyph.
attachmentEnum ( Enumeration(horizontal, vertical) )Whether tooltip’s arrow should appear in the horizontal or vertical dimension.
callbackInstance ( Callback )A callback to run in the browser whenever the input’s value changes.分别被Index和Geometry触发
formattersDict ( String , Enum ( TooltipFieldFormatter ) )指定列的类型,三种可选,”numeral”/”datetime”/”printf”
line_policyEnum ( Enumeration(prev, next, nearest, interp, none) )When showing tooltips for lines, designates whether the tooltip position should be the “previous” or “next” points on the line, the “nearest” point to the current mouse position, or “interpolate” along the line to the current mouse position.
modeEnum ( Enumeration(mouse, hline, vline) )设置坐标单个显示或双显示
namesList ( String )
point_policyEnum ( Enumeration(snap_to_data, follow_mouse, none) )
renderersList ( Instance ( Renderer ) )
show_arrowBool
tooltipsEither ( String , List ( Tuple ( String , String ) ) )指定显示的文字

tooltips数据有两种方式,第一种是”$”符,只要是展示图形坐标。另一种是”@列名”符展示数据框的列数据。这里可以直接用pandas。”{}“可以用来格式化显示

$描述
$index数据的索引
$x数据空间的x坐标
$y数据空间的y坐标
$sx屏幕x坐标
$sy屏幕y坐标
$color

Tool

class Tool(**kwargs)

bokeh.model.Model

属性&方法类型描述
plotInstance ( Plot )

class ToolEvents(**kwargs)

bokeh.model.Model

属性&方法类型描述
geometriesList ( Dict ( String , Any ) )

class ToolbarBase(**kwargs)

bokeh.models.layouts.LayoutDOM

属性&方法类型描述
logoEnum ( Enumeration(normal, grey) )设置logo
toolsList ( Instance ( Tool ) )

class Toolbar(**kwargs)

bokeh.models.tools.ToolbarBase

属性&方法类型描述
active_dragEither ( Auto , Instance ( Drag ) )
active_inspectEither ( Auto , Instance ( Inspection ), Seq ( Instance ( Inspection ) ) )
active_scrollEither ( Auto , Instance ( Scroll ) )
active_tapEither ( Auto , Instance ( Tap ) )

class ToolbarBox(*args, **kwargs)

bokeh.models.layouts.Box

属性&方法类型描述
logoEnum ( Enumeration(normal, grey) )
merge_toolsBool
toolbar_locationEnum ( Location )
toolsList ( Instance ( Tool ) )
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值