1 6
from bokeh.core.properties import Any
2 6
from bokeh.models.layouts import HTMLBox
3

4

5 6
class IPyWidget(HTMLBox):
6

7 6
    bundle = Any()
8

9 6
    def __init__(self, widget, **kwargs):
10 0
        from ipywidgets import embed, Widget
11 0
        super().__init__(**kwargs)
12 0
        spec = widget.get_view_spec()
13 0
        state = Widget.get_manager_state(widgets=[])
14 0
        state["state"] = embed.dependency_state([widget], drop_defaults=True)
15 0
        self.bundle = dict(spec=spec, state=state)

Read our documentation on viewing source code .

Loading