Skip to content

Commit a837a63

Browse files
committed
Embed full state on initial render
1 parent ff9bc36 commit a837a63

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

ipywidgets_bokeh/src/manager.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ export class WidgetManager extends HTMLManager {
155155

156156
try {
157157
const models = await this.set_state(state)
158+
await this.set_state({...state, state: state.full_state as any})
158159
for (const model of models) {
159160
if (this._model_objs.has(model.model_id))
160161
continue

ipywidgets_bokeh/widget.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class IPyWidget(LayoutDOM):
3535
def __init__(self, *, widget: Widget, **kwargs):
3636
super().__init__(**kwargs)
3737
spec = widget.get_view_spec()
38-
state = Widget.get_manager_state(widgets=[])
38+
state = Widget.get_manager_state(widgets=[widget])
39+
state["full_state"] = state["state"]
3940
state["state"] = embed.dependency_state([widget], drop_defaults=True)
4041
self.bundle = dict(spec=spec, state=state)

0 commit comments

Comments
 (0)