Open axil opened 1 year ago
There is a potential workaround for the "single document" error:
doc = Document()
doc.add_root(p)
doc.add_root(radio)
ipw.VBox([
BokehModel(p),
ipw.HBox([
BokehModel(radio),
label,
]),
])
This way p
and radio
will share a document and BokehModel
will not attempt to attach a new one under such setup. However, that only solves part of the problem. The other issue is that each BokehModel(...)
is an independent embedding point, which is currently undefined behavior when using the same document. Consider each BokehModel(...)
as if calling show()
multiple times with the same document. However, I have some ideas how this could be alleviated.
@mattpap Yes, it helps with the ownership issue. Yet this code displays both widgets twice and generates the following error
for every model (a total of 8 times). Do you know how to deal with it?
The following code that intermixes two BokehModel instances with an ipywidget instance
generates the following error:
Supposedly the problem is with
jupyter_bokeh
becauseworks fine.
It is similar to #154, and I understand that
is a workaround, but this trick is not always possible, for example, it is not possible for the following layout:
and the main difference from issue 154 is that I don't understand which model is being 'shared' here.