Replies: 1 comment 1 reply
-
|
Not sure, if this the same as #5092, it seems related, however my use case seems a bit more basic? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I'm experimenting with embedding one notebook (let's call it a child) into another notebook (let's call it the parent) using the App API.
Now I'm wondering how reactivity is supposed to work within the child and across child and parent.
I have created some rather minimal notebooks to explain the issue. The child notebook has one cell with a slider and a second cell with a markdown referencing that value. When I drag the slider, the markdown cell updates as expected. The parent notebook imports the child notebook, calls
await app.embed()and uses the result'soutputto display it in the parent.I'm now interacting with the child output from within the parent. When I move the slider, the value in the output of the second cell of the embedded child notebook does not update. This startled me as I was kind of expecting data flow and cell execution to still work within the child? That's my main question here. Is this supposed to work as I expected it or not, i.e. should the second cell from the child notebook update itself when the slider is dragged?
I also tried some interaction with the parent notebook. I can display the same slider from the child in the parent notebook (
result.defs.get("slider")) and dragging either updates the other. I can also display the slider value (result.defs.get("slider").value). At first the value there didn't reflect updates to either of the sliders, however I noticed the documentation says this:So I added a reference to
appin that cell and as a result the value updates when the slider is dragged.I recorded videos. This is the child working as expected:
child.mp4
This is the parent. Notice how the value in the last cell of the parent cell does update, but in the child (in the line below the pointer dragging the slider), the text keeps saying "the slider value is 1 at the moment":
parent.mp4
Here's the code for reference:
child.py
parent.py
Beta Was this translation helpful? Give feedback.
All reactions