links Module#
links
Module#
Defines Links which allow declaring links between bokeh properties.
- class panel.links.Callback(source: Reactive, target: JSLinkTarget = None, args: Dict[str, Any] = None, code: Dict[str, str] = None, **params)[source]#
Bases:
Parameterized
A Callback defines some callback to be triggered when a property changes on the source object. A Callback can execute arbitrary Javascript code and will make all objects referenced in the args available in the JS namespace.
args
= param.Dict(allow_None=True, class_=<class ‘dict’>, default={}, label=’Args’)A mapping of names to Python objects. These objects are made available to the callback’s code snippet as the values of named parameters to the callback.
code
= param.Dict(allow_None=True, class_=<class ‘dict’>, label=’Code’)A dictionary mapping from a source specification to a JS code snippet to be executed if the source property changes.
- class panel.links.Link(source: Reactive, target: Optional['JSLinkTarget'] = None, **params)[source]#
Bases:
Callback
A Link defines some connection between a source and target model. It allows defining callbacks in response to some change or event on the source object. Instead a Link directly causes some action to occur on the target, for JS based backends this usually means that a corresponding JS callback will effect some change on the target in response to a change on the source.
A Link must define a source object which is what triggers events, but must not define a target. It is also possible to define bi- directional links between the source and target object.
Parameters inherited from:
panel.links.Callback
: args, codebidirectional
= param.Boolean(bounds=(0, 1), default=False, label=’Bidirectional’)Whether to link source and target in both directions.
properties
= param.Dict(class_=<class ‘dict’>, default={}, label=’Properties’)A dictionary mapping between source specification to target specification.
- init() None #
Registers the Callback
- classmethod register_callback(callback: Type[CallbackGenerator]) None #
Register a LinkCallback providing the implementation for the Link for a particular backend.