bokeh.document.util¶
Provide ancillary utility functions useful for manipulating Bokeh documents.
-
compute_patch_between_json
(from_json, to_json)[source]¶ Compute a JSON diff between a two Bokeh document states.
Note
This function is used to send changes that happened between calls to
show()
andpush_notebook()
and will be removed when a better implementation based on the Bokeh protocol is available.Parameters: - from_json (
JSON
) – JSON representing a “starting” Bokeh document state - to_json (
JSON
) – JSON representing a “final” Bokeh document state
- Returns
JSON
- from_json (
-
initialize_references_json
(references_json, references, setter=None)[source]¶ Given a JSON representation of the models in a graph, and new model objects, set the properties on the models from the JSON
Parameters: - references_json (
JSON
) – JSON specifying attributes and values to initialize new model objects with. - references (dict[str, Model]) –
A dictionary mapping model IDs to newly created (but not yet initialized) Bokeh models.
This is an “out” parameter. The values it contains will be modified in-place.
- setter (ClientSession or ServerSession or None, optional) –
This is used to prevent “boomerang” updates to Bokeh apps. (default: None)
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.
- references_json (