Skip to content

Need help with updating plotly figure #159

Answered by Aran-Fey
Nachsh asked this question in Q&A
Discussion options

You must be logged in to vote

Rio components only update automatically if you assign a new value to one of the component's attributes. There's no way for Rio to know that you've changed the data in your dataframe, so you must explicitly tell it to rebuild your component by calling self.force_refresh():

async def update_plotly_fig(self):
        self.data['y'] = np.random.randint(0,4,4)
        await self.force_refresh()

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Nachsh
Comment options

Answer selected by Nachsh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants