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, allow_refs=False, class_=<class ‘dict’>, default={}, label=’Args’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1500bb110>)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, allow_refs=False, class_=<class ‘dict’>, label=’Code’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1500b9090>)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: 'JSLinkTarget' | None = 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(allow_refs=False, default=False, label=’Bidirectional’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1479ec190>)Whether to link source and target in both directions.
properties
= param.Dict(allow_refs=False, class_=<class ‘dict’>, default={}, label=’Properties’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1500d1d10>)A dictionary mapping between source specification to target specification.