Provide events that represent various changes to Bokeh Documents.
These events are used internally to signal changes to Documents. For information about user-facing (e.g. UI or tool) events, see the reference for bokeh.events.
ColumnDataChangedEvent
A concrete event representing efficiently replacing all existing data for a ColumnDataSource
ColumnDataSource
__init__
document (Document) – A Bokeh document that is to be updated.
column_source (ColumnDataSource) –
cols (list[str]) – optional explicit list of column names to update. If None, all columns will be updated (default: None)
setter (ClientSession or ServerSession or None, optional) –
This is used to prevent “boomerang” updates to Bokeh apps. (default: None)
See DocumentChangedEvent for more details.
DocumentChangedEvent
callback_invoker (callable, optional) – A callable that will invoke any Model callbacks that should be executed in response to the change that triggered this event. (default: None)
dispatch
Dispatch handling of this event to a receiver.
This method will invoke receiver._column_data_changed if it exists.
receiver._column_data_changed
generate
Create a JSON representation of this event suitable for sending to clients.
{ 'kind' : 'ColumnDataChanged' 'column_source' : <reference to a CDS> 'new' : <new data to steam to column_source> 'cols' : <specific columns to update> }
references (dict[str, Model]) –
If the event requires references to certain models in order to function, they may be collected here.
This is an “out” parameter. The values it contains will be modified in-place.
buffers (set) –
If the event needs to supply any additional Bokeh protocol buffers, they may be added to this set.
ColumnsPatchedEvent
A concrete event representing efficiently applying data patches to a ColumnDataSource
column_source (ColumnDataSource) – The data source to apply patches to.
patches (list) –
This method will invoke receiver._columns_patched if it exists.
receiver._columns_patched
{ 'kind' : 'ColumnsPatched' 'column_source' : <reference to a CDS> 'patches' : <patches to apply to column_source> }
ColumnsStreamedEvent
A concrete event representing efficiently streaming new data to a ColumnDataSource
column_source (ColumnDataSource) – The data source to stream new data to.
data (dict or DataFrame) –
New data to stream.
If a DataFrame, will be stored as {c: df[c] for c in df.columns}
{c: df[c] for c in df.columns}
rollover (int) – A rollover limit. If the data source columns exceed this limit, earlier values will be discarded to maintain the column length under the limit.
This method will invoke receiver._columns_streamed if it exists.
receiver._columns_streamed
{ 'kind' : 'ColumnsStreamed' 'column_source' : <reference to a CDS> 'data' : <new data to steam to column_source> 'rollover' : <rollover limit> }
Base class for all internal events representing a change to a Bokeh Document.
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.
combine
This method will invoke receiver._document_changed if it exists.
receiver._document_changed
DocumentPatchedEvent
A Base class for events that represent updating Bokeh Models and their properties.
This method will invoke receiver._document_patched if it exists.
receiver._document_patched
Sub-classes must implement this method.
MessageSentEvent
ModelChangedEvent
A concrete event representing updating an attribute and value of a specific Bokeh Model.
This is the “standard” way of updating most Bokeh model attributes. For special casing situations that can optimized (e.g. streaming, etc.), a hint may be supplied that overrides normal mechanisms.
hint
model (Model) – A Model to update
attr (str) – The name of the attribute to update on the model.
old (object) – The old value of the attribute
new (object) – The new value of the attribute
serializable_new (object) – A serialized (JSON) version of the new value. It may be None if a hint is supplied.
None
hint (DocumentPatchedEvent, optional) – When appropriate, a secondary event may be supplied that modifies the normal update process. For example, in order to stream or patch data more efficiently than the standard update mechanism.
This method will invoke receiver._document_model_changed if it exists.
receiver._document_model_changed
RootAddedEvent
A concrete event representing a change to add a new Model to a Document’s collection of “root” models.
model (Model) – The Bokeh Model to add as a Document root.
{ 'kind' : 'RootAdded' 'title' : <reference to a Model> }
RootRemovedEvent
A concrete event representing a change to remove an existing Model from a Document’s collection of “root” models.
model (Model) – The Bokeh Model to remove as a Document root.
{ 'kind' : 'RootRemoved' 'title' : <reference to a Model> }
SessionCallbackAdded
A concrete event representing a change to add a new callback (e.g. periodic, timeout, or “next tick”) to a Document.
callback (SessionCallback) – The callback to add
This method will invoke receiver._session_callback_added if it exists.
receiver._session_callback_added
SessionCallbackRemoved
A concrete event representing a change to remove an existing callback (e.g. periodic, timeout, or “next tick”) from a Document.
callback (SessionCallback) – The callback to remove
This method will invoke receiver._session_callback_removed if it exists.
receiver._session_callback_removed
TitleChangedEvent
A concrete event representing a change to the title of a Bokeh Document.
title (str) – The new title to set on the Document
{ 'kind' : 'TitleChanged' 'title' : <new title to set> }