fibomat.default_backends.measuretool module#

class fibomat.default_backends.measuretool.MeasureTool(*args, **kwargs)[source]#

Bases: InspectTool

A measure tool for bokeh plots!

measure_unit#
line_dash#
line_color#

Acceptable values are:

  • any of the named CSS colors, e.g 'green', 'indigo'

  • RGB(A) hex strings, e.g., '#FF0000', '#44444444'

  • CSS4 color strings, e.g., 'rgba(255, 0, 127, 0.6)', 'rgb(0 127 0 / 1.0)', or 'hsl(60deg 100% 50% / 1.0)'

  • a 3-tuple of integers (r, g, b) between 0 and 255

  • a 4-tuple of (r, g, b, a) where r, g, b are integers between 0 and 255, and a is between 0 and 1

  • a 32-bit unsigned integer using the 0xRRGGBBAA byte order pattern

line_width#
line_alpha#
__init__(**kwargs)#
apply_theme(property_values)#

Apply a set of theme values which will be used rather than defaults, but will not override application-set values.

The passed-in dictionary may be kept around as-is and shared with other instances to save memory (so neither the caller nor the |HasProps| instance should modify it).

Args:

property_values (dict) : theme values to use in place of defaults

Returns:

None

classmethod dataspecs()#

Collect the names of all DataSpec properties on this class.

This method always traverses the class hierarchy and includes properties defined on any parent classes.

Returns:

set[str] : names of DataSpec properties

classmethod dataspecs_with_props()#

Collect a dict mapping the names of all DataSpec properties on this class to the associated properties.

This method always traverses the class hierarchy and includes properties defined on any parent classes.

Returns:

dict[str, DataSpec] : mapping of names and DataSpec properties

description#

A string describing the purpose of this tool. If not defined, an auto-generated description will be used. This description will be typically presented in the user interface as a tooltip.

property document#

The |Document| this model is attached to (can be None)

equals(other)#

Structural equality of models.

Args:

other (HasProps) : the other instance to compare to

Returns:

True, if properties are structurally equal, otherwise False

classmethod from_string(name: str) Tool#

Takes a string and returns a corresponding Tool instance.

property id: str#
js_event_callbacks#

A mapping of event names to lists of CustomJS callbacks.

Typically, rather then modifying this property directly, callbacks should be added using the Model.js_on_event method:

callback = CustomJS(code="console.log('tap event occurred')")
plot.js_on_event('tap', callback)

Link two Bokeh model properties using JavaScript.

This is a convenience method that simplifies adding a CustomJS callback to update one Bokeh model property whenever another changes value.

Args:

attr (str) :

The name of a Bokeh property on this model

other (Model):

A Bokeh model to link to self.attr

other_attr (str) :

The property on other to link together

attr_selector (Union[int, str]) :

The index to link an item in a subscriptable attr

Added in version 1.1

Raises:

ValueError

Examples:

This code with js_link:

select.js_link('value', plot, 'sizing_mode')

is equivalent to the following:

from bokeh.models import CustomJS
select.js_on_change('value',
    CustomJS(args=dict(other=plot),
             code="other.sizing_mode = this.value"
    )
)

Additionally, to use attr_selector to attach the left side of a range slider to a plot’s x_range:

range_slider.js_link('value', plot.x_range, 'start', attr_selector=0)

which is equivalent to:

from bokeh.models import CustomJS
range_slider.js_on_change('value',
    CustomJS(args=dict(other=plot.x_range),
             code="other.start = this.value[0]"
    )
)
js_on_change(event, *callbacks)#

Attach a CustomJS callback to an arbitrary BokehJS model event.

On the BokehJS side, change events for model properties have the form "change:property_name". As a convenience, if the event name passed to this method is also the name of a property on the model, then it will be prefixed with "change:" automatically:

# these two are equivalent
source.js_on_change('data', callback)
source.js_on_change('change:data', callback)

However, there are other kinds of events that can be useful to respond to, in addition to property change events. For example to run a callback whenever data is streamed to a ColumnDataSource, use the "stream" event on the source:

source.js_on_change('streaming', callback)
js_on_event(event: str | Type[Event], *callbacks) None#
js_property_callbacks#

A mapping of attribute names to lists of CustomJS callbacks, to be set up on BokehJS side when the document is created.

Typically, rather then modifying this property directly, callbacks should be added using the Model.js_on_change method:

callback = CustomJS(code="console.log('stuff')")
plot.x_range.js_on_change('start', callback)
layout(side, plot)#
classmethod lookup(name: str, *, raises: bool = True) PropertyDescriptor | None#

Find the PropertyDescriptor for a Bokeh property on a class, given the property name.

Args:

name (str) : name of the property to search for raises (bool) : whether to raise or return None if missing

Returns:

PropertyDescriptor : descriptor for property named name

model_class_reverse_map = {'AbstractButton': <class 'bokeh.models.widgets.buttons.AbstractButton'>, 'AbstractGroup': <class 'bokeh.models.widgets.groups.AbstractGroup'>, 'AbstractIcon': <class 'bokeh.models.widgets.icons.AbstractIcon'>, 'AbstractSlider': <class 'bokeh.models.widgets.sliders.AbstractSlider'>, 'ActionTool': <class 'bokeh.models.tools.ActionTool'>, 'AdaptiveTicker': <class 'bokeh.models.tickers.AdaptiveTicker'>, 'AjaxDataSource': <class 'bokeh.models.sources.AjaxDataSource'>, 'AllLabels': <class 'bokeh.models.labeling.AllLabels'>, 'Annotation': <class 'bokeh.models.annotations.Annotation'>, 'AnnularWedge': <class 'bokeh.models.glyphs.AnnularWedge'>, 'Annulus': <class 'bokeh.models.glyphs.Annulus'>, 'Arc': <class 'bokeh.models.glyphs.Arc'>, 'Arrow': <class 'bokeh.models.annotations.Arrow'>, 'ArrowHead': <class 'bokeh.models.arrow_heads.ArrowHead'>, 'AutocompleteInput': <class 'bokeh.models.widgets.inputs.AutocompleteInput'>, 'AvgAggregator': <class 'bokeh.models.widgets.tables.AvgAggregator'>, 'Axis': <class 'bokeh.models.axes.Axis'>, 'BBoxTileSource': <class 'bokeh.models.tiles.BBoxTileSource'>, 'Band': <class 'bokeh.models.annotations.Band'>, 'BasicTickFormatter': <class 'bokeh.models.formatters.BasicTickFormatter'>, 'BasicTicker': <class 'bokeh.models.tickers.BasicTicker'>, 'Bezier': <class 'bokeh.models.glyphs.Bezier'>, 'BinnedTicker': <class 'bokeh.models.tickers.BinnedTicker'>, 'BooleanFilter': <class 'bokeh.models.filters.BooleanFilter'>, 'BooleanFormatter': <class 'bokeh.models.widgets.tables.BooleanFormatter'>, 'Box': <class 'bokeh.models.layouts.Box'>, 'BoxAnnotation': <class 'bokeh.models.annotations.BoxAnnotation'>, 'BoxEditTool': <class 'bokeh.models.tools.BoxEditTool'>, 'BoxSelectTool': <class 'bokeh.models.tools.BoxSelectTool'>, 'BoxZoomTool': <class 'bokeh.models.tools.BoxZoomTool'>, 'Button': <class 'bokeh.models.widgets.buttons.Button'>, 'ButtonGroup': <class 'bokeh.models.widgets.groups.ButtonGroup'>, 'CDSView': <class 'bokeh.models.sources.CDSView'>, 'Callback': <class 'bokeh.models.callbacks.Callback'>, 'CanvasTexture': <class 'bokeh.models.textures.CanvasTexture'>, 'CategoricalAxis': <class 'bokeh.models.axes.CategoricalAxis'>, 'CategoricalColorMapper': <class 'bokeh.models.mappers.CategoricalColorMapper'>, 'CategoricalMapper': <class 'bokeh.models.mappers.CategoricalMapper'>, 'CategoricalMarkerMapper': <class 'bokeh.models.mappers.CategoricalMarkerMapper'>, 'CategoricalPatternMapper': <class 'bokeh.models.mappers.CategoricalPatternMapper'>, 'CategoricalScale': <class 'bokeh.models.scales.CategoricalScale'>, 'CategoricalTickFormatter': <class 'bokeh.models.formatters.CategoricalTickFormatter'>, 'CategoricalTicker': <class 'bokeh.models.tickers.CategoricalTicker'>, 'CellEditor': <class 'bokeh.models.widgets.tables.CellEditor'>, 'CellFormatter': <class 'bokeh.models.widgets.tables.CellFormatter'>, 'CheckboxButtonGroup': <class 'bokeh.models.widgets.groups.CheckboxButtonGroup'>, 'CheckboxEditor': <class 'bokeh.models.widgets.tables.CheckboxEditor'>, 'CheckboxGroup': <class 'bokeh.models.widgets.groups.CheckboxGroup'>, 'Circle': <class 'bokeh.models.glyphs.Circle'>, 'ColorBar': <class 'bokeh.models.annotations.ColorBar'>, 'ColorMapper': <class 'bokeh.models.mappers.ColorMapper'>, 'ColorPicker': <class 'bokeh.models.widgets.inputs.ColorPicker'>, 'Column': <class 'bokeh.models.layouts.Column'>, 'ColumnDataSource': <class 'bokeh.models.sources.ColumnDataSource'>, 'ColumnarDataSource': <class 'bokeh.models.sources.ColumnarDataSource'>, 'CompositeTicker': <class 'bokeh.models.tickers.CompositeTicker'>, 'ConnectedXYGlyph': <class 'bokeh.models.glyph.ConnectedXYGlyph'>, 'ContinuousAxis': <class 'bokeh.models.axes.ContinuousAxis'>, 'ContinuousColorMapper': <class 'bokeh.models.mappers.ContinuousColorMapper'>, 'ContinuousScale': <class 'bokeh.models.scales.ContinuousScale'>, 'ContinuousTicker': <class 'bokeh.models.tickers.ContinuousTicker'>, 'CrosshairTool': <class 'bokeh.models.tools.CrosshairTool'>, 'CumSum': <class 'bokeh.models.expressions.CumSum'>, 'CustomAction': <class 'bokeh.models.tools.CustomAction'>, 'CustomJS': <class 'bokeh.models.callbacks.CustomJS'>, 'CustomJSExpr': <class 'bokeh.models.expressions.CustomJSExpr'>, 'CustomJSFilter': <class 'bokeh.models.filters.CustomJSFilter'>, 'CustomJSHover': <class 'bokeh.models.tools.CustomJSHover'>, 'CustomJSTransform': <class 'bokeh.models.transforms.CustomJSTransform'>, 'CustomLabelingPolicy': <class 'bokeh.models.labeling.CustomLabelingPolicy'>, 'DataAnnotation': <class 'bokeh.models.annotations.DataAnnotation'>, 'DataCube': <class 'bokeh.models.widgets.tables.DataCube'>, 'DataModel': <class 'bokeh.model.DataModel'>, 'DataRange': <class 'bokeh.models.ranges.DataRange'>, 'DataRange1d': <class 'bokeh.models.ranges.DataRange1d'>, 'DataRenderer': <class 'bokeh.models.renderers.DataRenderer'>, 'DataSource': <class 'bokeh.models.sources.DataSource'>, 'DataTable': <class 'bokeh.models.widgets.tables.DataTable'>, 'DateEditor': <class 'bokeh.models.widgets.tables.DateEditor'>, 'DateFormatter': <class 'bokeh.models.widgets.tables.DateFormatter'>, 'DatePicker': <class 'bokeh.models.widgets.inputs.DatePicker'>, 'DateRangeSlider': <class 'bokeh.models.widgets.sliders.DateRangeSlider'>, 'DateSlider': <class 'bokeh.models.widgets.sliders.DateSlider'>, 'DatetimeAxis': <class 'bokeh.models.axes.DatetimeAxis'>, 'DatetimeTickFormatter': <class 'bokeh.models.formatters.DatetimeTickFormatter'>, 'DatetimeTicker': <class 'bokeh.models.tickers.DatetimeTicker'>, 'DaysTicker': <class 'bokeh.models.tickers.DaysTicker'>, 'Div': <class 'bokeh.models.widgets.markups.Div'>, 'Dodge': <class 'bokeh.models.transforms.Dodge'>, 'Drag': <class 'bokeh.models.tools.Drag'>, 'Dropdown': <class 'bokeh.models.widgets.buttons.Dropdown'>, 'EdgesAndLinkedNodes': <class 'bokeh.models.graphs.EdgesAndLinkedNodes'>, 'EdgesOnly': <class 'bokeh.models.graphs.EdgesOnly'>, 'EditTool': <class 'bokeh.models.tools.EditTool'>, 'Ellipse': <class 'bokeh.models.glyphs.Ellipse'>, 'EqHistColorMapper': <class 'bokeh.models.mappers.EqHistColorMapper'>, 'Expression': <class 'bokeh.models.expressions.Expression'>, 'FactorRange': <class 'bokeh.models.ranges.FactorRange'>, 'Figure': <class 'bokeh.plotting.figure.Figure'>, 'FileInput': <class 'bokeh.models.widgets.inputs.FileInput'>, 'FillGlyph': <class 'bokeh.models.glyph.FillGlyph'>, 'Filter': <class 'bokeh.models.filters.Filter'>, 'FixedTicker': <class 'bokeh.models.tickers.FixedTicker'>, 'FreehandDrawTool': <class 'bokeh.models.tools.FreehandDrawTool'>, 'FuncTickFormatter': <class 'bokeh.models.formatters.FuncTickFormatter'>, 'GMap': <class 'bokeh.plotting.gmap.GMap'>, 'GMapOptions': <class 'bokeh.models.map_plots.GMapOptions'>, 'GMapPlot': <class 'bokeh.models.map_plots.GMapPlot'>, 'GeoJSONDataSource': <class 'bokeh.models.sources.GeoJSONDataSource'>, 'GestureTool': <class 'bokeh.models.tools.GestureTool'>, 'Glyph': <class 'bokeh.models.glyph.Glyph'>, 'GlyphRenderer': <class 'bokeh.models.renderers.GlyphRenderer'>, 'GraphHitTestPolicy': <class 'bokeh.models.graphs.GraphHitTestPolicy'>, 'GraphRenderer': <class 'bokeh.models.renderers.GraphRenderer'>, 'Grid': <class 'bokeh.models.grids.Grid'>, 'GridBox': <class 'bokeh.models.layouts.GridBox'>, 'Group': <class 'bokeh.models.widgets.groups.Group'>, 'GroupFilter': <class 'bokeh.models.filters.GroupFilter'>, 'GroupingInfo': <class 'bokeh.models.widgets.tables.GroupingInfo'>, 'GuideRenderer': <class 'bokeh.models.renderers.GuideRenderer'>, 'HArea': <class 'bokeh.models.glyphs.HArea'>, 'HBar': <class 'bokeh.models.glyphs.HBar'>, 'HTMLBox': <class 'bokeh.models.layouts.HTMLBox'>, 'HTMLTemplateFormatter': <class 'bokeh.models.widgets.tables.HTMLTemplateFormatter'>, 'HatchGlyph': <class 'bokeh.models.glyph.HatchGlyph'>, 'HelpTool': <class 'bokeh.models.tools.HelpTool'>, 'HexTile': <class 'bokeh.models.glyphs.HexTile'>, 'HoverTool': <class 'bokeh.models.tools.HoverTool'>, 'Image': <class 'bokeh.models.glyphs.Image'>, 'ImageRGBA': <class 'bokeh.models.glyphs.ImageRGBA'>, 'ImageURL': <class 'bokeh.models.glyphs.ImageURL'>, 'ImageURLTexture': <class 'bokeh.models.textures.ImageURLTexture'>, 'IndexFilter': <class 'bokeh.models.filters.IndexFilter'>, 'InputWidget': <class 'bokeh.models.widgets.inputs.InputWidget'>, 'InspectTool': <class 'bokeh.models.tools.InspectTool'>, 'IntEditor': <class 'bokeh.models.widgets.tables.IntEditor'>, 'Interpolator': <class 'bokeh.models.transforms.Interpolator'>, 'IntersectRenderers': <class 'bokeh.models.selections.IntersectRenderers'>, 'Jitter': <class 'bokeh.models.transforms.Jitter'>, 'Label': <class 'bokeh.models.annotations.Label'>, 'LabelSet': <class 'bokeh.models.annotations.LabelSet'>, 'LabelingPolicy': <class 'bokeh.models.labeling.LabelingPolicy'>, 'LassoSelectTool': <class 'bokeh.models.tools.LassoSelectTool'>, 'LayoutDOM': <class 'bokeh.models.layouts.LayoutDOM'>, 'LayoutProvider': <class 'bokeh.models.graphs.LayoutProvider'>, 'Legend': <class 'bokeh.models.annotations.Legend'>, 'LegendItem': <class 'bokeh.models.annotations.LegendItem'>, 'Line': <class 'bokeh.models.glyphs.Line'>, 'LineEditTool': <class 'bokeh.models.tools.LineEditTool'>, 'LineGlyph': <class 'bokeh.models.glyph.LineGlyph'>, 'LinearAxis': <class 'bokeh.models.axes.LinearAxis'>, 'LinearColorMapper': <class 'bokeh.models.mappers.LinearColorMapper'>, 'LinearInterpolator': <class 'bokeh.models.transforms.LinearInterpolator'>, 'LinearScale': <class 'bokeh.models.scales.LinearScale'>, 'LogAxis': <class 'bokeh.models.axes.LogAxis'>, 'LogColorMapper': <class 'bokeh.models.mappers.LogColorMapper'>, 'LogScale': <class 'bokeh.models.scales.LogScale'>, 'LogTickFormatter': <class 'bokeh.models.formatters.LogTickFormatter'>, 'LogTicker': <class 'bokeh.models.tickers.LogTicker'>, 'MapOptions': <class 'bokeh.models.map_plots.MapOptions'>, 'MapPlot': <class 'bokeh.models.map_plots.MapPlot'>, 'Mapper': <class 'bokeh.models.mappers.Mapper'>, 'Marker': <class 'bokeh.models.glyphs.Marker'>, 'Markup': <class 'bokeh.models.widgets.markups.Markup'>, 'MaxAggregator': <class 'bokeh.models.widgets.tables.MaxAggregator'>, 'Maximum': <class 'bokeh.models.expressions.Maximum'>, 'MeasureTool': <class 'fibomat.default_backends.measuretool.MeasureTool'>, 'MercatorAxis': <class 'bokeh.models.axes.MercatorAxis'>, 'MercatorTickFormatter': <class 'bokeh.models.formatters.MercatorTickFormatter'>, 'MercatorTicker': <class 'bokeh.models.tickers.MercatorTicker'>, 'MercatorTileSource': <class 'bokeh.models.tiles.MercatorTileSource'>, 'MinAggregator': <class 'bokeh.models.widgets.tables.MinAggregator'>, 'Minimum': <class 'bokeh.models.expressions.Minimum'>, 'MonthsTicker': <class 'bokeh.models.tickers.MonthsTicker'>, 'MultiChoice': <class 'bokeh.models.widgets.inputs.MultiChoice'>, 'MultiLine': <class 'bokeh.models.glyphs.MultiLine'>, 'MultiPolygons': <class 'bokeh.models.glyphs.MultiPolygons'>, 'MultiSelect': <class 'bokeh.models.widgets.inputs.MultiSelect'>, 'NoOverlap': <class 'bokeh.models.labeling.NoOverlap'>, 'NodesAndLinkedEdges': <class 'bokeh.models.graphs.NodesAndLinkedEdges'>, 'NodesOnly': <class 'bokeh.models.graphs.NodesOnly'>, 'NormalHead': <class 'bokeh.models.arrow_heads.NormalHead'>, 'NumberEditor': <class 'bokeh.models.widgets.tables.NumberEditor'>, 'NumberFormatter': <class 'bokeh.models.widgets.tables.NumberFormatter'>, 'NumeralTickFormatter': <class 'bokeh.models.formatters.NumeralTickFormatter'>, 'NumericInput': <class 'bokeh.models.widgets.inputs.NumericInput'>, 'OpenHead': <class 'bokeh.models.arrow_heads.OpenHead'>, 'OpenURL': <class 'bokeh.models.callbacks.OpenURL'>, 'Oval': <class 'bokeh.models.glyphs.Oval'>, 'PanTool': <class 'bokeh.models.tools.PanTool'>, 'Panel': <class 'bokeh.models.layouts.Panel'>, 'Paragraph': <class 'bokeh.models.widgets.markups.Paragraph'>, 'PasswordInput': <class 'bokeh.models.widgets.inputs.PasswordInput'>, 'Patch': <class 'bokeh.models.glyphs.Patch'>, 'Patches': <class 'bokeh.models.glyphs.Patches'>, 'PercentEditor': <class 'bokeh.models.widgets.tables.PercentEditor'>, 'Plot': <class 'bokeh.models.plots.Plot'>, 'PointDrawTool': <class 'bokeh.models.tools.PointDrawTool'>, 'PolyAnnotation': <class 'bokeh.models.annotations.PolyAnnotation'>, 'PolyDrawTool': <class 'bokeh.models.tools.PolyDrawTool'>, 'PolyEditTool': <class 'bokeh.models.tools.PolyEditTool'>, 'PolySelectTool': <class 'bokeh.models.tools.PolySelectTool'>, 'PolyTool': <class 'bokeh.models.tools.PolyTool'>, 'PreText': <class 'bokeh.models.widgets.markups.PreText'>, 'PrintfTickFormatter': <class 'bokeh.models.formatters.PrintfTickFormatter'>, 'ProxyToolbar': <class 'bokeh.models.tools.ProxyToolbar'>, 'QUADKEYTileSource': <class 'bokeh.models.tiles.QUADKEYTileSource'>, 'Quad': <class 'bokeh.models.glyphs.Quad'>, 'Quadratic': <class 'bokeh.models.glyphs.Quadratic'>, 'RadioButtonGroup': <class 'bokeh.models.widgets.groups.RadioButtonGroup'>, 'RadioGroup': <class 'bokeh.models.widgets.groups.RadioGroup'>, 'Range': <class 'bokeh.models.ranges.Range'>, 'Range1d': <class 'bokeh.models.ranges.Range1d'>, 'RangeSlider': <class 'bokeh.models.widgets.sliders.RangeSlider'>, 'RangeTool': <class 'bokeh.models.tools.RangeTool'>, 'Ray': <class 'bokeh.models.glyphs.Ray'>, 'Rect': <class 'bokeh.models.glyphs.Rect'>, 'RedoTool': <class 'bokeh.models.tools.RedoTool'>, 'Renderer': <class 'bokeh.models.renderers.Renderer'>, 'ResetTool': <class 'bokeh.models.tools.ResetTool'>, 'Row': <class 'bokeh.models.layouts.Row'>, 'RowAggregator': <class 'bokeh.models.widgets.tables.RowAggregator'>, 'SaveTool': <class 'bokeh.models.tools.SaveTool'>, 'ScalarExpression': <class 'bokeh.models.expressions.ScalarExpression'>, 'Scale': <class 'bokeh.models.scales.Scale'>, 'ScanningColorMapper': <class 'bokeh.models.mappers.ScanningColorMapper'>, 'Scatter': <class 'bokeh.models.glyphs.Scatter'>, 'ScientificFormatter': <class 'bokeh.models.widgets.tables.ScientificFormatter'>, 'Scroll': <class 'bokeh.models.tools.Scroll'>, 'Segment': <class 'bokeh.models.glyphs.Segment'>, 'Select': <class 'bokeh.models.widgets.inputs.Select'>, 'SelectEditor': <class 'bokeh.models.widgets.tables.SelectEditor'>, 'SelectTool': <class 'bokeh.models.tools.SelectTool'>, 'Selection': <class 'bokeh.models.selections.Selection'>, 'SelectionPolicy': <class 'bokeh.models.selections.SelectionPolicy'>, 'ServerSentDataSource': <class 'bokeh.models.sources.ServerSentDataSource'>, 'SingleIntervalTicker': <class 'bokeh.models.tickers.SingleIntervalTicker'>, 'Slider': <class 'bokeh.models.widgets.sliders.Slider'>, 'Slope': <class 'bokeh.models.annotations.Slope'>, 'Spacer': <class 'bokeh.models.layouts.Spacer'>, 'Span': <class 'bokeh.models.annotations.Span'>, 'Spinner': <class 'bokeh.models.widgets.inputs.Spinner'>, 'Stack': <class 'bokeh.models.expressions.Stack'>, 'StaticLayoutProvider': <class 'bokeh.models.graphs.StaticLayoutProvider'>, 'Step': <class 'bokeh.models.glyphs.Step'>, 'StepInterpolator': <class 'bokeh.models.transforms.StepInterpolator'>, 'StringEditor': <class 'bokeh.models.widgets.tables.StringEditor'>, 'StringFormatter': <class 'bokeh.models.widgets.tables.StringFormatter'>, 'SumAggregator': <class 'bokeh.models.widgets.tables.SumAggregator'>, 'TMSTileSource': <class 'bokeh.models.tiles.TMSTileSource'>, 'TableColumn': <class 'bokeh.models.widgets.tables.TableColumn'>, 'TableWidget': <class 'bokeh.models.widgets.tables.TableWidget'>, 'Tabs': <class 'bokeh.models.layouts.Tabs'>, 'Tap': <class 'bokeh.models.tools.Tap'>, 'TapTool': <class 'bokeh.models.tools.TapTool'>, 'TeeHead': <class 'bokeh.models.arrow_heads.TeeHead'>, 'Text': <class 'bokeh.models.glyphs.Text'>, 'TextAnnotation': <class 'bokeh.models.annotations.TextAnnotation'>, 'TextAreaInput': <class 'bokeh.models.widgets.inputs.TextAreaInput'>, 'TextEditor': <class 'bokeh.models.widgets.tables.TextEditor'>, 'TextGlyph': <class 'bokeh.models.glyph.TextGlyph'>, 'TextInput': <class 'bokeh.models.widgets.inputs.TextInput'>, 'TextLikeInput': <class 'bokeh.models.widgets.inputs.TextLikeInput'>, 'Texture': <class 'bokeh.models.textures.Texture'>, 'TickFormatter': <class 'bokeh.models.formatters.TickFormatter'>, 'Ticker': <class 'bokeh.models.tickers.Ticker'>, 'TileRenderer': <class 'bokeh.models.renderers.TileRenderer'>, 'TileSource': <class 'bokeh.models.tiles.TileSource'>, 'TimeEditor': <class 'bokeh.models.widgets.tables.TimeEditor'>, 'Title': <class 'bokeh.models.annotations.Title'>, 'Toggle': <class 'bokeh.models.widgets.buttons.Toggle'>, 'Tool': <class 'bokeh.models.tools.Tool'>, 'Toolbar': <class 'bokeh.models.tools.Toolbar'>, 'ToolbarBase': <class 'bokeh.models.tools.ToolbarBase'>, 'ToolbarBox': <class 'bokeh.models.tools.ToolbarBox'>, 'ToolbarPanel': <class 'bokeh.models.annotations.ToolbarPanel'>, 'Tooltip': <class 'bokeh.models.annotations.Tooltip'>, 'Transform': <class 'bokeh.models.transforms.Transform'>, 'UndoTool': <class 'bokeh.models.tools.UndoTool'>, 'UnionRenderers': <class 'bokeh.models.selections.UnionRenderers'>, 'VArea': <class 'bokeh.models.glyphs.VArea'>, 'VBar': <class 'bokeh.models.glyphs.VBar'>, 'VeeHead': <class 'bokeh.models.arrow_heads.VeeHead'>, 'WMTSTileSource': <class 'bokeh.models.tiles.WMTSTileSource'>, 'WebDataSource': <class 'bokeh.models.sources.WebDataSource'>, 'Wedge': <class 'bokeh.models.glyphs.Wedge'>, 'WheelPanTool': <class 'bokeh.models.tools.WheelPanTool'>, 'WheelZoomTool': <class 'bokeh.models.tools.WheelZoomTool'>, 'Whisker': <class 'bokeh.models.annotations.Whisker'>, 'Widget': <class 'bokeh.models.widgets.widget.Widget'>, 'WidgetBox': <class 'bokeh.models.layouts.WidgetBox'>, 'XYGlyph': <class 'bokeh.models.glyph.XYGlyph'>, 'YearsTicker': <class 'bokeh.models.tickers.YearsTicker'>, 'ZoomInTool': <class 'bokeh.models.tools.ZoomInTool'>, 'ZoomOutTool': <class 'bokeh.models.tools.ZoomOutTool'>}#
name: tp.Union[None, str]#

An arbitrary, user-supplied name for this model.

This name can be useful when querying the document to retrieve specific Bokeh models.

>>> plot.circle([1,2,3], [4,5,6], name="temp")
>>> plot.select(name="temp")
[GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]

Note

No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.

on_change(attr, *callbacks)#

Add a callback on this object to trigger when attr changes.

Args:

attr (str) : an attribute name on this object *callbacks (callable) : callback functions to register

Returns:

None

Example:

widget.on_change('value', callback1, callback2, ..., callback_n)
on_event(event, *callbacks)#

Run callbacks when the specified event occurs on this Model

Not all Events are supported for all Models. See specific Events in bokeh.events for more information on which Models are able to trigger them.

classmethod properties(with_bases=True)#

Collect the names of properties on this class.

This method optionally traverses the class hierarchy and includes properties defined on any parent classes.

Args:
with_bases (bool, optional) :

Whether to include properties defined on parent classes in the results. (default: True)

Returns:

set[str] : property names

classmethod properties_containers()#

Collect the names of all container properties on this class.

This method always traverses the class hierarchy and includes properties defined on any parent classes.

Returns:

set[str] : names of container properties

classmethod properties_with_refs()#

Collect the names of all properties on this class that also have references.

This method always traverses the class hierarchy and includes properties defined on any parent classes.

Returns:

set[str] : names of properties that have references

properties_with_values(*, include_defaults: bool = True, include_undefined: bool = False) Dict[str, Any]#

Collect a dict mapping property names to their values.

This method always traverses the class hierarchy and includes properties defined on any parent classes.

Non-serializable properties are skipped and property values are in “serialized” format which may be slightly different from the values you would normally read from the properties; the intent of this method is to return the information needed to losslessly reconstitute the object instance.

Args:
include_defaults (bool, optional) :

Whether to include properties that haven’t been explicitly set since the object was created. (default: True)

Returns:

dict : mapping from property names to their values

query_properties_with_values(query, *, include_defaults: bool = True, include_undefined: bool = False)#

Query the properties values of |HasProps| instances with a predicate.

Args:
query (callable) :

A callable that accepts property descriptors and returns True or False

include_defaults (bool, optional) :

Whether to include properties that have not been explicitly set by a user (default: True)

Returns:

dict : mapping of property names and values for matching properties

property ref#
references()#

Returns all Models that this object has references to.

classmethod register_alias(name: str, constructor: Callable[[], Tool]) None#
remove_on_change(attr, *callbacks)#

Remove a callback from this object

select(selector)#

Query this object and all of its references for objects that match the given selector.

Args:

selector (JSON-like) :

Returns:

seq[Model]

select_one(selector)#

Query this object and all of its references for objects that match the given selector. Raises an error if more than one object is found. Returns single matching object, or None if nothing is found Args:

selector (JSON-like) :

Returns:

Model

set_from_json(name, json, models=None, setter=None)#

Set a property value on this object from JSON.

Args:

name: (str) : name of the attribute to set

json: (JSON-value) : value to set to the attribute to

models (dict or None, optional) :

Mapping of model ids to models (default: None)

This is needed in cases where the attributes to update also have values that have references.

setter(ClientSession or ServerSession or None, optional) :

This is used to prevent “boomerang” updates to Bokeh apps.

In the context of a Bokeh server application, incoming updates to properties will be annotated with the session that is doing the updating. This value is propagated through any subsequent change notifications that the update triggers. The session can compare the event setter to itself, and suppress any updates that originate from itself.

Returns:

None

set_select(selector, updates)#

Update objects that match a given selector with the specified attribute/value updates.

Args:

selector (JSON-like) : updates (dict) :

Returns:

None

classmethod static_to_serializable(serializer)#
property struct#

A Bokeh protocol “structure” of this model, i.e. a dict of the form:

{
    'type' : << view model name >>
    'id'   : << unique model id >>
}

Additionally there may be a subtype field if this model is a subtype.

subscribed_events#

List of events that are subscribed to by Python callbacks. This is the set of events that will be communicated from BokehJS back to Python for this model.

syncable: bool#

Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to False may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.

Note

Setting this property to False will prevent any on_change() callbacks on this object from triggering. However, any JS-side callbacks will still work.

tags: tp.List[tp.Any]#

An optional list of arbitrary, user-supplied values to attach to this model.

This data can be useful when querying the document to retrieve specific Bokeh models:

>>> r = plot.circle([1,2,3], [4,5,6])
>>> r.tags = ["foo", 10]
>>> plot.select(tags=['foo', 10])
[GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]

Or simply a convenient way to attach any necessary metadata to a model that can be accessed by CustomJS callbacks, etc.

Note

No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason.

themed_values()#

Get any theme-provided overrides.

Results are returned as a dict from property name to value, or None if no theme overrides any values for this instance.

Returns:

dict or None

to_json(include_defaults)#

Returns a dictionary of the attributes of this object, containing only “JSON types” (string, number, boolean, none, dict, list).

References to other objects are serialized as “refs” (just the object ID and type info), so the deserializer will need to separately have the full attributes of those other objects.

There’s no corresponding from_json() because to deserialize an object is normally done in the context of a Document (since the Document can resolve references).

For most purposes it’s best to serialize and deserialize entire documents.

Args:
include_defaults (bool)whether to include attributes

that haven’t been changed from the default

to_json_string(include_defaults)#

Returns a JSON string encoding the attributes of this object.

References to other objects are serialized as references (just the object ID and type info), so the deserializer will need to separately have the full attributes of those other objects.

There’s no corresponding from_json_string() because to deserialize an object is normally done in the context of a Document (since the Document can resolve references).

For most purposes it’s best to serialize and deserialize entire documents.

Args:
include_defaults (bool)whether to include attributes

that haven’t been changed from the default

to_serializable(serializer)#
toggleable#

Whether an on/off toggle button should appear in the toolbar for this inspection tool. If False, the viewers of a plot will not be able to toggle the inspector on or off using the toolbar.

trigger(attr, old, new, hint=None, setter=None)#
unapply_theme()#

Remove any themed values and restore defaults.

Returns:

None

update(**kwargs)#

Updates the object’s properties from the given keyword arguments.

Returns:

None

Examples:

The following are equivalent:

from bokeh.models import Range1d

r = Range1d

# set properties individually:
r.start = 10
r.end = 20

# update properties together:
r.update(start=10, end=20)
update_from_json(json_attributes, models=None, setter=None)#

Updates the object’s properties from a JSON attributes dictionary.

Args:

json_attributes: (JSON-dict) : attributes and values to update

models (dict or None, optional) :

Mapping of model ids to models (default: None)

This is needed in cases where the attributes to update also have values that have references.

setter(ClientSession or ServerSession or None, optional) :

This is used to prevent “boomerang” updates to Bokeh apps.

In the context of a Bokeh server application, incoming updates to properties will be annotated with the session that is doing the updating. This value is propagated through any subsequent change notifications that the update triggers. The session can compare the event setter to itself, and suppress any updates that originate from itself.

Returns:

None