Provide ancillary utility functions useful for manipulating Bokeh documents.

initialize_references_json(references_json: List[ReferenceJson], references: Mapping[ID, Model], setter: Setter | None = None) 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

  • 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.

instantiate_references_json(references_json: List[ReferenceJson], existing_instances: Dict[ID, Model]) Dict[ID, Model][source]#

Given a JSON representation of all the models in a graph, return a dict of new model objects.


references_json (JSON) – JSON specifying new Bokeh models to create


dict[str, Model]

references_json(references: Iterable[Model]) List[ReferenceJson][source]#

Given a list of all models in a graph, return JSON representing them and their properties.


references (seq[Model]) – A list of models to convert to JSON