Replies: 1 comment 1 reply
-
Sounds like you might want to send the message once the reactive flush is complete? https://shiny.posit.co/py/api/core/Session.html#shiny.session.Session.on_flushed |
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.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to create a graph visualizer with py-shiny. PyShiny computes a value, a third-party library visualizes it. The challenge is to delay the visualization until the content is complete.
I am using a custom message sender in my computation once the value is computed:
await session.send_custom_message("trigger", 1)
coupled to
Everything works basically, the problem being only that the content that my javascript sees is always a generation cycle behind. The trigger runs before the element is updated.
If I manually delay the function call by 250ms it works, but it feels a bad design to just wait on page without knowing how long.
Is there a way to trigger my function once the page has bene updated reactively.
Beta Was this translation helpful? Give feedback.
All reactions