Document how or support bidirectional .link in Python between objects
I very often have use cases where I have
- two widgets
- a widget and a Parameterized class
- two Parameterized classes
with parameters I would like to .link bidirectionally.
Now I can see that the Overview Documentation states I can link objects bidirectionally.

But I don't see that any in the documentation. I would have expected an example in the Python links using the link method.
So I always find work arounds and more cumbersome methods to do this.
Solution
Document or support bidirectional .link
Additional Context
- The
.jslinksupports this. - Maybe it's a
paramthing that you should be able to link two parameters in Python generally? - I also inspected the
Reactive.linkmethod and cannot see that bidirectional linking is supported. panel.Paramsets up bidirectional communication between a parameter and a widget which is so useful.- I will start to develop and use Panel objects that don't render to anything (currently a hidden Div) but that I use for linking from .js client side to Python side. Currently I inherit from a widget because I don't know better. I would like to be able to link bidirectionally from these objects to parameters on Parameterized classes as well.
I'm a bit confused, here's the doc string for Reactive.link:
def link(self, target, callbacks=None, bidirectional=False, **links):
"""
Links the parameters on this object to attributes on another
object in Python. Supports two modes, either specify a mapping
between the source and target object parameters as keywords or
provide a dictionary of callbacks which maps from the source
parameter to a callback which is triggered when the parameter
changes.
Arguments
---------
target: object
The target object of the link.
callbacks: dict
Maps from a parameter in the source object to a callback.
bidirectional: boolean
Whether to link source and target bi-directionally
**links: dict
Maps between parameters on this object to the parameters
on the supplied object.
"""
Were you looking at an old version?
Maybe. Or maybe I just looked at the code without understanding it.
I still think the Panel web docs should contain an example though.
And maybe linking any parameters bidirectionally should be supported by Param?