Warning
This documentation is for an old version of IPython. You can find docs for newer versions here.
Module: html.widgets.widget_link
¶
Link and DirectionalLink classes.
Propagate changes between widgets on the javascript side
3 Classes¶
-
class
IPython.html.widgets.widget_link.
WidgetTraitTuple
(**kwargs)¶ Bases:
IPython.utils.traitlets.Tuple
Traitlet for validating a single (Widget, ‘trait_name’) pair
-
__init__
(*traits, default_value=None, allow_none=True, **medatata)¶
-
-
class
IPython.html.widgets.widget_link.
Link
(widgets, **kwargs)¶ Bases:
IPython.html.widgets.widget.Widget
Link Widget
one trait: widgets, a list of (widget, ‘trait_name’) tuples which should be linked in the frontend.
-
__init__
(widgets, **kwargs)¶
-
-
class
IPython.html.widgets.widget_link.
DirectionalLink
(source, targets, **kwargs)¶ Bases:
IPython.html.widgets.widget.Widget
A directional link
source: a (Widget, ‘trait_name’) tuple for the source trait targets: one or more (Widget, ‘trait_name’) tuples that should be updated when the source trait changes.
-
__init__
(source, targets, **kwargs)¶
-
2 Functions¶
-
IPython.html.widgets.widget_link.
jslink
(*args)¶ Link traits from different widgets together on the frontend so they remain in sync.
Parameters: *args : two or more (Widget, ‘trait_name’) tuples that should be kept in sync. Examples
>>> c = link((widget1, 'value'), (widget2, 'value'), (widget3, 'value'))
-
IPython.html.widgets.widget_link.
jsdlink
(source, *targets)¶ Link the trait of a source widget with traits of target widgets in the frontend.
Parameters: source : a (Widget, ‘trait_name’) tuple for the source trait
*targets : one or more (Widget, ‘trait_name’) tuples that should be updated
when the source trait changes.
Examples
>>> c = dlink((src_widget, 'value'), (tgt_widget1, 'value'), (tgt_widget2, 'value'))